elektra: actually fix compilation with iconv
authorRosen Penev <rosenp@gmail.com>
Thu, 14 Jul 2022 08:04:59 +0000 (01:04 -0700)
committerRosen Penev <rosenp@gmail.com>
Thu, 14 Jul 2022 21:09:03 +0000 (14:09 -0700)
find_package needs to be moved outside of if.

Signed-off-by: Rosen Penev <rosenp@gmail.com>
libs/elektra/Makefile
libs/elektra/patches/010-iconv.patch

index 4cb9d174937052de3ecfae9b3e10b4d347a60581..d2a0e9601ff58dfe1bc5f0c4b79ad1396d648601 100644 (file)
@@ -15,7 +15,7 @@ PKG_NAME:=elektra
 PKG_LICENSE:=BSD-3-Clause
 PKG_LICENSE_FILES:=LICENSE.md
 PKG_VERSION:=0.9.7
-PKG_RELEASE:=3
+PKG_RELEASE:=4
 
 # Use this for official releasees
 PKG_HASH:=12b7b046004db29317b7b937dc794abf719c400ba3115af8d41849127b562681
index 55eb29a6caedb39830acb329eeb62d8bf9593a41..96d5b727f228454265ca7c0d23fbcab77cf68ae5 100644 (file)
@@ -1,13 +1,16 @@
 --- a/src/plugins/filecheck/CMakeLists.txt
 +++ b/src/plugins/filecheck/CMakeLists.txt
-@@ -2,19 +2,45 @@ include (LibAddMacros)
- if (DEPENDENCY_PHASE)
-       find_package (Iconv QUIET)
+@@ -1,20 +1,46 @@
+ include (LibAddMacros)
+-if (DEPENDENCY_PHASE)
+-      find_package (Iconv QUIET)
+-
 -      if (NOT Iconv_FOUND)
 -              remove_plugin (filecheck "Cannot find iconv library")
 -      endif ()
--
++find_package (Iconv QUIET)
++if (DEPENDENCY_PHASE)
        if (ENABLE_ASAN AND CMAKE_SYSTEM_NAME MATCHES FreeBSD)
                # See also: https://cirrus-ci.com/task/5751822404288512?command=tests#L237-L239
                remove_plugin (filecheck "the unit test of the plugin fails on FreeBSD if ASan is active")
 +                      LINK_LIBRARIES iconv
 +                      ADD_TEST INSTALL_TEST_DATA COMPONENT libelektra${SO_VERSION}-extra)
 +      else()
-+                      remove_plugin (filecheck "Cannot find iconv library")
++                      message(FATAL_ERROR "Cannot find iconv library")
 +      endif()
 +endif()
 --- a/src/plugins/iconv/CMakeLists.txt
 +++ b/src/plugins/iconv/CMakeLists.txt
-@@ -5,15 +5,41 @@ if (DEPENDENCY_PHASE)
+@@ -1,19 +1,45 @@
+-if (DEPENDENCY_PHASE)
+-      find_package (Iconv QUIET)
++find_package (Iconv QUIET)
++if (DEPENDENCY_PHASE)
+       if (ENABLE_ASAN AND CMAKE_SYSTEM_NAME MATCHES FreeBSD)
                # See also: https://cirrus-ci.com/task/5751822404288512?command=tests#L253-L255
                remove_plugin (iconv "the unit test of the plugin fails on FreeBSD if ASan is active")
        endif (ENABLE_ASAN AND CMAKE_SYSTEM_NAME MATCHES FreeBSD)
 +                      LINK_LIBRARIES iconv
 +                      ADD_TEST TEST_README COMPONENT libelektra${SO_VERSION}-extra)
 +      else()
-+              remove_plugin (iconv "Cannot find iconv library")
++              message(FATAL_ERROR "Cannot find iconv library")
 +      endif()
 +endif()