From 0ee260b036a39c399f945992e98d31bf7950cdaa Mon Sep 17 00:00:00 2001 From: Jim Lewis Date: Fri, 24 Jul 2020 08:30:24 -0500 Subject: [PATCH] Arbitrary output directory support for compiler test build copies (#848) (#851) * Move copy from top level down to test_compile module as post-build copy * Fix windows VS2015 build break --- CMakeLists.txt | 13 ------------- test_conformance/compiler/CMakeLists.txt | 17 +++++++++++++++++ .../computeinfo/extended_versioning.cpp | 1 + 3 files changed, 18 insertions(+), 13 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 799460da..33296910 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -232,17 +232,4 @@ else(WIN32) add_custom_target( COPY_FILES${CONFORMANCE_SUFFIX} ) endif(WIN32) -# Copy required CL include directories into the build directory -# as required for the compiler testing. - -# ... For running the compiler test on the command line. -file(COPY "${CLConform_SOURCE_DIR}/test_conformance/compiler/includeTestDirectory" DESTINATION ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/test_conformance/compiler) -file(COPY "${CLConform_SOURCE_DIR}/test_conformance/compiler/secondIncludeTestDirectory" DESTINATION ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/test_conformance/compiler) - -# ... For running the compiler test with VisualStudio. -if(MSVC) - file(COPY "${CLConform_SOURCE_DIR}/test_conformance/compiler/includeTestDirectory" DESTINATION "${CLConform_SOURCE_DIR}/build/test_conformance/compiler") - file(COPY "${CLConform_SOURCE_DIR}/test_conformance/compiler/secondIncludeTestDirectory" DESTINATION "${CLConform_SOURCE_DIR}/build/test_conformance/compiler") -endif(MSVC) - set_property(TARGET COPY_FILES${CONFORMANCE_SUFFIX} PROPERTY FOLDER "CONFORMANCE${CONFORMANCE_SUFFIX}") diff --git a/test_conformance/compiler/CMakeLists.txt b/test_conformance/compiler/CMakeLists.txt index 69ad51c6..59fe654b 100644 --- a/test_conformance/compiler/CMakeLists.txt +++ b/test_conformance/compiler/CMakeLists.txt @@ -13,3 +13,20 @@ set(${MODULE_NAME}_SOURCES ) include(../CMakeCommon.txt) + +# Copy required CL include directories into the binary directory + +set(COMPILER_SOURCE_DIR ${CLConform_SOURCE_DIR}/test_conformance/compiler) +set(COMPILER_TARGET ${${MODULE_NAME}_OUT}) + +add_custom_command( + TARGET ${COMPILER_TARGET} + COMMAND ${CMAKE_COMMAND} -E copy_directory + "${COMPILER_SOURCE_DIR}/includeTestDirectory" + $/includeTestDirectory) + +add_custom_command( + TARGET ${COMPILER_TARGET} + COMMAND ${CMAKE_COMMAND} -E copy_directory + "${COMPILER_SOURCE_DIR}/secondIncludeTestDirectory" + $/secondIncludeTestDirectory) diff --git a/test_conformance/computeinfo/extended_versioning.cpp b/test_conformance/computeinfo/extended_versioning.cpp index f9c29b92..841526cc 100644 --- a/test_conformance/computeinfo/extended_versioning.cpp +++ b/test_conformance/computeinfo/extended_versioning.cpp @@ -17,6 +17,7 @@ #include #include +#include #include #include #include "harness/testHarness.h"