[libc] Add a library of standalone C++ utilities.
[lldb.git] / libc / CMakeLists.txt
1 cmake_minimum_required(VERSION 3.4.3)
2
3 # Use old version of target_sources command which converts the source
4 # file paths to full paths.
5 cmake_policy(SET CMP0076 OLD)
6 list(APPEND CMAKE_MODULE_PATH  "${CMAKE_CURRENT_SOURCE_DIR}/cmake/modules")
7
8 # The top-level source directory of libc.
9 set(LIBC_SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR})
10 # The top-level directory in which libc is being built.
11 set(LIBC_BUILD_DIR ${CMAKE_CURRENT_BINARY_DIR})
12
13 # Path libc/scripts directory.
14 set(LIBC_BUILD_SCRIPTS_DIR "${LIBC_SOURCE_DIR}/utils/build_scripts")
15
16
17 set(LIBC_TARGET_OS ${CMAKE_SYSTEM_NAME})
18 string(TOLOWER ${LIBC_TARGET_OS} LIBC_TARGET_OS)
19
20 set(LIBC_TARGET_MACHINE ${CMAKE_SYSTEM_PROCESSOR})
21
22 include(CMakeParseArguments)
23 include(LLVMLibCRules)
24
25 add_subdirectory(src)
26 add_subdirectory(config)
27 add_subdirectory(include)
28 add_subdirectory(utils)
29
30 # The lib and test directories are added at the very end as tests
31 # and libraries potentially draw from the components present in all
32 # of the other directories.
33 add_subdirectory(lib)
34 add_subdirectory(test)