From 7dbb887f07553a14b84aa2b2df3b61232fa7d107 Mon Sep 17 00:00:00 2001 From: Daniel Jasinski Date: Mon, 9 Sep 2024 20:19:22 +0200 Subject: [PATCH] build: fix memory manager compile options for CMake This enables CMake based build for sim:ostest. Flags which are set by set_source_files_properties are not reflected in final build. Changing these to target_compile_options makes CMake build runnable. Signed-off-by: Daniel Jasinski --- mm/kasan/CMakeLists.txt | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/mm/kasan/CMakeLists.txt b/mm/kasan/CMakeLists.txt index 47fe790d7891d..bba4df4f52bf6 100644 --- a/mm/kasan/CMakeLists.txt +++ b/mm/kasan/CMakeLists.txt @@ -19,7 +19,11 @@ # ############################################################################## if(CONFIG_MM_KASAN) target_sources(mm PRIVATE kasan.c) - set_source_files_properties(kasan.c PROPERTIES COMPILE_FLAGS - -fno-sanitize=kernel-address) - set_source_files_properties(kasan.c PROPERTIES COMPILE_FLAGS -fno-lto) + + target_compile_options(mm PRIVATE -fno-sanitize=kernel-address) + + if(NOT CONFIG_LTO_NONE) + target_compile_options(mm PRIVATE -fno-lto) + endif() + endif()