Initial commit with the chapter-0 code working.

This commit is contained in:
Zed A. Shaw 2025-11-24 10:50:50 -05:00
commit 7298568818
19 changed files with 8380 additions and 0 deletions

86
meson.build Normal file
View file

@ -0,0 +1,86 @@
# clang might need _LIBCPP_ENABLE_CXX26_REMOVED_CODECVT
project('hellovulk', 'cpp',
version: '0.1.0',
default_options: [
'cpp_std=c++23',
'cpp_args=-D_GLIBCXX_DEBUG=1 -D_GLIBCXX_DEBUG_PEDANTIC=1',
])
# use this for common options only for our executables
cpp_args=[]
link_args=[]
# these are passed as override_defaults
exe_defaults = [ 'warning_level=2' ]
cc = meson.get_compiler('cpp')
dependencies = []
if build_machine.system() == 'windows'
add_global_link_arguments(
'-static-libgcc',
'-static-libstdc++',
'-static',
language: 'cpp',
)
sdl2_main = subproject('sld2').get_variable('sdl2_main')
opengl32 = cc.find_library('opengl32', required: true)
winmm = cc.find_library('winmm', required: true)
gdi32 = cc.find_library('gdi32', required: true)
dependencies += [
opengl32, winmm, gdi32, sdl2_main
]
exe_defaults += ['werror=true']
elif build_machine.system() == 'darwin'
add_global_link_arguments(
language: 'cpp',
)
opengl = dependency('OpenGL')
corefoundation = dependency('CoreFoundation')
carbon = dependency('Carbon')
cocoa = dependency('Cocoa')
iokit = dependency('IOKit')
corevideo = dependency('CoreVideo')
link_args += ['-ObjC']
exe_defaults += ['werror=false']
dependencies += [
opengl, corefoundation, carbon, cocoa, iokit, corevideo
]
endif
vma = subproject('vulkan-memory-allocator').get_variable('vma_allocator_dep')
vulkanheaders = subproject('vulkan-headers').get_variable('vulkan_headers_dep')
vkbootstrap = subproject('vk-bootstrap').get_variable('vk_bootstrap_dep')
glm = subproject('glm').get_variable('glm_dep')
imgui = subproject('imgui').get_variable('imgui_dep')
sdl2 = subproject('sdl2').get_variable('sdl2_dep')
dependencies += [
vma,
vulkanheaders,
vkbootstrap,
glm,
imgui,
sdl2,
]
sources = [
'vk_initializers.cpp',
'vk_engine.cpp',
'main.cpp',
]
tests = [
]
executable('hellovulk', sources,
cpp_args: cpp_args,
link_args: link_args,
override_options: exe_defaults,
dependencies: dependencies)