Techt3o commited on
Commit
cbcfdeb
·
verified ·
1 Parent(s): 6b2320e

7ab911ccd9e88f77ba52668f708ac1378e479e3509ec9bcf91762f1bafbc4fa6

Browse files
Files changed (50) hide show
  1. third-party/DPVO/Pangolin/scripts/vcpkg/ports/libsecret/vcpkg.json +21 -0
  2. third-party/DPVO/Pangolin/scripts/vcpkg/ports/libsercomm/portfile.cmake +40 -0
  3. third-party/DPVO/Pangolin/scripts/vcpkg/ports/libsercomm/vcpkg.json +29 -0
  4. third-party/DPVO/Pangolin/scripts/vcpkg/ports/libsigcpp-3/portfile.cmake +1 -0
  5. third-party/DPVO/Pangolin/scripts/vcpkg/ports/libsigcpp-3/vcpkg.json +10 -0
  6. third-party/DPVO/Pangolin/scripts/vcpkg/ports/libsigcpp/disable_tests_enable_static_build.patch +41 -0
  7. third-party/DPVO/Pangolin/scripts/vcpkg/ports/libsigcpp/fix-shared-windows-build.patch +17 -0
  8. third-party/DPVO/Pangolin/scripts/vcpkg/ports/libsigcpp/fix-usage-in-static-build.patch +29 -0
  9. third-party/DPVO/Pangolin/scripts/vcpkg/ports/libsigcpp/portfile.cmake +27 -0
  10. third-party/DPVO/Pangolin/scripts/vcpkg/ports/libsigcpp/vcpkg.json +16 -0
  11. third-party/DPVO/Pangolin/scripts/vcpkg/ports/libsigcpp/version.patch +17 -0
  12. third-party/DPVO/Pangolin/scripts/vcpkg/ports/libslirp/portfile.cmake +27 -0
  13. third-party/DPVO/Pangolin/scripts/vcpkg/ports/libslirp/vcpkg.json +16 -0
  14. third-party/DPVO/Pangolin/scripts/vcpkg/ports/libsmb2/portfile.cmake +26 -0
  15. third-party/DPVO/Pangolin/scripts/vcpkg/ports/libsmb2/vcpkg.json +15 -0
  16. third-party/DPVO/Pangolin/scripts/vcpkg/ports/libsndfile/fix-mp3lame.patch +73 -0
  17. third-party/DPVO/Pangolin/scripts/vcpkg/ports/libsndfile/fix-uwp.patch +14 -0
  18. third-party/DPVO/Pangolin/scripts/vcpkg/ports/libsndfile/portfile.cmake +58 -0
  19. third-party/DPVO/Pangolin/scripts/vcpkg/ports/libsndfile/vcpkg.json +50 -0
  20. third-party/DPVO/Pangolin/scripts/vcpkg/ports/libsnoretoast/include_fix.patch +28 -0
  21. third-party/DPVO/Pangolin/scripts/vcpkg/ports/libsnoretoast/portfile.cmake +28 -0
  22. third-party/DPVO/Pangolin/scripts/vcpkg/ports/libsnoretoast/vcpkg.json +18 -0
  23. third-party/DPVO/Pangolin/scripts/vcpkg/ports/libsodium/CMakeLists.txt +1152 -0
  24. third-party/DPVO/Pangolin/scripts/vcpkg/ports/libsodium/portfile.cmake +43 -0
  25. third-party/DPVO/Pangolin/scripts/vcpkg/ports/libsodium/sodiumConfig.cmake.in +7 -0
  26. third-party/DPVO/Pangolin/scripts/vcpkg/ports/libsodium/vcpkg.json +17 -0
  27. third-party/DPVO/Pangolin/scripts/vcpkg/ports/libsoundio/fix_cmakelists.patch +58 -0
  28. third-party/DPVO/Pangolin/scripts/vcpkg/ports/libsoundio/portfile.cmake +43 -0
  29. third-party/DPVO/Pangolin/scripts/vcpkg/ports/libsoundio/vcpkg.json +22 -0
  30. third-party/DPVO/Pangolin/scripts/vcpkg/ports/libspatialindex/portfile.cmake +26 -0
  31. third-party/DPVO/Pangolin/scripts/vcpkg/ports/libspatialindex/static.patch +77 -0
  32. third-party/DPVO/Pangolin/scripts/vcpkg/ports/libspatialindex/vcpkg.json +9 -0
  33. third-party/DPVO/Pangolin/scripts/vcpkg/ports/libspatialite/fix-linux-configure.patch +34 -0
  34. third-party/DPVO/Pangolin/scripts/vcpkg/ports/libspatialite/fix-makefiles.patch +44 -0
  35. third-party/DPVO/Pangolin/scripts/vcpkg/ports/libspatialite/gaiaconfig-msvc.patch +31 -0
  36. third-party/DPVO/Pangolin/scripts/vcpkg/ports/libspatialite/portfile.cmake +239 -0
  37. third-party/DPVO/Pangolin/scripts/vcpkg/ports/libspatialite/vcpkg.json +47 -0
  38. third-party/DPVO/Pangolin/scripts/vcpkg/ports/libspnav/portfile.cmake +43 -0
  39. third-party/DPVO/Pangolin/scripts/vcpkg/ports/libspnav/vcpkg.json +8 -0
  40. third-party/DPVO/Pangolin/scripts/vcpkg/ports/libsquish/export-target.patch +19 -0
  41. third-party/DPVO/Pangolin/scripts/vcpkg/ports/libsquish/fix-export-symbols.patch +105 -0
  42. third-party/DPVO/Pangolin/scripts/vcpkg/ports/libsquish/portfile.cmake +29 -0
  43. third-party/DPVO/Pangolin/scripts/vcpkg/ports/libsquish/vcpkg.json +24 -0
  44. third-party/DPVO/Pangolin/scripts/vcpkg/ports/libsrt/fix-dependency-install.patch +38 -0
  45. third-party/DPVO/Pangolin/scripts/vcpkg/ports/libsrt/portfile.cmake +39 -0
  46. third-party/DPVO/Pangolin/scripts/vcpkg/ports/libsrt/vcpkg.json +20 -0
  47. third-party/DPVO/Pangolin/scripts/vcpkg/ports/libsrtp/portfile.cmake +42 -0
  48. third-party/DPVO/Pangolin/scripts/vcpkg/ports/libsrtp/vcpkg.json +16 -0
  49. third-party/DPVO/Pangolin/scripts/vcpkg/ports/libssh/0001-export-pkgconfig-file.patch +43 -0
  50. third-party/DPVO/Pangolin/scripts/vcpkg/ports/libssh/0002-mingw_for_Android.patch +13 -0
