From 83022726fcf073cca4a289f5036c9a0644014777 Mon Sep 17 00:00:00 2001 From: Robbert van der Helm Date: Tue, 21 Feb 2023 13:52:40 +0100 Subject: [PATCH] Update tomlplusplus to version 3.3.0 Arch tries to build yabridge against this version, and some things are now broken. We need to more forcefully hack tomlplusplus into thinking its running on Linux, and shared library mode also needs to be explicitly disabled. --- CHANGELOG.md | 1 + meson.build | 2 +- src/common/configuration.cpp | 47 +++++++++++++++++++++++++++++++---- subprojects/tomlplusplus.wrap | 4 +-- 4 files changed, 46 insertions(+), 8 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 1ece3c2e..22bdfc2c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -21,6 +21,7 @@ Versioning](https://semver.org/spec/v2.0.0.html). ### Packaging notes - The CLAP dependency has been updated to target version 1.1.7. +- The tomlplusplus dependency has been updated to target version 3.3.0. ## [5.0.3] - 2022-12-23 diff --git a/meson.build b/meson.build index dc5bf3a0..c0a699be 100644 --- a/meson.build +++ b/meson.build @@ -266,7 +266,7 @@ function2_dep = dependency('function2', version : '>=4.0.0') ghc_filesystem_dep = dependency('ghc_filesystem', modules : 'ghcFilesystem::ghc_filesystem', version : '>=1.5.0') threads_dep = dependency('threads') # Tomlplusplus recently added a shraed library version. We don't want to link to that. -tomlplusplus_dep = dependency('tomlplusplus', version : '>=3.0.0').partial_dependency(compile_args : true, includes : true) +tomlplusplus_dep = dependency('tomlplusplus', version : '>=3.3.0').partial_dependency(compile_args : true, includes : true) dl_dep = declare_dependency(link_args : '-ldl') rt_dep = declare_dependency(link_args : '-lrt') diff --git a/src/common/configuration.cpp b/src/common/configuration.cpp index da505309..74485067 100644 --- a/src/common/configuration.cpp +++ b/src/common/configuration.cpp @@ -16,14 +16,51 @@ #include "configuration.h" -// tomlplusplus recently got some Windows fixes, but they cause compilation -// errors and we don't need them so we'll just disable them outright -#define TOML_WINDOWS_COMPAT 0 - #include -#include #include +// By default tomlplusplus is no longer headers when using the package config +// file. We don't want to link against third party shared libraries in yabridge. +#ifdef TOML_SHARED_LIB + +#undef TOML_SHARED_LIB +#undef TOML_HEADER_ONLY +#define TOML_HEADER_ONLY 1 + +#endif + +// tomlplusplus recently got some Windows fixes, but they cause compilation +// errors and we don't need them so we'll just disable them outright. Disabling +// `TOML_ENABLE_WINDOWS_COMPAT` is no longer enough, and you can't disable +// `TOML_WINDOWS` directly. This is the same trick used in `use-asio-linux.h`. +#ifdef __WINE__ + +#pragma push_macro("WIN32") +#pragma push_macro("_WIN32") +#pragma push_macro("__WIN32__") +#pragma push_macro("__NT__") +#pragma push_macro("__CYGWIN__") + +#undef WIN32 +#undef _WIN32 +#undef __WIN32__ +#undef __NT__ +#undef __CYGWIN__ + +#endif + +#include + +#ifdef __WINE__ + +#pragma pop_macro("WIN32") +#pragma pop_macro("_WIN32") +#pragma pop_macro("__WIN32__") +#pragma pop_macro("__NT__") +#pragma pop_macro("__CYGWIN__") + +#endif + #include "utils.h" namespace fs = ghc::filesystem; diff --git a/subprojects/tomlplusplus.wrap b/subprojects/tomlplusplus.wrap index 87252924..cdf789bc 100644 --- a/subprojects/tomlplusplus.wrap +++ b/subprojects/tomlplusplus.wrap @@ -1,7 +1,7 @@ [wrap-git] url = https://github.com/marzer/tomlplusplus.git -# Tag v3.0.1 -revision = 8e669aa6990e0ed219c169d491472d749f54c393 +# Tag v3.3.0 +revision = c635f21 depth = 1 [provide]