summaryrefslogtreecommitdiffstats
path: root/Tests/Plugin/CMakeLists.txt
diff options
context:
space:
mode:
authorZsolt Parragi <zsolt.parragi@cancellar.hu>2019-03-21 18:49:11 (GMT)
committerZsolt Parragi <zsolt.parragi@cancellar.hu>2019-05-24 06:43:42 (GMT)
commit4819ff964714faec8ad2d92a3ee541b19196bcfc (patch)
treeb9e8602e7ebf86a10c67b7fa7b919a230f3dee56 /Tests/Plugin/CMakeLists.txt
parent26af0b25e77ba48b6d015adef6d54b6725fd7977 (diff)
downloadCMake-4819ff964714faec8ad2d92a3ee541b19196bcfc.zip
CMake-4819ff964714faec8ad2d92a3ee541b19196bcfc.tar.gz
CMake-4819ff964714faec8ad2d92a3ee541b19196bcfc.tar.bz2
Tests: fix failures with gnu mode clang on windows
Root causes were: * Using incorrect conditions (assuming MSVC-like command line mode) * Trying to compile the MSVC STL in C++11 mode, when parts of it require C++14 or enabling MS extensions in clang. * Missing flush in a testcase using stdout in a dll and a main part with static crt
Diffstat (limited to 'Tests/Plugin/CMakeLists.txt')
-rw-r--r--Tests/Plugin/CMakeLists.txt17
1 files changed, 11 insertions, 6 deletions
diff --git a/Tests/Plugin/CMakeLists.txt b/Tests/Plugin/CMakeLists.txt
index 8e8fa07..c4540db 100644
--- a/Tests/Plugin/CMakeLists.txt
+++ b/Tests/Plugin/CMakeLists.txt
@@ -5,6 +5,17 @@ project(Plugin)
# We need proper C++98 support from the compiler
set(CMAKE_CXX_STANDARD 98)
+# Clang/C2 in C++98 mode cannot properly handle some of MSVC headers
+if (CMAKE_CXX_COMPILER_ID STREQUAL "Clang" AND
+ CMAKE_CXX_SIMULATE_ID STREQUAL "MSVC")
+ set(CMAKE_CXX_STANDARD 11)
+endif()
+
+if (CMAKE_CXX_COMPILER_ID STREQUAL "Clang" AND
+ CMAKE_CXX_COMPILER_FRONTEND_VARIANT STREQUAL "GNU")
+ set(CMAKE_CXX_STANDARD 14)
+endif()
+
# Test per-target output directory properties.
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${Plugin_BINARY_DIR}/bin)
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${Plugin_BINARY_DIR}/lib/plugin)
@@ -29,12 +40,6 @@ include_directories(
${Plugin_SOURCE_DIR}/include
)
-# Clang/C2 in C++98 mode cannot properly handle some of MSVC headers
-if (CMAKE_CXX_COMPILER_ID STREQUAL "Clang" AND
- CMAKE_CXX_SIMULATE_ID STREQUAL "MSVC")
- set(CMAKE_CXX_STANDARD 11)
-endif()
-
# Create an executable that exports an API for use by plugins.
add_executable(example_exe src/example_exe.cxx)
set_target_properties(example_exe PROPERTIES