fix(build-check): only add global arguments when not a subproject
This is needd to let gridfire work as a subproject
This commit is contained in:
@@ -5,8 +5,10 @@ cc = meson.get_compiler('c')
|
|||||||
|
|
||||||
ignore_unused_args = '-Wno-unused-command-line-argument'
|
ignore_unused_args = '-Wno-unused-command-line-argument'
|
||||||
|
|
||||||
|
if !meson.is_subproject()
|
||||||
add_global_arguments(ignore_unused_args, language: 'cpp')
|
add_global_arguments(ignore_unused_args, language: 'cpp')
|
||||||
add_global_arguments(ignore_unused_args, language: 'c')
|
add_global_arguments(ignore_unused_args, language: 'c')
|
||||||
|
endif
|
||||||
|
|
||||||
|
|
||||||
subdir('CPPC')
|
subdir('CPPC')
|
||||||
|
|||||||
26
src/include/gridfire/utils/config.h.in
Normal file
26
src/include/gridfire/utils/config.h.in
Normal file
@@ -0,0 +1,26 @@
|
|||||||
|
#pragma once
|
||||||
|
|
||||||
|
#include <format>
|
||||||
|
|
||||||
|
namespace gridfire {
|
||||||
|
struct version {
|
||||||
|
static constexpr int major = #STRINGIFY(GF_VERSION_MAJOR);
|
||||||
|
static constexpr int minor = #STRINGIFY(GF_VERSION_MINOR);
|
||||||
|
static constexpr int patch = #STRINGIFY(GF_VERSION_PATCH);
|
||||||
|
|
||||||
|
static constexpr const char* tag = #STRINGIFY(GF_VERSION_TAG);
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
template <>
|
||||||
|
struct std::formatter<gridfire::version> : std::formatter<std::string> {
|
||||||
|
auto format(const gridfire::version& v, auto& ctx) {
|
||||||
|
std::string versionStr = std::to_string(v.major) + "." +
|
||||||
|
std::to_string(v.minor) + "." +
|
||||||
|
std::to_string(v.patch);
|
||||||
|
if (std::string(v.tag) != "") {
|
||||||
|
versionStr += "-" + std::string(v.tag);
|
||||||
|
}
|
||||||
|
return std::formatter<std::string>::format(versionStr, ctx);
|
||||||
|
}
|
||||||
|
};
|
||||||
0
src/include/gridfire/utils/meson.build
Normal file
0
src/include/gridfire/utils/meson.build
Normal file
Reference in New Issue
Block a user