From 12554c93d81f75f87c34040fd7737048d3518d6d Mon Sep 17 00:00:00 2001 From: Georg Baum Date: Fri, 31 May 2013 22:07:14 +0200 Subject: [PATCH] Remove ugly multiple definition hack Since 00387b2a38a1d5 it is possible to construct a dummy Messages object which does not translate at all. With the old gettext implementation, a Messages object without a defined language would have used a language from an environment variable. Therefore, the duplicate definition of _() is no longer needed. This gettext removal was really a good idea! --- src/Makefile.am | 3 ++- src/support/tests/dummy_functions.cpp | 2 -- src/tests/CMakeLists.txt | 8 -------- 3 files changed, 2 insertions(+), 11 deletions(-) diff --git a/src/Makefile.am b/src/Makefile.am index 125f1dbf2b..3a3d43bf01 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -678,7 +678,8 @@ check_PROGRAMS = \ check_layout_CPPFLAGS = $(AM_CPPFLAGS) -DNO_LAYOUT_CSS check_layout_LDADD = support/liblyxsupport.a $(LIBICONV) $(BOOST_LIBS) @LIBS@ $(QT4_CORE_LIBS) $(LIBSHLWAPI) # need to allow multiple definitions of _() (see dummy_functions.cpp) -check_layout_LDFLAGS = $(QT4_CORE_LDFLAGS) -Wl,--allow-multiple-definition +#check_layout_LDFLAGS = $(QT4_CORE_LDFLAGS) -Wl,--allow-multiple-definition +check_layout_LDFLAGS = $(QT4_CORE_LDFLAGS) check_layout_SOURCES = \ insets/InsetLayout.cpp \ Color.cpp \ diff --git a/src/support/tests/dummy_functions.cpp b/src/support/tests/dummy_functions.cpp index 63f16db092..cb87ee5f47 100644 --- a/src/support/tests/dummy_functions.cpp +++ b/src/support/tests/dummy_functions.cpp @@ -11,8 +11,6 @@ namespace lyx { // Keep the linker happy on Windows void lyx_exit(int) {} - docstring const _(string const & s) { return from_ascii(s); } - // Dummy language support Messages const & getGuiMessages() { diff --git a/src/tests/CMakeLists.txt b/src/tests/CMakeLists.txt index 1e94014654..2ac962fcd3 100644 --- a/src/tests/CMakeLists.txt +++ b/src/tests/CMakeLists.txt @@ -15,14 +15,6 @@ endforeach() add_definitions(-DNO_LAYOUT_CSS) add_executable(check_layout ${check_layout_SOURCES}) -if(CMAKE_CXX_COMPILER_ID STREQUAL "GNU") - set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -Wl,--allow-multiple-definition") -elseif(MSVC) - set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} /FORCE:MULTIPLE") -else() - message(STATUS "Allow multiple definitions for cxx-compiler ${CMAKE_CXX_COMPILER_ID} not handled") - endif() - target_link_libraries(check_layout support ${Lyx_Boost_Libraries} ${QT_QTGUI_LIBRARY} ${QT_QTCORE_LIBRARY} ${ZLIB_LIBRARY} ${ICONV_LIBRARY})