Skip to content

Commit d0fa599

Browse files
authored
box2d (#2311)
1 parent 8c57b14 commit d0fa599

File tree

4 files changed

+71
-14
lines changed

4 files changed

+71
-14
lines changed
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
2+
mkdir build
3+
cd build
4+
5+
# Configure step
6+
cmake ${CMAKE_ARGS} .. \
7+
-GNinja \
8+
-DCMAKE_BUILD_TYPE=Release \
9+
-DCMAKE_PREFIX_PATH=$PREFIX \
10+
-DCMAKE_INSTALL_LIBDIR=$PREFIX/lib \
11+
-DCMAKE_INSTALL_PREFIX=$PREFIX \
12+
-DBOX2D_SAMPLES=OFF \
13+
-DBUILD_SHARED_LIBS=ON \
14+
-DCMAKE_PROJECT_INCLUDE=${RECIPE_DIR}/overwriteProp.cmake \
15+
-DBOX2D_UNIT_TESTS=OFF
16+
17+
# Build step
18+
ninja install

recipes/recipes_emscripten/box2d/build.sh renamed to recipes/recipes_emscripten/box2d/build_static.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ cmake ${CMAKE_ARGS} .. \
1010
-DCMAKE_INSTALL_LIBDIR=$PREFIX/lib \
1111
-DCMAKE_INSTALL_PREFIX=$PREFIX \
1212
-DBOX2D_SAMPLES=OFF \
13+
-DBUILD_SHARED_LIBS=OFF \
1314
-DBOX2D_UNIT_TESTS=OFF
1415

1516
# Build step
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
set_property(GLOBAL PROPERTY TARGET_SUPPORTS_SHARED_LIBS TRUE)
2+
set(CMAKE_SHARED_LIBRARY_CREATE_C_FLAGS "-s SIDE_MODULE=1")
3+
set(CMAKE_SHARED_LIBRARY_CREATE_CXX_FLAGS "-s SIDE_MODULE=1")
4+
set(CMAKE_STRIP FALSE) # used by default in pybind11 on .so modules

recipes/recipes_emscripten/box2d/recipe.yaml

Lines changed: 48 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,61 @@
11
context:
22
name: box2d
3-
version: 3.0
3+
version: 3.1
44

5-
package:
6-
name: ${{ name|lower }}
7-
version: ${{ version }}
5+
recipe:
6+
name: box2d-split
87

98
source:
10-
# note until there is a release, we the fork of "DerThorsten"
11-
# url: https://github.com/DerThorsten/box2d/archive/refs/tags/${{ version }}.tar.gz
12-
# sha256: aea98ecf5bc5c5e0b789a76de0083a21a70457050ea4cc2aec7566935f5e258e
13-
git: https://github.com/DerThorsten/box2d
14-
branch: main
9+
# url: https://github.com/erincatto/box2d/archive/refs/tags/v${{ version }}.tar.gz
10+
# sha256: 7fac19801485efb31ee3745b2284d9d4601f9e8138a3383a7b0df6d788ea5785
11+
git: https://github.com/erincatto/box2d
12+
rev: 0f2b0246f39594e93fcc8dde0fe0bb1b20b403f9
13+
1514

1615
build:
1716
number: 0
1817

19-
requirements:
20-
build:
21-
- ${{ compiler('cxx') }}
22-
- cmake
23-
- ninja
18+
outputs:
19+
- package:
20+
name: ${{ name|lower }}-static
21+
version: ${{ version }}
22+
23+
build:
24+
script: build_static.sh
25+
requirements:
26+
build:
27+
- ${{ compiler('cxx') }}
28+
- cmake
29+
- ninja
30+
31+
tests:
32+
- package_contents:
33+
include:
34+
- box2d/box2d.h
35+
lib:
36+
- libbox2d.a
37+
files:
38+
- lib/cmake/box2d/box2dConfig.cmake
39+
- package:
40+
name: ${{ name|lower }}
41+
version: ${{ version }}
2442

43+
build:
44+
script: build_shared.sh
45+
requirements:
46+
build:
47+
- ${{ compiler('cxx') }}
48+
- cmake
49+
- ninja
50+
51+
tests:
52+
- package_contents:
53+
include:
54+
- box2d/box2d.h
55+
lib:
56+
- libbox2d.so
57+
files:
58+
- lib/cmake/box2d/box2dConfig.cmake
2559
about:
2660
homepage: https://box2d.org/
2761
license: MIT

0 commit comments

Comments
 (0)