diff options
author | David Robillard <d@drobilla.net> | 2022-10-23 12:55:40 -0400 |
---|---|---|
committer | David Robillard <d@drobilla.net> | 2022-10-23 13:26:00 -0400 |
commit | e883ea50dd1154294e21e946e391dd38e04d6527 (patch) | |
tree | 2019aecf50e1eb2f73a2aaf567d0f4573d9efc31 /meson.build | |
parent | 07b1289cd4907aa3defe3fc600f3db1dcefcb719 (diff) | |
download | zix-e883ea50dd1154294e21e946e391dd38e04d6527.tar.gz zix-e883ea50dd1154294e21e946e391dd38e04d6527.tar.bz2 zix-e883ea50dd1154294e21e946e391dd38e04d6527.zip |
Split up platform sources
This puts more onus on the build system to do things properly, but it's still
easy enough to build, even manually: all the files in the appropriate system
subdirectory just need to be included in the build.
Otherwise, the several nested levels of preprocessor conditionals get
confusing, and clang-format doesn't format code properly.
Diffstat (limited to 'meson.build')
-rw-r--r-- | meson.build | 21 |
1 files changed, 17 insertions, 4 deletions
diff --git a/meson.build b/meson.build index 58669cf..c56a10e 100644 --- a/meson.build +++ b/meson.build @@ -118,14 +118,27 @@ sources = files( 'src/hash.c', 'src/ring.c', 'src/status.c', - 'src/thread.c', 'src/tree.c', ) if thread_dep.found() - sources += files( - 'src/sem.c', - ) + if host_machine.system() == 'darwin' + sources += files( + 'src/darwin/sem_darwin.c', + 'src/posix/thread_posix.c', + ) + + elif host_machine.system() == 'windows' + sources += files( + 'src/win32/sem_win32.c', + 'src/win32/thread_win32.c', + ) + else + sources += files( + 'src/posix/sem_posix.c', + 'src/posix/thread_posix.c', + ) + endif endif # Set appropriate arguments for building against the library type |