Expanding CMake to other compilers other than MSVC on Windows platform#1251
Expanding CMake to other compilers other than MSVC on Windows platform#1251BoHomola wants to merge 2 commits intogodotengine:masterfrom
Conversation
|
Thank you for looking into this. My understanding is that So we need to detect the specific case of Clang as a MSVC frontend, which as far as I understand means checking the I don't know much about CMake, but this might work: diff --git a/CMakeLists.txt b/CMakeLists.txt
index 0ee99aa..215c719 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -55,7 +55,7 @@ endif()
# Set some helper variables for readability
set( compiler_is_clang "$<OR:$<CXX_COMPILER_ID:AppleClang>,$<CXX_COMPILER_ID:Clang>>" )
set( compiler_is_gnu "$<CXX_COMPILER_ID:GNU>" )
-set( compiler_is_msvc "$<CXX_COMPILER_ID:MSVC>" )
+set( compiler_is_msvc "$<OR:$<CXX_COMPILER_ID:MSVC>,$<CXX_COMPILER_FRONTEND_VARIANT:MSVC>>" )
# Default build type is Debug in the SConstruct
if("${CMAKE_BUILD_TYPE}" STREQUAL "") |
5906866 to
f1ab271
Compare
|
Hello, thank you for your feedback.
If we want to specifically exclude MinGW, then a simple check if WIN and NOT GNU should work. diff --git a/CMakeLists.txt b/CMakeLists.txt
index 0ee99aa..45b9238 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -159,7 +159,7 @@ target_compile_definitions(${PROJECT_NAME} PUBLIC
DEBUG_ENABLED
DEBUG_METHODS_ENABLED
>
- $<${compiler_is_msvc}:
+ $<$<AND:$<BOOL:${WIN32}>,$<NOT:${compiler_is_gnu}>>:
TYPED_METHOD_BIND
>
) |
f1ab271 to
64f0a61
Compare
Co-authored-by: A Thousand Ships <96648715+AThousandShips@users.noreply.github.com>
|
I believe the test you want is |
|
I have submitted #1651 to resolve this, it also uses CXX_COMPILER_FRONTEND_VARIANT and is upto date with the latest changes. |
|
Superseded by #1651 |
#1250