[cmake-developers] [CMake 0015596]: CMakeClDeps.cmake doesn't work if CC contains arguments
Mantis Bug Tracker
mantis at public.kitware.com
Fri May 29 13:47:38 EDT 2015
The following issue has been SUBMITTED.
======================================================================
http://www.cmake.org/Bug/view.php?id=15596
======================================================================
Reported By: Reid Kleckner
Assigned To:
======================================================================
Project: CMake
Issue ID: 15596
Category: (No Category)
Reproducibility: have not tried
Severity: minor
Priority: normal
Status: new
======================================================================
Date Submitted: 2015-05-29 13:47 EDT
Last Modified: 2015-05-29 13:47 EDT
======================================================================
Summary: CMakeClDeps.cmake doesn't work if CC contains
arguments
Description:
I am attempting to do a 32-bit self-host of clang on Windows with a 64-bit
clang-cl binary. By default, the 64-bit binary generates 64-bit code, so I need
to pass the -m32 flag to override that. I figured the most robust way to do this
is something like setting CC="clang-cl -m32" and running cmake.
This *almost* worked, but CMakeCLDeps.cmake runs CMAKE_C_COMPILER without the
flags present in CC, and the link failed. It's regex then matched the error
message from LINK, and I got this in rules.ninja:
msvc_deps_prefix = LINK : error LNK2001:
CMakeClDeps.cmake doesn't actually need to do a link, so one easy workaround
would be to add /c to command line there. That's probably a good tweak in
general, since it saves an invocation of link.exe, and cuts down on moving
parts. :)
Aside from the workaround, is there a more canonical way that CMakeClDeps should
be invoking the compiler that includes flags from the CC env var?
======================================================================
Issue History
Date Modified Username Field Change
======================================================================
2015-05-29 13:47 Reid Kleckner New Issue
======================================================================
More information about the cmake-developers
mailing list