0001-fix-static-link.patch 1.2 KB

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