From c34b7a3f6580f7f590a54ddb9c79c246246f1866 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebastian=20B=C3=B8e?= Date: Wed, 27 Dec 2017 15:21:54 +0100 Subject: [PATCH] cmake: Fix CMAKE_REQUIRED_FLAGS corruption MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 --- CMakeLists.txt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 5477fc0372..84deadfc50 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -807,10 +807,10 @@ if(CONFIG_OUTPUT_PRINT_MEMORY_USAGE) set(option ${LINKERFLAGPREFIX},--print-memory-usage) 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}") 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}) endif()