Files
rive-cpp/decoders/premake5_v2.lua
csmartdalton 7f3d8d96bf build: Fix premake5 build on macOS Sequoia (#10263) b4298b861b
It looks like the premake5 "v5.0.0-beta3" tag isn't compatible with
Sequoia 15.4.1. Bump our tag to v5.0.0-beta7 and update the deprecated
features we had been using.

Also fix the script to rebuild if the premake5 binary doesn't exist.
Before it only checked if the parent "premake-core" directory existed,
so if a build had failed previously, build_rive.sh would fail forever
without ever attempting to build premake5 again.

Co-authored-by: Chris Dalton <99840794+csmartdalton@users.noreply.github.com>
Co-authored-by: Jonathon Copeland <jcopela4@gmail.com>
2025-07-31 00:27:07 +00:00

108 lines
2.3 KiB
Lua

dofile('rive_build_config.lua')
if _OPTIONS['no-rive-decoders'] then
return
end
local rive = path.getabsolute('../')
newoption({
trigger = 'no_rive_png',
description = 'don\'t build png (or zlib) support into the rive_decoders library (built-in png decoding will fail)',
})
newoption({
trigger = 'no_rive_jpeg',
description = 'don\'t build jpeg support into the rive_decoders library (built-in jpeg decoding will fail)',
})
newoption({
trigger = 'no_rive_webp',
description = 'don\'t build webp support into the rive_decoders library (built-in webp decoding will fail)',
})
if not _OPTIONS["no_rive_png"] then
dofile(rive .. '/dependencies/premake5_libpng_v2.lua')
end
if not _OPTIONS["no_rive_jpeg"] then
dofile(rive .. '/dependencies/premake5_libjpeg_v2.lua')
end
if not _OPTIONS["no_rive_webp"] then
dofile(rive .. '/dependencies/premake5_libwebp_v2.lua')
else
libwebp = ''
end
project('rive_decoders')
do
kind('StaticLib')
fatalwarnings { "All" }
includedirs({
'include',
'../include',
'%{cfg.targetdir}/include/libpng',
})
files({
'src/bitmap_decoder.cpp',
})
filter({ 'options:not no-libjpeg-renames' })
do
includedirs({
rive .. '/dependencies',
})
forceincludes({ 'rive_libjpeg_renames.h' })
end
filter({
'system:macosx or system:ios',
'not options:variant=appletvos',
'not options:variant=appletvsimulator',
})
do
files({ 'src/**.mm' })
end
filter({ 'options:not no_rive_webp or no_rive_png or no_rive_jpeg'})
do
files({
'src/bitmap_decoder_thirdparty.cpp',
})
end
filter({'options:not no_rive_png'})
do
includedirs({
libpng
})
dependson('zlib', 'libpng')
defines({ 'RIVE_PNG' })
files({ 'src/decode_png.cpp' })
end
filter({ 'options:not no_rive_jpeg' })
do
includedirs({
libjpeg
})
dependson('libjpeg')
defines({ 'RIVE_JPEG' })
files({ 'src/decode_jpeg.cpp' })
end
filter({ 'options:not no_rive_webp' })
do
includedirs({
libwebp .. '/src'
})
dependson('libwebp')
defines({ 'RIVE_WEBP' })
files({ 'src/decode_webp.cpp' })
end
end