mirror of
https://gitlab.com/libeigen/eigen.git
synced 2026-01-18 17:31:19 +01:00
removed helper cmake macro and don't use deprecated COMPILE_FLAGS anymore.
This commit is contained in:
committed by
Rasmus Munk Larsen
parent
8a8122874b
commit
495ffff945
@@ -28,7 +28,9 @@ macro(ei_add_test_internal testname testname_with_suffix)
|
||||
set(is_gpu_test ON)
|
||||
if(EIGEN_TEST_HIP)
|
||||
hip_reset_flags()
|
||||
hip_add_executable(${targetname} ${filename} HIPCC_OPTIONS "-DEIGEN_USE_HIP -std=c++14 ${ARGV2}")
|
||||
hip_add_executable(${targetname} ${filename})
|
||||
target_compile_definitions(${targetname} PRVIATE -DEIGEN_USE_HIP)
|
||||
target_compile_options(${targetname} PRVIATE -std=c++14)
|
||||
elseif(EIGEN_TEST_CUDA_CLANG)
|
||||
set_source_files_properties(${filename} PROPERTIES LANGUAGE CXX)
|
||||
|
||||
@@ -38,22 +40,14 @@ macro(ei_add_test_internal testname testname_with_suffix)
|
||||
link_directories("${CUDA_TOOLKIT_ROOT_DIR}/lib")
|
||||
endif()
|
||||
|
||||
if (${ARGC} GREATER 2)
|
||||
add_executable(${targetname} ${filename})
|
||||
else()
|
||||
add_executable(${targetname} ${filename} OPTIONS ${ARGV2})
|
||||
endif()
|
||||
add_executable(${targetname} ${filename})
|
||||
set(CUDA_CLANG_LINK_LIBRARIES "cudart_static" "cuda" "dl" "pthread")
|
||||
if (CMAKE_SYSTEM_NAME STREQUAL "Linux")
|
||||
set(CUDA_CLANG_LINK_LIBRARIES ${CUDA_CLANG_LINK_LIBRARIES} "rt")
|
||||
endif()
|
||||
target_link_libraries(${targetname} ${CUDA_CLANG_LINK_LIBRARIES})
|
||||
else()
|
||||
if (${ARGC} GREATER 2)
|
||||
cuda_add_executable(${targetname} ${filename} OPTIONS ${ARGV2})
|
||||
else()
|
||||
cuda_add_executable(${targetname} ${filename})
|
||||
endif()
|
||||
cuda_add_executable(${targetname} ${filename})
|
||||
endif()
|
||||
else()
|
||||
add_executable(${targetname} ${filename})
|
||||
@@ -66,26 +60,26 @@ macro(ei_add_test_internal testname testname_with_suffix)
|
||||
endif()
|
||||
|
||||
if(EIGEN_NO_ASSERTION_CHECKING)
|
||||
ei_add_target_property(${targetname} COMPILE_FLAGS "-DEIGEN_NO_ASSERTION_CHECKING=1")
|
||||
target_compile_definitions(${targetname} PRIVATE EIGEN_NO_ASSERTION_CHECKING=1)
|
||||
else()
|
||||
if(EIGEN_DEBUG_ASSERTS)
|
||||
ei_add_target_property(${targetname} COMPILE_FLAGS "-DEIGEN_DEBUG_ASSERTS=1")
|
||||
target_compile_definitions(${targetname} PRIVATE EIGEN_DEBUG_ASSERTS=1)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
ei_add_target_property(${targetname} COMPILE_FLAGS "-DEIGEN_TEST_MAX_SIZE=${EIGEN_TEST_MAX_SIZE}")
|
||||
target_compile_definitions(${targetname} PRIVATE EIGEN_TEST_MAX_SIZE=${EIGEN_TEST_MAX_SIZE})
|
||||
|
||||
if(MSVC)
|
||||
ei_add_target_property(${targetname} COMPILE_FLAGS "/bigobj")
|
||||
target_compile_options(${targetname} PRIVATE "/bigobj")
|
||||
endif()
|
||||
|
||||
# let the user pass flags.
|
||||
if(${ARGC} GREATER 2)
|
||||
ei_add_target_property(${targetname} COMPILE_FLAGS "${ARGV2}")
|
||||
target_compile_options(${targetname} PRIVATE ${ARGV2})
|
||||
endif()
|
||||
|
||||
if(EIGEN_TEST_CUSTOM_CXX_FLAGS)
|
||||
ei_add_target_property(${targetname} COMPILE_FLAGS "${EIGEN_TEST_CUSTOM_CXX_FLAGS}")
|
||||
target_compile_options(${targetname} PRIVATE "${EIGEN_TEST_CUSTOM_CXX_FLAGS}")
|
||||
endif()
|
||||
|
||||
if(EIGEN_STANDARD_LIBRARIES_TO_LINK_TO)
|
||||
@@ -216,12 +210,13 @@ macro(ei_add_test testname)
|
||||
if( (EIGEN_SPLIT_LARGE_TESTS AND suffixes) OR explicit_suffixes)
|
||||
add_custom_target(${testname})
|
||||
foreach(suffix ${suffixes})
|
||||
ei_add_test_internal(${testname} ${testname}_${suffix}
|
||||
"${ARGV1} -DEIGEN_TEST_PART_${suffix}=1" "${ARGV2}")
|
||||
ei_add_test_internal(${testname} ${testname}_${suffix} "${ARGV1}" "${ARGV2}")
|
||||
add_dependencies(${testname} ${testname}_${suffix})
|
||||
target_compile_definitions(${testname}_${suffix} PRIVATE -DEIGEN_TEST_PART_${suffix}=1)
|
||||
endforeach()
|
||||
else()
|
||||
ei_add_test_internal(${testname} ${testname} "${ARGV1} -DEIGEN_TEST_PART_ALL=1" "${ARGV2}")
|
||||
ei_add_test_internal(${testname} ${testname} "${ARGV1}" "${ARGV2}")
|
||||
target_compile_definitions(${testname} PRIVATE -DEIGEN_TEST_PART_ALL=1)
|
||||
endif()
|
||||
endmacro()
|
||||
|
||||
|
||||
Reference in New Issue
Block a user