diff options
author | Zsolt Parragi <zsolt.parragi@cancellar.hu> | 2019-04-10 12:11:21 (GMT) |
---|---|---|
committer | Zsolt Parragi <zsolt.parragi@cancellar.hu> | 2019-05-24 06:43:55 (GMT) |
commit | 19669abe1d714d9dba3dcd642588160c0814f9e7 (patch) | |
tree | 2d4f07906a49eba1721e209546e0e9eb0d66aad6 /Tests/Preprocess/CMakeLists.txt | |
parent | a2a90f41e312ef1b6f60dd700db441e4b637d853 (diff) | |
download | CMake-19669abe1d714d9dba3dcd642588160c0814f9e7.zip CMake-19669abe1d714d9dba3dcd642588160c0814f9e7.tar.gz CMake-19669abe1d714d9dba3dcd642588160c0814f9e7.tar.bz2 |
Tests: handle string escaping differences with NMake+clang
Diffstat (limited to 'Tests/Preprocess/CMakeLists.txt')
-rw-r--r-- | Tests/Preprocess/CMakeLists.txt | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/Tests/Preprocess/CMakeLists.txt b/Tests/Preprocess/CMakeLists.txt index 8c2cdc9..588af03 100644 --- a/Tests/Preprocess/CMakeLists.txt +++ b/Tests/Preprocess/CMakeLists.txt @@ -28,6 +28,11 @@ endif() if("${CMAKE_GENERATOR}" MATCHES "Visual Studio") set(PP_VS 1) endif() +if(CMAKE_C_COMPILER_ID STREQUAL "Clang" AND + "x${CMAKE_C_SIMULATE_ID}" STREQUAL "xMSVC" AND + "x${CMAKE_C_COMPILER_FRONTEND_VARIANT}" STREQUAL "xGNU") + set(CLANG_GNULIKE_WINDOWS 1) +endif() # Some tests below check the PP_* variables set above. They are meant # to test the case that the build tool is at fault. Other tests below @@ -53,7 +58,7 @@ endif() string(APPEND STRING_EXTRA " ") -if(NOT PP_BORLAND AND NOT PP_WATCOM) +if(NOT PP_BORLAND AND NOT PP_WATCOM AND NOT CLANG_GNULIKE_WINDOWS) # Borland, WMake: multiple spaces # The make tool seems to remove extra whitespace from inside # quoted strings when passing to the compiler. It does not have @@ -70,14 +75,14 @@ if(NOT PP_VS) string(APPEND STRING_EXTRA ",") endif() -if(NOT PP_MINGW) +if(NOT PP_MINGW AND NOT CLANG_GNULIKE_WINDOWS) # MinGW: & # When inside -D"FOO=\"a & b\"" MinGW make wants -D"FOO=\"a "&" b\"" # but it does not like quoted ampersand elsewhere. string(APPEND STRING_EXTRA "&") endif() -if(NOT PP_MINGW) +if(NOT PP_MINGW AND NOT CLANG_GNULIKE_WINDOWS) # MinGW: | # When inside -D"FOO=\"a | b\"" MinGW make wants -D"FOO=\"a "|" b\"" # but it does not like quoted pipe elsewhere. @@ -100,7 +105,8 @@ endif() set(EXPR_OP1 "/") if((NOT MSVC OR PP_NMAKE) AND - NOT CMAKE_C_COMPILER_ID STREQUAL "Intel") + NOT CMAKE_C_COMPILER_ID STREQUAL "Intel" AND + NOT CLANG_GNULIKE_WINDOWS) # MSVC cl, Intel icl: % # When the cl compiler is invoked from the command line then % must # be written %% (to distinguish from %ENV% syntax). However cl does |