summaryrefslogtreecommitdiffhomepage
path: root/buildme/main.cpp
diff options
context:
space:
mode:
authorAmlal <amlal@zka.com>2024-07-11 23:51:17 +0200
committerAmlal <amlal@zka.com>2024-07-11 23:51:17 +0200
commit4c52feb57fda9e9ee29c1f5310ec19d8cd9e4ca8 (patch)
tree92cafaed135e4d79913d2064ee9e2592c8cd0a3a /buildme/main.cpp
parenta45e660211b0e262a53047ac09426fd736d6ef9c (diff)
[IMP] libzpt-core shared library and ManifestBuilder class.
Signed-off-by: Amlal <amlal@zka.com>
Diffstat (limited to 'buildme/main.cpp')
-rw-r--r--buildme/main.cpp68
1 files changed, 0 insertions, 68 deletions
diff --git a/buildme/main.cpp b/buildme/main.cpp
deleted file mode 100644
index b91bd98..0000000
--- a/buildme/main.cpp
+++ /dev/null
@@ -1,68 +0,0 @@
-//
-// main.cpp
-// buildme
-//
-// Created by Amlal on 6/20/24.
-//
-
-#include <iostream>
-#include <fstream>
-
-#include "json.hpp"
-
-using json = nlohmann::json;
-
-int main(int argc, const char * argv[])
-{
- std::cout << "buildme: ";
- std::string path;
-
- if (argc == 1)
- {
- std::cout << "no files, defaulting to build.json\n";
- path = "./build.json";
- }
- else
- {
- path = argv[1];
- }
-
- try
- {
- std::ifstream fJson(path);
- json buildme = json::parse(fJson);
-
- std::string compiler = buildme["compiler_path"].get<std::string>();
- std::cout << "choose toolchain: " << compiler << std::endl;
-
- json headerSearchPath = buildme["headers_path"];
- std::cout << "search path: " << headerSearchPath.dump() << std::endl;
-
- json sourceFiles = buildme["sources_path"];
- std::cout << "source files: " << sourceFiles.dump() << std::endl;
-
- std::string cmdLine = compiler + " ";
-
- for (auto sources : sourceFiles)
- {
- cmdLine += sources.get<std::string>() + " ";
- }
-
- for (auto sources : sourceFiles)
- {
- cmdLine += "-include=" + sources.get<std::string>() + " ";
- }
-
- cmdLine += "-std=" + buildme["compiler_std"].get<std::string>() + " ";
-
- std::cout << "running: " << cmdLine << std::endl;
-
- std::system(cmdLine.c_str());
- }
- catch (...)
- {
- return 1;
- }
-
- return 0;
-}