Major changes

Signed-off-by: Robear Selwans <robear.selwans@outlook.com>
This commit is contained in:
2025-07-02 12:26:20 +03:00
parent 4ec57bbd79
commit dd0d232c97
32 changed files with 997 additions and 182 deletions

View File

@@ -1,13 +1,11 @@
[wrap-file]
directory = glfw-3.3.10
source_url = https://github.com/glfw/glfw/archive/refs/tags/3.3.10.tar.gz
source_filename = glfw-3.3.10.tar.gz
source_hash = 4ff18a3377da465386374d8127e7b7349b685288cb8e17122f7e1179f73769d5
patch_filename = glfw_3.3.10-1_patch.zip
patch_url = https://wrapdb.mesonbuild.com/v2/glfw_3.3.10-1/get_patch
patch_hash = 3567f96c2576a5fc8c9cafd9059f919d7da404f6c22450c6c2ce3f9938909b8b
source_fallback_url = https://github.com/mesonbuild/wrapdb/releases/download/glfw_3.3.10-1/glfw-3.3.10.tar.gz
wrapdb_version = 3.3.10-1
[wrap-git]
directory = glfw
url = https://github.com/glfw/glfw
revision = 3.3.10
depth=1
patch_directory = glfw
[provide]
glfw3 = glfw_dep

View File

@@ -0,0 +1,145 @@
# Modified Meson WrapDB file
project(
'glfw',
'c',
version: '3.3.10',
license: 'Zlib',
default_options: ['b_ndebug=if-release', 'c_std=c99', 'warning_level=0'],
meson_version: '>=0.58.0',
)
#@ Project variables
sys_os = host_machine.system()
sys_cc = meson.get_compiler('c')
opt_libdir = get_option('libdir')
is_posix = sys_os != 'windows'
if get_option('default_library') != 'static'
add_project_arguments('-D_GLFW_BUILD_DLL', language: 'c')
endif
if sys_os == 'windows'
opt_display = 'win32'
elif sys_os == 'darwin'
opt_display = 'cocoa'
else
opt_display = 'x11'
endif
### Dependencies ###
deps = []
#@ Backend API
# X11
if opt_display == 'x11'
foreach x : ['x11', 'xrandr', 'xinerama', 'xcursor', 'xi', 'xkbcommon']
deps += dependency(x, required: true)
endforeach
# Win32
elif opt_display == 'win32'
if sys_os != 'windows'
error('Non Windows is unsupportred')
endif
# Cocoa
elif opt_display == 'cocoa'
if sys_os != 'darwin'
error('Non macOS is unsupported')
endif
deps += dependency('appleframeworks', modules: ['Cocoa', 'CoreFoundation', 'IOKit'])
endif
#@ System Dependencies
foreach l : ['m', 'rt']
deps += sys_cc.find_library(l, required: false)
endforeach
if meson.version().version_compare('>= 0.62')
deps += dependency('dl', required: false)
else
deps += sys_cc.find_library('dl', required: false)
endif
deps += dependency('threads')
### Configuration ###
cfg_data = configuration_data()
foreach d : ['osmesa', 'x11', 'wayland', 'win32', 'cocoa']
cfg_data.set('_GLFW_' + d.to_upper(), opt_display == d)
endforeach
cfg_file = configure_file(configuration: cfg_data, output: 'glfw_config.h')
### Targets ###
#@ Primary target:
## GLFW library
# Common files
s_common = files('src/context.c', 'src/init.c', 'src/input.c', 'src/monitor.c', 'src/vulkan.c', 'src/window.c')
s_common += cfg_file
# Backend files
if opt_display == 'x11'
s_display = files(
'src/egl_context.c',
'src/glx_context.c',
'src/osmesa_context.c',
'src/posix_thread.c',
'src/posix_time.c',
'src/x11_init.c',
'src/x11_monitor.c',
'src/x11_window.c',
'src/xkb_unicode.c',
'src/@0@_joystick.c'.format(sys_os == 'linux' ? 'linux' : 'null'),
)
elif opt_display == 'win32'
s_display = files(
'src/egl_context.c',
'src/osmesa_context.c',
'src/wgl_context.c',
'src/win32_init.c',
'src/win32_joystick.c',
'src/win32_monitor.c',
'src/win32_thread.c',
'src/win32_time.c',
'src/win32_window.c',
)
elif opt_display == 'cocoa'
add_languages('objc', native: false)
s_display = files(
'src/cocoa_init.m',
'src/cocoa_joystick.m',
'src/cocoa_monitor.m',
'src/cocoa_time.c',
'src/cocoa_window.m',
'src/egl_context.c',
'src/nsgl_context.m',
'src/osmesa_context.c',
'src/posix_thread.c',
)
add_project_arguments('-D_GLFW_USE_CONFIG_H', language: 'objc')
if host_machine.system() == 'darwin'
add_project_arguments('-D_DARWIN_C_SOURCE', language: 'objc')
endif
endif
srcfiles = [s_common, s_display]
incdirs = include_directories('include', 'src')
#@ Flags
add_project_arguments('-D_GLFW_USE_CONFIG_H', language: 'c')
if host_machine.system() == 'darwin'
add_project_arguments('-D_DARWIN_C_SOURCE', language: 'c')
endif
c_args = ['-Wno-everything']
# Build
glfw_lib = library(
'glfw3',
srcfiles,
include_directories: incdirs,
dependencies: deps,
version: meson.project_version(),
build_by_default: true,
pic: true,
c_args: c_args,
)
glfw_dep = declare_dependency(
include_directories: incdirs,
link_with: glfw_lib,
)
meson.override_dependency('glfw3', glfw_dep)

