File tree Expand file tree Collapse file tree 3 files changed +38
-0
lines changed Expand file tree Collapse file tree 3 files changed +38
-0
lines changed Original file line number Diff line number Diff line change
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 )
Original file line number Diff line number Diff line change
1
+ add_library (swiftLLVMSupport OBJECT
2
+ ErrorHandling.cpp
3
+ Hashing.cpp
4
+ MemAlloc.cpp
5
+ SmallPtrSet.cpp
6
+ SmallVector.cpp
7
+ StringRef.cpp )
Original file line number Diff line number Diff line change
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 )
You can’t perform that action at this time.
0 commit comments