瀏覽代碼

Merge pull request #470 from jubalh/develop

Add Builder project files
pull/474/head
Ray 7 年之前
committed by GitHub
父節點
當前提交
769cf23e53
沒有發現已知的金鑰在資料庫的簽署中 GPG 金鑰 ID: 4AEE18F83AFDEB23
共有 4 個檔案被更改,包括 82 行新增0 行删除
  1. +26
    -0
      project/Builder/README.md
  2. +1
    -0
      project/Builder/examples/README.md
  3. +27
    -0
      project/Builder/examples/meson.build
  4. +28
    -0
      project/Builder/meson.build

+ 26
- 0
project/Builder/README.md 查看文件

@ -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.

+ 1
- 0
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.

+ 27
- 0
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)

+ 28
- 0
project/Builder/meson.build 查看文件

@ -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)

Loading…
取消
儲存