mirror of
https://github.com/rive-app/rive-cpp.git
synced 2026-01-18 13:11:19 +01:00
feat: Integrate glfw into the premake build (#10656) 653c8c6040
Build GLFW with premake instead of requiring the user to call out into a custom script thatbuses their cmake. feat(scripting): split code panels (#10655) 9d8b49152e * feature(scripting): command palette * feature: adding split pane saving * chore: update to latest luau * fix: pixel correct scrollbars * feature: reload scroll position of script pane * feature: module titles on panes * chore: merging command palettes * fix: cleanup * chore: refactor searchbar tests * fix: failing test * chore: cleanup * chore: cleanup * chore: cleanup unused commented code * feature: hover for command palette items * chore: cleanup mocks Co-authored-by: Chris Dalton <99840794+csmartdalton@users.noreply.github.com> Co-authored-by: Luigi Rosso <luigi-rosso@users.noreply.github.com>
This commit is contained in:
@@ -1 +1 @@
|
||||
0f0d7c5f813080c2fbc0f81e3f17ab6f518799dd
|
||||
653c8c6040e08b14368c916bb1f4ff9d10293b2c
|
||||
|
||||
111
dependencies/premake5_glfw_v2.lua
vendored
Normal file
111
dependencies/premake5_glfw_v2.lua
vendored
Normal file
@@ -0,0 +1,111 @@
|
||||
dofile('rive_build_config.lua')
|
||||
|
||||
local dependency = require('dependency')
|
||||
glfw = dependency.github('glfw/glfw', '3.4')
|
||||
|
||||
project('glfw3')
|
||||
do
|
||||
kind('StaticLib')
|
||||
|
||||
includedirs({ glfw .. '/include' })
|
||||
|
||||
files({
|
||||
glfw .. '/src/internal.h',
|
||||
glfw .. '/src/platform.h',
|
||||
glfw .. '/src/mappings.h',
|
||||
glfw .. '/src/context.c',
|
||||
glfw .. '/src/init.c',
|
||||
glfw .. '/src/input.c',
|
||||
glfw .. '/src/monitor.c',
|
||||
glfw .. '/src/platform.c',
|
||||
glfw .. '/src/vulkan.c',
|
||||
glfw .. '/src/window.c',
|
||||
glfw .. '/src/egl_context.c',
|
||||
glfw .. '/src/osmesa_context.c',
|
||||
glfw .. '/src/null_platform.h',
|
||||
glfw .. '/src/null_joystick.h',
|
||||
glfw .. '/src/null_init.c',
|
||||
glfw .. '/src/null_monitor.c',
|
||||
glfw .. '/src/null_window.c',
|
||||
glfw .. '/src/null_joystick.c',
|
||||
})
|
||||
|
||||
filter({ 'system:windows' })
|
||||
do
|
||||
defines({
|
||||
'_GLFW_WIN32',
|
||||
'UNICODE',
|
||||
'_UNICODE',
|
||||
})
|
||||
|
||||
files({
|
||||
glfw .. '/src/win32_time.h',
|
||||
glfw .. '/src/win32_thread.h',
|
||||
glfw .. '/src/win32_module.c',
|
||||
glfw .. '/src/win32_time.c',
|
||||
glfw .. '/src/win32_thread.c',
|
||||
glfw .. '/src/win32_platform.h',
|
||||
glfw .. '/src/win32_joystick.h',
|
||||
glfw .. '/src/win32_init.c',
|
||||
glfw .. '/src/win32_joystick.c',
|
||||
glfw .. '/src/win32_monitor.c',
|
||||
glfw .. '/src/win32_window.c',
|
||||
glfw .. '/src/wgl_context.c',
|
||||
})
|
||||
end
|
||||
|
||||
filter({ 'system:macosx' })
|
||||
do
|
||||
defines({ '_GLFW_COCOA' })
|
||||
removebuildoptions({ '-fobjc-arc' })
|
||||
|
||||
files({
|
||||
glfw .. '/src/cocoa_time.h',
|
||||
glfw .. '/src/cocoa_time.c',
|
||||
glfw .. '/src/posix_thread.h',
|
||||
glfw .. '/src/posix_module.c',
|
||||
glfw .. '/src/posix_thread.c',
|
||||
glfw .. '/src/cocoa_platform.h',
|
||||
glfw .. '/src/cocoa_joystick.h',
|
||||
glfw .. '/src/cocoa_init.m',
|
||||
glfw .. '/src/cocoa_joystick.m',
|
||||
glfw .. '/src/cocoa_monitor.m',
|
||||
glfw .. '/src/cocoa_window.m',
|
||||
glfw .. '/src/nsgl_context.m',
|
||||
})
|
||||
end
|
||||
|
||||
filter({ 'system:linux' })
|
||||
do
|
||||
defines({
|
||||
'_GLFW_X11',
|
||||
'_DEFAULT_SOURCE',
|
||||
})
|
||||
|
||||
files({
|
||||
glfw .. '/src/posix_time.h',
|
||||
glfw .. '/src/posix_thread.h',
|
||||
glfw .. '/src/posix_module.c',
|
||||
glfw .. '/src/posix_time.c',
|
||||
glfw .. '/src/posix_thread.c',
|
||||
glfw .. '/src/x11_platform.h',
|
||||
glfw .. '/src/xkb_unicode.h',
|
||||
glfw .. '/src/x11_init.c',
|
||||
glfw .. '/src/x11_monitor.c',
|
||||
glfw .. '/src/x11_window.c',
|
||||
glfw .. '/src/xkb_unicode.c',
|
||||
glfw .. '/src/glx_context.c',
|
||||
glfw .. '/src/linux_joystick.h',
|
||||
glfw .. '/src/linux_joystick.c',
|
||||
glfw .. '/src/posix_poll.h',
|
||||
glfw .. '/src/posix_poll.c',
|
||||
})
|
||||
end
|
||||
|
||||
filter({ 'system:not windows', 'system:not macosx', 'system:not linux' })
|
||||
do
|
||||
-- Don't build GLFW on mobile or web platforms. It's integrated into
|
||||
-- emscripten and unavailable on mobile.
|
||||
kind('None')
|
||||
end
|
||||
end
|
||||
@@ -11,14 +11,6 @@ git clone https://github.com/rive-app/rive-runtime.git
|
||||
cd rive-runtime/renderer
|
||||
```
|
||||
|
||||
## Build GLFW
|
||||
|
||||
```
|
||||
pushd ../skia/dependencies
|
||||
./make_glfw.sh
|
||||
popd
|
||||
```
|
||||
|
||||
## Add build_rive.sh to $PATH
|
||||
|
||||
```
|
||||
|
||||
@@ -3,6 +3,7 @@ dofile('rive_build_config.lua')
|
||||
dofile('premake5_pls_renderer.lua')
|
||||
dofile(RIVE_RUNTIME_DIR .. '/premake5_v2.lua')
|
||||
dofile(RIVE_RUNTIME_DIR .. '/decoders/premake5_v2.lua')
|
||||
dofile(RIVE_RUNTIME_DIR .. '/dependencies/premake5_glfw_v2.lua')
|
||||
|
||||
newoption({ trigger = 'with-skia', description = 'use skia' })
|
||||
if _OPTIONS['with-skia'] then
|
||||
@@ -25,7 +26,7 @@ if not _OPTIONS['with-webgpu'] then
|
||||
externalincludedirs({
|
||||
'glad',
|
||||
'glad/include',
|
||||
RIVE_RUNTIME_DIR .. '/skia/dependencies/glfw/include',
|
||||
glfw .. '/include',
|
||||
yoga,
|
||||
})
|
||||
|
||||
@@ -86,9 +87,6 @@ if not _OPTIONS['with-webgpu'] then
|
||||
do
|
||||
architecture('x64')
|
||||
defines({ 'RIVE_WINDOWS', '_CRT_SECURE_NO_WARNINGS' })
|
||||
libdirs({
|
||||
RIVE_RUNTIME_DIR .. '/skia/dependencies/glfw_build/src/Release',
|
||||
})
|
||||
links({ 'glfw3', 'opengl32', 'd3d11', 'd3d12', 'dxguid', 'dxgi', 'd3dcompiler'})
|
||||
end
|
||||
if _OPTIONS['with_optick'] then
|
||||
@@ -113,13 +111,11 @@ if not _OPTIONS['with-webgpu'] then
|
||||
'QuartzCore.framework',
|
||||
'IOKit.framework',
|
||||
})
|
||||
libdirs({ RIVE_RUNTIME_DIR .. '/skia/dependencies/glfw_build/src' })
|
||||
end
|
||||
|
||||
filter('system:linux')
|
||||
do
|
||||
links({ 'glfw3' })
|
||||
libdirs({ RIVE_RUNTIME_DIR .. '/skia/dependencies/glfw_build/src' })
|
||||
end
|
||||
|
||||
filter('options:with-dawn')
|
||||
@@ -192,7 +188,7 @@ if _OPTIONS['with-webgpu'] or _OPTIONS['with-dawn'] then
|
||||
RIVE_RUNTIME_DIR .. '/include',
|
||||
'glad',
|
||||
'include',
|
||||
RIVE_RUNTIME_DIR .. '/skia/dependencies/glfw/include',
|
||||
glfw .. '/include',
|
||||
})
|
||||
externalincludedirs({'glad/include'})
|
||||
|
||||
@@ -222,9 +218,6 @@ if _OPTIONS['with-webgpu'] or _OPTIONS['with-dawn'] then
|
||||
do
|
||||
architecture('x64')
|
||||
defines({ 'RIVE_WINDOWS', '_CRT_SECURE_NO_WARNINGS' })
|
||||
libdirs({
|
||||
RIVE_RUNTIME_DIR .. '/skia/dependencies/glfw_build/src/Release',
|
||||
})
|
||||
links({ 'glfw3', 'opengl32', 'd3d11', 'dxgi', 'd3dcompiler' })
|
||||
end
|
||||
|
||||
@@ -239,7 +232,6 @@ if _OPTIONS['with-webgpu'] or _OPTIONS['with-dawn'] then
|
||||
'QuartzCore.framework',
|
||||
'IOKit.framework',
|
||||
})
|
||||
libdirs({ RIVE_RUNTIME_DIR .. '/skia/dependencies/glfw_build/src' })
|
||||
end
|
||||
|
||||
filter('options:with-dawn')
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
local dependency = require('dependency')
|
||||
local luau = dependency.github('luigi-rosso/luau', 'rive_0_16')
|
||||
local luau = dependency.github('luigi-rosso/luau', 'rive_0_17')
|
||||
|
||||
dofile('rive_build_config.lua')
|
||||
|
||||
|
||||
@@ -7,6 +7,7 @@ RIVE_PLS_DIR = path.getabsolute('../renderer')
|
||||
dofile(RIVE_RUNTIME_DIR .. '/premake5_v2.lua')
|
||||
dofile(RIVE_RUNTIME_DIR .. '/cg_renderer/premake5.lua')
|
||||
dofile(RIVE_RUNTIME_DIR .. '/dependencies/premake5_libpng_v2.lua')
|
||||
dofile(RIVE_RUNTIME_DIR .. '/dependencies/premake5_glfw_v2.lua')
|
||||
dofile(RIVE_RUNTIME_DIR .. '/decoders/premake5_v2.lua')
|
||||
dofile(RIVE_PLS_DIR .. '/premake5_pls_renderer.lua')
|
||||
|
||||
@@ -94,7 +95,7 @@ function rive_tools_project(name, project_kind)
|
||||
filter({ 'system:windows or macosx or linux', 'options:not for_unreal' })
|
||||
do
|
||||
externalincludedirs({
|
||||
RIVE_RUNTIME_DIR .. '/skia/dependencies/glfw/include',
|
||||
glfw .. '/include',
|
||||
})
|
||||
end
|
||||
|
||||
@@ -214,9 +215,6 @@ function rive_tools_project(name, project_kind)
|
||||
|
||||
filter({ 'kind:ConsoleApp or SharedLib or WindowedApp', 'system:windows' })
|
||||
do
|
||||
libdirs({
|
||||
RIVE_RUNTIME_DIR .. '/skia/dependencies/glfw_build/src/Release',
|
||||
})
|
||||
links({
|
||||
'glfw3',
|
||||
'opengl32',
|
||||
@@ -232,7 +230,6 @@ function rive_tools_project(name, project_kind)
|
||||
|
||||
filter({ 'kind:ConsoleApp or SharedLib or WindowedApp', 'system:macosx' })
|
||||
do
|
||||
libdirs({ RIVE_RUNTIME_DIR .. '/skia/dependencies/glfw_build/src' })
|
||||
links({
|
||||
'glfw3',
|
||||
'Metal.framework',
|
||||
@@ -254,7 +251,6 @@ function rive_tools_project(name, project_kind)
|
||||
|
||||
filter({ 'kind:ConsoleApp or SharedLib or WindowedApp', 'system:linux' })
|
||||
do
|
||||
libdirs({ RIVE_RUNTIME_DIR .. '/skia/dependencies/glfw_build/src' })
|
||||
links({ 'glfw3', 'm', 'z', 'dl', 'pthread', 'GL' })
|
||||
end
|
||||
|
||||
|
||||
Reference in New Issue
Block a user