Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
B
brpc
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Packages
Packages
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
submodule
brpc
Commits
f3fe5fc4
Commit
f3fe5fc4
authored
Dec 26, 2017
by
zhujiashun
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
refine CMakeLists.txt
parent
997522bc
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
11 additions
and
24 deletions
+11
-24
CMakeLists.txt
CMakeLists.txt
+10
-12
CMakeLists.txt
example/CMakeLists.txt
+0
-4
CMakeLists.txt
src/CMakeLists.txt
+1
-5
CMakeLists.txt
test/CMakeLists.txt
+0
-3
No files found.
CMakeLists.txt
View file @
f3fe5fc4
...
...
@@ -58,22 +58,21 @@ set(CMAKE_CXX_STANDARD_REQUIRED ON)
set
(
CMAKE_CPP_FLAGS
"-DBRPC_WITH_GLOG=
${
WITH_GLOG_VAL
}
-DGFLAGS_NS=
${
GFLAGS_NS
}
"
)
set
(
CMAKE_CPP_FLAGS
"
${
CMAKE_CPP_FLAGS
}
-DBTHREAD_USE_FAST_PTHREAD_MUTEX -D__const__= -D_GNU_SOURCE -DUSE_SYMBOLIZE -DNO_TCMALLOC -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS -D__STDC_CONSTANT_MACROS"
)
set
(
CMAKE_CPP_FLAGS
"
${
CMAKE_CPP_FLAGS
}
${
DEBUG_SYMBOL
}
"
)
set
(
CMAKE_CXX_FLAGS
"
${
CMAKE_CPP_FLAGS
}
-O2 -pipe -Wall -W -fPIC -fstrict-aliasing -Wno-invalid-offsetof -Wno-unused-parameter -fno-omit-frame-pointer"
)
set
(
CMAKE_C_FLAGS
"
${
CMAKE_CPP_FLAGS
}
-O2 -pipe -Wall -W -fPIC -fstrict-aliasing -Wno-unused-parameter -fno-omit-frame-pointer"
)
SET
(
CMAKE_EXE_LINKER_FLAGS
"-pthread"
)
#required by butil/crc32.cc to boost performance for 10x
if
(
NOT
(
CMAKE_CXX_COMPILER_VERSION VERSION_LESS 4.4
))
set
(
CMAKE_CXX_FLAGS
"
${
CMAKE_CXX_FLAGS
}
-msse4 -msse4.2"
)
endif
()
if
(
NOT
(
CMAKE_CXX_COMPILER_VERSION VERSION_LESS 7.0
))
set
(
CMAKE_CXX_FLAGS
"
${
CMAKE_CXX_FLAGS
}
-Wno-aligned-new"
)
if
(
CMAKE_CXX_COMPILER_ID STREQUAL
"GNU"
)
#required by butil/crc32.cc to boost performance for 10x
if
(
NOT
(
CMAKE_CXX_COMPILER_VERSION VERSION_LESS 4.4
))
set
(
CMAKE_CXX_FLAGS
"
${
CMAKE_CXX_FLAGS
}
-msse4 -msse4.2"
)
endif
()
if
(
NOT
(
CMAKE_CXX_COMPILER_VERSION VERSION_LESS 7.0
))
set
(
CMAKE_CXX_FLAGS
"
${
CMAKE_CXX_FLAGS
}
-Wno-aligned-new"
)
endif
()
endif
()
find_path
(
PROTOBUF_HEADER NAMES google/protobuf/stubs/common.h
)
find_library
(
PROTOBUF_LIB NAMES protobuf
)
include
(
FindProtobuf
)
find_path
(
LEVELDB_HEADER NAMES leveldb/db.h
)
find_library
(
LEVELDB_LIB NAMES leveldb
)
...
...
@@ -88,9 +87,8 @@ find_library(PROTOC_LIB NAMES protoc)
include_directories
(
${
GFLAGS_INCLUDE_PATH
}
${
PROTOBUF_
HEADER
}
${
PROTOBUF_
INCLUDE_DIRS
}
${
LEVELDB_HEADER
}
${
THREAD_HEADER
}
)
# for *.so
...
...
example/CMakeLists.txt
View file @
f3fe5fc4
include
(
FindProtobuf
)
find_package
(
Protobuf REQUIRED
)
include_directories
(
${
PROTOBUF_INCLUDE_DIR
}
)
add_subdirectory
(
http_c++
)
add_subdirectory
(
asynchronous_echo_c++
)
add_subdirectory
(
backup_request_c++
)
...
...
src/CMakeLists.txt
View file @
f3fe5fc4
include
(
FindProtobuf
)
find_package
(
Protobuf REQUIRED
)
include_directories
(
${
PROTOBUF_INCLUDE_DIR
}
)
file
(
GLOB PROTOS
"*.proto"
)
list
(
APPEND PROTO_FLAGS -I
${
CMAKE_CURRENT_BINARY_DIR
}
)
foreach
(
PROTO
${
PROTOS
}
)
...
...
@@ -192,7 +189,7 @@ add_library(brpc_static STATIC ${SOURCES})
target_link_libraries
(
brpc
${
GFLAGS_LIBRARY
}
${
PROTOBUF_LIB
}
${
PROTOBUF_LIB
RARIES
}
${
LEVELDB_LIB
}
${
PROTOC_LIB
}
rt
...
...
@@ -212,7 +209,6 @@ set(protoc_gen_mcpack_SOURCES
add_executable
(
protoc-gen-mcpack
${
protoc_gen_mcpack_SOURCES
}
)
target_link_libraries
(
protoc-gen-mcpack brpc
)
get_property
(
LIB64 GLOBAL PROPERTY FIND_LIBRARY_USE_LIB64_PATHS
)
if
(
"
${
LIB64
}
"
STREQUAL
"TRUE"
)
set
(
LIBSUFFIX 64
)
...
...
test/CMakeLists.txt
View file @
f3fe5fc4
include
(
FindProtobuf
)
find_package
(
Protobuf REQUIRED
)
include_directories
(
${
PROTOBUF_INCLUDE_DIR
}
)
include_directories
(
${
CMAKE_CURRENT_BINARY_DIR
}
)
file
(
GLOB PROTOS
"*.proto"
)
list
(
APPEND PROTO_FLAGS -I
${
CMAKE_CURRENT_BINARY_DIR
}
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment