summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2009-11-30 16:16:24 (GMT)
committerBrad King <brad.king@kitware.com>2009-11-30 16:16:24 (GMT)
commit4f43c1f27660a37f91eccad70ac3b34b97336d6b (patch)
tree867c6aceb446df16c22ef9353f76bb09a6da950e
parent5152bf563922da0d493cb769bca8861e25a5791a (diff)
downloadCMake-4f43c1f27660a37f91eccad70ac3b34b97336d6b.zip
CMake-4f43c1f27660a37f91eccad70ac3b34b97336d6b.tar.gz
CMake-4f43c1f27660a37f91eccad70ac3b34b97336d6b.tar.bz2
Singly-quote target names for Watcom linker
The Watcom tools do their own command-line parsing and do not accept double-quotes. Instead we single-quote the target output name when invoking wlink and other Watcom tools. This fixes support for spaces in the target output directory path when it is not under the build tree.
-rw-r--r--Modules/Platform/Windows-wcl386.cmake8
-rw-r--r--Source/cmLocalGenerator.cxx10
2 files changed, 14 insertions, 4 deletions
diff --git a/Modules/Platform/Windows-wcl386.cmake b/Modules/Platform/Windows-wcl386.cmake
index 87a61d5..b260489 100644
--- a/Modules/Platform/Windows-wcl386.cmake
+++ b/Modules/Platform/Windows-wcl386.cmake
@@ -27,11 +27,11 @@ SET (CMAKE_C_STANDARD_LIBRARIES_INIT "library clbrdll.lib library plbrdll.lib l
SET (CMAKE_CXX_STANDARD_LIBRARIES_INIT "${CMAKE_C_STANDARD_LIBRARIES_INIT}")
SET(CMAKE_C_CREATE_IMPORT_LIBRARY
- "wlib -q -n -b <TARGET_IMPLIB> +<TARGET>")
+ "wlib -q -n -b <TARGET_IMPLIB> +'<TARGET_UNQUOTED>'")
SET(CMAKE_CXX_CREATE_IMPORT_LIBRARY ${CMAKE_C_CREATE_IMPORT_LIBRARY})
SET(CMAKE_C_LINK_EXECUTABLE
- "wlink ${CMAKE_START_TEMP_FILE} ${CMAKE_WLINK_QUIET} name <TARGET> option caseexact file {<OBJECTS>} <LINK_LIBRARIES> ${CMAKE_END_TEMP_FILE}")
+ "wlink ${CMAKE_START_TEMP_FILE} ${CMAKE_WLINK_QUIET} name '<TARGET_UNQUOTED>' option caseexact file {<OBJECTS>} <LINK_LIBRARIES> ${CMAKE_END_TEMP_FILE}")
SET(CMAKE_CXX_LINK_EXECUTABLE ${CMAKE_C_LINK_EXECUTABLE})
@@ -52,7 +52,7 @@ SET(CMAKE_CXX_CREATE_PREPROCESSED_SOURCE
"<CMAKE_CXX_COMPILER> ${CMAKE_START_TEMP_FILE} ${CMAKE_WCL_QUIET} <FLAGS> -dWIN32 -d+ <DEFINES> -fo<PREPROCESSED_SOURCE> -pl -cc++ <SOURCE>${CMAKE_END_TEMP_FILE}")
SET(CMAKE_CXX_CREATE_SHARED_MODULE
- "wlink ${CMAKE_START_TEMP_FILE} system nt_dll ${CMAKE_WLINK_QUIET} name <TARGET> option caseexact file {<OBJECTS>} <LINK_LIBRARIES> ${CMAKE_END_TEMP_FILE}")
+ "wlink ${CMAKE_START_TEMP_FILE} system nt_dll ${CMAKE_WLINK_QUIET} name '<TARGET_UNQUOTED>' option caseexact file {<OBJECTS>} <LINK_LIBRARIES> ${CMAKE_END_TEMP_FILE}")
SET(CMAKE_CXX_CREATE_SHARED_LIBRARY
${CMAKE_CXX_CREATE_SHARED_MODULE}
${CMAKE_CXX_CREATE_IMPORT_LIBRARY})
@@ -64,7 +64,7 @@ SET(CMAKE_C_CREATE_SHARED_LIBRARY ${CMAKE_CXX_CREATE_SHARED_LIBRARY})
SET(CMAKE_C_CREATE_SHARED_MODULE ${CMAKE_CXX_CREATE_SHARED_MODULE})
# create a C++ static library
-SET(CMAKE_CXX_CREATE_STATIC_LIBRARY "wlib ${CMAKE_LIB_QUIET} -n -b <TARGET> <OBJECTS> ")
+SET(CMAKE_CXX_CREATE_STATIC_LIBRARY "wlib ${CMAKE_LIB_QUIET} -n -b '<TARGET_UNQUOTED>' <OBJECTS> ")
# create a C static library
SET(CMAKE_C_CREATE_STATIC_LIBRARY ${CMAKE_CXX_CREATE_STATIC_LIBRARY})
diff --git a/Source/cmLocalGenerator.cxx b/Source/cmLocalGenerator.cxx
index 5c86992..3339ee4 100644
--- a/Source/cmLocalGenerator.cxx
+++ b/Source/cmLocalGenerator.cxx
@@ -911,6 +911,16 @@ cmLocalGenerator::ExpandRuleVariable(std::string const& variable,
}
return targetQuoted;
}
+ if(variable == "TARGET_UNQUOTED")
+ {
+ std::string unquoted = replaceValues.Target;
+ std::string::size_type sz = unquoted.size();
+ if(sz > 2 && unquoted[0] == '\"' && unquoted[sz-1] == '\"')
+ {
+ unquoted = unquoted.substr(1, sz-2);
+ }
+ return unquoted;
+ }
if(replaceValues.LanguageCompileFlags)
{
if(variable == "LANGUAGE_COMPILE_FLAGS")