From 988f5b78329f31c3107ec258e8ac3eb1358dee3b Mon Sep 17 00:00:00 2001 From: Michael Vetter Date: Fri, 16 Feb 2018 11:20:21 +0100 Subject: [PATCH 1/4] Add Builder project template --- project/Builder/README.md | 20 ++++++++++++++++++++ project/Builder/meson.build | 27 +++++++++++++++++++++++++++ 2 files changed, 47 insertions(+) create mode 100644 project/Builder/README.md create mode 100644 project/Builder/meson.build diff --git a/project/Builder/README.md b/project/Builder/README.md new file mode 100644 index 000000000..f816ebe5f --- /dev/null +++ b/project/Builder/README.md @@ -0,0 +1,20 @@ +# 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. diff --git a/project/Builder/meson.build b/project/Builder/meson.build new file mode 100644 index 000000000..4908736cd --- /dev/null +++ b/project/Builder/meson.build @@ -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('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 +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) From 6ebc3fd29a6a05b2d56e893e753125a4c14cf184 Mon Sep 17 00:00:00 2001 From: Michael Vetter Date: Fri, 16 Feb 2018 11:23:02 +0100 Subject: [PATCH 2/4] Add core_basic_window project example for Builder --- project/Builder/examples/README.md | 1 + project/Builder/examples/meson.build | 27 +++++++++++++++++++++++++++ 2 files changed, 28 insertions(+) create mode 100644 project/Builder/examples/README.md create mode 100644 project/Builder/examples/meson.build diff --git a/project/Builder/examples/README.md b/project/Builder/examples/README.md new file mode 100644 index 000000000..cba3aef55 --- /dev/null +++ b/project/Builder/examples/README.md @@ -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. diff --git a/project/Builder/examples/meson.build b/project/Builder/examples/meson.build new file mode 100644 index 000000000..ab81ca6c3 --- /dev/null +++ b/project/Builder/examples/meson.build @@ -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) From e0a3a51b753ae20727bac9191da9b62f32c92d83 Mon Sep 17 00:00:00 2001 From: Michael Vetter Date: Fri, 16 Feb 2018 11:25:12 +0100 Subject: [PATCH 3/4] Builder project: Add note about examples --- project/Builder/README.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/project/Builder/README.md b/project/Builder/README.md index f816ebe5f..1696e0d2b 100644 --- a/project/Builder/README.md +++ b/project/Builder/README.md @@ -18,3 +18,6 @@ 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. From 883ed20e7c40009f116334fc2b7cf747942c68f2 Mon Sep 17 00:00:00 2001 From: Michael Vetter Date: Fri, 16 Feb 2018 11:53:04 +0100 Subject: [PATCH 4/4] Add note about glfw3 and openAL --- project/Builder/README.md | 3 +++ project/Builder/meson.build | 1 + 2 files changed, 4 insertions(+) diff --git a/project/Builder/README.md b/project/Builder/README.md index 1696e0d2b..556806ab2 100644 --- a/project/Builder/README.md +++ b/project/Builder/README.md @@ -21,3 +21,6 @@ In the provided file we assume that the build file is located at the root folder 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. diff --git a/project/Builder/meson.build b/project/Builder/meson.build index 4908736cd..41b37fdc4 100644 --- a/project/Builder/meson.build +++ b/project/Builder/meson.build @@ -9,6 +9,7 @@ project('projectname', 'c', version: '1.0', 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')