diff --git a/CMakeLists.txt b/CMakeLists.txt index 39c988e09..264644eca 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -41,6 +41,12 @@ if(DEBUG) add_compile_definitions(ALLOW_ALL_CORS) endif() +if(NOT DEFINED NITRO_VERSION) + set(NITRO_VERSION "default_version") +endif() + +add_compile_definitions(NITRO_VERSION="${NITRO_VERSION}") + add_subdirectory(llama.cpp) add_executable(${PROJECT_NAME} main.cc) @@ -71,11 +77,10 @@ aux_source_directory(controllers CTL_SRC) # aux_source_directory(filters FILTER_SRC) aux_source_directory(plugins # PLUGIN_SRC) aux_source_directory(models MODEL_SRC) -#drogon_create_views(${PROJECT_NAME} ${CMAKE_CURRENT_SOURCE_DIR}/views -# ${CMAKE_CURRENT_BINARY_DIR}) -# use the following line to create views with namespaces. # drogon_create_views(${PROJECT_NAME} ${CMAKE_CURRENT_SOURCE_DIR}/views -# ${CMAKE_CURRENT_BINARY_DIR} TRUE) +# ${CMAKE_CURRENT_BINARY_DIR}) use the following line to create views with +# namespaces. drogon_create_views(${PROJECT_NAME} +# ${CMAKE_CURRENT_SOURCE_DIR}/views ${CMAKE_CURRENT_BINARY_DIR} TRUE) target_include_directories(${PROJECT_NAME} PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}) # ${CMAKE_CURRENT_SOURCE_DIR}/models) diff --git a/main.cc b/main.cc index 8a0e2f1ff..050b7b844 100644 --- a/main.cc +++ b/main.cc @@ -3,7 +3,6 @@ #include #include #include -#include #if defined(__APPLE__) && defined(__MACH__) #include // for dirname() @@ -41,6 +40,11 @@ int main(int argc, char *argv[]) { int logical_cores = std::thread::hardware_concurrency(); int drogon_thread_num = std::max(thread_num, logical_cores); nitro_utils::nitro_logo(); +#ifdef NITRO_VERSION + LOG_INFO << "Nitro version: " << NITRO_VERSION; +#else + LOG_INFO << "Nitro version: undefined"; +#endif LOG_INFO << "Server started, listening at: " << host << ":" << port; LOG_INFO << "Please load your model"; drogon::app().addListener(host, port);