summaryrefslogtreecommitdiffstats
path: root/meson.build
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2022-10-25 08:59:53 -0400
committerDavid Robillard <d@drobilla.net>2022-10-25 08:59:53 -0400
commit124355ee047073166345df58234ef38a2dffac25 (patch)
treefc0e651a3b7870d814cd0fadce813ac04cd80c36 /meson.build
parent78091cfd182f20e3e5d639e94bd3065e9672c5cb (diff)
downloadzix-124355ee047073166345df58234ef38a2dffac25.tar.gz
zix-124355ee047073166345df58234ef38a2dffac25.tar.bz2
zix-124355ee047073166345df58234ef38a2dffac25.zip
Fix build without threads or tests
Diffstat (limited to 'meson.build')
-rw-r--r--meson.build25
1 files changed, 18 insertions, 7 deletions
diff --git a/meson.build b/meson.build
index 0e0afac..0885cf7 100644
--- a/meson.build
+++ b/meson.build
@@ -36,7 +36,7 @@ subdir('meson/suppressions')
# Platform Configuration #
##########################
-thread_dep = dependency('threads', required: get_option('tests'))
+thread_dep = dependency('threads', required: get_option('threads'))
platform_c_args = []
@@ -224,27 +224,38 @@ sources = files(
'src/tree.c',
)
+if host_machine.system() == 'darwin'
+ sources += files(
+ 'src/posix/filesystem_posix.c',
+ 'src/posix/system_posix.c',
+ )
+elif host_machine.system() == 'windows'
+ sources += files(
+ 'src/win32/filesystem_win32.c',
+ 'src/win32/system_win32.c',
+ )
+else
+ sources += files(
+ 'src/posix/filesystem_posix.c',
+ 'src/posix/system_posix.c',
+ )
+endif
+
if thread_dep.found()
if host_machine.system() == 'darwin'
sources += files(
'src/darwin/sem_darwin.c',
- 'src/posix/filesystem_posix.c',
- 'src/posix/system_posix.c',
'src/posix/thread_posix.c',
)
elif host_machine.system() == 'windows'
sources += files(
- 'src/win32/filesystem_win32.c',
'src/win32/sem_win32.c',
- 'src/win32/system_win32.c',
'src/win32/thread_win32.c',
)
else
sources += files(
- 'src/posix/filesystem_posix.c',
'src/posix/sem_posix.c',
- 'src/posix/system_posix.c',
'src/posix/thread_posix.c',
)
endif