Skip to content

Commit

Permalink
add ios build
Browse files Browse the repository at this point in the history
  • Loading branch information
KurtGokhan committed Apr 8, 2024
1 parent 7779635 commit 714470d
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 3 deletions.
11 changes: 9 additions & 2 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,7 @@ jobs:
run: |
yarn build
mkdir -p ../dist/webgl
cp -a build/ ../dist/webgl/
cp -a binaries/ ../dist/webgl/
cp build/libyogaObjLib.a ../dist/webgl/libyoga.a
- name: Upload Binaries
uses: actions/upload-artifact@v3
Expand Down Expand Up @@ -68,6 +67,14 @@ jobs:
mkdir -p dist/osx
cp build/libyogacore.dylib dist/osx/libyoga.dylib
- name: Build IOS
run: |
rm -rf build
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
cmake --build build --config Release
mkdir -p dist/iOS
cp -a build/ dist/iOS/
- name: Upload Binaries
uses: actions/upload-artifact@v3
if: github.event_name == 'push'
Expand Down
8 changes: 7 additions & 1 deletion javascript/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.

option(BUILD_STATIC_LIBS "Build static library (.a) instead of object library" OFF)

cmake_minimum_required(VERSION 3.13...3.26)
set(CMAKE_VERBOSE_MAKEFILE on)
project(yoga)
Expand Down Expand Up @@ -51,7 +53,11 @@ add_link_options(

link_libraries(embind)

add_library(yogaObjLib STATIC ${SOURCES})
if(BUILD_STATIC_LIBS)
add_library(yogaObjLib STATIC ${SOURCES})
else()
add_library(yogaObjLib OBJECT ${SOURCES})
endif()

set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/binaries)

Expand Down
1 change: 1 addition & 0 deletions javascript/just.config.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -197,6 +197,7 @@ function emcmakeGenerateTask() {
'-B',
'build',
...(process.platform === 'win32' ? [] : ['-G', 'Ninja']),
'-D BUILD_STATIC_LIBS=ON',
];
logger.info(['emcmake', ...args].join(' '));

Expand Down

0 comments on commit 714470d

Please sign in to comment.