third-party/DPVO/Pangolin/scripts/vcpkg/ports/libsecret/vcpkg.json ADDED
@@ -0,0 +1,21 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "name": "libsecret",
3
+ "version": "0.20.4",
4
+ "port-version": 1,
5
+ "description": "libsecret is a GObject-based library for accessing the Secret Service API of the freedesktop.org project, a cross-desktop effort to access passwords, tokens and other types of secrets. libsecret provides a convenient wrapper for these methods so consumers do not have to call the low-level DBus methods.",
6
+ "homepage": "https://gitlab.gnome.org/GNOME/libsecret/",
7
+ "license": "LGPL-2.1-or-later",
8
+ "supports": "!(windows | uwp | osx)",
9
+ "dependencies": [
10
+ "glib",
11
+ {
12
+ "name": "glib",
13
+ "host": true
14
+ },
15
+ "libgcrypt",
16
+ {
17
+ "name": "vcpkg-tool-meson",
18
+ "host": true
19
+ }
20
+ ]
21
+ }
third-party/DPVO/Pangolin/scripts/vcpkg/ports/libsercomm/portfile.cmake ADDED
@@ -0,0 +1,40 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ vcpkg_from_github(
2
+ OUT_SOURCE_PATH SOURCE_PATH
3
+ REPO ingeniamc/sercomm
4
+ REF 1.3.2
5
+ SHA512 f1581f2dfa262ffb1b3aec5a1e6d32493c322c94541fbacc98efff23b3b42b14c9abdcfb063a78b7c54fb1f9d8dbf59d8064099601de2175af6c6d830708324c
6
+ HEAD_REF master
7
+ )
8
+
9
+ vcpkg_check_features(
10
+ OUT_FEATURE_OPTIONS FEATURE_OPTIONS
11
+ FEATURES
12
+ errdesc WITH_ERRDESC
13
+ devmon WITH_DEVMON
14
+ )
15
+
16
+ vcpkg_cmake_configure(
17
+ SOURCE_PATH "${SOURCE_PATH}"
18
+ DISABLE_PARALLEL_CONFIGURE
19
+ OPTIONS
20
+ ${FEATURE_OPTIONS}
21
+ )
22
+
23
+ vcpkg_cmake_install()
24
+
25
+ # Fix CMake files
26
+ vcpkg_cmake_config_fixup(CONFIG_PATH lib/cmake/sercomm)
27
+
28
+ vcpkg_fixup_pkgconfig()
29
+
30
+ # Remove includes in debug
31
+ file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/include")
32
+ file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/share")
33
+ if(VCPKG_LIBRARY_LINKAGE STREQUAL "static")
34
+ file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/bin" "${CURRENT_PACKAGES_DIR}/debug/bin")
35
+ endif()
36
+ # Handle copyright
37
+ file(INSTALL "${SOURCE_PATH}/LICENSE" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}" RENAME copyright)
38
+
39
+ # Copy pdb files
40
+ vcpkg_copy_pdbs()
third-party/DPVO/Pangolin/scripts/vcpkg/ports/libsercomm/vcpkg.json ADDED
@@ -0,0 +1,29 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "name": "libsercomm",
3
+ "version": "1.3.2",
4
+ "description": "Multiplatform serial communications library",
5
+ "homepage": "https://github.com/ingeniamc/sercomm",
6
+ "license": "MIT",
7
+ "dependencies": [
8
+ {
9
+ "name": "vcpkg-cmake",
10
+ "host": true
11
+ },
12
+ {
13
+ "name": "vcpkg-cmake-config",
14
+ "host": true
15
+ }
16
+ ],
17
+ "default-features": [
18
+ "devmon",
19
+ "errdesc"
20
+ ],
21
+ "features": {
22
+ "devmon": {
23
+ "description": "When enabled, device listing and monitoring will be supported"
24
+ },
25
+ "errdesc": {
26
+ "description": "When enabled, error details description can be obtained"
27
+ }
28
+ }
29
+ }
third-party/DPVO/Pangolin/scripts/vcpkg/ports/libsigcpp-3/portfile.cmake ADDED
@@ -0,0 +1 @@
 
 
1
+ set(VCPKG_POLICY_EMPTY_PACKAGE enabled)
third-party/DPVO/Pangolin/scripts/vcpkg/ports/libsigcpp-3/vcpkg.json ADDED
@@ -0,0 +1,10 @@
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "name": "libsigcpp-3",
3
+ "version": "3.0.3",
4
+ "port-version": 1,
5
+ "description": "Typesafe callback framework for C++",
6
+ "homepage": "https://libsigcplusplus.github.io/libsigcplusplus/",
7
+ "dependencies": [
8
+ "libsigcpp"
9
+ ]
10
+ }
third-party/DPVO/Pangolin/scripts/vcpkg/ports/libsigcpp/disable_tests_enable_static_build.patch ADDED
@@ -0,0 +1,41 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ From 219b3f5a681731bcaeee9fee0f136e6eb6143d33 Mon Sep 17 00:00:00 2001
2
+ From: Bruk Tedla <[email protected]>
3
+ Date: Thu, 17 Sep 2020 19:45:27 +0300
4
+ Subject: [PATCH] disable_tests_enable_static_build
5
+
6
+ ---
7
+ CMakeLists.txt | 4 ++--
8
+ sigc++/CMakeLists.txt | 2 +-
9
+ 2 files changed, 3 insertions(+), 3 deletions(-)
10
+
11
+ diff --git a/CMakeLists.txt b/CMakeLists.txt
12
+ index 2e7f383..b2b8395 100644
13
+ --- a/CMakeLists.txt
14
+ +++ b/CMakeLists.txt
15
+ @@ -89,8 +89,8 @@ enable_testing()
16
+
17
+
18
+ add_subdirectory (sigc++)
19
+ -add_subdirectory (examples)
20
+ -add_subdirectory (tests)
21
+ +#add_subdirectory (examples)
22
+ +#add_subdirectory (tests)
23
+
24
+
25
+ set (PROJECT_CMAKE_NAME "${PROJECT_NAME}-3")
26
+ diff --git a/sigc++/CMakeLists.txt b/sigc++/CMakeLists.txt
27
+ index fa5a91a..86f1be7 100644
28
+ --- a/sigc++/CMakeLists.txt
29
+ +++ b/sigc++/CMakeLists.txt
30
+ @@ -23,7 +23,7 @@ set (SOURCE_FILES
31
+
32
+ set (SIGCPP_LIB_NAME sigc-${SIGCXX_API_VERSION})
33
+
34
+ -add_library(${SIGCPP_LIB_NAME} SHARED ${SOURCE_FILES})
35
+ +add_library(${SIGCPP_LIB_NAME} ${SOURCE_FILES})
36
+
37
+ set_property (TARGET ${SIGCPP_LIB_NAME} PROPERTY VERSION ${PACKAGE_VERSION})
38
+ set_property(TARGET ${SIGCPP_LIB_NAME} PROPERTY SOVERSION ${LIBSIGCPP_SOVERSION})
39
+ --
40
+ 2.27.0.windows.1
41
+
third-party/DPVO/Pangolin/scripts/vcpkg/ports/libsigcpp/fix-shared-windows-build.patch ADDED
@@ -0,0 +1,17 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ diff --git a/CMakeLists.txt b/CMakeLists.txt
2
+ --- a/CMakeLists.txt
3
+ +++ b/CMakeLists.txt
4
+ @@ -53,8 +53,11 @@ set (PROJECT_SOURCE_DIR "${sigc++_SOURCE_DIR}/sigc++")
5
+ include_directories (${sigc++_SOURCE_DIR})
6
+ include_directories (${sigc++_BINARY_DIR})
7
+
8
+ -if(BUILD_SHARED_LIBS)
9
+ - add_compile_options(-DBUILD_SHARED)
10
+ +if (BUILD_SHARED_LIBS)
11
+ + add_compile_options (-DBUILD_SHARED)
12
+ + if (MSVC)
13
+ + add_compile_options (-D_WINDLL)
14
+ + endif()
15
+ endif()
16
+
17
+ configure_file (sigc++config.h.cmake sigc++config.h)
third-party/DPVO/Pangolin/scripts/vcpkg/ports/libsigcpp/fix-usage-in-static-build.patch ADDED
@@ -0,0 +1,29 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ diff --git a/CMakeLists.txt b/CMakeLists.txt
2
+ index f54e830..972d0dc 100644
3
+ --- a/CMakeLists.txt
4
+ +++ b/CMakeLists.txt
5
+ @@ -53,6 +53,10 @@ set (PROJECT_SOURCE_DIR "${sigc++_SOURCE_DIR}/sigc++")
6
+ include_directories (${sigc++_SOURCE_DIR})
7
+ include_directories (${sigc++_BINARY_DIR})
8
+
9
+ +if(BUILD_SHARED_LIBS)
10
+ + add_compile_options(-DBUILD_SHARED)
11
+ +endif()
12
+ +
13
+ configure_file (sigc++config.h.cmake sigc++config.h)
14
+
15
+ set (prefix ${CMAKE_INSTALL_PREFIX})
16
+ diff --git a/sigc++config.h.cmake b/sigc++config.h.cmake
17
+ index 74d348a..43a99c5 100644
18
+ --- a/sigc++config.h.cmake
19
+ +++ b/sigc++config.h.cmake
20
+ @@ -16,7 +16,9 @@
21
+ # if defined(_MSC_VER)
22
+ # define SIGC_MSC 1
23
+ # define SIGC_WIN32 1
24
+ +# ifdef BUILD_SHARED
25
+ # define SIGC_DLL 1
26
+ +# endif
27
+ # elif defined(__CYGWIN__)
28
+ # define SIGC_CONFIGURE 1
29
+ # elif defined(__MINGW32__)
third-party/DPVO/Pangolin/scripts/vcpkg/ports/libsigcpp/portfile.cmake ADDED
@@ -0,0 +1,27 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ vcpkg_from_github(
2
+ OUT_SOURCE_PATH SOURCE_PATH
3
+ REPO libsigcplusplus/libsigcplusplus
4
+ REF 3.0.7
5
+ SHA512 4c9251613c30cc5d455dc30a039a12b73d6369ac03583dab382307b894f93d4733cebea0a6eef82e8d80b1354c812b4ff6bfc68913f0df5a61146d56a6afde13
6
+ HEAD_REF master
7
+ PATCHES
8
+ disable_tests_enable_static_build.patch
9
+ version.patch
10
+ fix-usage-in-static-build.patch
11
+ fix-shared-windows-build.patch
12
+ )
13
+
14
+ vcpkg_cmake_configure(
15
+ SOURCE_PATH "${SOURCE_PATH}"
16
+ )
17
+ vcpkg_cmake_install()
18
+ vcpkg_copy_pdbs()
19
+ vcpkg_fixup_pkgconfig()
20
+ vcpkg_cmake_config_fixup(PACKAGE_NAME sigc++-3 CONFIG_PATH lib/cmake/sigc++-3)
21
+
22
+ if(VCPKG_LIBRARY_LINKAGE STREQUAL "dynamic")
23
+ vcpkg_replace_string("${CURRENT_PACKAGES_DIR}/lib/sigc++-3.0/include/sigc++config.h" "ifdef BUILD_SHARED" "if 1")
24
+ endif()
25
+
26
+ file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/include")
27
+ file(INSTALL "${SOURCE_PATH}/COPYING" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}" RENAME copyright)
third-party/DPVO/Pangolin/scripts/vcpkg/ports/libsigcpp/vcpkg.json ADDED
@@ -0,0 +1,16 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "name": "libsigcpp",
3
+ "version": "3.0.7",
4
+ "description": "Typesafe callback framework for C++",
5
+ "homepage": "https://libsigcplusplus.github.io/libsigcplusplus/",
6
+ "dependencies": [
7
+ {
8
+ "name": "vcpkg-cmake",
9
+ "host": true
10
+ },
11
+ {
12
+ "name": "vcpkg-cmake-config",
13
+ "host": true
14
+ }
15
+ ]
16
+ }
third-party/DPVO/Pangolin/scripts/vcpkg/ports/libsigcpp/version.patch ADDED
@@ -0,0 +1,17 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ diff --git a/CMakeLists.txt b/CMakeLists.txt
2
+ index b06ef121c..9b9520342 100644
3
+ --- a/CMakeLists.txt
4
+ +++ b/CMakeLists.txt
5
+ @@ -16,9 +16,9 @@
6
+
7
+ cmake_minimum_required (VERSION 3.2)
8
+
9
+ -set (SIGCXX_MAJOR_VERSION 2)
10
+ -set (SIGCXX_MINOR_VERSION 99)
11
+ -set (SIGCXX_MICRO_VERSION 1)
12
+ +set (SIGCXX_MAJOR_VERSION 3)
13
+ +set (SIGCXX_MINOR_VERSION 0)
14
+ +set (SIGCXX_MICRO_VERSION 7)
15
+
16
+ set (SIGCXX_API_VERSION 3.0)
17
+ set (PACKAGE_VERSION ${SIGCXX_MAJOR_VERSION}.${SIGCXX_MINOR_VERSION}.${SIGCXX_MICRO_VERSION})
third-party/DPVO/Pangolin/scripts/vcpkg/ports/libslirp/portfile.cmake ADDED
@@ -0,0 +1,27 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ vcpkg_from_gitlab(
2
+ GITLAB_URL https://gitlab.freedesktop.org/
3
+ OUT_SOURCE_PATH SOURCE_PATH
4
+ REPO slirp/libslirp
5
+ REF v4.6.1
6
+ SHA512 04a9dd88cd58c849a24b9cff405d951952760d99ea2bef0b070463dff088d79f44557a13c9427ba0043f58d4b9e06b68ff64a4f23a7b0d66df594e32e1521cae
7
+ HEAD_REF master
8
+ )
9
+
10
+ if(VCPKG_HOST_IS_WINDOWS)
11
+ vcpkg_acquire_msys(MSYS_ROOT)
12
+ vcpkg_add_to_path("${MSYS_ROOT}/usr/bin")
13
+ endif()
14
+
15
+ vcpkg_configure_meson(
16
+ SOURCE_PATH "${SOURCE_PATH}"
17
+ OPTIONS
18
+ ${OPTIONS}
19
+ )
20
+
21
+ vcpkg_install_meson(ADD_BIN_TO_PATH)
22
+
23
+ vcpkg_fixup_pkgconfig()
24
+
25
+ vcpkg_copy_pdbs()
26
+
27
+ file(INSTALL "${SOURCE_PATH}/COPYRIGHT" DESTINATION "${CURRENT_PACKAGES_DIR}/share/libslirp" RENAME copyright)
third-party/DPVO/Pangolin/scripts/vcpkg/ports/libslirp/vcpkg.json ADDED
@@ -0,0 +1,16 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "name": "libslirp",
3
+ "version-semver": "4.6.1",
4
+ "port-version": 1,
5
+ "description": "libslirp is a user-mode networking library used by virtual machines, containers or various tools.",
6
+ "homepage": "https://gitlab.freedesktop.org/slirp/libslirp",
7
+ "license": "BSD-3-Clause",
8
+ "supports": "!windows | mingw",
9
+ "dependencies": [
10
+ "glib",
11
+ {
12
+ "name": "vcpkg-tool-meson",
13
+ "host": true
14
+ }
15
+ ]
16
+ }
third-party/DPVO/Pangolin/scripts/vcpkg/ports/libsmb2/portfile.cmake ADDED
@@ -0,0 +1,26 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ vcpkg_check_linkage(ONLY_STATIC_LIBRARY)
2
+
3
+ vcpkg_from_github(
4
+ OUT_SOURCE_PATH SOURCE_PATH
5
+ REPO sahlberg/libsmb2
6
+ REF d8c85a3119a0bd769590e448216130b368cd1099
7
+ SHA512 d15a040ed6314ad6f7984cfa7b52d9ede9934b2a7ec9827e833f574c25c9f694b5372b3e0950e258a6244b7aaf32b9e59987a75a88681d8031d9837ba94629d5
8
+ HEAD_REF master
9
+ )
10
+
11
+ vcpkg_configure_cmake(
12
+ SOURCE_PATH ${SOURCE_PATH}
13
+ PREFER_NINJA
14
+ )
15
+
16
+ vcpkg_install_cmake()
17
+ vcpkg_copy_pdbs()
18
+ vcpkg_cmake_config_fixup(CONFIG_PATH lib/cmake/${PORT})
19
+ vcpkg_fixup_pkgconfig()
20
+
21
+ file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/include")
22
+
23
+ #the debug/share folder is generated empty by the provided cmake system
24
+ file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/share")
25
+
26
+ file(INSTALL ${SOURCE_PATH}/COPYING DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright)
third-party/DPVO/Pangolin/scripts/vcpkg/ports/libsmb2/vcpkg.json ADDED
@@ -0,0 +1,15 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "name": "libsmb2",
3
+ "version-date": "2021-04-29",
4
+ "port-version": 1,
5
+ "description": "SMB2/3 Userspace Client",
6
+ "homepage": "https://github.com/sahlberg/libsmb2",
7
+ "supports": "!osx",
8
+ "dependencies": [
9
+ "openssl",
10
+ {
11
+ "name": "vcpkg-cmake-config",
12
+ "host": true
13
+ }
14
+ ]
15
+ }
third-party/DPVO/Pangolin/scripts/vcpkg/ports/libsndfile/fix-mp3lame.patch ADDED
@@ -0,0 +1,73 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ diff --git a/CMakeLists.txt b/CMakeLists.txt
2
+ index b1b49e9..ae8ebec 100644
3
+ --- a/CMakeLists.txt
4
+ +++ b/CMakeLists.txt
5
+ @@ -174,7 +174,7 @@ set_package_properties (FLAC PROPERTIES
6
+ DESCRIPTION "Free Lossless Audio Codec Library"
7
+ PURPOSE "Enables FLAC support"
8
+ )
9
+ -set_package_properties (Lame PROPERTIES
10
+ +set_package_properties (mp3lame PROPERTIES
11
+ TYPE RECOMMENDED
12
+ URL "https://lame.sourceforge.io/"
13
+ DESCRIPTION "High quality MPEG Audio Layer III (MP3) encoder"
14
+ @@ -237,20 +237,7 @@ if (INSTALL_PKGCONFIG_MODULE)
15
+ endif ()
16
+ if (ENABLE_MPEG)
17
+ set (EXTERNAL_MPEG_REQUIRE "libmpg123")
18
+ - get_filename_component(LAME_WE ${LAME_LIBRARY} NAME_WE)
19
+ - if (LAME_HIP_LIBRARY)
20
+ - get_filename_component(LAME_HIP_WE ${LAME_HIP_LIBRARY} NAME_WE)
21
+ - endif ()
22
+ - if (CMAKE_IMPORT_LIBRARY_PREFIX)
23
+ - string (REGEX REPLACE "^${CMAKE_IMPORT_LIBRARY_PREFIX}" "" LAME_WE_NO_PREFIX ${LAME_WE})
24
+ - if (LAME_HIP_LIBRARY)
25
+ - string (REGEX REPLACE "^${CMAKE_IMPORT_LIBRARY_PREFIX}" "" LAME_HIP_WE_NO_PREFIX ${LAME_HIP_WE})
26
+ - endif ()
27
+ - endif ()
28
+ - set (EXTERNAL_MPEG_LIBS "-l${LAME_WE_NO_PREFIX}")
29
+ - if (LAME_HIP_LIBRARY)
30
+ - set (EXTERNAL_MPEG_LIBS "${MPEG_LIBS} -l${LAME_HIP_WE}")
31
+ - endif ()
32
+ + set (EXTERNAL_MPEG_LIBS "-lmp3lame")
33
+ endif ()
34
+
35
+ configure_file (sndfile.pc.in sndfile.pc @ONLY)
36
+ @@ -411,7 +398,7 @@ target_link_libraries (sndfile
37
+ $<$<AND:$<BOOL:${ENABLE_EXPERIMENTAL}>,$<BOOL:${HAVE_EXTERNAL_XIPH_LIBS}>,$<BOOL:${HAVE_SPEEX}>>:Speex::Speex>
38
+ $<$<BOOL:${HAVE_EXTERNAL_XIPH_LIBS}>:Opus::opus>
39
+ $<$<BOOL:${HAVE_MPEG}>:MPG123::libmpg123>
40
+ - $<$<BOOL:${HAVE_MPEG}>:Lame::Lame>
41
+ + $<$<BOOL:${HAVE_MPEG}>:mp3lame::mp3lame>
42
+ )
43
+ set_target_properties (sndfile PROPERTIES
44
+ PUBLIC_HEADER "${sndfile_HDRS}"
45
+ diff --git a/cmake/SndFileChecks.cmake b/cmake/SndFileChecks.cmake
46
+ index f5d5994..2e09ba6 100644
47
+ --- a/cmake/SndFileChecks.cmake
48
+ +++ b/cmake/SndFileChecks.cmake
49
+ @@ -56,9 +56,9 @@ else ()
50
+ set (HAVE_EXTERNAL_XIPH_LIBS 0)
51
+ endif ()
52
+
53
+ -find_package (Lame)
54
+ +find_package (mp3lame)
55
+ find_package (Mpg123 1.25.10)
56
+ -if (LAME_FOUND AND (TARGET MPG123::libmpg123))
57
+ +if (TARGET mp3lame::mp3lame AND (TARGET MPG123::libmpg123))
58
+ set (HAVE_MPEG_LIBS 1)
59
+ else ()
60
+ set (HAVE_MPEG_LIBS 0)
61
+ diff --git a/cmake/SndFileConfig.cmake.in b/cmake/SndFileConfig.cmake.in
62
+ index 1d5463a..0c98e7e 100644
63
+ --- a/cmake/SndFileConfig.cmake.in
64
+ +++ b/cmake/SndFileConfig.cmake.in
65
+ @@ -18,7 +18,7 @@ if (SndFile_WITH_EXTERNAL_LIBS AND NOT @BUILD_SHARED_LIBS@)
66
+ endif ()
67
+
68
+ if (SndFile_WITH_MPEG AND NOT @BUILD_SHARED_LIBS@)
69
+ - find_dependency (Lame)
70
+ + find_dependency (mp3lame)
71
+ find_dependency (MPG123)
72
+ endif ()
73
+
third-party/DPVO/Pangolin/scripts/vcpkg/ports/libsndfile/fix-uwp.patch ADDED
@@ -0,0 +1,14 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ diff --git a/src/file_io.c b/src/file_io.c
2
+ index 334ba2a..90c9608 100644
3
+ --- a/src/file_io.c
4
+ +++ b/src/file_io.c
5
+ @@ -827,9 +827,6 @@ psf_open_handle (PSF_FILE * pfile)
6
+ } ;
7
+
8
+ #if defined (WINAPI_FAMILY_PARTITION) && !WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP | WINAPI_PARTITION_SYSTEM)
9
+ - if (!pfile->use_wchar)
10
+ - return INVALID_HANDLE_VALUE ;
11
+ -
12
+ CREATEFILE2_EXTENDED_PARAMETERS cfParams = { 0 } ;
13
+ cfParams.dwSize = sizeof (CREATEFILE2_EXTENDED_PARAMETERS) ;
14
+ cfParams.dwFileAttributes = FILE_ATTRIBUTE_NORMAL ;
third-party/DPVO/Pangolin/scripts/vcpkg/ports/libsndfile/portfile.cmake ADDED
@@ -0,0 +1,58 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ vcpkg_from_github(
2
+ OUT_SOURCE_PATH SOURCE_PATH
3
+ REPO libsndfile/libsndfile
4
+ REF 1.1.0
5
+ SHA512 5e530c33165a2d2be1c22d3a4bd96f0f1817dded3a45d24bad0e3f2c7908ccc1f19327a91d5040c3ea4d591845876019180747a125bf2a6f8bd49a6f67eadacd
6
+ HEAD_REF master
7
+ PATCHES
8
+ fix-mp3lame.patch
9
+ fix-uwp.patch
10
+ )
11
+
12
+ if(VCPKG_LIBRARY_LINKAGE STREQUAL dynamic)
13
+ vcpkg_find_acquire_program(PYTHON3)
14
+ endif()
15
+
16
+ vcpkg_check_features(OUT_FEATURE_OPTIONS FEATURE_OPTIONS
17
+ FEATURES
18
+ external-libs ENABLE_EXTERNAL_LIBS
19
+ mpeg ENABLE_MPEG
20
+ regtest BUILD_REGTEST
21
+ )
22
+
23
+ if(VCPKG_TARGET_IS_UWP)
24
+ set(VCPKG_C_FLAGS "/sdl- ${VCPKG_C_FLAGS}")
25
+ set(VCPKG_CXX_FLAGS "/sdl- ${VCPKG_CXX_FLAGS}")
26
+ endif()
27
+
28
+ vcpkg_cmake_configure(
29
+ SOURCE_PATH ${SOURCE_PATH}
30
+ OPTIONS
31
+ -DBUILD_EXAMPLES=OFF
32
+ -DBUILD_TESTING=OFF
33
+ -DENABLE_BOW_DOCS=OFF
34
+ -DBUILD_PROGRAMS=OFF
35
+ -DBUILD_REGTEST=OFF
36
+ -DCMAKE_FIND_PACKAGE_PREFER_CONFIG=ON
37
+ -DPYTHON_EXECUTABLE=${PYTHON3}
38
+ ${FEATURE_OPTIONS}
39
+ )
40
+
41
+ vcpkg_cmake_install()
42
+
43
+ if(WIN32 AND (NOT MINGW) AND (NOT CYGWIN))
44
+ set(CONFIG_PATH cmake)
45
+ else()
46
+ set(CONFIG_PATH lib/cmake/SndFile)
47
+ endif()
48
+
49
+ vcpkg_cmake_config_fixup(PACKAGE_NAME SndFile CONFIG_PATH ${CONFIG_PATH})
50
+ vcpkg_fixup_pkgconfig(SYSTEM_LIBRARIES m)
51
+
52
+ vcpkg_copy_pdbs()
53
+
54
+ file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/share)
55
+ file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include)
56
+
57
+ # Handle copyright
58
+ file(INSTALL ${SOURCE_PATH}/COPYING DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright)
third-party/DPVO/Pangolin/scripts/vcpkg/ports/libsndfile/vcpkg.json ADDED
@@ -0,0 +1,50 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "name": "libsndfile",
3
+ "version-semver": "1.1.0",
4
+ "description": "A library for reading and writing audio files",
5
+ "homepage": "https://github.com/erikd/libsndfile",
6
+ "license": "LGPL-2.1",
7
+ "dependencies": [
8
+ {
9
+ "name": "vcpkg-cmake",
10
+ "host": true
11
+ },
12
+ {
13
+ "name": "vcpkg-cmake-config",
14
+ "host": true
15
+ }
16
+ ],
17
+ "default-features": [
18
+ "external-libs",
19
+ "mpeg"
20
+ ],
21
+ "features": {
22
+ "experimental": {
23
+ "description": "Enable experimental code",
24
+ "dependencies": [
25
+ "speex"
26
+ ]
27
+ },
28
+ "external-libs": {
29
+ "description": "Enable FLAC, Vorbis, and Opus codecs",
30
+ "dependencies": [
31
+ "libflac",
32
+ "libvorbis",
33
+ "opus"
34
+ ]
35
+ },
36
+ "mpeg": {
37
+ "description": "Enable MPEG codecs",
38
+ "dependencies": [
39
+ "mp3lame",
40
+ "mpg123"
41
+ ]
42
+ },
43
+ "regtest": {
44
+ "description": "Build regtest",
45
+ "dependencies": [
46
+ "sqlite3"
47
+ ]
48
+ }
49
+ }
50
+ }
third-party/DPVO/Pangolin/scripts/vcpkg/ports/libsnoretoast/include_fix.patch ADDED
@@ -0,0 +1,28 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ From 7564823f8f0bc4d647bf3470ab7a2d8612418f32 Mon Sep 17 00:00:00 2001
2
+ From: =?UTF-8?q?Dawid=20Wr=C3=B3bel?= <[email protected]>
3
+ Date: Fri, 17 Sep 2021 12:30:41 +0000
4
+ Subject: [PATCH] Use relative INTERFACE_INCLUDE location
5
+
6
+ Using ${CMAKE_INSTALL_PREFIX} hardcodes the installation location,
7
+ instead of having CMake
8
+ use ${_IMPORT_PREFIX}
9
+ ---
10
+ src/CMakeLists.txt | 2 +-
11
+ 1 file changed, 1 insertion(+), 1 deletion(-)
12
+
13
+ diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
14
+ index eef57f7..6c35b71 100644
15
+ --- a/src/CMakeLists.txt
16
+ +++ b/src/CMakeLists.txt
17
+ @@ -1,7 +1,7 @@
18
+ add_library(SnoreToastActions INTERFACE)
19
+ target_include_directories(SnoreToastActions INTERFACE
20
+ $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}>
21
+ - $<INSTALL_INTERFACE:${CMAKE_INSTALL_PREFIX}/include/snoretoast>
22
+ + $<INSTALL_INTERFACE:include/snoretoast>
23
+ )
24
+ add_library(SnoreToast::SnoreToastActions ALIAS SnoreToastActions)
25
+
26
+ --
27
+ GitLab
28
+
third-party/DPVO/Pangolin/scripts/vcpkg/ports/libsnoretoast/portfile.cmake ADDED
@@ -0,0 +1,28 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ vcpkg_from_github(
2
+ OUT_SOURCE_PATH SOURCE_PATH
3
+ REPO KDE/snoretoast
4
+ REF v0.8.0
5
+ SHA512 233751b6cc3f8099c742e4412a3c9ba8707a2f3c69b57bab93dd83b028aa0c0656cade8de1ece563843ace576fd0d8e5f3a29c254a07ed939d0a69cd2d4f6c2a
6
+ HEAD_REF master
7
+ PATCHES
8
+ include_fix.patch # https://invent.kde.org/libraries/snoretoast/-/merge_requests/1
9
+ )
10
+
11
+ vcpkg_cmake_configure(
12
+ SOURCE_PATH "${SOURCE_PATH}"
13
+ OPTIONS
14
+ -DBUILD_EXAMPLES=OFF
15
+ -DBUILD_STATIC_RUNTIME=OFF
16
+ )
17
+
18
+ vcpkg_cmake_install()
19
+ vcpkg_cmake_config_fixup(PACKAGE_NAME LibSnoreToast CONFIG_PATH "lib/cmake/libsnoretoast")
20
+ vcpkg_copy_tools(
21
+ TOOL_NAMES "snoretoast"
22
+ AUTO_CLEAN
23
+ )
24
+
25
+ file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/etc")
26
+ file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug")
27
+ file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/lib")
28
+ file(INSTALL "${SOURCE_PATH}/COPYING.LGPL-3" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}" RENAME copyright)
third-party/DPVO/Pangolin/scripts/vcpkg/ports/libsnoretoast/vcpkg.json ADDED
@@ -0,0 +1,18 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "name": "libsnoretoast",
3
+ "version": "0.8.0",
4
+ "port-version": 2,
5
+ "description": "A tool to create Windows Toast notifications and parse them on Windows 8 or later.",
6
+ "homepage": "https://invent.kde.org/libraries/snoretoast",
7
+ "supports": "windows & !uwp",
8
+ "dependencies": [
9
+ {
10
+ "name": "vcpkg-cmake",
11
+ "host": true
12
+ },
13
+ {
14
+ "name": "vcpkg-cmake-config",
15
+ "host": true
16
+ }
17
+ ]
18
+ }
third-party/DPVO/Pangolin/scripts/vcpkg/ports/libsodium/CMakeLists.txt ADDED
@@ -0,0 +1,1152 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ cmake_minimum_required(VERSION 3.9)
2
+
3
+ include(CheckCSourceRuns)
4
+
5
+ file(STRINGS ${CMAKE_CURRENT_LIST_DIR}/configure.ac config_ac_contents)
6
+
7
+ foreach (line ${config_ac_contents})
8
+ if (line MATCHES "AC_INIT\\(\\[libsodium\\],\\[([0-9.]+)\\],")
9
+ set(VERSION ${CMAKE_MATCH_1})
10
+ elseif (line MATCHES "SODIUM_LIBRARY_VERSION_(MAJOR|MINOR)=([0-9]+)")
11
+ set(SODIUM_LIBRARY_VERSION_${CMAKE_MATCH_1} ${CMAKE_MATCH_2})
12
+ endif ()
13
+ endforeach ()
14
+
15
+ message("VERSION: ${VERSION}")
16
+ message("SODIUM_LIBRARY_VERSION_MAJOR: ${SODIUM_LIBRARY_VERSION_MAJOR}")
17
+ message("SODIUM_LIBRARY_VERSION_MINOR: ${SODIUM_LIBRARY_VERSION_MINOR}")
18
+
19
+ project(sodium VERSION ${VERSION} LANGUAGES C ASM)
20
+
21
+ include(CheckCSourceCompiles)
22
+ include(CheckFunctionExists)
23
+ include(CheckIncludeFile)
24
+ include(CMakePackageConfigHelpers)
25
+ include(CTest)
26
+ include(GNUInstallDirs)
27
+ include(TestBigEndian)
28
+
29
+ set(CMAKE_C_STANDARD 99)
30
+ set(CMAKE_INSTALL_RPATH_USE_LINK_PATH TRUE)
31
+ set(CMAKE_DISABLE_SOURCE_CHANGES ON)
32
+ set(CMAKE_DISABLE_IN_SOURCE_BUILD ON)
33
+
34
+ option(BUILD_SHARED_LIBS "Build shared library" ${BUILD_SHARED_LIBS})
35
+ option(ENABLE_SSP "Compile with -fstack-protector" ON)
36
+ option(ENABLE_PIE "Compile with -fPIE" ON)
37
+ option(ENABLE_BLOCKING_RANDOM "Enable blocking random" OFF)
38
+ option(ENABLE_MINIMAL "Only compile the minimum set of functions required for the high-level API" OFF)
39
+ option(ENABLE_PTHREADS "Use pthreads library" ON)
40
+ option(ENABLE_RETPOLINE "Use return trampolines for indirect calls" OFF)
41
+ option(ENABLE_NATIVE_OPTIMIZATIONS "Optimize for the native CPU - The resulting library will be faster but not portable" OFF)
42
+
43
+ if (ENABLE_MINIMAL)
44
+ set(SODIUM_LIBRARY_MINIMAL_DEF "#define SODIUM_LIBRARY_MINIMAL 1")
45
+ endif ()
46
+
47
+ configure_file(
48
+ src/libsodium/include/sodium/version.h.in
49
+ ${CMAKE_BINARY_DIR}/sodium/version.h
50
+ )
51
+
52
+ add_library(${PROJECT_NAME})
53
+
54
+ set_target_properties(${PROJECT_NAME}
55
+ PROPERTIES
56
+ PREFIX ""
57
+ OUTPUT_NAME "lib${PROJECT_NAME}"
58
+ )
59
+
60
+ if (MSVC)
61
+
62
+ target_include_directories(${PROJECT_NAME}
63
+ PRIVATE
64
+ $<BUILD_INTERFACE:${PROJECT_SOURCE_DIR}/src/libsodium/include/sodium>
65
+ $<BUILD_INTERFACE:${CMAKE_BINARY_DIR}/sodium>
66
+ )
67
+
68
+ enable_language(RC)
69
+
70
+ # see libsodium.vcxproj for reference
71
+ # - omitted "<ClInclude Include="src\libsodium\include\sodium\version.h" />" in favour of "${CMAKE_BINARY_DIR}/sodium/version.h"
72
+ file(GLOB_RECURSE sodium_headers
73
+ ${CMAKE_BINARY_DIR}/sodium/version.h
74
+ ${PROJECT_SOURCE_DIR}/builds/msvc/resource.h
75
+ ${PROJECT_SOURCE_DIR}/src/libsodium/*.h
76
+ )
77
+
78
+ file(GLOB_RECURSE sodium_sources
79
+ ${PROJECT_SOURCE_DIR}/builds/msvc/resource.rc
80
+ ${PROJECT_SOURCE_DIR}/src/libsodium/*.c
81
+ )
82
+
83
+ target_sources(${PROJECT_NAME}
84
+ PRIVATE
85
+ ${sodium_headers}
86
+ ${sodium_sources}
87
+ )
88
+
89
+ target_compile_options(${PROJECT_NAME}
90
+ PRIVATE
91
+ /D_CONSOLE
92
+ /D_CRT_SECURE_NO_WARNINGS
93
+ /DCPU_UNALIGNED_ACCESS=1
94
+ /MP
95
+ /Dinline=__inline
96
+ /wd4068 # Unknown pragma
97
+ /wd4197
98
+ /wd4244 # Macro redefinition
99
+ )
100
+
101
+ target_link_libraries(${PROJECT_NAME}
102
+ PUBLIC
103
+ advapi32
104
+ )
105
+
106
+ else ()
107
+
108
+ # use interface libs to track common flags and definitions across all targets
109
+ add_library(${PROJECT_NAME}_config_private INTERFACE)
110
+ add_library(${PROJECT_NAME}_config_public INTERFACE)
111
+
112
+ # use interface libs to track special flags only required for certain objects
113
+ add_library(${PROJECT_NAME}_aesni_config INTERFACE)
114
+ add_library(${PROJECT_NAME}_avx_config INTERFACE)
115
+ add_library(${PROJECT_NAME}_avx2_config INTERFACE)
116
+ add_library(${PROJECT_NAME}_avx512f_config INTERFACE)
117
+ add_library(${PROJECT_NAME}_mmx_config INTERFACE)
118
+ add_library(${PROJECT_NAME}_pclmul_config INTERFACE)
119
+ add_library(${PROJECT_NAME}_rdrand_config INTERFACE)
120
+ add_library(${PROJECT_NAME}_sse2_config INTERFACE)
121
+ add_library(${PROJECT_NAME}_sse3_config INTERFACE)
122
+ add_library(${PROJECT_NAME}_sse41_config INTERFACE)
123
+ add_library(${PROJECT_NAME}_ssse3_config INTERFACE)
124
+
125
+ target_include_directories(${PROJECT_NAME}_config_private
126
+ INTERFACE
127
+ $<BUILD_INTERFACE:${PROJECT_SOURCE_DIR}/src/libsodium/include/sodium>
128
+ $<BUILD_INTERFACE:${CMAKE_BINARY_DIR}/sodium>
129
+ )
130
+
131
+ target_compile_options(${PROJECT_NAME}_config_private
132
+ INTERFACE
133
+ -flax-vector-conversions
134
+ -fvisibility=hidden
135
+ -fwrapv
136
+ -Wall
137
+ -Wextra
138
+ -Wbad-function-cast
139
+ -Wcast-qual
140
+ #-Wdiv-by-zero
141
+ #-Wduplicated-branches
142
+ #-Wduplicated-cond
143
+ -Wfloat-equal
144
+ -Wformat=2
145
+ -Wlogical-op
146
+ -Wmaybe-uninitialized
147
+ #-Wmisleading-indentation
148
+ -Wmissing-declarations
149
+ -Wmissing-prototypes
150
+ -Wnested-externs
151
+ #-Wno-type-limits
152
+ #-Wno-unknown-pragmas
153
+ -Wnormalized=id
154
+ #-Wnull-dereference
155
+ -Wold-style-declaration
156
+ -Wpointer-arith
157
+ -Wredundant-decls
158
+ #-Wrestrict
159
+ #-Wsometimes-uninitialized
160
+ -Wstrict-prototypes
161
+ -Wswitch-enum
162
+ #-Wvariable-decl
163
+ -Wwrite-strings
164
+ )
165
+
166
+ if (NOT MINGW)
167
+ target_compile_options(${PROJECT_NAME}_config_private
168
+ INTERFACE
169
+ -fPIC
170
+ -Wl,-z,relro
171
+ -Wl,-z,now
172
+ -Wl,-z,noexecstack
173
+ )
174
+ endif()
175
+
176
+ if (MINGW)
177
+ target_compile_options(${PROJECT_NAME}_config_private
178
+ INTERFACE
179
+ -fno-asynchronous-unwind-tables
180
+ )
181
+ target_link_options(${PROJECT_NAME}_config_private
182
+ INTERFACE
183
+ -Wl,--dynamicbase
184
+ -Wl,--high-entropy-va
185
+ -Wl,--nxcompat
186
+ )
187
+ endif()
188
+
189
+ if (CMAKE_C_COMPILER_ID STREQUAL "Clang" OR
190
+ CMAKE_C_COMPILER_ID STREQUAL "AppleClang")
191
+ target_compile_options(${PROJECT_NAME}_config_private
192
+ INTERFACE
193
+ -Wno-unknown-warning-option
194
+ -Wshorten-64-to-32
195
+ )
196
+ endif ()
197
+
198
+ # see configure.ac for reference
199
+ if (ENABLE_BLOCKING_RANDOM)
200
+ target_compile_definitions(${PROJECT_NAME}_config_private INTERFACE USE_BLOCKING_RANDOM)
201
+ endif ()
202
+
203
+ if (ENABLE_PTHREADS)
204
+ target_compile_definitions(${PROJECT_NAME}_config_private INTERFACE HAVE_PTHREAD)
205
+ target_compile_options(${PROJECT_NAME}_config_private INTERFACE -ftls-model=local-dynamic)
206
+ target_compile_options(${PROJECT_NAME}_config_public INTERFACE -pthread)
207
+ endif ()
208
+
209
+ if (ENABLE_SSP AND NOT MINGW)
210
+ target_compile_options(${PROJECT_NAME}_config_private INTERFACE -fstack-protector-all)
211
+ endif ()
212
+
213
+ if (ENABLE_PIE AND NOT MINGW)
214
+ target_compile_options(${PROJECT_NAME}_config_private INTERFACE -fPIE)
215
+ endif ()
216
+
217
+ if (ENABLE_RETPOLINE)
218
+ target_compile_options(${PROJECT_NAME}_config_private
219
+ INTERFACE
220
+ -mindirect-branch=thunk-inline
221
+ -mindirect-branch-register
222
+ )
223
+ endif ()
224
+
225
+ if (ENABLE_NATIVE_OPTIMIZATIONS)
226
+ target_compile_options(${PROJECT_NAME}_config_private
227
+ INTERFACE
228
+ -ftree-vectorize
229
+ -ftree-slp-vectorize
230
+ -fomit-frame-pointer
231
+ -march=native
232
+ )
233
+ endif ()
234
+
235
+ check_include_file(sys/mman.h HAVE_SYS_MMAN_H)
236
+ if (HAVE_SYS_MMAN_H)
237
+ target_compile_definitions(${PROJECT_NAME}_config_private INTERFACE HAVE_SYS_MMAN_H)
238
+ endif ()
239
+
240
+ macro (sodium_check_func func var)
241
+ check_function_exists(${func} ${var})
242
+ if (${var})
243
+ target_compile_definitions(${PROJECT_NAME}_config_private INTERFACE ${var}=1)
244
+ endif ()
245
+ endmacro ()
246
+
247
+ sodium_check_func(arc4random HAVE_SAFE_ARC4RANDOM)
248
+ sodium_check_func(mmap HAVE_MMAP)
249
+ sodium_check_func(mlock HAVE_MLOCK)
250
+ sodium_check_func(madvise HAVE_MADVISE)
251
+ sodium_check_func(mprotect HAVE_MPROTECT)
252
+ sodium_check_func(memset_s HAVE_MEMSET_S)
253
+ sodium_check_func(explicit_bzero HAVE_EXPLICIT_BZERO)
254
+ sodium_check_func(explicit_memset HAVE_EXPLICIT_MEMSET)
255
+ sodium_check_func(nanosleep HAVE_NANOSLEEP)
256
+ sodium_check_func(posix_memalign HAVE_POSIX_MEMALIGN)
257
+ sodium_check_func(getpid HAVE_GETPID)
258
+
259
+ if (VCPKG_TARGET_ARCHITECTURE STREQUAL x64)
260
+ check_c_source_compiles(
261
+ "
262
+ #pragma GCC target(\"mmx\")
263
+ #include <mmintrin.h>
264
+ int main(void)
265
+ {
266
+ __m64 x = _mm_setzero_si64();
267
+ }
268
+ "
269
+ HAVE_MMINTRIN_H
270
+ )
271
+
272
+ if (HAVE_MMINTRIN_H)
273
+ target_compile_definitions(${PROJECT_NAME}_config_private INTERFACE HAVE_MMINTRIN_H=1)
274
+ target_compile_options(${PROJECT_NAME}_mmx_config INTERFACE -mmmx)
275
+ endif ()
276
+
277
+ check_c_source_compiles(
278
+ "
279
+ #pragma GCC target(\"sse2\")
280
+ #ifndef __SSE2__
281
+ # define __SSE2__
282
+ #endif
283
+
284
+ #include <emmintrin.h>
285
+ int main(void) {
286
+ __m128d x = _mm_setzero_pd();
287
+ __m128i z = _mm_srli_epi64(_mm_setzero_si128(), 26);
288
+ }
289
+ "
290
+ HAVE_EMMINTRIN_H
291
+ )
292
+
293
+ if (HAVE_EMMINTRIN_H)
294
+ target_compile_definitions(${PROJECT_NAME}_config_private INTERFACE HAVE_EMMINTRIN_H=1)
295
+ target_compile_options(${PROJECT_NAME}_sse2_config INTERFACE -msse2)
296
+ endif ()
297
+
298
+ check_c_source_compiles(
299
+ "
300
+ #pragma GCC target(\"sse3\")
301
+ #include <pmmintrin.h>
302
+ int main(void) {
303
+ __m128 x = _mm_addsub_ps(_mm_cvtpd_ps(_mm_setzero_pd()), _mm_cvtpd_ps(_mm_setzero_pd()));
304
+ }
305
+ "
306
+ HAVE_PMMINTRIN_H
307
+ )
308
+
309
+ if (HAVE_PMMINTRIN_H)
310
+ target_compile_definitions(${PROJECT_NAME}_config_private INTERFACE HAVE_PMMINTRIN_H=1)
311
+ target_compile_options(${PROJECT_NAME}_sse3_config INTERFACE -msse3)
312
+ endif ()
313
+
314
+ check_c_source_compiles(
315
+ "
316
+ #pragma GCC target(\"ssse3\")
317
+ #include <tmmintrin.h>
318
+ int main(void) {
319
+ __m64 x = _mm_abs_pi32(_m_from_int(0));
320
+ }
321
+ "
322
+ HAVE_TMMINTRIN_H
323
+ )
324
+
325
+ if (HAVE_TMMINTRIN_H)
326
+ target_compile_definitions(${PROJECT_NAME}_config_private INTERFACE HAVE_TMMINTRIN_H=1)
327
+ target_compile_options(${PROJECT_NAME}_ssse3_config INTERFACE -mssse3)
328
+ endif ()
329
+
330
+ check_c_source_compiles(
331
+ "
332
+ #pragma GCC target(\"sse4.1\")
333
+ #include <smmintrin.h>
334
+ int main(void) {
335
+ __m128i x = _mm_minpos_epu16(_mm_setzero_si128());
336
+ }
337
+ "
338
+ HAVE_SMMINTRIN_H
339
+ )
340
+
341
+ if (HAVE_SMMINTRIN_H)
342
+ target_compile_definitions(${PROJECT_NAME}_config_private INTERFACE HAVE_SMMINTRIN_H=1)
343
+ target_compile_options(${PROJECT_NAME}_sse41_config INTERFACE -msse4.1)
344
+ endif ()
345
+
346
+ check_c_source_compiles(
347
+ "
348
+ #ifdef __native_client__
349
+ # error NativeClient detected - Avoiding AVX opcodes
350
+ #endif
351
+ #pragma GCC target(\"avx\")
352
+ #include <immintrin.h>
353
+ int main(void) {
354
+ _mm256_zeroall();
355
+ }
356
+ "
357
+ HAVE_AVXINTRIN_H
358
+ )
359
+
360
+ if (HAVE_AVXINTRIN_H)
361
+ target_compile_definitions(${PROJECT_NAME}_config_private INTERFACE HAVE_AVXINTRIN_H=1)
362
+ target_compile_options(${PROJECT_NAME}_avx_config INTERFACE -mavx)
363
+ endif ()
364
+
365
+ check_c_source_compiles(
366
+ "
367
+ #ifdef __native_client__
368
+ # error NativeClient detected - Avoiding AVX2 opcodes
369
+ #endif
370
+ #pragma GCC target(\"avx2\")
371
+ #include <immintrin.h>
372
+ int main(void) {
373
+ __m256 x = _mm256_set1_ps(3.14);
374
+ __m256 y = _mm256_permutevar8x32_ps(x, _mm256_set1_epi32(42));
375
+ return _mm256_movemask_ps(_mm256_cmp_ps(x, y, _CMP_NEQ_OQ));
376
+ }
377
+ "
378
+ HAVE_AVX2INTRIN_H
379
+ )
380
+
381
+ if (HAVE_AVX2INTRIN_H)
382
+ target_compile_definitions(${PROJECT_NAME}_config_private INTERFACE HAVE_AVX2INTRIN_H=1)
383
+ target_compile_options(${PROJECT_NAME}_avx2_config INTERFACE -mavx2)
384
+
385
+ check_c_source_compiles(
386
+ "
387
+ #ifdef __native_client__
388
+ # error NativeClient detected - Avoiding AVX2 opcodes
389
+ #endif
390
+ #pragma GCC target(\"avx2\")
391
+ #include <immintrin.h>
392
+ int main(void) {
393
+ __m256i y = _mm256_broadcastsi128_si256(_mm_setzero_si128());
394
+ }
395
+ "
396
+ _mm256_broadcastsi128_si256_DEFINED
397
+ )
398
+
399
+ if (NOT _mm256_broadcastsi128_si256_DEFINED)
400
+ target_compile_definitions(${PROJECT_NAME}_config_private
401
+ INTERFACE
402
+ _mm256_broadcastsi128_si256=_mm_broadcastsi128_si256
403
+ )
404
+ endif ()
405
+ endif ()
406
+
407
+ check_c_source_compiles(
408
+ "
409
+ #ifdef __native_client__
410
+ # error NativeClient detected - Avoiding AVX512F opcodes
411
+ #endif
412
+ #pragma GCC target(\"avx512f\")
413
+ #include <immintrin.h>
414
+
415
+ #ifndef __AVX512F__
416
+ # error No AVX512 support
417
+ #elif defined(__clang__)
418
+ # if __clang_major__ < 4
419
+ # error Compiler AVX512 support may be broken
420
+ # endif
421
+ #elif defined(__GNUC__)
422
+ # if __GNUC__ < 6
423
+ # error Compiler AVX512 support may be broken
424
+ # endif
425
+ #endif
426
+
427
+ int main(void) {
428
+ __m512i x = _mm512_setzero_epi32();
429
+ __m512i y = _mm512_permutexvar_epi64(_mm512_setr_epi64(0, 1, 4, 5, 2, 3, 6, 7), x);
430
+ }
431
+ "
432
+ HAVE_AVX512FINTRIN_H
433
+ )
434
+
435
+ if (HAVE_AVX512FINTRIN_H)
436
+ target_compile_definitions(${PROJECT_NAME}_config_private INTERFACE HAVE_AVX512FINTRIN_H=1)
437
+ target_compile_options(${PROJECT_NAME}_avx512f_config INTERFACE -mavx512f)
438
+ endif ()
439
+
440
+ check_c_source_compiles(
441
+ "
442
+ #ifdef __native_client__
443
+ # error NativeClient detected - Avoiding AESNI opcodes
444
+ #endif
445
+ #pragma GCC target(\"aes\")
446
+ #pragma GCC target(\"pclmul\")
447
+ #include <wmmintrin.h>
448
+
449
+ int main(void) {
450
+ __m128i x = _mm_aesimc_si128(_mm_setzero_si128());
451
+ __m128i y = _mm_clmulepi64_si128(_mm_setzero_si128(), _mm_setzero_si128(), 0);
452
+ }
453
+ "
454
+ HAVE_WMMINTRIN_H
455
+ )
456
+
457
+ if (HAVE_WMMINTRIN_H)
458
+ target_compile_definitions(${PROJECT_NAME}_config_private INTERFACE HAVE_WMMINTRIN_H=1)
459
+ target_compile_options(${PROJECT_NAME}_aesni_config INTERFACE -maes)
460
+ target_compile_options(${PROJECT_NAME}_pclmul_config INTERFACE -mpclmul)
461
+ endif ()
462
+
463
+ check_c_source_compiles(
464
+ "
465
+ #ifdef __native_client__
466
+ # error NativeClient detected - Avoiding RDRAND opcodes
467
+ #endif
468
+ #pragma GCC target(\"rdrnd\")
469
+ #include <immintrin.h>
470
+
471
+ int main(void) {
472
+ unsigned long long x;
473
+ _rdrand64_step(&x);
474
+ }
475
+ "
476
+ HAVE_RDRAND
477
+ )
478
+
479
+ if (HAVE_RDRAND)
480
+ target_compile_definitions(${PROJECT_NAME}_config_private INTERFACE HAVE_RDRAND=1)
481
+ target_compile_options(${PROJECT_NAME}_rdrand_config INTERFACE -mrdrnd)
482
+ endif ()
483
+
484
+ check_c_source_compiles(
485
+ "
486
+ #include <intrin.h>
487
+
488
+ int main(void) {
489
+ (void) _xgetbv(0);
490
+ }
491
+ "
492
+ HAVE__XGETBV
493
+ )
494
+
495
+ if (HAVE__XGETBV)
496
+ target_compile_definitions(${PROJECT_NAME}_config_private INTERFACE HAVE__XGETBV=1)
497
+ endif ()
498
+
499
+ check_c_source_compiles(
500
+ "
501
+ int main(void) {
502
+ int a = 42;
503
+ int *pnt = &a;
504
+ __asm__ __volatile__ (\"\" : : \"r\"(pnt) : \"memory\");
505
+ }
506
+ "
507
+ HAVE_INLINE_ASM
508
+ )
509
+
510
+ if (HAVE_INLINE_ASM)
511
+ target_compile_definitions(${PROJECT_NAME}_config_private INTERFACE HAVE_INLINE_ASM=1)
512
+ endif ()
513
+
514
+ check_c_source_compiles(
515
+ "
516
+ int main(void) {
517
+ #if defined(__amd64) || defined(__amd64__) || defined(__x86_64__)
518
+ # if defined(__CYGWIN__) || defined(__MINGW32__) || defined(__MINGW64__) || defined(_WIN32) || defined(_WIN64)
519
+ # error Windows x86_64 calling conventions are not supported yet
520
+ # endif
521
+ /* neat */
522
+ #else
523
+ # error !x86_64
524
+ #endif
525
+ unsigned char i = 0, o = 0, t;
526
+ __asm__ __volatile__ (\"pxor %%xmm12, %%xmm6 \n\"
527
+ \"movb (%[i]), %[t] \n\"
528
+ \"addb %[t], (%[o]) \n\"
529
+ : [t] \"=&r\"(t)
530
+ : [o] \"D\"(&o), [i] \"S\"(&i)
531
+ : \"memory\", \"flags\", \"cc\");
532
+ }
533
+ "
534
+ HAVE_AMD64_ASM
535
+ )
536
+
537
+ if (HAVE_AMD64_ASM)
538
+ target_compile_definitions(${PROJECT_NAME}_config_private INTERFACE HAVE_AMD64_ASM=1)
539
+ endif ()
540
+
541
+ check_c_source_compiles(
542
+ "
543
+ int main(void) {
544
+ #if defined(__amd64) || defined(__amd64__) || defined(__x86_64__)
545
+ # if defined(__CYGWIN__) || defined(__MINGW32__) || defined(__MINGW64__) || defined(_WIN32) || defined(_WIN64)
546
+ # error Windows x86_64 calling conventions are not supported yet
547
+ # endif
548
+ /* neat */
549
+ #else
550
+ # error !x86_64
551
+ #endif
552
+ __asm__ __volatile__ (\"vpunpcklqdq %xmm0,%xmm13,%xmm0\");
553
+ }
554
+ "
555
+ HAVE_AVX_ASM
556
+ )
557
+
558
+ if (HAVE_AVX_ASM)
559
+ target_compile_definitions(${PROJECT_NAME}_config_private INTERFACE HAVE_AVX_ASM=1)
560
+ endif ()
561
+
562
+ check_c_source_compiles(
563
+ "
564
+ #if !defined(__clang__) && !defined(__GNUC__) && !defined(__SIZEOF_INT128__)
565
+ # error mode(TI) is a gcc extension, and __int128 is not available
566
+ #endif
567
+ #if defined(__clang__) && !defined(__x86_64__) && !defined(__aarch64__)
568
+ # error clang does not properly handle the 128-bit type on 32-bit systems
569
+ #endif
570
+ #ifndef NATIVE_LITTLE_ENDIAN
571
+ # error libsodium currently expects a little endian CPU for the 128-bit type
572
+ #endif
573
+ #ifdef __EMSCRIPTEN__
574
+ # error emscripten currently doesn't support some operations on integers larger than 64 bits
575
+ #endif
576
+ #include <stddef.h>
577
+ #include <stdint.h>
578
+ #if defined(__SIZEOF_INT128__)
579
+ typedef unsigned __int128 uint128_t;
580
+ #else
581
+ typedef unsigned uint128_t __attribute__((mode(TI)));
582
+ #endif
583
+ void fcontract(uint128_t *t) {
584
+ *t += 0x8000000000000 - 1;
585
+ *t *= *t;
586
+ *t >>= 84;
587
+ }
588
+
589
+ int main(void) {
590
+ (void) fcontract;
591
+ }
592
+ "
593
+ HAVE_TI_MODE
594
+ )
595
+
596
+ if (HAVE_TI_MODE)
597
+ target_compile_definitions(${PROJECT_NAME}_config_private INTERFACE HAVE_TI_MODE=1)
598
+ endif ()
599
+
600
+ check_c_source_compiles(
601
+ "
602
+ int main(void) {
603
+ unsigned int cpu_info[4];
604
+ __asm__ __volatile__ (\"xchgl %%ebx, %k1; cpuid; xchgl %%ebx, %k1\" :
605
+ \"=a\" (cpu_info[0]), \"=&r\" (cpu_info[1]),
606
+ \"=c\" (cpu_info[2]), \"=d\" (cpu_info[3]) :
607
+ \"0\" (0U), \"2\" (0U));
608
+ }
609
+ "
610
+ HAVE_CPUID
611
+ )
612
+
613
+ if (HAVE_CPUID)
614
+ target_compile_definitions(${PROJECT_NAME}_config_private INTERFACE HAVE_CPUID=1)
615
+ endif ()
616
+ endif ()
617
+
618
+ check_c_source_compiles(
619
+ "
620
+ #if !defined(__ELF__) && !defined(__APPLE_CC__)
621
+ # error Support for weak symbols may not be available
622
+ #endif
623
+ __attribute__((weak)) void __dummy(void *x) { }
624
+ void f(void *x) { __dummy(x); }
625
+ int main(void) {}
626
+ "
627
+ HAVE_WEAK_SYMBOLS
628
+ )
629
+
630
+ if (HAVE_WEAK_SYMBOLS)
631
+ target_compile_definitions(${PROJECT_NAME}_config_private INTERFACE HAVE_WEAK_SYMBOLS=1)
632
+ endif ()
633
+
634
+ check_c_source_compiles(
635
+ "
636
+ int main(void) {
637
+ static volatile int _sodium_lock;
638
+ __sync_lock_test_and_set(&_sodium_lock, 1);
639
+ __sync_lock_release(&_sodium_lock);
640
+ }
641
+ "
642
+ HAVE_ATOMIC_OPS
643
+ )
644
+
645
+ if (HAVE_ATOMIC_OPS)
646
+ target_compile_definitions(${PROJECT_NAME}_config_private INTERFACE HAVE_ATOMIC_OPS=1)
647
+ endif ()
648
+
649
+ check_c_source_compiles(
650
+ "
651
+ #include <limits.h>
652
+ #include <stdint.h>
653
+ int main(void) {
654
+ (void) SIZE_MAX;
655
+ (void) UINT64_MAX;
656
+ }
657
+ "
658
+ STDC_LIMIT_MACROS_REQUIRED
659
+ )
660
+
661
+ if (STDC_LIMIT_MACROS_REQUIRED)
662
+ target_compile_definitions(${PROJECT_NAME}_config_private
663
+ INTERFACE
664
+ __STDC_LIMIT_MACROS
665
+ __STDC_CONSTANT_MACROS
666
+ )
667
+ endif ()
668
+
669
+ # include/sodium/private/common.h
670
+ target_compile_definitions(${PROJECT_NAME}_config_private INTERFACE CONFIGURED=1)
671
+
672
+ test_big_endian(IS_BIG_ENDIAN)
673
+
674
+ if (IS_BIG_ENDIAN)
675
+ target_compile_definitions(${PROJECT_NAME}_config_private INTERFACE NATIVE_BIG_ENDIAN)
676
+ else ()
677
+ target_compile_definitions(${PROJECT_NAME}_config_private INTERFACE NATIVE_LITTLE_ENDIAN)
678
+ endif ()
679
+
680
+ # see src/libsodium/Makefile.am for reference
681
+ target_sources(${PROJECT_NAME}
682
+ PRIVATE
683
+ ${CMAKE_BINARY_DIR}/sodium/version.h
684
+
685
+ ${PROJECT_SOURCE_DIR}/src/libsodium/crypto_aead/chacha20poly1305/sodium/aead_chacha20poly1305.c
686
+ ${PROJECT_SOURCE_DIR}/src/libsodium/crypto_aead/xchacha20poly1305/sodium/aead_xchacha20poly1305.c
687
+ ${PROJECT_SOURCE_DIR}/src/libsodium/crypto_auth/crypto_auth.c
688
+ ${PROJECT_SOURCE_DIR}/src/libsodium/crypto_auth/hmacsha256/auth_hmacsha256.c
689
+ ${PROJECT_SOURCE_DIR}/src/libsodium/crypto_auth/hmacsha512/auth_hmacsha512.c
690
+ ${PROJECT_SOURCE_DIR}/src/libsodium/crypto_auth/hmacsha512256/auth_hmacsha512256.c
691
+ ${PROJECT_SOURCE_DIR}/src/libsodium/crypto_box/crypto_box.c
692
+ ${PROJECT_SOURCE_DIR}/src/libsodium/crypto_box/crypto_box_easy.c
693
+ ${PROJECT_SOURCE_DIR}/src/libsodium/crypto_box/crypto_box_seal.c
694
+ ${PROJECT_SOURCE_DIR}/src/libsodium/crypto_box/curve25519xsalsa20poly1305/box_curve25519xsalsa20poly1305.c
695
+ ${PROJECT_SOURCE_DIR}/src/libsodium/crypto_core/ed25519/ref10/ed25519_ref10.c
696
+ ${PROJECT_SOURCE_DIR}/src/libsodium/crypto_core/hchacha20/core_hchacha20.c
697
+ ${PROJECT_SOURCE_DIR}/src/libsodium/crypto_core/hsalsa20/ref2/core_hsalsa20_ref2.c
698
+ ${PROJECT_SOURCE_DIR}/src/libsodium/crypto_core/hsalsa20/core_hsalsa20.c
699
+ ${PROJECT_SOURCE_DIR}/src/libsodium/crypto_core/salsa/ref/core_salsa_ref.c
700
+ ${PROJECT_SOURCE_DIR}/src/libsodium/crypto_generichash/crypto_generichash.c
701
+ ${PROJECT_SOURCE_DIR}/src/libsodium/crypto_generichash/blake2b/generichash_blake2.c
702
+ ${PROJECT_SOURCE_DIR}/src/libsodium/crypto_generichash/blake2b/ref/blake2.h
703
+ ${PROJECT_SOURCE_DIR}/src/libsodium/crypto_generichash/blake2b/ref/blake2b-compress-ref.c
704
+ ${PROJECT_SOURCE_DIR}/src/libsodium/crypto_generichash/blake2b/ref/blake2b-load-sse2.h
705
+ ${PROJECT_SOURCE_DIR}/src/libsodium/crypto_generichash/blake2b/ref/blake2b-load-sse41.h
706
+ ${PROJECT_SOURCE_DIR}/src/libsodium/crypto_generichash/blake2b/ref/blake2b-load-avx2.h
707
+ ${PROJECT_SOURCE_DIR}/src/libsodium/crypto_generichash/blake2b/ref/blake2b-ref.c
708
+ ${PROJECT_SOURCE_DIR}/src/libsodium/crypto_generichash/blake2b/ref/generichash_blake2b.c
709
+ ${PROJECT_SOURCE_DIR}/src/libsodium/crypto_hash/crypto_hash.c
710
+ ${PROJECT_SOURCE_DIR}/src/libsodium/crypto_hash/sha256/hash_sha256.c
711
+ ${PROJECT_SOURCE_DIR}/src/libsodium/crypto_hash/sha256/cp/hash_sha256_cp.c
712
+ ${PROJECT_SOURCE_DIR}/src/libsodium/crypto_hash/sha512/hash_sha512.c
713
+ ${PROJECT_SOURCE_DIR}/src/libsodium/crypto_hash/sha512/cp/hash_sha512_cp.c
714
+ ${PROJECT_SOURCE_DIR}/src/libsodium/crypto_kdf/blake2b/kdf_blake2b.c
715
+ ${PROJECT_SOURCE_DIR}/src/libsodium/crypto_kdf/crypto_kdf.c
716
+ ${PROJECT_SOURCE_DIR}/src/libsodium/crypto_kx/crypto_kx.c
717
+ ${PROJECT_SOURCE_DIR}/src/libsodium/crypto_onetimeauth/crypto_onetimeauth.c
718
+ ${PROJECT_SOURCE_DIR}/src/libsodium/crypto_onetimeauth/poly1305/onetimeauth_poly1305.c
719
+ ${PROJECT_SOURCE_DIR}/src/libsodium/crypto_onetimeauth/poly1305/onetimeauth_poly1305.h
720
+ ${PROJECT_SOURCE_DIR}/src/libsodium/crypto_onetimeauth/poly1305/donna/poly1305_donna.h
721
+ ${PROJECT_SOURCE_DIR}/src/libsodium/crypto_onetimeauth/poly1305/donna/poly1305_donna32.h
722
+ ${PROJECT_SOURCE_DIR}/src/libsodium/crypto_onetimeauth/poly1305/donna/poly1305_donna64.h
723
+ ${PROJECT_SOURCE_DIR}/src/libsodium/crypto_onetimeauth/poly1305/donna/poly1305_donna.c
724
+ ${PROJECT_SOURCE_DIR}/src/libsodium/crypto_pwhash/argon2/argon2-core.c
725
+ ${PROJECT_SOURCE_DIR}/src/libsodium/crypto_pwhash/argon2/argon2-core.h
726
+ ${PROJECT_SOURCE_DIR}/src/libsodium/crypto_pwhash/argon2/argon2-encoding.c
727
+ ${PROJECT_SOURCE_DIR}/src/libsodium/crypto_pwhash/argon2/argon2-encoding.h
728
+ ${PROJECT_SOURCE_DIR}/src/libsodium/crypto_pwhash/argon2/argon2-fill-block-ref.c
729
+ ${PROJECT_SOURCE_DIR}/src/libsodium/crypto_pwhash/argon2/argon2.c
730
+ ${PROJECT_SOURCE_DIR}/src/libsodium/crypto_pwhash/argon2/argon2.h
731
+ ${PROJECT_SOURCE_DIR}/src/libsodium/crypto_pwhash/argon2/blake2b-long.c
732
+ ${PROJECT_SOURCE_DIR}/src/libsodium/crypto_pwhash/argon2/blake2b-long.h
733
+ ${PROJECT_SOURCE_DIR}/src/libsodium/crypto_pwhash/argon2/blamka-round-ref.h
734
+ ${PROJECT_SOURCE_DIR}/src/libsodium/crypto_pwhash/argon2/pwhash_argon2i.c
735
+ ${PROJECT_SOURCE_DIR}/src/libsodium/crypto_pwhash/argon2/pwhash_argon2id.c
736
+ ${PROJECT_SOURCE_DIR}/src/libsodium/crypto_pwhash/crypto_pwhash.c
737
+ ${PROJECT_SOURCE_DIR}/src/libsodium/crypto_scalarmult/crypto_scalarmult.c
738
+ ${PROJECT_SOURCE_DIR}/src/libsodium/crypto_scalarmult/curve25519/ref10/x25519_ref10.c
739
+ ${PROJECT_SOURCE_DIR}/src/libsodium/crypto_scalarmult/curve25519/ref10/x25519_ref10.h
740
+ ${PROJECT_SOURCE_DIR}/src/libsodium/crypto_scalarmult/curve25519/scalarmult_curve25519.c
741
+ ${PROJECT_SOURCE_DIR}/src/libsodium/crypto_scalarmult/curve25519/scalarmult_curve25519.h
742
+ ${PROJECT_SOURCE_DIR}/src/libsodium/crypto_secretbox/crypto_secretbox.c
743
+ ${PROJECT_SOURCE_DIR}/src/libsodium/crypto_secretbox/crypto_secretbox_easy.c
744
+ ${PROJECT_SOURCE_DIR}/src/libsodium/crypto_secretbox/xsalsa20poly1305/secretbox_xsalsa20poly1305.c
745
+ ${PROJECT_SOURCE_DIR}/src/libsodium/crypto_secretstream/xchacha20poly1305/secretstream_xchacha20poly1305.c
746
+ ${PROJECT_SOURCE_DIR}/src/libsodium/crypto_shorthash/crypto_shorthash.c
747
+ ${PROJECT_SOURCE_DIR}/src/libsodium/crypto_shorthash/siphash24/shorthash_siphash24.c
748
+ ${PROJECT_SOURCE_DIR}/src/libsodium/crypto_shorthash/siphash24/ref/shorthash_siphash24_ref.c
749
+ ${PROJECT_SOURCE_DIR}/src/libsodium/crypto_shorthash/siphash24/ref/shorthash_siphash_ref.h
750
+ ${PROJECT_SOURCE_DIR}/src/libsodium/crypto_sign/crypto_sign.c
751
+ ${PROJECT_SOURCE_DIR}/src/libsodium/crypto_sign/ed25519/sign_ed25519.c
752
+ ${PROJECT_SOURCE_DIR}/src/libsodium/crypto_sign/ed25519/ref10/keypair.c
753
+ ${PROJECT_SOURCE_DIR}/src/libsodium/crypto_sign/ed25519/ref10/open.c
754
+ ${PROJECT_SOURCE_DIR}/src/libsodium/crypto_sign/ed25519/ref10/sign.c
755
+ ${PROJECT_SOURCE_DIR}/src/libsodium/crypto_sign/ed25519/ref10/sign_ed25519_ref10.h
756
+ ${PROJECT_SOURCE_DIR}/src/libsodium/crypto_stream/chacha20/stream_chacha20.c
757
+ ${PROJECT_SOURCE_DIR}/src/libsodium/crypto_stream/chacha20/stream_chacha20.h
758
+ ${PROJECT_SOURCE_DIR}/src/libsodium/crypto_stream/chacha20/ref/chacha20_ref.h
759
+ ${PROJECT_SOURCE_DIR}/src/libsodium/crypto_stream/chacha20/ref/chacha20_ref.c
760
+ ${PROJECT_SOURCE_DIR}/src/libsodium/crypto_stream/crypto_stream.c
761
+ ${PROJECT_SOURCE_DIR}/src/libsodium/crypto_stream/salsa20/stream_salsa20.c
762
+ ${PROJECT_SOURCE_DIR}/src/libsodium/crypto_stream/salsa20/stream_salsa20.h
763
+ ${PROJECT_SOURCE_DIR}/src/libsodium/crypto_stream/xsalsa20/stream_xsalsa20.c
764
+ ${PROJECT_SOURCE_DIR}/src/libsodium/crypto_verify/sodium/verify.c
765
+ ${PROJECT_SOURCE_DIR}/src/libsodium/include/sodium/private/chacha20_ietf_ext.h
766
+ ${PROJECT_SOURCE_DIR}/src/libsodium/include/sodium/private/common.h
767
+ ${PROJECT_SOURCE_DIR}/src/libsodium/include/sodium/private/ed25519_ref10.h
768
+ ${PROJECT_SOURCE_DIR}/src/libsodium/include/sodium/private/implementations.h
769
+ ${PROJECT_SOURCE_DIR}/src/libsodium/include/sodium/private/mutex.h
770
+ ${PROJECT_SOURCE_DIR}/src/libsodium/include/sodium/private/sse2_64_32.h
771
+ ${PROJECT_SOURCE_DIR}/src/libsodium/randombytes/randombytes.c
772
+ ${PROJECT_SOURCE_DIR}/src/libsodium/sodium/codecs.c
773
+ ${PROJECT_SOURCE_DIR}/src/libsodium/sodium/core.c
774
+ ${PROJECT_SOURCE_DIR}/src/libsodium/sodium/runtime.c
775
+ ${PROJECT_SOURCE_DIR}/src/libsodium/sodium/utils.c
776
+ ${PROJECT_SOURCE_DIR}/src/libsodium/sodium/version.c
777
+ )
778
+
779
+ if (HAVE_TI_MODE)
780
+ target_sources(${PROJECT_NAME}
781
+ PRIVATE
782
+ ${PROJECT_SOURCE_DIR}/src/libsodium/crypto_core/ed25519/ref10/fe_51/base.h
783
+ ${PROJECT_SOURCE_DIR}/src/libsodium/crypto_core/ed25519/ref10/fe_51/base2.h
784
+ ${PROJECT_SOURCE_DIR}/src/libsodium/crypto_core/ed25519/ref10/fe_51/constants.h
785
+ ${PROJECT_SOURCE_DIR}/src/libsodium/crypto_core/ed25519/ref10/fe_51/fe.h
786
+ ${PROJECT_SOURCE_DIR}/src/libsodium/include/sodium/private/ed25519_ref10_fe_51.h
787
+ )
788
+ else ()
789
+ target_sources(${PROJECT_NAME}
790
+ PRIVATE
791
+ ${PROJECT_SOURCE_DIR}/src/libsodium/crypto_core/ed25519/ref10/fe_25_5/base.h
792
+ ${PROJECT_SOURCE_DIR}/src/libsodium/crypto_core/ed25519/ref10/fe_25_5/base2.h
793
+ ${PROJECT_SOURCE_DIR}/src/libsodium/crypto_core/ed25519/ref10/fe_25_5/constants.h
794
+ ${PROJECT_SOURCE_DIR}/src/libsodium/crypto_core/ed25519/ref10/fe_25_5/fe.h
795
+ ${PROJECT_SOURCE_DIR}/src/libsodium/include/sodium/private/ed25519_ref10_fe_25_5.h
796
+ )
797
+ endif ()
798
+
799
+ if (HAVE_AMD64_ASM)
800
+ target_sources(${PROJECT_NAME}
801
+ PRIVATE
802
+ ${PROJECT_SOURCE_DIR}/src/libsodium/crypto_stream/salsa20/xmm6/salsa20_xmm6-asm.S
803
+ ${PROJECT_SOURCE_DIR}/src/libsodium/crypto_stream/salsa20/xmm6/salsa20_xmm6.c
804
+ ${PROJECT_SOURCE_DIR}/src/libsodium/crypto_stream/salsa20/xmm6/salsa20_xmm6.h
805
+ )
806
+ else ()
807
+ target_sources(${PROJECT_NAME}
808
+ PRIVATE
809
+ ${PROJECT_SOURCE_DIR}/src/libsodium/crypto_stream/salsa20/ref/salsa20_ref.c
810
+ ${PROJECT_SOURCE_DIR}/src/libsodium/crypto_stream/salsa20/ref/salsa20_ref.h
811
+ )
812
+ endif ()
813
+
814
+ target_sources(${PROJECT_NAME}
815
+ PRIVATE
816
+ ${PROJECT_SOURCE_DIR}/src/libsodium/crypto_scalarmult/curve25519/sandy2x/consts.S
817
+ ${PROJECT_SOURCE_DIR}/src/libsodium/crypto_scalarmult/curve25519/sandy2x/fe51_mul.S
818
+ ${PROJECT_SOURCE_DIR}/src/libsodium/crypto_scalarmult/curve25519/sandy2x/fe51_nsquare.S
819
+ ${PROJECT_SOURCE_DIR}/src/libsodium/crypto_scalarmult/curve25519/sandy2x/fe51_pack.S
820
+ ${PROJECT_SOURCE_DIR}/src/libsodium/crypto_scalarmult/curve25519/sandy2x/ladder.S
821
+ ${PROJECT_SOURCE_DIR}/src/libsodium/crypto_scalarmult/curve25519/sandy2x/ladder_base.S
822
+ )
823
+
824
+ if (HAVE_AVX_ASM)
825
+ target_sources(${PROJECT_NAME}
826
+ PRIVATE
827
+ ${PROJECT_SOURCE_DIR}/src/libsodium/crypto_scalarmult/curve25519/sandy2x/consts_namespace.h
828
+ ${PROJECT_SOURCE_DIR}/src/libsodium/crypto_scalarmult/curve25519/sandy2x/curve25519_sandy2x.c
829
+ ${PROJECT_SOURCE_DIR}/src/libsodium/crypto_scalarmult/curve25519/sandy2x/curve25519_sandy2x.h
830
+ ${PROJECT_SOURCE_DIR}/src/libsodium/crypto_scalarmult/curve25519/sandy2x/fe.h
831
+ ${PROJECT_SOURCE_DIR}/src/libsodium/crypto_scalarmult/curve25519/sandy2x/fe51.h
832
+ ${PROJECT_SOURCE_DIR}/src/libsodium/crypto_scalarmult/curve25519/sandy2x/fe51_invert.c
833
+ ${PROJECT_SOURCE_DIR}/src/libsodium/crypto_scalarmult/curve25519/sandy2x/fe51_namespace.h
834
+ ${PROJECT_SOURCE_DIR}/src/libsodium/crypto_scalarmult/curve25519/sandy2x/fe_frombytes_sandy2x.c
835
+ ${PROJECT_SOURCE_DIR}/src/libsodium/crypto_scalarmult/curve25519/sandy2x/ladder.h
836
+ ${PROJECT_SOURCE_DIR}/src/libsodium/crypto_scalarmult/curve25519/sandy2x/ladder_namespace.h
837
+ ${PROJECT_SOURCE_DIR}/src/libsodium/crypto_scalarmult/curve25519/sandy2x/sandy2x.S
838
+ )
839
+ endif ()
840
+
841
+ if (NOT ENABLE_MINIMAL)
842
+ target_sources(${PROJECT_NAME}
843
+ PRIVATE
844
+ ${PROJECT_SOURCE_DIR}/src/libsodium/crypto_box/curve25519xchacha20poly1305/box_curve25519xchacha20poly1305.c
845
+ ${PROJECT_SOURCE_DIR}/src/libsodium/crypto_box/curve25519xchacha20poly1305/box_seal_curve25519xchacha20poly1305.c
846
+ ${PROJECT_SOURCE_DIR}/src/libsodium/crypto_core/ed25519/core_ed25519.c
847
+ ${PROJECT_SOURCE_DIR}/src/libsodium/crypto_core/ed25519/core_ristretto255.c
848
+ ${PROJECT_SOURCE_DIR}/src/libsodium/crypto_pwhash/scryptsalsa208sha256/crypto_scrypt-common.c
849
+ ${PROJECT_SOURCE_DIR}/src/libsodium/crypto_pwhash/scryptsalsa208sha256/crypto_scrypt.h
850
+ ${PROJECT_SOURCE_DIR}/src/libsodium/crypto_pwhash/scryptsalsa208sha256/scrypt_platform.c
851
+ ${PROJECT_SOURCE_DIR}/src/libsodium/crypto_pwhash/scryptsalsa208sha256/pbkdf2-sha256.c
852
+ ${PROJECT_SOURCE_DIR}/src/libsodium/crypto_pwhash/scryptsalsa208sha256/pbkdf2-sha256.h
853
+ ${PROJECT_SOURCE_DIR}/src/libsodium/crypto_pwhash/scryptsalsa208sha256/pwhash_scryptsalsa208sha256.c
854
+ ${PROJECT_SOURCE_DIR}/src/libsodium/crypto_pwhash/scryptsalsa208sha256/nosse/pwhash_scryptsalsa208sha256_nosse.c
855
+ ${PROJECT_SOURCE_DIR}/src/libsodium/crypto_scalarmult/ed25519/ref10/scalarmult_ed25519_ref10.c
856
+ ${PROJECT_SOURCE_DIR}/src/libsodium/crypto_scalarmult/ristretto255/ref10/scalarmult_ristretto255_ref10.c
857
+ ${PROJECT_SOURCE_DIR}/src/libsodium/crypto_secretbox/xchacha20poly1305/secretbox_xchacha20poly1305.c
858
+ ${PROJECT_SOURCE_DIR}/src/libsodium/crypto_shorthash/siphash24/shorthash_siphashx24.c
859
+ ${PROJECT_SOURCE_DIR}/src/libsodium/crypto_shorthash/siphash24/ref/shorthash_siphashx24_ref.c
860
+ ${PROJECT_SOURCE_DIR}/src/libsodium/crypto_sign/ed25519/ref10/obsolete.c
861
+ ${PROJECT_SOURCE_DIR}/src/libsodium/crypto_stream/salsa2012/ref/stream_salsa2012_ref.c
862
+ ${PROJECT_SOURCE_DIR}/src/libsodium/crypto_stream/salsa2012/stream_salsa2012.c
863
+ ${PROJECT_SOURCE_DIR}/src/libsodium/crypto_stream/salsa208/ref/stream_salsa208_ref.c
864
+ ${PROJECT_SOURCE_DIR}/src/libsodium/crypto_stream/salsa208/stream_salsa208.c
865
+ ${PROJECT_SOURCE_DIR}/src/libsodium/crypto_stream/xchacha20/stream_xchacha20.c
866
+ )
867
+ endif ()
868
+
869
+ add_library(${PROJECT_NAME}_rdrand
870
+ OBJECT
871
+ ${PROJECT_SOURCE_DIR}/src/libsodium/randombytes/internal/randombytes_internal_random.c
872
+ ${PROJECT_SOURCE_DIR}/src/libsodium/randombytes/sysrandom/randombytes_sysrandom.c
873
+ )
874
+
875
+ target_link_libraries(${PROJECT_NAME}_rdrand
876
+ PRIVATE
877
+ ${PROJECT_NAME}_rdrand_config
878
+ ${PROJECT_NAME}_config_public
879
+ ${PROJECT_NAME}_config_private
880
+ )
881
+
882
+ add_library(${PROJECT_NAME}_aesni
883
+ OBJECT
884
+ ${PROJECT_SOURCE_DIR}/src/libsodium/crypto_aead/aes256gcm/aesni/aead_aes256gcm_aesni.c
885
+ )
886
+
887
+ target_link_libraries(${PROJECT_NAME}_aesni
888
+ PRIVATE
889
+ ${PROJECT_NAME}_config_public
890
+ ${PROJECT_NAME}_config_private
891
+ ${PROJECT_NAME}_sse2_config
892
+ ${PROJECT_NAME}_ssse3_config
893
+ ${PROJECT_NAME}_aesni_config
894
+ ${PROJECT_NAME}_pclmul_config
895
+ )
896
+
897
+ add_library(${PROJECT_NAME}_sse2
898
+ OBJECT
899
+ ${PROJECT_SOURCE_DIR}/src/libsodium/crypto_onetimeauth/poly1305/sse2/poly1305_sse2.c
900
+ ${PROJECT_SOURCE_DIR}/src/libsodium/crypto_onetimeauth/poly1305/sse2/poly1305_sse2.h
901
+ )
902
+
903
+ if (NOT ENABLE_MINIMAL)
904
+ target_sources(${PROJECT_NAME}_sse2
905
+ PRIVATE
906
+ ${PROJECT_SOURCE_DIR}/src/libsodium/crypto_pwhash/scryptsalsa208sha256/sse/pwhash_scryptsalsa208sha256_sse.c
907
+ )
908
+ endif ()
909
+
910
+ if (NOT HAVE_AMD64_ASM)
911
+ target_sources(${PROJECT_NAME}_sse2
912
+ PRIVATE
913
+ ${PROJECT_SOURCE_DIR}/src/libsodium/crypto_stream/salsa20/xmm6int/salsa20_xmm6int-sse2.c
914
+ ${PROJECT_SOURCE_DIR}/src/libsodium/crypto_stream/salsa20/xmm6int/salsa20_xmm6int-sse2.h
915
+ ${PROJECT_SOURCE_DIR}/src/libsodium/crypto_stream/salsa20/xmm6int/u0.h
916
+ ${PROJECT_SOURCE_DIR}/src/libsodium/crypto_stream/salsa20/xmm6int/u1.h
917
+ ${PROJECT_SOURCE_DIR}/src/libsodium/crypto_stream/salsa20/xmm6int/u4.h
918
+ )
919
+ endif ()
920
+
921
+ target_link_libraries(${PROJECT_NAME}_sse2
922
+ PRIVATE
923
+ ${PROJECT_NAME}_config_public
924
+ ${PROJECT_NAME}_config_private
925
+ ${PROJECT_NAME}_sse2_config
926
+ )
927
+
928
+ add_library(${PROJECT_NAME}_ssse3
929
+ OBJECT
930
+ ${PROJECT_SOURCE_DIR}/src/libsodium/crypto_generichash/blake2b/ref/blake2b-compress-ssse3.c
931
+ ${PROJECT_SOURCE_DIR}/src/libsodium/crypto_generichash/blake2b/ref/blake2b-compress-ssse3.h
932
+ ${PROJECT_SOURCE_DIR}/src/libsodium/crypto_pwhash/argon2/argon2-fill-block-ssse3.c
933
+ ${PROJECT_SOURCE_DIR}/src/libsodium/crypto_pwhash/argon2/blamka-round-ssse3.h
934
+ ${PROJECT_SOURCE_DIR}/src/libsodium/crypto_stream/chacha20/dolbeau/chacha20_dolbeau-ssse3.c
935
+ ${PROJECT_SOURCE_DIR}/src/libsodium/crypto_stream/chacha20/dolbeau/chacha20_dolbeau-ssse3.h
936
+ ${PROJECT_SOURCE_DIR}/src/libsodium/crypto_stream/chacha20/dolbeau/u0.h
937
+ ${PROJECT_SOURCE_DIR}/src/libsodium/crypto_stream/chacha20/dolbeau/u1.h
938
+ ${PROJECT_SOURCE_DIR}/src/libsodium/crypto_stream/chacha20/dolbeau/u4.h
939
+ )
940
+
941
+ target_link_libraries(${PROJECT_NAME}_ssse3
942
+ PRIVATE
943
+ ${PROJECT_NAME}_config_public
944
+ ${PROJECT_NAME}_config_private
945
+ ${PROJECT_NAME}_sse2_config
946
+ ${PROJECT_NAME}_ssse3_config
947
+ )
948
+
949
+ add_library(${PROJECT_NAME}_sse41
950
+ OBJECT
951
+ ${PROJECT_SOURCE_DIR}/src/libsodium/crypto_generichash/blake2b/ref/blake2b-compress-sse41.c
952
+ ${PROJECT_SOURCE_DIR}/src/libsodium/crypto_generichash/blake2b/ref/blake2b-compress-sse41.h
953
+ )
954
+
955
+ target_link_libraries(${PROJECT_NAME}_sse41
956
+ PRIVATE
957
+ ${PROJECT_NAME}_config_public
958
+ ${PROJECT_NAME}_config_private
959
+ ${PROJECT_NAME}_sse2_config
960
+ ${PROJECT_NAME}_ssse3_config
961
+ ${PROJECT_NAME}_sse41_config
962
+ )
963
+
964
+ add_library(${PROJECT_NAME}_avx2
965
+ OBJECT
966
+ ${PROJECT_SOURCE_DIR}/src/libsodium/crypto_generichash/blake2b/ref/blake2b-compress-avx2.c
967
+ ${PROJECT_SOURCE_DIR}/src/libsodium/crypto_generichash/blake2b/ref/blake2b-compress-avx2.h
968
+ ${PROJECT_SOURCE_DIR}/src/libsodium/crypto_pwhash/argon2/argon2-fill-block-avx2.c
969
+ ${PROJECT_SOURCE_DIR}/src/libsodium/crypto_pwhash/argon2/blamka-round-avx2.h
970
+ ${PROJECT_SOURCE_DIR}/src/libsodium/crypto_stream/chacha20/dolbeau/chacha20_dolbeau-avx2.c
971
+ ${PROJECT_SOURCE_DIR}/src/libsodium/crypto_stream/chacha20/dolbeau/chacha20_dolbeau-avx2.h
972
+ ${PROJECT_SOURCE_DIR}/src/libsodium/crypto_stream/chacha20/dolbeau/u8.h
973
+ ${PROJECT_SOURCE_DIR}/src/libsodium/crypto_stream/salsa20/xmm6int/salsa20_xmm6int-avx2.c
974
+ ${PROJECT_SOURCE_DIR}/src/libsodium/crypto_stream/salsa20/xmm6int/salsa20_xmm6int-avx2.h
975
+ ${PROJECT_SOURCE_DIR}/src/libsodium/crypto_stream/salsa20/xmm6int/u0.h
976
+ ${PROJECT_SOURCE_DIR}/src/libsodium/crypto_stream/salsa20/xmm6int/u1.h
977
+ ${PROJECT_SOURCE_DIR}/src/libsodium/crypto_stream/salsa20/xmm6int/u4.h
978
+ ${PROJECT_SOURCE_DIR}/src/libsodium/crypto_stream/salsa20/xmm6int/u8.h
979
+ )
980
+
981
+ target_link_libraries(${PROJECT_NAME}_avx2
982
+ PRIVATE
983
+ ${PROJECT_NAME}_config_public
984
+ ${PROJECT_NAME}_config_private
985
+ ${PROJECT_NAME}_sse2_config
986
+ ${PROJECT_NAME}_ssse3_config
987
+ ${PROJECT_NAME}_sse41_config
988
+ ${PROJECT_NAME}_avx_config
989
+ ${PROJECT_NAME}_avx2_config
990
+ )
991
+
992
+ add_library(${PROJECT_NAME}_avx512f
993
+ OBJECT
994
+ ${PROJECT_SOURCE_DIR}/src/libsodium/crypto_pwhash/argon2/argon2-fill-block-avx512f.c
995
+ ${PROJECT_SOURCE_DIR}/src/libsodium/crypto_pwhash/argon2/blamka-round-avx512f.h
996
+ )
997
+
998
+ target_link_libraries(${PROJECT_NAME}_avx512f
999
+ PRIVATE
1000
+ ${PROJECT_NAME}_config_public
1001
+ ${PROJECT_NAME}_config_private
1002
+ ${PROJECT_NAME}_sse2_config
1003
+ ${PROJECT_NAME}_ssse3_config
1004
+ ${PROJECT_NAME}_sse41_config
1005
+ ${PROJECT_NAME}_avx_config
1006
+ ${PROJECT_NAME}_avx2_config
1007
+ ${PROJECT_NAME}_avx512f_config
1008
+ )
1009
+
1010
+ target_link_libraries(${PROJECT_NAME}
1011
+ PRIVATE
1012
+ "$<BUILD_INTERFACE:${PROJECT_NAME}_rdrand>"
1013
+ "$<BUILD_INTERFACE:${PROJECT_NAME}_aesni>"
1014
+ "$<BUILD_INTERFACE:${PROJECT_NAME}_sse2>"
1015
+ "$<BUILD_INTERFACE:${PROJECT_NAME}_ssse3>"
1016
+ "$<BUILD_INTERFACE:${PROJECT_NAME}_sse41>"
1017
+ "$<BUILD_INTERFACE:${PROJECT_NAME}_avx2>"
1018
+ "$<BUILD_INTERFACE:${PROJECT_NAME}_avx512f>"
1019
+ "$<BUILD_INTERFACE:${PROJECT_NAME}_config_private>"
1020
+ PUBLIC
1021
+ ${PROJECT_NAME}_config_public
1022
+ )
1023
+
1024
+ endif ()
1025
+
1026
+ if (BUILD_SHARED_LIBS)
1027
+ if (MSVC)
1028
+ target_compile_definitions(${PROJECT_NAME}
1029
+ PRIVATE
1030
+ SODIUM_DLL_EXPORT
1031
+ )
1032
+ endif ()
1033
+ else ()
1034
+ if (MSVC)
1035
+ target_compile_definitions(${PROJECT_NAME}
1036
+ PUBLIC
1037
+ SODIUM_STATIC
1038
+ )
1039
+ else ()
1040
+ target_compile_definitions(${PROJECT_NAME}_config_public
1041
+ INTERFACE
1042
+ SODIUM_STATIC
1043
+ )
1044
+ endif( )
1045
+ endif ()
1046
+
1047
+ if (BUILD_TESTING)
1048
+ enable_testing()
1049
+
1050
+ file(GLOB sodium_test_sources ${PROJECT_SOURCE_DIR}/test/default/*.c)
1051
+
1052
+ foreach (test_src ${sodium_test_sources})
1053
+ get_filename_component(test_name ${test_src} NAME_WE)
1054
+
1055
+ add_executable(${test_name} ${test_src})
1056
+
1057
+ if (MSVC)
1058
+ target_compile_definitions(${test_name} PRIVATE _CRT_SECURE_NO_WARNINGS)
1059
+ endif ()
1060
+
1061
+ target_include_directories(${test_name}
1062
+ PRIVATE
1063
+ $<BUILD_INTERFACE:${PROJECT_SOURCE_DIR}/src/libsodium/include>
1064
+ $<BUILD_INTERFACE:${PROJECT_SOURCE_DIR}/src/libsodium/include/sodium>
1065
+ $<BUILD_INTERFACE:${CMAKE_BINARY_DIR}>
1066
+ $<BUILD_INTERFACE:${PROJECT_SOURCE_DIR}/test/quirks>
1067
+ )
1068
+
1069
+ target_link_libraries(${test_name} PRIVATE ${PROJECT_NAME})
1070
+
1071
+ add_custom_command(TARGET ${test_name} POST_BUILD
1072
+ COMMAND ${CMAKE_COMMAND} -E copy_if_different
1073
+ "${CMAKE_CURRENT_LIST_DIR}/test/default/${test_name}.exp"
1074
+ $<TARGET_FILE_DIR:${test_name}>)
1075
+
1076
+ add_test(
1077
+ NAME ${test_name}
1078
+ COMMAND ${test_name}
1079
+ WORKING_DIRECTORY $<TARGET_FILE_DIR:${test_name}>
1080
+ )
1081
+ endforeach ()
1082
+ endif ()
1083
+
1084
+ install(DIRECTORY src/libsodium/include/
1085
+ DESTINATION include/
1086
+ USE_SOURCE_PERMISSIONS
1087
+ PATTERN "*.h"
1088
+ PATTERN "*.h.in" EXCLUDE
1089
+ REGEX "private($|/)" EXCLUDE
1090
+ )
1091
+
1092
+ install(FILES ${CMAKE_BINARY_DIR}/sodium/version.h
1093
+ DESTINATION include/sodium
1094
+ )
1095
+
1096
+ if (MSVC)
1097
+ install(TARGETS ${PROJECT_NAME}
1098
+ EXPORT ${PROJECT_NAME}-targets
1099
+ ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}
1100
+ LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
1101
+ RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
1102
+ INCLUDES DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}
1103
+ )
1104
+ else ()
1105
+ install(
1106
+ TARGETS
1107
+ ${PROJECT_NAME}
1108
+ ${PROJECT_NAME}_config_public
1109
+ EXPORT ${PROJECT_NAME}-targets
1110
+ ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}
1111
+ LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
1112
+ RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
1113
+ INCLUDES DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}
1114
+ )
1115
+ endif ()
1116
+
1117
+ install(EXPORT ${PROJECT_NAME}-targets
1118
+ FILE unofficial-${PROJECT_NAME}Targets.cmake
1119
+ NAMESPACE unofficial-${PROJECT_NAME}::
1120
+ DESTINATION share/unofficial-${PROJECT_NAME}
1121
+ )
1122
+
1123
+ write_basic_package_version_file(
1124
+ ${CMAKE_CURRENT_BINARY_DIR}/unofficial-${PROJECT_NAME}ConfigVersion.cmake
1125
+ VERSION ${VERSION}
1126
+ COMPATIBILITY AnyNewerVersion
1127
+ )
1128
+
1129
+ install(
1130
+ FILES
1131
+ ${CMAKE_CURRENT_BINARY_DIR}/unofficial-${PROJECT_NAME}ConfigVersion.cmake
1132
+ DESTINATION share/unofficial-${PROJECT_NAME}
1133
+ )
1134
+
1135
+ # References:
1136
+ # https://github.com/boost-cmake/bcm/wiki/Cmake-best-practices-and-guidelines
1137
+ # https://github.com/jedisct1/libsodium/pull/74/files
1138
+ # https://github.com/jedisct1/libsodium/pull/156/files
1139
+ # https://github.com/jedisct1/libsodium/pull/181/files
1140
+ # https://github.com/jedisct1/libsodium/issues/378
1141
+ # https://github.com/jedisct1/libsodium/issues/636
1142
+ # https://github.com/jedisct1/libsodium/issues/771
1143
+ # https://github.com/jedisct1/libsodium/blob/gyp/sodium.gyp
1144
+ # https://github.com/imefisto/cmake-libsodium
1145
+ # https://github.com/Cyberunner23/libsodium-CMake
1146
+ # https://stackoverflow.com/questions/29901352/appending-to-cmake-c-flags
1147
+ # https://stackoverflow.com/questions/986426/what-do-stdc-limit-macros-and-stdc-constant-macros-mean
1148
+ # https://gcc.gnu.org/onlinedocs/gcc/Option-Summary.html
1149
+ # https://stackoverflow.com/questions/15132185/mixing-c-and-assembly-sources-and-build-with-cmake
1150
+ # https://stackoverflow.com/questions/647892/how-to-check-header-files-and-library-functions-in-cmake-like-it-is-done-in-auto
1151
+ # https://stackoverflow.com/questions/31038963/how-do-you-rename-a-library-filename-in-cmake
1152
+ # https://gitlab.kitware.com/cmake/cmake/-/issues/15415
third-party/DPVO/Pangolin/scripts/vcpkg/ports/libsodium/portfile.cmake ADDED
@@ -0,0 +1,43 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ vcpkg_from_github(
2
+ OUT_SOURCE_PATH SOURCE_PATH
3
+ REPO jedisct1/libsodium
4
+ REF 1.0.18
5
+ SHA512 727fe50a5fb1df86ec5d807770f408a52609cbeb8510b4f4183b2a35a537905719bdb6348afcb103ff00ce946a8094ac9559b6e3e5b2ccc2a2d0c08f75577eeb
6
+ HEAD_REF master
7
+ )
8
+
9
+ file(COPY ${CMAKE_CURRENT_LIST_DIR}/CMakeLists.txt DESTINATION ${SOURCE_PATH})
10
+
11
+ vcpkg_cmake_configure(
12
+ SOURCE_PATH ${SOURCE_PATH}
13
+ PREFER_NINJA
14
+ OPTIONS
15
+ -DBUILD_TESTING=OFF
16
+ )
17
+
18
+ vcpkg_cmake_install()
19
+
20
+ vcpkg_copy_pdbs()
21
+
22
+ vcpkg_cmake_config_fixup(
23
+ PACKAGE_NAME unofficial-sodium
24
+ )
25
+
26
+ file(REMOVE_RECURSE
27
+ ${CURRENT_PACKAGES_DIR}/debug/include
28
+ ${CURRENT_PACKAGES_DIR}/debug/share
29
+ )
30
+
31
+ file(REMOVE ${CURRENT_PACKAGES_DIR}/include/Makefile.am)
32
+
33
+ configure_file(
34
+ ${SOURCE_PATH}/LICENSE
35
+ ${CURRENT_PACKAGES_DIR}/share/${PORT}/copyright
36
+ COPYONLY
37
+ )
38
+
39
+ configure_file(
40
+ ${CMAKE_CURRENT_LIST_DIR}/sodiumConfig.cmake.in
41
+ ${CURRENT_PACKAGES_DIR}/share/unofficial-sodium/unofficial-sodiumConfig.cmake
42
+ @ONLY
43
+ )
third-party/DPVO/Pangolin/scripts/vcpkg/ports/libsodium/sodiumConfig.cmake.in ADDED
@@ -0,0 +1,7 @@
 
 
 
 
 
 
 
 
1
+
2
+ if("@VCPKG_LIBRARY_LINKAGE@" STREQUAL "static" AND NOT WIN32)
3
+ include(CMakeFindDependencyMacro)
4
+ find_dependency(Threads)
5
+ endif()
6
+
7
+ include(${CMAKE_CURRENT_LIST_DIR}/unofficial-sodiumTargets.cmake)
third-party/DPVO/Pangolin/scripts/vcpkg/ports/libsodium/vcpkg.json ADDED
@@ -0,0 +1,17 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "name": "libsodium",
3
+ "version": "1.0.18",
4
+ "port-version": 6,
5
+ "description": "A modern and easy-to-use crypto library",
6
+ "homepage": "https://github.com/jedisct1/libsodium",
7
+ "dependencies": [
8
+ {
9
+ "name": "vcpkg-cmake",
10
+ "host": true
11
+ },
12
+ {
13
+ "name": "vcpkg-cmake-config",
14
+ "host": true
15
+ }
16
+ ]
17
+ }
third-party/DPVO/Pangolin/scripts/vcpkg/ports/libsoundio/fix_cmakelists.patch ADDED
@@ -0,0 +1,58 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ diff --git a/CMakeLists.txt b/CMakeLists.txt
2
+ index 6541f1b..e81bdce 100644
3
+ --- a/CMakeLists.txt
4
+ +++ b/CMakeLists.txt
5
+ @@ -1,4 +1,5 @@
6
+ -cmake_minimum_required(VERSION 2.8.5)
7
+ +cmake_minimum_required(VERSION 3.14)
8
+ +cmake_policy(SET CMP0022 NEW)
9
+ project(libsoundio C)
10
+ set(CMAKE_MODULE_PATH ${libsoundio_SOURCE_DIR}/cmake ${CMAKE_MODULE_PATH})
11
+
12
+ @@ -233,7 +234,8 @@ if(BUILD_DYNAMIC_LIBS)
13
+ LINKER_LANGUAGE C
14
+ )
15
+ target_link_libraries(libsoundio_shared LINK_PUBLIC ${LIBSOUNDIO_LIBS})
16
+ - install(TARGETS libsoundio_shared DESTINATION ${CMAKE_INSTALL_LIBDIR})
17
+ + target_include_directories(libsoundio_shared PUBLIC $<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}>)
18
+ + install(TARGETS libsoundio_shared EXPORT libsoundio-export)
19
+ endif()
20
+
21
+ if(BUILD_STATIC_LIBS)
22
+ @@ -204,8 +206,7 @@ if(MSVC)
23
+ set(EXAMPLE_CFLAGS "/W4")
24
+ set(TEST_CFLAGS "${LIB_CFLAGS}")
25
+ set(TEST_LDFLAGS " ")
26
+ set(LIBM " ")
27
+ else()
28
+ - set(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} -Werror -pedantic")
29
+ set(LIB_CFLAGS "-std=c11 -fvisibility=hidden -Wall -Werror=strict-prototypes -Werror=old-style-definition -Werror=missing-prototypes -D_REENTRANT -D_POSIX_C_SOURCE=200809L -Wno-missing-braces")
30
+ set(EXAMPLE_CFLAGS "-std=c99 -Wall")
31
+ @@ -243,9 +244,26 @@ if(BUILD_STATIC_LIBS)
32
+ COMPILE_FLAGS ${LIB_CFLAGS}
33
+ LINKER_LANGUAGE C
34
+ )
35
+ - install(TARGETS libsoundio_static DESTINATION ${CMAKE_INSTALL_LIBDIR})
36
+ + target_link_libraries(libsoundio_static PUBLIC ${LIBSOUNDIO_LIBS})
37
+ + target_include_directories(libsoundio_static PUBLIC $<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}>)
38
+ + install(TARGETS libsoundio_static EXPORT libsoundio-export)
39
+ endif()
40
+
41
+ +add_library(libsoundio INTERFACE)
42
+ +if(BUILD_DYNAMIC_LIBS)
43
+ + target_link_libraries(libsoundio INTERFACE libsoundio_shared)
44
+ +else()
45
+ + target_link_libraries(libsoundio INTERFACE libsoundio_static)
46
+ +endif()
47
+ +install(TARGETS libsoundio EXPORT libsoundio-export)
48
+ +install(
49
+ + EXPORT libsoundio-export
50
+ + FILE libsoundio-config.cmake
51
+ + DESTINATION share/libsoundio/
52
+ + NAMESPACE ${PROJECT_NAME}::
53
+ + EXPORT_LINK_INTERFACE_LIBRARIES
54
+ +)
55
+ +
56
+ install(FILES
57
+ ${LIBSOUNDIO_HEADERS}
58
+ DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}/soundio")
third-party/DPVO/Pangolin/scripts/vcpkg/ports/libsoundio/portfile.cmake ADDED
@@ -0,0 +1,43 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ vcpkg_from_github(
2
+ OUT_SOURCE_PATH SOURCE_PATH
3
+ REPO andrewrk/libsoundio
4
+ REF 2.0.0
5
+ SHA512 347a9be1789a41e778ea8d0efa1d00e03e725a4ab65e3aaf6c71e49138643f08a50a81bd60087d86a3b4d63beaeec617e47ba6b81f829ece8a3ac17418eb5309
6
+ HEAD_REF master
7
+ PATCHES
8
+ fix_cmakelists.patch
9
+ )
10
+
11
+ string(COMPARE EQUAL "${VCPKG_LIBRARY_LINKAGE}" "dynamic" BUILD_DYNAMIC_LIBS)
12
+ string(COMPARE EQUAL "${VCPKG_LIBRARY_LINKAGE}" "static" BUILD_STATIC_LIBS)
13
+
14
+ vcpkg_check_features(OUT_FEATURE_OPTIONS FEATURE_OPTIONS
15
+ FEATURES
16
+ alsa ENABLE_ALSA
17
+ jack ENABLE_JACK
18
+ pulseaudio ENABLE_PULSEAUDIO
19
+ )
20
+
21
+ vcpkg_configure_cmake(
22
+ SOURCE_PATH ${SOURCE_PATH}
23
+ PREFER_NINJA
24
+ OPTIONS
25
+ -DBUILD_DYNAMIC_LIBS=${BUILD_DYNAMIC_LIBS}
26
+ -DBUILD_STATIC_LIBS=${BUILD_STATIC_LIBS}
27
+ -DBUILD_EXAMPLE_PROGRAMS=OFF
28
+ -DBUILD_TESTS=OFF
29
+ ${FEATURE_OPTIONS}
30
+ -DENABLE_COREAUDIO=${VCPKG_TARGET_IS_OSX}
31
+ -DENABLE_WASAPI=${VCPKG_TARGET_IS_WINDOWS}
32
+ )
33
+
34
+ vcpkg_install_cmake()
35
+ vcpkg_fixup_cmake_targets()
36
+ vcpkg_copy_pdbs()
37
+
38
+ if(NOT DEFINED VCPKG_BUILD_TYPE OR VCPKG_BUILD_TYPE STREQUAL "debug")
39
+ file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include)
40
+ file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/share)
41
+ endif()
42
+
43
+ file(INSTALL ${SOURCE_PATH}/LICENSE DESTINATION ${CURRENT_PACKAGES_DIR}/share/libsoundio RENAME copyright)
third-party/DPVO/Pangolin/scripts/vcpkg/ports/libsoundio/vcpkg.json ADDED
@@ -0,0 +1,22 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "name": "libsoundio",
3
+ "version": "2.0.0",
4
+ "port-version": 6,
5
+ "description": "libsoundio is C library providing cross-platform audio input and output.",
6
+ "homepage": "http://libsound.io/",
7
+ "supports": "!uwp",
8
+ "features": {
9
+ "alsa": {
10
+ "description": "ALSA backend for libsoundio"
11
+ },
12
+ "jack": {
13
+ "description": "JACK backend for libsoundio",
14
+ "dependencies": [
15
+ "jack2"
16
+ ]
17
+ },
18
+ "pulseaudio": {
19
+ "description": "PulseAudio backend for libsoundio"
20
+ }
21
+ }
22
+ }
third-party/DPVO/Pangolin/scripts/vcpkg/ports/libspatialindex/portfile.cmake ADDED
@@ -0,0 +1,26 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ vcpkg_from_github(
2
+ OUT_SOURCE_PATH SOURCE_PATH
3
+ REPO libspatialindex/libspatialindex
4
+ REF 1.9.3
5
+ SHA512 d4c608abbd631dc163b7b4fb6bf09dee3e85ce692a5f8875d51f05a26e09c75cd17dff1ed9d2c232a071f0f5864d21d877b4cbc252f3416896db24dfa3fa18cb
6
+ HEAD_REF master
7
+ PATCHES
8
+ static.patch
9
+ )
10
+
11
+ vcpkg_configure_cmake(
12
+ SOURCE_PATH ${SOURCE_PATH}
13
+ OPTIONS
14
+ -DCMAKE_DEBUG_POSTFIX=d
15
+ -DSIDX_BUILD_TESTS:BOOL=OFF
16
+ )
17
+
18
+ vcpkg_install_cmake()
19
+
20
+ vcpkg_copy_pdbs()
21
+
22
+ #Debug
23
+ file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include)
24
+
25
+ # Handle copyright
26
+ file(INSTALL ${SOURCE_PATH}/COPYING DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright)
third-party/DPVO/Pangolin/scripts/vcpkg/ports/libspatialindex/static.patch ADDED
@@ -0,0 +1,77 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ diff --git a/CMakeLists.txt b/CMakeLists.txt
2
+ index c34ee8d71..84e4a9247 100644
3
+ --- a/CMakeLists.txt
4
+ +++ b/CMakeLists.txt
5
+ @@ -43,7 +43,7 @@ SET(SIDX_VERSION_MINOR "9")
6
+ SET(SIDX_VERSION_PATCH "3")
7
+ SET(SIDX_LIB_VERSION "6.1.1")
8
+ SET(SIDX_LIB_SOVERSION "6")
9
+ -SET(BUILD_SHARED_LIBS ON)
10
+ +option(BUILD_SHARED_LIBS "Build shared libs" ON)
11
+
12
+
13
+ set(SIDX_VERSION_STRING "${SIDX_VERSION_MAJOR}.${SIDX_VERSION_MINOR}.${SIDX_VERSION_PATCH}")
14
+
15
+ diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
16
+ index 90f4501bc..aad327181 100644
17
+ --- a/src/CMakeLists.txt
18
+ +++ b/src/CMakeLists.txt
19
+ @@ -188,9 +188,13 @@ set(SIDX_SOURCES
20
+ #endif()
21
+
22
+
23
+ -add_library(${SIDX_LIB_NAME} ${SIDX_SOURCES})
24
+ -
25
+ -add_library(${SIDX_C_LIB_NAME} ${SIDX_CAPI_CPP})
26
+ +if(BUILD_SHARED_LIBS)
27
+ + add_library(${SIDX_LIB_NAME} SHARED ${SIDX_SOURCES})
28
+ + add_library(${SIDX_C_LIB_NAME} SHARED ${SIDX_CAPI_CPP})
29
+ +else(BUILD_SHARED_LIBS)
30
+ + add_library(${SIDX_LIB_NAME} STATIC ${SIDX_SOURCES})
31
+ + add_library(${SIDX_C_LIB_NAME} STATIC ${SIDX_CAPI_CPP})
32
+ +endif(BUILD_SHARED_LIBS)
33
+
34
+ target_link_libraries(${SIDX_C_LIB_NAME}
35
+ ${SIDX_LIB_NAME}
36
+ @@ -208,9 +212,10 @@ if(WIN32)
37
+ target_compile_options(${SIDX_LIB_NAME} PRIVATE "/wd4068")
38
+ target_compile_options(${SIDX_C_LIB_NAME} PRIVATE "/wd4068")
39
+
40
+ - target_compile_definitions(${SIDX_C_LIB_NAME} PRIVATE "-DSIDX_DLL_EXPORT=1")
41
+ - target_compile_definitions(${SIDX_LIB_NAME} PRIVATE "-DSIDX_DLL_EXPORT=1")
42
+ - if (NOT WITH_STATIC_SIDX)
43
+ + if (BUILD_SHARED_LIBS)
44
+ + target_compile_definitions(${SIDX_C_LIB_NAME} PRIVATE "-DSIDX_DLL_EXPORT=1")
45
+ + target_compile_definitions(${SIDX_LIB_NAME} PRIVATE "-DSIDX_DLL_EXPORT=1")
46
+ + else()
47
+ target_compile_definitions(${SIDX_LIB_NAME} PRIVATE "-DSIDX_DLL_IMPORT=1")
48
+ target_compile_definitions(${SIDX_C_LIB_NAME} PRIVATE "-DSIDX_DLL_IMPORT=1")
49
+ endif()
50
+
51
+ diff --git a/include/spatialindex/capi/sidx_export.h b/include/spatialindex/capi/sidx_export.h
52
+ index b6c84f1ef..7b0a39364 100644
53
+ --- a/include/spatialindex/capi/sidx_export.h
54
+ +++ b/include/spatialindex/capi/sidx_export.h
55
+ @@ -29,7 +29,7 @@
56
+ #pragma once
57
+
58
+ #ifndef SIDX_C_DLL
59
+ -#if defined(_MSC_VER)
60
+ +#if defined(_MSC_VER) && defined(SIDX_DLL_EXPORT)
61
+ # define SIDX_C_DLL __declspec(dllexport)
62
+ # define SIDX_DLL __declspec(dllexport)
63
+ #else
64
+
65
+ diff --git a/include/spatialindex/tools/Tools.h b/include/spatialindex/tools/Tools.h
66
+ index 322bc819e..46b62fa00 100644
67
+ --- a/include/spatialindex/tools/Tools.h
68
+ +++ b/include/spatialindex/tools/Tools.h
69
+ @@ -46,7 +46,7 @@
70
+ #ifdef SIDX_DLL_EXPORT
71
+ #define SIDX_DLL __declspec(dllexport)
72
+ #else
73
+ - #define SIDX_DLL __declspec(dllimport)
74
+ + #define SIDX_DLL
75
+ #endif
76
+
77
+ // Nuke this annoying warning. See http://www.unknownroad.com/rtfm/VisualStudio/warningC4251.html
third-party/DPVO/Pangolin/scripts/vcpkg/ports/libspatialindex/vcpkg.json ADDED
@@ -0,0 +1,9 @@
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "name": "libspatialindex",
3
+ "version": "1.9.3",
4
+ "description": "C++ implementation of R*-tree, an MVR-tree and a TPR-tree with C API.",
5
+ "homepage": "http://libspatialindex.github.com",
6
+ "dependencies": [
7
+ "zlib"
8
+ ]
9
+ }
third-party/DPVO/Pangolin/scripts/vcpkg/ports/libspatialite/fix-linux-configure.patch ADDED
@@ -0,0 +1,34 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ diff --git a/configure.ac b/configure.ac
2
+ index ead87caff..47abb90f0 100644
3
+ --- a/configure.ac
4
+ +++ b/configure.ac
5
+ @@ -302,6 +302,7 @@ if test x"$enable_geos" != "xno"; then
6
+ #-----------------------------------------------------------------------
7
+ # --with-geosconfig
8
+ #
9
+ + if 0; then
10
+ AC_ARG_WITH([geosconfig],
11
+ [AS_HELP_STRING([--with-geosconfig=FILE], [specify an alternative geos-config file])],
12
+ [GEOSCONFIG="$withval"], [GEOSCONFIG=""])
13
+ @@ -327,6 +328,7 @@ if test x"$enable_geos" != "xno"; then
14
+ # Extract the linker and include flags
15
+ GEOS_LDFLAGS=`$GEOSCONFIG --ldflags`
16
+ GEOS_CFLAGS=-I`$GEOSCONFIG --includes`
17
+ + fi
18
+ AC_SUBST([GEOS_LDFLAGS])
19
+ AC_SUBST([GEOS_CFLAGS])
20
+ # Ensure that we can parse geos_c.h
21
+ @@ -335,11 +337,13 @@ if test x"$enable_geos" != "xno"; then
22
+ AC_CHECK_HEADERS([geos_c.h],, [AC_MSG_ERROR([could not find geos_c.h - you may need to specify the directory of a geos-config file using --with-geosconfig])])
23
+ CPPFLAGS="$CPPFLAGS_SAVE"
24
+ # Ensure we can link against libgeos_c
25
+ + if 0; then
26
+ LIBS_SAVE="$LIBS"
27
+ LIBS="$GEOS_LDFLAGS"
28
+ AC_SEARCH_LIBS(GEOSCoveredBy,geos_c,,AC_MSG_ERROR([could not find libgeos_c (or obsolete 'libgeos_c' < v.3.3.0 found) - you may need to specify the directory of a geos-config file using --with-geosconfig]))
29
+ LIBS="$LIBS_SAVE"
30
+ LIBS="$LIBS $GEOS_LDFLAGS -lgeos_c"
31
+ + fi
32
+
33
+ #-----------------------------------------------------------------------
34
+ # --enable-controlpoints
third-party/DPVO/Pangolin/scripts/vcpkg/ports/libspatialite/fix-makefiles.patch ADDED
@@ -0,0 +1,44 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ diff --git a/makefile.vc b/makefile.vc
2
+ index 120090eba..049c0d0b0 100644
3
+ --- a/makefile.vc
4
+ +++ b/makefile.vc
5
+ @@ -93,7 +93,7 @@ LIBOBJ = src\gaiaaux\gg_sqlaux.obj src\gaiaaux\gg_utf8.obj \
6
+ SPATIALITE_DLL = spatialite$(VERSION).dll
7
+
8
+ CFLAGS = /nologo -I.\src\headers -I.\src\topology \
9
+ - -I. -IC:\OSGeo4W\include $(OPTFLAGS)
10
+ + -I. $(OPTFLAGS)
11
+
12
+ default: all
13
+
14
+ @@ -107,12 +107,9 @@ spatialite.lib: $(LIBOBJ)
15
+ $(SPATIALITE_DLL): spatialite_i.lib
16
+
17
+ spatialite_i.lib: $(LIBOBJ)
18
+ - link /dll /out:$(SPATIALITE_DLL) \
19
+ + link $(LINK_FLAGS) /dll /out:$(SPATIALITE_DLL) \
20
+ /implib:spatialite_i.lib $(LIBOBJ) \
21
+ - C:\OSGeo4W\lib\proj_i.lib C:\OSGeo4W\lib\geos_c.lib \
22
+ - C:\OSGeo4w\lib\freexl_i.lib C:\OSGeo4w\lib\iconv.lib \
23
+ - C:\OSGeo4W\lib\sqlite3_i.lib C:\OSGeo4W\lib\zlib.lib \
24
+ - C:\OSGeo4W\lib\libxml2.lib C:\OSGeo4W\lib\librttopo.lib
25
+ + $(LIBS_ALL)
26
+ if exist $(SPATIALITE_DLL).manifest mt -manifest \
27
+ $(SPATIALITE_DLL).manifest -outputresource:$(SPATIALITE_DLL);2
28
+
29
+
30
+ diff --git a/nmake.opt b/nmake.opt
31
+ index c048aa758..be68e21cd 100644
32
+ --- a/nmake.opt
33
+ +++ b/nmake.opt
34
+ @@ -1,8 +1,8 @@
35
+ # Directory tree where SpatiaLite will be installed.
36
+ -INSTDIR=C:\OSGeo4W
37
+ +INSTDIR=$(INST_DIR)
38
+
39
+ # Uncomment the first for an optimized build, or the second for debug.
40
+ -OPTFLAGS= /nologo /Ox /fp:precise /W4 /MD /D_CRT_SECURE_NO_WARNINGS \
41
+ +OPTFLAGS= /nologo /fp:precise /W4 $(CL_FLAGS) /D_CRT_SECURE_NO_WARNINGS \
42
+ /DDLL_EXPORT /DYY_NO_UNISTD_H
43
+ #OPTFLAGS= /nologo /Zi /MD /Fdspatialite.pdb /DDLL_EXPORT
44
+
third-party/DPVO/Pangolin/scripts/vcpkg/ports/libspatialite/gaiaconfig-msvc.patch ADDED
@@ -0,0 +1,31 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ diff --git a/src/headers/spatialite/gaiaconfig-msvc.h b/src/headers/spatialite/gaiaconfig-msvc.h
2
+ index 37f0bd1..0053258 100644
3
+ --- a/src/headers/spatialite/gaiaconfig-msvc.h
4
+ +++ b/src/headers/spatialite/gaiaconfig-msvc.h
5
+ @@ -2,7 +2,7 @@
6
+ /* ./src/headers/spatialite/gaiaconfig-msvc.h.in - manually maintained */
7
+
8
+ /* Should be defined in order to enable GCP support. */
9
+ -#define ENABLE_GCP 1
10
+ +// #define ENABLE_GCP 1
11
+
12
+ /* Should be defined in order to enable GeoPackage support. */
13
+ #define ENABLE_GEOPACKAGE 1
14
+ @@ -11,7 +11,7 @@
15
+ #define ENABLE_LIBXML2 1
16
+
17
+ /* Should be defined in order to enable RTTOPO support. */
18
+ -#define ENABLE_RTTOPO 1
19
+ +// #define ENABLE_RTTOPO 1
20
+
21
+ /* Should be defined in order to enable GEOS_370 support. */
22
+ #define GEOS_370 1
23
+ @@ -32,7 +32,7 @@
24
+ /* #undef OMIT_FREEXL */
25
+
26
+ /* Should be defined in order to disable GEOCALLBACKS support. */
27
+ -#define OMIT_GEOCALLBACKS 1
28
+ +// #define OMIT_GEOCALLBACKS 1
29
+
30
+ /* Should be defined in order to disable GEOS support. */
31
+ /* #undef OMIT_GEOS */
third-party/DPVO/Pangolin/scripts/vcpkg/ports/libspatialite/portfile.cmake ADDED
@@ -0,0 +1,239 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ set(LIBSPATIALITE_VERSION_STR "5.0.1")
2
+ vcpkg_download_distfile(ARCHIVE
3
+ URLS "https://www.gaia-gis.it/gaia-sins/libspatialite-sources/libspatialite-${LIBSPATIALITE_VERSION_STR}.tar.gz"
4
+ FILENAME "libspatialite-${LIBSPATIALITE_VERSION_STR}.tar.gz"
5
+ SHA512 c2552994bc30d69d1e80aa274760f048cd384f71e8350a1e48a47cb8222ba71a1554a69c6534eedde9a09dc582c39c089967bcc1c57bf158cc91a3e7b1840ddf
6
+ )
7
+
8
+ vcpkg_extract_source_archive_ex(
9
+ OUT_SOURCE_PATH SOURCE_PATH
10
+ ARCHIVE "${ARCHIVE}"
11
+ PATCHES
12
+ fix-makefiles.patch
13
+ fix-linux-configure.patch
14
+ gaiaconfig-msvc.patch
15
+ )
16
+
17
+ vcpkg_check_features(OUT_FEATURE_OPTIONS unused
18
+ FEATURES
19
+ freexl ENABLE_FREEXL
20
+ gcp ENABLE_GCP
21
+ geocallbacks ENABLE_GEOCALLBACKS
22
+ rttopo ENABLE_RTTOPO
23
+ )
24
+
25
+ set(pkg_config_modules geos libxml-2.0 proj sqlite3 zlib)
26
+ if(ENABLE_FREEXL)
27
+ list(APPEND pkg_config_modules freexl)
28
+ endif()
29
+ if(ENABLE_RTTOPO)
30
+ list(APPEND pkg_config_modules rttopo)
31
+ endif()
32
+
33
+ if(VCPKG_TARGET_IS_WINDOWS AND NOT VCPKG_TARGET_IS_MINGW)
34
+ set(CL_FLAGS "")
35
+ if(NOT ENABLE_FREEXL)
36
+ string(APPEND CL_FLAGS " /DOMIT_FREEXL")
37
+ endif()
38
+ if(ENABLE_GCP)
39
+ string(APPEND CL_FLAGS " /DENABLE_GCP")
40
+ endif()
41
+ if(NOT ENABLE_GEOCALLBACKS)
42
+ string(APPEND CL_FLAGS " /DOMIT_GEOCALLBACKS")
43
+ endif()
44
+ if(ENABLE_RTTOPO)
45
+ string(APPEND CL_FLAGS " /DENABLE_RTTOPO")
46
+ endif()
47
+
48
+ x_vcpkg_pkgconfig_get_modules(
49
+ PREFIX PKGCONFIG
50
+ MODULES --msvc-syntax ${pkg_config_modules}
51
+ LIBS
52
+ CFLAGS
53
+ )
54
+
55
+ set(CL_FLAGS_RELEASE "${CL_FLAGS} ${PKGCONFIG_CFLAGS_RELEASE}")
56
+ set(CL_FLAGS_DEBUG "${CL_FLAGS} ${PKGCONFIG_CFLAGS_DEBUG}")
57
+
58
+ # vcpkg_build_nmake doesn't supply cmake's implicit link libraries
59
+ if(PKGCONFIG_LIBS_DEBUG MATCHES "libcrypto")
60
+ string(APPEND PKGCONFIG_LIBS_DEBUG " user32.lib")
61
+ endif()
62
+ if(PKGCONFIG_LIBS_RELEASE MATCHES "libcrypto")
63
+ string(APPEND PKGCONFIG_LIBS_RELEASE " user32.lib")
64
+ endif()
65
+
66
+ string(JOIN " " LIBS_ALL_DEBUG
67
+ "/LIBPATH:${CURRENT_INSTALLED_DIR}/debug/lib"
68
+ "${PKGCONFIG_LIBS_DEBUG}"
69
+ iconv.lib charset.lib
70
+ )
71
+ string(JOIN " " LIBS_ALL_RELEASE
72
+ "/LIBPATH:${CURRENT_INSTALLED_DIR}/lib"
73
+ "${PKGCONFIG_LIBS_RELEASE}"
74
+ iconv.lib charset.lib
75
+ )
76
+
77
+ string(REPLACE "/" "\\\\" INST_DIR "${CURRENT_PACKAGES_DIR}")
78
+
79
+ if(ENABLE_RTTOPO)
80
+ list(APPEND pkg_config_modules rttopo)
81
+ endif()
82
+ vcpkg_install_nmake(
83
+ SOURCE_PATH "${SOURCE_PATH}"
84
+ OPTIONS_RELEASE
85
+ "CL_FLAGS=${CL_FLAGS_RELEASE}"
86
+ "INST_DIR=${INST_DIR}"
87
+ "LIBS_ALL=${LIBS_ALL_RELEASE}"
88
+ OPTIONS_DEBUG
89
+ "CL_FLAGS=${CL_FLAGS_DEBUG}"
90
+ "INST_DIR=${INST_DIR}\\debug"
91
+ "LIBS_ALL=${LIBS_ALL_DEBUG}"
92
+ "LINK_FLAGS=/debug"
93
+ )
94
+
95
+ vcpkg_copy_pdbs()
96
+
97
+ file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/include")
98
+
99
+ if(VCPKG_LIBRARY_LINKAGE STREQUAL "static")
100
+ file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/bin")
101
+ file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/bin")
102
+ file(REMOVE "${CURRENT_PACKAGES_DIR}/lib/spatialite_i.lib")
103
+ file(REMOVE "${CURRENT_PACKAGES_DIR}/debug/lib/spatialite_i.lib")
104
+ else()
105
+ file(REMOVE "${CURRENT_PACKAGES_DIR}/lib/spatialite.lib")
106
+ file(REMOVE "${CURRENT_PACKAGES_DIR}/debug/lib/spatialite.lib")
107
+ file(RENAME "${CURRENT_PACKAGES_DIR}/lib/spatialite_i.lib" "${CURRENT_PACKAGES_DIR}/lib/spatialite.lib")
108
+ file(RENAME "${CURRENT_PACKAGES_DIR}/debug/lib/spatialite_i.lib" "${CURRENT_PACKAGES_DIR}/debug/lib/spatialite.lib")
109
+ endif()
110
+
111
+ set(infile "${SOURCE_PATH}/spatialite.pc.in")
112
+ set(VERSION "${LIBSPATIALITE_VERSION_STR}")
113
+ set(libdir [[${prefix}/lib]])
114
+ set(exec_prefix [[${prefix}]])
115
+ list(JOIN pkg_config_modules " " requires_private)
116
+ if(NOT DEFINED VCPKG_BUILD_TYPE OR VCPKG_BUILD_TYPE STREQUAL "release")
117
+ set(includedir [[${prefix}/include]])
118
+ set(outfile "${CURRENT_PACKAGES_DIR}/lib/pkgconfig/spatialite.pc")
119
+ configure_file("${infile}" "${outfile}" @ONLY)
120
+ vcpkg_replace_string("${outfile}" "Libs:" "Requires.private: ${requires_private}\nLibs.private: -liconv -lcharset\nLibs:")
121
+ vcpkg_replace_string("${outfile}" " -lm" " ")
122
+ endif()
123
+ if(NOT DEFINED VCPKG_BUILD_TYPE OR VCPKG_BUILD_TYPE STREQUAL "debug")
124
+ set(includedir [[${prefix}/../include]])
125
+ set(outfile "${CURRENT_PACKAGES_DIR}/debug/lib/pkgconfig/spatialite.pc")
126
+ configure_file("${infile}" "${outfile}" @ONLY)
127
+ vcpkg_replace_string("${outfile}" "Libs:" "Requires.private: ${requires_private}\nLibs.private: -liconv -lcharset\nLibs:")
128
+ vcpkg_replace_string("${outfile}" " -lm" " ")
129
+ endif()
130
+ else()
131
+ if(ENABLE_FREEXL)
132
+ set(FREEXL_OPTION "--enable-freexl")
133
+ else()
134
+ set(FREEXL_OPTION "--disable-freexl")
135
+ endif()
136
+ if(ENABLE_GCP)
137
+ set(GCP_OPTION "--enable-gcp")
138
+ else()
139
+ set(GCP_OPTION "--disable-gcp")
140
+ endif()
141
+ if(ENABLE_GEOCALLBACKS)
142
+ set(GEOCALLBACKS_OPTION "--enable-geocallbacks")
143
+ else()
144
+ set(GEOCALLBACKS_OPTION "--disable-geocallbacks")
145
+ endif()
146
+ if(ENABLE_RTTOPO)
147
+ set(RTTOPO_OPTION "--enable-rttopo")
148
+ else()
149
+ set(RTTOPO_OPTION "--disable-rttopo")
150
+ endif()
151
+ list(REMOVE_ITEM pkg_config_modules libxml2) # handled properly by configure
152
+ x_vcpkg_pkgconfig_get_modules(
153
+ PREFIX PKGCONFIG
154
+ MODULES ${pkg_config_modules}
155
+ LIBS
156
+ )
157
+ if(VCPKG_TARGET_IS_MINGW)
158
+ # Avoid system libs (as detected by cmake) in exported pc files
159
+ set(SYSTEM_LIBS "")
160
+ else()
161
+ set(SYSTEM_LIBS "\$LIBS")
162
+ endif()
163
+ # libspatialite needs some targets literally
164
+ if(VCPKG_TARGET_IS_ANDROID)
165
+ set(TARGET_ALIAS "--target=android")
166
+ elseif(VCPKG_TARGET_IS_MINGW)
167
+ set(TARGET_ALIAS "--target=mingw32")
168
+ elseif(VCPKG_TARGET_IS_OSX)
169
+ set(TARGET_ALIAS "--target=macosx")
170
+ else()
171
+ set(TARGET_ALIAS "")
172
+ endif()
173
+ vcpkg_configure_make(
174
+ SOURCE_PATH "${SOURCE_PATH}"
175
+ AUTOCONFIG
176
+ OPTIONS
177
+ ${TARGET_ALIAS}
178
+ ${FREEXL_OPTION}
179
+ ${GCP_OPTION}
180
+ ${GEOCALLBACKS_OPTION}
181
+ ${RTTOPO_OPTION}
182
+ "--disable-examples"
183
+ "--disable-minizip"
184
+ OPTIONS_DEBUG
185
+ "LIBS=${PKGCONFIG_LIBS_DEBUG} ${SYSTEM_LIBS}"
186
+ OPTIONS_RELEASE
187
+ "LIBS=${PKGCONFIG_LIBS_RELEASE} ${SYSTEM_LIBS}"
188
+ )
189
+
190
+ # automake adds the basedir of the generated config to `DEFAULT_INCLUDES`,
191
+ # but libspatialite uses `#include <spatialite/gaiaconfig.h>`.
192
+ file(GLOB_RECURSE makefiles
193
+ "${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-dbg/Makefile"
194
+ "${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel/Makefile"
195
+ )
196
+ foreach(makefile IN LISTS makefiles)
197
+ vcpkg_replace_string("${makefile}" " -I$(top_builddir)/./src/headers/spatialite" " -I$(top_builddir)/./src/headers")
198
+ endforeach()
199
+
200
+ vcpkg_install_make()
201
+
202
+ if(VCPKG_TARGET_IS_MINGW AND VCPKG_LIBRARY_LINKAGE STREQUAL "dynamic")
203
+ if(NOT DEFINED VCPKG_BUILD_TYPE OR VCPKG_BUILD_TYPE STREQUAL "release")
204
+ file(MAKE_DIRECTORY "${CURRENT_PACKAGES_DIR}/plugins/${PORT}")
205
+ file(RENAME "${CURRENT_PACKAGES_DIR}/lib/mod_spatialite.dll" "${CURRENT_PACKAGES_DIR}/plugins/${PORT}/mod_spatialite.dll")
206
+ endif()
207
+ if(NOT DEFINED VCPKG_BUILD_TYPE OR VCPKG_BUILD_TYPE STREQUAL "debug")
208
+ file(MAKE_DIRECTORY "${CURRENT_PACKAGES_DIR}/debug/plugins/${PORT}")
209
+ file(RENAME "${CURRENT_PACKAGES_DIR}/debug/lib/mod_spatialite.dll" "${CURRENT_PACKAGES_DIR}/debug/plugins/${PORT}/mod_spatialite.dll")
210
+ endif()
211
+ endif()
212
+ endif()
213
+
214
+ vcpkg_fixup_pkgconfig()
215
+
216
+ # Handle copyright
217
+ set(outfile "${CURRENT_PACKAGES_DIR}/share/${PORT}/copyright")
218
+ if(NOT ENABLE_GCP AND NOT ENABLE_RTTOPO)
219
+ file(READ "${SOURCE_PATH}/COPYING" mpl)
220
+ file(WRITE "${outfile}"
221
+ "SpatiaLite[${FEATURES}] is licensed under the MPL tri-license terms;\n"
222
+ "you are free to choose the best-fit license between:\n"
223
+ "- the MPL 1.1\n"
224
+ "- the GPL v2.0 or any subsequent version\n"
225
+ "- the LGPL v2.1 or any subsequent version.\n\n"
226
+ "# MPL 1.1 (from COPYING)\n\n"
227
+ "${mpl}\n"
228
+ )
229
+ else()
230
+ file(WRITE "${outfile}"
231
+ "SpatiaLite[${FEATURES}] is licensed under:\n"
232
+ "the GPL v2.0 or any subsequent version.\n\n"
233
+ )
234
+ endif()
235
+ file(READ "${SOURCE_PATH}/src/control_points/COPYING" gpl)
236
+ file(APPEND "${outfile}"
237
+ "# GPL v2.0 (from src/control_points/COPYING)\n\n"
238
+ "${gpl}\n"
239
+ )
third-party/DPVO/Pangolin/scripts/vcpkg/ports/libspatialite/vcpkg.json ADDED
@@ -0,0 +1,47 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "name": "libspatialite",
3
+ "version": "5.0.1",
4
+ "port-version": 4,
5
+ "description": "SpatiaLite is an open source library intended to extend the SQLite core to support fully fledged Spatial SQL capabilities.",
6
+ "homepage": "https://www.gaia-gis.it/gaia-sins/libspatialite-sources",
7
+ "license": "MPL-1.1 OR GPL-2.0-or-later OR LGPL-2.1-or-later",
8
+ "dependencies": [
9
+ "geos",
10
+ "libiconv",
11
+ "libxml2",
12
+ "proj",
13
+ {
14
+ "name": "sqlite3",
15
+ "default-features": false,
16
+ "features": [
17
+ "rtree"
18
+ ]
19
+ },
20
+ "vcpkg-pkgconfig-get-modules",
21
+ "zlib"
22
+ ],
23
+ "default-features": [
24
+ "freexl",
25
+ "geocallbacks"
26
+ ],
27
+ "features": {
28
+ "freexl": {
29
+ "description": "FreeXL spreadsheet file support.",
30
+ "dependencies": [
31
+ "freexl"
32
+ ]
33
+ },
34
+ "gcp": {
35
+ "description": "Ground control points support. This feature reduces the license options to GPLv2+."
36
+ },
37
+ "geocallbacks": {
38
+ "description": "Geometry callbacks support."
39
+ },
40
+ "rttopo": {
41
+ "description": "RTTOPO support. This feature reduces the license options to GPLv2+.",
42
+ "dependencies": [
43
+ "librttopo"
44
+ ]
45
+ }
46
+ }
47
+ }
third-party/DPVO/Pangolin/scripts/vcpkg/ports/libspnav/portfile.cmake ADDED
@@ -0,0 +1,43 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ vcpkg_from_github(
2
+ OUT_SOURCE_PATH SOURCE_PATH
3
+ REPO FreeSpacenav/libspnav
4
+ REF libspnav-0.2.3 # v0.2.3 seems to be outdated. libspnav-0.2.3 is the same as 0.2.3 on their sourceforge
5
+ SHA512 6c06344813ddf7e2bc7981932b4a901334de2b91d8c3abb23828869070dc73ed1c19c5bf7ff9338cc673c8f0dc7394608652afd0cdae093149c0a24460f0a8fb
6
+ HEAD_REF master
7
+ )
8
+
9
+ vcpkg_configure_make(
10
+ SOURCE_PATH ${SOURCE_PATH}
11
+ OPTIONS_DEBUG "--enable-debug"
12
+ OPTIONS_RELEASE "--disable-debug"
13
+ )
14
+
15
+ vcpkg_install_make()
16
+
17
+ macro(CLEANUP WHERE)
18
+ set(WORKDIR ${CURRENT_PACKAGES_DIR}/${WHERE})
19
+ if ("${WHERE}" STREQUAL "debug")
20
+ file(REMOVE_RECURSE ${WORKDIR}/include)
21
+ endif ()
22
+ file(REMOVE ${WORKDIR}/lib/libspnav.so)
23
+ file(REMOVE ${WORKDIR}/lib/libspnav.so.0)
24
+ file(RENAME ${WORKDIR}/lib/libspnav.so.0.1 ${WORKDIR}/lib/libspnav.so)
25
+ if (VCPKG_LIBRARY_LINKAGE STREQUAL "static")
26
+ file(REMOVE ${WORKDIR}/lib/libspnav.so)
27
+ else ()
28
+ file(REMOVE ${WORKDIR}/lib/libspnav.a)
29
+ endif ()
30
+ endmacro()
31
+
32
+ if (NOT VCPKG_BUILD_TYPE OR VCPKG_BUILD_TYPE STREQUAL "release")
33
+ cleanup("")
34
+ endif ()
35
+
36
+ if (NOT VCPKG_BUILD_TYPE OR VCPKG_BUILD_TYPE STREQUAL "debug")
37
+ cleanup("debug")
38
+ endif ()
39
+
40
+ file(INSTALL ${SOURCE_PATH}/README
41
+ DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT}
42
+ RENAME copyright
43
+ )
third-party/DPVO/Pangolin/scripts/vcpkg/ports/libspnav/vcpkg.json ADDED
@@ -0,0 +1,8 @@
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "name": "libspnav",
3
+ "version": "0.2.3",
4
+ "port-version": 2,
5
+ "description": "Library for communicating with spacenavd or 3dxsrv to get input from 6-dof devices.",
6
+ "homepage": "https://github.com/FreeSpacenav/libspnav",
7
+ "supports": "linux"
8
+ }
third-party/DPVO/Pangolin/scripts/vcpkg/ports/libsquish/export-target.patch ADDED
@@ -0,0 +1,19 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ diff --git a/CMakeLists.txt b/CMakeLists.txt
2
+ index a3ecdde..94c7b3d 100644
3
+ --- a/CMakeLists.txt
4
+ +++ b/CMakeLists.txt
5
+ @@ -120,8 +120,14 @@ INCLUDE(GNUInstallDirs)
6
+
7
+ INSTALL(
8
+ TARGETS squish
9
+ + EXPORT unofficial-libsquishConfig
10
+ LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
11
+ ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}
12
+ RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
13
+ PUBLIC_HEADER DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}
14
+ )
15
+ +
16
+ +INSTALL(EXPORT unofficial-libsquishConfig
17
+ + NAMESPACE unofficial::libsquish::
18
+ + DESTINATION share/unofficial-libsquish
19
+ +)
third-party/DPVO/Pangolin/scripts/vcpkg/ports/libsquish/fix-export-symbols.patch ADDED
@@ -0,0 +1,105 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ diff --git a/CMakeLists.txt b/CMakeLists.txt
2
+ index a36e574..a3ecdde 100644
3
+ --- a/CMakeLists.txt
4
+ +++ b/CMakeLists.txt
5
+ @@ -75,6 +75,13 @@ INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR})
6
+
7
+ ADD_LIBRARY(squish ${SQUISH_SRCS} ${SQUISH_HDRS})
8
+
9
+ +INCLUDE(GenerateExportHeader)
10
+ +GENERATE_EXPORT_HEADER(squish
11
+ + EXPORT_FILE_NAME ${CMAKE_CURRENT_SOURCE_DIR}/squish_export.h
12
+ + )
13
+ +
14
+ +list(APPEND SQUISH_HDRS "squish_export.h")
15
+ +
16
+ SET_TARGET_PROPERTIES(
17
+ squish PROPERTIES
18
+ PUBLIC_HEADER "${SQUISH_HDRS}"
19
+ @@ -109,9 +116,12 @@ IF (BUILD_SQUISH_EXTRA)
20
+ ENDIF (PNG_FOUND)
21
+ ENDIF (BUILD_SQUISH_EXTRA)
22
+
23
+ +INCLUDE(GNUInstallDirs)
24
+ +
25
+ INSTALL(
26
+ TARGETS squish
27
+ - LIBRARY DESTINATION lib
28
+ - ARCHIVE DESTINATION lib
29
+ - PUBLIC_HEADER DESTINATION include
30
+ + LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
31
+ + ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}
32
+ + RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
33
+ + PUBLIC_HEADER DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}
34
+ )
35
+ diff --git a/squish.h b/squish.h
36
+ index 14c9bb5..aaffbb2 100644
37
+ --- a/squish.h
38
+ +++ b/squish.h
39
+ @@ -26,6 +26,8 @@
40
+ #ifndef SQUISH_H
41
+ #define SQUISH_H
42
+
43
+ +#include "squish_export.h"
44
+ +
45
+ //! All squish API functions live in this namespace.
46
+ namespace squish {
47
+
48
+ @@ -115,5 +117,5 @@
49
+ */
50
+ -void CompressMasked( u8 const* rgba, int mask, void* block, int flags, float* metric = 0 );
51
+ +SQUISH_EXPORT void CompressMasked( u8 const* rgba, int mask, void* block, int flags, float* metric = 0 );
52
+
53
+ // -----------------------------------------------------------------------------
54
+
55
+ @@ -176,7 +178,7 @@ inline void Compress( u8 const* rgba, void* block, int flags, float* metric = 0
56
+ however, DXT1 will be used by default if none is specified. All other flags
57
+ are ignored.
58
+ */
59
+ -void Decompress( u8* rgba, void const* block, int flags );
60
+ +SQUISH_EXPORT void Decompress( u8* rgba, void const* block, int flags );
61
+
62
+ // -----------------------------------------------------------------------------
63
+
64
+ @@ -194,7 +196,7 @@ void Decompress( u8* rgba, void const* block, int flags );
65
+ function supports arbitrary size images by allowing the outer blocks to
66
+ be only partially used.
67
+ */
68
+ -int GetStorageRequirements( int width, int height, int flags );
69
+ +SQUISH_EXPORT int GetStorageRequirements( int width, int height, int flags );
70
+
71
+ // -----------------------------------------------------------------------------
72
+
73
+ @@ -249,8 +251,8 @@ int GetStorageRequirements( int width, int height, int flags );
74
+ Windows platform but for other platforms like MacOS X a different
75
+ gamma value may be more suitable.
76
+ */
77
+ -void CompressImage( u8 const* rgba, int width, int height, int pitch, void* blocks, int flags, float* metric = 0 );
78
+ -void CompressImage( u8 const* rgba, int width, int height, void* blocks, int flags, float* metric = 0 );
79
+ +SQUISH_EXPORT void CompressImage( u8 const* rgba, int width, int height, int pitch, void* blocks, int flags, float* metric = 0 );
80
+ +SQUISH_EXPORT void CompressImage( u8 const* rgba, int width, int height, void* blocks, int flags, float* metric = 0 );
81
+
82
+ // -----------------------------------------------------------------------------
83
+
84
+ @@ -274,8 +276,8 @@ void CompressImage( u8 const* rgba, int width, int height, void* blocks, int fla
85
+
86
+ Internally this function calls squish::Decompress for each block.
87
+ */
88
+ -void DecompressImage( u8* rgba, int width, int height, int pitch, void const* blocks, int flags );
89
+ -void DecompressImage( u8* rgba, int width, int height, void const* blocks, int flags );
90
+ +SQUISH_EXPORT void DecompressImage( u8* rgba, int width, int height, int pitch, void const* blocks, int flags );
91
+ +SQUISH_EXPORT void DecompressImage( u8* rgba, int width, int height, void const* blocks, int flags );
92
+
93
+ // -----------------------------------------------------------------------------
94
+
95
+ @@ -299,8 +301,8 @@ void DecompressImage( u8* rgba, int width, int height, void const* blocks, int f
96
+
97
+ Internally this function calls squish::Decompress for each block.
98
+ */
99
+ -void ComputeMSE(u8 const *rgba, int width, int height, int pitch, u8 const *dxt, int flags, double &colourMSE, double &alphaMSE);
100
+ -void ComputeMSE(u8 const *rgba, int width, int height, u8 const *dxt, int flags, double &colourMSE, double &alphaMSE);
101
+ +SQUISH_EXPORT void ComputeMSE(u8 const *rgba, int width, int height, int pitch, u8 const *dxt, int flags, double &colourMSE, double &alphaMSE);
102
+ +SQUISH_EXPORT void ComputeMSE(u8 const *rgba, int width, int height, u8 const *dxt, int flags, double &colourMSE, double &alphaMSE);
103
+
104
+ // -----------------------------------------------------------------------------
105
+
third-party/DPVO/Pangolin/scripts/vcpkg/ports/libsquish/portfile.cmake ADDED
@@ -0,0 +1,29 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ vcpkg_from_sourceforge(
2
+ OUT_SOURCE_PATH SOURCE_PATH
3
+ REPO libsquish
4
+ FILENAME "libsquish-1.15.tgz"
5
+ NO_REMOVE_ONE_LEVEL
6
+ SHA512 5b569b7023874c7a43063107e2e428ea19e6eb00de045a4a13fafe852ed5402093db4b65d540b5971ec2be0d21cb97dfad9161ebfe6cf6e5376174ff6c6c3e7a
7
+ PATCHES
8
+ fix-export-symbols.patch
9
+ export-target.patch
10
+ )
11
+
12
+ vcpkg_check_features(OUT_FEATURE_OPTIONS FEATURE_OPTIONS
13
+ FEATURES
14
+ sse2 BUILD_SQUISH_WITH_SSE2
15
+ )
16
+
17
+ vcpkg_cmake_configure(
18
+ SOURCE_PATH "${SOURCE_PATH}"
19
+ DISABLE_PARALLEL_CONFIGURE
20
+ OPTIONS ${FEATURE_OPTIONS}
21
+ )
22
+
23
+ vcpkg_cmake_install()
24
+
25
+ vcpkg_cmake_config_fixup(PACKAGE_NAME unofficial-libsquish CONFIG_PATH share/unofficial-libsquish)
26
+
27
+ file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/include" "${CURRENT_PACKAGES_DIR}/debug/share")
28
+
29
+ file(INSTALL "${SOURCE_PATH}/LICENSE.txt" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}" RENAME copyright)
third-party/DPVO/Pangolin/scripts/vcpkg/ports/libsquish/vcpkg.json ADDED
@@ -0,0 +1,24 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "name": "libsquish",
3
+ "version": "1.15",
4
+ "port-version": 10,
5
+ "description": "Open source DXT compression library.",
6
+ "homepage": "https://sourceforge.net/projects/libsquish",
7
+ "license": "MIT",
8
+ "dependencies": [
9
+ {
10
+ "name": "vcpkg-cmake",
11
+ "host": true
12
+ },
13
+ {
14
+ "name": "vcpkg-cmake-config",
15
+ "host": true
16
+ }
17
+ ],
18
+ "features": {
19
+ "sse2": {
20
+ "description": "Build with SSE2",
21
+ "supports": "osx"
22
+ }
23
+ }
24
+ }
third-party/DPVO/Pangolin/scripts/vcpkg/ports/libsrt/fix-dependency-install.patch ADDED
@@ -0,0 +1,38 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ diff --git a/CMakeLists.txt b/CMakeLists.txt
2
+ --- a/CMakeLists.txt
3
+ +++ b/CMakeLists.txt
4
+ @@ -1008,6 +1008,7 @@ set (INSTALL_SHARED_DIR ${CMAKE_INSTALL_LIBDIR})
5
+ if (CYGWIN)
6
+ set (INSTALL_SHARED_DIR ${CMAKE_INSTALL_BINDIR})
7
+ endif()
8
+ +set(CMAKE_INSTALL_INCLUDEDIR include)
9
+
10
+ message(STATUS "INSTALL DIRS: bin=${CMAKE_INSTALL_BINDIR} lib=${CMAKE_INSTALL_LIBDIR} shlib=${INSTALL_SHARED_DIR} include=${CMAKE_INSTALL_INCLUDEDIR}")
11
+
12
+ @@ -1085,7 +1085,7 @@
13
+
14
+ macro(srt_add_program name)
15
+ srt_add_program_dont_install(${name} ${ARGN})
16
+ - install(TARGETS ${name} RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR})
17
+ + install(TARGETS ${name} RUNTIME DESTINATION tools)
18
+ endmacro()
19
+
20
+ macro(srt_make_application name)
21
+ @@ -1124,7 +1124,7 @@ endmacro()
22
+ macro(srt_add_application name) # ARGN=sources...
23
+ srt_add_program(${name} apps/${name}.cpp ${ARGN})
24
+ srt_make_application(${name})
25
+ - install(TARGETS ${name} RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR})
26
+ + install(TARGETS ${name} RUNTIME DESTINATION tools)
27
+ endmacro()
28
+
29
+ ## FIXME: transmitmedia.cpp does not build on OpenBSD
30
+ @@ -1324,7 +1324,7 @@ if (ENABLE_UNITTESTS AND ENABLE_CXX11)
31
+ endif()
32
+
33
+
34
+ -install(PROGRAMS scripts/srt-ffplay DESTINATION ${CMAKE_INSTALL_BINDIR})
35
+ +install(PROGRAMS scripts/srt-ffplay DESTINATION tools)
36
+
37
+
38
+ if (DEFINED SRT_EXTRA_APPS_INC)
third-party/DPVO/Pangolin/scripts/vcpkg/ports/libsrt/portfile.cmake ADDED
@@ -0,0 +1,39 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ vcpkg_from_github(
2
+ OUT_SOURCE_PATH SOURCE_PATH
3
+ REPO Haivision/srt
4
+ REF v1.4.4
5
+ SHA512 0D51E0EF73F4AA7EB284288CDBBD75B1C161969C2C2FED3A6D4E13A931341CA41DFCF2D6C1B9728F72B43454A9FDE3764DA67A27AF9F0C99A6818682E4F4D4BA
6
+ HEAD_REF master
7
+ PATCHES fix-dependency-install.patch
8
+ )
9
+
10
+ if (VCPKG_LIBRARY_LINKAGE STREQUAL dynamic)
11
+ set(BUILD_DYNAMIC ON)
12
+ set(BUILD_STATIC OFF)
13
+ else()
14
+ set(BUILD_DYNAMIC OFF)
15
+ set(BUILD_STATIC ON)
16
+ endif()
17
+
18
+ vcpkg_check_features(
19
+ OUT_FEATURE_OPTIONS FEATURE_OPTIONS
20
+ FEATURES
21
+ tool ENABLE_APPS
22
+ )
23
+
24
+ vcpkg_cmake_configure(
25
+ SOURCE_PATH "${SOURCE_PATH}"
26
+ OPTIONS ${FEATURE_OPTIONS}
27
+ -DENABLE_SHARED=${BUILD_DYNAMIC}
28
+ -DENABLE_STATIC=${BUILD_STATIC}
29
+ -DENABLE_UNITTESTS=OFF
30
+ -DUSE_OPENSSL_PC=OFF
31
+ )
32
+
33
+ vcpkg_cmake_install()
34
+ vcpkg_copy_pdbs()
35
+ vcpkg_fixup_pkgconfig()
36
+
37
+ file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include)
38
+
39
+ file(INSTALL "${SOURCE_PATH}/LICENSE" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}" RENAME copyright)
third-party/DPVO/Pangolin/scripts/vcpkg/ports/libsrt/vcpkg.json ADDED
@@ -0,0 +1,20 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "name": "libsrt",
3
+ "version": "1.4.4",
4
+ "port-version": 2,
5
+ "description": "Secure Reliable Transport (SRT) is an open source transport technology that optimizes streaming performance across unpredictable networks, such as the Internet.",
6
+ "homepage": "https://github.com/Haivision/srt",
7
+ "supports": "!uwp",
8
+ "dependencies": [
9
+ "openssl",
10
+ {
11
+ "name": "vcpkg-cmake",
12
+ "host": true
13
+ }
14
+ ],
15
+ "features": {
16
+ "tool": {
17
+ "description": "Builds libsrt executable"
18
+ }
19
+ }
20
+ }
third-party/DPVO/Pangolin/scripts/vcpkg/ports/libsrtp/portfile.cmake ADDED
@@ -0,0 +1,42 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ vcpkg_download_distfile(CMAKE_PR_PATCH
2
+ URLS https://patch-diff.githubusercontent.com/raw/cisco/libsrtp/pull/573.diff
3
+ FILENAME libsrtp-pr-573.patch
4
+ SHA512 58c07977ccbd3dce114f59583a5e10813bbee907af5ef23ec1961b4cfd0791c14326845a376470430978e878c78fb1f598851898a9e9031225628739fb248176
5
+ )
6
+
7
+ vcpkg_from_github(
8
+ OUT_SOURCE_PATH SOURCE_PATH
9
+ REPO cisco/libsrtp
10
+ REF v2.4.2
11
+ SHA512 6E4805E6D34B2050A6F68F629B0B42356B1D27F2CBAA6CC6166E56957609C3D9AA6B723DCC674E5C74180D122D27BADD2F9496639CCB1E0C210B9E1F7949D0E2
12
+ PATCHES ${CMAKE_PR_PATCH}
13
+ )
14
+
15
+ if (VCPKG_TARGET_IS_WINDOWS)
16
+ set(VCPKG_C_FLAGS "${VCPKG_C_FLAGS} /wd4703")
17
+ set(VCPKG_CXX_FLAGS "${VCPKG_CXX_FLAGS} /wd4703")
18
+ endif()
19
+
20
+ vcpkg_cmake_configure(
21
+ SOURCE_PATH "${SOURCE_PATH}"
22
+ PREFER_NINJA
23
+ )
24
+
25
+ vcpkg_cmake_install()
26
+
27
+ vcpkg_cmake_config_fixup(
28
+ CONFIG_PATH lib/cmake/libSRTP
29
+ )
30
+
31
+ file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/include")
32
+
33
+ if(EXISTS "${CURRENT_PACKAGES_DIR}/lib/srtp2.dll")
34
+ file(MAKE_DIRECTORY "${CURRENT_PACKAGES_DIR}/bin")
35
+ file(RENAME "${CURRENT_PACKAGES_DIR}/lib/srtp2.dll" "${CURRENT_PACKAGES_DIR}/bin/srtp2.dll")
36
+ endif()
37
+ if(EXISTS "${CURRENT_PACKAGES_DIR}/debug/lib/srtp2.dll")
38
+ file(MAKE_DIRECTORY "${CURRENT_PACKAGES_DIR}/debug/bin")
39
+ file(RENAME "${CURRENT_PACKAGES_DIR}/debug/lib/srtp2.dll" "${CURRENT_PACKAGES_DIR}/debug/bin/srtp2.dll")
40
+ endif()
41
+
42
+ file(INSTALL "${SOURCE_PATH}/LICENSE" DESTINATION "${CURRENT_PACKAGES_DIR}/share/libsrtp" RENAME copyright)
third-party/DPVO/Pangolin/scripts/vcpkg/ports/libsrtp/vcpkg.json ADDED
@@ -0,0 +1,16 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "name": "libsrtp",
3
+ "version": "2.4.2",
4
+ "port-version": 1,
5
+ "description": "This package provides an implementation of the Secure Real-time Transport Protocol (SRTP), the Universal Security Transform (UST), and a supporting cryptographic kernel.",
6
+ "dependencies": [
7
+ {
8
+ "name": "vcpkg-cmake",
9
+ "host": true
10
+ },
11
+ {
12
+ "name": "vcpkg-cmake-config",
13
+ "host": true
14
+ }
15
+ ]
16
+ }
third-party/DPVO/Pangolin/scripts/vcpkg/ports/libssh/0001-export-pkgconfig-file.patch ADDED
@@ -0,0 +1,43 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ diff --git a/CMakeLists.txt b/CMakeLists.txt
2
+ index 1f5b0bf5..c51fb0d3 100644
3
+ --- a/CMakeLists.txt
4
+ +++ b/CMakeLists.txt
5
+ @@ -111,8 +111,28 @@ add_subdirectory(include)
6
+ add_subdirectory(src)
7
+
8
+ # pkg-config file
9
+ -if (UNIX)
10
+ configure_file(libssh.pc.cmake ${CMAKE_CURRENT_BINARY_DIR}/libssh.pc)
11
+ + file(APPEND ${CMAKE_CURRENT_BINARY_DIR}/libssh.pc "Requires:")
12
+ + if (WITH_ZLIB)
13
+ + file(APPEND ${CMAKE_CURRENT_BINARY_DIR}/libssh.pc " zlib")
14
+ + endif ()
15
+ + if (WITH_GCRYPT)
16
+ + file(APPEND ${CMAKE_CURRENT_BINARY_DIR}/libssh.pc "\nLibs.private: -lgcrypt")
17
+ + elseif (WITH_MBEDTLS)
18
+ + file(APPEND ${CMAKE_CURRENT_BINARY_DIR}/libssh.pc "\nLibs.private: -lmbedcrypto -lpthread")
19
+ + else ()
20
+ + if (WIN32)
21
+ + file(APPEND ${CMAKE_CURRENT_BINARY_DIR}/libssh.pc "\nLibs.private: -llibcrypto -lUser32 -lCrypt32")
22
+ + else ()
23
+ + file(APPEND ${CMAKE_CURRENT_BINARY_DIR}/libssh.pc " libcrypto\nLibs.private:")
24
+ + endif ()
25
+ + endif ()
26
+ + if (CMAKE_USE_PTHREADS_INIT)
27
+ + file(APPEND ${CMAKE_CURRENT_BINARY_DIR}/libssh.pc " -lpthread")
28
+ + endif ()
29
+ + if (WIN32)
30
+ + file(APPEND ${CMAKE_CURRENT_BINARY_DIR}/libssh.pc " -lws2_32 -lShell32 -lAdvapi32")
31
+ + endif ()
32
+ install(
33
+ FILES
34
+ ${CMAKE_CURRENT_BINARY_DIR}/libssh.pc
35
+ @@ -121,7 +141,6 @@ install(
36
+ COMPONENT
37
+ pkgconfig
38
+ )
39
+ -endif (UNIX)
40
+
41
+ # CMake config files
42
+ include(CMakePackageConfigHelpers)
43
+
third-party/DPVO/Pangolin/scripts/vcpkg/ports/libssh/0002-mingw_for_Android.patch ADDED
@@ -0,0 +1,13 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
2
+ index a576cf7..1f6a048 100644
3
+ --- a/src/CMakeLists.txt
4
+ +++ b/src/CMakeLists.txt
5
+ @@ -359,7 +359,7 @@ if (WITH_VISIBILITY_HIDDEN)
6
+ set_target_properties(ssh PROPERTIES C_VISIBILITY_PRESET hidden)
7
+ endif (WITH_VISIBILITY_HIDDEN)
8
+
9
+ -if (MINGW)
10
+ +if (MINGW AND NOT ANDROID)
11
+ target_link_libraries(ssh PRIVATE "-Wl,--enable-stdcall-fixup")
12
+ target_compile_definitions(ssh PRIVATE "_POSIX_SOURCE")
13
+ endif ()