aboutsummaryrefslogtreecommitdiff
path: root/meson.build
diff options
context:
space:
mode:
authorKenny Levinsen <kl@kl.wtf>2022-03-03 14:40:40 +0100
committerKenny Levinsen <kl@kl.wtf>2022-03-03 14:40:40 +0100
commitabcecbb53b35cfb449ce1793f98bfdee5e604a94 (patch)
treef7e6591e749e40372861aab5ef5e1346677a1e3a /meson.build
parentae42d05513189c2215916c5586e9f8fb74c4d5e7 (diff)
meson: Only set libseat defines for libseat itself
This allows us to distinguish between when we build seatd as part of the builtin libseat backend, or when we build seatd on its own.
Diffstat (limited to 'meson.build')
-rw-r--r--meson.build12
1 files changed, 8 insertions, 4 deletions
diff --git a/meson.build b/meson.build
index 960c3b6..1070b55 100644
--- a/meson.build
+++ b/meson.build
@@ -121,8 +121,10 @@ if with_seatd or with_builtin
private_files += 'libseat/backend/seatd.c'
endif
+libseat_c_args = ['-DLIBSEAT=1']
+
if with_seatd
- add_project_arguments('-DSEATD_ENABLED=1', language: 'c')
+ libseat_c_args += '-DSEATD_ENABLED=1'
endif
logind = disabler()
@@ -137,8 +139,8 @@ if get_option('libseat-logind') != 'disabled'
endif
if logind.found()
- add_project_arguments('-DLOGIND_ENABLED=1', language: 'c')
- add_project_arguments('-DHAVE_@0@=1'.format(logind.name().to_upper()), language: 'c')
+ libseat_c_args += '-DLOGIND_ENABLED=1'
+ libseat_c_args += '-DHAVE_@0@=1'.format(logind.name().to_upper())
private_files += [
'libseat/backend/logind.c',
'common/drm.c',
@@ -152,7 +154,7 @@ realtime = meson.get_compiler('c').find_library('rt')
private_deps += realtime
if with_builtin
- add_project_arguments('-DBUILTIN_ENABLED=1', language: 'c')
+ libseat_c_args += '-DBUILTIN_ENABLED=1'
private_files += server_files
endif
@@ -161,6 +163,7 @@ private_lib = static_library(
private_files,
dependencies: private_deps,
include_directories: [include_directories('.', 'include')],
+ c_args: libseat_c_args,
)
symbols_file = 'libseat/libseat.syms'
@@ -174,6 +177,7 @@ lib = library(
install: true,
link_args: symbols_flag,
link_depends: symbols_file,
+ c_args: libseat_c_args,
)
install_headers('include/libseat.h')