cmake: Compile with -fcommon

Newer versions of gcc and clang default to fno-common and
our global variable usage requires -fcommon.
This commit is contained in:
Tom Stellard 2021-06-06 10:11:13 -07:00
parent bc4a6ded85
commit dd115a7e69
1 changed files with 5 additions and 1 deletions

View File

@ -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})