Compare commits
5 Commits
591c3b16a2
...
3a9a32d7e3
Author | SHA1 | Date | |
---|---|---|---|
3a9a32d7e3 | |||
a5202ad85a | |||
61a856e88f | |||
6170c95666 | |||
d6f597d8c0 |
3
.gitmodules
vendored
Normal file
3
.gitmodules
vendored
Normal file
@@ -0,0 +1,3 @@
|
||||
[submodule "subprojects/raylib"]
|
||||
path = subprojects/raylib
|
||||
url = https://github.com/raysan5/raylib.git
|
@@ -10,9 +10,10 @@ The game has only one runtime dependency: The [raylib](https://www.raylib.com/)
|
||||
|
||||
This application uses [Meson](https://mesonbuild.com/) as a build system. To build the application:
|
||||
1. Install __meson__ from the link above.
|
||||
2. Install __raylib__ from the link above.
|
||||
2. Install __raylib__ from the link above (THIS IS OPTIONAL, SEE STEP 5)
|
||||
3. Set up the build directory with the `meson setup build` command.
|
||||
4. Compile the application with `meson compile -C build`.
|
||||
4. Compile the application, with the existing raylib installation, using `meson compile -C build`.
|
||||
5. If you don't have raylib installed, you can create a statically linked version of the library on Linux, using `meson compile -C build -Ddefault_library=static`.
|
||||
|
||||
## Running
|
||||
|
||||
|
23
meson.build
23
meson.build
@@ -1,12 +1,27 @@
|
||||
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')
|
||||
cmake = import('cmake')
|
||||
|
||||
raylib = dependency('raylib', required: false)
|
||||
if not raylib.found()
|
||||
raylib = compiler.find_library('raylib', has_headers: ['raylib.h', 'raymath.h'], required: true)
|
||||
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
|
||||
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
|
||||
|
||||
#For Windows only
|
||||
ws2_dep = compiler.find_library('ws2_32', required: false)
|
||||
|
||||
executable('pong',
|
||||
|
1
subprojects/raylib
Submodule
1
subprojects/raylib
Submodule
Submodule subprojects/raylib added at c7b362d19d
Reference in New Issue
Block a user