From 8073b3ea6226dda4367dd100e16dc9107b0df99f Mon Sep 17 00:00:00 2001 From: Lioncash Date: Sun, 1 Sep 2019 02:44:18 -0400 Subject: [PATCH] CMakeLists: Add standard-compliance flags for MSVC Enforces standard compliant behavior capable by MSVC. --- specter/CMakeLists.txt | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/specter/CMakeLists.txt b/specter/CMakeLists.txt index 6bd90414c..9aece31b3 100644 --- a/specter/CMakeLists.txt +++ b/specter/CMakeLists.txt @@ -63,6 +63,25 @@ add_library(specter include/specter/specter.hpp ) +if (MSVC) + target_compile_options(specter PRIVATE + # Enforce various standards compliant behavior. + /permissive- + + # Enable standard volatile semantics. + /volatile:iso + + # Reports the proper value for the __cplusplus preprocessor macro. + /Zc:__cplusplus + + # Allow constexpr variables to have explicit external linkage. + /Zc:externConstexpr + + # Assume that new throws exceptions, allowing better code generation. + /Zc:throwingNew + ) +endif() + target_link_libraries(specter PUBLIC freetype hecl-full