File tree Expand file tree Collapse file tree 1 file changed +12
-0
lines changed Expand file tree Collapse file tree 1 file changed +12
-0
lines changed Original file line number Diff line number Diff line change 88include (${LLVM_COMMON_CMAKE_UTILS} /Modules/CMakePolicy.cmake
99 NO_POLICY_SCOPE)
1010
11+ # If we are not building as a part of LLVM, build libc as an
12+ # standalone project, using LLVM as an external library:
13+ if (CMAKE_SOURCE_DIR STREQUAL CMAKE_CURRENT_SOURCE_DIR )
14+ project (libc)
15+ set (LIBC_BUILT_STANDALONE TRUE )
16+ endif ()
17+
1118if (LIBC_CMAKE_VERBOSE_LOGGING)
1219 get_directory_property (LIBC_OLD_PREPROCESSOR_DEFS COMPILE_DEFINITIONS )
1320 foreach (OLD_DEF ${LIBC_OLD_PREPROCESSOR_DEFS} )
@@ -30,6 +37,11 @@ endif()
3037# Default to C++17
3138set (CMAKE_CXX_STANDARD 17)
3239
40+ if (LIBC_BUILT_STANDALONE)
41+ find_package (Python3 ${LLVM_MINIMUM_PYTHON_VERSION} REQUIRED
42+ COMPONENTS Interpreter)
43+ endif ()
44+
3345list (APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR} /cmake/modules" )
3446
3547# The top-level source directory.
You can’t perform that action at this time.
0 commit comments