This commit is contained in:
aozhiwei 2019-12-06 14:49:42 +08:00
parent b3fe7cce9b
commit b7aae72085

View File

@ -15,10 +15,15 @@ else()
message(MASTER_MODE: 0)
endif()
set(CMAKE_BUILD_TYPE "Debug")
set(CMAKE_BUILD_TYPE "Release")
set(CMAKE_CXX_FLAGS_RELEASE "-O3 -Wall -g -std=gnu++11 -DGAME_ID=${GAME_ID} -DMASTER_MODE=${MASTER_MODE}")
set(CMAKE_CXX_FLAGS_DEBUG "-Wall -g -std=gnu++11 -DGAME_ID=${GAME_ID} -DMASTER_MODE=${MASTER_MODE}")
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} -DMASTER_MODE=${MASTER_MODE} -DNDEBUG")
set(CMAKE_CXX_FLAGS_DEBUG "-Wall -g -std=gnu++11 -DGAME_ID=${GAME_ID} -DMASTER_MODE=${MASTER_MODE} -DDEBUG")
include_directories(
AFTER
@ -29,12 +34,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
@ -45,6 +54,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
@ -70,16 +87,40 @@ add_custom_command(TARGET script_pb_protocol
)
add_dependencies(wsproxy${GAME_ID} script_pb_protocol)
target_link_libraries(
wsproxy${GAME_ID}
pthread
mysqlclient
protobuf
rt
crypto
ssl
jsoncpp
curl
hiredis
tinyxml2
)
if (CMAKE_BUILD_TYPE STREQUAL "Debug")
target_link_libraries(
wsproxy${GAME_ID}
pthread
mysqlclient
protobuf
rt
dl
util
crypto
ssl
jsoncpp
curl
hiredis
tinyxml2
tcmalloc
behaviac_gcc_debug
)
else()
target_link_libraries(
wsproxy${GAME_ID}
pthread
mysqlclient
protobuf
rt
dl
util
crypto
ssl
jsoncpp
curl
hiredis
tinyxml2
tcmalloc
behaviac_gcc_release
)
endif()