-
-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Build libogg and libvorbis with CMake
- Run GitHub Actions on both old and updated macOS images - Update libogg to 1.3.5 - Add a patch to compile libvorbis on MinGW
- Loading branch information
Showing
4 changed files
with
110 additions
and
110 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,64 +1,56 @@ | ||
set(TARGET_OGG ogg) | ||
set(URL_OGG http://downloads.xiph.org/releases/ogg/libogg-1.3.3.tar.gz) | ||
set(URL_MD5_OGG 1eda7efc22a97d08af98265107d65f95) | ||
set(LIBNAME_OGG libogg) | ||
set(URL_OGG http://downloads.xiph.org/releases/ogg/libogg-1.3.5.tar.gz) | ||
set(URL_MD5_OGG 3267127fe8d7ba77d3e00cb9d7ad578d) | ||
set(COMMON_CMAKE_ARGS_OGG -DBUILD_SHARED_LIBS=ON -DINSTALL_DOCS=OFF) | ||
set(INCLUDE_DIR_OGG ${EP_BASE}/Source/project_${TARGET_OGG}/include) | ||
|
||
if(MSVC) | ||
set(LIBFILE_OGG_NOEXT ${EP_BASE}/Source/project_${TARGET_OGG}/win32/VS2015/${CMAKE_VS_PLATFORM_NAME}/${CMAKE_BUILD_TYPE}/${LIBNAME_OGG}) | ||
set(LIBNAME_OGG ogg) | ||
set(LIBFILE_OGG_NOEXT ${CMAKE_BUILD_TYPE}/${LIBNAME_OGG}) | ||
set(INCLUDE_DIR_VORBIS ${EP_BASE}/Source/project_${TARGET_VORBIS}/include/vorbis) | ||
|
||
ExternalProject_Add(project_${TARGET_OGG} | ||
URL ${URL_OGG} | ||
URL_MD5 ${URL_MD5_OGG} | ||
CONFIGURE_COMMAND devenv win32/VS2015/libogg_dynamic.vcxproj /Upgrade | ||
BUILD_COMMAND msbuild win32/VS2015/libogg_dynamic.vcxproj -m /t:Build /p:Configuration=${CMAKE_BUILD_TYPE} /p:Platform=${CMAKE_VS_PLATFORM_NAME} /p:PlatformToolset=${CMAKE_VS_PLATFORM_TOOLSET} /p:WindowsTargetPlatformVersion=${CMAKE_VS_WINDOWS_TARGET_PLATFORM_VERSION} | ||
BUILD_IN_SOURCE 1 | ||
CMAKE_ARGS ${COMMON_CMAKE_ARGS_OGG} | ||
BUILD_COMMAND ${CMAKE_COMMAND} --build . --config ${CMAKE_BUILD_TYPE} --parallel | ||
BUILD_IN_SOURCE 0 | ||
INSTALL_COMMAND ${CMAKE_COMMAND} -E copy_if_different ${LIBFILE_OGG_NOEXT}.dll ${BINDIR}/ | ||
COMMAND ${CMAKE_COMMAND} -E copy_if_different ${LIBFILE_OGG_NOEXT}.lib ${LIBDIR}/ | ||
COMMAND ${CMAKE_COMMAND} -E copy_if_different include/ogg/ogg.h ${INCDIR}/ogg/ogg.h | ||
COMMAND ${CMAKE_COMMAND} -E copy_if_different include/ogg/os_types.h ${INCDIR}/ogg/os_types.h | ||
) | ||
|
||
set(TARGET_OGG_STATIC ogg_static) | ||
ExternalProject_Add(project_${TARGET_OGG_STATIC} | ||
DEPENDS project_${TARGET_OGG} | ||
DOWNLOAD_COMMAND "" | ||
SOURCE_DIR ${EP_BASE}/Source/project_${TARGET_OGG} | ||
CONFIGURE_COMMAND devenv win32/VS2015/libogg_static.vcxproj /Upgrade | ||
BUILD_COMMAND msbuild win32/VS2015/libogg_static.vcxproj -m /t:Build /p:Configuration=${CMAKE_BUILD_TYPE} /p:Platform=${CMAKE_VS_PLATFORM_NAME} /p:PlatformToolset=${CMAKE_VS_PLATFORM_TOOLSET} /p:WindowsTargetPlatformVersion=${CMAKE_VS_WINDOWS_TARGET_PLATFORM_VERSION} | ||
BUILD_IN_SOURCE 1 | ||
INSTALL_COMMAND "" #${CMAKE_COMMAND} -E copy_if_different ${LIBFILE_OGG_NOEXT}_static.lib ${LIBDIR}/ | ||
COMMAND ${CMAKE_COMMAND} -E copy_if_different ${INCLUDE_DIR_OGG}/ogg/ogg.h ${INCDIR}/ogg/ogg.h | ||
COMMAND ${CMAKE_COMMAND} -E copy_if_different ${INCLUDE_DIR_OGG}/ogg/os_types.h ${INCDIR}/ogg/os_types.h | ||
COMMAND ${CMAKE_COMMAND} -E copy_if_different include/ogg/config_types.h ${INCDIR}/ogg/config_types.h | ||
) | ||
elseif(APPLE) | ||
set(FRAMEWORK_DIR_OGG ${DESTINATION_PATH}/${TARGET_OGG}.framework) | ||
set(DYLIBNAME_OGG libogg.0.dylib) | ||
set(DYLIBNAME_VERSIONED_OGG libogg.0.8.5.dylib) | ||
|
||
ExternalProject_Add(project_${TARGET_OGG} | ||
URL ${URL_OGG} | ||
URL_MD5 ${URL_MD5_OGG} | ||
CONFIGURE_COMMAND ./configure --prefix= | ||
BUILD_COMMAND make -j${CPUS} | ||
BUILD_IN_SOURCE 1 | ||
CMAKE_ARGS -DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE} ${COMMON_CMAKE_ARGS_OGG} | ||
BUILD_COMMAND ${CMAKE_COMMAND} --build . --parallel | ||
BUILD_IN_SOURCE 0 | ||
INSTALL_COMMAND ${CMAKE_COMMAND} -E make_directory ${FRAMEWORK_DIR_OGG}/Versions/A | ||
COMMAND ${CMAKE_COMMAND} -E create_symlink A ${FRAMEWORK_DIR_OGG}/Versions/Current | ||
COMMAND ${CMAKE_COMMAND} -E copy_if_different src/.libs/${DYLIBNAME_OGG} ${FRAMEWORK_DIR_OGG}/Versions/A/ | ||
COMMAND ${CMAKE_COMMAND} -E copy_if_different ${DYLIBNAME_VERSIONED_OGG} ${FRAMEWORK_DIR_OGG}/Versions/A/ | ||
COMMAND ${CMAKE_COMMAND} -E copy_if_different ${DYLIBNAME_OGG} ${FRAMEWORK_DIR_OGG}/Versions/A/ | ||
COMMAND ${CMAKE_COMMAND} -E create_symlink Versions/Current/${DYLIBNAME_OGG} ${FRAMEWORK_DIR_OGG}/${TARGET_OGG} | ||
COMMAND install_name_tool -id "@rpath/${TARGET_OGG}.framework/${TARGET_OGG}" ${FRAMEWORK_DIR_OGG}/${TARGET_OGG} | ||
COMMAND ${CMAKE_COMMAND} -E make_directory ${FRAMEWORK_DIR_OGG}/Versions/A/Headers/ | ||
COMMAND ${CMAKE_COMMAND} -E copy_if_different include/ogg/ogg.h ${FRAMEWORK_DIR_OGG}/Versions/A/Headers/ | ||
COMMAND ${CMAKE_COMMAND} -E copy_if_different include/ogg/os_types.h ${FRAMEWORK_DIR_OGG}/Versions/A/Headers/ | ||
COMMAND ${CMAKE_COMMAND} -E copy_if_different ${INCLUDE_DIR_OGG}/ogg/ogg.h ${FRAMEWORK_DIR_OGG}/Versions/A/Headers/ | ||
COMMAND ${CMAKE_COMMAND} -E copy_if_different ${INCLUDE_DIR_OGG}/ogg/os_types.h ${FRAMEWORK_DIR_OGG}/Versions/A/Headers/ | ||
COMMAND ${CMAKE_COMMAND} -E copy_if_different include/ogg/config_types.h ${FRAMEWORK_DIR_OGG}/Versions/A/Headers/ | ||
COMMAND ${CMAKE_COMMAND} -E create_symlink Versions/Current/Headers ${FRAMEWORK_DIR_OGG}/Headers | ||
COMMAND ${CMAKE_COMMAND} -E make_directory ${FRAMEWORK_DIR_OGG}/Versions/A/Resources | ||
COMMAND ${CMAKE_COMMAND} -E copy_if_different macosx/English.lproj ${FRAMEWORK_DIR_OGG}/Versions/A/Resources/ | ||
COMMAND ${CMAKE_COMMAND} -E copy_if_different macosx/Info.plist ${FRAMEWORK_DIR_OGG}/Versions/A/Resources/ | ||
COMMAND ${CMAKE_COMMAND} -E create_symlink Versions/Current/Resources ${FRAMEWORK_DIR_OGG}/Resources | ||
) | ||
elseif(NOT EMSCRIPTEN) | ||
ExternalProject_Add(project_${TARGET_OGG} | ||
URL ${URL_OGG} | ||
URL_MD5 ${URL_MD5_OGG} | ||
CONFIGURE_COMMAND ./configure --prefix=${DESTINATION_PATH} --exec-prefix=${DESTINATION_PATH} | ||
BUILD_COMMAND make -j${CPUS} | ||
BUILD_IN_SOURCE 1 | ||
CMAKE_ARGS -DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE} ${COMMON_CMAKE_ARGS_OGG} -DCMAKE_INSTALL_PREFIX=${DESTINATION_PATH} | ||
BUILD_COMMAND ${CMAKE_COMMAND} --build . --parallel | ||
BUILD_IN_SOURCE 0 | ||
INSTALL_COMMAND make install | ||
) | ||
endif() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.