Browse Source

:tada: create coconut project

Jeremy Zheng 1 year ago
parent
commit
715cc543d3

+ 7 - 0
.clang-format

@@ -0,0 +1,7 @@
+---
+BasedOnStyle: Google
+IncludeBlocks: Preserve
+SortIncludes: 'true'
+TabWidth: 2
+MaxEmptyLinesToKeep: 1
+...

+ 8 - 0
coconut/.gitignore

@@ -0,0 +1,8 @@
+# Xmake cache
+.xmake/
+build/
+
+# MacOS Cache
+.DS_Store
+
+

+ 11 - 0
coconut/README.md

@@ -0,0 +1,11 @@
+# USAGE
+
+```bash
+# Debug
+xmake f -m debug
+
+# Release for x86_64
+xmake f -p linux --toolchain=clang -a x86_64 -m release
+# Release for aarch64
+xmake f -p linux --toolchain=clang -a arm64-v8a -m release
+```

+ 10 - 0
coconut/include/coconut/application.hpp

@@ -0,0 +1,10 @@
+#pragma once
+
+namespace coconut {
+class Application {
+ public:
+  Application(int argc, char** argv);
+
+ private:
+};
+}

+ 8 - 0
coconut/src/application.cpp

@@ -0,0 +1,8 @@
+#include "coconut/application.hpp"
+
+#include <spdlog/spdlog.h>
+#include <args.hxx>
+
+coconut::Application::Application(int argc, char** argv) {
+    spdlog::info("hello coconut!");
+}

+ 8 - 0
coconut/src/main.cpp

@@ -0,0 +1,8 @@
+#include <cstdlib>
+
+#include "coconut/application.hpp"
+
+int main(int argc, char** argv) {
+    coconut::Application app(argc, argv);
+    return EXIT_SUCCESS;
+}

+ 10 - 0
coconut/xmake.lua

@@ -0,0 +1,10 @@
+add_rules("mode.debug", "mode.release")
+set_languages("c11", "c++20")
+
+add_requires("spdlog", "taywee_args")
+
+target("coconut")
+    set_kind("binary")
+    add_includedirs("include")
+    add_files("src/*.cpp")
+    add_packages("spdlog", "taywee_args")