From dd115a7e6981c0e7d3f88208a4a6b4e9d93cd069 Mon Sep 17 00:00:00 2001 From: Tom Stellard Date: Sun, 6 Jun 2021 10:11:13 -0700 Subject: [PATCH] cmake: Compile with -fcommon Newer versions of gcc and clang default to fno-common and our global variable usage requires -fcommon. --- CMakeLists.txt | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index a0605b88..bbc13ab7 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -140,7 +140,11 @@ add_executable(bygfoot WIN32 ) # Some gtk headers use deprecated glib features, so disable this warning # since we can't do anything about it. -target_compile_options(bygfoot PRIVATE -Wno-deprecated-declarations) +# Newer versions of gcc and clang enable fno-common by default and +# this won't work with the global variables in bygfoot. +target_compile_options(bygfoot PRIVATE + -Wno-deprecated-declarations + -fcommon) # Link the target to the GTK+ libraries target_link_libraries (bygfoot ${GTK2_LIBRARIES} ${GLIB_LIBRARIES} m ${ZLIB_LIBRARIES} ${JSON-C_LIBRARIES})