diff options
| author | Alexander Karatarakis <alex@karatarakis.com> | 2017-09-08 17:26:21 -0700 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2017-09-08 17:26:21 -0700 |
| commit | f52106a03a63f50670f8bbe906922169a2aac46d (patch) | |
| tree | 57b7667794a883835bef7240682b8e4d2c82da6f | |
| parent | 5a46f8e279f47229759dea9dd736d71ab74e04b9 (diff) | |
| parent | 5ad0d8187584ee24f9b007821b033204f0746d35 (diff) | |
| download | vcpkg-f52106a03a63f50670f8bbe906922169a2aac46d.tar.gz vcpkg-f52106a03a63f50670f8bbe906922169a2aac46d.zip | |
Merge pull request #1800 from KindDragon/protobuf-fix
[protobuf] Fix define PROTOBUF_USE_DLLS with static linking
| -rw-r--r-- | ports/protobuf/CONTROL | 2 | ||||
| -rw-r--r-- | ports/protobuf/portfile.cmake | 14 |
2 files changed, 6 insertions, 10 deletions
diff --git a/ports/protobuf/CONTROL b/ports/protobuf/CONTROL index 83b672b3f..68d305ce8 100644 --- a/ports/protobuf/CONTROL +++ b/ports/protobuf/CONTROL @@ -1,4 +1,4 @@ Source: protobuf -Version: 3.4.0 +Version: 3.4.0-1 Build-Depends: zlib Description: Protocol Buffers - Google's data interchange format
\ No newline at end of file diff --git a/ports/protobuf/portfile.cmake b/ports/protobuf/portfile.cmake index 84e2c9b65..804780ab4 100644 --- a/ports/protobuf/portfile.cmake +++ b/ports/protobuf/portfile.cmake @@ -92,15 +92,11 @@ else() protobuf_try_remove_recurse_wait(${CURRENT_PACKAGES_DIR}/debug/bin/protoc.exe) endif() -foreach(FILE ${CURRENT_PACKAGES_DIR}/include/google/protobuf/stubs/platform_macros.h) - file(READ ${FILE} _contents) - if(VCPKG_LIBRARY_LINKAGE STREQUAL dynamic) - string(REPLACE "\#endif // GOOGLE_PROTOBUF_PLATFORM_MACROS_H_" "\#define PROTOBUF_USE_DLLS 1\n\#endif // GOOGLE_PROTOBUF_PLATFORM_MACROS_H_" _contents "${_contents}") - else() - string(REPLACE "\#endif // GOOGLE_PROTOBUF_PLATFORM_MACROS_H_" "\#define PROTOBUF_USE_DLLS 0\n\#endif // GOOGLE_PROTOBUF_PLATFORM_MACROS_H_" _contents "${_contents}") - endif() - file(WRITE ${FILE} "${_contents}") -endforeach() +if(VCPKG_LIBRARY_LINKAGE STREQUAL dynamic) + file(READ ${CURRENT_PACKAGES_DIR}/include/google/protobuf/stubs/platform_macros.h _contents) + string(REPLACE "\#endif // GOOGLE_PROTOBUF_PLATFORM_MACROS_H_" "\#define PROTOBUF_USE_DLLS\n\#endif // GOOGLE_PROTOBUF_PLATFORM_MACROS_H_" _contents "${_contents}") + file(WRITE ${CURRENT_PACKAGES_DIR}/include/google/protobuf/stubs/platform_macros.h "${_contents}") +endif() file(INSTALL ${SOURCE_PATH}/LICENSE DESTINATION ${CURRENT_PACKAGES_DIR}/share/protobuf RENAME copyright) file(INSTALL ${TOOL_PATH}/bin/protoc.exe DESTINATION ${CURRENT_PACKAGES_DIR}/tools) |
