93 lines
2.1 KiB
Meson
93 lines
2.1 KiB
Meson
# 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',
|
|
])
|
|
|
|
cmake = import('cmake')
|
|
|
|
# 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')
|
|
glm = subproject('glm').get_variable('glm_dep')
|
|
imgui = subproject('imgui').get_variable('imgui_dep')
|
|
sdl2 = subproject('sdl2').get_variable('sdl2_dep')
|
|
|
|
opts = cmake.subproject_options()
|
|
opts.add_cmake_defines({
|
|
'VK_BOOTSTRAP_TEST': false,
|
|
'VK_BOOTSTRAP_INSTALL': false,
|
|
})
|
|
vkbootstrap_proj = cmake.subproject('vk-bootstrap', options: opts)
|
|
vkbootstrap = vkbootstrap_proj.get_variable('vk_bootstrap_dep')
|
|
|
|
dependencies += [
|
|
vma,
|
|
vkbootstrap,
|
|
glm,
|
|
imgui,
|
|
sdl2,
|
|
]
|
|
|
|
sources = [
|
|
'vk_initializers.cpp',
|
|
'vk_engine.cpp',
|
|
'vk_images.cpp',
|
|
'main.cpp',
|
|
]
|
|
|
|
tests = [
|
|
]
|
|
|
|
executable('hellovulk', sources,
|
|
cpp_args: cpp_args,
|
|
link_args: link_args,
|
|
override_options: exe_defaults,
|
|
dependencies: dependencies)
|