Skip to content

Commit

Permalink
build: export defines to pkgconfig
Browse files Browse the repository at this point in the history
  • Loading branch information
mochaaP committed Sep 14, 2024
1 parent 025c998 commit 794d6c8
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -122,13 +122,15 @@ install_headers(hdrs_common, subdir: 'Zycore')
install_headers(hdrs_api, subdir: 'Zycore/API')
install_headers(hdrs_internal, subdir: 'Zycore/Internal')

extra_cflags = nolibc ? ['-DZYAN_NO_LIBC'] : []

zycore_dep = declare_dependency(
compile_args: nolibc ? ['-DZYAN_NO_LIBC'] : [],
include_directories: inc,
link_with: zycore_lib,
compile_args: extra_cflags,
)

if not get_option('nolibc')
if not nolibc
gtest_dep = dependency('gtest', required: false)
if gtest_dep.found() and add_languages('cpp', native: false)
test(
Expand Down Expand Up @@ -167,6 +169,7 @@ pkg.generate(
name: 'zycore',
description: 'Zyan Core Library for C',
url: 'https://github.com/zyantific/zycore-c',
extra_cflags: extra_cflags,
)

meson.override_dependency('zycore', zycore_dep)

0 comments on commit 794d6c8

Please sign in to comment.