diff options
Diffstat (limited to 'dev/src/JSONManifestBuilder.cc')
| -rw-r--r-- | dev/src/JSONManifestBuilder.cc | 56 |
1 files changed, 5 insertions, 51 deletions
diff --git a/dev/src/JSONManifestBuilder.cc b/dev/src/JSONManifestBuilder.cc index e045f6c..daf47af 100644 --- a/dev/src/JSONManifestBuilder.cc +++ b/dev/src/JSONManifestBuilder.cc @@ -5,10 +5,6 @@ #include <BuildKit/JSONManifestBuilder.h> -#if defined(NEBUILD_POSIX) -#include <dlfcn.h> -#endif - using JSON = nlohmann::json; namespace FS = std::filesystem; @@ -48,12 +44,6 @@ bool JSONManifestBuilder::BuildTarget(const std::string& argv_val, const bool dr std::string compiler = json_obj["compiler_path"].get<std::string>(); - if (compiler != "g++" || !compiler.starts_with("clang")) { - NeBuild::Logger::info() << "nebuild: error: compiler '" << compiler - << "' is not a valid C/C++ compiler!" << std::endl; - return false; - } - std::string command = compiler + " "; JSON header_search_path = json_obj["compiler_headers_path"]; @@ -63,6 +53,11 @@ bool JSONManifestBuilder::BuildTarget(const std::string& argv_val, const bool dr } JSON headers_path = json_obj["headers_path"]; + + for (auto& headers : headers_path) { + command += "-I" + headers.get<std::string>() + " "; + } + JSON sources_files = json_obj["sources_path"]; for (auto& sources : sources_files) { @@ -91,15 +86,6 @@ bool JSONManifestBuilder::BuildTarget(const std::string& argv_val, const bool dr NeBuild::Logger::info() << "output path: " << target << "\n"; NeBuild::Logger::info() << "command: " << command << "\n"; - try { - if (json_obj["dry_run"].get<bool>()) return true; - } catch (...) { - } - - if (dry_run) { - return true; - } - auto ret_exec = std::system(command.c_str()); if (ret_exec > 0) { @@ -107,38 +93,6 @@ bool JSONManifestBuilder::BuildTarget(const std::string& argv_val, const bool dr << std::endl; return false; } - - try { - if (json_obj["run_after_build"].get<bool>()) { - if (target.ends_with(".so") || target.ends_with(".dylib")) { -#if defined(NEBUILD_POSIX) - auto dll = dlopen(target.c_str(), RTLD_LAZY); - - if (dll) { - int (*entrypoint)(void) = nullptr; - entrypoint = (decltype(entrypoint)) dlsym(dll, "shared_runner"); - - if (entrypoint) entrypoint(); - - dlclose(dll); - - return true; - } -#endif - - return false; - } - -#if defined(NEBUILD_WINDOWS) - std::system((".\\" + target).c_str()); -#else - std::system(("./" + target).c_str()); -#endif - } - } catch (std::runtime_error& err) { - NeBuild::Logger::info() << "error: " << err.what() << std::endl; - return false; - } } catch (std::runtime_error& err) { NeBuild::Logger::info() << "error: " << err.what() << std::endl; return false; |
