2017-07-25 21:05:23 +08:00
|
|
|
if(VCPKG_CMAKE_SYSTEM_NAME STREQUAL WindowsStore)
|
|
|
|
message(FATAL_ERROR "WindowsStore not supported")
|
2016-10-27 10:06:43 +08:00
|
|
|
endif()
|
2017-07-25 21:05:23 +08:00
|
|
|
|
2016-09-19 11:50:08 +08:00
|
|
|
include(vcpkg_common_functions)
|
2017-07-25 21:05:23 +08:00
|
|
|
vcpkg_from_github(
|
|
|
|
OUT_SOURCE_PATH SOURCE_PATH
|
|
|
|
REPO kcat/openal-soft
|
2018-09-18 17:28:21 +08:00
|
|
|
REF openal-soft-1.19.0
|
|
|
|
SHA512 59623792e560c9ef8069b7b4e4c12c67c9814433fc57d5b5650951f3adad338570ec785bbac8f7e1e7596220bab433e9f29161ced7d1a37da4f5418f6a3b7581
|
2017-07-25 21:05:23 +08:00
|
|
|
HEAD_REF master
|
2018-04-04 08:02:40 +08:00
|
|
|
PATCHES
|
2018-09-18 17:28:21 +08:00
|
|
|
dont-export-symbols-in-static-build.patch
|
|
|
|
cmake-3-11.patch
|
2018-04-04 08:02:40 +08:00
|
|
|
)
|
2017-07-25 21:05:23 +08:00
|
|
|
|
|
|
|
if(VCPKG_LIBRARY_LINKAGE STREQUAL "dynamic")
|
|
|
|
set(OPENAL_LIBTYPE "SHARED")
|
|
|
|
else()
|
|
|
|
set(OPENAL_LIBTYPE "STATIC")
|
|
|
|
endif()
|
2016-09-19 11:50:08 +08:00
|
|
|
|
2018-04-27 18:15:17 +08:00
|
|
|
if(VCPKG_CMAKE_SYSTEM_NAME)
|
|
|
|
set(ALSOFT_REQUIRE_WINDOWS OFF)
|
|
|
|
set(ALSOFT_REQUIRE_LINUX ON)
|
|
|
|
else()
|
|
|
|
set(ALSOFT_REQUIRE_WINDOWS ON)
|
|
|
|
set(ALSOFT_REQUIRE_LINUX OFF)
|
|
|
|
endif()
|
|
|
|
|
2016-09-19 11:50:08 +08:00
|
|
|
vcpkg_configure_cmake(
|
2016-09-29 08:05:56 +08:00
|
|
|
SOURCE_PATH ${SOURCE_PATH}
|
2017-07-25 21:05:23 +08:00
|
|
|
PREFER_NINJA
|
2016-09-19 11:50:08 +08:00
|
|
|
OPTIONS
|
2017-07-25 21:05:23 +08:00
|
|
|
-DLIBTYPE=${OPENAL_LIBTYPE}
|
2016-09-19 11:50:08 +08:00
|
|
|
-DALSOFT_UTILS=OFF
|
|
|
|
-DALSOFT_NO_CONFIG_UTIL=ON
|
|
|
|
-DALSOFT_EXAMPLES=OFF
|
|
|
|
-DALSOFT_TESTS=OFF
|
|
|
|
-DALSOFT_CONFIG=OFF
|
|
|
|
-DALSOFT_HRTF_DEFS=OFF
|
2017-07-25 21:05:23 +08:00
|
|
|
-DALSOFT_AMBDEC_PRESETS=OFF
|
2018-04-27 18:15:17 +08:00
|
|
|
-DALSOFT_BACKEND_ALSA=${ALSOFT_REQUIRE_LINUX}
|
2017-07-25 21:05:23 +08:00
|
|
|
-DALSOFT_BACKEND_OSS=OFF
|
|
|
|
-DALSOFT_BACKEND_SOLARIS=OFF
|
|
|
|
-DALSOFT_BACKEND_SNDIO=OFF
|
|
|
|
-DALSOFT_BACKEND_QSA=OFF
|
|
|
|
-DALSOFT_BACKEND_PORTAUDIO=OFF
|
|
|
|
-DALSOFT_BACKEND_PULSEAUDIO=OFF
|
|
|
|
-DALSOFT_BACKEND_COREAUDIO=OFF
|
|
|
|
-DALSOFT_BACKEND_JACK=OFF
|
|
|
|
-DALSOFT_BACKEND_OPENSL=OFF
|
|
|
|
-DALSOFT_BACKEND_WAVE=ON
|
2018-04-27 18:15:17 +08:00
|
|
|
-DALSOFT_REQUIRE_WINMM=${ALSOFT_REQUIRE_WINDOWS}
|
|
|
|
-DALSOFT_REQUIRE_DSOUND=${ALSOFT_REQUIRE_WINDOWS}
|
|
|
|
-DALSOFT_REQUIRE_MMDEVAPI=${ALSOFT_REQUIRE_WINDOWS}
|
2016-09-19 11:50:08 +08:00
|
|
|
)
|
|
|
|
|
|
|
|
vcpkg_install_cmake()
|
2017-07-25 21:05:23 +08:00
|
|
|
vcpkg_fixup_cmake_targets(CONFIG_PATH lib/cmake/OpenAL)
|
|
|
|
|
|
|
|
foreach(HEADER al.h alc.h)
|
|
|
|
file(READ ${CURRENT_PACKAGES_DIR}/include/AL/${HEADER} AL_H)
|
|
|
|
if(VCPKG_LIBRARY_LINKAGE STREQUAL "static")
|
|
|
|
string(REPLACE "defined(AL_LIBTYPE_STATIC)" "1" AL_H "${AL_H}")
|
|
|
|
else()
|
|
|
|
string(REPLACE "defined(AL_LIBTYPE_STATIC)" "0" AL_H "${AL_H}")
|
|
|
|
endif()
|
|
|
|
file(WRITE ${CURRENT_PACKAGES_DIR}/include/AL/${HEADER} "${AL_H}")
|
|
|
|
endforeach()
|
2016-09-19 11:50:08 +08:00
|
|
|
|
2017-07-25 21:05:23 +08:00
|
|
|
file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/lib/pkgconfig)
|
|
|
|
file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/lib/pkgconfig)
|
2016-09-19 11:50:08 +08:00
|
|
|
file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include)
|
2016-09-29 08:05:56 +08:00
|
|
|
file(COPY ${SOURCE_PATH}/COPYING DESTINATION ${CURRENT_PACKAGES_DIR}/share/openal-soft)
|
2016-09-19 11:50:08 +08:00
|
|
|
file(RENAME ${CURRENT_PACKAGES_DIR}/share/openal-soft/COPYING ${CURRENT_PACKAGES_DIR}/share/openal-soft/copyright)
|
|
|
|
vcpkg_copy_pdbs()
|