Skip to content

Commit

Permalink
[irods#6256,irods#7220] Do not explicitly build against libc++
Browse files Browse the repository at this point in the history
  • Loading branch information
SwooshyCueb authored and alanking committed Mar 6, 2024
1 parent 47a8699 commit 8e7d2bc
Show file tree
Hide file tree
Showing 12 changed files with 97 additions and 70 deletions.
13 changes: 6 additions & 7 deletions .github/workflows/build-irods-centos.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,19 +22,18 @@ jobs:
wget -qO - https://unstable.irods.org/renci-irods-unstable.yum.repo | tee /etc/yum.repos.d/renci-irods-unstable.yum.repo
yum -y update
yum -y install \
irods-externals-avro1.11.0-2 \
irods-externals-boost1.81.0-0 \
irods-externals-avro1.11.0-3 \
irods-externals-boost1.81.0-1 \
irods-externals-catch22.13.8-0 \
irods-externals-clang-runtime13.0.1-0 \
irods-externals-clang13.0.1-0 \
irods-externals-cmake3.21.4-0 \
irods-externals-cppzmq4.8.1-1 \
irods-externals-fmt8.1.1-0 \
irods-externals-fmt8.1.1-1 \
irods-externals-json3.10.4-0 \
irods-externals-libarchive3.5.2-0 \
irods-externals-nanodbc2.13.0-1 \
irods-externals-spdlog1.9.2-1 \
irods-externals-zeromq4-14.1.8-0
irods-externals-nanodbc2.13.0-2 \
irods-externals-spdlog1.9.2-2 \
irods-externals-zeromq4-14.1.8-1
- name: Configure CMake
run: |
export PATH=/opt/irods-externals/cmake3.21.4-0/bin:$PATH
Expand Down
13 changes: 6 additions & 7 deletions .github/workflows/build-irods-debian.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,19 +21,18 @@ jobs:
echo "deb [arch=amd64] https://unstable.irods.org/apt/ $(lsb_release -sc) main" | tee /etc/apt/sources.list.d/renci-irods-unstable.list
apt-get update -qq
apt-get install -qq \
irods-externals-avro1.11.0-2 \
irods-externals-boost1.81.0-0 \
irods-externals-avro1.11.0-3 \
irods-externals-boost1.81.0-1 \
irods-externals-catch22.13.8-0 \
irods-externals-clang-runtime13.0.1-0 \
irods-externals-clang13.0.1-0 \
irods-externals-cmake3.21.4-0 \
irods-externals-cppzmq4.8.1-1 \
irods-externals-fmt8.1.1-0 \
irods-externals-fmt8.1.1-1 \
irods-externals-json3.10.4-0 \
irods-externals-libarchive3.5.2-0 \
irods-externals-nanodbc2.13.0-1 \
irods-externals-spdlog1.9.2-1 \
irods-externals-zeromq4-14.1.8-0
irods-externals-nanodbc2.13.0-2 \
irods-externals-spdlog1.9.2-2 \
irods-externals-zeromq4-14.1.8-1
- name: Configure CMake
run: |
export PATH=/opt/irods-externals/cmake3.21.4-0/bin:$PATH
Expand Down
13 changes: 6 additions & 7 deletions .github/workflows/build-irods-enterprise-linux-8.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,19 +25,18 @@ jobs:
sed -i 's/centos/el/' /etc/yum.repos.d/renci-irods-unstable.yum.repo
dnf -y update
dnf -y install \
irods-externals-avro1.11.0-2 \
irods-externals-boost1.81.0-0 \
irods-externals-avro1.11.0-3 \
irods-externals-boost1.81.0-1 \
irods-externals-catch22.13.8-0 \
irods-externals-clang-runtime13.0.1-0 \
irods-externals-clang13.0.1-0 \
irods-externals-cmake3.21.4-0 \
irods-externals-cppzmq4.8.1-1 \
irods-externals-fmt8.1.1-0 \
irods-externals-fmt8.1.1-1 \
irods-externals-json3.10.4-0 \
irods-externals-libarchive3.5.2-0 \
irods-externals-nanodbc2.13.0-1 \
irods-externals-spdlog1.9.2-1 \
irods-externals-zeromq4-14.1.8-0
irods-externals-nanodbc2.13.0-2 \
irods-externals-spdlog1.9.2-2 \
irods-externals-zeromq4-14.1.8-1
- name: Configure CMake
run: |
export PATH=/opt/irods-externals/cmake3.21.4-0/bin:$PATH
Expand Down
13 changes: 6 additions & 7 deletions .github/workflows/build-irods-enterprise-linux-9.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,19 +26,18 @@ jobs:
dnf config-manager -y --set-enabled renci-irods-unstable
dnf -y update
dnf -y install \
irods-externals-avro1.11.0-2 \
irods-externals-boost1.81.0-0 \
irods-externals-avro1.11.0-3 \
irods-externals-boost1.81.0-1 \
irods-externals-catch22.13.8-0 \
irods-externals-clang-runtime13.0.1-0 \
irods-externals-clang13.0.1-0 \
irods-externals-cmake3.21.4-0 \
irods-externals-cppzmq4.8.1-1 \
irods-externals-fmt8.1.1-0 \
irods-externals-fmt8.1.1-1 \
irods-externals-json3.10.4-0 \
irods-externals-libarchive3.5.2-0 \
irods-externals-nanodbc2.13.0-1 \
irods-externals-spdlog1.9.2-1 \
irods-externals-zeromq4-14.1.8-0
irods-externals-nanodbc2.13.0-2 \
irods-externals-spdlog1.9.2-2 \
irods-externals-zeromq4-14.1.8-1
- name: Configure CMake
run: |
export PATH=/opt/irods-externals/cmake3.21.4-0/bin:$PATH
Expand Down
13 changes: 6 additions & 7 deletions .github/workflows/build-irods-ubuntu.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,19 +28,18 @@ jobs:
echo "deb [arch=amd64] https://unstable.irods.org/apt/ $(lsb_release -sc) main" | tee /etc/apt/sources.list.d/renci-irods-unstable.list
apt-get update -qq
apt-get install -qq \
irods-externals-avro1.11.0-2 \
irods-externals-boost1.81.0-0 \
irods-externals-avro1.11.0-3 \
irods-externals-boost1.81.0-1 \
irods-externals-catch22.13.8-0 \
irods-externals-clang-runtime13.0.1-0 \
irods-externals-clang13.0.1-0 \
irods-externals-cmake3.21.4-0 \
irods-externals-cppzmq4.8.1-1 \
irods-externals-fmt8.1.1-0 \
irods-externals-fmt8.1.1-1 \
irods-externals-json3.10.4-0 \
irods-externals-libarchive3.5.2-0 \
irods-externals-nanodbc2.13.0-1 \
irods-externals-spdlog1.9.2-1 \
irods-externals-zeromq4-14.1.8-0
irods-externals-nanodbc2.13.0-2 \
irods-externals-spdlog1.9.2-2 \
irods-externals-zeromq4-14.1.8-1
- name: Configure CMake
run: |
export PATH=/opt/irods-externals/cmake3.21.4-0/bin:$PATH
Expand Down
13 changes: 6 additions & 7 deletions .github/workflows/linter-irods-clang-tidy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -48,19 +48,18 @@ jobs:
echo "deb [arch=amd64] https://unstable.irods.org/apt/ $(lsb_release -sc) main" | sudo tee /etc/apt/sources.list.d/renci-irods-unstable.list
sudo apt-get update -qq
sudo apt-get install -qq \
irods-externals-avro1.11.0-2 \
irods-externals-boost1.81.0-0 \
irods-externals-avro1.11.0-3 \
irods-externals-boost1.81.0-1 \
irods-externals-catch22.13.8-0 \
irods-externals-clang-runtime13.0.1-0 \
irods-externals-clang13.0.1-0 \
irods-externals-cmake3.21.4-0 \
irods-externals-cppzmq4.8.1-1 \
irods-externals-fmt8.1.1-0 \
irods-externals-fmt8.1.1-1 \
irods-externals-json3.10.4-0 \
irods-externals-libarchive3.5.2-0 \
irods-externals-nanodbc2.13.0-1 \
irods-externals-spdlog1.9.2-1 \
irods-externals-zeromq4-14.1.8-0
irods-externals-nanodbc2.13.0-2 \
irods-externals-spdlog1.9.2-2 \
irods-externals-zeromq4-14.1.8-1
- name: Configure CMake
run: |
export PATH=/opt/irods-externals/cmake3.21.4-0/bin:$PATH
Expand Down
30 changes: 24 additions & 6 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -16,17 +16,34 @@ endif()
include(IrodsExternals)
include(IrodsCXXCompiler)

# This is duplicated from UseLibCXX.cmake, since we need it before UseLibCXX can be included.
# Remove this when UseLibCXX.cmake is removed (#7547).
set(IRODS_BUILD_AGAINST_LIBCXX OFF CACHE BOOL "[DEPRECATED] Try to build against libc++ instead of libstdc++.")

# At present, our split externals packages have parity. Eventually, this will change, likely due to needs of
# the iRODS project, or due to the retirement of the -libcxx packages. When this happens, or when
# UseLibCXX.camke is removed (#7547) (whichever happens first), support for automatically switching externals
# packages based on IRODS_BUILD_AGAINST_LIBCXX should be removed.
if (IRODS_BUILD_AGAINST_LIBCXX)
IRODS_MACRO_CHECK_DEPENDENCY_SET_FULLPATH_ADD_TO_IRODS_PACKAGE_DEPENDENCIES_LIST(AVRO avro-libcxx1.11.0-3)
IRODS_MACRO_CHECK_DEPENDENCY_SET_FULLPATH_ADD_TO_IRODS_PACKAGE_DEPENDENCIES_LIST(BOOST boost-libcxx1.81.0-1)
IRODS_MACRO_CHECK_DEPENDENCY_SET_FULLPATH_ADD_TO_IRODS_PACKAGE_DEPENDENCIES_LIST(FMT fmt-libcxx8.1.1-1)
IRODS_MACRO_CHECK_DEPENDENCY_SET_FULLPATH_ADD_TO_IRODS_PACKAGE_DEPENDENCIES_LIST(NANODBC nanodbc-libcxx2.13.0-2)
IRODS_MACRO_CHECK_DEPENDENCY_SET_FULLPATH_ADD_TO_IRODS_PACKAGE_DEPENDENCIES_LIST(ZMQ zeromq4-1-libcxx4.1.8-1)
IRODS_MACRO_CHECK_DEPENDENCY_SET_FULLPATH_ADD_TO_IRODS_PACKAGE_DEPENDENCIES_LIST(SPDLOG spdlog-libcxx1.9.2-2)
else()
IRODS_MACRO_CHECK_DEPENDENCY_SET_FULLPATH_ADD_TO_IRODS_PACKAGE_DEPENDENCIES_LIST(AVRO avro1.11.0-3)
IRODS_MACRO_CHECK_DEPENDENCY_SET_FULLPATH_ADD_TO_IRODS_PACKAGE_DEPENDENCIES_LIST(BOOST boost1.81.0-1)
IRODS_MACRO_CHECK_DEPENDENCY_SET_FULLPATH_ADD_TO_IRODS_PACKAGE_DEPENDENCIES_LIST(FMT fmt8.1.1-1)
IRODS_MACRO_CHECK_DEPENDENCY_SET_FULLPATH_ADD_TO_IRODS_PACKAGE_DEPENDENCIES_LIST(NANODBC nanodbc2.13.0-2)
IRODS_MACRO_CHECK_DEPENDENCY_SET_FULLPATH_ADD_TO_IRODS_PACKAGE_DEPENDENCIES_LIST(ZMQ zeromq4-14.1.8-1)
IRODS_MACRO_CHECK_DEPENDENCY_SET_FULLPATH_ADD_TO_IRODS_PACKAGE_DEPENDENCIES_LIST(SPDLOG spdlog1.9.2-2)
endif()
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)
IRODS_MACRO_CHECK_DEPENDENCY_SET_FULLPATH_ADD_TO_IRODS_PACKAGE_DEPENDENCIES_LIST(FMT fmt8.1.1-0)
IRODS_MACRO_CHECK_DEPENDENCY_SET_FULLPATH_ADD_TO_IRODS_PACKAGE_DEPENDENCIES_LIST(NANODBC nanodbc2.13.0-1)
IRODS_MACRO_CHECK_DEPENDENCY_SET_FULLPATH_ADD_TO_IRODS_PACKAGE_DEPENDENCIES_LIST(ZMQ zeromq4-14.1.8-0)

