]> sigrok.org Git - pulseview.git/commitdiff
Add a workaround for QTBUG-22829.
authorUwe Hermann <redacted>
Sat, 28 Feb 2015 19:39:06 +0000 (20:39 +0100)
committerUwe Hermann <redacted>
Sat, 28 Feb 2015 19:49:32 +0000 (20:49 +0100)
Qt4's MOC has issues parsing some C++ constructs, yielding errors like:

  [...]/include/boost/type_traits/detail/has_binary_operator.hp:50:
    Parse error at "BOOST_JOIN"

Full details:

  https://bugreports.qt.io/browse/QTBUG-22829

Use -DBOOST_NEXT_PRIOR_HPP_INCLUDED as MOC option to workaround these
issues. This is currently sufficient, however, depending on the future
PulseView code it may be necessary to add further options mentioned in the
above bugreport (e.g.  BOOST_TT_HAS_OPERATOR_HPP_INCLUDED,
BOOST_LEXICAL_CAST_INCLUDED, BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION).

This fixes bug #532 (fixing the build on at least Mac OS X and MinGW).

CMakeLists.txt
test/CMakeLists.txt

index 79dd8f8b3118e424e8279cd9498f9089ba4230e9..80e90e9b48601bcf74cc665a9aaeb30ab263d49e 100644 (file)
@@ -296,7 +296,10 @@ if(Qt5Core_FOUND)
        qt5_wrap_ui(pulseview_FORMS_HEADERS ${pulseview_FORMS})
        qt5_add_resources(pulseview_RESOURCES_RCC ${pulseview_RESOURCES})
 else()
-       qt4_wrap_cpp(pulseview_HEADERS_MOC ${pulseview_HEADERS})
+       # Workaroud for QTBUG-22829: -DBOOST_NEXT_PRIOR_HPP_INCLUDED.
+       # https://bugreports.qt.io/browse/QTBUG-22829
+       qt4_wrap_cpp(pulseview_HEADERS_MOC ${pulseview_HEADERS}
+               OPTIONS -DBOOST_NEXT_PRIOR_HPP_INCLUDED)
        qt4_wrap_ui(pulseview_FORMS_HEADERS ${pulseview_FORMS})
        qt4_add_resources(pulseview_RESOURCES_RCC ${pulseview_RESOURCES})
        include(${QT_USE_FILE})
index 98b02999695526b9bb59a47922bcd570aa77224a..91b85320bc7262601bc4ac97e7b8f3f5d364fd13 100644 (file)
@@ -132,7 +132,10 @@ endif()
 if(Qt5Core_FOUND)
        qt5_wrap_cpp(pulseview_TEST_HEADERS_MOC ${pulseview_TEST_HEADERS})
 else()
-       qt4_wrap_cpp(pulseview_TEST_HEADERS_MOC ${pulseview_TEST_HEADERS})
+       # Workaroud for QTBUG-22829: -DBOOST_NEXT_PRIOR_HPP_INCLUDED.
+       # https://bugreports.qt.io/browse/QTBUG-22829
+       qt4_wrap_cpp(pulseview_TEST_HEADERS_MOC ${pulseview_TEST_HEADERS}
+               OPTIONS -DBOOST_NEXT_PRIOR_HPP_INCLUDED)
        include(${QT_USE_FILE})
 endif()