diff --git a/CMakeLists.txt b/CMakeLists.txt index 83c166d..6a74528 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -79,7 +79,7 @@ set(CPACK_PACKAGE_INSTALL_DIRECTORY "Yerbacon ${CMAKE_PROJECT_VERSION_MAJOR}.${C set(CPACK_PACKAGE_FILE_NAME "${PROJECT_NAME}-${CMAKE_PROJECT_VERSION}-${TIME}") include_directories(${CMAKE_CURRENT_LIST_DIR}) -add_executable(${EXENAME} src/main.cpp ${CMAKE_CURRENT_BINARY_DIR}/processed/${PROJECT_NAME}.rc src/parser/MainParse.cpp src/transpiler/MainTranspile.cpp src/etc/filefuncs.cpp src/etc/lexer.cpp src/headers/lex.hpp src/headers/misc.hpp src/headers/parsing/ParseComponents.hpp src/headers/transpiler/Target.hpp src/headers/transpiler/implementations/Lua.hpp src/headers/transpiler/implementations/Js.hpp src/headers/transpiler/implementations/Py.hpp src/headers/parsing/Parser.hpp) +add_executable(${EXENAME} src/main.cpp ${CMAKE_CURRENT_BINARY_DIR}/processed/${PROJECT_NAME}.rc src/parser/MainParse.cpp src/transpiler/MainTranspile.cpp src/etc/filefuncs.cpp src/etc/lexer.cpp src/headers/lex.hpp src/headers/misc.hpp src/headers/parsing/ParseComponents.hpp src/headers/transpiler/Target.hpp src/headers/transpiler/implementations/Lua.hpp src/headers/transpiler/implementations/Js.hpp src/headers/transpiler/implementations/Py.hpp src/headers/parsing/Parser.hpp src/headers/Yerbacon.hpp) target_compile_definitions(ybcon PRIVATE YBCON_VERSION="${CODENAME} ${PROJECT_VERSION}") # lpkg = linux package, wpkg = windows package diff --git a/src/headers/Yerbacon.hpp b/src/headers/Yerbacon.hpp new file mode 100644 index 0000000..50bfb90 --- /dev/null +++ b/src/headers/Yerbacon.hpp @@ -0,0 +1,8 @@ +#ifndef YERBACON_HPP +#define YERBACON_HPP + +namespace Yerbacon { + consteval const char* getVersion() noexcept { return YBCON_VERSION; } +} + +#endif \ No newline at end of file diff --git a/src/headers/misc.hpp b/src/headers/misc.hpp index 5468268..9a61602 100644 --- a/src/headers/misc.hpp +++ b/src/headers/misc.hpp @@ -5,8 +5,6 @@ #define YBCON_VERSION "UNKNOWN" #endif -consteval const char* getVersion() noexcept { return YBCON_VERSION; } - string getFileContent(const string& file); void outputFileContent(const string& file, string_view content); diff --git a/src/main.cpp b/src/main.cpp index 61d7ef5..1440bd1 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -5,9 +5,10 @@ using namespace std; #include "headers/misc.hpp" +#include "headers/Yerbacon.hpp" int main(int argc, char* argv[]) { - if ((argc == 2) && (((string) argv[1]) == "--version")) { cout << getVersion() << endl; exit(EXIT_SUCCESS); } + if ((argc == 2) && (((string) argv[1]) == "--version")) { cout << Yerbacon::getVersion() << endl; exit(EXIT_SUCCESS); } string target = ".lua"; string_view currentArg; bool printResult = false;