Skip to content

Commit 7a8ae99

Browse files
committed
build(wasi): compile pthreadShim in cxx
To avoid: CMake Error: Error required internal CMake variable not set, cmake may not be built correctly. Missing variable is: CMAKE_C_COMPILE_OBJECT
1 parent 7484b79 commit 7a8ae99

File tree

2 files changed

+8
-1
lines changed

2 files changed

+8
-1
lines changed

src/docker/itk-wasm/ITKWebAssemblyInterface.cmake

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,11 @@ function(add_executable target)
6464
# WASI
6565
set_property(TARGET ${wasm_target} PROPERTY SUFFIX ".wasi.wasm")
6666
if (NOT TARGET wasi-itk-extras AND DEFINED CMAKE_CXX_COMPILE_OBJECT)
67-
add_library(wasi-itk-extras STATIC /ITKWebAssemblyInterface/src/exceptionShim.cxx /ITKWebAssemblyInterface/src/cxaThreadAtExitShim.cxx /ITKWebAssemblyInterface/src/pthreadShim.c /ITKWebAssemblyInterface/src/initialization.cxx)
67+
add_library(wasi-itk-extras STATIC
68+
/ITKWebAssemblyInterface/src/exceptionShim.cxx
69+
/ITKWebAssemblyInterface/src/cxaThreadAtExitShim.cxx
70+
/ITKWebAssemblyInterface/src/pthreadShim.cxx
71+
/ITKWebAssemblyInterface/src/initialization.cxx)
6872
endif()
6973
get_property(_is_imported TARGET ${wasm_target} PROPERTY IMPORTED)
7074
if (NOT ${_is_imported})
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,8 @@
2020

2121
#include <pthread.h>
2222

23+
extern "C" {
24+
2325
int pthread_attr_setscope(pthread_attr_t *attr, int contentionscope)
2426
{}
2527

@@ -30,3 +32,4 @@ int pthread_atfork(
3032
)
3133
{}
3234

35+
} // end extern "C"

0 commit comments

Comments
 (0)