File tree Expand file tree Collapse file tree 1 file changed +14
-3
lines changed Expand file tree Collapse file tree 1 file changed +14
-3
lines changed Original file line number Diff line number Diff line change 6
6
# See http://swift.org/LICENSE.txt for license information
7
7
# See http://swift.org/CONTRIBUTORS.txt for Swift project authors
8
8
9
+ include (SwiftUtils)
10
+
9
11
# Following function are needed as a workaround until it's possible to compile
10
12
# swift code with cmake's builtin swift support.
11
13
@@ -121,10 +123,19 @@ function(add_swift_compiler_modules_library name)
121
123
list (APPEND swift_compile_options "-Xfrontend" "-cxx-interop-use-opaque-pointer-for-moveonly" )
122
124
endif ()
123
125
124
- if (CMAKE_BUILD_TYPE STREQUAL "Debug" )
126
+ is_build_type_with_debuginfo("${CMAKE_BUILD_TYPE} " debug)
127
+ if (debug)
125
128
list (APPEND swift_compile_options "-g" )
126
- else ()
127
- list (APPEND swift_compile_options "-O" "-cross-module-optimization" )
129
+ endif ()
130
+
131
+ is_build_type_optimized("${CMAKE_BUILD_TYPE} " optimized)
132
+ if (optimized)
133
+ if ("${CMAKE_BUILD_TYPE} " STREQUAL "MinSizeRel" )
134
+ list (APPEND swift_compile_options "-Osize" )
135
+ else ()
136
+ list (APPEND swift_compile_options "-O" )
137
+ endif ()
138
+ list (APPEND swift_compile_options "-cross-module-optimization" )
128
139
endif ()
129
140
130
141
if (LLVM_ENABLE_ASSERTIONS)
You can’t perform that action at this time.
0 commit comments