-
-
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
- Update libogg to 1.3.5
- Loading branch information
Showing
4 changed files
with
79 additions
and
23 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,24 +1,39 @@ | ||
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(TARGET_OGG_STATIC ogg_static) | ||
set(URL_OGG http://downloads.xiph.org/releases/ogg/libogg-1.3.5.tar.gz) | ||
set(URL_MD5_OGG 3267127fe8d7ba77d3e00cb9d7ad578d) | ||
set(DEST_OGG ${DESTINATION_PATH}/ogg) | ||
set(INCLUDE_DIR_OGG ${EP_BASE}/Source/project_${TARGET_OGG}/include) | ||
|
||
ExternalProject_Add(project_${TARGET_OGG} | ||
URL ${URL_OGG} | ||
URL_MD5 ${URL_MD5_OGG} | ||
CONFIGURE_COMMAND ./configure ${CONFIGURE_TOOLCHAIN_ARGS} | ||
BUILD_COMMAND make -j${CPUS} | ||
BUILD_IN_SOURCE 1 | ||
INSTALL_COMMAND ${CMAKE_COMMAND} -E copy_if_different ${EP_BASE}/Source/project_${TARGET_OGG}/src/.libs/libogg.so ${DEST_OGG}/${ARCH}/libogg.so | ||
COMMAND ${CMAKE_COMMAND} -E copy_if_different ${EP_BASE}/Source/project_${TARGET_OGG}/src/.libs/libogg.a ${DEST_OGG}/${ARCH}/libogg.a | ||
COMMAND ${CMAKE_COMMAND} -E copy_if_different include/ogg/ogg.h ${DEST_OGG}/include/ogg/ogg.h | ||
COMMAND ${CMAKE_COMMAND} -E copy_if_different include/ogg/os_types.h ${DEST_OGG}/include/ogg/os_types.h | ||
PATCH_COMMAND patch -p1 < ${CMAKE_SOURCE_DIR}/patches/ogg.patch | ||
CMAKE_ARGS ${CMAKE_TOOLCHAIN_ARGS} -DBUILD_SHARED_LIBS=ON | ||
BUILD_COMMAND ${CMAKE_COMMAND} --build . --parallel | ||
BUILD_IN_SOURCE 0 | ||
INSTALL_COMMAND ${CMAKE_COMMAND} -E copy_if_different libogg.so ${DEST_OGG}/${ARCH}/libogg.so | ||
COMMAND ${CMAKE_COMMAND} -E copy_if_different ${INCLUDE_DIR_OGG}/ogg/ogg.h ${DEST_OGG}/include/ogg/ogg.h | ||
COMMAND ${CMAKE_COMMAND} -E copy_if_different ${INCLUDE_DIR_OGG}/ogg/os_types.h ${DEST_OGG}/include/ogg/os_types.h | ||
COMMAND ${CMAKE_COMMAND} -E copy_if_different include/ogg/config_types.h ${DEST_OGG}/include/ogg/config_types.h | ||
) | ||
|
||
ExternalProject_Add(project_${TARGET_OGG_STATIC} | ||
DEPENDS project_${TARGET_OGG} | ||
DOWNLOAD_COMMAND "" | ||
SOURCE_DIR ${EP_BASE}/Source/project_${TARGET_OGG} | ||
CMAKE_ARGS ${CMAKE_TOOLCHAIN_ARGS} -DBUILD_SHARED_LIBS=OFF | ||
BUILD_COMMAND ${CMAKE_COMMAND} --build . --parallel | ||
BUILD_IN_SOURCE 0 | ||
INSTALL_COMMAND ${CMAKE_COMMAND} -E copy_if_different libogg.a ${DEST_OGG}/${ARCH}/libogg.a | ||
) | ||
|
||
if(CMAKE_BUILD_TYPE STREQUAL "Release") | ||
add_custom_command(TARGET project_${TARGET_OGG} POST_BUILD | ||
COMMAND ${STRIP} ${STRIP_SHARED_ARGS} ${DEST_OGG}/${ARCH}/libogg.so | ||
COMMENT "Stripping OGG shared library") | ||
|
||
add_custom_command(TARGET project_${TARGET_OGG_STATIC} POST_BUILD | ||
COMMAND ${STRIP} ${STRIP_STATIC_ARGS} ${DEST_OGG}/${ARCH}/libogg.a | ||
COMMENT "Stripping OGG libraries") | ||
COMMENT "Stripping OGG static library") | ||
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
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 |
---|---|---|
@@ -0,0 +1,12 @@ | ||
diff -urN libogg-1.3.5.orig/CMakeLists.txt libogg-1.3.5/CMakeLists.txt | ||
--- libogg-1.3.5.orig/CMakeLists.txt 2021-05-10 19:40:30.000000000 +0200 | ||
+++ libogg-1.3.5/CMakeLists.txt 2024-03-03 18:38:01.623796959 +0100 | ||
@@ -100,8 +100,6 @@ | ||
|
||
set_target_properties( | ||
ogg PROPERTIES | ||
- SOVERSION ${LIB_SOVERSION} | ||
- VERSION ${LIB_VERSION} | ||
PUBLIC_HEADER "${OGG_HEADERS}" | ||
) | ||
|
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 |
---|---|---|
@@ -0,0 +1,15 @@ | ||
diff -urN libvorbis-1.3.7.orig/lib/CMakeLists.txt libvorbis-1.3.7/lib/CMakeLists.txt | ||
--- libvorbis-1.3.7.orig/lib/CMakeLists.txt 2020-04-15 18:20:52.000000000 +0200 | ||
+++ libvorbis-1.3.7/lib/CMakeLists.txt 2024-03-03 18:39:03.367128679 +0100 | ||
@@ -79,11 +79,8 @@ | ||
add_library(vorbisfile ${VORBISFILE_SOURCES}) | ||
|
||
get_version_info(VORBIS_VERSION_INFO "V_LIB_CURRENT" "V_LIB_AGE" "V_LIB_REVISION") | ||
- set_target_properties(vorbis PROPERTIES SOVERSION ${VORBIS_VERSION_INFO}) | ||
get_version_info(VORBISENC_VERSION_INFO "VE_LIB_CURRENT" "VE_LIB_AGE" "VE_LIB_REVISION") | ||
- set_target_properties(vorbisenc PROPERTIES SOVERSION ${VORBISENC_VERSION_INFO}) | ||
get_version_info(VORBISFILE_VERSION_INFO "VF_LIB_CURRENT" "VF_LIB_AGE" "VF_LIB_REVISION") | ||
- set_target_properties(vorbisfile PROPERTIES SOVERSION ${VORBISFILE_VERSION_INFO}) | ||
|
||
target_include_directories(vorbis | ||
PUBLIC |