diff options
| author | Robert Schumacher <roschuma@microsoft.com> | 2017-02-28 18:52:32 -0800 |
|---|---|---|
| committer | Robert Schumacher <roschuma@microsoft.com> | 2017-02-28 18:52:32 -0800 |
| commit | 9e43dbb184785d48d9b5eca0ff60410b68663289 (patch) | |
| tree | 7b488fa92805b33530f98209f013f4ceeaf9d515 | |
| parent | b2cf02b2d6ccbe1e86620ce712501e8a173a701d (diff) | |
| download | vcpkg-9e43dbb184785d48d9b5eca0ff60410b68663289.tar.gz vcpkg-9e43dbb184785d48d9b5eca0ff60410b68663289.zip | |
[flatbuffers] Initial commit of v1.6.0. Fixes #35.
| -rw-r--r-- | ports/flatbuffers/CONTROL | 4 | ||||
| -rw-r--r-- | ports/flatbuffers/portfile.cmake | 65 |
2 files changed, 69 insertions, 0 deletions
diff --git a/ports/flatbuffers/CONTROL b/ports/flatbuffers/CONTROL new file mode 100644 index 000000000..1fbe5d628 --- /dev/null +++ b/ports/flatbuffers/CONTROL @@ -0,0 +1,4 @@ +Source: flatbuffers +Version: 1.6.0 +Description: Memory Efficient Serialization Library http://google.github.io/flatbuffers/ + FlatBuffers is an efficient cross platform serialization library for games and other memory constrained apps. It allows you to directly access serialized data without unpacking/parsing it first, while still having great forwards/backwards compatibility.
\ No newline at end of file diff --git a/ports/flatbuffers/portfile.cmake b/ports/flatbuffers/portfile.cmake new file mode 100644 index 000000000..5d52fc2a8 --- /dev/null +++ b/ports/flatbuffers/portfile.cmake @@ -0,0 +1,65 @@ +# Common Ambient Variables: +# VCPKG_ROOT_DIR = <C:\path\to\current\vcpkg> +# TARGET_TRIPLET is the current triplet (x86-windows, etc) +# PORT is the current port name (zlib, etc) +# CURRENT_BUILDTREES_DIR = ${VCPKG_ROOT_DIR}\buildtrees\${PORT} +# CURRENT_PACKAGES_DIR = ${VCPKG_ROOT_DIR}\packages\${PORT}_${TARGET_TRIPLET} +# + +if(VCPKG_LIBRARY_LINKAGE STREQUAL "dynamic") + message("Building DLLs not supported. Building static instead.") + set(VCPKG_LIBRARY_LINKAGE static) +endif() + + +include(vcpkg_common_functions) +set(SOURCE_PATH ${CURRENT_BUILDTREES_DIR}/src/flatbuffers-1.6.0) +vcpkg_download_distfile(ARCHIVE + URLS "https://github.com/google/flatbuffers/archive/v1.6.0.zip" + FILENAME "flatbuffers-1.6.0.zip" + SHA512 c23043a54d7055f4e0a0164fdafd3f1d60292e57d62d20d30f641c9da90935d14da847f86239a19f777e68b707cfb25452da9192607a3a399ab25ce06b31c282 +) +vcpkg_extract_source_archive(${ARCHIVE}) + +set(OPTIONS) +if(VCPKG_LIBRARY_LINKAGE STREQUAL "dynamic") + list(APPEND OPTIONS -DFLATBUFFERS_BUILD_SHAREDLIB=ON) +endif() + +vcpkg_configure_cmake( + SOURCE_PATH ${SOURCE_PATH} + PREFER_NINJA # Disable this option if project cannot be built with Ninja + OPTIONS + -DFLATBUFFERS_BUILD_TESTS=OFF + -DFLATBUFFERS_BUILD_GRPCTEST=OFF + ${OPTIONS} + # OPTIONS_RELEASE -DOPTIMIZE=1 + # OPTIONS_DEBUG -DDEBUGGABLE=1 +) + +vcpkg_install_cmake() + +if(EXISTS ${CURRENT_PACKAGES_DIR}/debug/bin) + file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/bin) +endif() +if(EXISTS ${CURRENT_PACKAGES_DIR}/bin/flatc.exe) + make_directory(${CURRENT_PACKAGES_DIR}/tools/flatbuffers) + file(RENAME ${CURRENT_PACKAGES_DIR}/bin/flatc.exe ${CURRENT_PACKAGES_DIR}/tools/flatbuffers/flatc.exe) + file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/bin) +endif() +if(EXISTS ${CURRENT_PACKAGES_DIR}/lib/flatbuffers.dll) + make_directory(${CURRENT_PACKAGES_DIR}/bin) + file(RENAME ${CURRENT_PACKAGES_DIR}/lib/flatbuffers.dll ${CURRENT_PACKAGES_DIR}/bin/flatbuffers.dll) +endif() +if(EXISTS ${CURRENT_PACKAGES_DIR}/debug/lib/flatbuffers.dll) + make_directory(${CURRENT_PACKAGES_DIR}/debug/bin) + file(RENAME ${CURRENT_PACKAGES_DIR}/debug/lib/flatbuffers.dll ${CURRENT_PACKAGES_DIR}/debug/bin/flatbuffers.dll) +endif() + +vcpkg_copy_tool_dependencies(${CURRENT_PACKAGES_DIR}/tools/flatbuffers) + +file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include) + +# Handle copyright +file(COPY ${SOURCE_PATH}/LICENSE.txt DESTINATION ${CURRENT_PACKAGES_DIR}/share/flatbuffers) +file(RENAME ${CURRENT_PACKAGES_DIR}/share/flatbuffers/LICENSE.txt ${CURRENT_PACKAGES_DIR}/share/flatbuffers/copyright) |
