Skip to content

Commit 697a44c

Browse files
committed
build: inline some variables in _add_swift_host_library_single
1 parent 8430a03 commit 697a44c

File tree

1 file changed

+8
-14
lines changed

1 file changed

+8
-14
lines changed

cmake/modules/AddSwift.cmake

Lines changed: 8 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -880,19 +880,13 @@ function(_add_swift_host_library_single target name)
880880
list(APPEND library_search_directories "$ENV{SDKROOT}/usr/lib/swift")
881881
endif()
882882

883-
# Add variant-specific flags.
884-
set(build_type "${CMAKE_BUILD_TYPE}")
885-
set(enable_assertions "${LLVM_ENABLE_ASSERTIONS}")
886-
set(analyze_code_coverage "${SWIFT_ANALYZE_CODE_COVERAGE}")
887-
set(lto_type "${SWIFT_TOOLS_ENABLE_LTO}")
888-
889883
_add_variant_c_compile_flags(
890884
SDK "${SWIFTLIB_SINGLE_SDK}"
891885
ARCH "${SWIFTLIB_SINGLE_ARCHITECTURE}"
892-
BUILD_TYPE "${build_type}"
893-
ENABLE_ASSERTIONS "${enable_assertions}"
894-
ANALYZE_CODE_COVERAGE "${analyze_code_coverage}"
895-
ENABLE_LTO "${lto_type}"
886+
BUILD_TYPE ${CMAKE_BUILD_TYPE}
887+
ENABLE_ASSERTIONS ${LLVM_ENABLE_ASSERTIONS}
888+
ANALYZE_CODE_COVERAGE ${SWIFT_ANALYZE_CODE_COVERAGE}
889+
ENABLE_LTO ${SWIFT_TOOLS_ENABLE_LTO}
896890
RESULT_VAR_NAME c_compile_flags
897891
)
898892

@@ -904,10 +898,10 @@ function(_add_swift_host_library_single target name)
904898
_add_variant_link_flags(
905899
SDK "${SWIFTLIB_SINGLE_SDK}"
906900
ARCH "${SWIFTLIB_SINGLE_ARCHITECTURE}"
907-
BUILD_TYPE "${build_type}"
908-
ENABLE_ASSERTIONS "${enable_assertions}"
909-
ANALYZE_CODE_COVERAGE "${analyze_code_coverage}"
910-
ENABLE_LTO "${lto_type}"
901+
BUILD_TYPE ${CMAKE_BUILD_TYPE}
902+
ENABLE_ASSERTIONS ${LLVM_ENABLE_ASSERTIONS}
903+
ANALYZE_CODE_COVERAGE ${SWIFT_ANALYZE_CODE_COVERAGE}
904+
ENABLE_LTO ${SWIFT_TOOLS_ENABLE_LTO}
911905
LTO_OBJECT_NAME "${target}-${SWIFTLIB_SINGLE_SDK}-${SWIFTLIB_SINGLE_ARCHITECTURE}"
912906
RESULT_VAR_NAME link_flags
913907
LIBRARY_SEARCH_DIRECTORIES_VAR_NAME library_search_directories

0 commit comments

Comments
 (0)