[LLVMdev] [CMake] Generated LLVMConfig.cmake and LLVMExports.cmake broken under Visual Studio 2015

Alexander Aprelev alexander at aprelev.com
Fri Jun 19 12:13:22 PDT 2015


FYI, llvm/clang r240139 with Dan's patch seems to build fine on Windows with VS2015.

________________________________________
From: llvmdev-bounces at cs.uiuc.edu <llvmdev-bounces at cs.uiuc.edu> on behalf of Brad King <brad.king at kitware.com>
Sent: Friday, June 19, 2015 8:41 AM
To: Dan Liew; LLVM Developers Mailing List
Cc: aam at google.com
Subject: Re: [LLVMdev] [CMake] Generated LLVMConfig.cmake and LLVMExports.cmake broken under Visual Studio 2015

On 06/18/2015 06:46 PM, Dan Liew wrote:
>> The issue is the that that generated LLVMExports.cmake file has this in it
>>   INTERFACE_LINK_LIBRARIES "LLVMObject;LLVMSupport;C:\Program Files (x86)\Microsoft Visual Studio 14.0\DIA SDK\lib\diaguids.lib"
>
> Hmm actually this might be a bug in the
> ``/lib/DebugInfo/PDB/CMakeLists.txt`` file. CC'ing Zach Turner seeing
> as he appears to be the author.
>
> -  set(LIBPDB_ADDITIONAL_LIBRARIES "${LIBPDB_LINK_FOLDERS}\\diaguids.lib")
> +  file(TO_CMAKE_PATH "${LIBPDB_LINK_FOLDERS}\\diaguids.lib" LIBPDB_ADDITIONAL_LIBRARIES)

That should resolve the issue for LLVM with no changes to CMake.

However, CMake should also be taught to escape the backslashes correctly
when generating the export files.  Take a look at

 Source/cmExportFileGenerator.cxx
 Source/cmExportBuildFileGenerator.cxx
 Source/cmExportInstallFileGenerator.cxx

in the CMake source tree.  There are several places that just generate
double quotes around a raw value that should instead use EscapeForCMake.

Thanks,
-Brad

_______________________________________________
LLVM Developers mailing list
LLVMdev at cs.uiuc.edu         http://llvm.cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev



More information about the llvm-dev mailing list