From 094ff8cebe1ccc8c0f7093599f9d5a4c4e7bbce6 Mon Sep 17 00:00:00 2001 From: Peter Kubov Date: Mon, 18 May 2020 10:28:11 +0200 Subject: [PATCH] Move CMAKE_C_FLAGS setting Fix position of command that alters CMAKE_C_FLAGS. This did result in failing build of retdec on newst macOS systems. --- deps/yara/CMakeLists.txt | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/deps/yara/CMakeLists.txt b/deps/yara/CMakeLists.txt index 6c69c6976..dca006472 100644 --- a/deps/yara/CMakeLists.txt +++ b/deps/yara/CMakeLists.txt @@ -39,6 +39,16 @@ else() set(YARAC_PATH ${YARA_DIR}/yarac) endif() +# https://github.com/avast/retdec/issues/439 +if(APPLE) + execute_process( + COMMAND xcrun --show-sdk-path + OUTPUT_VARIABLE MACOS_SDK_PATH + OUTPUT_STRIP_TRAILING_WHITESPACE + ) + set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} --sysroot=${MACOS_SDK_PATH}") +endif() + # These are not used on MSVC, but we use it on all platforms to detect if # build configuration changed - changes in config should be mirrored on both # MSVC & Linux. @@ -101,16 +111,6 @@ else() ) endif() -# https://github.com/avast/retdec/issues/439 -if(APPLE) - execute_process( - COMMAND xcrun --show-sdk-path - OUTPUT_VARIABLE MACOS_SDK_PATH - OUTPUT_STRIP_TRAILING_WHITESPACE - ) - set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} --sysroot=${MACOS_SDK_PATH}") -endif() - if(NOT MSVC) ExternalProject_Add_Step(yara configure-linux WORKING_DIRECTORY ${YARA_DIR}