From 9064f36eb93e8f80befb4bc181cd45378bf1e042 Mon Sep 17 00:00:00 2001 From: mjtalbot Date: Tue, 15 Jul 2025 20:58:14 +0000 Subject: [PATCH] chore: update thumbnailer for new rive building set-up 9fd4961e9b Co-authored-by: Maxwell Talbot --- .rive_head | 2 +- skia/thumbnail_generator/build.sh | 38 +++--- skia/thumbnail_generator/build/premake5.lua | 137 ++++++++------------ skia/thumbnail_generator/run.sh | 2 +- 4 files changed, 75 insertions(+), 104 deletions(-) diff --git a/.rive_head b/.rive_head index be22f767..a01be5a6 100644 --- a/.rive_head +++ b/.rive_head @@ -1 +1 @@ -8b7aa847042cbb17ee62d126d3b488dc7a4f8614 +9fd4961e9bf4da4198a43bb5ec00baf5d2cf1561 diff --git a/skia/thumbnail_generator/build.sh b/skia/thumbnail_generator/build.sh index 7e99f5cb..6331e77a 100755 --- a/skia/thumbnail_generator/build.sh +++ b/skia/thumbnail_generator/build.sh @@ -9,26 +9,28 @@ else export RIVE_RUNTIME_DIR="$PWD/../../../runtime" fi -cd ../renderer -./build.sh "$@" +source "$RIVE_RUNTIME_DIR"/dependencies/config_directories.sh -cd "$BASEDIR" +export SKIA_REPO="https://github.com/rive-app/skia.git" +export SKIA_BRANCH="bae2881014cb5c3216184cbb0b639045b8804931" +export SKIA_COMMIT=$SKIA_BRANCH +# could call this thumbnailer, but we can share. +export CACHE_NAME="rive_recorder" +export MAKE_SKIA_FILE="make_skia_recorder.sh" +export SKIA_DIR_NAME="skia" +export SKIA_DIR="skia" +build_deps() { + pushd "$RIVE_RUNTIME_DIR"/skia/dependencies + ./make_skia_recorder.sh + popd + echo "$RIVE_RUNTIME_DIR" + pwd +} + +build_deps cd build -OPTION=$1 - -export PREMAKE_PATH="$RIVE_RUNTIME_DIR/build":$PREMAKE_PATH - -if [ "$OPTION" = 'help' ]; then - echo build.sh - build debug library - echo build.sh clean - clean the build - echo build.sh release - build release library -elif [ "$OPTION" = "clean" ]; then - echo Cleaning project ... - premake5 clean --scripts="$RIVE_RUNTIME_DIR/build" -elif [ "$OPTION" = "release" ]; then - premake5 gmake --scripts="$RIVE_RUNTIME_DIR/build" --with_rive_text --with_rive_layout && make config=release -j7 -else - premake5 gmake --scripts="$RIVE_RUNTIME_DIR/build" --with_rive_text --with_rive_layout && make -j7 +if [[ $1 != "skip" ]]; then + build_rive.sh $@ fi diff --git a/skia/thumbnail_generator/build/premake5.lua b/skia/thumbnail_generator/build/premake5.lua index a724d647..55d70e99 100644 --- a/skia/thumbnail_generator/build/premake5.lua +++ b/skia/thumbnail_generator/build/premake5.lua @@ -1,95 +1,64 @@ -workspace('rive') -configurations({ 'debug', 'release' }) - -require('setup_compiler') +dofile('rive_build_config.lua') RIVE_RUNTIME_DIR = os.getenv('RIVE_RUNTIME_DIR') or '../../../' SKIA_DIR_NAME = os.getenv('SKIA_DIR_NAME') or 'skia' -BASE_DIR = path.getabsolute(RIVE_RUNTIME_DIR .. '/build') -location('./') -dofile(path.join(BASE_DIR, 'premake5.lua')) +dofile(path.join(RIVE_RUNTIME_DIR, 'premake5_v2.lua')) +BASE_DIR = path.getabsolute(RIVE_RUNTIME_DIR .. '/skia/renderer') +dofile(path.join(BASE_DIR, 'premake5_v2.lua')) -BASE_DIR = path.getabsolute(RIVE_RUNTIME_DIR .. '/skia/renderer/build') -location('./') -dofile(path.join(BASE_DIR, 'premake5.lua')) project('rive_thumbnail_generator') -kind('ConsoleApp') -language('C++') -cppdialect('C++17') -targetdir('%{cfg.system}/bin/%{cfg.buildcfg}') -objdir('%{cfg.system}/obj/%{cfg.buildcfg}') +do + kind('ConsoleApp') + exceptionhandling('On') + rtti('On') -includedirs({ - RIVE_RUNTIME_DIR .. '/include', - RIVE_RUNTIME_DIR .. '/skia/renderer/include', - RIVE_RUNTIME_DIR .. '/skia/dependencies/' .. SKIA_DIR_NAME, - RIVE_RUNTIME_DIR .. '/skia/dependencies/' .. SKIA_DIR_NAME .. '/include/core', - RIVE_RUNTIME_DIR .. '/skia/dependencies/' .. SKIA_DIR_NAME .. '/include/effects', - RIVE_RUNTIME_DIR .. '/skia/dependencies/' .. SKIA_DIR_NAME .. '/include/gpu', - RIVE_RUNTIME_DIR .. '/skia/dependencies/' .. SKIA_DIR_NAME .. '/include/config', -}) - -if os.host() == 'macosx' then - links({ - 'Cocoa.framework', - 'rive', - 'skia', - 'rive_skia_renderer', - 'rive_harfbuzz', - 'rive_sheenbidi', + includedirs({ + RIVE_RUNTIME_DIR .. '/include', + RIVE_RUNTIME_DIR .. '/skia/renderer/include', + RIVE_RUNTIME_DIR .. '/skia/dependencies/' .. SKIA_DIR_NAME, + RIVE_RUNTIME_DIR .. '/skia/dependencies/' .. SKIA_DIR_NAME .. '/include/core', + RIVE_RUNTIME_DIR .. '/skia/dependencies/' .. SKIA_DIR_NAME .. '/include/effects', + RIVE_RUNTIME_DIR .. '/skia/dependencies/' .. SKIA_DIR_NAME .. '/include/gpu', + RIVE_RUNTIME_DIR .. '/skia/dependencies/' .. SKIA_DIR_NAME .. '/include/config', + '/usr/local/include', + '/usr/include', + yoga, }) -else - links({ - 'rive', - 'rive_skia_renderer', - 'skia', - 'GL', - 'rive_harfbuzz', - 'rive_sheenbidi', - }) -end - -libdirs({ - '../../../build/%{cfg.system}/bin/%{cfg.buildcfg}', - '../../dependencies/skia/out/static', - '../../renderer/build/%{cfg.system}/bin/%{cfg.buildcfg}', -}) - -files({ '../src/**.cpp' }) - -buildoptions({ '-Wall', '-fno-exceptions', '-fno-rtti' }) - -filter('configurations:debug') -defines({ 'DEBUG' }) -symbols('On') - -filter('configurations:release') -defines({ 'RELEASE' }) -defines({ 'NDEBUG' }) -optimize('On') - -filter({ 'options:with_rive_layout' }) -do defines({ 'YOGA_EXPORT=' }) - includedirs({ yoga }) - links({ - 'rive_yoga', - }) -end --- Clean Function -- -newaction({ - trigger = 'clean', - description = 'clean the build', - execute = function() - print('clean the build...') - os.rmdir('./bin') - os.rmdir('./obj') - os.remove('Makefile') - -- no wildcards in os.remove, so use shell - os.execute('rm *.make') - print('build cleaned') - end, -}) + if os.host() == 'macosx' then + links({ + 'Cocoa.framework', + 'skia', + 'rive', + 'rive_skia_renderer', + 'rive_harfbuzz', + 'rive_sheenbidi', + 'rive_yoga', + }) + else + links({ + 'skia', + 'GL', + 'rive', + 'rive_skia_renderer', + 'rive_harfbuzz', + 'rive_sheenbidi', + 'rive_yoga', + }) + end + + libdirs({ + -- hmm nothing here? + -- RIVE_RUNTIME_DIR .. '/build/%{cfg.system}/bin/%{cfg.buildcfg}', + -- RIVE_RUNTIME_DIR .. '/dependencies/%{cfg.system}/cache/bin/%{cfg.buildcfg}', + RIVE_RUNTIME_DIR .. '/skia/dependencies/' .. SKIA_DIR_NAME .. '/out/static', + RIVE_RUNTIME_DIR .. '/skia/renderer/build/%{cfg.system}/bin/%{cfg.buildcfg}', + '/usr/local/lib', + '/usr/lib', + }) + files({ '../src/**.cpp',}) + +end diff --git a/skia/thumbnail_generator/run.sh b/skia/thumbnail_generator/run.sh index 263888e7..2770f996 100755 --- a/skia/thumbnail_generator/run.sh +++ b/skia/thumbnail_generator/run.sh @@ -1 +1 @@ -./build/bin/debug/rive_thumbnail_generator \ No newline at end of file +./build/out/release/rive_thumbnail_generator \ No newline at end of file