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 66# See http://swift.org/LICENSE.txt for license information
77# See http://swift.org/CONTRIBUTORS.txt for Swift project authors
88
9+ include (SwiftUtils)
10+
911# Following function are needed as a workaround until it's possible to compile
1012# swift code with cmake's builtin swift support.
1113
@@ -121,10 +123,19 @@ function(add_swift_compiler_modules_library name)
121123 list (APPEND swift_compile_options "-Xfrontend" "-cxx-interop-use-opaque-pointer-for-moveonly" )
122124 endif ()
123125
124- if (CMAKE_BUILD_TYPE STREQUAL "Debug" )
126+ is_build_type_with_debuginfo("${CMAKE_BUILD_TYPE} " debug)
127+ if (debug)
125128 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" )
128139 endif ()
129140
130141 if (LLVM_ENABLE_ASSERTIONS)
You can’t perform that action at this time.
0 commit comments