diff options
author | Gil <mcg@google.com> | 2018-06-12 10:55:48 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-06-12 10:55:48 -0700 |
commit | 0db8ef7dbe6c8c191252d33090dbb88b98735148 (patch) | |
tree | 35ada9d92eddbe4b43e8850eb52f5855755f8895 /cmake/external/protobuf.cmake | |
parent | 9e14b80e0716c2be71c6100cad7aa7c61ac46c6e (diff) |
Fix protobuf/nanopb builds on Windows (#1392)
* Build protobuf with CMake for compatibility with Windows.
Fixes b/74067357
* Update to nanopb 0.3.9.1
This release includes functional CMake support for building the protoc
plugin.
* Fix license
* Build nanopb out-of-source
This is possible now that the build is CMake-based.
* Find protoc on windows
* Define CMAKE_ARGS in a more straightforward way
* Adjust libprotobuf locations to account for CMake build
Diffstat (limited to 'cmake/external/protobuf.cmake')
-rw-r--r-- | cmake/external/protobuf.cmake | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/cmake/external/protobuf.cmake b/cmake/external/protobuf.cmake index e1fdcbb..acc5a96 100644 --- a/cmake/external/protobuf.cmake +++ b/cmake/external/protobuf.cmake @@ -24,8 +24,18 @@ ExternalProject_Add( PREFIX ${PROJECT_BINARY_DIR}/external/protobuf + # protobuf ships CMake files but not at the root of the repo, which confuses + # CMake by default. Unfortunately when you override CONFIGURE_COMMAND like + # this, CMake no longer automatically plumbs in CMAKE_ARGS and friends so + # those need to be manually passed in this command line. + CONFIGURE_COMMAND + ${CMAKE_COMMAND} + -DCMAKE_BUILD_TYPE:STRING=${CMAKE_BUILD_TYPE} + -DCMAKE_INSTALL_PREFIX:PATH=${FIREBASE_INSTALL_DIR} + -Dprotobuf_BUILD_TESTS=OFF + ${PROJECT_BINARY_DIR}/external/protobuf/src/protobuf/cmake + UPDATE_COMMAND "" - CONFIGURE_COMMAND cd <SOURCE_DIR> && ./autogen.sh - COMMAND <SOURCE_DIR>/configure --prefix=${PREFIX} + TEST_COMMAND "" INSTALL_COMMAND "" ) |