[Lldb-commits] [lldb] r366639 - build: allow the user to specify `llvm-tblgen`
Saleem Abdulrasool via lldb-commits
lldb-commits at lists.llvm.org
Sat Jul 20 10:59:08 PDT 2019
Author: compnerd
Date: Sat Jul 20 10:59:08 2019
New Revision: 366639
URL: http://llvm.org/viewvc/llvm-project?rev=366639&view=rev
Log:
build: allow the user to specify `llvm-tblgen`
This follows the same pattern as Clang and permits the user to specify
the tablegen to use via `-DLLVM_TABLEGEN=`. This allows for
cross-compiling LLDB for a foreign target (e.g. Windows ARM64 on Windows
X64). The LLVM dependency for LLDB in that case must be a Windows ARM64
build which cannot cross-compile llvm-tblgen due to the way that Visual
Studio works. Instead, permit the user to have a separate tablegen
build which can be used during the build.
Modified:
lldb/trunk/cmake/modules/LLDBStandalone.cmake
Modified: lldb/trunk/cmake/modules/LLDBStandalone.cmake
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/cmake/modules/LLDBStandalone.cmake?rev=366639&r1=366638&r2=366639&view=diff
==============================================================================
--- lldb/trunk/cmake/modules/LLDBStandalone.cmake (original)
+++ lldb/trunk/cmake/modules/LLDBStandalone.cmake Sat Jul 20 10:59:08 2019
@@ -31,31 +31,35 @@ append_configuration_directories(${LLVM_
find_program(lit_full_path ${lit_file_name} ${config_dirs} NO_DEFAULT_PATH)
set(LLVM_DEFAULT_EXTERNAL_LIT ${lit_full_path} CACHE PATH "Path to llvm-lit")
-if(CMAKE_CROSSCOMPILING)
- set(LLVM_NATIVE_BUILD "${LLVM_BINARY_DIR}/NATIVE")
- if (NOT EXISTS "${LLVM_NATIVE_BUILD}")
- message(FATAL_ERROR
- "Attempting to cross-compile LLDB standalone but no native LLVM build
- found. Please cross-compile LLVM as well.")
- endif()
+if(LLVM_TABLEGEN)
+ set(LLVM_TABLEGEN_EXE ${LLVM_TABLEGEN})
+else()
+ if(CMAKE_CROSSCOMPILING)
+ set(LLVM_NATIVE_BUILD "${LLVM_BINARY_DIR}/NATIVE")
+ if (NOT EXISTS "${LLVM_NATIVE_BUILD}")
+ message(FATAL_ERROR
+ "Attempting to cross-compile LLDB standalone but no native LLVM build
+ found. Please cross-compile LLVM as well.")
+ endif()
- if (CMAKE_HOST_SYSTEM_NAME MATCHES "Windows")
- set(HOST_EXECUTABLE_SUFFIX ".exe")
- endif()
+ if (CMAKE_HOST_SYSTEM_NAME MATCHES "Windows")
+ set(HOST_EXECUTABLE_SUFFIX ".exe")
+ endif()
- if (NOT CMAKE_CONFIGURATION_TYPES)
- set(LLVM_TABLEGEN_EXE
- "${LLVM_NATIVE_BUILD}/bin/llvm-tblgen${HOST_EXECUTABLE_SUFFIX}")
+ if (NOT CMAKE_CONFIGURATION_TYPES)
+ set(LLVM_TABLEGEN_EXE
+ "${LLVM_NATIVE_BUILD}/bin/llvm-tblgen${HOST_EXECUTABLE_SUFFIX}")
+ else()
+ # NOTE: LLVM NATIVE build is always built Release, as is specified in
+ # CrossCompile.cmake
+ set(LLVM_TABLEGEN_EXE
+ "${LLVM_NATIVE_BUILD}/Release/bin/llvm-tblgen${HOST_EXECUTABLE_SUFFIX}")
+ endif()
else()
- # NOTE: LLVM NATIVE build is always built Release, as is specified in
- # CrossCompile.cmake
- set(LLVM_TABLEGEN_EXE
- "${LLVM_NATIVE_BUILD}/Release/bin/llvm-tblgen${HOST_EXECUTABLE_SUFFIX}")
+ set(tblgen_file_name "llvm-tblgen${CMAKE_EXECUTABLE_SUFFIX}")
+ append_configuration_directories(${LLVM_TOOLS_BINARY_DIR} config_dirs)
+ find_program(LLVM_TABLEGEN_EXE ${tblgen_file_name} ${config_dirs} NO_DEFAULT_PATH)
endif()
-else()
- set(tblgen_file_name "llvm-tblgen${CMAKE_EXECUTABLE_SUFFIX}")
- append_configuration_directories(${LLVM_TOOLS_BINARY_DIR} config_dirs)
- find_program(LLVM_TABLEGEN_EXE ${tblgen_file_name} ${config_dirs} NO_DEFAULT_PATH)
endif()
# They are used as destination of target generators.
More information about the lldb-commits
mailing list