summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2015-04-15 15:46:15 (GMT)
committerCMake Topic Stage <kwrobot@kitware.com>2015-04-15 15:46:15 (GMT)
commitea394c63aa39fed008eec86b19a304d04bb302cf (patch)
treedf83603b9820ce4d86d7d27eaad2dd750b98c58f
parentfc579b91e0c2f433c17ce004faa38863c15e8ead (diff)
parentbaef72f2b369b77507969e3362edfc8d7171c43a (diff)
downloadCMake-ea394c63aa39fed008eec86b19a304d04bb302cf.zip
CMake-ea394c63aa39fed008eec86b19a304d04bb302cf.tar.gz
CMake-ea394c63aa39fed008eec86b19a304d04bb302cf.tar.bz2
Merge topic 'test-xl-preprocess-updates'
baef72f2 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: