Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

misc: added libconfig as a subproject #1267

Merged
merged 1 commit into from
May 30, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -72,3 +72,6 @@ doxygen/
*.orig
/tests/log
/tests/testcases/__pycache__/

# Subproject files
subprojects/libconfig
17 changes: 16 additions & 1 deletion src/meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,22 @@ endforeach
foreach i : required_xcb_packages
base_deps += [dependency(i, version: '>=1.12.0', required: true)]
endforeach
base_deps += [dependency('libconfig', version: '>=1.7', required: true)]

libconfig_dep = dependency('libconfig', version: '>=1.7', required: false)

if not libconfig_dep.found()
warning('Trying to clone and build libconfig as a subproject.')

cmake = import('cmake')
sub_libconfig_opts = cmake.subproject_options()
sub_libconfig_opts.add_cmake_defines({
'BUILD_SHARED_LIBS': false,
})
sub_libconfig = cmake.subproject('libconfig', options: sub_libconfig_opts)
base_deps += [sub_libconfig.dependency('config')]
else
base_deps += [libconfig_dep]
endif

if not cc.has_header('uthash.h')
error('Dependency uthash not found')
Expand Down
4 changes: 4 additions & 0 deletions subprojects/libconfig.wrap
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
[wrap-git]
url = https://github.com/hyperrealm/libconfig
revision = f9404f60a435aa06321f4ccd8357364dcb216d46
depth = 1