View File

@@ -1,13 +1,27 @@
project('libshaderc', 'cpp', default_options: ['buildtype=release'])
project('libshaderc', 'cpp')
fs = import('fs')
cxxc = meson.get_compiler('cpp')
shaderc_inc = include_directories('install/include')
shaderc_dep = declare_dependency(
dependencies: cxxc.find_library('shaderc_combined', dirs: meson.current_source_dir()/'install/lib'),
include_directories: shaderc_inc,
)
python = find_program('python3')
run_command(python, './utils/git-sync-deps', check: true)
cmake = import('cmake')
opts = cmake.subproject_options()
opts.add_cmake_defines({
'CMAKE_MSVC_RUNTIME_LIBRARY': 'MultiThreaded',
'CMAKE_POLICY_DEFAULT_CMP0091': 'NEW',
'SHADERC_SKIP_INSTALL': 'ON',
'SHADERC_SKIP_TESTS': 'ON',
'SHADERC_SKIP_EXAMPLES': 'ON',
'SHADERC_SKIP_COPYRIGHT_CHECK': 'ON'
})
shaderc_proj = cmake.subproject('shaderc', options: opts)
shaderc_dep = declare_dependency(dependencies: [
shaderc_proj.dependency('shaderc'),
shaderc_proj.dependency('shaderc_util'),
shaderc_proj.dependency('SPIRV'),
shaderc_proj.dependency('SPIRV-Tools-static'),
shaderc_proj.dependency('SPIRV-Tools-opt'),
shaderc_proj.dependency('glslang'),
shaderc_proj.dependency('GenericCodeGen'),
shaderc_proj.dependency('MachineIndependent'),
])
meson.override_dependency('shaderc', shaderc_dep)

View File

@@ -0,0 +1,13 @@
project('libshaderc', 'cpp', default_options: ['buildtype=release', 'default_library=static'])
fs = import('fs')
cxxc = meson.get_compiler('cpp')
shaderc_inc = include_directories('install/include')
shaderc_dep = declare_dependency(
dependencies: cxxc.find_library('shaderc_combined', dirs: meson.current_source_dir()/'install/lib'),
include_directories: shaderc_inc,
)
meson.override_dependency('shaderc', shaderc_dep)

View File

@@ -0,0 +1 @@
project('shaderc_cmake', 'cpp')

View File

@@ -1,4 +1,7 @@
#define VMA_STATIC_VULKAN_FUNCTIONS 0
#define VMA_DYNAMIC_VULKAN_FUNCTIONS 0
#define VMA_IMPLEMENTATION
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Weverything"
#include <vk_mem_alloc.h>
#pragma clang diagnostic pop

View File

@@ -0,0 +1,10 @@
[wrap-git]
directory = shaderc_cmake
url = https://github.com/google/shaderc
revision = v2024.4
depth=1
patch_directory = shaderc_cmake
[provide]
dependency_names = shaderc_cmake

View File

@@ -1,12 +1,12 @@
[wrap-file]
directory = libshaderc
directory = libshaderc_old
source_url = https://storage.googleapis.com/shaderc/artifacts/prod/graphics_shader_compiler/shaderc/windows/continuous_release_2019/64/20241106-090939/install.zip
source_filename = libshaderc-upstream-msvc.zip
source_hash = a6879869e580d5991ebd9909f3665d1f6fe39cdb9830adf4f48b35dfd3782a78
lead_directory_missing = libshaderc
patch_directory = libshaderc
patch_directory = libshaderc_old
[provide]
dependency_names = shaderc
dependency_names = shaderc_old