Skip to content

Commit d7db651

Browse files
committed
[CMake] Get _RegexParser building
This is a first pass at getting the _RegexParser library building.
1 parent aa6b5c2 commit d7db651

File tree

2 files changed

+65
-0
lines changed

2 files changed

+65
-0
lines changed
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
cmake_minimum_required(VERSION 3.29)
2+
3+
set(CMAKE_POSITION_INDEPENDENT_CODE YES)
4+
5+
if($ENV{BUILD_NUMBER})
6+
math(EXPR BUILD_NUMBER "$ENV{BUILD_NUMBER} % 65535")
7+
set(BUILD_NUMBER ".${BUILD_NUMBER}")
8+
endif()
9+
project(SwiftStringProcessing
10+
LANGUAGES Swift C
11+
VERSION 6.1.0${BUILD_NUMBER})
12+
13+
if(NOT PROJECT_IS_TOP_LEVEL)
14+
message(FATAL_ERROR "Swift StringProcessing must build as a standalone project")
15+
endif()
16+
17+
set(${PROJECT_NAME}_SWIFTC_SOURCE_DIR
18+
"${PROJECT_SOURCE_DIR}/../../../"
19+
CACHE FILEPATH "Path to the root source directory of the Swift compiler")
20+
21+
find_package(SwiftCore)
22+
23+
add_compile_options(
24+
$<$<COMPILE_LANGUAGE:Swift>:-explicit-module-build>
25+
$<$<COMPILE_LANGUAGE:Swift>:-nostdlibimport>
26+
"$<$<COMPILE_LANGUAGE:Swift>:SHELL:-Xfrontend -disable-implicit-string-processing-module-import>")
27+
28+
add_subdirectory(_RegexParser)
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
add_library(swift_RegexParser
2+
Regex/TreeProtocols.swift
3+
Regex/Parse/DelimiterLexing.swift
4+
Regex/Parse/Source.swift
5+
Regex/Parse/CharacterPropertyClassification.swift
6+
Regex/Parse/LexicalAnalysis.swift
7+
Regex/Parse/SyntaxOptions.swift
8+
Regex/Parse/CaptureList.swift
9+
Regex/Parse/CompilerInterface.swift
10+
Regex/Parse/CaptureStructure.swift
11+
Regex/Parse/Parse.swift
12+
Regex/Parse/SourceLocation.swift
13+
Regex/Parse/Diagnostics.swift
14+
Regex/Parse/Sema.swift
15+
Regex/Printing/RenderRanges.swift
16+
Regex/Printing/PrettyPrinter.swift
17+
Regex/Printing/PrintAsCanonical.swift
18+
Regex/Printing/DumpAST.swift
19+
Regex/AST/ASTAction.swift
20+
Regex/AST/AST.swift
21+
Regex/AST/CustomCharClass.swift
22+
Regex/AST/Quantification.swift
23+
Regex/AST/Conditional.swift
24+
Regex/AST/MatchingOptions.swift
25+
Regex/AST/ASTProtocols.swift
26+
Regex/AST/Group.swift
27+
Regex/AST/Atom.swift
28+
Utility/TypeConstruction.swift
29+
Utility/Misc.swift
30+
Utility/AllScalars.swift
31+
Utility/Errors.swift
32+
Utility/MissingUnicode.swift)
33+
34+
target_link_libraries(swift_RegexParser PRIVATE swiftCore)
35+
36+
set_target_properties(swift_RegexParser PROPERTIES
37+
Swift_MODULE_NAME _RegexParser)

0 commit comments

Comments
 (0)