Skip to content

Commit d5c2bc2

Browse files
committed
build: remove ANALYZE_CODE_COVERAGE from _add_host_variant_c_compile_link_flags
This flag does not make sense here as this function is called from `_add_host_variant_link_flags` and `_add_host_variant_c_compile_flags`. The latter will add the flags appropriately. The former is always invoked *after* `_add_host_variant_c_compile_flags`. This effectively was duplicating the flags.
1 parent 0f132bf commit d5c2bc2

File tree

1 file changed

+3
-13
lines changed

1 file changed

+3
-13
lines changed

cmake/modules/AddSwift.cmake

Lines changed: 3 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -78,11 +78,10 @@ endfunction()
7878

7979
# Usage:
8080
# _add_host_variant_c_compile_link_flags(
81-
# ANALYZE_CODE_COVERAGE analyze_code_coverage
8281
# RESULT_VAR_NAME result_var_name
8382
# )
8483
function(_add_host_variant_c_compile_link_flags)
85-
set(oneValueArgs RESULT_VAR_NAME ANALYZE_CODE_COVERAGE)
84+
set(oneValueArgs RESULT_VAR_NAME)
8685
cmake_parse_arguments(CFLAGS
8786
""
8887
"${oneValueArgs}"
@@ -150,11 +149,6 @@ function(_add_host_variant_c_compile_link_flags)
150149
endif()
151150
endif()
152151

153-
if(CFLAGS_ANALYZE_CODE_COVERAGE)
154-
list(APPEND result "-fprofile-instr-generate"
155-
"-fcoverage-mapping")
156-
endif()
157-
158152
_compute_lto_flag("${SWIFT_TOOLS_ENABLE_LTO}" _lto_flag_out)
159153
if (_lto_flag_out)
160154
list(APPEND result "${_lto_flag_out}")
@@ -165,9 +159,7 @@ endfunction()
165159

166160

167161
function(_add_host_variant_c_compile_flags target)
168-
_add_host_variant_c_compile_link_flags(
169-
ANALYZE_CODE_COVERAGE FALSE
170-
RESULT_VAR_NAME result)
162+
_add_host_variant_c_compile_link_flags(RESULT_VAR_NAME result)
171163
target_compile_options(${target} PRIVATE
172164
${result})
173165

@@ -332,9 +324,7 @@ function(_add_host_variant_c_compile_flags target)
332324
endfunction()
333325

334326
function(_add_host_variant_link_flags target)
335-
_add_host_variant_c_compile_link_flags(
336-
ANALYZE_CODE_COVERAGE ${SWIFT_ANALYZE_CODE_COVERAGE}
337-
RESULT_VAR_NAME result)
327+
_add_host_variant_c_compile_link_flags(RESULT_VAR_NAME result)
338328
target_link_options(${target} PRIVATE
339329
${result})
340330

0 commit comments

Comments
 (0)