浏览代码

try_compile: Fix quoting of libraries in generated CMakeLists.txt

Since commit 236133e7 (Handle targets in the LINK_LIBRARIES of
try_compile, 2013-02-09) libraries passed to the new LINK_LIBRARIES
option of try_compile are not quoted inside the generated CMakeLists.txt
file.  Quote the library names so they re-parse correctly when loaded by
CMake to configure and generate the test project.

Reported-by: Bogdan Cristea <[email protected]>
Brad King 12 年之前
父节点
当前提交
e65ef08bf2
共有 1 个文件被更改,包括 1 次插入1 次删除
  1. 1 1
      Source/cmCoreTryCompile.cxx

+ 1 - 1
Source/cmCoreTryCompile.cxx

@@ -111,7 +111,7 @@ int cmCoreTryCompile::TryCompileCode(std::vector<std::string> const& argv)
           ++i)
         {
         extraArgs++;
-        libsToLink += argv[i] + " ";
+        libsToLink += "\"" + argv[i] + "\" ";
         cmTarget *tgt = this->Makefile->FindTargetToUse(argv[i].c_str());
         if (!tgt)
           {