summaryrefslogtreecommitdiff
path: root/mesonbuild/templates/objcpptemplates.py
diff options
context:
space:
mode:
authorDylan Baker <dylan@pnwbakers.com>2025-01-06 14:28:14 -0800
committerDylan Baker <dylan@pnwbakers.com>2025-01-08 09:58:00 -0800
commit1b14526243c3e12c132ee8f81089fea0425bab7d (patch)
tree1dc41cf7fbee3d6cefc2368c9de8939097ce56ae /mesonbuild/templates/objcpptemplates.py
parentb94cbbfb79eaeaf863d77fca1dd051b102471ad3 (diff)
downloadmeson-1b14526243c3e12c132ee8f81089fea0425bab7d.tar.gz
templates: standardize Meson formatting
We have all kinds of formatting, different indents, different line break standards.
Diffstat (limited to 'mesonbuild/templates/objcpptemplates.py')
-rw-r--r--mesonbuild/templates/objcpptemplates.py37
1 files changed, 26 insertions, 11 deletions
diff --git a/mesonbuild/templates/objcpptemplates.py b/mesonbuild/templates/objcpptemplates.py
index 91ce177c3..a9e1099a2 100644
--- a/mesonbuild/templates/objcpptemplates.py
+++ b/mesonbuild/templates/objcpptemplates.py
@@ -52,29 +52,38 @@ int main(int argc, char **argv) {{
}}
'''
-lib_objcpp_meson_template = '''project('{project_name}', 'objcpp',
+lib_objcpp_meson_template = '''project(
+ '{project_name}',
+ 'objcpp',
version : '{version}',
meson_version : '>= {meson_version}',
- default_options : ['warning_level=3'])
+ default_options : ['warning_level=3'],
+)
# These arguments are only used to build the shared library
# not the executables that use the library.
lib_args = ['-DBUILDING_{utoken}']
-shlib = shared_library('{lib_name}', '{source_file}',
+shlib = shared_library(
+ '{lib_name}',
+ '{source_file}',
install : true,
objcpp_args : lib_args,
gnu_symbol_visibility : 'hidden',
)
-test_exe = executable('{test_exe_name}', '{test_source_file}',
- link_with : shlib)
+test_exe = executable(
+ '{test_exe_name}',
+ '{test_source_file}',
+ link_with : shlib,
+)
test('{test_name}', test_exe)
# Make this library usable as a Meson subproject.
{ltoken}_dep = declare_dependency(
- include_directories: include_directories('.'),
- link_with : shlib)
+ include_directories : include_directories('.'),
+ link_with : shlib,
+)
# Make this library usable from the system's
# package manager.
@@ -105,13 +114,19 @@ int main(int argc, char **argv) {{
}}
'''
-hello_objcpp_meson_template = '''project('{project_name}', 'objcpp',
+hello_objcpp_meson_template = '''project(
+ '{project_name}',
+ 'objcpp',
version : '{version}',
meson_version : '>= {meson_version}',
- default_options : ['warning_level=3'])
+ default_options : ['warning_level=3'],
+)
-exe = executable('{exe_name}', '{source_name}',
- install : true)
+exe = executable(
+ '{exe_name}',
+ '{source_name}',
+ install : true,
+)
test('basic', exe)
'''