summaryrefslogtreecommitdiff
path: root/mesonbuild/templates/objcpptemplates.py
diff options
context:
space:
mode:
authorDylan Baker <dylan@pnwbakers.com>2025-01-06 16:12:46 -0800
committerDylan Baker <dylan@pnwbakers.com>2025-01-08 10:05:02 -0800
commit2180af4ac1537cf42d47891cf19e53de02087d2a (patch)
tree0efae3c2351176bc671339ba533e74b107a0114c /mesonbuild/templates/objcpptemplates.py
parente4ea17bf1d1443269b1fc37f87afd54b30abb8e3 (diff)
downloadmeson-2180af4ac1537cf42d47891cf19e53de02087d2a.tar.gz
templates: use library() instead of shared_library()
Diffstat (limited to 'mesonbuild/templates/objcpptemplates.py')
-rw-r--r--mesonbuild/templates/objcpptemplates.py18
1 files changed, 13 insertions, 5 deletions
diff --git a/mesonbuild/templates/objcpptemplates.py b/mesonbuild/templates/objcpptemplates.py
index 7ea4c3f8e..45e70c6c9 100644
--- a/mesonbuild/templates/objcpptemplates.py
+++ b/mesonbuild/templates/objcpptemplates.py
@@ -3,9 +3,13 @@
# Copyright © 2023-2025 Intel Corporation
from __future__ import annotations
+import typing as T
from mesonbuild.templates.sampleimpl import FileHeaderImpl
+if T.TYPE_CHECKING:
+ from ..minit import Arguments
+
lib_h_template = '''#pragma once
#if defined _WIN32 || defined __CYGWIN__
@@ -67,11 +71,11 @@ dependencies = [{dependencies}
# not the executables that use the library.
lib_args = ['-DBUILDING_{utoken}']
-shlib = shared_library(
+lib = library(
'{lib_name}',
'{source_file}',
install : true,
- objcpp_args : lib_args,
+ objcpp_shared_args : lib_args,
dependencies : dependencies,
gnu_symbol_visibility : 'hidden',
)
@@ -80,7 +84,7 @@ test_exe = executable(
'{test_exe_name}',
'{test_source_file}',
dependencies : dependencies,
- link_with : shlib,
+ link_with : lib,
)
test('{test_name}', test_exe)
@@ -88,7 +92,7 @@ test('{test_name}', test_exe)
{ltoken}_dep = declare_dependency(
include_directories : include_directories('.'),
dependencies : dependencies,
- link_with : shlib,
+ link_with : lib,
)
meson.override_dependency('{project_name}', {ltoken}_dep)
@@ -98,7 +102,7 @@ install_headers('{header_file}', subdir : '{header_dir}')
pkg_mod = import('pkgconfig')
pkg_mod.generate(
- shlib,
+ lib,
description : 'Meson sample project.',
subdirs : '{header_dir}',
)
@@ -150,3 +154,7 @@ class ObjCppProject(FileHeaderImpl):
lib_header_template = lib_h_template
lib_test_template = lib_objcpp_test_template
lib_meson_template = lib_objcpp_meson_template
+
+ def __init__(self, args: Arguments):
+ super().__init__(args)
+ self.meson_version = '1.3.0'