Skip to content

Commit 8294b51

Browse files
authored
Update CMakeLists.txt
1 parent 7cf2c7a commit 8294b51

File tree

1 file changed

+11
-16
lines changed

1 file changed

+11
-16
lines changed

unittests/CppInterOp/CMakeLists.txt

Lines changed: 11 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -2,18 +2,6 @@ set(LLVM_LINK_COMPONENTS
22
Support
33
)
44

5-
if(EMSCRIPTEN)
6-
7-
set(interpreter_lib
8-
clangCppInterOp
9-
)
10-
11-
foreach(l ${interpreter_lib})
12-
find_library(${l} NAMES ${l} HINTS ${CMAKE_BINARY_DIR}/lib/ )
13-
mark_as_advanced(${l})
14-
endforeach(l)
15-
endif()
16-
175
add_cppinterop_unittest(CppInterOpTests
186
CUDATest.cpp
197
EnumReflectionTest.cpp
@@ -26,10 +14,17 @@ add_cppinterop_unittest(CppInterOpTests
2614
VariableReflectionTest.cpp
2715
)
2816

29-
target_link_libraries(CppInterOpTests
30-
PRIVATE
31-
${interpreter_lib} ${interpreter_lib}
32-
)
17+
if(EMSCRIPTEN)
18+
set_target_properties(CppInterOpTests PROPERTIES
19+
LINK_FLAGS "-L ${CMAKE_BINARY_DIR}/lib/libclangCppInterOp.so"
20+
)
21+
else()
22+
target_link_libraries(CppInterOpTests
23+
PRIVATE
24+
clangCppInterOp
25+
)
26+
endif()
27+
3328
set_output_directory(CppInterOpTests
3429
BINARY_DIR ${CMAKE_CURRENT_BINARY_DIR}/CppInterOpTests/unittests/bin/$<CONFIG>/
3530
LIBRARY_DIR ${CMAKE_CURRENT_BINARY_DIR}/CppInterOpTests/unittests/bin/$<CONFIG>/

0 commit comments

Comments
 (0)