cmake: Fix CMAKE_REQUIRED_FLAGS corruption
The --print-memory-usage check was accidentally corrupting the CMAKE_REQUIRED_FLAGS variable due to a variable de-referencing bug. This was affecting app CMakeLists.txt code that was using CMAKE_REQUIRED_FLAGS. Signed-off-by: Sebastian Bøe <sebastian.boe@nordicsemi.no>
This commit is contained in:
parent
5fb5adb34f
commit
c34b7a3f65
|
@ -807,10 +807,10 @@ if(CONFIG_OUTPUT_PRINT_MEMORY_USAGE)
|
||||||
set(option ${LINKERFLAGPREFIX},--print-memory-usage)
|
set(option ${LINKERFLAGPREFIX},--print-memory-usage)
|
||||||
string(MAKE_C_IDENTIFIER check${option} check)
|
string(MAKE_C_IDENTIFIER check${option} check)
|
||||||
|
|
||||||
set(SAVED_CMAKE_REQUIRED_FLAGS CMAKE_REQUIRED_FLAGS)
|
set(SAVED_CMAKE_REQUIRED_FLAGS ${CMAKE_REQUIRED_FLAGS})
|
||||||
set(CMAKE_REQUIRED_FLAGS "${CMAKE_REQUIRED_FLAGS} ${option}")
|
set(CMAKE_REQUIRED_FLAGS "${CMAKE_REQUIRED_FLAGS} ${option}")
|
||||||
check_c_compiler_flag("" ${check})
|
check_c_compiler_flag("" ${check})
|
||||||
set(CMAKE_REQUIRED_FLAGS SAVED_CMAKE_REQUIRED_FLAGS)
|
set(CMAKE_REQUIRED_FLAGS ${SAVED_CMAKE_REQUIRED_FLAGS})
|
||||||
|
|
||||||
target_link_libraries_ifdef(${check} zephyr_prebuilt ${option})
|
target_link_libraries_ifdef(${check} zephyr_prebuilt ${option})
|
||||||
endif()
|
endif()
|
||||||
|
|
Loading…
Reference in a new issue