diff --git a/.rive_head b/.rive_head index 5cc13fd7..7845da81 100644 --- a/.rive_head +++ b/.rive_head @@ -1 +1 @@ -0f0d7c5f813080c2fbc0f81e3f17ab6f518799dd +653c8c6040e08b14368c916bb1f4ff9d10293b2c diff --git a/dependencies/premake5_glfw_v2.lua b/dependencies/premake5_glfw_v2.lua new file mode 100644 index 00000000..0c49b447 --- /dev/null +++ b/dependencies/premake5_glfw_v2.lua @@ -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 diff --git a/renderer/README.md b/renderer/README.md index 802cd3f1..7d73dce9 100644 --- a/renderer/README.md +++ b/renderer/README.md @@ -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 ``` diff --git a/renderer/premake5.lua b/renderer/premake5.lua index 255c6d97..7dffb712 100644 --- a/renderer/premake5.lua +++ b/renderer/premake5.lua @@ -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') diff --git a/scripting/premake5.lua b/scripting/premake5.lua index ef943edd..a8c8f605 100755 --- a/scripting/premake5.lua +++ b/scripting/premake5.lua @@ -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') diff --git a/tests/rive_tools_project.lua b/tests/rive_tools_project.lua index ca2445bd..26864446 100644 --- a/tests/rive_tools_project.lua +++ b/tests/rive_tools_project.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