Skip to content

Commit

Permalink
support cmake.
Browse files Browse the repository at this point in the history
  • Loading branch information
zhengshuxin committed Jan 18, 2017
1 parent a27435e commit e2bb0ad
Show file tree
Hide file tree
Showing 7 changed files with 179 additions and 142 deletions.
8 changes: 8 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
cmake_minimum_required(VERSION 2.8)
project(acl)
add_subdirectory(lib_acl/src lib_acl)
add_subdirectory(lib_protocol/src lib_protocol)
add_subdirectory(lib_acl_cpp/src lib_acl_cpp)
if (CMAKE_SYSTEM_NAME MATCHES "Linuxxx")
add_subdirectory(lib_fiber/src lib_fiber)
endif()
70 changes: 70 additions & 0 deletions lib_acl/src/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
cmake_minimum_required(VERSION 2.8)

add_definitions("-g")
add_definitions("-W")
add_definitions("-O3")
add_definitions("-Wall")
add_definitions("-Werror")
add_definitions("-Wshadow")
add_definitions("-Wpointer-arith")
add_definitions("-Waggregate-return")
add_definitions("-Wmissing-prototypes")
add_definitions("-D_REENTRANT")
add_definitions("-D_USE_FAST_MACRO")
add_definitions("-DACL_WRITEABLE_CHECK")
add_definitions("-Wno-long-long")
add_definitions("-Wuninitialized")
add_definitions("-D_POSIX_PTHREAD_SEMANTICS")
add_definitions("-DACL_PREPARE_COMPILE")

if (CMAKE_SYSTEM_NAME MATCHES "Linux")
add_definitions("-DLINUX2")
add_definitions("-Wstrict-prototypes")
add_definitions("-fPIC")
endif()

message(${PROJECT_SOURCE_DIR})
set(rpath lib_acl)
set(src ${PROJECT_SOURCE_DIR}/${rpath}/src)

message(${src})
message(${src}/stdlib)
include_directories(${PROJECT_SOURCE_DIR}/${rpath})
include_directories(${PROJECT_SOURCE_DIR}/${rpath}/include)
aux_source_directory(${src}/stdlib lib_src)
aux_source_directory(${src}/stdlib/debug lib_src)
aux_source_directory(${src}/stdlib/memory lib_src)
aux_source_directory(${src}/stdlib/filedir lib_src)
aux_source_directory(${src}/stdlib/string lib_src)
aux_source_directory(${src}/stdlib/common lib_src)
aux_source_directory(${src}/stdlib/sys lib_src)
aux_source_directory(${src}/stdlib/sys/unix lib_src)
aux_source_directory(${src}/stdlib/configure lib_src)
aux_source_directory(${src}/stdlib/iostuff lib_src)
aux_source_directory(${src}/aio lib_src)
aux_source_directory(${src}/code lib_src)
aux_source_directory(${src}/db lib_src)
aux_source_directory(${src}/db/memdb lib_src)
aux_source_directory(${src}/db/mysql lib_src)
aux_source_directory(${src}/db/null lib_src)
aux_source_directory(${src}/db/zdb lib_src)
aux_source_directory(${src}/event lib_src)
aux_source_directory(${src}/init lib_src)
aux_source_directory(${src}/ioctl lib_src)
aux_source_directory(${src}/json lib_src)
aux_source_directory(${src}/master lib_src)
aux_source_directory(${src}/master/framework lib_src)
aux_source_directory(${src}/master/framework/trigger lib_src)
aux_source_directory(${src}/master/template lib_src)
aux_source_directory(${src}/msg lib_src)
aux_source_directory(${src}/net lib_src)
aux_source_directory(${src}/net/dns lib_src)
aux_source_directory(${src}/net/connect lib_src)
aux_source_directory(${src}/net/listen lib_src)
aux_source_directory(${src}/private lib_src)
aux_source_directory(${src}/thread lib_src)
aux_source_directory(${src}/unit_test lib_src)
aux_source_directory(${src}/xml lib_src)

add_library(_acl ${lib_src})
#add_library(_acl SHARED ${lib_src})
1 change: 1 addition & 0 deletions lib_acl/src/master/framework/master_ent.c
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@
#include "stdlib/acl_argv.h"
#include "net/acl_sane_inet.h"
#include "net/acl_host_port.h"
#include "net/acl_ifconf.h"

/* Application specific */
#include "../master_proto.h"
Expand Down
62 changes: 62 additions & 0 deletions lib_acl_cpp/src/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
cmake_minimum_required(VERSION 2.8)

