From 768e6822ccdca50f95b1b155a2ffd2bdf99cae44 Mon Sep 17 00:00:00 2001 From: David Benjamin Date: Thu, 11 May 2017 17:50:25 -0400 Subject: [PATCH] Only fixup CMAKE_ASM_FLAGS -isysroot if CMAKE_OSX_SYSROOT is set. Sometimes[1] CMake will do a build on Darwin without setting up CMAKE_OSX_SYSROOT. This appears to be to support the "basic POSIX-only case"[2]. The hard-coded CMake logic we're mimicking[3] handles this case, so do the same. [1] https://github.com/Kitware/CMake/blob/f6b93fbf3ae00a9157af2f6497bed074d585cea9/Modules/Platform/Darwin-Initialize.cmake#L48 [2] https://github.com/Kitware/CMake/commit/43b74793de80153b9446689adf79c4acf1391969 [3] https://github.com/Kitware/CMake/blob/master/Source/cmLocalGenerator.cxx#L1307 Change-Id: Ica5ae8510d07eca384cc366dd3de10b0c1ce0f81 Reviewed-on: https://boringssl-review.googlesource.com/16245 Commit-Queue: David Benjamin Commit-Queue: Adam Langley Reviewed-by: Adam Langley CQ-Verified: CQ bot account: commit-bot@chromium.org --- crypto/CMakeLists.txt | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/crypto/CMakeLists.txt b/crypto/CMakeLists.txt index 0ca2847be..557246c79 100644 --- a/crypto/CMakeLists.txt +++ b/crypto/CMakeLists.txt @@ -38,7 +38,9 @@ if(UNIX) # CMake does not add -isysroot and -arch flags to assembly. if (APPLE) - set(CMAKE_ASM_FLAGS "${CMAKE_ASM_FLAGS} -isysroot ${CMAKE_OSX_SYSROOT}") + if (CMAKE_OSX_SYSROOT) + set(CMAKE_ASM_FLAGS "${CMAKE_ASM_FLAGS} -isysroot ${CMAKE_OSX_SYSROOT}") + endif() foreach(arch ${CMAKE_OSX_ARCHITECTURES}) set(CMAKE_ASM_FLAGS "${CMAKE_ASM_FLAGS} -arch ${arch}") endforeach()