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 8
8
include (${LLVM_COMMON_CMAKE_UTILS} /Modules/CMakePolicy.cmake
9
9
NO_POLICY_SCOPE )
10
10
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
+
11
18
if (LIBC_CMAKE_VERBOSE_LOGGING )
12
19
get_directory_property (LIBC_OLD_PREPROCESSOR_DEFS COMPILE_DEFINITIONS )
13
20
foreach (OLD_DEF ${LIBC_OLD_PREPROCESSOR_DEFS} )
@@ -30,6 +37,11 @@ endif()
30
37
# Default to C++17
31
38
set (CMAKE_CXX_STANDARD 17 )
32
39
40
+ if (LIBC_BUILT_STANDALONE )
41
+ find_package (Python3 ${LLVM_MINIMUM_PYTHON_VERSION} REQUIRED
42
+ COMPONENTS Interpreter )
43
+ endif ()
44
+
33
45
list (APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR} /cmake/modules" )
34
46
35
47
# The top-level source directory.
You can’t perform that action at this time.
0 commit comments