mirror of
https://github.com/capstone-engine/llvm-capstone.git
synced 2024-11-24 14:20:17 +00:00
[libc++abi] Make sure we can run the tests in Standalone mode
The tests would previously fail if the `python` executable wasn't found, because we were missing the mandatory find_package.
This commit is contained in:
parent
0387015d75
commit
b888463f8d
@ -201,7 +201,8 @@ legacy-standalone)
|
||||
-DCMAKE_INSTALL_PREFIX="${INSTALL_DIR}" \
|
||||
-DLLVM_PATH="${MONOREPO_ROOT}/llvm" \
|
||||
-DLIBCXXABI_LIBCXX_PATH="${MONOREPO_ROOT}/libcxx" \
|
||||
-DLIBCXXABI_LIBCXX_INCLUDES="${MONOREPO_ROOT}/libcxx/include"
|
||||
-DLIBCXXABI_LIBCXX_INCLUDES="${MONOREPO_ROOT}/libcxx/include" \
|
||||
-DLIBCXXABI_LIBCXX_LIBRARY_PATH="${BUILD_DIR}/libcxx/lib"
|
||||
|
||||
echo "+++ Building libc++abi"
|
||||
ninja -C "${BUILD_DIR}/libcxxabi" cxxabi
|
||||
|
@ -48,6 +48,23 @@ if (CMAKE_SOURCE_DIR STREQUAL CMAKE_CURRENT_SOURCE_DIR OR LIBCXXABI_STANDALONE_B
|
||||
include(HandleOutOfTreeLLVM)
|
||||
endif()
|
||||
|
||||
if (LIBCXXABI_STANDALONE_BUILD)
|
||||
find_package(Python3 COMPONENTS Interpreter)
|
||||
if(NOT Python3_Interpreter_FOUND)
|
||||
message(WARNING "Python3 not found, using python2 as a fallback")
|
||||
find_package(Python2 COMPONENTS Interpreter REQUIRED)
|
||||
if(Python2_VERSION VERSION_LESS 2.7)
|
||||
message(SEND_ERROR "Python 2.7 or newer is required")
|
||||
endif()
|
||||
|
||||
# Treat python2 as python3
|
||||
add_executable(Python3::Interpreter IMPORTED)
|
||||
set_target_properties(Python3::Interpreter PROPERTIES
|
||||
IMPORTED_LOCATION ${Python2_EXECUTABLE})
|
||||
set(Python3_EXECUTABLE ${Python2_EXECUTABLE})
|
||||
endif()
|
||||
endif()
|
||||
|
||||
# Require out of source build.
|
||||
include(MacroEnsureOutOfSourceBuild)
|
||||
MACRO_ENSURE_OUT_OF_SOURCE_BUILD(
|
||||
|
Loading…
Reference in New Issue
Block a user