Skip to content

[cmake] Fix some errors in the cmake code that enables LTO. #1487

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Feb 29, 2016
Merged
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
10 changes: 5 additions & 5 deletions cmake/modules/AddSwift.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -89,14 +89,14 @@ function(_add_variant_c_compile_link_flags)
"-F" "${SWIFT_SDK_${CFLAGS_SDK}_PATH}/../../../Developer/Library/Frameworks"
"-m${SWIFT_SDK_${CFLAGS_SDK}_VERSION_MIN_NAME}-version-min=${DEPLOYMENT_VERSION}")

if(analyze_code_coverage)
if(CFLAGS_ANALYZE_CODE_COVERAGE)
list(APPEND result "-fprofile-instr-generate"
"-fcoverage-mapping")
endif()
endif()

if(enable_lto)
list(APPEND result "-flto")
endif()
if(CFLAGS_ENABLE_LTO)
list(APPEND result "-flto")
endif()

set("${CFLAGS_RESULT_VAR_NAME}" "${result}" PARENT_SCOPE)
Expand All @@ -117,7 +117,7 @@ function(_add_variant_c_compile_flags)
ARCH "${CFLAGS_ARCH}"
BUILD_TYPE "${CFLAGS_BUILD_TYPE}"
ENABLE_ASSERTIONS "${CFLAGS_ENABLE_ASSERTIONS}"
SWIFT_ENABLE_LTO "${SWIFT_ENABLE_LTO}"
ENABLE_LTO "${SWIFT_ENABLE_LTO}"
ANALYZE_CODE_COVERAGE FALSE
DEPLOYMENT_VERSION_IOS "${CFLAGS_DEPLOYMENT_VERSION_IOS}"
RESULT_VAR_NAME result)
Expand Down