diff --git a/CMakeLists.txt b/CMakeLists.txt index 73a65c12374..956cc9e7e6f 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -746,10 +746,10 @@ if(CONFIG_CODE_DATA_RELOCATION) endif() if(CONFIG_USERSPACE) - zephyr_get_compile_options_for_lang_as_string(C compiler_flags_priv) - string(REPLACE "-ftest-coverage" "" NO_COVERAGE_FLAGS "${compiler_flags_priv}") - string(REPLACE "-fprofile-arcs" "" NO_COVERAGE_FLAGS "${NO_COVERAGE_FLAGS}") - string(REPLACE "-fno-inline" "" NO_COVERAGE_FLAGS "${NO_COVERAGE_FLAGS}") + zephyr_get_compile_options_for_lang(C compiler_flags_priv) + string(REPLACE "$" "" + NO_COVERAGE_FLAGS "${compiler_flags_priv}" + ) get_property(include_dir_in_interface TARGET zephyr_interface PROPERTY INTERFACE_INCLUDE_DIRECTORIES)