6eb58909fd6c922d96ccf25f7a297b3738c956d0
[packages/trusty/cirros-testvm.git] / cirros-testvm / src-cirros / buildroot-2015.05 / package / libcuefile / 0001-fix-static-link.patch
1 Fix static only build
2
3 Make sure to build the shared library only if BUILD_SHARED_LIBS is
4 ON. Normally, CMake takes care of this automatically, but libcuefile
5 wants to build both the shared and static variants, so the normal
6 logic of CMake doesn't apply.
7
8 Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
9
10 Index: 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)