-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: fixes for c-api build issues (#239)
* chore: fixes for c-api build issues --------- Co-authored-by: Muhmud Ahmad <[email protected]>
- Loading branch information
Showing
11 changed files
with
93 additions
and
17 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
RUNTIME_FFI := dotlottie-ffi | ||
|
||
RELEASE := release | ||
NATIVE := native | ||
|
||
DOTLOTTIE_PLAYER_NATIVE_RELEASE_DIR := $(RELEASE)\$(NATIVE)\dotlottie-player | ||
DOTLOTTIE_PLAYER_NATIVE_RELEASE_INCLUDE_DIR := $(DOTLOTTIE_PLAYER_NATIVE_RELEASE_DIR)\include | ||
DOTLOTTIE_PLAYER_NATIVE_RELEASE_LIB_DIR := $(DOTLOTTIE_PLAYER_NATIVE_RELEASE_DIR)\lib | ||
|
||
RUNTIME_FFI_HEADER := dotlottie_player.h | ||
|
||
define NATIVE_RELEASE | ||
if exist "$(RELEASE)\$(NATIVE)" rmdir /s /q $(RELEASE)\$(NATIVE) | ||
mkdir $(DOTLOTTIE_PLAYER_NATIVE_RELEASE_INCLUDE_DIR) | ||
mkdir $(DOTLOTTIE_PLAYER_NATIVE_RELEASE_LIB_DIR) | ||
copy $(RUNTIME_FFI)\bindings.h $(DOTLOTTIE_PLAYER_NATIVE_RELEASE_INCLUDE_DIR)\$(RUNTIME_FFI_HEADER) | ||
copy $(RUNTIME_FFI)\target\release\dotlottie_player.dll $(DOTLOTTIE_PLAYER_NATIVE_RELEASE_LIB_DIR)\dotlottie_player.dll | ||
copy $(RUNTIME_FFI)\target\release\dotlottie_player.lib $(DOTLOTTIE_PLAYER_NATIVE_RELEASE_LIB_DIR)\dotlottie_player.lib | ||
cd $(RELEASE)\$(NATIVE) && tar.exe -a -c -f "dotlottie_player.native.zip" dotlottie-player | ||
endef | ||
|
||
native: | ||
cargo build --manifest-path $(RUNTIME_FFI)/Cargo.toml --release | ||
$(NATIVE_RELEASE) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,3 @@ | ||
demo-player | ||
demo-player.dSYM/ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,3 @@ | ||
demo-player | ||
skia | ||
demo-player.dSYM |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,23 @@ | ||
.PHONY: all run debug clean | ||
|
||
DOTLOTTIE_PLAYER_LIB_PATH=../../dotlottie-ffi/target/debug | ||
DOTLOTTIE_PLAYER_LIB_PATH=../../dotlottie-ffi/target/release | ||
DOTLOTTIE_PLAYER_LIB=dotlottie_player | ||
|
||
SDL2_CFLAGS=$(shell sdl2-config --cflags) | ||
SDL2_LIBS=$(shell sdl2-config --libs) | ||
|
||
BUILD_PLATFORM := $(shell uname -s | tr '[:upper:]' '[:lower:]') | ||
MAC_BUILD_PLATFORM := darwin | ||
ifeq ($(BUILD_PLATFORM),$(MAC_BUILD_PLATFORM)) | ||
FRAMEWORKS := -framework CoreText -framework CoreGraphics -framework Foundation -framework CoreServices | ||
endif | ||
|
||
all: demo-player | ||
|
||
demo-player: skia main.cpp | ||
$(CXX) -g -Iskia -Lskia/out/Static -L$(DOTLOTTIE_PLAYER_LIB_PATH) main.cpp \ | ||
-lSDL2 -l$(DOTLOTTIE_PLAYER_LIB) -lskia -lpng -ljpeg -lz -lfreetype -lwebp -lwebpdemux \ | ||
-o $@ | ||
$(CXX) -g --std=c++20 -Iskia -Lskia/out/Static -L$(DOTLOTTIE_PLAYER_LIB_PATH) main.cpp \ | ||
$(SDL2_CFLAGS) $(SDL2_LIBS) -l$(DOTLOTTIE_PLAYER_LIB) -lskia -ldng_sdk \ | ||
$(FRAMEWORKS) -o $@ | ||
|
||
run: export LD_LIBRARY_PATH = $(DOTLOTTIE_PLAYER_LIB_PATH) | ||
run: demo-player | ||
|
@@ -20,10 +29,13 @@ debug: demo-player | |
|
||
skia: | ||
git clone [email protected]:google/skia.git | ||
|
||
skia-build: skia | ||
cd skia && \ | ||
python3 tools/git-sync-deps && \ | ||
python3 bin/fetch-ninja && \ | ||
bin/gn gen out/Static --args='is_official_build=true' && \ | ||
bin/gn gen out/Static \ | ||
--args='is_official_build=true skia_use_system_libjpeg_turbo=false skia_use_system_libpng=false skia_use_system_libwebp=false skia_use_system_zlib=false skia_use_icu=false skia_use_icu=false skia_use_harfbuzz=false skia_use_freetype=false' && \ | ||
ninja -C out/Static | ||
|
||
clean: | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters