Merge pull request #470 from jubalh/develop

Add Builder project files
This commit is contained in:
Ray 2018-02-16 12:12:59 +01:00 committed by GitHub
commit 769cf23e53
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 82 additions and 0 deletions

26
project/Builder/README.md Normal file
View file

@ -0,0 +1,26 @@
# Builder project template
This is a project template to be used with [GNOME Builder](https://raw.githubusercontent.com/jubalh/raymario/master/meson.build).
We use the [meson](https://raw.githubusercontent.com/jubalh/raymario/master/meson.build) build system here.
We can compile our project via the command line:
```
meson build
cd build
ninja
ninja install
```
Or can simply click on the `meson.build` file to open it with Builder.
Alternatively you can open Builder first and click on the `open` button and the left top.
We added comments to the file to give you an idea which values you should edit.
For a full overview of options please check the [meson manual](http://mesonbuild.com/Manual.html).
In the provided file we assume that the build file is located at the root folder of your project, and that all your sources are in a `src` subfolder.
Check out the `examples` directory for a simple example on how to use this template.
You can also look at [raymario](https://github.com/jubalh/raymario) for a slightly more complex example which also installs resource files.
# Notice
The files provided link against glfw3 and openAL because the latest stable version of raylib is version 1.8, which still needs this. For later versions these two dependencies are not necessary anymore.

View file

@ -0,0 +1 @@
Open `meson.build` with Builder or run `meson build; cd build; ninja; ./core_basic_window` on the commandline to launch the example.

View file

@ -0,0 +1,27 @@
# This file should be in the main folder of your project
# Replace 'projectname' with the name of your project
# Replace '1.0' with its version
project('core_basic_window', 'c', version: '1.0',
meson_version: '>= 0.39.1')
# We want a C Compiler to be present
cc = meson.get_compiler('c')
# Find dependencies
glfw_dep = dependency('glfw3')
gl_dep = dependency('gl')
openal_dep = dependency('openal')
m_dep = cc.find_library('m', required : false)
raylib_dep = cc.find_library('raylib', required : false)
# List your source files here
source_c = [
'../../../examples/core/core_basic_window.c',
]
# Build executable
core_basic_window = executable('core_basic_window',
source_c,
dependencies : [ raylib_dep, glfw_dep, gl_dep, openal_dep, m_dep ],
install : true)

View file

@ -0,0 +1,28 @@
# This file should be in the main folder of your project
# Replace 'projectname' with the name of your project
# Replace '1.0' with its version
project('projectname', 'c', version: '1.0',
meson_version: '>= 0.39.1')
# We want a C Compiler to be present
cc = meson.get_compiler('c')
# Find dependencies
# glfw3 and openal are not needed for raylib > 1.8.0
glfw_dep = dependency('glfw3')
gl_dep = dependency('gl')
openal_dep = dependency('openal')
m_dep = cc.find_library('m', required : false)
raylib_dep = cc.find_library('raylib', required : false)
# List your source files here
source_c = [
'src/main.c',
]
# Build executable
projectname = executable('projectname',
source_c,
dependencies : [ raylib_dep, glfw_dep, gl_dep, openal_dep, m_dep ],
install : true)