From 326ad9949fb8c74b2e266c152bcc9437ea2d484e Mon Sep 17 00:00:00 2001 From: Ben Boeckel Date: Fri, 12 Feb 2016 13:14:59 -0500 Subject: [PATCH] Tests: fix GenerateExportHeader directory definitions There's no need to stringify the values, but instead just pass in strings. The core problem is that the path may have tokens which are replaced by the preprocessor which causes an invalid path to be used. --- Tests/Module/GenerateExportHeader/CMakeLists.txt | 4 ++-- .../Module/GenerateExportHeader/exportheader_test.cpp | 11 ++++------- 2 files changed, 6 insertions(+), 9 deletions(-) diff --git a/Tests/Module/GenerateExportHeader/CMakeLists.txt b/Tests/Module/GenerateExportHeader/CMakeLists.txt index 8cd25a4ff..7fce330a9 100644 --- a/Tests/Module/GenerateExportHeader/CMakeLists.txt +++ b/Tests/Module/GenerateExportHeader/CMakeLists.txt @@ -124,6 +124,6 @@ endif() message("#### Testing reference: ${_platform}") target_compile_definitions(GenerateExportHeader PRIVATE - "SRC_DIR=${CMAKE_CURRENT_SOURCE_DIR}/reference/${_platform}" - "BIN_DIR=${CMAKE_CURRENT_BINARY_DIR}" + "SRC_DIR=\"${CMAKE_CURRENT_SOURCE_DIR}/reference/${_platform}\"" + "BIN_DIR=\"${CMAKE_CURRENT_BINARY_DIR}\"" ) diff --git a/Tests/Module/GenerateExportHeader/exportheader_test.cpp b/Tests/Module/GenerateExportHeader/exportheader_test.cpp index 4f45f3786..7802c4358 100644 --- a/Tests/Module/GenerateExportHeader/exportheader_test.cpp +++ b/Tests/Module/GenerateExportHeader/exportheader_test.cpp @@ -136,13 +136,10 @@ int main() libstatic_not_exported(); libstatic_excluded(); -#define STRINGIFY_IMPL(A) #A -#define STRINGIFY(A) STRINGIFY_IMPL(A) - - compare(STRINGIFY(SRC_DIR) "/libshared_export.h", - STRINGIFY(BIN_DIR) "/libshared/libshared_export.h"); - compare(STRINGIFY(SRC_DIR) "/libstatic_export.h", - STRINGIFY(BIN_DIR) "/libstatic/libstatic_export.h"); + compare(SRC_DIR "/libshared_export.h", + BIN_DIR "/libshared/libshared_export.h"); + compare(SRC_DIR "/libstatic_export.h", + BIN_DIR "/libstatic/libstatic_export.h"); return 0; }