This is an archive of the discontinued LLVM Phabricator instance.

[llvm/cmake] Replace CMAKE_SOURCE_DIR with PROJECT_SOURCE_DIR
ClosedPublic

Authored by sebastian-ne on Jan 11 2023, 9:55 AM.

Details

Summary

When adding llvm to a build with add_subdirectory, CMAKE_SOURCE_DIR
refers to the source directory of the parent project. We want to use
PROJECT_SOURCE_DIR instead.

Diff Detail

Event Timeline

sebastian-ne created this revision.Jan 11 2023, 9:55 AM
Herald added a project: Restricted Project. · View Herald TranscriptJan 11 2023, 9:55 AM
sebastian-ne requested review of this revision.Jan 11 2023, 9:55 AM
foad accepted this revision.Jan 12 2023, 2:23 AM
foad added subscribers: fpetrogalli, foad.

LGTM, thanks! In particular the fix to include/llvm/TargetParser/CMakeLists.txt fixes a build error when LLVM is included as a sub-project and the RISCV target is not being built. @fpetrogalli FYI

This revision is now accepted and ready to land.Jan 12 2023, 2:23 AM

LGTM, thanks! In particular the fix to include/llvm/TargetParser/CMakeLists.txt fixes a build error when LLVM is included as a sub-project and the RISCV target is not being built. @fpetrogalli FYI

Thank you for the fix!

This revision was landed with ongoing or failed builds.Jan 12 2023, 2:37 AM
This revision was automatically updated to reflect the committed changes.