summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEike Rathke <erack@redhat.com>2012-08-11 13:29:50 +0200
committerEike Rathke <erack@redhat.com>2012-08-11 13:41:27 +0200
commit4ff9a9958653666fb0b0ff333cac7f8d1b293117 (patch)
treebc92506a2f19803805d962fc99fa5f19d238122d
parentd724f64703eaa0b0595fc4983e42875f2b439e88 (diff)
langtag: use ENABLE_LIBLANGTAG in unit test
-rw-r--r--i18npool/CppunitTest_i18npool_test_languagetag.mk14
-rw-r--r--i18npool/qa/cppunit/test_languagetag.cxx6
-rw-r--r--i18npool/source/languagetag/languagetag.cxx2
3 files changed, 10 insertions, 12 deletions
diff --git a/i18npool/CppunitTest_i18npool_test_languagetag.mk b/i18npool/CppunitTest_i18npool_test_languagetag.mk
index 467a36ba5c2e..fd7c6047644d 100644
--- a/i18npool/CppunitTest_i18npool_test_languagetag.mk
+++ b/i18npool/CppunitTest_i18npool_test_languagetag.mk
@@ -23,23 +23,17 @@ $(eval $(call gb_CppunitTest_use_libraries,i18npool_test_languagetag,\
$(gb_STDLIBS) \
))
-ifneq ($(OS),ANDROID)
-ifneq ($(OS),IOS)
+ifeq ($(ENABLE_LIBLANGTAG),YES)
$(eval $(call gb_CppunitTest_use_externals,i18npool_test_languagetag,\
liblangtag \
glib \
-))
-endif
-endif
-
-$(eval $(call gb_CppunitTest_use_externals,i18npool_test_languagetag,\
libxml2 \
))
+$(eval $(call gb_CppunitTest_add_defs,i18npool_test_languagetag,-DENABLE_LIBLANGTAG))
ifeq ($(SYSTEM_LIBLANGTAG),YES)
-$(eval $(call gb_CppunitTest_add_cxxflags,i18npool_test_languagetag,\
- -DSYSTEM_LIBLANGTAG \
-))
+$(eval $(call gb_CppunitTest_add_defs,i18npool_test_languagetag,-DSYSTEM_LIBLANGTAG))
+endif
endif
$(eval $(call gb_CppunitTest_set_include,i18npool_test_languagetag,\
diff --git a/i18npool/qa/cppunit/test_languagetag.cxx b/i18npool/qa/cppunit/test_languagetag.cxx
index c8a5f7c522b5..4569e81cf159 100644
--- a/i18npool/qa/cppunit/test_languagetag.cxx
+++ b/i18npool/qa/cppunit/test_languagetag.cxx
@@ -26,7 +26,11 @@ using namespace com::sun::star;
// To test the replacement code add '&& 0' and also in
// source/languagetag/languagetag.cxx
-#define USE_LIBLANGTAG (!defined(ANDROID) && !defined(IOS))
+#if defined(ENABLE_LIBLANGTAG)
+#define USE_LIBLANGTAG 1
+#else
+#define USE_LIBLANGTAG 0
+#endif
namespace {
diff --git a/i18npool/source/languagetag/languagetag.cxx b/i18npool/source/languagetag/languagetag.cxx
index 68474d8907a6..9eae6eab58ac 100644
--- a/i18npool/source/languagetag/languagetag.cxx
+++ b/i18npool/source/languagetag/languagetag.cxx
@@ -15,7 +15,7 @@
//#define erDEBUG
-#ifdef ENABLE_LIBLANGTAG
+#if defined(ENABLE_LIBLANGTAG)
#include <liblangtag/langtag.h>
#else
/* Replacement code for LGPL phobic and Android systems.