LibiglWindows.cmake 969 B

12345678910111213141516171819202122
  1. if(MSVC)
  2. if("${MSVC_RUNTIME}" STREQUAL "")
  3. set(MSVC_RUNTIME "static")
  4. endif()
  5. if(${MSVC_RUNTIME} STREQUAL "static")
  6. message(STATUS "MSVC -> forcing use of statically-linked runtime.")
  7. foreach(config ${CMAKE_CONFIGURATION_TYPES})
  8. string(TOUPPER ${config} config)
  9. string(REPLACE /MD /MT CMAKE_C_FLAGS_${config} "${CMAKE_C_FLAGS_${config}}")
  10. string(REPLACE /MD /MT CMAKE_CXX_FLAGS_${config} "${CMAKE_CXX_FLAGS_${config}}")
  11. endforeach()
  12. string(REPLACE "/MDd" "/MTd" CMAKE_CXX_FLAGS_DEBUG ${CMAKE_CXX_FLAGS_DEBUG})
  13. else()
  14. message(STATUS "MSVC -> forcing use of dynamically-linked runtime.")
  15. foreach(config ${CMAKE_CONFIGURATION_TYPES})
  16. string(TOUPPER ${config} config)
  17. string(REPLACE /MT /MD CMAKE_C_FLAGS_${config} "${CMAKE_C_FLAGS_${config}}")
  18. string(REPLACE /MT /MD CMAKE_CXX_FLAGS_${config} "${CMAKE_CXX_FLAGS_${config}}")
  19. endforeach()
  20. string(REPLACE "/MTd" "/MDd" CMAKE_CXX_FLAGS_DEBUG ${CMAKE_CXX_FLAGS_DEBUG})
  21. endif()
  22. endif()