This is an archive of the discontinued LLVM Phabricator instance.

[CMake][compiler-rt] Replace Windows backslashes with CMake ones
ClosedPublic

Authored by phosek on Jan 27 2020, 7:22 PM.

Details

Summary

XRay builds uses llvm-config to obtain the ldflags and libs and then
passes those to CMake. Unfortunately, this breaks on Windows because
CMake tries to interpret backslashes followed by certain characters
as flags. We need to rewrite these into forward slashes that are used
by CMake (even on Windows).

Diff Detail

Event Timeline

phosek created this revision.Jan 27 2020, 7:22 PM
Herald added projects: Restricted Project, Restricted Project. · View Herald TranscriptJan 27 2020, 7:23 PM
Herald added subscribers: llvm-commits, Restricted Project, mgorny, dberris. · View Herald Transcript
smeenai added inline comments.Jan 27 2020, 7:33 PM
compiler-rt/cmake/Modules/CompilerRTUtils.cmake
251–252

Does file(TO_CMAKE_PATH) work for this?

253

Why the addition of FORCE?

phosek updated this revision to Diff 241338.Jan 29 2020, 7:34 PM
phosek marked 4 inline comments as done.
phosek added inline comments.Jan 29 2020, 7:36 PM
compiler-rt/cmake/Modules/CompilerRTUtils.cmake
251–252

I tried it and it seems to work.

253

Leftover from debugging.

smeenai accepted this revision.Feb 4 2020, 5:23 PM

LGTM

At some point we should change this to use the LLVM CMake package instead of llvm-config, but that's way out of scope here, of course.

This revision is now accepted and ready to land.Feb 4 2020, 5:23 PM
This revision was automatically updated to reflect the committed changes.