package An official xmake package repository https://xrepo.xmake.io/
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 

27 lines
1.1 KiB

diff --git a/CMakeLists.txt b/CMakeLists.txt
index af78061..8aba951 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -39,13 +39,15 @@ function(add_security_flags target)
target_compile_options( ${target} PRIVATE -fstack-protector-strong)
endif()
elseif(WIN32)
- target_compile_options( ${target} PRIVATE /GS /DynamicBase)
- if(BUILD_WITH_STATIC_CRT)
- target_compile_options( ${target} PRIVATE "/MT")
- endif()
- if("${CMAKE_SIZEOF_VOID_P}" STREQUAL "4")
- # These options for 32 bit builds only
- target_compile_options( ${target} PRIVATE /SAFESEH /NXCOMPAT )
+ if (MSVC)
+ target_compile_options( ${target} PRIVATE /GS /DynamicBase)
+ if(BUILD_WITH_STATIC_CRT)
+ target_compile_options( ${target} PRIVATE "/MT")
+ endif()
+ if("${CMAKE_SIZEOF_VOID_P}" STREQUAL "4")
+ # These options for 32 bit builds only
+ target_compile_options( ${target} PRIVATE /SAFESEH /NXCOMPAT )
+ endif()
endif()
endif()
endfunction()