mirror of
https://github.com/microsoft/vcpkg.git
synced 2025-01-15 02:57:56 +08:00
[protobuf] Fix define PROTOBUF_USE_DLLS with static linking. Closes #1798
This commit is contained in:
parent
6d0f750646
commit
5ad0d81875
@ -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
|
@ -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)
|
||||
|
Loading…
x
Reference in New Issue
Block a user