xref: /OK3568_Linux_fs/buildroot/package/libcuefile/0001-fix-static-link.patch (revision 4882a59341e53eb6f0b4789bf948001014eff981)
1Fix static only build
2
3Make sure to build the shared library only if BUILD_SHARED_LIBS is
4ON. Normally, CMake takes care of this automatically, but libcuefile
5wants to build both the shared and static variants, so the normal
6logic of CMake doesn't apply.
7
8Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
9
10Index: b/src/CMakeLists.txt
11===================================================================
12--- a/src/CMakeLists.txt
13+++ b/src/CMakeLists.txt
14@@ -4,7 +4,11 @@
15 add_library(cuefile-static STATIC cd cdtext cue_parse cue_print cue_scan cuefile time toc toc_parse toc_print toc_scan)
16 set_target_properties(cuefile-static PROPERTIES OUTPUT_NAME cuefile CLEAN_DIRECT_OUTPUT 1)
17
18+if (BUILD_SHARED_LIBS)
19 add_library(cuefile-shared SHARED cd cdtext cue_parse cue_print cue_scan cuefile time toc toc_parse toc_print toc_scan)
20 set_target_properties(cuefile-shared PROPERTIES OUTPUT_NAME cuefile CLEAN_DIRECT_OUTPUT 1 VERSION 0.0.0 SOVERSION 0)
21
22 install(TARGETS cuefile-static cuefile-shared LIBRARY DESTINATION "lib${LIB_SUFFIX}" ARCHIVE DESTINATION "lib${LIB_SUFFIX}")
23+else (BUILD_SHARED_LIBS)
24+install(TARGETS cuefile-static LIBRARY DESTINATION "lib${LIB_SUFFIX}" ARCHIVE DESTINATION "lib${LIB_SUFFIX}")
25+endif (BUILD_SHARED_LIBS)
26