This is an archive of the discontinued LLVM Phabricator instance.

Compiler-RT CMake refactoring
ClosedPublic

Authored by george.karpenkov on Aug 14 2017, 5:59 PM.

Details

Summary

Convert macro to a function, generalize the output path using CMAKE_CFG_RESOLVED_INTDIR not to require branching for multi-output build systems.

Part 2 of splitting of https://reviews.llvm.org/D36116

Diff Detail

Event Timeline

vitalybuka edited edge metadata.Aug 14 2017, 6:03 PM

Could you please put meaning full description. Patch does meaningful things on it's own.

cmake/Modules/CompilerRTCompile.cmake
45

What is the difference between CMAKE_CFG_RESOLVED_INTDIR and CMAKE_CFG_INTDIR?

vitalybuka accepted this revision.Aug 14 2017, 6:03 PM
This revision is now accepted and ready to land.Aug 14 2017, 6:03 PM
cmake/Modules/CompilerRTCompile.cmake
45

It's a workaround for a CMake bug (https://gitlab.kitware.com/cmake/cmake/issues/17111)

Some build systems (VS) can output to multiple directories (debug/release/etc) at the same time. In those cases, there is a need for an extra output folder in the output path. In order not to guard all such usages with if CMAKE_CONFIGURATION_TYPES/else, CMake provides a CMAKE_CFG_INTDIR variable, which is resolved to "." on "normal" build systems, and to the corresponding folder on others. HOWEVER, CMake has a bug where compiling file names which start with "." (e.g. "./blah" in place of "blah") will get ignored (as the path would be resolved for the target output file, but not for the dependency list).
Thus I've created the RESOLVED version, which removes this problematic dot.

george.karpenkov edited the summary of this revision. (Show Details)Aug 14 2017, 6:09 PM
This revision was automatically updated to reflect the committed changes.