From c69fae99a561a04cac79d2931b43e53892167a0e Mon Sep 17 00:00:00 2001 From: Bruno de Oliveira Abinader Date: Tue, 9 May 2017 10:12:33 +0300 Subject: [build] Suppress GLFW redefining GLAPIENTRY error --- cmake/glfw.cmake | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'cmake') diff --git a/cmake/glfw.cmake b/cmake/glfw.cmake index ba6ba92e9f..f1ace9e6ef 100644 --- a/cmake/glfw.cmake +++ b/cmake/glfw.cmake @@ -11,6 +11,17 @@ target_sources(mbgl-glfw PRIVATE platform/default/mbgl/util/default_styles.cpp ) +# Our GL implementation is internal to mbgl-core, which causes the GL header to +# be included after GLFW's own header. They both attempt to define GLAPIENTRY, +# but unfortunately the GL header doesn't check if it was previously defined, +# causing a macro redefinition compiler error. +# There is no particular compiler warning flag to ignore this check on GCC +# neither it does accept ignoring '-Werror' via diagnostics pragmas. We can +# only suppress this by either replacing the header path inclusion from -I to +# -isystem, or completely suppressing errors. Until the former solution is not +# available, we'll suppress the errors from that definition file. +set_source_files_properties(platform/glfw/glfw_view.cpp PROPERTIES COMPILE_FLAGS -Wno-error) + target_compile_options(mbgl-glfw PRIVATE -fvisibility-inlines-hidden ) -- cgit v1.2.1