From 47a86994bb8d5e3e386424690d5d1a39dd7da51d Mon Sep 17 00:00:00 2001 From: "Markus Kitsinger (SwooshyCueb)" Date: Tue, 5 Mar 2024 13:04:56 -0500 Subject: [PATCH] [#7545,#7546] Ensure clang[-runtime] package added to dependencies --- CMakeLists.txt | 8 -------- cmake/Modules/IrodsCXXCompiler.cmake | 2 +- cmake/Modules/IrodsExternals.cmake | 14 +++++++++++++- cmake/Modules/UseLibCXX.cmake | 2 +- cmake/packaging.cmake | 4 ++++ 5 files changed, 19 insertions(+), 11 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 0829b86842..d7c6f44792 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -16,11 +16,6 @@ endif() include(IrodsExternals) include(IrodsCXXCompiler) -macro(IRODS_MACRO_CHECK_DEPENDENCY_SET_FULLPATH_ADD_TO_IRODS_DEVELOP_DEPENDENCIES_LIST DEPENDENCY_NAME DEPENDENCY_SUBDIRECTORY) - IRODS_MACRO_CHECK_DEPENDENCY_SET_FULLPATH(${DEPENDENCY_NAME} ${DEPENDENCY_SUBDIRECTORY}) - list(APPEND IRODS_DEVELOP_DEPENDENCIES_LIST irods-externals-${DEPENDENCY_SUBDIRECTORY}) -endmacro() - IRODS_MACRO_CHECK_DEPENDENCY_SET_FULLPATH_ADD_TO_IRODS_PACKAGE_DEPENDENCIES_LIST(ARCHIVE libarchive3.5.2-0) IRODS_MACRO_CHECK_DEPENDENCY_SET_FULLPATH_ADD_TO_IRODS_PACKAGE_DEPENDENCIES_LIST(AVRO avro1.11.0-2) IRODS_MACRO_CHECK_DEPENDENCY_SET_FULLPATH_ADD_TO_IRODS_PACKAGE_DEPENDENCIES_LIST(BOOST boost1.81.0-0) @@ -33,9 +28,6 @@ IRODS_MACRO_CHECK_DEPENDENCY_SET_FULLPATH_ADD_TO_IRODS_DEVELOP_DEPENDENCIES_LIST IRODS_MACRO_CHECK_DEPENDENCY_SET_FULLPATH_ADD_TO_IRODS_DEVELOP_DEPENDENCIES_LIST(JSON json3.10.4-0) IRODS_MACRO_CHECK_DEPENDENCY_SET_FULLPATH_ADD_TO_IRODS_DEVELOP_DEPENDENCIES_LIST(SPDLOG spdlog1.9.2-1) -string(REPLACE ";" ", " IRODS_PACKAGE_DEPENDENCIES_STRING "${IRODS_PACKAGE_DEPENDENCIES_LIST}") -string(REPLACE ";" ", " IRODS_DEVELOP_DEPENDENCIES_STRING "${IRODS_DEVELOP_DEPENDENCIES_LIST}") - set(CMAKE_CXX_STANDARD 20) set(CMAKE_CXX_EXTENSIONS OFF) set(IRODS_CXX_STANDARD "${CMAKE_CXX_STANDARD}") diff --git a/cmake/Modules/IrodsCXXCompiler.cmake b/cmake/Modules/IrodsCXXCompiler.cmake index 4f21648294..7c771d3e80 100644 --- a/cmake/Modules/IrodsCXXCompiler.cmake +++ b/cmake/Modules/IrodsCXXCompiler.cmake @@ -16,7 +16,7 @@ set(IRODS_BUILD_WITH_CLANG ON CACHE BOOL "Try to build with clang instead of gcc set(CLANG_STATIC_ANALYZER OFF CACHE BOOL "Choose whether to run Clang Static Analyzer.") if (IRODS_BUILD_WITH_CLANG) - IRODS_MACRO_CHECK_DEPENDENCY_SET_FULLPATH(CLANG clang13.0.1-0) + IRODS_MACRO_CHECK_DEPENDENCY_SET_FULLPATH_ADD_TO_IRODS_DEVELOP_DEPENDENCIES_LIST(CLANG clang13.0.1-0) else() set(CLANG_STATIC_ANALYZER OFF CACHE BOOL "Choose whether to run Clang Static Analyzer." FORCE) message(STATUS "Setting CLANG_STATIC_ANALYZER to 'OFF'.") diff --git a/cmake/Modules/IrodsExternals.cmake b/cmake/Modules/IrodsExternals.cmake index a8322b0bb5..6fecd7362b 100644 --- a/cmake/Modules/IrodsExternals.cmake +++ b/cmake/Modules/IrodsExternals.cmake @@ -25,6 +25,18 @@ endmacro() macro(IRODS_MACRO_CHECK_DEPENDENCY_SET_FULLPATH_ADD_TO_IRODS_PACKAGE_DEPENDENCIES_LIST VAR DEPENDENCY_SUBDIRECTORY) IRODS_MACRO_CHECK_DEPENDENCY_SET_FULLPATH(${VAR} ${DEPENDENCY_SUBDIRECTORY}) - list(APPEND IRODS_PACKAGE_DEPENDENCIES_LIST irods-externals-${DEPENDENCY_SUBDIRECTORY}) + set(__externals_package_name "irods-externals-${DEPENDENCY_SUBDIRECTORY}") + if (NOT __externals_package_name IN_LIST IRODS_PACKAGE_DEPENDENCIES_LIST) + list(APPEND IRODS_PACKAGE_DEPENDENCIES_LIST "${__externals_package_name}") + endif() + unset(__externals_package_name) endmacro() +macro(IRODS_MACRO_CHECK_DEPENDENCY_SET_FULLPATH_ADD_TO_IRODS_DEVELOP_DEPENDENCIES_LIST DEPENDENCY_NAME DEPENDENCY_SUBDIRECTORY) + IRODS_MACRO_CHECK_DEPENDENCY_SET_FULLPATH(${DEPENDENCY_NAME} ${DEPENDENCY_SUBDIRECTORY}) + set(__externals_package_name "irods-externals-${DEPENDENCY_SUBDIRECTORY}") + if (NOT __externals_package_name IN_LIST IRODS_DEVELOP_DEPENDENCIES_LIST) + list(APPEND IRODS_DEVELOP_DEPENDENCIES_LIST irods-externals-${DEPENDENCY_SUBDIRECTORY}) + endif() + unset(__externals_package_name) +endmacro() diff --git a/cmake/Modules/UseLibCXX.cmake b/cmake/Modules/UseLibCXX.cmake index bbc0f1dd46..75e755c83b 100644 --- a/cmake/Modules/UseLibCXX.cmake +++ b/cmake/Modules/UseLibCXX.cmake @@ -24,7 +24,7 @@ set(IRODS_BUILD_AGAINST_LIBCXX ${IRODS_BUILD_AGAINST_LIBCXX_DEFAULT} CACHE BOOL if (IRODS_BUILD_AGAINST_LIBCXX) include(IrodsExternals) - IRODS_MACRO_CHECK_DEPENDENCY_SET_FULLPATH(CLANG clang13.0.1-0) + IRODS_MACRO_CHECK_DEPENDENCY_SET_FULLPATH_ADD_TO_IRODS_DEVELOP_DEPENDENCIES_LIST(CLANG clang13.0.1-0) IRODS_MACRO_CHECK_DEPENDENCY_SET_FULLPATH_ADD_TO_IRODS_PACKAGE_DEPENDENCIES_LIST(CLANG_RUNTIME clang-runtime13.0.1-0) unset(IRODS_PACKAGE_DEPENDENCIES_STRING) string(REPLACE ";" ", " IRODS_PACKAGE_DEPENDENCIES_STRING "${IRODS_PACKAGE_DEPENDENCIES_LIST}") diff --git a/cmake/packaging.cmake b/cmake/packaging.cmake index 7b1c37c969..6a8fe88ec2 100644 --- a/cmake/packaging.cmake +++ b/cmake/packaging.cmake @@ -1,6 +1,10 @@ # We need to define everything for CPack at the top level of the project. # Variables defined in CMake files included via add_subdirectory don't make it back to the calling CMake file. +# Dependency declarations for externals packages +string(REPLACE ";" ", " IRODS_PACKAGE_DEPENDENCIES_STRING "${IRODS_PACKAGE_DEPENDENCIES_LIST}") +string(REPLACE ";" ", " IRODS_DEVELOP_DEPENDENCIES_STRING "${IRODS_DEVELOP_DEPENDENCIES_LIST}") + # We build multiple packages, so this doesn't really matter. # We define it anyway to avoid potential issues. set(CPACK_PACKAGE_FILE_NAME "irods")