[vcpkg] Fix unrecognized identifier errors in prbuild and cibuild. (#15354)

This commit is contained in:
Billy O'Neal 2021-01-10 14:31:30 -08:00 committed by GitHub
parent a14a6bcb27
commit a8fa84e4d8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
12 changed files with 105 additions and 42 deletions

View File

@ -1,6 +0,0 @@
Source: tensorflow-cc
Version: 2.3.1
Port-Version: 1
Homepage: https://github.com/tensorflow/tensorflow
Description: Library for computation using data flow graphs for scalable machine learning (C++ API version)
Supports: !(x86|arm|uwp)

View File

@ -2,9 +2,9 @@ vcpkg_fail_port_install(ON_ARCH "x86" "arm" ON_TARGET "UWP")
set(TF_LIB_SUFFIX "_cc")
set(TF_PORT_SUFFIX "-cc")
set(TF_INCLUDE_DIRS "${INSTALL_PREFIX}/${TARGET_TRIPLET}/include/tensorflow-external
${INSTALL_PREFIX}/${TARGET_TRIPLET}/include/tensorflow-external/src")
list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_LIST_DIR}/../tensorflow-common")
set(TF_INCLUDE_DIRS "${CURRENT_INSTALLED_DIR}/include/tensorflow-external
${CURRENT_INSTALLED_DIR}/include/tensorflow-external/src")
list(APPEND CMAKE_MODULE_PATH "${CURRENT_INSTALLED_DIR}/share/tensorflow-common")
include(tensorflow-common)
file(COPY ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel/bazel-bin/tensorflow/include/ DESTINATION ${CURRENT_PACKAGES_DIR}/include/tensorflow-external)
file(COPY "${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel/bazel-bin/tensorflow/include/" DESTINATION "${CURRENT_PACKAGES_DIR}/include/tensorflow-external")

View File

@ -0,0 +1,11 @@
{
"name": "tensorflow-cc",
"version-string": "2.3.1",
"port-version": 2,
"description": "Library for computation using data flow graphs for scalable machine learning (C++ API version)",
"homepage": "https://github.com/tensorflow/tensorflow",
"supports": "!(x86 | arm | uwp)",
"dependencies": [
"tensorflow-common"
]
}

View File

@ -1,6 +0,0 @@
Source: tensorflow-common
Version: 2.3.1
Port-Version: 0
Homepage: https://github.com/tensorflow/tensorflow
Description: This meta package holds common files for the C [tensorflow] and the C++ [tensorflow-cc] API version of TensorFlow but is not installable on its own.
Supports: false

View File

@ -0,0 +1,23 @@
Copyright (c) Microsoft Corporation
All rights reserved.
MIT License
Permission is hereby granted, free of charge, to any person obtaining a copy of
this software and associated documentation files (the "Software"), to deal in
the Software without restriction, including without limitation the rights to
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
of the Software, and to permit persons to whom the Software is furnished to do
so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

View File

@ -1 +1,27 @@
message(FATAL_ERROR "This meta package holds common files for the C [tensorflow] and the C++ [tensorflow-cc] API version of TensorFlow but is not installable on its own.")
set(VCPKG_POLICY_EMPTY_INCLUDE_FOLDER enabled)
set(TENSORFLOW_FILES
"${CMAKE_CURRENT_LIST_DIR}/change-macros-for-static-lib.patch"
"${CMAKE_CURRENT_LIST_DIR}/convert_lib_params_linux.py"
"${CMAKE_CURRENT_LIST_DIR}/convert_lib_params_windows.py"
"${CMAKE_CURRENT_LIST_DIR}/fix-build-error.patch"
"${CMAKE_CURRENT_LIST_DIR}/fix-dbg-build-errors.patch"
"${CMAKE_CURRENT_LIST_DIR}/fix-linux-build.patch"
"${CMAKE_CURRENT_LIST_DIR}/fix-more-build-errors.patch"
"${CMAKE_CURRENT_LIST_DIR}/generate_static_link_cmd_linux.py"
"${CMAKE_CURRENT_LIST_DIR}/generate_static_link_cmd_macos.py"
"${CMAKE_CURRENT_LIST_DIR}/generate_static_link_cmd_windows.py"
"${CMAKE_CURRENT_LIST_DIR}/README-linux"
"${CMAKE_CURRENT_LIST_DIR}/README-macos"
"${CMAKE_CURRENT_LIST_DIR}/README-windows"
"${CMAKE_CURRENT_LIST_DIR}/tensorflow-common.cmake"
"${CMAKE_CURRENT_LIST_DIR}/tensorflow-config-shared.cmake.in"
"${CMAKE_CURRENT_LIST_DIR}/tensorflow-config-static.cmake.in"
"${CMAKE_CURRENT_LIST_DIR}/tensorflow-config-windows-dll.cmake.in"
"${CMAKE_CURRENT_LIST_DIR}/tensorflow-config-windows-lib.cmake.in"
)
file(COPY ${TENSORFLOW_FILES} DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}")
# Use vcpkg's license
file(INSTALL "${CMAKE_CURRENT_LIST_DIR}/LICENSE.txt" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}" RENAME copyright)

View File

@ -110,14 +110,14 @@ else()
endif()
foreach(BUILD_TYPE dbg rel)
# prefer repeated source extraction here for each build type over extracting once above the loop and copying because users reported issues with copying symlinks
# prefer repeated source extraction here for each build type over extracting once above the loop and copying because users reported issues with copying symlinks
set(STATIC_ONLY_PATCHES)
set(LINUX_ONLY_PATCHES)
if(VCPKG_LIBRARY_LINKAGE STREQUAL static)
set(STATIC_ONLY_PATCHES ../tensorflow-common/change-macros-for-static-lib.patch) # there is no static build option - change macros via patch and link library manually at the end
set(STATIC_ONLY_PATCHES "${CMAKE_CURRENT_LIST_DIR}/change-macros-for-static-lib.patch") # there is no static build option - change macros via patch and link library manually at the end
endif()
if(VCPKG_TARGET_IS_LINUX)
set(LINUX_ONLY_PATCHES ../tensorflow-common/fix-linux-build.patch)
set(LINUX_ONLY_PATCHES "${CMAKE_CURRENT_LIST_DIR}/fix-linux-build.patch")
endif()
vcpkg_from_github(
OUT_SOURCE_PATH SOURCE_PATH
@ -126,9 +126,9 @@ foreach(BUILD_TYPE dbg rel)
SHA512 e497ef4564f50abf9f918be4522cf702f4cf945cb1ebf83af1386ac4ddc7373b3ba70c7f803f8ca06faf2c6b5396e60b1e0e9b97bfbd667e733b08b6e6d70ef0
HEAD_REF master
PATCHES
../tensorflow-common/fix-build-error.patch # Fix namespace error
../tensorflow-common/fix-dbg-build-errors.patch # Fix no return statement
../tensorflow-common/fix-more-build-errors.patch # Fix no return statement
"${CMAKE_CURRENT_LIST_DIR}/fix-build-error.patch" # Fix namespace error
"${CMAKE_CURRENT_LIST_DIR}/fix-dbg-build-errors.patch" # Fix no return statement
"${CMAKE_CURRENT_LIST_DIR}/fix-more-build-errors.patch" # Fix no return statement
${STATIC_ONLY_PATCHES}
${LINUX_ONLY_PATCHES}
)

View File

@ -0,0 +1,7 @@
{
"name": "tensorflow-common",
"version-string": "2.3.1",
"port-version": 1,
"description": "This meta package holds common files for the C [tensorflow] and the C++ [tensorflow-cc] API version of TensorFlow but is not installable on its own.",
"homepage": "https://github.com/tensorflow/tensorflow"
}

View File

@ -1,6 +0,0 @@
Source: tensorflow
Version: 2.3.1
Port-Version: 0
Homepage: https://github.com/tensorflow/tensorflow
Description: Library for computation using data flow graphs for scalable machine learning (C API version)
Supports: !(x86|arm|uwp)

View File

@ -2,18 +2,18 @@ vcpkg_fail_port_install(ON_ARCH "x86" "arm" ON_TARGET "uwp")
set(TF_LIB_SUFFIX "")
set(TF_PORT_SUFFIX "")
set(TF_INCLUDE_DIRS "${INSTALL_PREFIX}/${TARGET_TRIPLET}/include")
list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_LIST_DIR}/../tensorflow-common")
set(TF_INCLUDE_DIRS "${CURRENT_INSTALLED_DIR}/include")
list(APPEND CMAKE_MODULE_PATH "${CURRENT_INSTALLED_DIR}/share/tensorflow-common")
include(tensorflow-common)
file(COPY ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel/bazel-bin/tensorflow/include/tensorflow/c/c_api.h DESTINATION ${CURRENT_PACKAGES_DIR}/include/tensorflow/c)
file(COPY ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel/bazel-bin/tensorflow/include/tensorflow/c/c_api_experimental.h DESTINATION ${CURRENT_PACKAGES_DIR}/include/tensorflow/c)
file(COPY ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel/bazel-bin/tensorflow/include/tensorflow/c/tensor_interface.h DESTINATION ${CURRENT_PACKAGES_DIR}/include/tensorflow/c)
file(COPY ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel/bazel-bin/tensorflow/include/tensorflow/c/tf_attrtype.h DESTINATION ${CURRENT_PACKAGES_DIR}/include/tensorflow/c)
file(COPY ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel/bazel-bin/tensorflow/include/tensorflow/c/tf_datatype.h DESTINATION ${CURRENT_PACKAGES_DIR}/include/tensorflow/c)
file(COPY ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel/bazel-bin/tensorflow/include/tensorflow/c/tf_file_statistics.h DESTINATION ${CURRENT_PACKAGES_DIR}/include/tensorflow/c)
file(COPY ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel/bazel-bin/tensorflow/include/tensorflow/c/tf_status.h DESTINATION ${CURRENT_PACKAGES_DIR}/include/tensorflow/c)
file(COPY ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel/bazel-bin/tensorflow/include/tensorflow/c/tf_tensor.h DESTINATION ${CURRENT_PACKAGES_DIR}/include/tensorflow/c)
file(COPY ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel/bazel-bin/tensorflow/include/tensorflow/c/eager/c_api.h DESTINATION ${CURRENT_PACKAGES_DIR}/include/tensorflow/c/eager)
file(COPY ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel/bazel-bin/tensorflow/include/tensorflow/c/eager/c_api_experimental.h DESTINATION ${CURRENT_PACKAGES_DIR}/include/tensorflow/c/eager)
file(COPY ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel/bazel-bin/tensorflow/include/tensorflow/c/eager/dlpack.h DESTINATION ${CURRENT_PACKAGES_DIR}/include/tensorflow/c/eager)
file(COPY "${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel/bazel-bin/tensorflow/include/tensorflow/c/c_api.h" DESTINATION "${CURRENT_PACKAGES_DIR}/include/tensorflow/c")
file(COPY "${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel/bazel-bin/tensorflow/include/tensorflow/c/c_api_experimental.h" DESTINATION "${CURRENT_PACKAGES_DIR}/include/tensorflow/c")
file(COPY "${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel/bazel-bin/tensorflow/include/tensorflow/c/tensor_interface.h" DESTINATION "${CURRENT_PACKAGES_DIR}/include/tensorflow/c")
file(COPY "${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel/bazel-bin/tensorflow/include/tensorflow/c/tf_attrtype.h" DESTINATION "${CURRENT_PACKAGES_DIR}/include/tensorflow/c")
file(COPY "${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel/bazel-bin/tensorflow/include/tensorflow/c/tf_datatype.h" DESTINATION "${CURRENT_PACKAGES_DIR}/include/tensorflow/c")
file(COPY "${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel/bazel-bin/tensorflow/include/tensorflow/c/tf_file_statistics.h" DESTINATION "${CURRENT_PACKAGES_DIR}/include/tensorflow/c")
file(COPY "${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel/bazel-bin/tensorflow/include/tensorflow/c/tf_status.h" DESTINATION "${CURRENT_PACKAGES_DIR}/include/tensorflow/c")
file(COPY "${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel/bazel-bin/tensorflow/include/tensorflow/c/tf_tensor.h" DESTINATION "${CURRENT_PACKAGES_DIR}/include/tensorflow/c")
file(COPY "${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel/bazel-bin/tensorflow/include/tensorflow/c/eager/c_api.h" DESTINATION "${CURRENT_PACKAGES_DIR}/include/tensorflow/c/eager")
file(COPY "${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel/bazel-bin/tensorflow/include/tensorflow/c/eager/c_api_experimental.h" DESTINATION "${CURRENT_PACKAGES_DIR}/include/tensorflow/c/eager")
file(COPY "${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel/bazel-bin/tensorflow/include/tensorflow/c/eager/dlpack.h" DESTINATION "${CURRENT_PACKAGES_DIR}/include/tensorflow/c/eager")

View File

@ -0,0 +1,11 @@
{
"name": "tensorflow",
"version-string": "2.3.1",
"port-version": 1,
"description": "Library for computation using data flow graphs for scalable machine learning (C API version)",
"homepage": "https://github.com/tensorflow/tensorflow",
"supports": "!(x86 | arm | uwp)",
"dependencies": [
"tensorflow-common"
]
}

View File

@ -29,6 +29,7 @@ namespace vcpkg::PlatformExpression
uwp,
android,
emscripten,
ios,
static_link,
};
@ -48,6 +49,7 @@ namespace vcpkg::PlatformExpression
{"uwp", Identifier::uwp},
{"android", Identifier::android},
{"emscripten", Identifier::emscripten},
{"ios", Identifier::ios},
{"static", Identifier::static_link},
};
@ -392,6 +394,7 @@ namespace vcpkg::PlatformExpression
case Identifier::android: return true_if_exists_and_equal("VCPKG_CMAKE_SYSTEM_NAME", "Android");
case Identifier::emscripten:
return true_if_exists_and_equal("VCPKG_CMAKE_SYSTEM_NAME", "Emscripten");
case Identifier::ios: return true_if_exists_and_equal("VCPKG_CMAKE_SYSTEM_NAME", "iOS");
case Identifier::wasm32: return true_if_exists_and_equal("VCPKG_TARGET_ARCHITECTURE", "wasm32");
case Identifier::static_link:
return true_if_exists_and_equal("VCPKG_LIBRARY_LINKAGE", "static");