mirror of
https://github.com/clangen/musikcube.git
synced 2024-10-02 13:02:35 +00:00
Build: ensure static library existence only when needed (#447)
The current cmake build script for flac, m4a and ogg asserts the corresponding library existence. However, when building in environments like buildroot, the static library may not exist. Thus only check for them when static build is actually needed.
This commit is contained in:
parent
bd870de626
commit
00cf3eb59d
@ -6,12 +6,12 @@ set (flacdecoder_SOURCES
|
|||||||
)
|
)
|
||||||
|
|
||||||
ensure_library_exists(FLAC)
|
ensure_library_exists(FLAC)
|
||||||
ensure_library_exists(libFLAC.a)
|
|
||||||
|
|
||||||
add_library(flacdecoder SHARED ${flacdecoder_SOURCES})
|
add_library(flacdecoder SHARED ${flacdecoder_SOURCES})
|
||||||
|
|
||||||
# prefer static libraries on mac to make redist easier
|
# prefer static libraries on mac to make redist easier
|
||||||
if (${LINK_STATICALLY} MATCHES "true")
|
if (${LINK_STATICALLY} MATCHES "true")
|
||||||
|
ensure_library_exists(libFLAC.a)
|
||||||
find_library(FLACLIB NAMES libFLAC.a FLAC)
|
find_library(FLACLIB NAMES libFLAC.a FLAC)
|
||||||
find_library(OGGLIB NAMES libogg.a ogg)
|
find_library(OGGLIB NAMES libogg.a ogg)
|
||||||
target_link_libraries(flacdecoder ${musikcube_LINK_LIBS} ${FLACLIB} ${OGGLIB})
|
target_link_libraries(flacdecoder ${musikcube_LINK_LIBS} ${FLACLIB} ${OGGLIB})
|
||||||
|
@ -17,12 +17,12 @@ include_directories(
|
|||||||
)
|
)
|
||||||
|
|
||||||
ensure_library_exists(faad)
|
ensure_library_exists(faad)
|
||||||
ensure_library_exists(libfaad.a)
|
|
||||||
|
|
||||||
add_library(m4adecoder SHARED ${m4adecoder_SOURCES})
|
add_library(m4adecoder SHARED ${m4adecoder_SOURCES})
|
||||||
|
|
||||||
# prefer static libraries on mac to make redist easier
|
# prefer static libraries on mac to make redist easier
|
||||||
if (${LINK_STATICALLY} MATCHES "true")
|
if (${LINK_STATICALLY} MATCHES "true")
|
||||||
|
ensure_library_exists(libfaad.a)
|
||||||
find_library(FAADLIB NAMES libfaad.a faad)
|
find_library(FAADLIB NAMES libfaad.a faad)
|
||||||
target_link_libraries(m4adecoder ${musikcube_LINK_LIBS} ${FAADLIB})
|
target_link_libraries(m4adecoder ${musikcube_LINK_LIBS} ${FAADLIB})
|
||||||
else()
|
else()
|
||||||
|
@ -6,16 +6,16 @@ set (oggdecoder_SOURCES
|
|||||||
)
|
)
|
||||||
|
|
||||||
ensure_library_exists(ogg)
|
ensure_library_exists(ogg)
|
||||||
ensure_library_exists(libogg.a)
|
|
||||||
ensure_library_exists(vorbis)
|
ensure_library_exists(vorbis)
|
||||||
ensure_library_exists(libvorbis.a)
|
|
||||||
ensure_library_exists(vorbisfile)
|
ensure_library_exists(vorbisfile)
|
||||||
ensure_library_exists(libvorbisfile.a)
|
|
||||||
|
|
||||||
add_library(oggdecoder SHARED ${oggdecoder_SOURCES})
|
add_library(oggdecoder SHARED ${oggdecoder_SOURCES})
|
||||||
|
|
||||||
# prefer static libraries on mac to make redist easier
|
# prefer static libraries on mac to make redist easier
|
||||||
if (${LINK_STATICALLY} MATCHES "true")
|
if (${LINK_STATICALLY} MATCHES "true")
|
||||||
|
ensure_library_exists(libogg.a)
|
||||||
|
ensure_library_exists(libvorbisfile.a)
|
||||||
|
ensure_library_exists(libvorbis.a)
|
||||||
find_library(OGGLIB NAMES libogg.a ogg)
|
find_library(OGGLIB NAMES libogg.a ogg)
|
||||||
find_library(VORBISLIB NAMES libvorbis.a vorbis)
|
find_library(VORBISLIB NAMES libvorbis.a vorbis)
|
||||||
find_library(VORBISFILELIB NAMES libvorbisfile.a vorbisfile)
|
find_library(VORBISFILELIB NAMES libvorbisfile.a vorbisfile)
|
||||||
|
Loading…
Reference in New Issue
Block a user