[libcxx-commits] [libcxx] 88af3dd - build: update libc++ as there are some bots with integrated build
Saleem Abdulrasool via libcxx-commits
libcxx-commits at lists.llvm.org
Tue Apr 28 13:07:52 PDT 2020
Author: Saleem Abdulrasool
Date: 2020-04-28T20:07:28Z
New Revision: 88af3ddb1e8a84399610daf59f0bb083289831c7
URL: https://github.com/llvm/llvm-project/commit/88af3ddb1e8a84399610daf59f0bb083289831c7
DIFF: https://github.com/llvm/llvm-project/commit/88af3ddb1e8a84399610daf59f0bb083289831c7.diff
LOG: build: update libc++ as there are some bots with integrated build
Some of the builders are building with C++ in the unified build. Merge
this without review to try to restore the builder.
Added:
Modified:
libcxx/CMakeLists.txt
libcxx/include/CMakeLists.txt
libcxx/src/CMakeLists.txt
Removed:
################################################################################
diff --git a/libcxx/CMakeLists.txt b/libcxx/CMakeLists.txt
index b05cad79d76a..65b00fcb4695 100644
--- a/libcxx/CMakeLists.txt
+++ b/libcxx/CMakeLists.txt
@@ -41,11 +41,35 @@ if (CMAKE_SOURCE_DIR STREQUAL CMAKE_CURRENT_SOURCE_DIR OR LIBCXX_STANDALONE_BUIL
endif()
if (LIBCXX_STANDALONE_BUILD)
- include(FindPythonInterp)
- if( NOT PYTHONINTERP_FOUND )
- message(WARNING "Failed to find python interpreter. "
- "The libc++ test suite will be disabled.")
- set(LLVM_INCLUDE_TESTS OFF)
+ if(CMAKE_VERSION VERSION_LESS 3.12)
+ include(FindPythonInterp)
+ if( NOT PYTHONINTERP_FOUND )
+ if(LIBCXX_ENABLE_STATIC)
+ message(FATAL_ERROR "Python is required for building the static library")
+ endif()
+ message(WARNING "Failed to find python interpreter. "
+ "The libc++ test suite will be disabled.")
+ set(LLVM_INCLUDE_TESTS OFF)
+ else()
+ add_executable(Python3::Interpreter IMPORTED)
+ set_target_properties(Python3::Interpreter PROPERTIES
+ IMPORTED_LOCATION ${PYTHON_EXECUTABLE})
+ endif()
+ else()
+ 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()
endif()
diff --git a/libcxx/include/CMakeLists.txt b/libcxx/include/CMakeLists.txt
index 433bf67fbcb9..250d804f800e 100644
--- a/libcxx/include/CMakeLists.txt
+++ b/libcxx/include/CMakeLists.txt
@@ -187,7 +187,7 @@ if (LIBCXX_NEEDS_SITE_CONFIG)
# Generate a custom __config header. The new header is created
# by prepending __config_site to the current __config header.
add_custom_command(OUTPUT ${LIBCXX_BINARY_DIR}/__generated_config
- COMMAND ${PYTHON_EXECUTABLE} ${LIBCXX_SOURCE_DIR}/utils/cat_files.py
+ COMMAND ${Python3_EXECUTABLE} ${LIBCXX_SOURCE_DIR}/utils/cat_files.py
${LIBCXX_BINARY_DIR}/__config_site
${LIBCXX_SOURCE_DIR}/include/__config
-o ${LIBCXX_BINARY_DIR}/__generated_config
diff --git a/libcxx/src/CMakeLists.txt b/libcxx/src/CMakeLists.txt
index b55946f6cac3..898ec027f326 100644
--- a/libcxx/src/CMakeLists.txt
+++ b/libcxx/src/CMakeLists.txt
@@ -283,7 +283,7 @@ if (LIBCXX_ENABLE_STATIC)
endif()
add_custom_command(TARGET cxx_static POST_BUILD
COMMAND
- ${PYTHON_EXECUTABLE} ${LIBCXX_SOURCE_DIR}/utils/merge_archives.py
+ ${Python3_EXECUTABLE} ${LIBCXX_SOURCE_DIR}/utils/merge_archives.py
ARGS
-o $<TARGET_LINKER_FILE:cxx_static>
--ar "${CMAKE_AR}"
More information about the libcxx-commits
mailing list