Added comments, and added a way to use the bundled raylib, even if we are building a dynamically linked version
This commit is contained in:
22
meson.build
22
meson.build
@@ -3,19 +3,23 @@ add_global_arguments('-g', '-Wall', '-pedantic', '-Wno-unused-function', '-Wno-n
|
||||
compiler = meson.get_compiler('cpp')
|
||||
cmake = import('cmake')
|
||||
|
||||
# if we are building a shared library
|
||||
if get_option('default_library') == 'shared'
|
||||
raylib = dependency('raylib', required: false) # Try to find dependency with pkg-config
|
||||
if not raylib.found()
|
||||
raylib = compiler.find_library('raylib', has_headers: ['raylib.h', 'raymath.h'], required: true) # Try to manually search for the dependency
|
||||
message('===========+RAYLIB NOT FOUND===============')
|
||||
raylib = compiler.find_library('raylib', has_headers: ['raylib.h', 'raymath.h'], required: false) # Try to manually search for the dependency
|
||||
endif
|
||||
if not raylib.found()
|
||||
opt_var = cmake.subproject_options()
|
||||
opt_var.add_cmake_defines({'BUILD_SHARED_LIBS' : true})
|
||||
opt_var.add_cmake_defines({'CMAKE_SKIP_RPATH' : true})
|
||||
raylib_proj = cmake.subproject('raylib', options: opt_var)
|
||||
raylib = raylib_proj.dependency('raylib')
|
||||
endif
|
||||
# if not raylib.found()
|
||||
# opt_var = cmake.subproject_options()
|
||||
# opt_var.add_cmake_defines({'BUILD_SHARED_LIBS' : true})
|
||||
# opt_var.add_cmake_defines({'CMAKE_SKIP_RPATH' : true})
|
||||
# raylib_proj = cmake.subproject('raylib', options: opt_var)
|
||||
# raylib = raylib_proj.dependency('raylib')
|
||||
# endif
|
||||
endif
|
||||
|
||||
# I we are building a static library
|
||||
if get_option('default_library') == 'static'
|
||||
raylib_proj = cmake.subproject('raylib')
|
||||
raylib = raylib_proj.dependency('raylib')
|
||||
@@ -30,7 +34,7 @@ if build_machine.system() == 'windows'
|
||||
endif
|
||||
|
||||
executable('pong',
|
||||
'main.cpp', 'easysock.cpp', 'sock.cpp','paddle.cpp', 'ball.cpp', 'numeric_base.cpp', 'connect_code.cpp', 'server.cpp', 'client.cpp',
|
||||
'main.cpp', 'easysock.cpp', 'sock.cpp','paddle.cpp', 'ball.cpp', 'numeric_base.cpp', 'connect_code.cpp', 'server.cpp', 'client.cpp', 'check_input.cpp',
|
||||
'serialization.c',
|
||||
dependencies: [raylib, ws2_dep, winmm]
|
||||
)
|
||||
|
Reference in New Issue
Block a user