nix: add support to build with GCC

Signed-off-by: Amneesh Singh <natto@weirdnatto.in>
This commit is contained in:
2023-09-23 15:50:29 +05:30
parent 6c33c77ef3
commit c3bf8b0ae8
14 changed files with 211 additions and 83 deletions

View File

@@ -5,13 +5,22 @@ lib_sources = files(
subdir('cpu')
fmt = dependency('fmt', version : '>=10.1.0')
lib_cpp_args = [ ]
fmt = dependency('fmt', version : '>=10.1.0', static: true)
if not fmt.found()
fmt = dependency('fmt', version : '>=10.1.0', static: false)
lib_cpp_args += 'DFMT_HEADER_ONLY'
endif
lib = library(
meson.project_name(),
lib_sources,
dependencies: [fmt],
include_directories: inc,
install: true,
cpp_args: lib_cpp_args
)
import('pkgconfig').generate(lib)