-
Notifications
You must be signed in to change notification settings - Fork 12.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[BOLT] Enable standalone build (#97130)
Summary: Continue from #87196 as author did not have much time, I have taken over working on this PR. We would like to have this so it'll be easier to package for Nix. Can be tested by copying cmake, bolt, third-party, and llvm directories out into their own directory with this PR applied and then build bolt. --------- Co-authored-by: pca006132 <[email protected]> Test Plan: Reviewers: Subscribers: Tasks: Tags: Differential Revision: https://phabricator.intern.facebook.com/D60250600
- Loading branch information
1 parent
185f5e7
commit 1194214
Showing
14 changed files
with
199 additions
and
26 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,39 @@ | ||
find_first_existing_vc_file("${LLVM_MAIN_SRC_DIR}" llvm_vc) | ||
find_first_existing_vc_file("${BOLT_SOURCE_DIR}" bolt_vc) | ||
|
||
# The VC revision include that we want to generate. | ||
set(version_inc "${CMAKE_CURRENT_BINARY_DIR}/VCSVersion.inc") | ||
|
||
set(generate_vcs_version_script "${LLVM_CMAKE_DIR}/GenerateVersionFromVCS.cmake") | ||
|
||
# Create custom target to generate the VC revision include. | ||
add_custom_command(OUTPUT "${version_inc}" | ||
DEPENDS "${llvm_vc}" "${bolt_vc}" "${generate_vcs_version_script}" | ||
COMMAND ${CMAKE_COMMAND} "-DNAMES=BOLT" | ||
"-DHEADER_FILE=${version_inc}" | ||
"-DBOLT_SOURCE_DIR=${BOLT_SOURCE_DIR}" | ||
"-DLLVM_VC_REPOSITORY=${llvm_vc_repository}" | ||
"-DLLVM_VC_REVISION=${llvm_vc_revision}" | ||
"-DLLVM_FORCE_VC_REVISION=${LLVM_FORCE_VC_REVISION}" | ||
"-DLLVM_FORCE_VC_REPOSITORY=${LLVM_FORCE_VC_REPOSITORY}" | ||
-P "${generate_vcs_version_script}") | ||
|
||
# Mark the generated header as being generated. | ||
set_source_files_properties("${version_inc}" | ||
PROPERTIES GENERATED TRUE | ||
HEADER_FILE_ONLY TRUE) | ||
|
||
include_directories(${CMAKE_CURRENT_BINARY_DIR}) | ||
|
||
add_llvm_library(LLVMBOLTUtils | ||
CommandLineOpts.cpp | ||
Utils.cpp | ||
|
||
${version_inc} | ||
DISABLE_LLVM_LINK_LLVM_DYLIB | ||
|
||
LINK_LIBS | ||
${LLVM_PTHREAD_LIB} | ||
|
||
DEPENDS | ||
llvm_vcsrevision_h | ||
|
||
LINK_COMPONENTS | ||
Support | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters