From: Daniel Arndt Date: Wed, 13 Mar 2019 08:56:12 +0000 (+0100) Subject: Avoid tabs and don't test for alternative linker with MSVC X-Git-Tag: v9.1.0-rc1~256^2~1 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=2876a2686c53ae96e215226c7f8104e413e628cb;p=dealii.git Avoid tabs and don't test for alternative linker with MSVC --- diff --git a/cmake/checks/check_01_cxx_features.cmake b/cmake/checks/check_01_cxx_features.cmake index 1f71219af4..2f5cf61e7e 100644 --- a/cmake/checks/check_01_cxx_features.cmake +++ b/cmake/checks/check_01_cxx_features.cmake @@ -104,12 +104,12 @@ MACRO(_check_cxx_flag _suffix) IF(DEAL_II_HAVE_FLAG_stdcxx${_suffix}) SET(DEAL_II_CXX_VERSION_FLAG "/std:c++${_suffix}") ENDIF() - ELSE() + ELSE() CHECK_CXX_COMPILER_FLAG("-std=c++${_suffix}" DEAL_II_HAVE_FLAG_stdcxx${_suffix}) IF(DEAL_II_HAVE_FLAG_stdcxx${_suffix}) SET(DEAL_II_CXX_VERSION_FLAG "-std=c++${_suffix}") ENDIF() - ENDIF() + ENDIF() ENDIF() ENDMACRO() @@ -542,7 +542,7 @@ CHECK_CXX_SOURCE_COMPILES( } " DEAL_II_COMPILER_DEFAULTS_TO_CXX11_OR_NEWER) - RESET_CMAKE_REQUIRED() +RESET_CMAKE_REQUIRED() IF(_user_provided_cxx_version_flag OR NOT DEAL_II_COMPILER_DEFAULTS_TO_CXX11_OR_NEWER OR diff --git a/cmake/checks/check_02_compiler_features.cmake b/cmake/checks/check_02_compiler_features.cmake index d7d7c83218..e844e7d904 100644 --- a/cmake/checks/check_02_compiler_features.cmake +++ b/cmake/checks/check_02_compiler_features.cmake @@ -442,45 +442,38 @@ RESET_CMAKE_REQUIRED() # # Wolfgang Bangerth, Matthias Maier, Daniel Arndt, 2015, 2018 # -IF(CMAKE_CXX_COMPILER_ID MATCHES "Clang") - ADD_FLAGS(CMAKE_REQUIRED_FLAGS "-Wno-unused-command-line-argument") -ELSEIF(CMAKE_CXX_COMPILER_ID MATCHES "Intel") - ADD_FLAGS(CMAKE_REQUIRED_FLAGS "-diag-error warn") -ENDIF() -IF(CMAKE_CXX_COMPILER_ID MATCHES "MSVC") - ADD_FLAGS(CMAKE_REQUIRED_FLAGS "/WX") -ELSE() +IF(NOT CMAKE_CXX_COMPILER_ID MATCHES "MSVC") + IF(CMAKE_CXX_COMPILER_ID MATCHES "Clang") + ADD_FLAGS(CMAKE_REQUIRED_FLAGS "-Wno-unused-command-line-argument") + ELSEIF(CMAKE_CXX_COMPILER_ID MATCHES "Intel") + ADD_FLAGS(CMAKE_REQUIRED_FLAGS "-diag-error warn") + ENDIF() ADD_FLAGS(CMAKE_REQUIRED_FLAGS "-Werror") -ENDIF() -ADD_FLAGS(CMAKE_REQUIRED_FLAGS "-fuse-ld=lld") -CHECK_CXX_SOURCE_COMPILES( - " - int main() { return 0; } - " - DEAL_II_COMPILER_HAS_FUSE_LD_LLD) -RESET_CMAKE_REQUIRED() + ADD_FLAGS(CMAKE_REQUIRED_FLAGS "-fuse-ld=lld") + CHECK_CXX_SOURCE_COMPILES( + " + int main() { return 0; } + " + DEAL_II_COMPILER_HAS_FUSE_LD_LLD) + RESET_CMAKE_REQUIRED() -IF(CMAKE_CXX_COMPILER_ID MATCHES "Clang") - ADD_FLAGS(CMAKE_REQUIRED_FLAGS "-Wno-unused-command-line-argument") -ELSEIF(CMAKE_CXX_COMPILER_ID MATCHES "Intel") - ADD_FLAGS(CMAKE_REQUIRED_FLAGS "-diag-error warn") -ENDIF() -IF(CMAKE_CXX_COMPILER_ID MATCHES "MSVC") - ADD_FLAGS(CMAKE_REQUIRED_FLAGS "/WX") -ELSE() + IF(CMAKE_CXX_COMPILER_ID MATCHES "Clang") + ADD_FLAGS(CMAKE_REQUIRED_FLAGS "-Wno-unused-command-line-argument") + ELSEIF(CMAKE_CXX_COMPILER_ID MATCHES "Intel") + ADD_FLAGS(CMAKE_REQUIRED_FLAGS "-diag-error warn") + ENDIF() ADD_FLAGS(CMAKE_REQUIRED_FLAGS "-Werror") -ENDIF() -ADD_FLAGS(CMAKE_REQUIRED_FLAGS "-fuse-ld=gold") -CHECK_CXX_SOURCE_COMPILES( - " - int main() { return 0; } - " - DEAL_II_COMPILER_HAS_FUSE_LD_GOLD) -RESET_CMAKE_REQUIRED() + ADD_FLAGS(CMAKE_REQUIRED_FLAGS "-fuse-ld=gold") + CHECK_CXX_SOURCE_COMPILES( + " + int main() { return 0; } + " + DEAL_II_COMPILER_HAS_FUSE_LD_GOLD) + RESET_CMAKE_REQUIRED() -IF(DEAL_II_COMPILER_HAS_FUSE_LD_LLD) - ADD_FLAGS(DEAL_II_LINKER_FLAGS "-fuse-ld=lld") -ELSEIF(DEAL_II_COMPILER_HAS_FUSE_LD_GOLD) - ADD_FLAGS(DEAL_II_LINKER_FLAGS "-fuse-ld=gold") + IF(DEAL_II_COMPILER_HAS_FUSE_LD_LLD) + ADD_FLAGS(DEAL_II_LINKER_FLAGS "-fuse-ld=lld") + ELSEIF(DEAL_II_COMPILER_HAS_FUSE_LD_GOLD) + ADD_FLAGS(DEAL_II_LINKER_FLAGS "-fuse-ld=gold") + ENDIF() ENDIF() - diff --git a/cmake/configure/configure_2_boost.cmake b/cmake/configure/configure_2_boost.cmake index 1b5988fc8f..1637b16695 100644 --- a/cmake/configure/configure_2_boost.cmake +++ b/cmake/configure/configure_2_boost.cmake @@ -59,7 +59,7 @@ MACRO(FEATURE_BOOST_CONFIGURE_COMMON) # circumvent the issue. Hence, we just check ourselves. ADD_FLAGS(CMAKE_REQUIRED_FLAGS "${DEAL_II_CXX_VERSION_FLAG}") IF(CMAKE_CXX_COMPILER_ID MATCHES "MSVC") - ADD_FLAGS(CMAKE_REQUIRED_FLAGS "/WX") + ADD_FLAGS(CMAKE_REQUIRED_FLAGS "/WX /EHsc") ELSE() ADD_FLAGS(CMAKE_REQUIRED_FLAGS "-Werror") ENDIF()