File tree Expand file tree Collapse file tree 5 files changed +24
-5
lines changed
Expand file tree Collapse file tree 5 files changed +24
-5
lines changed Original file line number Diff line number Diff line change @@ -132,6 +132,9 @@ if(EMSCRIPTEN)
132132 SUFFIX ".wasm"
133133 )
134134
135+ add_custom_command (TARGET clangCppInterOp POST_BUILD
136+ COMMAND ${CMAKE_COMMAND} -E copy $<TARGET_FILE:clangCppInterOp> ${CMAKE_BINARY_DIR} /unittests/CppInterOp/
137+ )
135138endif ()
136139
137140string (REPLACE ";" "\; " _VER CPPINTEROP_VERSION)
Original file line number Diff line number Diff line change 99
1010if (EMSCRIPTEN)
1111 # By removing gtest_main and gmock_main you avoid duplicate symbol error (probably not the best solution)
12- set (gtest_libs gtest_main gtest gmock)
12+ set (gtest_libs gtest gmock)
1313else ()
1414 set (gtest_libs gtest gtest_main)
1515 # Clang prior than clang13 (I think) merges both gmock into gtest.
Original file line number Diff line number Diff line change @@ -2,8 +2,16 @@ set(LLVM_LINK_COMPONENTS
22 Support
33)
44
5+ if (EMSCRIPTEN)
6+ set (INCLUDE_CUDA_TEST "" )
7+ set (INCLUDE_MAIN_CCP "main.cpp" )
8+ else ()
9+ set (INCLUDE_CUDA_TEST "CUDATest.cpp" )
10+ set (INCLUDE_MAIN_CPP "" )
11+ endif ()
12+
513add_cppinterop_unittest(CppInterOpTests
6- CUDATest.cpp
14+ ${INCLUDE_CUDA_TEST}
715 EnumReflectionTest.cpp
816 FunctionReflectionTest.cpp
917 InterpreterTest.cpp
@@ -12,11 +20,12 @@ add_cppinterop_unittest(CppInterOpTests
1220 TypeReflectionTest.cpp
1321 Utils.cpp
1422 VariableReflectionTest.cpp
23+ ${INCLUDE_MAIN_CPP}
1524)
1625
1726if (EMSCRIPTEN)
1827 set_target_properties (CppInterOpTests PROPERTIES
19- LINK_FLAGS "-s MAIN_MODULE=1"
28+ LINK_FLAGS "-s MAIN_MODULE=1 -s WASM_BIGINT "
2029 )
2130endif ()
2231 target_link_libraries (CppInterOpTests
@@ -49,15 +58,15 @@ export_executable_symbols(CppInterOpTests)
4958
5059unset (LLVM_LINK_COMPONENTS)
5160
52- add_cppinterop_unittest(DynamicLibraryManagerTests DynamicLibraryManagerTest.cpp)
61+ add_cppinterop_unittest(DynamicLibraryManagerTests DynamicLibraryManagerTest.cpp ${INCLUDE_MAIN_CPP} )
5362target_link_libraries (DynamicLibraryManagerTests
5463 PRIVATE
5564 clangCppInterOp
5665)
5766
5867if (EMSCRIPTEN)
5968 target_link_options (DynamicLibraryManagerTests PRIVATE
60- "SHELL: -s MAIN_MODULE=1"
69+ "SHELL: -s MAIN_MODULE=1 -s WASM_BIGINT "
6170 )
6271endif ()
6372
Original file line number Diff line number Diff line change @@ -17,6 +17,7 @@ set_output_directory(TestSharedLib
1717
1818
1919if (EMSCRIPTEN)
20+ # FIXME: Remove export-all and replace with exporting individual undefined symbols
2021 set_target_properties (TestSharedLib PROPERTIES
2122 NO_SONAME 1
2223 COMPILE_FLAGS "-s SIDE_MODULE=1"
Original file line number Diff line number Diff line change 1+ #include < gtest/gtest.h>
2+
3+ int main (int argc, char **argv) {
4+ ::testing::InitGoogleTest (&argc, argv);
5+ return RUN_ALL_TESTS ();
6+ }
You can’t perform that action at this time.
0 commit comments