Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
35 changes: 18 additions & 17 deletions lib/ASTGen/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,20 +1,21 @@
add_subdirectory(Sources)

# If requested, build the regular expression parser into the compiler itself.
if(SWIFT_BUILD_REGEX_PARSER_IN_COMPILER)
file(GLOB_RECURSE _COMPILER_REGEX_PARSER_SOURCES
"${SWIFT_PATH_TO_STRING_PROCESSING_SOURCE}/Sources/_RegexParser/*.swift")
set(COMPILER_REGEX_PARSER_SOURCES)
foreach(source ${_COMPILER_REGEX_PARSER_SOURCES})
file(TO_CMAKE_PATH "${source}" source)
list(APPEND COMPILER_REGEX_PARSER_SOURCES ${source})
endforeach()
message(STATUS "Using Experimental String Processing library for _CompilerRegexParser (${SWIFT_PATH_TO_STRING_PROCESSING_SOURCE}).")

add_pure_swift_host_library(_CompilerRegexParser STATIC
"${COMPILER_REGEX_PARSER_SOURCES}"
)
else()
# Dummy target for dependencies
add_custom_target(_CompilerRegexParser)
if(NOT SWIFT_BUILD_REGEX_PARSER_IN_COMPILER)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we may want to allow the case where SWIFT_BUILD_SWIFT_SYNTAX is false, as add_pure_swift_host_library will bail without creating a target, and it looks like we force SWIFT_BUILD_REGEX_PARSER_IN_COMPILER off in that case:

swift/CMakeLists.txt

Lines 815 to 818 in 7ea2b3d

if(SWIFT_BUILD_REGEX_PARSER_IN_COMPILER AND NOT SWIFT_BUILD_SWIFT_SYNTAX)
message(WARNING "Force setting SWIFT_BUILD_REGEX_PARSER_IN_COMPILER=OFF because Swift parser integration is disabled")
set(SWIFT_BUILD_REGEX_PARSER_IN_COMPILER OFF)
endif()

cc @rintaro

message(FATAL_ERROR
"Unable to build ASTGen without Regex Parser support. "
"Please enable SWIFT_BUILD_REGEX_PARSER_IN_COMPILER.")
endif()

# Build the regular expression parser into the compiler itself.
file(GLOB_RECURSE _COMPILER_REGEX_PARSER_SOURCES
"${SWIFT_PATH_TO_STRING_PROCESSING_SOURCE}/Sources/_RegexParser/*.swift")
set(COMPILER_REGEX_PARSER_SOURCES)
foreach(source ${_COMPILER_REGEX_PARSER_SOURCES})
file(TO_CMAKE_PATH "${source}" source)
list(APPEND COMPILER_REGEX_PARSER_SOURCES ${source})
endforeach()
message(STATUS "Using Experimental String Processing library for _CompilerRegexParser (${SWIFT_PATH_TO_STRING_PROCESSING_SOURCE}).")

add_pure_swift_host_library(_CompilerRegexParser STATIC
"${COMPILER_REGEX_PARSER_SOURCES}"
)