cmake-mingw.patch 1.1 KB

123456789101112131415161718192021222324252627
  1. diff --git a/CMakeLists.txt b/CMakeLists.txt
  2. index af78061..8aba951 100644
  3. --- a/CMakeLists.txt
  4. +++ b/CMakeLists.txt
  5. @@ -39,13 +39,15 @@ function(add_security_flags target)
  6. target_compile_options( ${target} PRIVATE -fstack-protector-strong)
  7. endif()
  8. elseif(WIN32)
  9. - target_compile_options( ${target} PRIVATE /GS /DynamicBase)
  10. - if(BUILD_WITH_STATIC_CRT)
  11. - target_compile_options( ${target} PRIVATE "/MT")
  12. - endif()
  13. - if("${CMAKE_SIZEOF_VOID_P}" STREQUAL "4")
  14. - # These options for 32 bit builds only
  15. - target_compile_options( ${target} PRIVATE /SAFESEH /NXCOMPAT )
  16. + if (MSVC)
  17. + target_compile_options( ${target} PRIVATE /GS /DynamicBase)
  18. + if(BUILD_WITH_STATIC_CRT)
  19. + target_compile_options( ${target} PRIVATE "/MT")
  20. + endif()
  21. + if("${CMAKE_SIZEOF_VOID_P}" STREQUAL "4")
  22. + # These options for 32 bit builds only
  23. + target_compile_options( ${target} PRIVATE /SAFESEH /NXCOMPAT )
  24. + endif()
  25. endif()
  26. endif()
  27. endfunction()