Skip to content

Commit

Permalink
Skip building libtiff tools on all platforms
Browse files Browse the repository at this point in the history
build_usd.py now patches the libtiff build to skip
building the included tools, most notably tiffgt,
on Linux and MacOS. This removes a GLUT
dependency that is otherwise unnecessary.

The build script had already been doing this on
Windows for other reasons; this change extends
this behavior to all other platforms.

Fixes #402

(Internal change: 1843826)
  • Loading branch information
sunyab authored and pixar-oss committed Apr 3, 2018
1 parent f4ae208 commit 44ec289
Showing 1 changed file with 5 additions and 12 deletions.
17 changes: 5 additions & 12 deletions build_scripts/build_usd.py
Original file line number Diff line number Diff line change
Expand Up @@ -545,26 +545,19 @@ def InstallJPEG_Lib(context, force):
TIFF_URL = "ftp://download.osgeo.org/libtiff/tiff-4.0.7.zip"

def InstallTIFF(context, force):
if Windows():
InstallTIFF_Windows(context, force)
else:
InstallTIFF_LinuxOrMacOS(context, force)

def InstallTIFF_Windows(context, force):
with CurrentWorkingDirectory(DownloadURL(TIFF_URL, context, force)):
# libTIFF has a build issue on Windows where tools/tiffgt.c
# unconditionally includes unistd.h, which does not exist.
# To avoid this, we patch the CMakeLists.txt to skip building
# the tools entirely. We also need to skip building tests, since
# they rely on the tools we've just elided.
# the tools entirely. We do this on Linux and MacOS as well
# to avoid requiring some GL and X dependencies.
#
# We also need to skip building tests, since they rely on
# the tools we've just elided.
PatchFile("CMakeLists.txt",
[("add_subdirectory(tools)", "# add_subdirectory(tools)"),
("add_subdirectory(test)", "# add_subdirectory(test)")])
RunCMake(context, force)

def InstallTIFF_LinuxOrMacOS(context, force):
with CurrentWorkingDirectory(DownloadURL(TIFF_URL, context, force)):
RunCMake(context, force)

TIFF = Dependency("TIFF", InstallTIFF, "include/tiff.h")

Expand Down

0 comments on commit 44ec289

Please sign in to comment.