mirror of https://github.com/AxioDL/kabufuda.git
Exclude CMake CXX standard from MSVC
This commit is contained in:
parent
35e5c7c90f
commit
4648c93b8e
|
@ -1,8 +1,10 @@
|
||||||
cmake_minimum_required(VERSION 3.10 FATAL_ERROR) # because of c++17
|
cmake_minimum_required(VERSION 3.10 FATAL_ERROR) # because of c++17
|
||||||
project(kabufuda)
|
project(kabufuda)
|
||||||
|
|
||||||
set(CMAKE_CXX_STANDARD 17)
|
if (NOT MSVC)
|
||||||
set(CMAKE_CXX_STANDARD_REQUIRED ON)
|
set(CMAKE_CXX_STANDARD 20)
|
||||||
|
set(CMAKE_CXX_STANDARD_REQUIRED ON)
|
||||||
|
endif()
|
||||||
|
|
||||||
add_library(kabufuda STATIC
|
add_library(kabufuda STATIC
|
||||||
include/kabufuda/Constants.hpp
|
include/kabufuda/Constants.hpp
|
||||||
|
@ -20,20 +22,27 @@ if(WIN32)
|
||||||
if (MSVC)
|
if (MSVC)
|
||||||
target_compile_options(kabufuda PRIVATE
|
target_compile_options(kabufuda 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>
|
||||||
|
|
||||||
# Allow constexpr variables to have explicit external linkage.
|
# Use latest C++ standard.
|
||||||
/Zc:externConstexpr
|
$<$<COMPILE_LANGUAGE:CXX>:/std:c++latest>
|
||||||
|
|
||||||
# Assume that new throws exceptions, allowing better code generation.
|
|
||||||
/Zc:throwingNew
|
|
||||||
)
|
)
|
||||||
|
if ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "MSVC")
|
||||||
|
# Flags for MSVC (not clang-cl)
|
||||||
|
target_compile_options(kabufuda PRIVATE
|
||||||
|
# Allow constexpr variables to have explicit external linkage.
|
||||||
|
$<$<COMPILE_LANGUAGE:CXX>:/Zc:externConstexpr>
|
||||||
|
|
||||||
|
# Assume that new throws exceptions, allowing better code generation.
|
||||||
|
$<$<COMPILE_LANGUAGE:CXX>:/Zc:throwingNew>
|
||||||
|
)
|
||||||
|
endif()
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
target_sources(kabufuda PRIVATE
|
target_sources(kabufuda PRIVATE
|
||||||
|
|
Loading…
Reference in New Issue