From d6c57d6c85679915babdf3f9138f66a25a5c1279 Mon Sep 17 00:00:00 2001 From: past-due <30942300+past-due@users.noreply.github.com> Date: Thu, 12 Oct 2023 20:21:36 -0400 Subject: [PATCH] [CMake] Drop the HAVE_CONFIG_H define This was an autotools leftover - CMake is always guaranteed to write the config file. Also, rename the WZ-specific generated "config.h" to "wz2100-generated-config.h". --- CMakeLists.txt | 4 +--- lib/framework/types.h | 7 +++---- lib/framework/wzglobal.h | 12 +++--------- src/input/manager.cpp | 1 - 4 files changed, 7 insertions(+), 17 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index fdbe4a4141a..d9ec8bbbb7d 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -686,8 +686,6 @@ macro(CONFIGURE_WZ_COMPILER_WARNINGS) endif() endmacro(CONFIGURE_WZ_COMPILER_WARNINGS) -add_definitions("-DHAVE_CONFIG_H") - # CMAKE_CURRENT_BINARY_DIR should come before the current source directory # so that any build products are preferentially included over in-source build # products that might have been generated by a different compilation method / run @@ -794,7 +792,7 @@ function(CHECK_IS_ABSOLUTE_PATH _var _output) endfunction() CHECK_IS_ABSOLUTE_PATH(WZ_DATADIR WZ_DATADIR_ISABSOLUTE) CHECK_IS_ABSOLUTE_PATH(WZ_LOCALEDIR WZ_LOCALEDIR_ISABSOLUTE) -CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/src/config.h.in ${CMAKE_CURRENT_BINARY_DIR}/config.h) +CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/src/config.h.in ${CMAKE_CURRENT_BINARY_DIR}/wz2100-generated-config.h) # Attempt to find Miniupnpc (minimum supported API version = 9) # NOTE: This is not available on every platform / distro diff --git a/lib/framework/types.h b/lib/framework/types.h index dae24d74dac..b2030d878c4 100644 --- a/lib/framework/types.h +++ b/lib/framework/types.h @@ -31,10 +31,9 @@ #define __STDC_LIMIT_MACROS #endif -#if defined(HAVE_CONFIG_H) -# undef _XOPEN_SOURCE -# include "config.h" -#endif +// Always include generated config.h +#undef _XOPEN_SOURCE +#include "wz2100-generated-config.h" #include // for size_t diff --git a/lib/framework/wzglobal.h b/lib/framework/wzglobal.h index 417f0607db4..9c7bfd463d2 100644 --- a/lib/framework/wzglobal.h +++ b/lib/framework/wzglobal.h @@ -34,15 +34,9 @@ #define __STDC_LIMIT_MACROS #endif -#if defined(HAVE_CONFIG_H) -# undef _XOPEN_SOURCE -# include "config.h" -#elif !defined(HAVE_CONFIG_H) -# define PACKAGE "warzone2100" -# define PACKAGE_BUGREPORT "http://wz2100.net/" -# define PACKAGE_NAME "Warzone 2100" -# define PACKAGE_TARNAME "warzone2100" -#endif +// Always include generated config.h +#undef _XOPEN_SOURCE +#include "wz2100-generated-config.h" /* ---- Platform detection ---- */ diff --git a/src/input/manager.cpp b/src/input/manager.cpp index b102558bf0a..b2424a1bfff 100644 --- a/src/input/manager.cpp +++ b/src/input/manager.cpp @@ -27,7 +27,6 @@ #include "manager.h" #include "context.h" -#include "config.h" #include "mapping.h" #include "../keybind.h"