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.
This commit is contained in:
Peter Kubov 2020-05-18 10:28:11 +02:00
parent d0f0dbca10
commit e0d5a60e60

View File

@ -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}