From: Matthias Maier Date: Tue, 23 Jan 2018 18:37:43 +0000 (-0600) Subject: CMake: Bugfix: Do not use COMPILE_LANGUAGE if configuring for MSVC X-Git-Tag: v9.0.0-rc1~533^2 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=0eab5edf54b287d99e744efdba798252c1e9392d;p=dealii.git CMake: Bugfix: Do not use COMPILE_LANGUAGE if configuring for MSVC Closes #5782 --- diff --git a/cmake/macros/macro_deal_ii_add_library.cmake b/cmake/macros/macro_deal_ii_add_library.cmake index c6a0c8bdca..dde147a684 100644 --- a/cmake/macros/macro_deal_ii_add_library.cmake +++ b/cmake/macros/macro_deal_ii_add_library.cmake @@ -40,7 +40,7 @@ MACRO(DEAL_II_ADD_LIBRARY _library) LINKER_LANGUAGE "CXX" ) - IF(CMAKE_VERSION VERSION_LESS 3.9) + IF(CMAKE_VERSION VERSION_LESS 3.9 OR CMAKE_CXX_COMPILER_ID MATCHES "MSVC") SET_TARGET_PROPERTIES(${_library}_${_build_lowercase} PROPERTIES COMPILE_FLAGS "${DEAL_II_CXX_FLAGS} ${DEAL_II_CXX_FLAGS_${_build}}" diff --git a/cmake/macros/macro_deal_ii_insource_setup_target.cmake b/cmake/macros/macro_deal_ii_insource_setup_target.cmake index fb19f757f5..5c0298d698 100644 --- a/cmake/macros/macro_deal_ii_insource_setup_target.cmake +++ b/cmake/macros/macro_deal_ii_insource_setup_target.cmake @@ -39,7 +39,7 @@ MACRO(DEAL_II_INSOURCE_SETUP_TARGET _target _build) ${DEAL_II_INCLUDE_DIRS} ) - IF(CMAKE_VERSION VERSION_LESS 3.9) + IF(CMAKE_VERSION VERSION_LESS 3.9 OR CMAKE_CXX_COMPILER_ID MATCHES "MSVC") SET_PROPERTY(TARGET ${_target} APPEND_STRING PROPERTY COMPILE_FLAGS " ${DEAL_II_CXX_FLAGS} ${DEAL_II_CXX_FLAGS_${_build}}" ) diff --git a/cmake/macros/macro_deal_ii_setup_target.cmake b/cmake/macros/macro_deal_ii_setup_target.cmake index 981b2ae8f6..7e3c80c00d 100644 --- a/cmake/macros/macro_deal_ii_setup_target.cmake +++ b/cmake/macros/macro_deal_ii_setup_target.cmake @@ -110,7 +110,7 @@ MACRO(DEAL_II_SETUP_TARGET _target) LINK_FLAGS " ${DEAL_II_LINKER_FLAGS} ${DEAL_II_LINKER_FLAGS_${_build}}" ) - IF(CMAKE_VERSION VERSION_LESS 3.9) + IF(CMAKE_VERSION VERSION_LESS 3.9 OR CMAKE_CXX_COMPILER_ID MATCHES "MSVC") SET_PROPERTY(TARGET ${_target} APPEND_STRING PROPERTY COMPILE_FLAGS " ${DEAL_II_CXX_FLAGS} ${DEAL_II_CXX_FLAGS_${_build}}" )