diff options
-rw-r--r-- | doc/meson.build | 16 | ||||
-rw-r--r-- | meson.build | 25 | ||||
-rw-r--r-- | meson_options.txt | 3 |
3 files changed, 30 insertions, 14 deletions
diff --git a/doc/meson.build b/doc/meson.build index f406624..e6ba3bd 100644 --- a/doc/meson.build +++ b/doc/meson.build @@ -12,15 +12,17 @@ if build_docs # Documentation Code - test( - 'overview_code', - executable( + if not get_option('tests').disabled() + test( 'overview_code', - files('overview_code.c'), - dependencies: [zix_dep], - c_args: c_suppressions, + executable( + 'overview_code', + files('overview_code.c'), + dependencies: [zix_dep], + c_args: c_suppressions, + ) ) - ) + endif # Generated API Reference 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 diff --git a/meson_options.txt b/meson_options.txt index 476b3d5..975eb3b 100644 --- a/meson_options.txt +++ b/meson_options.txt @@ -13,6 +13,9 @@ option('posix', type: 'feature', value: 'auto', yield: true, option('strict', type: 'boolean', value: false, yield: true, description: 'Enable ultra-strict warnings') +option('threads', type: 'feature', value: 'auto', yield: true, + description: 'Enable thread support') + option('tests', type: 'feature', value: 'auto', yield: true, description: 'Build tests') |