1
0
mirror of https://git.tartarus.org/simon/putty.git synced 2025-01-08 08:58:00 +00:00

Make cmake.h available everywhere.

The definition of HAVE_CMAKE_H is now at the very top of the main
CMakeLists.txt, so that it applies to all objects. And the consequent
include of cmake.h is at the very top of defs.h, so that it should be
included first by everything. This way, I don't have to worry any more
that the HAVE_FOO definitions in cmake.h might accidentally have
failed to reach some part of the code.
This commit is contained in:
Simon Tatham 2021-04-19 06:40:01 +01:00
parent 70f6ce5628
commit 9fe1550980
4 changed files with 6 additions and 10 deletions

View File

@ -3,6 +3,8 @@ project(putty LANGUAGES C)
include(cmake/setup.cmake)
add_compile_definitions(HAVE_CMAKE_H)
add_library(utils STATIC
utils/base64_decode_atom.c
utils/base64_encode_atom.c
@ -161,8 +163,6 @@ add_executable(test_wildcard
target_compile_definitions(test_wildcard PRIVATE TEST)
target_link_libraries(test_wildcard utils ${platform_libraries})
add_compile_definitions(HAVE_CMAKE_H)
foreach(subdir ${PLATFORM_SUBDIRS})
add_subdirectory(${subdir})
endforeach()

4
defs.h
View File

@ -22,6 +22,10 @@
#error Do not compile this code base with NDEBUG defined!
#endif
#if HAVE_CMAKE_H
#include "cmake.h"
#endif
#include <stddef.h>
#include <stdint.h>
#include <stdio.h> /* for __MINGW_PRINTF_FORMAT */

View File

@ -5,10 +5,6 @@
#ifndef PUTTY_UNIX_PLATFORM_H
#define PUTTY_UNIX_PLATFORM_H
#if HAVE_CMAKE_H
#include "cmake.h"
#endif
#include <stdio.h> /* for FILENAME_MAX */
#include <stdint.h> /* C99 int types */
#ifndef NO_LIBDL

View File

@ -5,10 +5,6 @@
#ifndef PUTTY_WINDOWS_PLATFORM_H
#define PUTTY_WINDOWS_PLATFORM_H
#if HAVE_CMAKE_H
#include "cmake.h"
#endif
#include <winsock2.h>
#include <windows.h>
#include <stdio.h> /* for FILENAME_MAX */