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
9b6b004f
Commit
9b6b004f
authored
7 years ago
by
zhujiashun
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
make brpc sources compiled once
parent
6aa9661b
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
12 additions
and
6 deletions
+12
-6
CMakeLists.txt
CMakeLists.txt
+1
-1
CMakeLists.txt
src/CMakeLists.txt
+7
-2
CMakeLists.txt
test/CMakeLists.txt
+4
-3
No files found.
CMakeLists.txt
View file @
9b6b004f
...
...
@@ -56,7 +56,7 @@ include_directories(
set
(
CMAKE_CXX_STANDARD 11
)
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
}
-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
-D__STRICT_ANSI__
"
)
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"
)
...
...
This diff is collapsed.
Click to expand it.
src/CMakeLists.txt
View file @
9b6b004f
...
...
@@ -184,8 +184,13 @@ set(SOURCES
${
PROTO_SRCS
}
)
add_library
(
brpc SHARED
${
SOURCES
}
)
add_library
(
brpc_static STATIC
${
SOURCES
}
)
add_library
(
OBJ_LIB OBJECT
${
SOURCES
}
)
# shared libraries need PIC
set_property
(
TARGET
${
OBJ_LIB
}
PROPERTY POSITION_INDEPENDENT_CODE 1
)
add_library
(
brpc SHARED $<TARGET_OBJECTS:OBJ_LIB>
)
add_library
(
brpc_static STATIC $<TARGET_OBJECTS:OBJ_LIB>
)
target_link_libraries
(
brpc
${
GFLAGS_LIBRARY
}
...
...
This diff is collapsed.
Click to expand it.
test/CMakeLists.txt
View file @
9b6b004f
...
...
@@ -267,19 +267,20 @@ target_link_libraries(test_bvar
z
)
add_executable
(
test_butil
${
TEST_BUTIL_SOURCES
}
${
PROTO_SRCS
}
)
add_library
(
PROTO_OBJ OBJECT
${
PROTO_SRCS
}
)
add_executable
(
test_butil
${
TEST_BUTIL_SOURCES
}
$<TARGET_OBJECTS:PROTO_OBJ>
)
target_link_libraries
(
test_butil brpc
${
GTEST_LIB
}
)
file
(
GLOB BTHREAD_UNITTESTS
"bthread*unittest.cpp"
)
foreach
(
BTHREAD_UT
${
BTHREAD_UNITTESTS
}
)
get_filename_component
(
BTHREAD_UT_WE
${
BTHREAD_UT
}
NAME_WE
)
add_executable
(
${
BTHREAD_UT_WE
}
${
BTHREAD_UT
}
$
{
PROTO_SRCS
}
)
add_executable
(
${
BTHREAD_UT_WE
}
${
BTHREAD_UT
}
$
<TARGET_OBJECTS:PROTO_OBJ>
)
target_link_libraries
(
${
BTHREAD_UT_WE
}
brpc
${
GTEST_MAIN_LIB
}
${
GPERFTOOLS_LIBRARIES
}
${
GTEST_LIB
}
)
endforeach
()
file
(
GLOB BRPC_UNITTESTS
"brpc_*_unittest.cpp"
)
foreach
(
BRPC_UT
${
BRPC_UNITTESTS
}
)
get_filename_component
(
BRPC_UT_WE
${
BRPC_UT
}
NAME_WE
)
add_executable
(
${
BRPC_UT_WE
}
${
BRPC_UT
}
$
{
PROTO_SRCS
}
)
add_executable
(
${
BRPC_UT_WE
}
${
BRPC_UT
}
$
<TARGET_OBJECTS:PROTO_OBJ>
)
target_link_libraries
(
${
BRPC_UT_WE
}
brpc
${
GTEST_MAIN_LIB
}
${
GPERFTOOLS_LIBRARIES
}
${
GTEST_LIB
}
)
endforeach
()
This diff is collapsed.
Click to expand it.
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