Link libext dynamically
authorJo-Philipp Wich <jow@openwrt.org>
Tue, 5 May 2015 15:21:22 +0000 (17:21 +0200)
committerJo-Philipp Wich <jow@openwrt.org>
Tue, 26 May 2015 09:20:57 +0000 (11:20 +0200)
Signed-off-by: Jo-Philipp Wich <jow@openwrt.org>
CMakeLists.txt

index a57cb7b18983a0a9ca4d0bc1ea42f261be54ea94..bfaa3eb95b1a21ccf03fcc844ead95345bae21c3 100644 (file)
@@ -14,24 +14,11 @@ EXECUTE_PROCESS(COMMAND sed -n -e "s/${sed_match}/${sed_replace}/; T n; H; :n; \
 SET(CMAKE_SHARED_LIBRARY_LINK_C_FLAGS "")
 SET(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -Wl,--unresolved-symbols=ignore-all ${ext_syms}")
 
-IF (EXISTS "${CMAKE_SOURCE_DIR}/libext.a")
-  ADD_LIBRARY(ext STATIC IMPORTED)
-  SET_PROPERTY(TARGET ext PROPERTY IMPORTED_LOCATION ${CMAKE_SOURCE_DIR}/libext.a)
-  LIST(APPEND ext_libs ext)
-ENDIF()
-
-IF (EXISTS "${CMAKE_SOURCE_DIR}/libext4.a")
-  ADD_LIBRARY(ext4 STATIC IMPORTED)
-  SET_PROPERTY(TARGET ext4 PROPERTY IMPORTED_LOCATION "${CMAKE_SOURCE_DIR}/libext4.a")
-  LIST(APPEND ext_libs ext4)
-ENDIF()
+LIST(APPEND ext_libs iptext)
+LIST(APPEND ext_libs iptext4)
 
 IF (NOT DISABLE_IPV6)
-  IF (EXISTS "${CMAKE_SOURCE_DIR}/libext6.a")
-       ADD_LIBRARY(ext6 STATIC IMPORTED)
-       SET_PROPERTY(TARGET ext6 PROPERTY IMPORTED_LOCATION "${CMAKE_SOURCE_DIR}/libext6.a")
-       LIST(APPEND ext_libs ext6)
-  ENDIF()
+  LIST(APPEND ext_libs iptext6)
   LIST(APPEND iptc_libs ip6tc)
 ELSE()
   ADD_DEFINITIONS(-DDISABLE_IPV6)