]> git.lyx.org Git - features.git/commitdiff
CMake: fix merged build, seems GCC could not handle the namespaces correctly
authorPeter Kümmel <syntheticpp@gmx.net>
Sat, 30 Jan 2010 11:34:28 +0000 (11:34 +0000)
committerPeter Kümmel <syntheticpp@gmx.net>
Sat, 30 Jan 2010 11:34:28 +0000 (11:34 +0000)
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@33272 a592a061-630c-0410-9148-cb99ea01b6c8

development/cmake/CMakeLists.txt
development/cmake/config.h.cmake
development/cmake/src/client/CMakeLists.txt
development/cmake/src/support/CMakeLists.txt
src/frontends/qt4/GuiHyperlink.cpp
src/frontends/qt4/GuiListings.cpp
src/frontends/qt4/GuiView.cpp
src/support/strfwd.h

index 65009f0d96d85b1e20746d35a37690347defba0d..b18e0928b7eeaae85b0ecc380dafa5ea93fcebdf 100644 (file)
@@ -1,3 +1,4 @@
+
 # This file is part of LyX, the document processor.
 # Licence details can be found in the file COPYING.
 #
@@ -19,12 +20,14 @@ set(CMAKE_ALLOW_LOOSE_LOOP_CONSTRUCTS true)
 # is checked
 set(CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/modules")
 set(EXECUTABLE_OUTPUT_PATH  ${CMAKE_BINARY_DIR}/bin)
+set(LIBRARY_OUTPUT_PATH  ${CMAKE_BINARY_DIR}/lib)
 
 
 option(lyxinstall "Build install projects/rules" ON)
 
 
 
+
 # Supress regeneration
 set(CMAKE_SUPPRESS_REGENERATION TRUE)
 
@@ -119,6 +122,7 @@ if(merge OR merge_rebuild)
        message(STATUS "")
        message(STATUS "All *.cpp files of a project are merged into two files, disable with -Dmerge=0")
        message(STATUS "")
+       add_definitions(-DLYX_MERGED_BUILD)
 else()
        set(merge 0 CACHE TYPE STRING FORCE)
        set(MERGE_FILES 0 CACHE TYPE STRING FORCE)
index ab3e539ef33c44a6f6ee9b103b05761f1578e646..3022bef10efd9768aa11c09e59f799b370c8ece8 100644 (file)
 #cmakedefine PATH_MAX ${PATH_MAX}
 
 #endif
+
+
+// cleanup global namespace
+#ifdef ColorMode
+#undef ColorMode
+#endif
+
+#ifdef FocusOut
+#undef FocusOut
+#endif
+
+#ifdef FocusIn
+#undef FocusIn
+#endif
+
+#ifdef KeyRelease
+#undef KeyRelease
+#endif
+
+#ifdef CursorShape
+#undef CursorShape
+#endif
+
+#ifdef IGNORE
+#undef IGNORE
+#endif
+
+#ifdef GrayScale
+#undef GrayScale
+#endif
+
+#ifdef Status
+#undef Status
+#endif
+
index 3442a902e338db7318537ffc610bf951a6a6d8ef..8df2da675bbd4607dcc280cd3de7349f3921c255 100644 (file)
@@ -21,7 +21,7 @@ target_link_libraries(${_lyxclient}
        support
        ${Lyx_Boost_Libraries}
        ${LIBINTL_LIBRARIES}
-        ${ICONV_LIBRARY}
+       ${ICONV_LIBRARY}
        ${QT_QTCORE_LIBRARY}
        ${QT_QTGUI_LIBRARY}
        )
index 9b40da0c65a9b32694d7afededd606a3300c0bd6..6e00386b759569602d6d4abebe71636a0baf76a2 100644 (file)
@@ -54,13 +54,16 @@ if(NOT MERGE_FILES)
        set(support_headers ${support_headers} ${support_mythes_headers} ${support_linkback_headers})
        add_library(support ${library_type} ${support_sources} ${support_headers} ${dont_merge})
 else()
+       # GCC bug: gcc resolves ::bind as boost::bind
+       list(REMOVE_ITEM support_sources ${TOP_SRC_DIR}/src/support/socktools.cpp)
+       set(support_separate ${TOP_SRC_DIR}/src/support/socktools.cpp)
        lyx_const_touched_files(_allinone  support_sources)
-               set(depends_moc ${support_headers})
+       set(depends_moc ${support_headers})
        set_source_files_properties(_allinone_const.C
                PROPERTIES OBJECT_DEPENDS "${depends_moc}")
        set_source_files_properties(_allinone_touched.C
                PROPERTIES OBJECT_DEPENDS "${depends_moc}")
-       add_library(support ${library_type} ${_allinone_files}
+       add_library(support ${library_type} ${_allinone_files} ${support_separate}
                ${support_mythes_sources} ${support_linkback_sources} ${support_headers} ${dont_merge})
 endif()
 
index 8323b65ff3d3f1f625f602fbfa9f53bbfcc5bdca..60b0fe430ed804e18a080c49bd5d7ca45c90f1aa 100644 (file)
 #include <QLineEdit>
 #include <QPushButton>
 
+#ifdef LYX_MERGED_BUILD
+// GCC couldn't find operator==
+namespace lyx {
+       bool operator==(lyx::docstring & d, char const * c) 
+               { return lyx::operator ==(d, c); }
+       namespace frontend {
+               bool operator==(lyx::docstring & d, char const * c) 
+                 { return lyx::operator ==(d, c); }
+       }
+}
+#endif
+
 
 namespace lyx {
 namespace frontend {
index 9bb8f05dba0cef6f8f7df61ee45ec5722ff725e4..6591b5550c8c896e5ace0211ae2c9091f7b1dd26 100644 (file)
@@ -44,7 +44,7 @@ namespace frontend {
 /////////////////////////////////////////////////////////////////////
 
 
-char const * languages[] =
+char const * languages_supported[] =
 { "no language", "ABAP", "ACSL", "Ada", "ALGOL", "Assembler", "Awk", "bash", "Basic", "C",
   "C++", "Caml", "Clean", "Cobol", "Comal 80", "command.com", "Comsol", "csh", "Delphi",
   "Eiffel", "Elan", "erlang", "Euphoria", "Fortran", "Gnuplot", "Haskell", "HTML", "IDL", "inform",
@@ -213,7 +213,7 @@ GuiListings::GuiListings(GuiView & lv)
        connect(bypassCB, SIGNAL(clicked()),
                this, SLOT(setListingsMsg()));
 
-       for (int n = 0; languages[n][0]; ++n)
+       for (int n = 0; languages_supported[n][0]; ++n)
                languageCO->addItem(qt_(languages_gui[n]));
 
        for (int n = 0; font_styles[n][0]; ++n)
@@ -251,7 +251,7 @@ void GuiListings::change_adaptor()
 
 string GuiListings::construct_params()
 {
-       string language = languages[qMax(0, languageCO->currentIndex())];
+       string language = languages_supported[qMax(0, languageCO->currentIndex())];
        string dialect;
        string const dialect_gui = fromqstr(dialectCO->currentText());
        if (dialectCO->currentIndex() > 0) {
@@ -412,7 +412,7 @@ void GuiListings::on_languageCO_currentIndexChanged(int index)
        // 0 is "no dialect"
        int default_dialect = 0;
        dialectCO->addItem(qt_("No dialect"));
-       string const language = languages[index];
+       string const language = languages_supported[index];
 
        for (size_t i = 0; i != nr_dialects; ++i) {
                if (language == dialects[i].language) {
@@ -448,7 +448,7 @@ void GuiListings::updateContents()
        // set default values
        listingsTB->setPlainText(
                qt_("Input listing parameters on the right. Enter ? for a list of parameters."));
-       languageCO->setCurrentIndex(findToken(languages, "no language"));
+       languageCO->setCurrentIndex(findToken(languages_supported, "no language"));
        dialectCO->setCurrentIndex(0);
        floatCB->setChecked(false);
        placementLE->clear();
@@ -489,7 +489,7 @@ void GuiListings::updateContents()
                        } else {
                                language = arg;
                        }
-                       int n = findToken(languages, language);
+                       int n = findToken(languages_supported, language);
                        if (n >= 0) {
                                languageCO->setCurrentIndex(n);
                                in_gui = true;
index fe0c201b8dc3fe26d20f4ab403dcc02555094797..e5556b1beaea2cfa3b145b76269a9a10d3bdda49 100644 (file)
@@ -2722,7 +2722,8 @@ void GuiView::dispatch(FuncRequest const & cmd, DispatchResult & dr)
                case LFUN_BUFFER_EXPORT: {
                        if (!doc_buffer)
                                break;
-                       if (cmd.argument() == "custom") {
+                       // GCC only sees strfwd.h when building merged
+                       if (::lyx::operator==(cmd.argument(), "custom")) {
                                dispatch(FuncRequest(LFUN_DIALOG_SHOW, "sendto"), 
                                         dr);
                                break;
index 85dfed168fc46a06438153fa8faa2fbc1e042f6f..fcd97f5685e433094419f17bb88267873e662d43 100644 (file)
@@ -69,6 +69,7 @@ extern odocstream & operator<<(odocstream &, char);
 
 docstring const & empty_docstring();
 std::string const & empty_string();
+bool operator==(docstring const &, char const *);
 
 } // namespace lyx