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
5 changes: 3 additions & 2 deletions cmake/Modules/CheckTypeSize.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -111,9 +111,10 @@ function(__check_type_size_impl type var map builtin language)
endif()
set(bin ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CheckTypeSize/${var}.bin)
configure_file(${__check_type_size_dir}/CheckTypeSize.c.in ${src} @ONLY)
set(CMAKE_TRY_COMPILE_TARGET_TYPE STATIC_LIBRARY)
try_compile(HAVE_${var} ${CMAKE_BINARY_DIR} ${src}
COMPILE_DEFINITIONS ${CMAKE_REQUIRED_DEFINITIONS}
LINK_LIBRARIES ${CMAKE_REQUIRED_LIBRARIES} "--oformat=wasm" "-sWASM=1"
COMPILE_DEFINITIONS ${CMAKE_REQUIRED_DEFINITIONS} "-fno-lto"
LINK_LIBRARIES ${CMAKE_REQUIRED_LIBRARIES}
CMAKE_FLAGS
"-DCOMPILE_DEFINITIONS:STRING=${CMAKE_REQUIRED_FLAGS}"
"-DINCLUDE_DIRECTORIES:STRING=${CMAKE_REQUIRED_INCLUDES}"
Expand Down
3 changes: 3 additions & 0 deletions test/test_other.py
Original file line number Diff line number Diff line change
Expand Up @@ -1197,6 +1197,9 @@ def test_pkg_config_ports(self):
'': (None,),
'wasm64': ('-m64',),
'pthreads': ('-pthread',),
'wasm_workers': ('-sWASM_WORKERS',),
'exit_runtime': ('-sEXIT_RUNTIME',),
'lto': ('-flto',),
})
def test_cmake_check_type_size(self, cflag):
if cflag == '-m64':
Expand Down
Loading