add_definitions("-g")
add_definitions("-W")
add_definitions("-O3")
add_definitions("-Wall")
add_definitions("-Werror")
add_definitions("-Wshadow")
add_definitions("-Wformat")
add_definitions("-Wpointer-arith")
add_definitions("-D_REENTRANT")
add_definitions("-D_USE_FAST_MACRO")
add_definitions("-Wno-long-long")
add_definitions("-Wuninitialized")
add_definitions("-D_POSIX_PTHREAD_SEMANTICS")
add_definitions("-DHAS_MYSQL_DLL")
add_definitions("-DHAS_SQLITE_DLL")

if (CMAKE_SYSTEM_NAME MATCHES "Linux")
add_definitions("-DLINUX2")
add_definitions("-fPIC")
endif()

set(rpath lib_acl_cpp)
set(src ${PROJECT_SOURCE_DIR}/${rpath}/src)
set(acl_path ${PROJECT_SOURCE_DIR}/lib_acl)
set(acl_include ${acl_path}/include)
set(proto_path ${PROJECT_SOURCE_DIR}/lib_protocol)
set(proto_include ${proto_path}/include)
set(mysql_include ${PROJECT_SOURCE_DIR}/include/mysql)
set(sqlite_include ${PROJECT_SOURCE_DIR}/include/sqlite)

include_directories(${mysql_include})
include_directories(${sqlite_include})
include_directories(${acl_include})
include_directories(${proto_include})
include_directories(${PROJECT_SOURCE_DIR}/${rpath}/src)
include_directories(${PROJECT_SOURCE_DIR}/${rpath}/include)

aux_source_directory(${src} lib_src)
aux_source_directory(${src}/aliyun lib_src)
aux_source_directory(${src}/beanstalk lib_src)
aux_source_directory(${src}/connpool lib_src)
aux_source_directory(${src}/db lib_src)
aux_source_directory(${src}/disque lib_src)
aux_source_directory(${src}/event lib_src)
aux_source_directory(${src}/hsocket lib_src)
aux_source_directory(${src}/http lib_src)
aux_source_directory(${src}/ipc lib_src)
aux_source_directory(${src}/master lib_src)
aux_source_directory(${src}/memcache lib_src)
aux_source_directory(${src}/mime lib_src)
aux_source_directory(${src}/mime/internal lib_src)
aux_source_directory(${src}/queue lib_src)
aux_source_directory(${src}/redis lib_src)
aux_source_directory(${src}/serialize lib_src)
aux_source_directory(${src}/session lib_src)
aux_source_directory(${src}/smtp lib_src)
aux_source_directory(${src}/stdlib lib_src)
aux_source_directory(${src}/stream lib_src)

add_library(_acl_cpp ${lib_src})
73 changes: 0 additions & 73 deletions lib_acl_cpp/src/mime/internal/tok822_resolve.c

This file was deleted.

69 changes: 0 additions & 69 deletions lib_acl_cpp/src/mime/internal/tok822_rewrite.c

This file was deleted.

38 changes: 38 additions & 0 deletions lib_protocol/src/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
cmake_minimum_required(VERSION 2.8)

add_definitions("-g")
add_definitions("-W")
add_definitions("-O3")
add_definitions("-Wall")
add_definitions("-Werror")
add_definitions("-Wshadow")
add_definitions("-Wpointer-arith")
add_definitions("-Waggregate-return")
add_definitions("-Wmissing-prototypes")
add_definitions("-D_REENTRANT")
add_definitions("-D_USE_FAST_MACRO")
add_definitions("-Wno-long-long")
add_definitions("-Wuninitialized")
add_definitions("-D_POSIX_PTHREAD_SEMANTICS")

if (CMAKE_SYSTEM_NAME MATCHES "Linux")
add_definitions("-DLINUX2")
add_definitions("-Wstrict-prototypes")
add_definitions("-fPIC")
endif()

set(rpath lib_protocol)
set(src ${PROJECT_SOURCE_DIR}/${rpath}/src)
set(acl_path ${PROJECT_SOURCE_DIR}/lib_acl)
set(acl_include ${acl_path}/include)

include_directories(${acl_include})
include_directories(${PROJECT_SOURCE_DIR}/${rpath}/src)
include_directories(${PROJECT_SOURCE_DIR}/${rpath}/include)

aux_source_directory(${src} lib_src)
aux_source_directory(${src}/http lib_src)
aux_source_directory(${src}/smtp lib_src)
aux_source_directory(${src}/icmp lib_src)

add_library(_protocol ${lib_src})

0 comments on commit e2bb0ad

Please sign in to comment.