Warning, /geant4/cmake/Modules/MSVCCompileFeatures.cmake is written in an unsupported language. File is not indexed.
0001 #.rst:
0002 # MSVC Compile Features for Geant4
0003 # --------------------------------
0004 #
0005 # Due to use of C++17 features in visualization on Windows, Geant4 requires
0006 # use of VS 2017 update 3 or newer. CMake 3.10 and higher support this out
0007 # of the box, but with our minimum requirement of 3.8, we add this shim
0008 # to:
0009 #
0010 # 1) Check the version requirement
0011 # 2) Set the compile flags/features when using CMake < 3.10
0012 #
0013 if(MSVC)
0014 # This seems to indicate CMAKE_C_SIMULATE_ID
0015 if(CMAKE_CXX_COMPILER_ID STREQUAL "MSVC")
0016 # Require MSVC that supports standard flags and std::filesystem
0017 if(CMAKE_CXX_COMPILER_VERSION VERSION_LESS 19.20)
0018 message(FATAL_ERROR "Geant4 requires MSVC 19.20 (Visual Studio 2019 Version 16.0) or newer")
0019 else()
0020 # Set cxxstd flags on CMake < 3.10
0021 if(CMAKE_VERSION VERSION_LESS 3.10)
0022 # VS 2015 Update 3 and above support language standard level flags,
0023 # with the default and minimum level being C++14.
0024 set(CMAKE_CXX98_STANDARD_COMPILE_OPTION "")
0025 set(CMAKE_CXX98_EXTENSION_COMPILE_OPTION "")
0026 set(CMAKE_CXX11_STANDARD_COMPILE_OPTION "")
0027 set(CMAKE_CXX11_EXTENSION_COMPILE_OPTION "")
0028 set(CMAKE_CXX14_STANDARD_COMPILE_OPTION "-std:c++14")
0029 set(CMAKE_CXX14_EXTENSION_COMPILE_OPTION "-std:c++14")
0030 set(CMAKE_CXX17_STANDARD_COMPILE_OPTION "-std:c++17")
0031 set(CMAKE_CXX17_EXTENSION_COMPILE_OPTION "-std:c++17")
0032 list(APPEND CMAKE_CXX17_COMPILE_FEATURES cxx_std_17)
0033 set(CMAKE_CXX_COMPILE_FEATURES ${CMAKE_CXX_COMPILE_FEATURES} "${CMAKE_CXX17_COMPILE_FEATURES}")
0034 endif()
0035 endif()
0036 elseif(CMAKE_CXX_COMPILER_ID STREQUAL "Clang")
0037 else()
0038 message(FATAL_ERROR "Geant4 requires Visual Studio or Clang.")
0039 endif()
0040 endif()
0041