Comments (7)
IOS static libraries were added in the latest package pushed to the GitLab feed. https://gitlab.com/BeanCheeseBurrito/Flecs.NET/-/packages/20154174
from flecs.net.
I will look into adding them!
from flecs.net.
Flecs.NET uses zig to cross-compile native libraries for all target platforms. Trying to compile flecs with -Dtarget=aarch64-linux-android
or -Dtarget=aarch64-ios
doesn't seem to work out of the box due to missing headers. I'm assuming zig doesn't include them for those targets.
fatal error: 'assert.h' file not found
I'm not familiar enough with c/c++ and mobile development to get the build script to compile for those platforms but I'm open to contributions if anyone knows how to get it working. These are the relevant files for anyone interested in adding support for mobile targets.
https://github.com/BeanCheeseBurrito/Flecs.NET/blob/main/src/Flecs.NET.Native/build.zig
https://github.com/BeanCheeseBurrito/Flecs.NET/blob/main/src/Flecs.NET.Native/Flecs.NET.Native.csproj
from flecs.net.
Thanks! Can we avoid exotic targets like linux android for now and just add the more vanilla stuff that zig does support? Or for modern ios at least?
ziglang/zig#5145
from flecs.net.
- and maybe skip the ios simulator target too for simplicity, although it seems someone has done it before: https://github.com/kubkon/zig-ios-example
from flecs.net.
Thanks! Can we avoid exotic targets like linux android for now and just add the more vanilla stuff that zig does support? Or for modern ios at least? ziglang/zig#5145
Zig doesn't provide(?) the headers needed to cross-compile for android and ios. The build script needs to be changed to allow the user to manually provide them but I'm not experienced enough with mobile development to set it up myself.
from flecs.net.
In case it helps, I made this example github action that will output a static library via https://github.com/leetal/ios-cmake without needing any code signing.
name: Build Flecs for iOS
on:
push:
tags:
- 'v*'
workflow_dispatch:
jobs:
build:
runs-on: macos-latest
strategy:
matrix:
config: [Debug, Release]
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Setup environment
run: |
echo "FLECS_REPO=https://github.com/SanderMertens/flecs.git" >> $GITHUB_ENV
echo "FLECS_DIR=$GITHUB_WORKSPACE/flecs" >> $GITHUB_ENV
echo "DEBUG_DIR=$GITHUB_WORKSPACE/build_ios/debug" >> $GITHUB_ENV
echo "RELEASE_DIR=$GITHUB_WORKSPACE/build_ios/release" >> $GITHUB_ENV
echo "TOOLCHAIN_FILE=$GITHUB_WORKSPACE/ios.toolchain.cmake" >> $GITHUB_ENV
- name: Clone Flecs Repository
run: git clone ${{ env.FLECS_REPO }} ${{ env.FLECS_DIR }}
- name: Download dependencies
run: |
if [ ! -f "$TOOLCHAIN_FILE" ]; then
curl -O https://raw.githubusercontent.com/leetal/ios-cmake/master/ios.toolchain.cmake
fi
- name: Build static library
run: |
mkdir -p $DEBUG_DIR
mkdir -p $RELEASE_DIR
cd $DEBUG_DIR
cmake -DCMAKE_BUILD_TYPE=Debug $FLECS_DIR
make
mv libflecs_static.a libflecs.a
cd $RELEASE_DIR
cmake -DCMAKE_BUILD_TYPE=Release $FLECS_DIR
make
mv libflecs_static.a libflecs.a
- name: Upload artifact (Debug)
if: matrix.config == 'Debug'
uses: actions/upload-artifact@v2
with:
name: libflecs-debug
path: ${{ env.DEBUG_DIR }}/libflecs.a
- name: Upload artifact (Release)
if: matrix.config == 'Release'
uses: actions/upload-artifact@v2
with:
name: libflecs-release
path: ${{ env.RELEASE_DIR }}/libflecs.a
from flecs.net.
Related Issues (17)
- Docs update: rename `EcsOnUpdate` to `Ecs.OnUpdate` HOT 1
- Support for tick sources? HOT 2
- How to register a system that doesn't query for any components? HOT 7
- Avoid heap allocation with native strings whenever possible
- Modify examples to use new source-generated Iter/Each callbacks. HOT 1
- Make the high-level wrapper usable in reflection-free mode HOT 1
- Add NativeAOT examples and tests
- Unity Editor crashes when initializing world with Monitor and Metrics modules HOT 2
- Ambiguous definitions of Routine. HOT 2
- Use C# arrays as pluggable storage for managed types
- FromJson and ToJson don't seem to work correctly HOT 3
- [v4] Replace usage of ecs_world_t* with World in public apis
- [v4] Implement component id lookup support for System.Type
- [v4] Ensure all callback methods have overloads that take managed function pointers instead of delegates
- Add support for Id Indicies HOT 1
- [v4] Wildcard observers not emitting HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from flecs.net.