# 声明编译要求cmake最低版本
CMAKE_MINIMUM_REQUIRED(VERSION 3.0)

# 配置支持Ｃ++11

set(CMAKE_CXX_STANDARD 11)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -m32 -fpic")

file(GLOB_RECURSE DIR_ASMJIT_LIB_SRCS 
	"asmjit/core/*.c"
	"asmjit/core/*.cc"
	"asmjit/core/*.cpp"
	"asmjit/core/*.cxx"
	"asmjit/arm/*.c"
	"asmjit/arm/*.cc"
	"asmjit/arm/*.cpp"
	"asmjit/arm/*.cxx"
	"asmjit/x86/*.c"
	"asmjit/x86/*.cc"
	"asmjit/x86/*.cpp"
	"asmjit/x86/*.cxx"
)

#添加头文件目录
include_directories(${PROJECT_SOURCE_DIR}/include /home/asio/asio-1.28.0/include/ ${PROJECT_SOURCE_DIR}/src/ ${PROJECT_SOURCE_DIR}/src/sdk/)
add_compile_definitions(ASMJIT_STATIC)

# 添加库源文件
set(LIB_SOURCE
        "dispatch.cpp"
        "controller.cpp"
        "df_main.cpp"
		"Tool.cpp"
		"l_squirrel.cpp"
		"l_socket.cpp"
		"CConnectPool.cpp"
)

# 添加动态库，关键词为shared
ADD_LIBRARY(hook_aurora SHARED ${DIR_ASMJIT_LIB_SRCS} ${LIB_SOURCE})

# 指定动态库的输出名称
SET_TARGET_PROPERTIES(hook_aurora PROPERTIES OUTPUT_NAME "Aurora")



target_link_libraries(hook_aurora  libstdc++.a -L/home/dnf_project/dnf_project/build/lib/squirrel -lsqstdlib_static -L/home/dnf_project/dnf_project/build/lib/squirrel -lsquirrel_static -L/home/dnf_project/dnf_project/build/lib/mysql/lib libmysqlclient.a -lpthread)
# 指定动态库版本, 视需求而定，可不加
# VERSION:动态库版本，SOVERSION:API版本
#SET_TARGET_PROPERTIES(hook_aurora PROPERTIES VERSION 0.1.1 SOVERSION 0)

# 指定库编译输出目录
SET(LIBRARY_OUTPUT_PATH ${PROJECT_BINARY_DIR}/lib) 
