Bug 2829 - CMake build on WIN32 results in using tif_unix.c iso tif_win32.c
: CMake build on WIN32 results in using tif_unix.c iso tif_win32.c
Status: RESOLVED FIXED
: libtiff
default
: unspecified
: PC Windows NT
: P2 enhancement
: ---
Assigned To:
:
:
:
:
:
  Show dependency treegraph
 
Reported: 2018-12-14 10:21 by
Modified: 2019-05-08 03:17 (History)


Attachments


Note

You need to log in before you can comment on or make changes to this bug.


Description From 2018-12-14 10:21:02
Using the CMake build on WIN32, the tif_win32.c does not get used but
tif_unix.c is used instead.

In the top CMakeLists.txt file we have:

--8<--
# Win32 IO
set(win32_io FALSE)
if(WIN32)
  set(win32_io TRUE)
endif()

set(USE_WIN32_FILEIO ${win32_io})
--8<--

In the libtiff CMakeLists.txt file we have:

--8<--
if(WIN32_IO)
  extra_dist(tif_unix.c)
  list(APPEND tiff_SOURCES tif_win32.c)
else()
  extra_dist(tif_win32.c)
  list(APPEND tiff_SOURCES tif_unix.c)
endif()
--8<--

So the cause is that the wrong test is done.  Casing in CMake variable names
matter.  Changing "if(WIN32_IO)" to "if(win32_io)" solves this problem.
------- Comment #1 From 2019-04-25 07:31:26 -------
I think it should be

if(USE_WIN32_FILEIO)
------- Comment #2 From 2019-04-25 07:37:27 -------
https://gitlab.com/libtiff/libtiff/merge_requests/75
------- Comment #3 From 2019-05-08 03:17:10 -------
Fixed per https://gitlab.com/libtiff/libtiff/merge_requests/75