Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions cmake/Modules/Platform/Emscripten.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ set(CMAKE_SYSTEM_NAME Emscripten)
set(CMAKE_SYSTEM_VERSION 1)

set(CMAKE_CROSSCOMPILING TRUE)
set_property(GLOBAL PROPERTY TARGET_SUPPORTS_SHARED_LIBS FALSE)

# Advertise Emscripten as a 32-bit platform (as opposed to CMAKE_SYSTEM_PROCESSOR=x86_64 for 64-bit platform),
# since some projects (e.g. OpenCV) use this to detect bitness.
Expand Down
2 changes: 1 addition & 1 deletion tests/runner.py
Original file line number Diff line number Diff line change
Expand Up @@ -1370,7 +1370,7 @@ def get_zlib_library(runner_core):
if WINDOWS:
return runner_core.get_library('zlib', os.path.join('libz.a'),
configure=[path_from_root('emconfigure.bat')],
configure_args=['cmake', '.', '-DBUILD_SHARED_LIBS=OFF'],
configure_args=['cmake', '.'],
make=['mingw32-make'],
make_args=[])
else:
Expand Down
4 changes: 2 additions & 2 deletions tests/test_core.py
Original file line number Diff line number Diff line change
Expand Up @@ -5541,7 +5541,7 @@ def test_zlib(self):
use_cmake_configure = WINDOWS
if use_cmake_configure:
make_args = []
configure = [PYTHON, path_from_root('emcmake'), 'cmake', '.', '-DBUILD_SHARED_LIBS=OFF']
configure = [PYTHON, path_from_root('emcmake'), 'cmake', '.']
else:
make_args = ['libz.a']
configure = ['sh', './configure']
Expand Down Expand Up @@ -5646,7 +5646,7 @@ def line_splitter(data):
os.path.sep.join('codec/CMakeFiles/j2k_to_image.dir/convert.c.o'.split('/')),
os.path.sep.join('codec/CMakeFiles/j2k_to_image.dir/__/common/color.c.o'.split('/')),
os.path.join('bin', 'libopenjpeg.a')],
configure=['cmake', '.', '-DBUILD_SHARED_LIBS=OFF'],
configure=['cmake', '.'],
# configure_args=['--enable-tiff=no', '--enable-jp3d=no', '--enable-png=no'],
make_args=[]) # no -j 2, since parallel builds can fail

Expand Down
6 changes: 2 additions & 4 deletions tests/test_other.py
Original file line number Diff line number Diff line change
Expand Up @@ -582,11 +582,9 @@ def check_makefile(dirname):
# while still keeping this test in sensible time limit.
cases = [
('target_js', 'test_cmake.js', ['-DCMAKE_BUILD_TYPE=Debug']),
('target_html', 'hello_world_gles.html', ['-DCMAKE_BUILD_TYPE=Release', '-DBUILD_SHARED_LIBS=OFF']),
('target_library', 'libtest_cmake.a', ['-DCMAKE_BUILD_TYPE=MinSizeRel', '-DBUILD_SHARED_LIBS=OFF']),
('target_html', 'hello_world_gles.html', ['-DCMAKE_BUILD_TYPE=Release']),
('target_library', 'libtest_cmake.a', ['-DCMAKE_BUILD_TYPE=MinSizeRel']),
('target_library', 'libtest_cmake.a', ['-DCMAKE_BUILD_TYPE=RelWithDebInfo', '-DCPP_LIBRARY_TYPE=STATIC']),
('target_library', 'libtest_cmake.so', ['-DCMAKE_BUILD_TYPE=Release', '-DBUILD_SHARED_LIBS=ON']),
('target_library', 'libtest_cmake.so', ['-DCMAKE_BUILD_TYPE=Release', '-DBUILD_SHARED_LIBS=ON', '-DCPP_LIBRARY_TYPE=SHARED']),
('stdproperty', 'helloworld.js', [])
]
for test_dir, output_file, cmake_args in cases:
Expand Down