From 1d6a6089e92a9ca73a3e5d3fd8ba128a4b684af4 Mon Sep 17 00:00:00 2001 From: nianhua <1585346868@qq.com> Date: Wed, 19 Jun 2024 15:34:03 +0800 Subject: [PATCH] update --- CMakeLists.txt | 6 ++++-- tests/fastweb.cpp | 7 ++++--- tests/fastweb.h | 2 +- 3 files changed, 9 insertions(+), 6 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 8540dc1..a9339e5 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -59,7 +59,8 @@ if(MSVC) else() include_directories(${PROJECT_SOURCE_DIR}/3rdparty) - include_directories(/usr/include/lua5.3/) + include_directories(/usr/local/include) + add_definitions(-DfPIC) endif() @@ -105,7 +106,7 @@ else() ylib leveldb crypto - lua5.3 + lua pthread sqlite3 dl @@ -116,6 +117,7 @@ else() endif() add_definitions(-DFASTWEB_EXE) + # 编译测试调用示例 add_executable(${PROJECT_NAME} tests/main.cpp diff --git a/tests/fastweb.cpp b/tests/fastweb.cpp index 4aafbc3..4ea7b04 100644 --- a/tests/fastweb.cpp +++ b/tests/fastweb.cpp @@ -91,11 +91,11 @@ fastweb::fastweb(const std::vector ¶m) if(equals({"start"},2)) { - start(param[1],false); + start(param[1]); } else if(equals({"start2"},2)) { - start(param[1],true); + start(param[1]); } else if(equals({"create","config"},3)) { @@ -127,7 +127,7 @@ fastweb::~fastweb() { } -void fastweb::start(std::string ini_filepath, bool wait) +void fastweb::start(std::string ini_filepath) { ini_filepath = std::filesystem::absolute(ini_filepath).string(); @@ -135,6 +135,7 @@ void fastweb::start(std::string ini_filepath, bool wait) { if (fastweb_start(ini_filepath.c_str()) == nullptr) return; + wait(); } else { diff --git a/tests/fastweb.h b/tests/fastweb.h index 9c3042b..22e55cb 100644 --- a/tests/fastweb.h +++ b/tests/fastweb.h @@ -26,7 +26,7 @@ private: /// @brief 启动 /// @param ini_filepath /// @param wait - void start(std::string ini_filepath,bool wait); + void start(std::string ini_filepath); /// @brief 停止 /// @param app void stop(void* app);