From 04ce2860f99c49b4c46219ae1bf91ad2f34b3931 Mon Sep 17 00:00:00 2001 From: aozhiwei Date: Wed, 1 May 2024 13:58:55 +0800 Subject: [PATCH] 1 --- server/mymangosd/CMakeLists.txt | 62 ++++++++++++++++++++++++++++++--- server/mymangosd/main.cc | 29 --------------- third_party/f8/f8/btmgr.cc | 2 ++ third_party/f8/f8/btmgr.h | 2 ++ 4 files changed, 61 insertions(+), 34 deletions(-) diff --git a/server/mymangosd/CMakeLists.txt b/server/mymangosd/CMakeLists.txt index 488cdfc..ed71339 100644 --- a/server/mymangosd/CMakeLists.txt +++ b/server/mymangosd/CMakeLists.txt @@ -1,7 +1,5 @@ -cmake_minimum_required(VERSION 3.28.2) project(mymangosd) - -set(CMAKE_CXX_STANDARD 20) +cmake_minimum_required(VERSION 2.8) if (${RELEASE}) set(CMAKE_BUILD_TYPE "Release") @@ -11,16 +9,54 @@ else() message("debug mode") endif() -set(CMAKE_CXX_FLAGS_DEBUG "-std=c++20 -fmodules-ts") +set(CMAKE_CXX_FLAGS_RELEASE "-Wall -g -std=gnu++1z -DNDEBUG -DDT_VIRTUAL_QUERYFILTER") +if (${ASAN}) + set(CMAKE_CXX_FLAGS_DEBUG "-Wall -g -std=gnu++1z -DMYDEBUG -DDT_VIRTUAL_QUERYFILTER -fsanitize=address -fno-omit-frame-pointer") +else() + set(CMAKE_CXX_FLAGS_DEBUG "-Wall -g -std=gnu++1z -DMYDEBUG -DDT_VIRTUAL_QUERYFILTER") +endif() include_directories( AFTER ../../third_party/a8 ../../third_party/f8 + /usr/include/mysql + /usr/include/jsoncpp + /usr/include/hiredis + /usr/include/glm + ../../third_party + ../../third_party/behaviac/inc + ../../third_party/recastnavigation/Recast/Include + ../../third_party/recastnavigation/Detour/Include + ../../third_party/recastnavigation/DetourTileCache/Include + behaviac_generated/types + behaviac_generated/types/internal + . ) link_directories( - ../../third_party/behaviac/lib/${LIB_DIR} + /usr/lib64/mysql + /usr/local/lib +) + +aux_source_directory(../../third_party/a8/a8 + SRC_LIST +) + +aux_source_directory(../../third_party/f8/f8 + SRC_LIST +) + +aux_source_directory(../../third_party/recastnavigation/Recast/Source + SRC_LIST +) + +aux_source_directory(../../third_party/recastnavigation/Detour/Source + SRC_LIST +) + +aux_source_directory(../../third_party/recastnavigation/DetourTileCache/Source + SRC_LIST ) aux_source_directory(. @@ -38,15 +74,31 @@ add_executable( target_link_libraries( mymangosd pthread + mysqlclient protobuf + rt + dl + util + crypto + ssl + jsoncpp + curl + hiredis + tinyxml2 + backtrace ) if (CMAKE_BUILD_TYPE STREQUAL "Debug") target_link_libraries( mymangosd + #behaviac_gcc_release + boost_stacktrace_backtrace + boost_stacktrace_addr2line ) else() target_link_libraries( mymangosd + tcmalloc + #behaviac_gcc_release ) endif() diff --git a/server/mymangosd/main.cc b/server/mymangosd/main.cc index b9d5df5..489dfc7 100644 --- a/server/mymangosd/main.cc +++ b/server/mymangosd/main.cc @@ -1,33 +1,4 @@ -import ; -import ; -import ; -import ; - -import gemfield; -import cs; - -#include - -void test(std::vector& a) -{ - for (auto& n : a) { - std::cout << "I am Gemfield." << n << std::endl; - n += 100; - } -} - int main(int argc, char* argv[]) { - std::vector a; - a.push_back(1); - a.push_back(2); - a.push_back(3); - a.push_back(4); - a.push_back(100); - test(a); - whoami(a); - std::shared_ptr msg; - cs::CMMove msg1; - msg1.set_seq(100); return 0; } diff --git a/third_party/f8/f8/btmgr.cc b/third_party/f8/f8/btmgr.cc index c205d86..6d81079 100644 --- a/third_party/f8/f8/btmgr.cc +++ b/third_party/f8/f8/btmgr.cc @@ -2,6 +2,7 @@ #include +#if 0 #include "btmgr.h" namespace f8 @@ -64,3 +65,4 @@ namespace f8 } } +#endif diff --git a/third_party/f8/f8/btmgr.h b/third_party/f8/f8/btmgr.h index 0b6cca1..459296f 100644 --- a/third_party/f8/f8/btmgr.h +++ b/third_party/f8/f8/btmgr.h @@ -1,5 +1,6 @@ #pragma once +#if 0 #include #include "behaviac/behaviac.h" @@ -29,3 +30,4 @@ namespace f8 void BtDestory(behaviac::Agent* agent); }; } +#endif