mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
ASTGen always builds with the host Swift compiler, without requiring bootstrapping, and is enabled in more places. Move the regex literal parsing logic there so it is enabled in more host environments, and makes use of CMake's Swift support. Enable all of the regex literal tests when ASTGen is built, to ensure everything is working. Remove the "AST" and "Parse" Swift modules from SwiftCompilerSources, because they are no longer needed.
74 lines
1.5 KiB
CMake
74 lines
1.5 KiB
CMake
|
|
|
|
if(CMAKE_HOST_SYSTEM_NAME STREQUAL "Windows")
|
|
set(SWIFT_GYB_FLAGS --line-directive "^\"#line %(line)d \\\"%(file)s\\\"^\"")
|
|
else()
|
|
set(SWIFT_GYB_FLAGS --line-directive "\'#line" "%(line)d" "\"%(file)s\"\'")
|
|
endif()
|
|
|
|
add_swift_host_library(swiftParse STATIC
|
|
Confusables.cpp
|
|
Lexer.cpp
|
|
ParseBridging.cpp
|
|
ParseDecl.cpp
|
|
ParseExpr.cpp
|
|
ParseGeneric.cpp
|
|
ParseIfConfig.cpp
|
|
ParsePattern.cpp
|
|
Parser.cpp
|
|
ParseRegex.cpp
|
|
ParseRequests.cpp
|
|
ParseStmt.cpp
|
|
ParseType.cpp
|
|
ParseVersion.cpp
|
|
PersistentParserState.cpp)
|
|
target_link_libraries(swiftParse PRIVATE
|
|
swiftAST
|
|
)
|
|
|
|
if (SWIFT_BUILD_SWIFT_SYNTAX)
|
|
target_link_libraries(swiftParse
|
|
PRIVATE
|
|
SwiftBasicFormat
|
|
SwiftParser
|
|
SwiftParserDiagnostics
|
|
SwiftDiagnostics
|
|
SwiftSyntax
|
|
SwiftOperators
|
|
SwiftSyntaxBuilder
|
|
SwiftSyntaxMacros
|
|
swiftASTGen
|
|
)
|
|
|
|
add_dependencies(swiftParse
|
|
SwiftBasicFormat
|
|
SwiftParser
|
|
SwiftParserDiagnostics
|
|
SwiftDiagnostics
|
|
SwiftSyntax
|
|
SwiftOperators
|
|
SwiftSyntaxBuilder
|
|
SwiftSyntaxMacros
|
|
swiftASTGen
|
|
)
|
|
|
|
target_compile_definitions(swiftParse
|
|
PRIVATE
|
|
SWIFT_BUILD_SWIFT_SYNTAX
|
|
)
|
|
endif()
|
|
|
|
if(SWIFT_BUILD_REGEX_PARSER_IN_COMPILER)
|
|
target_compile_definitions(swiftParse
|
|
PRIVATE
|
|
SWIFT_BUILD_REGEX_PARSER_IN_COMPILER
|
|
)
|
|
endif()
|
|
|
|
if(SWIFT_COMPILER_VERSION)
|
|
set_property(SOURCE ParseVersion.cpp APPEND_STRING PROPERTY COMPILE_FLAGS
|
|
" -DSWIFT_COMPILER_VERSION=\"\\\"${SWIFT_COMPILER_VERSION}\\\"\"")
|
|
endif()
|
|
|
|
set_swift_llvm_is_available(swiftParse)
|