IRODS_MACRO_CHECK_DEPENDENCY_SET_FULLPATH_ADD_TO_IRODS_DEVELOP_DEPENDENCIES_LIST(CATCH2 catch22.13.8-0)
IRODS_MACRO_CHECK_DEPENDENCY_SET_FULLPATH_ADD_TO_IRODS_DEVELOP_DEPENDENCIES_LIST(CPPZMQ cppzmq4.8.1-1)
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)

set(CMAKE_CXX_STANDARD 20)
set(CMAKE_CXX_EXTENSIONS OFF)
Expand Down Expand Up @@ -100,6 +117,7 @@ if (IRODS_BUILD_WITH_WERROR)
add_compile_options(-Werror)
endif()

# Remove when UseLibCXX.cmake is removed (#7547).
include(UseLibCXX)

set(CMAKE_EXPORT_COMPILE_COMMANDS TRUE)
Expand Down
6 changes: 6 additions & 0 deletions cmake/IRODSConfig.cmake.not_yet_installed.in
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ set_and_check(IRODS_TARGETS_PATH_UNWRAPPED "${CMAKE_CURRENT_LIST_DIR}/IRODSTarge
if(NOT DEFINED IRODS_BUILD_WITH_CLANG)
set(IRODS_BUILD_WITH_CLANG "@IRODS_BUILD_WITH_CLANG@")
endif()

# Remove when UseLibCXX.cmake is removed (#7547).
if(NOT DEFINED IRODS_BUILD_AGAINST_LIBCXX)
set(IRODS_BUILD_AGAINST_LIBCXX "@IRODS_BUILD_AGAINST_LIBCXX@")
endif()
Expand All @@ -31,9 +33,13 @@ endif()
if(NOT DEFINED IRODS_EXTERNALS_FULLPATH_BOOST)
set(IRODS_EXTERNALS_FULLPATH_BOOST "@IRODS_EXTERNALS_FULLPATH_BOOST@")
endif()

# Remove when UseLibCXX.cmake is removed (#7547).
if(NOT "@IRODS_EXTERNALS_FULLPATH_CLANG_RUNTIME@" STREQUAL "" AND NOT DEFINED IRODS_EXTERNALS_FULLPATH_CLANG_RUNTIME)
set(IRODS_EXTERNALS_FULLPATH_CLANG_RUNTIME "@IRODS_EXTERNALS_FULLPATH_CLANG_RUNTIME@")
endif()


if(NOT DEFINED IRODS_EXTERNALS_FULLPATH_ZMQ)
set(IRODS_EXTERNALS_FULLPATH_ZMQ "@IRODS_EXTERNALS_FULLPATH_ZMQ@")
endif()
Expand Down
7 changes: 7 additions & 0 deletions cmake/Modules/FindLibCXX.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
FindLibCXX
----------
This module is deprecated and will be removed in a future release of iRODS
Result variables
^^^^^^^^^^^^^^^^
Expand Down Expand Up @@ -34,6 +36,11 @@ The following cache variables may also be set:
#]======================================================================]

string(TOUPPER "${PROJECT_NAME}" PROJECT_NAME_UPPER)
if (NOT PROJECT_NAME_UPPER STREQUAL "IRODS")
message(DEPRECATION "The LibCXX CMake find module is deprecated and will be removed in a future relase of iRODS.")
endif()

get_filename_component(__find_libcxx_dir "${CMAKE_CURRENT_LIST_FILE}" PATH)

# We need to set some variables to manipulate find_library behavior
Expand Down
12 changes: 7 additions & 5 deletions cmake/Modules/UseLibCXX.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ UseLibCXX
Sets toolchain variables and directory properties for using libc++.
Define CMAKE_CXX_STANDARD before including this module.
This module is deprecated and will be removed in a future release of iRODS
#]======================================================================]

include_guard(GLOBAL)
Expand All @@ -14,15 +16,15 @@ cmake_minimum_required(VERSION 3.6.0 FATAL_ERROR)
# - CMAKE_<LANG>_INCLUDE_DIRECTORIES variable
# - CMAKE_<LANG>_STANDARD_LIBRARIES variable

if (CMAKE_CXX_COMPILER_ID MATCHES ".*Clang")
set(IRODS_BUILD_AGAINST_LIBCXX_DEFAULT ON)
else()
set(IRODS_BUILD_AGAINST_LIBCXX_DEFAULT OFF)
string(TOUPPER "${PROJECT_NAME}" PROJECT_NAME_UPPER)
if (NOT PROJECT_NAME_UPPER STREQUAL "IRODS")
message(DEPRECATION "The UseLibCXX CMake module is deprecated and will be removed in a future relase of iRODS.")
endif()

set(IRODS_BUILD_AGAINST_LIBCXX ${IRODS_BUILD_AGAINST_LIBCXX_DEFAULT} CACHE BOOL "Try to build against libc++ instead of libstdc++.")
set(IRODS_BUILD_AGAINST_LIBCXX OFF CACHE BOOL "[DEPRECATED] Try to build against libc++ instead of libstdc++.")

if (IRODS_BUILD_AGAINST_LIBCXX)
message(DEPRECATION "Using the IRODS_BUILD_AGAINST_LIBCXX variable to explicitly build agaisnst libc++ is deprecated and will be removed in a future release of iRODS.")
include(IrodsExternals)
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)
Expand Down
Loading

0 comments on commit 8e7d2bc

Please sign in to comment.