1- set (ASTGen_Swift_dependencies )
1+ add_subdirectory ( Sources )
22
33# If requested, build the regular expression parser into the compiler itself.
44if (SWIFT_BUILD_REGEX_PARSER_IN_COMPILER)
@@ -14,116 +14,7 @@ if(SWIFT_BUILD_REGEX_PARSER_IN_COMPILER)
1414 add_pure_swift_host_library(_CompilerRegexParser STATIC
1515 "${COMPILER_REGEX_PARSER_SOURCES} "
1616 )
17-
18- list (APPEND ASTGen_Swift_dependencies _CompilerRegexParser)
19- endif ()
20-
21- add_pure_swift_host_library(swiftASTGen STATIC
22- Sources /ASTGen/ASTGen.swift
23- Sources /ASTGen/ASTGen+CompilerBuildConfiguration.swift
24- Sources /ASTGen/Bridge.swift
25- Sources /ASTGen/CompilerBuildConfiguration.swift
26- Sources /ASTGen/DeclAttrs.swift
27- Sources /ASTGen/Decls.swift
28- Sources /ASTGen/Diagnostics.swift
29- Sources /ASTGen/DiagnosticsBridge.swift
30- Sources /ASTGen/Exprs.swift
31- Sources /ASTGen/Generics.swift
32- Sources /ASTGen/LegacyParse.swift
33- Sources /ASTGen/Literals.swift
34- Sources /ASTGen/ParameterClause.swift
35- Sources /ASTGen/Patterns.swift
36- Sources /ASTGen/Regex .swift
37- Sources /ASTGen/SourceFile.swift
38- Sources /ASTGen/Stmts.swift
39- Sources /ASTGen/TypeAttrs.swift
40- Sources /ASTGen/Types.swift
41-
42- DEPENDENCIES
43- swiftAST
44- SWIFT_DEPENDENCIES
45- _CompilerSwiftSyntax
46- _CompilerSwiftIfConfig
47- _CompilerSwiftOperators
48- _CompilerSwiftSyntaxBuilder
49- _CompilerSwiftParser
50- _CompilerSwiftParserDiagnostics
51- _CompilerSwiftDiagnostics
52- ${ASTGen_Swift_dependencies}
53- )
54-
55- add_pure_swift_host_library(swiftMacros STATIC
56- Sources /Macros /Macros .swift
57- Sources /Macros /PluginHost.swift
58- Sources /Macros /SourceManager.swift
59-
60- DEPENDENCIES
61- swiftAST
62- SWIFT_DEPENDENCIES
63- _CompilerSwiftCompilerPluginMessageHandling
64- _CompilerSwiftDiagnostics
65- _CompilerSwiftOperators
66- _CompilerSwiftParser
67- _CompilerSwiftSyntax
68- _CompilerSwiftSyntaxMacroExpansion
69- swiftASTGen
70- )
71-
72- add_pure_swift_host_library(swiftIDEUtilsBridging
73- Sources /SwiftIDEUtilsBridging/NameMatcherBridging.swift
74-
75- DEPENDENCIES
76- swiftAST
77- SWIFT_DEPENDENCIES
78- _CompilerSwiftIDEUtils
79- _CompilerSwiftSyntax
80- swiftASTGen
81- )
82-
83- set (c_include_paths
84- # LLVM modules and headers.
85- "${LLVM_MAIN_INCLUDE_DIR} "
86- # Generated LLVM headers.
87- "${LLVM_INCLUDE_DIR} "
88- # Clang modules and headers.
89- ${CLANG_INCLUDE_DIRS}
90- # Bridging modules and headers.
91- "${SWIFT_MAIN_INCLUDE_DIR} "
92- # Generated C headers.
93- "${CMAKE_CURRENT_BINARY_DIR} /../../include" )
94- set (c_include_paths_args)
95- foreach (c_include_path ${c_include_paths} )
96- list (APPEND c_include_paths_args "SHELL: -Xcc -I -Xcc ${c_include_path} " )
97- endforeach ()
98-
99- set (compile_options
100- ${c_include_paths_args}
101- "SHELL: -Xcc -std=c++17 -Xcc -DCOMPILED_WITH_SWIFT"
102-
103- # FIXME: Needed to work around an availability issue with CxxStdlib
104- "SHELL: -Xfrontend -disable-target-os-checking"
105-
106- # Necessary to avoid treating IBOutlet and IBAction as keywords
107- "SHELL:-Xcc -UIBOutlet -Xcc -UIBAction -Xcc -UIBInspectable"
108- )
109-
110- if (CMAKE_SYSTEM_NAME STREQUAL "Windows" )
111- list (APPEND compile_options
112- # Make 'offsetof()' a const value.
113- "SHELL:-Xcc -D_CRT_USE_BUILTIN_OFFSETOF"
114- # Workaround for https://github.com/swiftlang/llvm-project/issues/7172
115- "SHELL:-Xcc -Xclang -Xcc -fmodule-format=raw" )
116- endif ()
117-
118- # Prior to 5.9, we have to use the experimental flag for C++ interop.
119- if (CMAKE_Swift_COMPILER_VERSION VERSION_LESS 5.9)
120- list (APPEND compile_options "SHELL:-Xfrontend -enable-experimental-cxx-interop" )
12117else ()
122- list (APPEND compile_options "-cxx-interoperability-mode=default" )
123- endif ()
124-
125- if (SWIFT_BUILD_SWIFT_SYNTAX)
126- foreach (target swiftASTGen swiftIDEUtilsBridging swiftMacros)
127- target_compile_options (${target} PRIVATE ${compile_options} )
128- endforeach ()
18+ # Dummy target for dependencies
19+ add_custom_target (_CompilerRegexParser)
12920endif ()
0 commit comments