101 lines
2.3 KiB
Meson
101 lines
2.3 KiB
Meson
project('hellogl', '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=[
|
|
'-Wno-unused-parameter',
|
|
'-Wno-unused-function',
|
|
'-Wno-unused-variable',
|
|
'-Wno-unused-but-set-variable',
|
|
'-Wno-deprecated-declarations',
|
|
]
|
|
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',
|
|
'-lstdc++exp',
|
|
language: 'cpp',
|
|
)
|
|
|
|
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
|
|
]
|
|
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
|
|
|
|
glfw3 = subproject('glfw').get_variable('glfw_dep')
|
|
fuc2 = subproject('fuc2').get_variable('fuc2_dep')
|
|
fmt = subproject('fmt').get_variable('fmt_dep')
|
|
glm = subproject('glm').get_variable('glm_dep')
|
|
json = subproject('nlohmann_json').get_variable('nlohmann_json_dep')
|
|
|
|
assimp = subproject('assimp').get_variable('assimp_dep')
|
|
|
|
dependencies += [
|
|
glfw3, fuc2, fmt, glm, assimp, json
|
|
]
|
|
|
|
inc_dirs = ['src']
|
|
|
|
sources = [
|
|
'src/glad/glad.cpp',
|
|
'src/dbc.cpp',
|
|
'src/stb_image.cpp',
|
|
'src/shader.cpp',
|
|
'src/mesh.cpp',
|
|
'src/utils.cpp',
|
|
'src/model.cpp',
|
|
'src/scene.cpp',
|
|
'src/camera.cpp',
|
|
]
|
|
|
|
subdir('tests')
|
|
|
|
executable('fuc2it', sources + fuc2_tests,
|
|
cpp_args: cpp_args,
|
|
link_args: link_args,
|
|
include_directories: inc_dirs,
|
|
override_options: exe_defaults,
|
|
dependencies: dependencies + [fuc2])
|
|
|
|
executable('hellogl',
|
|
sources + [ 'src/main.cpp' ],
|
|
cpp_args: cpp_args,
|
|
include_directories: inc_dirs,
|
|
link_args: link_args,
|
|
override_options: exe_defaults,
|
|
dependencies: dependencies)
|