Skip to main content

Notice: this Wiki will be going read only early in 2024 and edits will no longer be possible. Please see: https://gitlab.eclipse.org/eclipsefdn/helpdesk/-/wikis/Wiki-shutdown-plan for the plan.

Jump to: navigation, search

Difference between revisions of "CDT/Meson/User Guide"

< CDT
(Created page with "{{#eclipseproject:tools.cdt}} = Introduction = The Meson feature for Eclipse is an optional feature of the CDT (C/C++ Development Tools) that adds support for maintaining an...")
 
Line 11: Line 11:
  
 
<code>
 
<code>
project('hello', 'c')
+
project('hello', 'c')<b>
 
executable('hello', 'hello.c')
 
executable('hello', 'hello.c')
 
</code>
 
</code>

Revision as of 17:35, 5 March 2018

{{#eclipseproject:tools.cdt}}

Introduction

The Meson feature for Eclipse is an optional feature of the CDT (C/C++ Development Tools) that adds support for maintaining and building C/C++ projects that use the Meson build system. The Meson build system is akin to Autotools in that a project is configured before building. Like Autotools, configuration involves testing the build system and toolsets supported. Once configured, the project is built by a second tool, akin to the Make tool used in Autotools. While Meson supports more than one Make-like tool to build the project, the CDT Meson plug-ins currently only have support for "ninja".

The configuration data for the project is stored in a file called: "meson.build". This file contains directives that are interpreted by the meson command. Directives include which languages are used, what executables/targets are created, sources, special configuration options, and any special build-time tests among other things. Many tests are automatic so the configuration file does not require much.

The following is a sample meson.build file:

project('hello', 'c') executable('hello', 'hello.c') </code>

This file tells meson that the project name hello is a C project and that it creates a single executable called hello which is formed from hello.c. Meson will find the C compiler, etc.. needed to build this project on this build machine.

Running meson in the directory containing meson.build will create a ninja.build file in the <b>build directory (or specified build directory).

For more details see: http://mesonbuild.com/

Back to the top