summaryrefslogtreecommitdiff
path: root/src/hello
diff options
context:
space:
mode:
authorKlaus Aehlig <klaus.aehlig@huawei.com>2024-05-31 18:30:10 +0200
committerKlaus Aehlig <klaus.aehlig@huawei.com>2024-06-03 10:09:24 +0200
commit3626877554b6c567d43336ec49414cedfe487260 (patch)
treef80c51ec1867fea029b955d85e89e39017f920e3 /src/hello
downloadhello-nix-3626877554b6c567d43336ec49414cedfe487260.tar.gz
Initial commit
Diffstat (limited to 'src/hello')
-rw-r--r--src/hello/TARGETS9
-rw-r--r--src/hello/hello.cpp11
2 files changed, 20 insertions, 0 deletions
diff --git a/src/hello/TARGETS b/src/hello/TARGETS
new file mode 100644
index 0000000..80380c7
--- /dev/null
+++ b/src/hello/TARGETS
@@ -0,0 +1,9 @@
+{ "":
+ { "type": ["@", "rules", "CC", "binary"]
+ , "name": ["hello"]
+ , "srcs": ["hello.cpp"]
+ , "private-deps": ["fmt"]
+ }
+, "fmt":
+ {"type": ["@", "rules", "CC/pkgconfig", "system_library"], "name": ["fmt"]}
+}
diff --git a/src/hello/hello.cpp b/src/hello/hello.cpp
new file mode 100644
index 0000000..0c9df99
--- /dev/null
+++ b/src/hello/hello.cpp
@@ -0,0 +1,11 @@
+#include <iostream>
+
+#include <fmt/format.h>
+#include <string>
+
+int main(int argc, char **argv) {
+ std::cout << fmt::format("Hello {}!",
+ argc > 1 ? std::string{argv[1]} : "World")
+ << std::endl;
+ return 0;
+}