From d948508aa22ff273c915397f5aba365ac10bd4e4 Mon Sep 17 00:00:00 2001 From: Egor Yusov Date: Tue, 19 Dec 2017 17:54:14 -0800 Subject: Enabling linux build --- External/libtiff-4.0.3/CMakeLists.txt | 16 ++- .../libtiff-4.0.3/libtiff/tif_config.android.h | 4 +- External/libtiff-4.0.3/libtiff/tif_config.h | 4 + External/libtiff-4.0.3/libtiff/tif_config.linux.h | 71 ++++++++++ External/libtiff-4.0.3/libtiff/tiffconf.android.h | 152 --------------------- External/libtiff-4.0.3/libtiff/tiffconf.h | 8 +- External/libtiff-4.0.3/libtiff/tiffconf.linux.h | 152 +++++++++++++++++++++ External/lua-5.2.3/CMakeLists.txt | 2 +- External/zlib-1.2.8/CMakeLists.txt | 2 +- RenderScript/CMakeLists.txt | 3 +- 10 files changed, 252 insertions(+), 162 deletions(-) create mode 100644 External/libtiff-4.0.3/libtiff/tif_config.linux.h delete mode 100644 External/libtiff-4.0.3/libtiff/tiffconf.android.h create mode 100644 External/libtiff-4.0.3/libtiff/tiffconf.linux.h diff --git a/External/libtiff-4.0.3/CMakeLists.txt b/External/libtiff-4.0.3/CMakeLists.txt index 0a76ad3..ff3b031 100644 --- a/External/libtiff-4.0.3/CMakeLists.txt +++ b/External/libtiff-4.0.3/CMakeLists.txt @@ -47,7 +47,7 @@ set(SOURCE if(PLATFORM_WIN32) list(APPEND SOURCE libtiff/tif_win32.c) -elseif(PLATFORM_ANDROID OR PLATFORM_UNIVERSAL_WINDOWS) +elseif(PLATFORM_ANDROID OR PLATFORM_UNIVERSAL_WINDOWS OR PLATFORM_LINUX) list(APPEND SOURCE libtiff/tif_unix.c) else() message(FATAL_ERROR "Unknown platform") @@ -64,7 +64,7 @@ set(INCLUDE libtiff/tif_fax3.h libtiff/tif_predict.h libtiff/tiff.h - libtiff/tiffconf.android.h + libtiff/tiffconf.linux.h libtiff/tiffconf.h libtiff/tiffconf.vc.h libtiff/tiffconf.wince.h @@ -89,6 +89,18 @@ if(MSVC) endif() endif(MSVC) +if (CMAKE_CXX_COMPILER_ID MATCHES "GNU") + # Suppress the following warnings in tif_unix.c + # cast from pointer to integer of different size [-Wpointer-to-int-cast] + # and + # cast to pointer from integer of different size [-Wint-to-pointer-cast] + set_source_files_properties( + libtiff/tif_unix.c + PROPERTIES + COMPILE_FLAGS "-Wno-pointer-to-int-cast -Wno-int-to-pointer-cast" + ) +endif() + target_link_libraries(LibTiff PRIVATE BuildSettings) target_include_directories(LibTiff diff --git a/External/libtiff-4.0.3/libtiff/tif_config.android.h b/External/libtiff-4.0.3/libtiff/tif_config.android.h index e3826ad..517c3bf 100644 --- a/External/libtiff-4.0.3/libtiff/tif_config.android.h +++ b/External/libtiff-4.0.3/libtiff/tif_config.android.h @@ -21,7 +21,7 @@ //#define HAVE_IO_H 1 /* Define to 1 if you have the header file. */ -//#define HAVE_SEARCH_H 1 +#define HAVE_SEARCH_H 1 /* Define to 1 if you have the header file. */ #define HAVE_UNISTD_H 1 @@ -50,7 +50,6 @@ /* Set the native cpu bit order */ #define HOST_FILLORDER FILLORDER_LSB2MSB -#define snprintf _snprintf /* Define to 1 if your processor stores words with the most significant byte first (like Motorola and SPARC, unlike Intel and VAX). */ @@ -64,7 +63,6 @@ # endif #endif -#define lfind _lfind /* * Local Variables: * mode: c diff --git a/External/libtiff-4.0.3/libtiff/tif_config.h b/External/libtiff-4.0.3/libtiff/tif_config.h index 6ed7d7f..45df73e 100644 --- a/External/libtiff-4.0.3/libtiff/tif_config.h +++ b/External/libtiff-4.0.3/libtiff/tif_config.h @@ -6,6 +6,10 @@ # include "tif_config.android.h" +#elif defined(PLATFORM_LINUX) + +# include "tif_config.linux.h" + #else # error "Unknown platform" diff --git a/External/libtiff-4.0.3/libtiff/tif_config.linux.h b/External/libtiff-4.0.3/libtiff/tif_config.linux.h new file mode 100644 index 0000000..536d1b6 --- /dev/null +++ b/External/libtiff-4.0.3/libtiff/tif_config.linux.h @@ -0,0 +1,71 @@ +/* Define to 1 if you have the header file. */ +#define HAVE_ASSERT_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_FCNTL_H 1 + +/* Define as 0 or 1 according to the floating point format suported by the + machine */ +#define HAVE_IEEEFP 1 + +/* Define to 1 if you have the `jbg_newlen' function. */ +#define HAVE_JBG_NEWLEN 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_STRING_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_SYS_TYPES_H 1 + +/* Define to 1 if you have the header file. */ +//#define HAVE_IO_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_SEARCH_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_UNISTD_H 1 + +/* Define to 1 if you have the `setmode' function. */ +#define HAVE_SETMODE 1 + +/* The size of a `int', as computed by sizeof. */ +#define SIZEOF_INT 4 + +/* The size of a `long', as computed by sizeof. */ +#define SIZEOF_LONG 4 + +/* Signed 64-bit type formatter */ +#define TIFF_INT64_FORMAT "%lld" + +/* Signed 64-bit type */ +#define TIFF_INT64_T signed long long + +/* Unsigned 64-bit type formatter */ +#define TIFF_UINT64_FORMAT "%llu" + +/* Unsigned 64-bit type */ +#define TIFF_UINT64_T unsigned long long + +/* Set the native cpu bit order */ +#define HOST_FILLORDER FILLORDER_LSB2MSB + +/* Define to 1 if your processor stores words with the most significant byte + first (like Motorola and SPARC, unlike Intel and VAX). */ +/* #undef WORDS_BIGENDIAN */ + +/* Define to `__inline__' or `__inline' if that's what the C compiler + calls it, or to nothing if 'inline' is not supported under any name. */ +#ifndef __cplusplus +# ifndef inline +# define inline __inline +# endif +#endif + +/* + * Local Variables: + * mode: c + * c-basic-offset: 8 + * fill-column: 78 + * End: + */ diff --git a/External/libtiff-4.0.3/libtiff/tiffconf.android.h b/External/libtiff-4.0.3/libtiff/tiffconf.android.h deleted file mode 100644 index f01b835..0000000 --- a/External/libtiff-4.0.3/libtiff/tiffconf.android.h +++ /dev/null @@ -1,152 +0,0 @@ -/* - Configuration defines for installed libtiff. - This file maintained for backward compatibility. Do not use definitions - from this file in your programs. -*/ - -#ifndef _TIFFCONF_ -#define _TIFFCONF_ - -/* Define to 1 if the system has the type `int16'. */ -/* #undef HAVE_INT16 */ - -/* Define to 1 if the system has the type `int32'. */ -/* #undef HAVE_INT32 */ - -/* Define to 1 if the system has the type `int8'. */ -/* #undef HAVE_INT8 */ - -/* The size of a `int', as computed by sizeof. */ -#define SIZEOF_INT 4 - -/* Signed 8-bit type */ -#define TIFF_INT8_T signed char - -/* Unsigned 8-bit type */ -#define TIFF_UINT8_T unsigned char - -/* Signed 16-bit type */ -#define TIFF_INT16_T signed short - -/* Unsigned 16-bit type */ -#define TIFF_UINT16_T unsigned short - -/* Signed 32-bit type formatter */ -#define TIFF_INT32_FORMAT "%d" - -/* Signed 32-bit type */ -#define TIFF_INT32_T signed int - -/* Unsigned 32-bit type formatter */ -#define TIFF_UINT32_FORMAT "%u" - -/* Unsigned 32-bit type */ -#define TIFF_UINT32_T unsigned int - -/* Signed 64-bit type formatter */ -#define TIFF_INT64_FORMAT "%lld" - -/* Signed 64-bit type */ -#define TIFF_INT64_T signed long long - -/* Unsigned 64-bit type formatter */ -#define TIFF_UINT64_FORMAT "%llu" - -/* Unsigned 64-bit type */ -#define TIFF_UINT64_T unsigned long long - -/* Signed size type */ -#define TIFF_SSIZE_T signed long int - -/* Signed size type formatter */ -#define TIFF_SSIZE_FORMAT "%ld" - -/* Pointer difference type */ -#define TIFF_PTRDIFF_T long - -/* Compatibility stuff. */ - -/* Define as 0 or 1 according to the floating point format suported by the - machine */ -#define HAVE_IEEEFP 1 - -/* Set the native cpu bit order (FILLORDER_LSB2MSB or FILLORDER_MSB2LSB) */ -#define HOST_FILLORDER FILLORDER_LSB2MSB - -/* Native cpu byte order: 1 if big-endian (Motorola) or 0 if little-endian - (Intel) */ -#define HOST_BIGENDIAN 0 - -/* Support CCITT Group 3 & 4 algorithms */ -#define CCITT_SUPPORT 1 - -/* Support JPEG compression (requires IJG JPEG library) */ -/* #undef JPEG_SUPPORT */ - -/* Support JBIG compression (requires JBIG-KIT library) */ -/* #undef JBIG_SUPPORT */ - -/* Support LogLuv high dynamic range encoding */ -#define LOGLUV_SUPPORT 1 - -/* Support LZW algorithm */ -#define LZW_SUPPORT 1 - -/* Support NeXT 2-bit RLE algorithm */ -#define NEXT_SUPPORT 1 - -/* Support Old JPEG compresson (read contrib/ojpeg/README first! Compilation - fails with unpatched IJG JPEG library) */ -/* #undef OJPEG_SUPPORT */ - -/* Support Macintosh PackBits algorithm */ -#define PACKBITS_SUPPORT 1 - -/* Support Pixar log-format algorithm (requires Zlib) */ -/* #undef PIXARLOG_SUPPORT */ - -/* Support ThunderScan 4-bit RLE algorithm */ -#define THUNDER_SUPPORT 1 - -/* Support Deflate compression */ -/* #undef ZIP_SUPPORT */ - -/* Support strip chopping (whether or not to convert single-strip uncompressed - images to mutiple strips of ~8Kb to reduce memory usage) */ -#define STRIPCHOP_DEFAULT TIFF_STRIPCHOP - -/* Enable SubIFD tag (330) support */ -#define SUBIFD_SUPPORT 1 - -/* Treat extra sample as alpha (default enabled). The RGBA interface will - treat a fourth sample with no EXTRASAMPLE_ value as being ASSOCALPHA. Many - packages produce RGBA files but don't mark the alpha properly. */ -#define DEFAULT_EXTRASAMPLE_AS_ALPHA 1 - -/* Pick up YCbCr subsampling info from the JPEG data stream to support files - lacking the tag (default enabled). */ -#define CHECK_JPEG_YCBCR_SUBSAMPLING 1 - -/* Support MS MDI magic number files as TIFF */ -/* #undef MDI_SUPPORT */ - -/* - * Feature support definitions. - * XXX: These macros are obsoleted. Don't use them in your apps! - * Macros stays here for backward compatibility and should be always defined. - */ -#define COLORIMETRY_SUPPORT -#define YCBCR_SUPPORT -#define CMYK_SUPPORT -#define ICC_SUPPORT -#define PHOTOSHOP_SUPPORT -#define IPTC_SUPPORT - -#endif /* _TIFFCONF_ */ -/* - * Local Variables: - * mode: c - * c-basic-offset: 8 - * fill-column: 78 - * End: - */ diff --git a/External/libtiff-4.0.3/libtiff/tiffconf.h b/External/libtiff-4.0.3/libtiff/tiffconf.h index cd026b2..8806afc 100644 --- a/External/libtiff-4.0.3/libtiff/tiffconf.h +++ b/External/libtiff-4.0.3/libtiff/tiffconf.h @@ -2,8 +2,12 @@ # include "tiffconf.vc.h" -#elif defined(PLATFORM_ANDROID) +#elif defined(PLATFORM_ANDROID) || defined(PLATFORM_LINUX) -# include "tiffconf.android.h" +# include "tiffconf.linux.h" + +#else + +# error Unsupported platform #endif \ No newline at end of file diff --git a/External/libtiff-4.0.3/libtiff/tiffconf.linux.h b/External/libtiff-4.0.3/libtiff/tiffconf.linux.h new file mode 100644 index 0000000..f01b835 --- /dev/null +++ b/External/libtiff-4.0.3/libtiff/tiffconf.linux.h @@ -0,0 +1,152 @@ +/* + Configuration defines for installed libtiff. + This file maintained for backward compatibility. Do not use definitions + from this file in your programs. +*/ + +#ifndef _TIFFCONF_ +#define _TIFFCONF_ + +/* Define to 1 if the system has the type `int16'. */ +/* #undef HAVE_INT16 */ + +/* Define to 1 if the system has the type `int32'. */ +/* #undef HAVE_INT32 */ + +/* Define to 1 if the system has the type `int8'. */ +/* #undef HAVE_INT8 */ + +/* The size of a `int', as computed by sizeof. */ +#define SIZEOF_INT 4 + +/* Signed 8-bit type */ +#define TIFF_INT8_T signed char + +/* Unsigned 8-bit type */ +#define TIFF_UINT8_T unsigned char + +/* Signed 16-bit type */ +#define TIFF_INT16_T signed short + +/* Unsigned 16-bit type */ +#define TIFF_UINT16_T unsigned short + +/* Signed 32-bit type formatter */ +#define TIFF_INT32_FORMAT "%d" + +/* Signed 32-bit type */ +#define TIFF_INT32_T signed int + +/* Unsigned 32-bit type formatter */ +#define TIFF_UINT32_FORMAT "%u" + +/* Unsigned 32-bit type */ +#define TIFF_UINT32_T unsigned int + +/* Signed 64-bit type formatter */ +#define TIFF_INT64_FORMAT "%lld" + +/* Signed 64-bit type */ +#define TIFF_INT64_T signed long long + +/* Unsigned 64-bit type formatter */ +#define TIFF_UINT64_FORMAT "%llu" + +/* Unsigned 64-bit type */ +#define TIFF_UINT64_T unsigned long long + +/* Signed size type */ +#define TIFF_SSIZE_T signed long int + +/* Signed size type formatter */ +#define TIFF_SSIZE_FORMAT "%ld" + +/* Pointer difference type */ +#define TIFF_PTRDIFF_T long + +/* Compatibility stuff. */ + +/* Define as 0 or 1 according to the floating point format suported by the + machine */ +#define HAVE_IEEEFP 1 + +/* Set the native cpu bit order (FILLORDER_LSB2MSB or FILLORDER_MSB2LSB) */ +#define HOST_FILLORDER FILLORDER_LSB2MSB + +/* Native cpu byte order: 1 if big-endian (Motorola) or 0 if little-endian + (Intel) */ +#define HOST_BIGENDIAN 0 + +/* Support CCITT Group 3 & 4 algorithms */ +#define CCITT_SUPPORT 1 + +/* Support JPEG compression (requires IJG JPEG library) */ +/* #undef JPEG_SUPPORT */ + +/* Support JBIG compression (requires JBIG-KIT library) */ +/* #undef JBIG_SUPPORT */ + +/* Support LogLuv high dynamic range encoding */ +#define LOGLUV_SUPPORT 1 + +/* Support LZW algorithm */ +#define LZW_SUPPORT 1 + +/* Support NeXT 2-bit RLE algorithm */ +#define NEXT_SUPPORT 1 + +/* Support Old JPEG compresson (read contrib/ojpeg/README first! Compilation + fails with unpatched IJG JPEG library) */ +/* #undef OJPEG_SUPPORT */ + +/* Support Macintosh PackBits algorithm */ +#define PACKBITS_SUPPORT 1 + +/* Support Pixar log-format algorithm (requires Zlib) */ +/* #undef PIXARLOG_SUPPORT */ + +/* Support ThunderScan 4-bit RLE algorithm */ +#define THUNDER_SUPPORT 1 + +/* Support Deflate compression */ +/* #undef ZIP_SUPPORT */ + +/* Support strip chopping (whether or not to convert single-strip uncompressed + images to mutiple strips of ~8Kb to reduce memory usage) */ +#define STRIPCHOP_DEFAULT TIFF_STRIPCHOP + +/* Enable SubIFD tag (330) support */ +#define SUBIFD_SUPPORT 1 + +/* Treat extra sample as alpha (default enabled). The RGBA interface will + treat a fourth sample with no EXTRASAMPLE_ value as being ASSOCALPHA. Many + packages produce RGBA files but don't mark the alpha properly. */ +#define DEFAULT_EXTRASAMPLE_AS_ALPHA 1 + +/* Pick up YCbCr subsampling info from the JPEG data stream to support files + lacking the tag (default enabled). */ +#define CHECK_JPEG_YCBCR_SUBSAMPLING 1 + +/* Support MS MDI magic number files as TIFF */ +/* #undef MDI_SUPPORT */ + +/* + * Feature support definitions. + * XXX: These macros are obsoleted. Don't use them in your apps! + * Macros stays here for backward compatibility and should be always defined. + */ +#define COLORIMETRY_SUPPORT +#define YCBCR_SUPPORT +#define CMYK_SUPPORT +#define ICC_SUPPORT +#define PHOTOSHOP_SUPPORT +#define IPTC_SUPPORT + +#endif /* _TIFFCONF_ */ +/* + * Local Variables: + * mode: c + * c-basic-offset: 8 + * fill-column: 78 + * End: + */ diff --git a/External/lua-5.2.3/CMakeLists.txt b/External/lua-5.2.3/CMakeLists.txt index 383bae8..6e4ee5c 100644 --- a/External/lua-5.2.3/CMakeLists.txt +++ b/External/lua-5.2.3/CMakeLists.txt @@ -87,7 +87,7 @@ if(MSVC) endif(MSVC) if (CMAKE_CXX_COMPILER_ID MATCHES "Clang" OR - CMAKE_CXX_COMPILER_ID STREQUAL "GNU") + CMAKE_CXX_COMPILER_ID MATCHES "GNU") # Setting LANGUAGE to CXX is not enough for clang, so use -x c++ to compile c files as c++ and suppress # the following warning: # clang++.exe: warning: treating 'c' input as 'c++' when in C++ mode, this behavior is deprecated [-Wdeprecated] diff --git a/External/zlib-1.2.8/CMakeLists.txt b/External/zlib-1.2.8/CMakeLists.txt index b6dc7a6..a7ad493 100644 --- a/External/zlib-1.2.8/CMakeLists.txt +++ b/External/zlib-1.2.8/CMakeLists.txt @@ -49,7 +49,7 @@ if(PLATFORM_ANDROID) endif() if (CMAKE_CXX_COMPILER_ID MATCHES "Clang" OR - CMAKE_CXX_COMPILER_ID STREQUAL "GNU") + CMAKE_CXX_COMPILER_ID MATCHES "GNU") # For inflate.c, disable the following # warning: shifting a negative signed value is undefined [-Wshift-negative-value] set_source_files_properties(inflate.c PROPERTIES COMPILE_FLAGS -Wno-shift-negative-value) diff --git a/RenderScript/CMakeLists.txt b/RenderScript/CMakeLists.txt index aef4334..0521027 100644 --- a/RenderScript/CMakeLists.txt +++ b/RenderScript/CMakeLists.txt @@ -71,7 +71,8 @@ PUBLIC include ) -if(PLATFORM_ANDROID) +if (CMAKE_CXX_COMPILER_ID MATCHES "Clang" OR + CMAKE_CXX_COMPILER_ID MATCHES "GNU") # Suppress warnings from applying the ‘offsetof’ macro to a non-POD type # warning: offset of on non-standard-layout type [-Winvalid-offsetof] # This is OK because the warning is generated for simple structs (such as TextureDesc) -- cgit v1.2.3