Skip to content

Commit

Permalink
Move CMAKE_C_FLAGS setting
Browse files Browse the repository at this point in the history
Fix position of command that alters CMAKE_C_FLAGS. This did result
in failing build of retdec on newst macOS systems.
  • Loading branch information
Peter Kubov committed May 29, 2020
1 parent 1e02f82 commit 094ff8c
Showing 1 changed file with 10 additions and 10 deletions.
20 changes: 10 additions & 10 deletions deps/yara/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down Expand Up @@ -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}
Expand Down

0 comments on commit 094ff8c

Please sign in to comment.