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.
This commit is contained in:
Ben Boeckel 2016-02-12 13:14:59 -05:00
parent 86d2f32525
commit 326ad9949f
2 changed files with 6 additions and 9 deletions

View File

@ -124,6 +124,6 @@ endif()
message("#### Testing reference: ${_platform}") message("#### Testing reference: ${_platform}")
target_compile_definitions(GenerateExportHeader target_compile_definitions(GenerateExportHeader
PRIVATE PRIVATE
"SRC_DIR=${CMAKE_CURRENT_SOURCE_DIR}/reference/${_platform}" "SRC_DIR=\"${CMAKE_CURRENT_SOURCE_DIR}/reference/${_platform}\""
"BIN_DIR=${CMAKE_CURRENT_BINARY_DIR}" "BIN_DIR=\"${CMAKE_CURRENT_BINARY_DIR}\""
) )

View File

@ -136,13 +136,10 @@ int main()
libstatic_not_exported(); libstatic_not_exported();
libstatic_excluded(); libstatic_excluded();
#define STRINGIFY_IMPL(A) #A compare(SRC_DIR "/libshared_export.h",
#define STRINGIFY(A) STRINGIFY_IMPL(A) BIN_DIR "/libshared/libshared_export.h");
compare(SRC_DIR "/libstatic_export.h",
compare(STRINGIFY(SRC_DIR) "/libshared_export.h", BIN_DIR "/libstatic/libstatic_export.h");
STRINGIFY(BIN_DIR) "/libshared/libshared_export.h");
compare(STRINGIFY(SRC_DIR) "/libstatic_export.h",
STRINGIFY(BIN_DIR) "/libstatic/libstatic_export.h");
return 0; return 0;
} }