From 7d333e0e0af1586b91636fe0bd1db5aaf2190f96 Mon Sep 17 00:00:00 2001 From: Artur Wojcik Date: Thu, 31 Aug 2023 22:48:07 +0200 Subject: [PATCH] cmake: cleanup outdated code --- CMakeLists.txt | 3 +-- speedtests/CMakeLists.txt | 2 +- src/CMakeLists.txt | 22 +++---------------- .../host/host_tensor/CMakeLists.txt | 1 - test/CMakeLists.txt | 2 +- 5 files changed, 6 insertions(+), 24 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 2d95378708..0c882e69d1 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -689,7 +689,6 @@ enable_clang_tidy( "\.hpp$" EXTRA_ARGS -DMIOPEN_USE_CLANG_TIDY - ) include(CppCheck) enable_cppcheck( @@ -788,5 +787,5 @@ add_subdirectory(test) add_subdirectory(speedtests) add_subdirectory(utils) if(MIOPEN_ENABLE_FIN) -add_subdirectory(fin) + add_subdirectory(fin) endif() diff --git a/speedtests/CMakeLists.txt b/speedtests/CMakeLists.txt index 5832f43751..bfdfff872e 100644 --- a/speedtests/CMakeLists.txt +++ b/speedtests/CMakeLists.txt @@ -17,7 +17,7 @@ function(add_speedtest_executable TEST_NAME) separate_arguments(MIOPEN_TEST_FLAGS_ARGS UNIX_COMMAND ${MIOPEN_TEST_FLAGS}) target_link_libraries(${TEST_NAME} MIOpen) target_include_directories(${TEST_NAME} PRIVATE ../test) -endfunction(add_speedtest_executable) +endfunction() foreach(TEST ${TESTS}) get_filename_component(BASE_NAME ${TEST} NAME_WE) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index c0bc457b93..3ad28c62d8 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -48,7 +48,6 @@ configure_file("${PROJECT_SOURCE_DIR}/include/miopen/config.h.in" "${PROJECT_BIN # configure a header file to pass the CMake version settings to the source, and package the header files in the output archive configure_file( "${PROJECT_SOURCE_DIR}/include/miopen/version.h.in" "${PROJECT_BINARY_DIR}/include/miopen/version.h" ) - if(BUILD_FILE_REORG_BACKWARD_COMPATIBILITY) #Copy header to Build Dir for generating backward compatibility configure_file( "${PROJECT_SOURCE_DIR}/include/miopen/miopen.h" "${PROJECT_BINARY_DIR}/include/miopen/miopen.h" ) @@ -60,16 +59,11 @@ message( STATUS "CMAKE_BUILD_TYPE= ${CMAKE_BUILD_TYPE}" ) # This is incremented when the ABI to the library changes set( MIOpen_SOVERSION 1.0 ) - function(add_kernels FILE_NAME VAR_PREFIX VAR_SUFFIX KERNEL_FILES) set(INIT_KERNELS_LIST) set(KERNELS_DECLS) foreach(KERNEL_FILE ${KERNEL_FILES}) - if("${CMAKE_VERSION}" VERSION_LESS 3.0) - configure_file(${KERNEL_FILE} ${KERNEL_FILE}.delete) - else() - set_property(DIRECTORY APPEND PROPERTY CMAKE_CONFIGURE_DEPENDS ${KERNEL_FILE}) - endif() + set_property(DIRECTORY APPEND PROPERTY CMAKE_CONFIGURE_DEPENDS ${KERNEL_FILE}) get_filename_component(KERNEL_FILENAME ${KERNEL_FILE} NAME) get_filename_component(BASE_NAME ${KERNEL_FILE} NAME_WE) string(TOUPPER "${BASE_NAME}" KEY_NAME) @@ -667,23 +661,13 @@ clang_tidy_check(MIOpen) function(target_internal_library TARGET) target_link_libraries(${TARGET} PRIVATE ${ARGN}) - set(PASS_ARGS debug optimized) - set(DEPS) - foreach(DEP ${ARGN}) - if(DEP IN_LIST PASS_ARGS) - list(APPEND DEPS ${DEP}) - else() - list(APPEND DEPS $) - endif() - endforeach() - target_link_libraries(${TARGET} INTERFACE ${DEPS}) + target_link_libraries(${TARGET} INTERFACE $) endfunction() target_include_directories(MIOpen PUBLIC $ ) -set(MIOPEN_CK_LINK_FLAGS) if(MIOPEN_USE_COMPOSABLEKERNEL) set(MIOPEN_CK_LINK_FLAGS composable_kernel::device_operations hip::host) endif() @@ -824,7 +808,7 @@ endif() if(NOT WIN32 AND NOT APPLE) find_library(LIBRT rt) if(LIBRT) - MESSAGE(STATUS "Librt: " ${LIBRT}) + message(STATUS "Librt: " ${LIBRT}) target_internal_library(MIOpen ${LIBRT}) endif() endif() diff --git a/src/composable_kernel/host/host_tensor/CMakeLists.txt b/src/composable_kernel/host/host_tensor/CMakeLists.txt index 3dcecf64e1..f49f90d6e9 100644 --- a/src/composable_kernel/host/host_tensor/CMakeLists.txt +++ b/src/composable_kernel/host/host_tensor/CMakeLists.txt @@ -15,7 +15,6 @@ target_include_directories(host_tensor SYSTEM PUBLIC $