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 <jasinskidaniel95szcz@gmail.com>
This commit is contained in:
Daniel Jasinski 2024-09-09 20:19:22 +02:00 committed by Xiang Xiao
parent 1413fc0c1b
commit 7dbb887f07

View File

@ -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()