aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGabriel <gabriel+github@mastergk.de>2018-08-08 12:04:44 +0200
committerRobert Schumacher <roschuma@microsoft.com>2018-08-08 03:04:44 -0700
commitad2bcd9dade618f3e97b6b8a362c6988cca5e534 (patch)
tree6c46de66eb089f114a3889d2b96099e4ebb2f327
parent72d7c3d3a93d75e6d4bc91172806c45fedc2d451 (diff)
downloadvcpkg-ad2bcd9dade618f3e97b6b8a362c6988cca5e534.tar.gz
vcpkg-ad2bcd9dade618f3e97b6b8a362c6988cca5e534.zip
opusfile: Add feature for disabling the openssl dependency (#3527)
* opusfile: Add feature for disabling the openssl dependency * [opusfile] Rename feature openssl -> opusurl to better describe this library's interface
-rw-r--r--ports/opusfile/CMakeLists.txt29
-rw-r--r--ports/opusfile/CONTROL8
-rw-r--r--ports/opusfile/portfile.cmake10
3 files changed, 33 insertions, 14 deletions
diff --git a/ports/opusfile/CMakeLists.txt b/ports/opusfile/CMakeLists.txt
index 737adee1a..51ea8f894 100644
--- a/ports/opusfile/CMakeLists.txt
+++ b/ports/opusfile/CMakeLists.txt
@@ -10,8 +10,6 @@ find_library(OGG_LIBRARY ogg)
find_path(OPUS_INCLUDE_DIR opus.h PATH_SUFFIXES opus)
find_library(OPUS_LIBRARY opus)
-find_package(OpenSSL MODULE REQUIRED)
-
add_library(opusfile
src/info.c
src/internal.c
@@ -21,19 +19,28 @@ add_library(opusfile
target_include_directories(opusfile PRIVATE include PUBLIC ${OGG_INCLUDE_DIR} ${OPUS_INCLUDE_DIR})
target_link_libraries(opusfile PRIVATE ${OGG_LIBRARY} ${OPUS_LIBRARY})
-add_library(opusurl
- src/http.c
- src/wincerts.c)
-
-target_compile_definitions(opusurl PRIVATE OP_ENABLE_HTTP)
-target_include_directories(opusurl PRIVATE include)
-target_link_libraries(opusurl PRIVATE opusfile OpenSSL::SSL ws2_32.lib crypt32.lib)
-
-install(TARGETS opusfile opusurl
+install(TARGETS opusfile
RUNTIME DESTINATION bin
LIBRARY DESTINATION lib
ARCHIVE DESTINATION lib)
+if(BUILD_OPUSURL)
+ find_package(OpenSSL MODULE REQUIRED)
+
+ add_library(opusurl
+ src/http.c
+ src/wincerts.c)
+
+ target_compile_definitions(opusurl PRIVATE OP_ENABLE_HTTP)
+ target_include_directories(opusurl PRIVATE include)
+ target_link_libraries(opusurl PRIVATE opusfile OpenSSL::SSL ws2_32.lib crypt32.lib)
+
+ install(TARGETS opusurl
+ RUNTIME DESTINATION bin
+ LIBRARY DESTINATION lib
+ ARCHIVE DESTINATION lib)
+endif()
+
if(NOT OPUSFILE_SKIP_HEADERS)
install(FILES include/opusfile.h
DESTINATION include/opus)
diff --git a/ports/opusfile/CONTROL b/ports/opusfile/CONTROL
index 5489cb4b2..5a9cf2002 100644
--- a/ports/opusfile/CONTROL
+++ b/ports/opusfile/CONTROL
@@ -1,4 +1,8 @@
Source: opusfile
-Version: 0.9-1
+Version: 0.9-3
Description: Stand-alone decoder library for .opus streams
-Build-Depends: libogg, opus, openssl
+Build-Depends: libogg, opus
+
+Feature: opusurl
+Description: Support decoding of http(s) streams
+Build-Depends: openssl
diff --git a/ports/opusfile/portfile.cmake b/ports/opusfile/portfile.cmake
index 06c2a2196..c538a692f 100644
--- a/ports/opusfile/portfile.cmake
+++ b/ports/opusfile/portfile.cmake
@@ -12,8 +12,16 @@ vcpkg_from_github(
file(COPY ${CMAKE_CURRENT_LIST_DIR}/CMakeLists.txt DESTINATION ${SOURCE_PATH})
+if("opusurl" IN_LIST FEATURES)
+ set(BUILD_OPUSURL ON)
+else()
+ set(BUILD_OPUSURL OFF)
+endif()
+
vcpkg_configure_cmake(SOURCE_PATH ${SOURCE_PATH}
- PREFER_NINJA
+ PREFER_NINJA
+ OPTIONS
+ -DBUILD_OPUSURL=${BUILD_OPUSURL}
OPTIONS_DEBUG
-DOPUSFILE_SKIP_HEADERS=ON)