diff --git a/CMakeLists.txt b/CMakeLists.txt index cce01d357..1b138b0c0 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -83,6 +83,13 @@ configure_file(include/OpenShotVersion.h.in include/OpenShotVersion.h @ONLY) install(FILES ${CMAKE_CURRENT_BINARY_DIR}/include/OpenShotVersion.h DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/libopenshot) +#### Work around a GCC < 9 bug with handling of _Pragma() in macros +#### See https://gcc.gnu.org/bugzilla/show_bug.cgi?id=55578 +if ((${CMAKE_CXX_COMPILER_ID} STREQUAL "GNU") AND + (${CMAKE_CXX_COMPILER_VERSION} VERSION_LESS "9.0.0")) + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -no-integrated-cpp") +endif() + #### Enable C++11 (for std::shared_ptr support) set(CMAKE_CXX_STANDARD 11) set(CMAKE_CXX_STANDARD_REQUIRED ON)