From 70e91081e1f67b26de3425049f0d8baccc2f2aee Mon Sep 17 00:00:00 2001 From: Tamas Nepusz Date: Wed, 13 Sep 2023 12:41:55 +0200 Subject: [PATCH] fix: trying to fix compilation on Windows --- CMakeLists.txt | 5 +++++ src/getopt.c | 2 ++ 2 files changed, 7 insertions(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index 463ef4b..c4a64b0 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -38,6 +38,7 @@ endif() # Check for headers and symbols check_include_file("getopt.h" HAVE_GETOPT_H) +check_include_file("libintl.h" HAVE_LIBINTL_H) check_symbol_exists(isatty unistd.h HAVE_ISATTY) # Turn on all compiler warnings @@ -65,6 +66,10 @@ add_executable(stitch ${STITCH_SOURCES}) target_include_directories(stitch PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/src ${CURL_INCLUDE_DIRS}) target_link_libraries(stitch ${MATH_LIBRARY} CURL::libcurl) +if(WIN32) + add_compile_definitions(_USE_MATH_DEFINES) +endif() + if(JPEG_FOUND) target_link_libraries(stitch JPEG::JPEG) endif() diff --git a/src/getopt.c b/src/getopt.c index 948c72f..8c10e58 100644 --- a/src/getopt.c +++ b/src/getopt.c @@ -1,3 +1,5 @@ +#include "config.h" + /* Getopt for GNU. NOTE: getopt is now part of the C library, so if you don't know what "Keep this file name-space clean" means, talk to drepper@gnu.org