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
1d05e8b4
Commit
1d05e8b4
authored
Jan 05, 2018
by
zhujiashun
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix compatibility problem in ubuntu16.04&cmake3.5.1
parent
d71fb5e3
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
25 additions
and
22 deletions
+25
-22
CMakeLists.txt
CMakeLists.txt
+23
-19
CMakeLists.txt
test/CMakeLists.txt
+2
-3
No files found.
CMakeLists.txt
View file @
1d05e8b4
...
...
@@ -124,8 +124,25 @@ foreach(PROTO ${PROTOS})
)
endforeach
()
file
(
GLOB BRPC_PROTOS
"
${
CMAKE_SOURCE_DIR
}
/src/brpc/*.proto"
)
file
(
GLOB BRPC_POLICY_PROTOS
"
${
CMAKE_SOURCE_DIR
}
/src/brpc/policy/*.proto"
)
file
(
GLOB BRPC_PROTOS
"src/brpc/*.proto"
)
foreach
(
PROTO
${
BRPC_PROTOS
}
)
get_filename_component
(
PROTO_WE
${
PROTO
}
NAME_WE
)
list
(
APPEND PROTO_SRCS
"
${
CMAKE_CURRENT_BINARY_DIR
}
/brpc/
${
PROTO_WE
}
.pb.cc"
)
execute_process
(
COMMAND
${
PROTOBUF_PROTOC_EXECUTABLE
}
${
PROTO_FLAGS
}
--cpp_out=
${
CMAKE_CURRENT_BINARY_DIR
}
--proto_path=
${
PROTOBUF_INCLUDE_DIR
}
--proto_path=
${
CMAKE_SOURCE_DIR
}
/src --proto_path=
${
CMAKE_SOURCE_DIR
}
/src/brpc/
${
PROTO
}
WORKING_DIRECTORY
${
CMAKE_CURRENT_BINARY_DIR
}
)
endforeach
()
file
(
GLOB BRPC_POLICY_PROTOS
"src/brpc/policy/*.proto"
)
foreach
(
PROTO
${
BRPC_POLICY_PROTOS
}
)
get_filename_component
(
PROTO_WE
${
PROTO
}
NAME_WE
)
list
(
APPEND PROTO_SRCS
"
${
CMAKE_CURRENT_BINARY_DIR
}
/brpc/policy/
${
PROTO_WE
}
.pb.cc"
)
execute_process
(
COMMAND
${
PROTOBUF_PROTOC_EXECUTABLE
}
${
PROTO_FLAGS
}
--cpp_out=
${
CMAKE_CURRENT_BINARY_DIR
}
--proto_path=
${
PROTOBUF_INCLUDE_DIR
}
--proto_path=
${
CMAKE_SOURCE_DIR
}
/src --proto_path=
${
CMAKE_SOURCE_DIR
}
/src/brpc/policy
${
PROTO
}
WORKING_DIRECTORY
${
CMAKE_CURRENT_BINARY_DIR
}
)
endforeach
()
# list all source files
set
(
BUTIL_SOURCES
...
...
@@ -245,17 +262,10 @@ set(BUTIL_SOURCES
${
CMAKE_SOURCE_DIR
}
/src/butil/popen.cpp
)
aux_source_directory
(
${
CMAKE_SOURCE_DIR
}
/src/bvar BVAR_SOURCES
)
aux_source_directory
(
${
CMAKE_SOURCE_DIR
}
/src/bvar/detail BVAR_DETAIL_SOURCES
)
aux_source_directory
(
${
CMAKE_SOURCE_DIR
}
/src/bthread BTHREAD_SOURCES
)
aux_source_directory
(
${
CMAKE_SOURCE_DIR
}
/src/json2pb JSON2PB_SOURCES
)
aux_source_directory
(
${
CMAKE_SOURCE_DIR
}
/src/brpc BRPC_SOURCES
)
aux_source_directory
(
${
CMAKE_SOURCE_DIR
}
/src/brpc/details BRPC_DETAILS_SOURCES
)
aux_source_directory
(
${
CMAKE_SOURCE_DIR
}
/src/brpc/builtin BRPC_BUILTIN_SOURCES
)
aux_source_directory
(
${
CMAKE_SOURCE_DIR
}
/src/brpc/policy BRPC_POLICY_SOURCES
)
file
(
GLOB_RECURSE BVAR_SOURCES
"
${
CMAKE_SOURCE_DIR
}
/src/bvar/*.cpp"
"
${
CMAKE_SOURCE_DIR
}
/src/bvar/*.cc"
)
file
(
GLOB_RECURSE BTHREAD_SOURCES
"
${
CMAKE_SOURCE_DIR
}
/src/bthread/*.cpp"
"
${
CMAKE_SOURCE_DIR
}
/src/bthread/*.cc"
)
file
(
GLOB_RECURSE JSON2PB_SOURCES
"
${
CMAKE_SOURCE_DIR
}
/src/json2pb/*.cpp"
"
${
CMAKE_SOURCE_DIR
}
/src/json2pb/*.cc"
)
file
(
GLOB_RECURSE BRPC_SOURCES
"
${
CMAKE_SOURCE_DIR
}
/src/brpc/*.cpp"
"
${
CMAKE_SOURCE_DIR
}
/src/brpc/*.cc"
)
set
(
MCPACK2PB_SOURCES
${
CMAKE_SOURCE_DIR
}
/src/mcpack2pb/field_type.cpp
...
...
@@ -266,17 +276,11 @@ set(MCPACK2PB_SOURCES
set
(
SOURCES
${
BVAR_SOURCES
}
${
BVAR_DETAIL_SOURCES
}
${
BTHREAD_SOURCES
}
${
JSON2PB_SOURCES
}
${
MCPACK2PB_SOURCES
}
${
BRPC_SOURCES
}
${
BRPC_DETAILS_SOURCES
}
${
BRPC_BUILTIN_SOURCES
}
${
BRPC_POLICY_SOURCES
}
${
PROTO_SRCS
}
${
BRPC_PROTOS
}
${
BRPC_POLICY_PROTOS
}
)
add_subdirectory
(
src
)
...
...
test/CMakeLists.txt
View file @
1d05e8b4
...
...
@@ -139,12 +139,11 @@ SET(TEST_BUTIL_SOURCES
)
# -DBVAR_NOT_LINK_DEFAULT_VARIABLES not work for gcc >= 5.0, just remove the file to prevent linking into unit tests
set
(
BVAR_SOURCE
${
BVAR_SOURCES
}
${
BVAR_DETAIL_SOURCES
}
)
list
(
REMOVE_ITEM BVAR_SOURCE
${
CMAKE_SOURCE_DIR
}
/src/bvar/default_variables.cpp
)
list
(
REMOVE_ITEM BVAR_SOURCES
${
CMAKE_SOURCE_DIR
}
/src/bvar/default_variables.cpp
)
file
(
GLOB TEST_BVAR_SRCS
"bvar_*_unittest.cpp"
)
add_executable
(
test_bvar $<TARGET_OBJECTS:BUTIL_LIB>
${
BVAR_SOURCE
}
${
BVAR_SOURCE
S
}
${
TEST_BVAR_SRCS
}
)
target_link_libraries
(
test_bvar
${
GTEST_LIB
}
${
GPERFTOOLS_LIBRARIES
}
...
...
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