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
2 changes: 2 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,8 @@ else() # PROJECT_IS_TOP_LEVEL
find_package(CUDAToolkit REQUIRED)
endif() # PROJECT_IS_TOP_LEVEL

add_subdirectory(${CMAKE_CURRENT_LIST_DIR}/lib/dynamic_type)

# TODO: fix MSVC
if(NOT MSVC)
find_library(LIBNVTOOLSEXT libnvToolsExt.so PATHS ${CUDA_TOOLKIT_ROOT_DIR}/lib64/)
Expand Down
2 changes: 0 additions & 2 deletions cmake/Dependencies.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,6 @@ set(BUILD_SHARED_LIBS OFF CACHE BOOL "Build shared libs" FORCE)
set(INSTALL_GTEST OFF CACHE BOOL "Install gtest." FORCE)
set(BUILD_GMOCK ON CACHE BOOL "Build gmock." FORCE)

add_subdirectory(${CMAKE_CURRENT_LIST_DIR}/../lib/dynamic_type)

# Add googletest subdirectory but make sure our INCLUDE_DIRECTORIES do not bleed into it.
# This is because libraries installed into the root conda env (e.g. MKL) add a global /opt/conda/include directory,
# and if there is gtest installed in conda, the third_party/googletest/**.cc source files would try to include headers
Expand Down
52 changes: 27 additions & 25 deletions lib/dynamic_type/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,30 +5,32 @@
add_library(dynamic_type INTERFACE)
target_include_directories(dynamic_type INTERFACE src)

function(add_test_for_standard std_version)
set(target test_dynamic_type_${std_version})
add_executable(${target}
test/ForAllTypes.cpp
test/assignment.cpp
test/binary_ops.cpp
test/container.cpp
test/examples.cpp
test/hash.cpp
test/member.cpp
test/move.cpp
test/null.cpp
test/opcheck.cpp
test/print.cpp
test/typing.cpp
test/unary_ops.cpp
)
target_include_directories(${target} PUBLIC src)
target_link_libraries(${target} PRIVATE gtest_main gmock_main)
set_property(TARGET ${target} PROPERTY CXX_STANDARD ${std_version})
endfunction()
if(BUILD_TEST)
function(add_test_for_standard std_version)
set(target test_dynamic_type_${std_version})
add_executable(${target}
test/ForAllTypes.cpp
test/assignment.cpp
test/binary_ops.cpp
test/container.cpp
test/examples.cpp
test/hash.cpp
test/member.cpp
test/move.cpp
test/null.cpp
test/opcheck.cpp
test/print.cpp
test/typing.cpp
test/unary_ops.cpp
)
target_include_directories(${target} PUBLIC src)
target_link_libraries(${target} PRIVATE gtest_main gmock_main)
set_property(TARGET ${target} PROPERTY CXX_STANDARD ${std_version})
endfunction()

add_test_for_standard(17)
add_test_for_standard(17)

# add_test_for_standard(20)
# add_test_for_standard(23)
# add_test_for_standard(26)
# add_test_for_standard(20)
# add_test_for_standard(23)
# add_test_for_standard(26)
endif()