Commit f26ca5a1 authored by Rolf Eike Beer's avatar Rolf Eike Beer
Browse files

Tests/Module/WCDH: write multi_file_compiler_detection.h before using it

This was broken in commit 98e6d1e5
(Tests/Module/WCDH: make it work with only C features defined) when all C tests
were made accessible even if no C++ features are available, but the header was
only created if C++ features are available. Fix it by creating the header
unconditionally before any checks on the available features.
parent 2b0256c5
......@@ -20,6 +20,17 @@ write_compiler_detection_header(
${cxx_known_features} ${c_known_features}
)
write_compiler_detection_header(
FILE "${CMAKE_CURRENT_BINARY_DIR}/compiler_multi_files/multi_file_compiler_detection.h"
PREFIX MULTI
OUTPUT_FILES_VAR multi_files
OUTPUT_DIR "${CMAKE_CURRENT_BINARY_DIR}/compiler_multi_files/compiler_support"
COMPILERS GNU Clang AppleClang MSVC SunPro Intel
VERSION 3.1
FEATURES
${cxx_known_features} ${c_known_features}
)
macro(set_defines target true_defs false_defs)
set(defines)
foreach(def ${true_defs})
......@@ -116,17 +127,6 @@ add_executable(WriteCompilerDetectionHeader main.cpp)
set_property(TARGET WriteCompilerDetectionHeader PROPERTY CXX_STANDARD 98)
set_defines(WriteCompilerDetectionHeader "${true_defs}" "${false_defs}")
write_compiler_detection_header(
FILE "${CMAKE_CURRENT_BINARY_DIR}/compiler_multi_files/multi_file_compiler_detection.h"
PREFIX MULTI
OUTPUT_FILES_VAR multi_files
OUTPUT_DIR "${CMAKE_CURRENT_BINARY_DIR}/compiler_multi_files/compiler_support"
COMPILERS GNU Clang AppleClang MSVC SunPro Intel
VERSION 3.1
FEATURES
${cxx_known_features} ${c_known_features}
)
add_executable(multi_files multi_files.cpp)
set_property(TARGET multi_files PROPERTY CXX_STANDARD 98)
target_include_directories(multi_files PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/compiler_multi_files)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment