Add support for building a statically linked version of the game, by specifying a command-line flag

master
Aadhavan Srinivasan 10 months ago
parent 61a856e88f
commit a5202ad85a

@ -1,12 +1,27 @@
project('Pong', ['cpp', 'c']) project('Pong', ['cpp', 'c'])
add_global_arguments('-g', '-Wall', '-pedantic', '-Wno-unused-function', '-Werror', language : ['cpp', 'c']) add_global_arguments('-g', '-Wall', '-pedantic', '-Wno-unused-function', language : ['cpp', 'c'])
compiler = meson.get_compiler('cpp') compiler = meson.get_compiler('cpp')
cmake = import('cmake')
raylib = dependency('raylib', required: false) if get_option('default_library') == 'shared'
raylib = dependency('raylib', required: false) # Try to find dependency with pkg-config
if not raylib.found() if not raylib.found()
raylib = compiler.find_library('raylib', has_headers: ['raylib.h', 'raymath.h'], required: true) raylib = compiler.find_library('raylib', has_headers: ['raylib.h', 'raymath.h'], required: true) # 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
endif
if get_option('default_library') == 'static'
raylib_proj = cmake.subproject('raylib')
raylib = raylib_proj.dependency('raylib')
endif endif
#For Windows only
ws2_dep = compiler.find_library('ws2_32', required: false) ws2_dep = compiler.find_library('ws2_32', required: false)
executable('pong', executable('pong',

Loading…
Cancel
Save