try_compile: Trim whitespace from LINK_LIBRARIES entries
Commite65ef08b
(try_compile: Fix quoting of libraries in generated CMakeLists.txt, 2013-05-24) added quoting to entries specified in the LINK_LIBRARIES. However, if the input entries contain whitespace padding, that quoted whitespace causes an error in the generated CMakeLists.txt at target_link_libraries. Strictly, it is an error to have space separated entries in the CMAKE_REQUIRED_LIBRARIES, as it was never properly handled by CMakeExpandImportedTargets even prior to commit236133e7
(Handle targets in the LINK_LIBRARIES of try_compile., 2013-02-09). However, it is causing a regression in KDE code which tests the next branch.
This commit is contained in:
parent
e65ef08bf2
commit
e5375442ff
|
@ -111,7 +111,7 @@ int cmCoreTryCompile::TryCompileCode(std::vector<std::string> const& argv)
|
||||||
++i)
|
++i)
|
||||||
{
|
{
|
||||||
extraArgs++;
|
extraArgs++;
|
||||||
libsToLink += "\"" + argv[i] + "\" ";
|
libsToLink += "\"" + cmSystemTools::TrimWhitespace(argv[i]) + "\" ";
|
||||||
cmTarget *tgt = this->Makefile->FindTargetToUse(argv[i].c_str());
|
cmTarget *tgt = this->Makefile->FindTargetToUse(argv[i].c_str());
|
||||||
if (!tgt)
|
if (!tgt)
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in New Issue