88 lines
1.6 KiB
CMake
88 lines
1.6 KiB
CMake
project(wsproxy)
|
|
cmake_minimum_required(VERSION 2.8)
|
|
|
|
if (${GAME_ID})
|
|
message(GAME_ID: ${GAME_ID})
|
|
else()
|
|
set(GAME_ID 1008)
|
|
message(GAME_ID: ${GAME_ID})
|
|
endif()
|
|
|
|
if (${MASTER_MODE})
|
|
message(MASTER_MODE: 1)
|
|
else()
|
|
set(MASTER_MODE 0)
|
|
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} -DA8_TCP_SESSION2=1")
|
|
set(CMAKE_CXX_FLAGS_DEBUG "-Wall -g -std=gnu++11 -DGAME_ID=${GAME_ID} -DMASTER_MODE=${MASTER_MODE} -DA8_TCP_SESSION2=1")
|
|
|
|
include_directories(
|
|
AFTER
|
|
../../third_party/a8engine
|
|
/usr/include/mysql
|
|
/usr/include/jsoncpp
|
|
/usr/include/hiredis
|
|
/usr/include/eigen3
|
|
/usr/include/glm
|
|
../../third_party
|
|
.
|
|
)
|
|
|
|
link_directories(
|
|
/usr/lib64/mysql
|
|
/usr/local/lib
|
|
)
|
|
|
|
aux_source_directory(../../third_party/a8engine/a8
|
|
SRC_LIST
|
|
)
|
|
|
|
aux_source_directory(../../third_party/framework/cpp
|
|
SRC_LIST
|
|
)
|
|
|
|
execute_process(
|
|
COMMAND touch -a ss_proto.pb.h
|
|
COMMAND touch -a ss_proto.pb.cc
|
|
COMMAND touch -a ss_msgid.pb.h
|
|
COMMAND touch -a ss_msgid.pb.cc
|
|
)
|
|
aux_source_directory(.
|
|
SRC_LIST
|
|
)
|
|
|
|
set(EXECUTABLE_OUTPUT_PATH
|
|
${PROJECT_BINARY_DIR}/../bin
|
|
)
|
|
|
|
set_directory_properties(PROPERTIES COMPILE_DEFINITIONS_DEBUG "_DEBUG")
|
|
|
|
add_executable(
|
|
wsproxy ${SRC_LIST}
|
|
)
|
|
|
|
add_custom_target(script_pb_protocol ALL)
|
|
add_custom_command(TARGET script_pb_protocol
|
|
PRE_BUILD
|
|
COMMAND python ../tools/scripts/construct/build_pb.py
|
|
)
|
|
add_dependencies(wsproxy script_pb_protocol)
|
|
|
|
target_link_libraries(
|
|
wsproxy
|
|
pthread
|
|
mysqlclient
|
|
protobuf
|
|
rt
|
|
crypto
|
|
ssl
|
|
jsoncpp
|
|
curl
|
|
hiredis
|
|
tinyxml2
|
|
)
|