Merge commit '92f44'

This commit is contained in:
Jack Andersen 2020-04-10 18:59:32 -10:00
commit 40efdcc38c
2 changed files with 34 additions and 18 deletions

View File

@ -2,8 +2,10 @@ cmake_minimum_required(VERSION 3.10 FATAL_ERROR) # because of c++17
project(amuse) project(amuse)
set(CMAKE_CXX_STANDARD 17) if (NOT MSVC)
set(CMAKE_CXX_STANDARD 20)
set(CMAKE_CXX_STANDARD_REQUIRED ON) set(CMAKE_CXX_STANDARD_REQUIRED ON)
endif()
if(NOT MSVC) if(NOT MSVC)
add_compile_options(-Wno-narrowing) add_compile_options(-Wno-narrowing)
@ -98,20 +100,27 @@ endif()
if (MSVC) if (MSVC)
target_compile_options(amuse PRIVATE target_compile_options(amuse PRIVATE
# Enforce various standards compliant behavior. # Enforce various standards compliant behavior.
/permissive- $<$<COMPILE_LANGUAGE:CXX>:/permissive->
# Enable standard volatile semantics. # Enable standard volatile semantics.
/volatile:iso $<$<COMPILE_LANGUAGE:CXX>:/volatile:iso>
# Reports the proper value for the __cplusplus preprocessor macro. # Reports the proper value for the __cplusplus preprocessor macro.
/Zc:__cplusplus $<$<COMPILE_LANGUAGE:CXX>:/Zc:__cplusplus>
# Use latest C++ standard.
$<$<COMPILE_LANGUAGE:CXX>:/std:c++latest>
)
if ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "MSVC")
# Flags for MSVC (not clang-cl)
target_compile_options(amuse PRIVATE
# Allow constexpr variables to have explicit external linkage. # Allow constexpr variables to have explicit external linkage.
/Zc:externConstexpr $<$<COMPILE_LANGUAGE:CXX>:/Zc:externConstexpr>
# Assume that new throws exceptions, allowing better code generation. # Assume that new throws exceptions, allowing better code generation.
/Zc:throwingNew $<$<COMPILE_LANGUAGE:CXX>:/Zc:throwingNew>
) )
endif()
else() else()
target_compile_options(amuse PRIVATE -Wno-unknown-pragmas) target_compile_options(amuse PRIVATE -Wno-unknown-pragmas)
endif() endif()

View File

@ -84,21 +84,28 @@ target_compile_definitions(amuse-gui PRIVATE
if (MSVC) if (MSVC)
target_compile_options(amuse-gui PRIVATE target_compile_options(amuse-gui PRIVATE
# Enforce various standards compliant behavior. # Enforce various standards compliant behavior.
/permissive- $<$<COMPILE_LANGUAGE:CXX>:/permissive->
# Enable standard volatile semantics. # Enable standard volatile semantics.
/volatile:iso $<$<COMPILE_LANGUAGE:CXX>:/volatile:iso>
# Reports the proper value for the __cplusplus preprocessor macro. # Reports the proper value for the __cplusplus preprocessor macro.
/Zc:__cplusplus $<$<COMPILE_LANGUAGE:CXX>:/Zc:__cplusplus>
# Use latest C++ standard.
$<$<COMPILE_LANGUAGE:CXX>:/std:c++latest>
)
if ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "MSVC")
# Flags for MSVC (not clang-cl)
target_compile_options(amuse-gui PRIVATE
# Allow constexpr variables to have explicit external linkage. # Allow constexpr variables to have explicit external linkage.
/Zc:externConstexpr $<$<COMPILE_LANGUAGE:CXX>:/Zc:externConstexpr>
# Assume that new throws exceptions, allowing better code generation. # Assume that new throws exceptions, allowing better code generation.
/Zc:throwingNew $<$<COMPILE_LANGUAGE:CXX>:/Zc:throwingNew>
) )
endif() endif()
endif()
if(WIN32) if(WIN32)
target_sources(amuse-gui PRIVATE target_sources(amuse-gui PRIVATE