aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormyd7349 <myd7349@gmail.com>2019-01-27 08:31:21 +0800
committerCodiferous <44823842+Codiferous@users.noreply.github.com>2019-01-26 16:31:21 -0800
commit65d866786a3d32ab5791bf8ec16ee219540f0648 (patch)
treef74366296c3db82277c6db45220d375625e56138
parentebb2d1a44fa74f4928bfb1e229e343bd4a721472 (diff)
downloadvcpkg-65d866786a3d32ab5791bf8ec16ee219540f0648.tar.gz
vcpkg-65d866786a3d32ab5791bf8ec16ee219540f0648.zip
[xsimd] Add new port (#5194)
* [xsimd] Add new port * Add a header include guard to xsimd's algorithm.hpp algorithm.hpp is not guarded by a header include guard, which can cause difficulty for users. xhihaoy asked that we be sure to include this patch because it caused a lot of pain.
-rw-r--r--ports/xsimd/CONTROL7
-rw-r--r--ports/xsimd/PatchHeaderIncludeGuard.patch24
-rw-r--r--ports/xsimd/portfile.cmake40
3 files changed, 71 insertions, 0 deletions
diff --git a/ports/xsimd/CONTROL b/ports/xsimd/CONTROL
new file mode 100644
index 000000000..f75d920ab
--- /dev/null
+++ b/ports/xsimd/CONTROL
@@ -0,0 +1,7 @@
+Source: xsimd
+Version: 7.1.2
+Description: Modern, portable C++ wrappers for SIMD intrinsics
+
+Feature: xcomplex
+Description: xtl complex support
+Build-Depends: xtl
diff --git a/ports/xsimd/PatchHeaderIncludeGuard.patch b/ports/xsimd/PatchHeaderIncludeGuard.patch
new file mode 100644
index 000000000..73ba4a9bf
--- /dev/null
+++ b/ports/xsimd/PatchHeaderIncludeGuard.patch
@@ -0,0 +1,24 @@
+diff --git a/include/xsimd/stl/algorithms.hpp b/include/xsimd/stl/algorithms.hpp
+index 4cb2b79..1590b89 100644
+--- a/include/xsimd/stl/algorithms.hpp
++++ b/include/xsimd/stl/algorithms.hpp
+@@ -6,6 +6,9 @@
+ * The full license is in the file LICENSE, distributed with this software. *
+ ****************************************************************************/
+
++#ifndef XSIMD_ALGORITHMS_HPP
++#define XSIMD_ALGORITHMS_HPP
++
+ #include "xsimd/memory/xsimd_load_store.hpp"
+
+ namespace xsimd
+@@ -126,4 +129,6 @@ namespace xsimd
+
+ #undef XSIMD_LOOP_MACRO
+ }
+-}
+\ No newline at end of file
++}
++
++#endif
+\ No newline at end of file
diff --git a/ports/xsimd/portfile.cmake b/ports/xsimd/portfile.cmake
new file mode 100644
index 000000000..7e128cd8f
--- /dev/null
+++ b/ports/xsimd/portfile.cmake
@@ -0,0 +1,40 @@
+# header-only library
+
+include(vcpkg_common_functions)
+
+vcpkg_from_github(
+ OUT_SOURCE_PATH SOURCE_PATH
+ REPO QuantStack/xsimd
+ REF 7.1.2
+ SHA512 9479eb6188a68388d470e38ec7b08aaeeb03a1028a574258b52e1c39ce0b1b1aaf97a5cb898447f68c989badd23903ba7a059f5daf59160c660ba751d668c0eb
+ HEAD_REF master
+ PATCHES PatchHeaderIncludeGuard.patch
+)
+
+if("xcomplex" IN_LIST FEATURES)
+ set(ENABLE_XTL_COMPLEX ON)
+else()
+ set(ENABLE_XTL_COMPLEX OFF)
+endif()
+
+vcpkg_configure_cmake(
+ SOURCE_PATH ${SOURCE_PATH}
+ PREFER_NINJA
+ OPTIONS
+ -DENABLE_FALLBACK=OFF
+ -DENABLE_XTL_COMPLEX=${ENABLE_XTL_COMPLEX}
+ -DBUILD_TESTS=OFF
+ -DDOWNLOAD_GTEST=OFF
+)
+
+vcpkg_install_cmake()
+
+vcpkg_fixup_cmake_targets(CONFIG_PATH lib/cmake/${PORT})
+
+file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug ${CURRENT_PACKAGES_DIR}/lib)
+
+# Handle copyright
+configure_file(${SOURCE_PATH}/LICENSE ${CURRENT_PACKAGES_DIR}/share/${PORT}/copyright COPYONLY)
+
+# CMake integration test
+vcpkg_test_cmake(PACKAGE_NAME ${PORT})