blob: 21cd2adb0d80174a2b6b51056e1039a596de5d5a [file]
dofile('rive_build_config.lua')
local dependency = require('dependency')
-- packages/yoga is the source of truth; mirrors of the runtime build the copy
-- published to our fork at the pinned tag instead.
local packages = path.getabsolute(path.join(path.getdirectory(_SCRIPT), '../..'))
if path.getname(packages) == 'packages' and os.isdir(packages .. '/yoga/yoga') then
yoga = packages .. '/yoga'
else
local ref = io.readfile(path.join(path.getdirectory(_SCRIPT), 'yoga.ref'))
yoga = dependency.github('rive-app/yoga', (ref:gsub('%s', '')))
end
newoption({
trigger = 'no-yoga-renames',
description = 'don\'t rename yoga symbols',
})
project('rive_yoga')
do
kind('StaticLib')
warnings('Off')
defines({ 'YOGA_EXPORT=' })
includedirs({ yoga })
filter('action:xcode4')
do
-- xcode doesnt like angle brackets except for -isystem
-- should use externalincludedirs but GitHub runners dont have latest premake5 binaries
buildoptions({ '-isystem' .. yoga })
end
filter({})
files({
yoga .. '/yoga/Utils.cpp',
yoga .. '/yoga/YGConfig.cpp',
yoga .. '/yoga/YGLayout.cpp',
yoga .. '/yoga/YGEnums.cpp',
yoga .. '/yoga/YGNodePrint.cpp',
yoga .. '/yoga/YGNode.cpp',
yoga .. '/yoga/YGValue.cpp',
yoga .. '/yoga/YGStyle.cpp',
yoga .. '/yoga/Yoga.cpp',
yoga .. '/yoga/event/event.cpp',
yoga .. '/yoga/log.cpp',
yoga .. '/yoga/YGGridTrackList.cpp',
yoga .. '/yoga/grid/GridLayout.cpp',
})
filter({ 'options:not no-yoga-renames' })
do
includedirs({ './' })
forceincludes({ 'rive_yoga_renames.h' })
end
end