From aa03059e39f6e6e5145aa60ba9ab76c7f66486d0 Mon Sep 17 00:00:00 2001 From: "David M. Bryson" Date: Wed, 19 Aug 2020 09:42:35 -0700 Subject: [PATCH 1/3] Adjust swift target based on CMAKE_OSX_ARCHITECTURE (cherry picked from commit b18320f27d869afcdcb63fd166ffd0f9703465d9) --- products/llbuildSwift/CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/products/llbuildSwift/CMakeLists.txt b/products/llbuildSwift/CMakeLists.txt index 918bde56..4e57b870 100644 --- a/products/llbuildSwift/CMakeLists.txt +++ b/products/llbuildSwift/CMakeLists.txt @@ -17,7 +17,7 @@ endif() # TODO(compnerd) move both of these outside of the CMake into the invocation if(CMAKE_SYSTEM_NAME STREQUAL Darwin) - add_compile_options(-target x86_64-apple-macosx10.10) + add_compile_options(-target ${CMAKE_OSX_ARCHITECTURE}-apple-macosx) if(NOT CMAKE_OSX_SYSROOT STREQUAL "") add_compile_options(-sdk ${CMAKE_OSX_SYSROOT}) endif() From 6bfef8302164f4349bddf20f970c211c01e30df2 Mon Sep 17 00:00:00 2001 From: David Bryson Date: Wed, 19 Aug 2020 10:08:01 -0700 Subject: [PATCH 2/3] Update products/llbuildSwift/CMakeLists.txt Co-authored-by: Mishal Shah (cherry picked from commit 95178212257822a5a642948e72dccf87e1209f5f) --- products/llbuildSwift/CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/products/llbuildSwift/CMakeLists.txt b/products/llbuildSwift/CMakeLists.txt index 4e57b870..7a76bc73 100644 --- a/products/llbuildSwift/CMakeLists.txt +++ b/products/llbuildSwift/CMakeLists.txt @@ -17,7 +17,7 @@ endif() # TODO(compnerd) move both of these outside of the CMake into the invocation if(CMAKE_SYSTEM_NAME STREQUAL Darwin) - add_compile_options(-target ${CMAKE_OSX_ARCHITECTURE}-apple-macosx) + add_compile_options(-target ${CMAKE_OSX_ARCHITECTURES}-apple-macosx10.10) if(NOT CMAKE_OSX_SYSROOT STREQUAL "") add_compile_options(-sdk ${CMAKE_OSX_SYSROOT}) endif() From 07161c7474d1e76ab77dc43da60789da0a77793e Mon Sep 17 00:00:00 2001 From: Mishal Shah Date: Tue, 8 Sep 2020 10:23:40 -0700 Subject: [PATCH 3/3] Set default for CMAKE_OSX_ARCHITECTURES x86_64 (cherry picked from commit f62c7f558a5967cd7a70babeeb0058649b18e5d4) --- products/llbuildSwift/CMakeLists.txt | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/products/llbuildSwift/CMakeLists.txt b/products/llbuildSwift/CMakeLists.txt index 7a76bc73..677a103f 100644 --- a/products/llbuildSwift/CMakeLists.txt +++ b/products/llbuildSwift/CMakeLists.txt @@ -15,6 +15,11 @@ if(CMAKE_VERSION VERSION_LESS 3.16) endif() endif() +# Set x86_64 default if CMAKE_OSX_ARCHITECTURES is not set +if(NOT DEFINED CMAKE_OSX_ARCHITECTURES) + set(CMAKE_OSX_ARCHITECTURES "x86_64") +endif() + # TODO(compnerd) move both of these outside of the CMake into the invocation if(CMAKE_SYSTEM_NAME STREQUAL Darwin) add_compile_options(-target ${CMAKE_OSX_ARCHITECTURES}-apple-macosx10.10)