Starting the refactor session on day 14. Moved the glad and KHR dirs into src to start.
This commit is contained in:
parent
1b7066757a
commit
5b5e8a9fb0
62 changed files with 13880 additions and 0 deletions
100
14-refactor/meson.build
Normal file
100
14-refactor/meson.build
Normal file
|
|
@ -0,0 +1,100 @@
|
|||
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')
|
||||
box2d = subproject('box2d').get_variable('box2d_dep')
|
||||
|
||||
assimp = subproject('assimp').get_variable('assimp_dep')
|
||||
|
||||
dependencies += [
|
||||
glfw3, fuc2, fmt, glm, box2d, assimp
|
||||
]
|
||||
|
||||
inc_dirs = ['src']
|
||||
|
||||
sources = [
|
||||
'src/glad/glad.cpp',
|
||||
'src/dbc.cpp',
|
||||
'src/stb_image.cpp',
|
||||
'src/shader.cpp',
|
||||
'src/physics.cpp',
|
||||
'src/mesh.cpp',
|
||||
'src/model.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)
|
||||
Loading…
Add table
Add a link
Reference in a new issue