Fix compiling with Clang on windows (#6)

This commit is contained in:
Frederick Mills authored and GitHub committed 2024-02-08 12:56:42 +02:00
1 parent 888d971214
commit 9d27180388
1 file changed
+3 -4
+3 -4
View File
@@ -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)