This is an archive of the discontinued LLVM Phabricator instance.

Fix an issue of creating symlinks when llvm is embedded
AbandonedPublic

Authored by v.g.vassilev on May 23 2017, 8:07 AM.

Details

Reviewers
beanz
rnk
Summary

We configure with llvm with a script not from the command line. When trying to create a symlink we try to get a value from target property RUNTIME_OUTPUT_DIRECTORY_RELEASE which is only conditionally set (see set_output_directory).

Adjust the condition to match the conditional addition in `set_output_directory.

Diff Detail

Event Timeline

v.g.vassilev created this revision.May 23 2017, 8:07 AM

Remove extra blank line.

beanz edited edge metadata.May 31 2017, 11:44 AM

How are you configuring? Unless I'm misunderstanding something when CMAKE_CONFIGURATION_TYPES is set CMAKE_CFG_INTDIR will never be ".".

The documentation of CMAKE_CFG_INTDIR lists its expansions (https://cmake.org/cmake/help/v3.0/variable/CMAKE_CFG_INTDIR.html), and the only case where it should be "." is if you're using a non-IDE generator. In which case CMAKE_CONFIGURATION_TYPES would be unset.

Are you overriding CMAKE_CFG_INTDIR? Because that would be bad.

Thanks for looking into this.

We have a copy of llvm in the framework. We configure it from here: https://github.com/vgvassilev/root/blob/update-llvm-to-r302975/interpreter/CMakeLists.txt

Does that help?

beanz added a comment.May 31 2017, 1:52 PM

Unfortunately that doesn't really explain the need for these patches. From searching GitHub it doesn't seem like your project is overriding CMAKE_CFG_INTDIR. What is your CMake command line?

This seems to me like a problem with your integration of LLVM into your project's build system, not a problem with LLVM's build system itself.

v.g.vassilev added inline comments.May 31 2017, 2:06 PM
cmake/modules/AddLLVM.cmake
220

@beanz, for some reason we when configuring we do not enter here. So we do not get a property RUNTIME_OUTPUT_DIRECTORY_${CONFIG_SUFFIX}, when calling add_llvm_tool_symlink we have CMAKE_CONFIGURATION_TYPES so we enter in the branch where we should have set the property...

v.g.vassilev abandoned this revision.Jun 13 2017, 11:51 AM

That was a bug on our end. @beanz, thanks for pinpointing it and sorry for the noise!