mirror of
https://github.com/google/flatbuffers.git
synced 2026-06-23 16:20:01 +00:00
feat(build): compile "universal" libraries and executables for Mac (#6852)
to support both x86_64 and arm64 with a single artifact
This commit is contained in:
7
.github/workflows/build.yml
vendored
7
.github/workflows/build.yml
vendored
@@ -72,6 +72,11 @@ jobs:
|
|||||||
- name: build
|
- name: build
|
||||||
# NOTE: we need this _build dir to not have xcodebuild's default ./build dir clash with the BUILD file.
|
# NOTE: we need this _build dir to not have xcodebuild's default ./build dir clash with the BUILD file.
|
||||||
run: xcodebuild -toolchain clang -configuration Release -target flattests SYMROOT=$(PWD)/_build
|
run: xcodebuild -toolchain clang -configuration Release -target flattests SYMROOT=$(PWD)/_build
|
||||||
|
- name: check that the binary is "universal"
|
||||||
|
run: |
|
||||||
|
info=$(file _build/Release/flatc)
|
||||||
|
echo $info
|
||||||
|
echo $info | grep "universal binary with 2 architectures"
|
||||||
- name: test
|
- name: test
|
||||||
run: _build/Release/flattests
|
run: _build/Release/flattests
|
||||||
- name: upload build artifacts
|
- name: upload build artifacts
|
||||||
@@ -133,7 +138,7 @@ jobs:
|
|||||||
- name: Build
|
- name: Build
|
||||||
working-directory: kotlin
|
working-directory: kotlin
|
||||||
run: ./gradlew clean iosX64Test macosX64Test jsTest jsBrowserTest
|
run: ./gradlew clean iosX64Test macosX64Test jsTest jsBrowserTest
|
||||||
|
|
||||||
build-kotlin-linux:
|
build-kotlin-linux:
|
||||||
name: Build Kotlin Linux
|
name: Build Kotlin Linux
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
|
|||||||
@@ -247,6 +247,7 @@ elseif(CMAKE_COMPILER_IS_GNUCXX)
|
|||||||
|
|
||||||
elseif(${CMAKE_CXX_COMPILER_ID} MATCHES "Clang")
|
elseif(${CMAKE_CXX_COMPILER_ID} MATCHES "Clang")
|
||||||
if(APPLE)
|
if(APPLE)
|
||||||
|
set(CMAKE_OSX_ARCHITECTURES "arm64;x86_64")
|
||||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11")
|
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11")
|
||||||
else()
|
else()
|
||||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++0x")
|
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++0x")
|
||||||
|
|||||||
Reference in New Issue
Block a user