summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2015-04-14 15:03:48 (GMT)
committerBrad King <brad.king@kitware.com>2015-04-14 15:03:48 (GMT)
commitbaef72f2b369b77507969e3362edfc8d7171c43a (patch)
tree4273fd15183f8cf3c8ba282f827557604320f67c
parentcdc53b62c20605467334ecb80c474533e04ff26c (diff)
downloadCMake-baef72f2b369b77507969e3362edfc8d7171c43a.zip
CMake-baef72f2b369b77507969e3362edfc8d7171c43a.tar.gz
CMake-baef72f2b369b77507969e3362edfc8d7171c43a.tar.bz2
Tests: Update Preprocess test for XL compiler limitations
-rw-r--r--Tests/Preprocess/CMakeLists.txt16
1 files changed, 14 insertions, 2 deletions
diff --git a/Tests/Preprocess/CMakeLists.txt b/Tests/Preprocess/CMakeLists.txt
index 8ff0cfd..15e2aca 100644
--- a/Tests/Preprocess/CMakeLists.txt
+++ b/Tests/Preprocess/CMakeLists.txt
@@ -134,6 +134,15 @@ if((NOT MSVC OR PP_NMAKE) AND
set(EXPR_OP1 "%")
endif()
+# XL: )(
+# The XL compiler cannot pass unbalanced parens correctly to a tool
+# it launches internally.
+if(CMAKE_C_COMPILER_ID STREQUAL "XL")
+ set(STRING_EXTRA "${STRING_EXTRA}()")
+else()
+ set(STRING_EXTRA "${STRING_EXTRA})(")
+endif()
+
# General: \"
# Make tools do not reliably accept \\\" syntax:
# - MinGW and MSYS make tools crash with \\\"
@@ -141,7 +150,10 @@ endif()
# or $(BACKSLASH)\" where BACKSLASH is a variable set to \\
# - VS IDE gets confused about the bounds of the definition value \\\"
# - NMake is okay with just \\\"
-if(PP_NMAKE OR PP_UMAKE)
+# - The XL compiler does not re-escape \\\" when launching an
+# internal tool to do preprocessing .
+if((PP_NMAKE OR PP_UMAKE) AND
+ NOT CMAKE_C_COMPILER_ID STREQUAL "XL")
set(STRING_EXTRA "${STRING_EXTRA}\\\"")
endif()
@@ -160,7 +172,7 @@ endif()
# support it and it is not an operator it is not worthwhile.
# Compose the final test string.
-set(STRING_VALUE "hello`~!@$*)(_+-=}{][:'.?/${STRING_EXTRA}world")
+set(STRING_VALUE "hello`~!@$*_+-=}{][:'.?/${STRING_EXTRA}world")
#-----------------------------------------------------------------------------
# Function-style macro command-line support: