diff --git a/projects/gflags.github.io/package.yml b/projects/gflags.github.io/package.yml new file mode 100644 index 00000000..2eba88b5 --- /dev/null +++ b/projects/gflags.github.io/package.yml @@ -0,0 +1,55 @@ + +distributable: + url: https://github.com/gflags/gflags/archive/refs/tags/v{{version}}.tar.gz + strip-components: 1 + +versions: + github: gflags/gflags/tags + strip: /^v/ + + +build: + dependencies: + tea.xyz/gx/cc: c99 + tea.xyz/gx/make: '*' + cmake.org: '*' + working-directory: buildroot + script: | + cmake $ARGS .. + make --jobs {{ hw.concurrency }} + make install + env: + ARGS: + - -DCMAKE_INSTALL_PREFIX={{prefix}} + - -DBUILD_SHARED_LIBS=ON + - -DBUILD_STATIC_LIBS=ON + - -DCMAKE_POSITION_INDEPENDENT_CODE=ON + +test: + dependencies: + tea.xyz/gx/cc: c99 + fixture: | + #include + #include "gflags/gflags.h" + DEFINE_bool(verbose, false, "Display program name before message"); + DEFINE_string(message, "Hello world!", "Message to print"); + static bool IsNonEmptyMessage(const char *flagname, const std::string &value) + { + return value[0] != '\0'; + } + DEFINE_validator(message, &IsNonEmptyMessage); + int main(int argc, char *argv[]) + { + gflags::SetUsageMessage("some usage message"); + gflags::SetVersionString("1.0.0"); + gflags::ParseCommandLineFlags(&argc, &argv, true); + if (FLAGS_verbose) std::cout << gflags::ProgramInvocationShortName() << ": "; + std::cout << FLAGS_message; + gflags::ShutDownCommandLineFlags(); + return 0; + } + + script: | + mv $FIXTURE test.cpp + g++ test.cpp -lgflags -o test + ./test \ No newline at end of file