aboutsummaryrefslogtreecommitdiffstats
path: root/meson.build
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2023-01-14 12:11:00 -0500
committerDavid Robillard <d@drobilla.net>2023-01-14 14:11:54 -0500
commite9bbaf95fbe57d730bfb1ab40a41428ed4ee2ff6 (patch)
tree0bd566b4b46fdc8902d9022c1640d9ebdee59460 /meson.build
parent3e9009a09513bbdaf542890d37d98179f268b9eb (diff)
downloadpugl-e9bbaf95fbe57d730bfb1ab40a41428ed4ee2ff6.tar.gz
pugl-e9bbaf95fbe57d730bfb1ab40a41428ed4ee2ff6.tar.bz2
pugl-e9bbaf95fbe57d730bfb1ab40a41428ed4ee2ff6.zip
Simplify library build definitions
Diffstat (limited to 'meson.build')
-rw-r--r--meson.build22
1 files changed, 10 insertions, 12 deletions
diff --git a/meson.build b/meson.build
index 006939d..6ce6c8d 100644
--- a/meson.build
+++ b/meson.build
@@ -80,6 +80,10 @@ if host_machine.system() == 'darwin'
# Windows
elif host_machine.system() == 'windows'
+ if get_option('default_library') == 'both'
+ error('default_library=both is not supported on Windows')
+ endif
+
if cc.get_id() == 'msvc'
msvc_args = [
'/experimental:external',
@@ -208,8 +212,7 @@ core_name = 'pugl_@0@@1@'.format(platform, version_suffix)
includes = include_directories(['include'])
library_args = ['-DPUGL_INTERNAL']
-subdir('meson/library')
-if library_type == 'static_library'
+if get_option('default_library') == 'static'
add_project_arguments(
['-DPUGL_STATIC'],
language: ['c', 'cpp', 'objc', 'objcpp'],
@@ -221,7 +224,7 @@ common_sources = files(
'src/internal.c',
)
-libpugl = build_target(
+libpugl = library(
core_name,
common_sources + platform_sources,
c_args: library_args + core_args,
@@ -230,7 +233,6 @@ libpugl = build_target(
include_directories: includes,
install: true,
soversion: soversion,
- target_type: library_type,
version: meson.project_version(),
)
@@ -260,7 +262,7 @@ if get_option('stub')
name = 'pugl_' + platform + '_stub' + version_suffix
sources = files('src/' + platform + '_stub' + extension)
- stub_backend = build_target(
+ stub_backend = library(
name,
sources,
c_args: library_args,
@@ -269,7 +271,6 @@ if get_option('stub')
include_directories: includes,
install: true,
soversion: soversion,
- target_type: library_type,
version: meson.project_version(),
)
@@ -302,7 +303,7 @@ if opengl_dep.found()
name = 'pugl_' + platform + '_gl' + version_suffix
sources = files('src/' + platform + '_gl' + extension)
- gl_backend = build_target(
+ gl_backend = library(
name,
sources,
c_args: library_args,
@@ -311,7 +312,6 @@ if opengl_dep.found()
include_directories: includes,
install: true,
soversion: soversion,
- target_type: library_type,
version: meson.project_version(),
)
@@ -355,7 +355,7 @@ if cairo_dep.found()
cairo_args = cc.get_supported_arguments(cairo_args)
- cairo_backend = build_target(
+ cairo_backend = library(
name,
sources,
c_args: library_args + cairo_args,
@@ -365,7 +365,6 @@ if cairo_dep.found()
install: true,
objc_args: library_args + cairo_args,
soversion: soversion,
- target_type: library_type,
version: meson.project_version(),
)
@@ -410,7 +409,7 @@ if vulkan_dep.found()
]
endif
- vulkan_backend = build_target(
+ vulkan_backend = library(
name,
sources,
c_args: library_args,
@@ -419,7 +418,6 @@ if vulkan_dep.found()
include_directories: includes,
install: true,
soversion: soversion,
- target_type: library_type,
version: meson.project_version(),
)