Skip to content
Open
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
34 changes: 17 additions & 17 deletions unittests/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -34,24 +34,24 @@ function(add_cppinterop_unittest name)
add_dependencies(CppInterOpUnitTests ${name})
target_include_directories(${name} PUBLIC ${CMAKE_CURRENT_BINARY_DIR} ${GTEST_INCLUDE_DIR})
set_property(TARGET ${name} PROPERTY RUNTIME_OUTPUT_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR})
if(WIN32)
target_link_libraries(${name} PUBLIC ${ARG_LIBRARIES} ${gtest_libs})
set_property(TARGET ${name} APPEND_STRING PROPERTY LINK_FLAGS "${MSVC_EXPORTS}")
else()
target_link_libraries(${name} PRIVATE ${ARG_LIBRARIES} ${gtest_libs} ${link_pthreads_lib})
endif()
if(EMSCRIPTEN)
# Without this cmake will try and get node to run the html file.
# This guarantees that it runs the js file, and uses emsdks node.
add_test(NAME cppinterop-${name} COMMAND $ENV{EMSDK_NODE} ${name}.js)
else()
add_test(NAME cppinterop-${name} COMMAND ${name})
endif()
if(WIN32)
target_link_libraries(${name} PUBLIC ${ARG_LIBRARIES} ${gtest_libs})
set_property(TARGET ${name} APPEND_STRING PROPERTY LINK_FLAGS "${MSVC_EXPORTS}")
else()
target_link_libraries(${name} PRIVATE ${ARG_LIBRARIES} ${gtest_libs} ${link_pthreads_lib})
endif()
if(EMSCRIPTEN)
# Without this cmake will try and get node to run the html file.
# This guarantees that it runs the js file, and uses emsdks node.
add_test(NAME cppinterop-${name} COMMAND $ENV{EMSDK_NODE} ${name}.js)
else()
add_test(NAME cppinterop-${name} COMMAND ${name})
endif()
set_tests_properties(cppinterop-${name} PROPERTIES
TIMEOUT "${TIMEOUT_VALUE}"
ENVIRONMENT "CPLUS_INCLUDE_PATH=${CMAKE_BINARY_DIR}/etc"
LABELS
DEPENDS)
TIMEOUT "${TIMEOUT_VALUE}"
ENVIRONMENT "CPLUS_INCLUDE_PATH=${CMAKE_BINARY_DIR}/etc"
LABELS
DEPENDS)
# FIXME: Just call gtest_add_tests this function is available.
#gtest_add_tests(${name} "${Arguments}" AUTO)
endfunction()
Expand Down
Loading