Skip to content

Commit

Permalink
Remove usage of --src-root with llvm-config
Browse files Browse the repository at this point in the history
  • Loading branch information
stephanlachnit authored and jenkins committed Aug 2, 2023
1 parent 5a58c4f commit 798c565
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 10 deletions.
5 changes: 1 addition & 4 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,7 @@ if( CMAKE_SOURCE_DIR STREQUAL CMAKE_CURRENT_SOURCE_DIR )
"--bindir"
"--libdir"
"--includedir"
"--prefix"
"--src-root")
"--prefix")
execute_process(
COMMAND ${CONFIG_COMMAND}
RESULT_VARIABLE HAD_ERROR
Expand All @@ -47,7 +46,6 @@ if( CMAKE_SOURCE_DIR STREQUAL CMAKE_CURRENT_SOURCE_DIR )
list(GET CONFIG_OUTPUT 2 LIBRARY_DIR)
list(GET CONFIG_OUTPUT 3 INCLUDE_DIR)
list(GET CONFIG_OUTPUT 4 LLVM_OBJ_ROOT)
list(GET CONFIG_OUTPUT 5 MAIN_SRC_DIR)

if(NOT MSVC_IDE)
set(LLVM_ENABLE_ASSERTIONS ${ENABLE_ASSERTIONS}
Expand All @@ -60,7 +58,6 @@ if( CMAKE_SOURCE_DIR STREQUAL CMAKE_CURRENT_SOURCE_DIR )
set(LLVM_LIBRARY_DIR ${LIBRARY_DIR} CACHE PATH "Path to llvm/lib")
set(LLVM_MAIN_INCLUDE_DIR ${INCLUDE_DIR} CACHE PATH "Path to llvm/include")
set(LLVM_BINARY_DIR ${LLVM_OBJ_ROOT} CACHE PATH "Path to LLVM build tree")
set(LLVM_MAIN_SRC_DIR ${MAIN_SRC_DIR} CACHE PATH "Path to LLVM source tree")

find_program(LLVM_TABLEGEN_EXE "llvm-tblgen" ${LLVM_TOOLS_BINARY_DIR}
NO_DEFAULT_PATH)
Expand Down
10 changes: 4 additions & 6 deletions tools/packaging/cpt.py
Original file line number Diff line number Diff line change
Expand Up @@ -799,12 +799,10 @@ def setup_tests():
exec_subprocess_call("cmake {0}".format(LLVM_OBJ_ROOT), CLING_SRC_DIR)
exec_subprocess_call("cmake --build . --target FileCheck -- -j{0}".format(multiprocessing.cpu_count()), LLVM_OBJ_ROOT)
if not os.path.exists(os.path.join(CLING_SRC_DIR, "..", "clang", "test")):
llvm_dir = exec_subprocess_check_output("llvm-config --src-root", ".").strip()
if llvm_dir == "":
if tar_required:
llvm_dir = copy.copy(srcdir)
else:
llvm_dir = os.path.join("/usr", "lib", "llvm-" + llvm_vers, "build")
if tar_required:
llvm_dir = copy.copy(srcdir)
else:
llvm_dir = os.path.join("/usr", "lib", "llvm-" + llvm_vers, "build")
subprocess.Popen(
["sudo mkdir {0}/utils/".format(llvm_dir)],
cwd=os.path.join(CLING_SRC_DIR, "tools"),
Expand Down

0 comments on commit 798c565

Please sign in to comment.