Skip to content

Commit 46dfee2

Browse files
committed
Get swiftLLVMSupport building
This patch gets the LLVM Support object files building.
1 parent 2503384 commit 46dfee2

File tree

3 files changed

+38
-0
lines changed

3 files changed

+38
-0
lines changed

Runtimes/Core/CMakeLists.txt

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
cmake_minimum_required(VERSION 3.26...3.29)
2+
list(APPEND CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/cmake/modules")
3+
project(SwiftCore LANGUAGES C CXX Swift VERSION 6.1)
4+
5+
# The Swift standard library is not intended for use as a sub-library as part of
6+
# another project. It is tightly coupled with the compiler version.
7+
if(NOT PROJECT_IS_TOP_LEVEL)
8+
message(FATAL_ERROR "Swift Core must build as a standalone project")
9+
endif()
10+
include(CompilerSettings)
11+
12+
include_directories(include)
13+
14+
add_subdirectory(LLVMSupport)
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
add_library(swiftLLVMSupport OBJECT
2+
ErrorHandling.cpp
3+
Hashing.cpp
4+
MemAlloc.cpp
5+
SmallPtrSet.cpp
6+
SmallVector.cpp
7+
StringRef.cpp)
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
# Use C+17
2+
set(SwiftCore_MIN_CXX_STANDARD 17)
3+
# Unset CMAKE_CXX_STANDARD if it's too low and in the CMakeCache.txt
4+
if($CACHE{CMAKE_CXX_STANDARD} AND $CACHE{CMAKE_CXX_STANDARD} LESS ${SwiftCore_MIN_CXX_STANDARD})
5+
message(WARNING "Resetting cache value for CMAKE_CXX_STANDARD to ${SwiftCore_MIN_CXX_STANDARD}")
6+
unset(CMAKE_CXX_STANDARD CACHE)
7+
endif()
8+
9+
# Allow manually specified CMAKE_CXX_STANDARD if it's greater than the minimum
10+
# required C++ version
11+
if(DEFINED CMAKE_CXX_STANDARD AND CMAKE_CXX_STANDARD LESS ${SwiftCore_MIN_CXX_STANDARD})
12+
message(FATAL_ERROR "Requested CMAKE_CXX_STANDARD=${CMAKE_CXX_STANDARD} which is less than the minimum C++ standard ${SwiftCore_MIN_CXX_STANDARD}")
13+
endif()
14+
15+
set(CMAKE_CXX_STANDARD ${SwiftCore_MIN_CXX_STANDARD} CACHE STRING "C++ standard to conform to")
16+
set(CMAKE_CXX_STANDARD_REQUIRED YES)
17+
set(CMAKE_CXX_EXTENSIONS NO)

0 commit comments

Comments
 (0)