mirror of
https://gitlab.com/libeigen/eigen.git
synced 2025-08-12 11:49:02 +08:00
removed helper cmake macro and don't use deprecated COMPILE_FLAGS anymore.
This commit is contained in:
parent
8a8122874b
commit
495ffff945
@ -440,17 +440,6 @@ foreach(var INCLUDE_INSTALL_DIR CMAKEPACKAGE_INSTALL_DIR PKGCONFIG_INSTALL_DIR)
|
|||||||
endif()
|
endif()
|
||||||
endforeach()
|
endforeach()
|
||||||
|
|
||||||
# similar to set_target_properties but append the property instead of overwriting it
|
|
||||||
macro(ei_add_target_property target prop value)
|
|
||||||
|
|
||||||
get_target_property(previous ${target} ${prop})
|
|
||||||
# if the property wasn't previously set, ${previous} is now "previous-NOTFOUND" which cmake allows catching with plain if()
|
|
||||||
if(NOT previous)
|
|
||||||
set(previous "")
|
|
||||||
endif()
|
|
||||||
set_target_properties(${target} PROPERTIES ${prop} "${previous} ${value}")
|
|
||||||
endmacro()
|
|
||||||
|
|
||||||
install(FILES
|
install(FILES
|
||||||
signature_of_eigen3_matrix_library
|
signature_of_eigen3_matrix_library
|
||||||
DESTINATION ${INCLUDE_INSTALL_DIR} COMPONENT Devel
|
DESTINATION ${INCLUDE_INSTALL_DIR} COMPONENT Devel
|
||||||
|
@ -28,7 +28,9 @@ macro(ei_add_test_internal testname testname_with_suffix)
|
|||||||
set(is_gpu_test ON)
|
set(is_gpu_test ON)
|
||||||
if(EIGEN_TEST_HIP)
|
if(EIGEN_TEST_HIP)
|
||||||
hip_reset_flags()
|
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)
|
elseif(EIGEN_TEST_CUDA_CLANG)
|
||||||
set_source_files_properties(${filename} PROPERTIES LANGUAGE CXX)
|
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")
|
link_directories("${CUDA_TOOLKIT_ROOT_DIR}/lib")
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
if (${ARGC} GREATER 2)
|
add_executable(${targetname} ${filename})
|
||||||
add_executable(${targetname} ${filename})
|
|
||||||
else()
|
|
||||||
add_executable(${targetname} ${filename} OPTIONS ${ARGV2})
|
|
||||||
endif()
|
|
||||||
set(CUDA_CLANG_LINK_LIBRARIES "cudart_static" "cuda" "dl" "pthread")
|
set(CUDA_CLANG_LINK_LIBRARIES "cudart_static" "cuda" "dl" "pthread")
|
||||||
if (CMAKE_SYSTEM_NAME STREQUAL "Linux")
|
if (CMAKE_SYSTEM_NAME STREQUAL "Linux")
|
||||||
set(CUDA_CLANG_LINK_LIBRARIES ${CUDA_CLANG_LINK_LIBRARIES} "rt")
|
set(CUDA_CLANG_LINK_LIBRARIES ${CUDA_CLANG_LINK_LIBRARIES} "rt")
|
||||||
endif()
|
endif()
|
||||||
target_link_libraries(${targetname} ${CUDA_CLANG_LINK_LIBRARIES})
|
target_link_libraries(${targetname} ${CUDA_CLANG_LINK_LIBRARIES})
|
||||||
else()
|
else()
|
||||||
if (${ARGC} GREATER 2)
|
cuda_add_executable(${targetname} ${filename})
|
||||||
cuda_add_executable(${targetname} ${filename} OPTIONS ${ARGV2})
|
|
||||||
else()
|
|
||||||
cuda_add_executable(${targetname} ${filename})
|
|
||||||
endif()
|
|
||||||
endif()
|
endif()
|
||||||
else()
|
else()
|
||||||
add_executable(${targetname} ${filename})
|
add_executable(${targetname} ${filename})
|
||||||
@ -66,26 +60,26 @@ macro(ei_add_test_internal testname testname_with_suffix)
|
|||||||
endif()
|
endif()
|
||||||
|
|
||||||
if(EIGEN_NO_ASSERTION_CHECKING)
|
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()
|
else()
|
||||||
if(EIGEN_DEBUG_ASSERTS)
|
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()
|
||||||
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)
|
if(MSVC)
|
||||||
ei_add_target_property(${targetname} COMPILE_FLAGS "/bigobj")
|
target_compile_options(${targetname} PRIVATE "/bigobj")
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
# let the user pass flags.
|
# let the user pass flags.
|
||||||
if(${ARGC} GREATER 2)
|
if(${ARGC} GREATER 2)
|
||||||
ei_add_target_property(${targetname} COMPILE_FLAGS "${ARGV2}")
|
target_compile_options(${targetname} PRIVATE ${ARGV2})
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
if(EIGEN_TEST_CUSTOM_CXX_FLAGS)
|
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()
|
endif()
|
||||||
|
|
||||||
if(EIGEN_STANDARD_LIBRARIES_TO_LINK_TO)
|
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)
|
if( (EIGEN_SPLIT_LARGE_TESTS AND suffixes) OR explicit_suffixes)
|
||||||
add_custom_target(${testname})
|
add_custom_target(${testname})
|
||||||
foreach(suffix ${suffixes})
|
foreach(suffix ${suffixes})
|
||||||
ei_add_test_internal(${testname} ${testname}_${suffix}
|
ei_add_test_internal(${testname} ${testname}_${suffix} "${ARGV1}" "${ARGV2}")
|
||||||
"${ARGV1} -DEIGEN_TEST_PART_${suffix}=1" "${ARGV2}")
|
|
||||||
add_dependencies(${testname} ${testname}_${suffix})
|
add_dependencies(${testname} ${testname}_${suffix})
|
||||||
|
target_compile_definitions(${testname}_${suffix} PRIVATE -DEIGEN_TEST_PART_${suffix}=1)
|
||||||
endforeach()
|
endforeach()
|
||||||
else()
|
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()
|
endif()
|
||||||
endmacro()
|
endmacro()
|
||||||
|
|
||||||
|
@ -303,7 +303,7 @@ else()
|
|||||||
endif()
|
endif()
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
ei_add_test(fastmath " ${EIGEN_FASTMATH_FLAGS} ")
|
ei_add_test(fastmath "${EIGEN_FASTMATH_FLAGS}")
|
||||||
|
|
||||||
# # ei_add_test(denseLM)
|
# # ei_add_test(denseLM)
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user