Browse Source

solving mistery of component made of external static libs only

(and I hate CMake)
Philippe G 4 năm trước cách đây
mục cha
commit
a73c659a1e
2 tập tin đã thay đổi với 11 bổ sung17 xóa
  1. 11 16
      components/codecs/CMakeLists.txt
  2. 0 1
      components/codecs/link_helper.c

+ 11 - 16
components/codecs/CMakeLists.txt

@@ -1,6 +1,5 @@
-idf_component_register(SRC_DIRS . 
-					   INCLUDE_DIRS .  ./inc  inc/alac inc/FLAC  inc/helix-aac inc/mad inc/ogg inc/opus inc/opusfile inc/resample16 inc/soxr inc/vorbis
-					   PRIV_REQUIRES newlib
+idf_component_register(
+	   INCLUDE_DIRS .  ./inc  inc/alac inc/FLAC  inc/helix-aac inc/mad inc/ogg inc/opus inc/opusfile inc/resample16 inc/soxr inc/vorbis
 )
 
 add_prebuilt_library(libmad 		lib/libmad.a)
@@ -13,16 +12,12 @@ add_prebuilt_library(libresample16 	lib/libresample16.a )
 add_prebuilt_library(libopusfile 	lib/libopusfile.a ) 
 add_prebuilt_library(libopus 		lib/libopus.a ) 
 
-target_link_libraries(${COMPONENT_LIB} PRIVATE libmad)
-target_link_libraries(${COMPONENT_LIB} PRIVATE libFLAC)
-target_link_libraries(${COMPONENT_LIB} PRIVATE libhelix-aac)
-target_link_libraries(${COMPONENT_LIB} PRIVATE libvorbisidec)
-target_link_libraries(${COMPONENT_LIB} PRIVATE libogg)
-target_link_libraries(${COMPONENT_LIB} PRIVATE libalac)
-target_link_libraries(${COMPONENT_LIB} PRIVATE libresample16)
-target_link_libraries(${COMPONENT_LIB} PRIVATE libopusfile)
-target_link_libraries(${COMPONENT_LIB} PRIVATE libopus)
-
-set_source_files_properties(link_helper.c
-    PROPERTIES COMPILE_FLAGS -Wno-unused-variable
-)
+target_link_libraries(${COMPONENT_LIB} INTERFACE libmad)
+target_link_libraries(${COMPONENT_LIB} INTERFACE libFLAC)
+target_link_libraries(${COMPONENT_LIB} INTERFACE libhelix-aac)
+target_link_libraries(${COMPONENT_LIB} INTERFACE libvorbisidec)
+target_link_libraries(${COMPONENT_LIB} INTERFACE libogg)
+target_link_libraries(${COMPONENT_LIB} INTERFACE libalac)
+target_link_libraries(${COMPONENT_LIB} INTERFACE libresample16)
+target_link_libraries(${COMPONENT_LIB} INTERFACE libopusfile)
+target_link_libraries(${COMPONENT_LIB} INTERFACE libopus)

+ 0 - 1
components/codecs/link_helper.c

@@ -1 +0,0 @@
-static int a;