Merge branch 'shared-memory' into 'master'

Set the --shared-memory linker flag for Emscripten builds

See merge request libtiff/libtiff!153
This commit is contained in:
Even Rouault 2020-10-04 09:51:13 +00:00
commit 8c4c297a48
4 changed files with 62 additions and 0 deletions

View File

@ -32,3 +32,9 @@ include_directories(${PROJECT_SOURCE_DIR}/libtiff
add_executable(addtiffo addtiffo.c tif_overview.c tif_ovrcache.c tif_ovrcache.h)
target_link_libraries(addtiffo tiff port)
if(WEBP_SUPPORT AND EMSCRIPTEN)
# Emscripten is pretty finnicky about linker flags.
# It needs --shared-memory if and only if atomics or bulk-memory is used.
target_link_options(addtiffo PUBLIC "-Wl,--shared-memory")
endif()

View File

@ -41,3 +41,14 @@ target_link_libraries(tiff-rgb tiff port)
add_subdirectory(xtiff)
extra_dist(README)
if(WEBP_SUPPORT AND EMSCRIPTEN)
# Emscripten is pretty finnicky about linker flags.
# It needs --shared-memory if and only if atomics or bulk-memory is used.
foreach(target tiff-bi
tiff-grayscale
tiff-palette
tiff-rgb)
target_link_options(${target} PUBLIC "-Wl,--shared-memory")
endforeach()
endif()

View File

@ -220,6 +220,24 @@ target_link_libraries(defer_strile_writing tiff port)
add_executable(testtypes testtypes.c)
target_link_libraries(testtypes tiff port)
if(WEBP_SUPPORT AND EMSCRIPTEN)
# Emscripten is pretty finnicky about linker flags.
# It needs --shared-memory if and only if atomics or bulk-memory is used.
foreach(target ascii_tag
custom_dir
defer_strile_loading
defer_strile_writing
long_tag
rewrite
short_tag
strip_rw)
target_link_options(${target} PUBLIC "-Wl,--shared-memory")
endforeach()
if(JPEG_SUPPORT)
target_link_options(raw_decode PUBLIC "-Wl,--shared-memory")
endif()
endif()
set(TEST_OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/output")
file(MAKE_DIRECTORY "${TEST_OUTPUT}")

View File

@ -123,3 +123,30 @@ if(HAVE_OPENGL)
install(TARGETS tiffgt
RUNTIME DESTINATION "${CMAKE_INSTALL_FULL_BINDIR}")
endif()
if(WEBP_SUPPORT AND EMSCRIPTEN)
# Emscripten is pretty finnicky about linker flags.
# It needs --shared-memory if and only if atomics or bulk-memory is used.
foreach(target fax2ps
fax2tiff
pal2rgb
ppm2tiff
raw2tiff
rgb2ycbcr
thumbnail
tiff2bw
tiff2pdf
tiff2ps
tiff2rgba
tiffcmp
tiffcp
tiffcrop
tiffdither
tiffdump
tiffinfo
tiffmedian
tiffset
tiffsplit)
target_link_options(${target} PUBLIC "-Wl,--shared-memory")
endforeach()
endif()