aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authornicole mazzuca <mazzucan@outlook.com>2020-03-04 13:40:00 -0800
committerGitHub <noreply@github.com>2020-03-04 13:40:00 -0800
commit42dee421afd75b967e22bc51d1dc1936fccb4fea (patch)
treeb028f351261091ff96798c00e61df35e6217e549
parent8d5cb4cac4be4ae69d37554d8e499d8ac15aade4 (diff)
downloadvcpkg-42dee421afd75b967e22bc51d1dc1936fccb4fea.tar.gz
vcpkg-42dee421afd75b967e22bc51d1dc1936fccb4fea.zip
[turbobase64] Add new port (#9911)
* Turbo Base 64 * TurboBase64
-rw-r--r--ports/turbobase64/CMakeLists.txt70
-rw-r--r--ports/turbobase64/CONTROL4
-rw-r--r--ports/turbobase64/portfile.cmake21
-rw-r--r--scripts/ci.baseline.txt6
4 files changed, 101 insertions, 0 deletions
diff --git a/ports/turbobase64/CMakeLists.txt b/ports/turbobase64/CMakeLists.txt
new file mode 100644
index 000000000..c4fcebc47
--- /dev/null
+++ b/ports/turbobase64/CMakeLists.txt
@@ -0,0 +1,70 @@
+cmake_minimum_required(VERSION 3.14)
+
+project(turbobase64 C)
+if (SOURCE_PATH)
+ set(CMAKE_SOURCE_DIR ${SOURCE_PATH})
+endif ()
+
+#Copyright 2016-2020 Yandex LLC
+# https://github.com/ClickHouse/ClickHouse/blob/master/contrib/base64-cmake/CMakeLists.txt
+#
+#Apache License
+#Version 2.0, January 2004
+#http://www.apache.org/licenses/
+#Yandex code starts
+
+SET(LIBRARY_DIR ${CMAKE_SOURCE_DIR})
+
+add_library(base64_scalar OBJECT ${LIBRARY_DIR}/turbob64c.c ${LIBRARY_DIR}/turbob64d.c)
+add_library(base64_ssse3 OBJECT ${LIBRARY_DIR}/turbob64sse.c) # This file also contains code for ARM NEON
+
+if (ARCH_AMD64)
+ add_library(base64_avx OBJECT ${LIBRARY_DIR}/turbob64sse.c) # This is not a mistake. One file is compiled twice.
+ add_library(base64_avx2 OBJECT ${LIBRARY_DIR}/turbob64avx2.c)
+endif ()
+
+target_compile_options(base64_scalar PRIVATE -falign-loops)
+
+if (ARCH_AMD64)
+ target_compile_options(base64_ssse3 PRIVATE -mssse3 -falign-loops)
+ target_compile_options(base64_avx PRIVATE -falign-loops -mavx)
+ target_compile_options(base64_avx2 PRIVATE -falign-loops -mavx2)
+else ()
+ target_compile_options(base64_ssse3 PRIVATE -falign-loops)
+endif ()
+
+if (ARCH_AMD64)
+ add_library(base64
+ $<TARGET_OBJECTS:base64_scalar>
+ $<TARGET_OBJECTS:base64_ssse3>
+ $<TARGET_OBJECTS:base64_avx>
+ $<TARGET_OBJECTS:base64_avx2>)
+else ()
+ add_library(base64
+ $<TARGET_OBJECTS:base64_scalar>
+ $<TARGET_OBJECTS:base64_ssse3>)
+endif ()
+
+# End of Yandex code
+
+target_include_directories(base64 SYSTEM PUBLIC $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}>)
+set_target_properties(base64 PROPERTIES PUBLIC_HEADER "${CMAKE_SOURCE_DIR}/turbob64.h")
+
+install(TARGETS base64
+ EXPORT base64Config
+ RUNTIME DESTINATION "bin"
+ LIBRARY DESTINATION "lib"
+ ARCHIVE DESTINATION "lib"
+ PUBLIC_HEADER DESTINATION "include"
+ COMPONENT dev
+ )
+
+export(TARGETS base64
+ NAMESPACE TURBO::
+ FILE "share/base64/base64Config.cmake"
+ )
+
+install(EXPORT base64Config
+ DESTINATION "share/base64"
+ NAMESPACE TURBO::
+ ) \ No newline at end of file
diff --git a/ports/turbobase64/CONTROL b/ports/turbobase64/CONTROL
new file mode 100644
index 000000000..2709230da
--- /dev/null
+++ b/ports/turbobase64/CONTROL
@@ -0,0 +1,4 @@
+Source: turbobase64
+Version: 2020-01-12
+Description: Fastest Base64 SIMD/Neon library
+Homepage: https://github.com/powturbo/Turbo-Base64 \ No newline at end of file
diff --git a/ports/turbobase64/portfile.cmake b/ports/turbobase64/portfile.cmake
new file mode 100644
index 000000000..0d6fc2a43
--- /dev/null
+++ b/ports/turbobase64/portfile.cmake
@@ -0,0 +1,21 @@
+vcpkg_fail_port_install(ON_TARGET "UWP" "Windows")
+
+vcpkg_from_github(
+ OUT_SOURCE_PATH SOURCE_PATH
+ REPO powturbo/Turbo-Base64
+ REF 5257626d2be17a3eb23f79be17fe55ebba394ad2
+ SHA512 7843652793d20c007178cd2069f376578d39566f6e558d7a2ea4f453046ebf5729e7208d6aca205fcca4d2174a3c4de3a6bc841d455778ebf95b3bdaad08c399
+ HEAD_REF master
+)
+
+configure_file(${CURRENT_PORT_DIR}/CMakeLists.txt ${SOURCE_PATH}/CMakeLists.txt COPYONLY)
+
+vcpkg_configure_cmake(
+ SOURCE_PATH ${SOURCE_PATH}
+ PREFER_NINJA
+)
+
+vcpkg_install_cmake()
+
+file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include ${CURRENT_PACKAGES_DIR}/debug/share)
+file(INSTALL ${SOURCE_PATH}/LICENSE DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright)
diff --git a/scripts/ci.baseline.txt b/scripts/ci.baseline.txt
index 066eb21f3..6e7c8dfcf 100644
--- a/scripts/ci.baseline.txt
+++ b/scripts/ci.baseline.txt
@@ -1756,6 +1756,12 @@ torch-th:x64-uwp=fail
torch-th:x64-windows-static=fail
tre:x64-osx=fail
treehopper:x64-windows-static=fail
+turbobase64:arm64-windows=fail
+turbobase64:arm-uwp=fail
+turbobase64:x64-uwp=fail
+turbobase64:x64-windows=fail
+turbobase64:x64-windows-static=fail
+turbobase64:x86-windows=fail
unicorn:arm64-windows=fail
unicorn:arm-uwp=fail
unicorn:x64-linux=fail