diff --git a/.gitmodules b/.gitmodules index 048cce1..22d6b7e 100644 --- a/.gitmodules +++ b/.gitmodules @@ -7,3 +7,9 @@ [submodule "third_party/tools"] path = third_party/tools url = git@git.kingsome.cn:server_common/tools.git +[submodule "third_party/behaviac"] + path = third_party/behaviac + url = git@git.kingsome.cn:libs/behaviac.git +[submodule "third_party/recastnavigation"] + path = third_party/recastnavigation + url = git@git.kingsome.cn:libs/recastnavigation.git diff --git a/server/masterserver/CMakeLists.txt b/server/masterserver/CMakeLists.txt index 37fc769..f3db6a6 100644 --- a/server/masterserver/CMakeLists.txt +++ b/server/masterserver/CMakeLists.txt @@ -8,9 +8,15 @@ else() message(GAME_ID: ${GAME_ID}) endif() -set(CMAKE_BUILD_TYPE "Debug") -set(CMAKE_CXX_FLAGS_RELEASE "-std=gnu++11 -fsanitize=address -fno-omit-frame-pointer") -set(CMAKE_CXX_FLAGS_DEBUG "-Wall -g -std=gnu++11 -DGAME_ID=${GAME_ID}") +if (${RELEASE}) + set(CMAKE_BUILD_TYPE "Release") + message("release mode") +else() + set(CMAKE_BUILD_TYPE "Debug") + message("debug mode") +endif() +set(CMAKE_CXX_FLAGS_RELEASE "-O3 -Wall -g -std=gnu++11 -DGAME_ID=${GAME_ID} -DNDEBUG") +set(CMAKE_CXX_FLAGS_DEBUG "-Wall -g -std=gnu++11 -DGAME_ID=${GAME_ID} -DDEBUG") include_directories( AFTER @@ -21,12 +27,16 @@ include_directories( /usr/include/eigen3 /usr/include/glm ../../third_party + ../../third_party/behaviac/inc + ../../third_party/recastnavigation/Detour/Include + ../../third_party/recastnavigation/DetourTileCache/Include . ) link_directories( /usr/lib64/mysql /usr/local/lib + ../../third_party/behaviac/lib ) aux_source_directory(../../third_party/a8engine/a8 @@ -37,6 +47,14 @@ aux_source_directory(../../third_party/framework/cpp SRC_LIST ) +aux_source_directory(../../third_party/recastnavigation/Detour/Source + SRC_LIST +) + +aux_source_directory(../../third_party/recastnavigation/DetourTileCache/Source + SRC_LIST +) + execute_process( COMMAND touch -a ss_proto.pb.h COMMAND touch -a ss_proto.pb.cc @@ -62,18 +80,42 @@ add_custom_command(TARGET script_pb_protocol ) add_dependencies(masterserver script_pb_protocol) -target_link_libraries( - masterserver - pthread - mysqlclient - protobuf - rt - dl - util - crypto - ssl - jsoncpp - curl - hiredis - tinyxml2 -) + +if (CMAKE_BUILD_TYPE STREQUAL "Debug") + target_link_libraries( + masterserver + pthread + mysqlclient + protobuf + rt + dl + util + crypto + ssl + jsoncpp + curl + hiredis + tinyxml2 + tcmalloc + behaviac_gcc_debug + ) +else() + target_link_libraries( + masterserver + pthread + mysqlclient + protobuf + rt + dl + util + crypto + ssl + jsoncpp + curl + hiredis + tinyxml2 + tcmalloc + behaviac_gcc_release + ) +endif() + diff --git a/third_party/a8engine b/third_party/a8engine index ee4ceec..cdb87a3 160000 --- a/third_party/a8engine +++ b/third_party/a8engine @@ -1 +1 @@ -Subproject commit ee4ceec3d96375f9ca6ba4816ade7508bd570a92 +Subproject commit cdb87a3e673aee3401b3e2ffce3ea1a1e6a603b0 diff --git a/third_party/behaviac b/third_party/behaviac new file mode 160000 index 0000000..2404145 --- /dev/null +++ b/third_party/behaviac @@ -0,0 +1 @@ +Subproject commit 240414570ee2848291d24ff8d3102dc43d4104a3 diff --git a/third_party/framework b/third_party/framework index f7c0890..eb455bb 160000 --- a/third_party/framework +++ b/third_party/framework @@ -1 +1 @@ -Subproject commit f7c0890bc84974c2770688378696bd8d74cfa7c2 +Subproject commit eb455bb95f97dc506566c443be0c72960ceebabf diff --git a/third_party/recastnavigation b/third_party/recastnavigation new file mode 160000 index 0000000..35ca2ea --- /dev/null +++ b/third_party/recastnavigation @@ -0,0 +1 @@ +Subproject commit 35ca2eadc32161cd6ab479d1a2626759a73bb5a3