-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: support ninja build,reduced dependency #178
base: unstable
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -13,14 +13,14 @@ ELSE () | |
SET(LIB_PROTOC "libprotoc.a") | ||
ENDIF () | ||
|
||
SET(PROTOBUF_SOURCES_DIR "${LIB_SOURCE_DIR}/extern_protobuf" CACHE PATH "Path to protobuf sources") | ||
SET(PROTOBUF_SOURCES_DIR "${LIB_SOURCE_DIR}/protobuf" CACHE PATH "Path to protobuf sources") | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🛠️ Refactor suggestion Add missing BUILD_BYPRODUCTS for protoc library. While the build system improvements look good, the Update the - BUILD_BYPRODUCTS ${LIB_PROTOBUF}
+ BUILD_BYPRODUCTS ${PROTOBUF_LIBRARY} ${PROTOC_LIBRARY} Also applies to: 23-23, 48-50 |
||
SET(PROTOBUF_INCLUDE_DIR "${LIB_INCLUDE_DIR}" CACHE PATH "protobuf include directory." FORCE) | ||
SET(PROTOBUF_LIBRARY "${LIB_INSTALL_DIR}/${LIB_PROTOBUF}" CACHE FILEPATH "protobuf install directory." FORCE) | ||
SET(PROTOC_LIBRARY "${LIB_INSTALL_DIR}/${LIB_PROTOC}" CACHE FILEPATH "protoc install directory." FORCE) | ||
SET(PROTOBUF_PROTOC "${LIB_INSTALL_PREFIX}/bin/protoc") | ||
|
||
ExternalProject_Add( | ||
extern_protobuf | ||
protobuf | ||
UPDATE_COMMAND "" | ||
LOG_CONFIGURE 1 | ||
LOG_BUILD 1 | ||
|
@@ -45,9 +45,7 @@ ExternalProject_Add( | |
-DBUILD_SHARED_LIBS=OFF | ||
-Dprotobuf_BUILD_TESTS=OFF | ||
-Dprotobuf_BUILD_LIBPROTOC=ON | ||
BUILD_COMMAND make -j${CPU_CORE} | ||
${EXTERNAL_GENERATOR} | ||
BUILD_COMMAND ${EXTERNAL_BUILD} -j${CPU_CORE} | ||
BUILD_BYPRODUCTS ${LIB_PROTOBUF} | ||
) | ||
|
||
ADD_LIBRARY(protobuf STATIC IMPORTED GLOBAL) | ||
SET_PROPERTY(TARGET protobuf PROPERTY IMPORTED_LOCATION ${PROTOBUF_LIBRARY}) | ||
ADD_DEPENDENCIES(protobuf extern_protobuf) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🛠️ Refactor suggestion
Add missing BUILD_BYPRODUCTS.
The
BUILD_BYPRODUCTS
should include all built libraries to properly support Ninja build system.📝 Committable suggestion