elektra: actually fix compilation with iconv

find_package needs to be moved outside of if.

Signed-off-by: Rosen Penev <rosenp@gmail.com>
This commit is contained in:
Rosen Penev 2022-07-14 01:04:59 -07:00 committed by 1582130940
parent b15f69d3ea
commit 66f17c5245
2 changed files with 18 additions and 9 deletions

View File

@ -15,7 +15,7 @@ PKG_NAME:=elektra
PKG_LICENSE:=BSD-3-Clause PKG_LICENSE:=BSD-3-Clause
PKG_LICENSE_FILES:=LICENSE.md PKG_LICENSE_FILES:=LICENSE.md
PKG_VERSION:=0.9.7 PKG_VERSION:=0.9.7
PKG_RELEASE:=3 PKG_RELEASE:=4
# Use this for official releasees # Use this for official releasees
PKG_HASH:=12b7b046004db29317b7b937dc794abf719c400ba3115af8d41849127b562681 PKG_HASH:=12b7b046004db29317b7b937dc794abf719c400ba3115af8d41849127b562681

View File

@ -1,13 +1,16 @@
--- a/src/plugins/filecheck/CMakeLists.txt --- a/src/plugins/filecheck/CMakeLists.txt
+++ b/src/plugins/filecheck/CMakeLists.txt +++ b/src/plugins/filecheck/CMakeLists.txt
@@ -2,19 +2,45 @@ include (LibAddMacros) @@ -1,20 +1,46 @@
if (DEPENDENCY_PHASE) include (LibAddMacros)
find_package (Iconv QUIET) -if (DEPENDENCY_PHASE)
- find_package (Iconv QUIET)
-
- if (NOT Iconv_FOUND) - if (NOT Iconv_FOUND)
- remove_plugin (filecheck "Cannot find iconv library") - remove_plugin (filecheck "Cannot find iconv library")
- endif () - endif ()
- +find_package (Iconv QUIET)
+if (DEPENDENCY_PHASE)
if (ENABLE_ASAN AND CMAKE_SYSTEM_NAME MATCHES FreeBSD) if (ENABLE_ASAN AND CMAKE_SYSTEM_NAME MATCHES FreeBSD)
# See also: https://cirrus-ci.com/task/5751822404288512?command=tests#L237-L239 # 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") remove_plugin (filecheck "the unit test of the plugin fails on FreeBSD if ASan is active")
@ -53,12 +56,18 @@
+ LINK_LIBRARIES iconv + LINK_LIBRARIES iconv
+ ADD_TEST INSTALL_TEST_DATA COMPONENT libelektra${SO_VERSION}-extra) + ADD_TEST INSTALL_TEST_DATA COMPONENT libelektra${SO_VERSION}-extra)
+ else() + else()
+ remove_plugin (filecheck "Cannot find iconv library") + message(FATAL_ERROR "Cannot find iconv library")
+ endif() + endif()
+endif() +endif()
--- a/src/plugins/iconv/CMakeLists.txt --- a/src/plugins/iconv/CMakeLists.txt
+++ b/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 # 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") 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) endif (ENABLE_ASAN AND CMAKE_SYSTEM_NAME MATCHES FreeBSD)
@ -107,6 +116,6 @@
+ LINK_LIBRARIES iconv + LINK_LIBRARIES iconv
+ ADD_TEST TEST_README COMPONENT libelektra${SO_VERSION}-extra) + ADD_TEST TEST_README COMPONENT libelektra${SO_VERSION}-extra)
+ else() + else()
+ remove_plugin (iconv "Cannot find iconv library") + message(FATAL_ERROR "Cannot find iconv library")
+ endif() + endif()
+endif() +endif()