Skip to content

Commit

Permalink
Fix compiling with Clang on windows (#6)
Browse files Browse the repository at this point in the history
  • Loading branch information
MillzyDev authored Feb 8, 2024
1 parent 888d971 commit 9d27180
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -105,15 +105,15 @@ 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()
add_compile_options(/MT)
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()
Expand All @@ -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")
Expand Down Expand Up @@ -504,4 +504,3 @@ if(SYSTEM.Darwin)
endif()

add_subdirectory(example)

0 comments on commit 9d27180

Please sign in to comment.