From 9d271803881f467aabfc24593c7dcaeb710fe861 Mon Sep 17 00:00:00 2001 From: Frederick Mills <64277238+MillzyDev@users.noreply.github.com> Date: Thu, 8 Feb 2024 10:56:42 +0000 Subject: [PATCH] Fix compiling with Clang on windows (#6) --- CMakeLists.txt | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 916e548..8744cb6 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -105,7 +105,7 @@ elseif(SYSTEM.Linux) elseif(SYSTEM.Windows) # Statically link UCRT if(NOT DOBBY_DEBUG) - if(COMPILER.Gcc) + if(COMPILER.Gcc OR COMPILER.Clang) add_compile_options(-MT) set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -MT") else() @@ -113,7 +113,7 @@ elseif(SYSTEM.Windows) set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} /MT") endif() else() - if(COMPILER.Gcc) + if(COMPILER.Gcc OR COMPILER.Clang) add_compile_options(-MTd) set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -MTd") else() @@ -137,7 +137,7 @@ elseif(SYSTEM.Windows) if (NearBranch) set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} /export:dobby_enable_near_branch_trampoline /export:dobby_disable_near_branch_trampoline") endif() - elseif(COMPILER.Gcc) + elseif(COMPILER.Gcc OR Compiler.Clang) set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fno-rtti") # Enable unicode, Statically link libgcc/libstdc++ set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -municode") @@ -504,4 +504,3 @@ if(SYSTEM.Darwin) endif() add_subdirectory(example) -