Skip to content

Commit

Permalink
fix: trying to fix compilation on Linux
Browse files Browse the repository at this point in the history
  • Loading branch information
ntamas committed Sep 13, 2023
1 parent 70e9108 commit 1369f7d
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
3 changes: 2 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ endif()
# Check for headers and symbols
check_include_file("getopt.h" HAVE_GETOPT_H)
check_include_file("libintl.h" HAVE_LIBINTL_H)
check_include_file("unistd.h" HAVE_UNISTD_H)
check_symbol_exists(isatty unistd.h HAVE_ISATTY)

# Turn on all compiler warnings
Expand Down Expand Up @@ -67,7 +68,7 @@ target_include_directories(stitch PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/src ${CURL
target_link_libraries(stitch ${MATH_LIBRARY} CURL::libcurl)

if(WIN32)
add_compile_definitions(_USE_MATH_DEFINES)
add_compile_definitions(_USE_MATH_DEFINES _CRT_SECURE_NO_WARNINGS)
endif()

if(JPEG_FOUND)
Expand Down
5 changes: 5 additions & 0 deletions src/stitch.c
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
#include "config.h"

#include <stdbool.h>
#include <stdint.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
Expand All @@ -11,6 +12,10 @@
#include "formats/jpeg.h"
#include "formats/png.h"

#if HAVE_UNISTD_H
# include <unistd.h>
#endif

#if HAVE_GETOPT_H
# include <getopt.h>
#else
Expand Down

0 comments on commit 1369f7d

Please sign in to comment.