Skip to content

Commit

Permalink
Add static/dynamic runtime config based on actual target config.
Browse files Browse the repository at this point in the history
Based on chat with Matt from geotech.

Diffs=
335a30588 Add static/dynamic runtime config based on actual target config. (#7184)

Co-authored-by: Luigi Rosso <[email protected]>
  • Loading branch information
luigi-rosso and luigi-rosso committed May 2, 2024
1 parent efe0382 commit 0a88f0e
Show file tree
Hide file tree
Showing 4 changed files with 26 additions and 12 deletions.
2 changes: 1 addition & 1 deletion .rive_head
Original file line number Diff line number Diff line change
@@ -1 +1 @@
8db7cac50c53ab10838da0cd80c869917c51c72a
335a30588e5052375d6245e65c3c0a64864d486e
31 changes: 21 additions & 10 deletions build/rive_build_config.lua
Original file line number Diff line number Diff line change
Expand Up @@ -131,30 +131,41 @@ do
end

newoption({
trigger = 'use_default_runtime',
description = 'Don\'t set windows static runtime and runtime values.',
})

newoption({
trigger = 'runtime',
trigger = 'windows_runtime',
description = 'Choose whether to use staticruntime on/off/default',
allowed = {
{ 'default', 'Use default runtime' },
{ 'static', 'Use static runtime' },
{ 'dynamic', 'Use dynamic runtime' },
},
default = 'static',
default = 'default',
})

filter({ 'system:windows', 'options:runtime=static' })
-- This is just to match our old windows config. Gamekit specifically sets
-- static/dynamic and maybe we should do the same elsewhere.
filter({ 'system:windows', 'options:windows_runtime=default' })
do
staticruntime('on') -- Match Skia's /MT flag for link compatibility
runtime('Release')
end

filter({ 'system:windows', 'options:windows_runtime=static' })
do
staticruntime('on') -- Match Skia's /MT flag for link compatibility
runtime('Release') -- Use /MT even in debug (/MTd is incompatible with Skia)
end

filter({ 'system:windows', 'options:runtime=dynamic' })
filter({ 'system:windows', 'options:windows_runtime=dynamic' })
do
staticruntime('off')
end

filter({ 'system:windows', 'options:not windows_runtime=default', 'options:config=debug' })
do
runtime('Debug')
end

filter({ 'system:windows', 'options:not windows_runtime=default', 'options:config=release' })
do
runtime('Release')
end

Expand Down
3 changes: 2 additions & 1 deletion dependencies/premake5_harfbuzz_v2.lua
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
dofile('rive_build_config.lua')

local dependency = require('dependency')
harfbuzz = dependency.github('rive-app/harfbuzz', 'rive_8.3.0')
harfbuzz = dependency.github('rive-app/harfbuzz', 'rive_8.4.0')

newoption({
trigger = 'no-harfbuzz-renames',
Expand Down Expand Up @@ -225,6 +225,7 @@ do
warnings('Off')

defines({
'HB_ONLY_ONE_SHAPER', -- added this for Geotech Mac multi-module issue: https://github.com/rive-app/rive-cpp/issues/369
'HAVE_OT',
'HB_NO_FALLBACK_SHAPE',
'HB_NO_WIN1256',
Expand Down
2 changes: 2 additions & 0 deletions dependencies/rive_png_renames.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
#define RIVE_PNG_RENAMES_H
#define PNGPREFIX_H
#define PNG_PREFIX rive_
#define png_image_write_to_memory rive_png_image_write_to_memory
#define png_check_keyword rive_png_check_keyword
#define png_sRGB_table rive_png_sRGB_table
#define png_sRGB_base rive_png_sRGB_base
#define png_sRGB_delta rive_png_sRGB_delta
Expand Down

0 comments on commit 0a88f0e

Please sign in to comment.