Skip to content

Commit 714470d

Browse files
committed
add ios build
1 parent 7779635 commit 714470d

File tree

3 files changed

+17
-3
lines changed

3 files changed

+17
-3
lines changed

.github/workflows/build.yml

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,8 +38,7 @@ jobs:
3838
run: |
3939
yarn build
4040
mkdir -p ../dist/webgl
41-
cp -a build/ ../dist/webgl/
42-
cp -a binaries/ ../dist/webgl/
41+
cp build/libyogaObjLib.a ../dist/webgl/libyoga.a
4342
4443
- name: Upload Binaries
4544
uses: actions/upload-artifact@v3
@@ -68,6 +67,14 @@ jobs:
6867
mkdir -p dist/osx
6968
cp build/libyogacore.dylib dist/osx/libyoga.dylib
7069
70+
- name: Build IOS
71+
run: |
72+
rm -rf build
73+
cmake -B build -S yoga -D CMAKE_BUILD_TYPE=Release -G Xcode -DCMAKE_SYSTEM_NAME=iOS -DCMAKE_Swift_COMPILER_FORCED=true -DCMAKE_OSX_DEPLOYMENT_TARGET=11.0
74+
cmake --build build --config Release
75+
mkdir -p dist/iOS
76+
cp -a build/ dist/iOS/
77+
7178
- name: Upload Binaries
7279
uses: actions/upload-artifact@v3
7380
if: github.event_name == 'push'

javascript/CMakeLists.txt

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@
33
# This source code is licensed under the MIT license found in the
44
# LICENSE file in the root directory of this source tree.
55

6+
option(BUILD_STATIC_LIBS "Build static library (.a) instead of object library" OFF)
7+
68
cmake_minimum_required(VERSION 3.13...3.26)
79
set(CMAKE_VERBOSE_MAKEFILE on)
810
project(yoga)
@@ -51,7 +53,11 @@ add_link_options(
5153

5254
link_libraries(embind)
5355

54-
add_library(yogaObjLib STATIC ${SOURCES})
56+
if(BUILD_STATIC_LIBS)
57+
add_library(yogaObjLib STATIC ${SOURCES})
58+
else()
59+
add_library(yogaObjLib OBJECT ${SOURCES})
60+
endif()
5561

5662
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/binaries)
5763

javascript/just.config.cjs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -197,6 +197,7 @@ function emcmakeGenerateTask() {
197197
'-B',
198198
'build',
199199
...(process.platform === 'win32' ? [] : ['-G', 'Ninja']),
200+
'-D BUILD_STATIC_LIBS=ON',
200201
];
201202
logger.info(['emcmake', ...args].join(' '));
202203

0 commit comments

Comments
 (0)