diff options
| author | nicole mazzuca <mazzucan@outlook.com> | 2020-03-05 14:17:08 -0800 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2020-03-05 14:17:08 -0800 |
| commit | 4b1444e48d4ff3d8468091e8f1d57a55236f091b (patch) | |
| tree | 4683051c97226793c98f9be01808147ec8976424 | |
| parent | bf75bdfe92206e0ac5461743b09592495137c674 (diff) | |
| download | vcpkg-4b1444e48d4ff3d8468091e8f1d57a55236f091b.tar.gz vcpkg-4b1444e48d4ff3d8468091e8f1d57a55236f091b.zip | |
[ryu] Add new port (#10167)
* ryu
* Add tool bazel in OSX
* wip
* wip
* wip
* wip
* wip
Co-authored-by: Jack·Boos·Yu <47264268+JackBoosY@users.noreply.github.com>
| -rw-r--r-- | ports/ryu/CONTROL | 4 | ||||
| -rw-r--r-- | ports/ryu/portfile.cmake | 38 | ||||
| -rw-r--r-- | ports/ryu/ryuConfig.cmake | 20 | ||||
| -rw-r--r-- | scripts/ci.baseline.txt | 5 | ||||
| -rw-r--r-- | scripts/cmake/vcpkg_find_acquire_program.cmake | 6 |
5 files changed, 73 insertions, 0 deletions
diff --git a/ports/ryu/CONTROL b/ports/ryu/CONTROL new file mode 100644 index 000000000..62e6e9f82 --- /dev/null +++ b/ports/ryu/CONTROL @@ -0,0 +1,4 @@ +Source: ryu +Version: 2.0 +Homepage: https://github.com/ulfjack/ryu +Description: Ryu generates the shortest decimal representation of a floating point number that maintains round-trip safety. diff --git a/ports/ryu/portfile.cmake b/ports/ryu/portfile.cmake new file mode 100644 index 000000000..17d1357da --- /dev/null +++ b/ports/ryu/portfile.cmake @@ -0,0 +1,38 @@ +vcpkg_fail_port_install(ON_TARGET "UWP") + +vcpkg_from_github( + OUT_SOURCE_PATH SOURCE_PATH + REPO ulfjack/ryu + REF v2.0 + SHA512 88a0cca74a4889e8e579987abdc75a6ac87c1cdae557e5a15c29dbfd65733f9e591d6569e97a9374444918475099087f8056e696a97c9be24e38eb737e2304c2 + HEAD_REF master +) + +vcpkg_find_acquire_program(BAZEL) +get_filename_component(BAZEL_DIR "${BAZEL}" DIRECTORY) +vcpkg_add_to_path(PREPEND ${BAZEL_DIR}) +set(ENV{BAZEL_BIN_PATH} "${BAZEL}") + +if (CMAKE_HOST_WIN32) + set(ENV{BAZEL_VS} $ENV{VSInstallDir}) + set(ENV{BAZEL_VC} $ENV{VCInstallDir}) +endif () + +vcpkg_execute_build_process( + COMMAND ${BAZEL} build --verbose_failures //ryu + WORKING_DIRECTORY ${SOURCE_PATH} + LOGNAME build-${TARGET_TRIPLET}-rel + ) + +if (CMAKE_HOST_WIN32) + file(INSTALL ${SOURCE_PATH}/bazel-bin/ryu/ryu.lib DESTINATION ${CURRENT_PACKAGES_DIR}/lib/) + file(INSTALL ${SOURCE_PATH}/bazel-bin/ryu/ryu.lib DESTINATION ${CURRENT_PACKAGES_DIR}/debug/lib/) +else() + file(INSTALL ${SOURCE_PATH}/bazel-bin/ryu/libryu.a DESTINATION ${CURRENT_PACKAGES_DIR}/lib/) + file(INSTALL ${SOURCE_PATH}/bazel-bin/ryu/libryu.a DESTINATION ${CURRENT_PACKAGES_DIR}/debug/lib/) +endif() + +file(INSTALL ${SOURCE_PATH}/LICENSE-Boost DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright) +file(INSTALL ${SOURCE_PATH}/ryu/ryu.h DESTINATION ${CURRENT_PACKAGES_DIR}/include/) +file(INSTALL ${CMAKE_CURRENT_LIST_DIR}/ryuConfig.cmake DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT}) + diff --git a/ports/ryu/ryuConfig.cmake b/ports/ryu/ryuConfig.cmake new file mode 100644 index 000000000..ae5e08cb2 --- /dev/null +++ b/ports/ryu/ryuConfig.cmake @@ -0,0 +1,20 @@ +function(set_library_target NAMESPACE LIB_NAME DEBUG_LIB_FILE_NAME RELEASE_LIB_FILE_NAME INCLUDE_DIR) + add_library(${NAMESPACE}::${LIB_NAME} STATIC IMPORTED) + set_target_properties(${NAMESPACE}::${LIB_NAME} PROPERTIES + IMPORTED_CONFIGURATIONS "RELEASE;DEBUG" + IMPORTED_LOCATION_RELEASE "${RELEASE_LIB_FILE_NAME}" + IMPORTED_LOCATION_DEBUG "${DEBUG_LIB_FILE_NAME}" + INTERFACE_INCLUDE_DIRECTORIES "${INCLUDE_DIR}" + ) + set(${NAMESPACE}_${LIB_NAME}_FOUND 1) +endfunction() + +get_filename_component(ROOT "${CMAKE_CURRENT_LIST_FILE}" PATH) +get_filename_component(ROOT "${ROOT}" PATH) +get_filename_component(ROOT "${ROOT}" PATH) + +if (CMAKE_HOST_WIN32) +set_library_target("RYU" "ryu" "${ROOT}/debug/lib/ryu.lib" "${ROOT}/lib/ryu.lib" "${ROOT}/include/") +else() +set_library_target("RYU" "ryu" "${ROOT}/debug/lib/libryu.a" "${ROOT}/lib/libryu.a" "${ROOT}/include/") +endif()
\ No newline at end of file diff --git a/scripts/ci.baseline.txt b/scripts/ci.baseline.txt index 9b76b9c96..0c389fa0d 100644 --- a/scripts/ci.baseline.txt +++ b/scripts/ci.baseline.txt @@ -1549,6 +1549,11 @@ rttr:arm-uwp=fail rttr:x64-uwp=fail
rxspencer:x64-uwp=fail
rxspencer:arm-uwp=fail
+ryu:arm-uwp=fail
+ryu:x64-uwp=fail
+ryu:x64-windows-static=fail
+ryu:x86-windows=fail
+ryu::arm64-windows=fail
scintilla:arm-uwp=fail
scintilla:x64-linux=fail
scintilla:x64-osx=fail
diff --git a/scripts/cmake/vcpkg_find_acquire_program.cmake b/scripts/cmake/vcpkg_find_acquire_program.cmake index 76196769c..81c6dcc39 100644 --- a/scripts/cmake/vcpkg_find_acquire_program.cmake +++ b/scripts/cmake/vcpkg_find_acquire_program.cmake @@ -281,6 +281,12 @@ function(vcpkg_find_acquire_program VAR) set(ARCHIVE "bazel-${BAZEL_VERSION}-linux-x86_64") set(NOEXTRACT ON) set(HASH db4a583cf2996aeb29fd008261b12fe39a4a5faf0fbf96f7124e6d3ffeccf6d9655d391378e68dd0915bc91c9e146a51fd9661963743857ca25179547feceab1) + elseif(CMAKE_HOST_SYSTEM_NAME STREQUAL "Darwin") + set(_vfa_SUPPORTED ON) + set(URL "https://github.com/bazelbuild/bazel/releases/download/${BAZEL_VERSION}/bazel-${BAZEL_VERSION}-darwin-x86_64") + set(ARCHIVE "bazel-${BAZEL_VERSION}-darwin-x86_64") + set(NOEXTRACT ON) + set(HASH 420a37081e6ee76441b0d92ff26d1715ce647737ce888877980d0665197b5a619d6afe6102f2e7edfb5062c9b40630a10b2539585e35479b780074ada978d23c) else() set(URL "https://github.com/bazelbuild/bazel/releases/download/${BAZEL_VERSION}/bazel-${BAZEL_VERSION}-windows-x86_64.zip") set(ARCHIVE "bazel-${BAZEL_VERSION}-windows-x86_64.zip") |
