This is an automated email from the ASF dual-hosted git repository. swebb2066 pushed a commit to branch remove_prefer_boost_option in repository https://gitbox.apache.org/repos/asf/logging-log4cxx.git
commit 0aa3db00582d5498ece3813ba0d605304d7895c1 Author: Stephen Webb <[email protected]> AuthorDate: Thu Sep 10 15:21:58 2026 +1000 Remove unused PREFER_BOOST cmake option --- CMakeLists.txt | 11 ++----- src/CMakeLists.txt | 2 -- src/cmake/boost-fallback/boost-fallback.cmake | 36 ---------------------- .../boost-fallback/boost-std-configuration.h.cmake | 31 ------------------- src/cmake/boost-fallback/test-boostatomic.cpp | 6 ---- src/cmake/boost-fallback/test-boostfilesystem.cpp | 6 ---- src/cmake/boost-fallback/test-boostmutex.cpp | 6 ---- src/cmake/boost-fallback/test-boostsharedmutex.cpp | 6 ---- src/cmake/boost-fallback/test-boostsharedptr.cpp | 10 ------ src/cmake/boost-fallback/test-boostthread.cpp | 6 ---- src/cmake/boost-fallback/test-stdatomic.cpp | 5 --- src/cmake/boost-fallback/test-stdexpfilesystem.cpp | 5 --- src/cmake/boost-fallback/test-stdfilesystem.cpp | 5 --- src/cmake/boost-fallback/test-stdmutex.cpp | 6 ---- src/cmake/boost-fallback/test-stdsharedmutex.cpp | 6 ---- src/cmake/boost-fallback/test-stdsharedptr.cpp | 10 ------ src/cmake/boost-fallback/test-stdthread.cpp | 6 ---- .../compiler-features/check-compiler-support.cmake | 2 +- src/main/include/CMakeLists.txt | 4 --- src/site/markdown/development/build-cmake.md.in | 1 - src/site/markdown/development/dependencies.md | 16 ---------- 21 files changed, 4 insertions(+), 182 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index b294dc94..82b9e2fb 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -66,10 +66,8 @@ find_package(APR REQUIRED) option(APU_STATIC "Link to the APR-Util static library" OFF) find_package(APR-Util REQUIRED) -if(NOT MSVC) - # The pthread library is used to name threads and mask signals - find_package(Threads REQUIRED) -endif(NOT MSVC) +# The pthread library is used to name threads and mask signals +find_package(Threads REQUIRED) option(LOG4CXX_ENABLE_ODBC "Support logging via ODBC" OFF) if(LOG4CXX_ENABLE_ODBC) @@ -317,11 +315,8 @@ message(STATUS " DOMConfigurator support ......... : ${LOG4CXX_DOMCONFIGURATOR_ message(STATUS " Qt support ...................... : ${LOG4CXX_QT_SUPPORT}") message(STATUS " LOG4CXX_XXXX_ASYNC macros ....... : ON") message(STATUS " LOG4CXX_XXXX_FMT_ASYNC macros ... : ${ENABLE_FMT_ASYNC}") -message(STATUS "C++ version and Boost settings:") -message(STATUS " Prefer boost: ................... : ${PREFER_BOOST}") message(STATUS " make_unique implementation :..... : ${STD_MAKE_UNIQUE_IMPL}") -message(STATUS " filesystem implementation ....... : ${FILESYSTEM_IMPL}") -message(STATUS " format implementation ........... : ${LOG4CXX_FORMAT_NAMESPACE}::format") +message(STATUS " default format implementation ... : ${LOG4CXX_FORMAT_NAMESPACE}::format") message(STATUS " thread_local support? ........... : ${HAS_THREAD_LOCAL}") if(BUILD_TESTING) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 868a1273..d5a9de44 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -14,8 +14,6 @@ # See the License for the specific language governing permissions and # limitations under the License. # -cmake_policy(SET CMP0079 NEW) -include(${CMAKE_CURRENT_LIST_DIR}/cmake/boost-fallback/boost-fallback.cmake) include(${CMAKE_CURRENT_LIST_DIR}/cmake/compiler-features/check-compiler-support.cmake) add_subdirectory(main) diff --git a/src/cmake/boost-fallback/boost-fallback.cmake b/src/cmake/boost-fallback/boost-fallback.cmake deleted file mode 100644 index ef78fd0a..00000000 --- a/src/cmake/boost-fallback/boost-fallback.cmake +++ /dev/null @@ -1,36 +0,0 @@ -# This module checks for C++ standard classes and their boost counterparts -# Filesystem variables set: -# STD_FILESYSTEM_FOUND - if std::filesystem is found -# STD_EXPERIMENTAL_FILESYSTEM_FOUND - if std::experimental::filesystem is found -# Boost_FILESYSTEM_FOUND - if boost::filesystem is found - -include(FindThreads) - -try_compile(STD_FILESYSTEM_FOUND "${CMAKE_BINARY_DIR}/boost-fallback-compile-tests" - "${CMAKE_CURRENT_LIST_DIR}/test-stdfilesystem.cpp") -try_compile(STD_EXPERIMENTAL_FILESYSTEM_FOUND "${CMAKE_BINARY_DIR}/boost-fallback-compile-tests" - "${CMAKE_CURRENT_LIST_DIR}/test-stdexpfilesystem.cpp") - -# Check for standard headers that we need, fall back to boost if they're not found -set(NAMESPACE_ALIAS ${LOG4CXX_NS}) -option(PREFER_BOOST "Prefer Boost over std:: equivalents" OFF) - -if( ${PREFER_BOOST} OR NOT ( ${STD_FILESYSTEM_FOUND} OR ${STD_EXPERIMENTAL_FILESYSTEM_FOUND} ) ) - find_package(Boost COMPONENTS filesystem) - if( ${Boost_FOUND} ) - try_compile(Boost_FILESYSTEM_FOUND "${CMAKE_BINARY_DIR}/boost-fallback-compile-tests" - "${CMAKE_CURRENT_LIST_DIR}/test-boostfilesystem.cpp") - endif( ${Boost_FOUND} ) -endif() - -if( ${STD_FILESYSTEM_FOUND} AND NOT ${PREFER_BOOST} ) - set( FILESYSTEM_IMPL "std::filesystem" ) -elseif( ${STD_EXPERIMENTAL_FILESYSTEM_FOUND} AND NOT ${PREFER_BOOST} ) - set( FILESYSTEM_IMPL "std::experimental::filesystem" ) -elseif( ${Boost_FILESYSTEM_FOUND} ) - set( FILESYSTEM_IMPL "boost::filesystem" ) -else() - set( FILESYSTEM_IMPL "NONE" ) -endif() - - diff --git a/src/cmake/boost-fallback/boost-std-configuration.h.cmake b/src/cmake/boost-fallback/boost-std-configuration.h.cmake deleted file mode 100644 index a56b21ff..00000000 --- a/src/cmake/boost-fallback/boost-std-configuration.h.cmake +++ /dev/null @@ -1,31 +0,0 @@ -#ifndef BOOST_STD_CONFIGURATION_H -#define BOOST_STD_CONFIGURATION_H - -#cmakedefine01 STD_FILESYSTEM_FOUND -#cmakedefine01 Boost_FILESYSTEM_FOUND -#cmakedefine01 STD_EXPERIMENTAL_FILESYSTEM_FOUND - -#if STD_FILESYSTEM_FOUND -#include <filesystem> -namespace ${NAMESPACE_ALIAS} { -namespace filesystem { - typedef std::filesystem::path path; -} -} -#elif STD_EXPERIMENTAL_FILESYSTEM_FOUND -#include <experimental/filesystem> -namespace ${NAMESPACE_ALIAS} { -namespace filesystem { - typedef std::experimental::filesystem::path path; -} -} -#elif Boost_FILESYSTEM_FOUND -#include <boost/filesystem.hpp> -namespace ${NAMESPACE_ALIAS} { -namespace filesystem { - typedef boost::filesystem::path path; -} -} -#endif - -#endif /* BOOST_STD_CONFIGURATION_H */ diff --git a/src/cmake/boost-fallback/test-boostatomic.cpp b/src/cmake/boost-fallback/test-boostatomic.cpp deleted file mode 100644 index a2e2743c..00000000 --- a/src/cmake/boost-fallback/test-boostatomic.cpp +++ /dev/null @@ -1,6 +0,0 @@ -#include <boost/atomic.hpp> - -int main(int argc, char** argv){ - boost::atomic<bool> b; -} - diff --git a/src/cmake/boost-fallback/test-boostfilesystem.cpp b/src/cmake/boost-fallback/test-boostfilesystem.cpp deleted file mode 100644 index 137f8c96..00000000 --- a/src/cmake/boost-fallback/test-boostfilesystem.cpp +++ /dev/null @@ -1,6 +0,0 @@ -#include <boost/filesystem.hpp> - -int main(int argc, char** argv){ - boost::filesystem::path p; -} - diff --git a/src/cmake/boost-fallback/test-boostmutex.cpp b/src/cmake/boost-fallback/test-boostmutex.cpp deleted file mode 100644 index f10d0fc3..00000000 --- a/src/cmake/boost-fallback/test-boostmutex.cpp +++ /dev/null @@ -1,6 +0,0 @@ -#include <boost/thread.hpp> - -int main(int argc, char** argv){ - boost::mutex mutex; - return 0; -} diff --git a/src/cmake/boost-fallback/test-boostsharedmutex.cpp b/src/cmake/boost-fallback/test-boostsharedmutex.cpp deleted file mode 100644 index 3f88de63..00000000 --- a/src/cmake/boost-fallback/test-boostsharedmutex.cpp +++ /dev/null @@ -1,6 +0,0 @@ -#include <boost/thread/shared_mutex.hpp> - -int main(int argc, char** argv){ - boost::shared_mutex mtx; - return 0; -} diff --git a/src/cmake/boost-fallback/test-boostsharedptr.cpp b/src/cmake/boost-fallback/test-boostsharedptr.cpp deleted file mode 100644 index 3371640b..00000000 --- a/src/cmake/boost-fallback/test-boostsharedptr.cpp +++ /dev/null @@ -1,10 +0,0 @@ -#include <boost/smart_ptr.hpp> - -struct foo{ - int x; -}; - -int main(int argc, char** argv){ - boost::shared_ptr<foo> fooptr; - return 0; -} diff --git a/src/cmake/boost-fallback/test-boostthread.cpp b/src/cmake/boost-fallback/test-boostthread.cpp deleted file mode 100644 index 2c9cdf75..00000000 --- a/src/cmake/boost-fallback/test-boostthread.cpp +++ /dev/null @@ -1,6 +0,0 @@ -#include <boost/thread.hpp> - -int main(int argc, char** argv){ - boost::thread th; - return 0; -} diff --git a/src/cmake/boost-fallback/test-stdatomic.cpp b/src/cmake/boost-fallback/test-stdatomic.cpp deleted file mode 100644 index 57d89808..00000000 --- a/src/cmake/boost-fallback/test-stdatomic.cpp +++ /dev/null @@ -1,5 +0,0 @@ -#include <atomic> - -int main(int argc, char** argv){ - std::atomic<bool> b; -} diff --git a/src/cmake/boost-fallback/test-stdexpfilesystem.cpp b/src/cmake/boost-fallback/test-stdexpfilesystem.cpp deleted file mode 100644 index 6062572d..00000000 --- a/src/cmake/boost-fallback/test-stdexpfilesystem.cpp +++ /dev/null @@ -1,5 +0,0 @@ -#include <experimental/filesystem> - -int main(int argc, char** argv){ - std::experimental::filesystem::path p; -} diff --git a/src/cmake/boost-fallback/test-stdfilesystem.cpp b/src/cmake/boost-fallback/test-stdfilesystem.cpp deleted file mode 100644 index 6c45325f..00000000 --- a/src/cmake/boost-fallback/test-stdfilesystem.cpp +++ /dev/null @@ -1,5 +0,0 @@ -#include <filesystem> - -int main(int argc, char** argv){ - std::filesystem::path p; -} diff --git a/src/cmake/boost-fallback/test-stdmutex.cpp b/src/cmake/boost-fallback/test-stdmutex.cpp deleted file mode 100644 index 3805ed64..00000000 --- a/src/cmake/boost-fallback/test-stdmutex.cpp +++ /dev/null @@ -1,6 +0,0 @@ -#include <mutex> - -int main(int argc, char** argv){ - std::mutex mutex; - return 0; -} diff --git a/src/cmake/boost-fallback/test-stdsharedmutex.cpp b/src/cmake/boost-fallback/test-stdsharedmutex.cpp deleted file mode 100644 index a99a272f..00000000 --- a/src/cmake/boost-fallback/test-stdsharedmutex.cpp +++ /dev/null @@ -1,6 +0,0 @@ -#include <shared_mutex> - -int main(int argc, char** argv){ - std::shared_mutex shared; - return 0; -} diff --git a/src/cmake/boost-fallback/test-stdsharedptr.cpp b/src/cmake/boost-fallback/test-stdsharedptr.cpp deleted file mode 100644 index b5af4d59..00000000 --- a/src/cmake/boost-fallback/test-stdsharedptr.cpp +++ /dev/null @@ -1,10 +0,0 @@ -#include <memory> - -struct foo{ - int x; -}; - -int main(int argc, char** argv){ - std::shared_ptr<foo> fooptr; - return 0; -} diff --git a/src/cmake/boost-fallback/test-stdthread.cpp b/src/cmake/boost-fallback/test-stdthread.cpp deleted file mode 100644 index 9d8b4f69..00000000 --- a/src/cmake/boost-fallback/test-stdthread.cpp +++ /dev/null @@ -1,6 +0,0 @@ -#include <thread> - -int main(int argc, char** argv){ - std::thread th; - return 0; -} diff --git a/src/cmake/compiler-features/check-compiler-support.cmake b/src/cmake/compiler-features/check-compiler-support.cmake index c2e86f73..fcb32b84 100644 --- a/src/cmake/compiler-features/check-compiler-support.cmake +++ b/src/cmake/compiler-features/check-compiler-support.cmake @@ -20,7 +20,7 @@ else() endif() # Does the standard library support std::make_unique<T>>? -try_compile(STD_MAKE_UNIQUE_FOUND "${CMAKE_BINARY_DIR}/boost-fallback-compile-tests" +try_compile(STD_MAKE_UNIQUE_FOUND "${CMAKE_BINARY_DIR}/Testing/make-unique-test" "${CMAKE_CURRENT_LIST_DIR}/test-make-unique.cpp") if( ${STD_MAKE_UNIQUE_FOUND} ) set(STD_MAKE_UNIQUE_IMPL "std::make_unique") diff --git a/src/main/include/CMakeLists.txt b/src/main/include/CMakeLists.txt index c5d52f33..2a2a7c2a 100644 --- a/src/main/include/CMakeLists.txt +++ b/src/main/include/CMakeLists.txt @@ -192,10 +192,6 @@ configure_file(${CMAKE_CURRENT_SOURCE_DIR}/log4cxx/log4cxx.h.in @ONLY ) list(APPEND GENERATED_HEADERS ${CMAKE_CURRENT_BINARY_DIR}/log4cxx/log4cxx.h) -configure_file(${LOG4CXX_SOURCE_DIR}/src/cmake/boost-fallback/boost-std-configuration.h.cmake - ${CMAKE_CURRENT_BINARY_DIR}/log4cxx/private/boost-std-configuration.h -) -list(APPEND GENERATED_HEADERS ${CMAKE_CURRENT_BINARY_DIR}/log4cxx/private/boost-std-configuration.h) if(WIN32) configure_file(${CMAKE_CURRENT_SOURCE_DIR}/log4cxx/version_info.h.in diff --git a/src/site/markdown/development/build-cmake.md.in b/src/site/markdown/development/build-cmake.md.in index e7271dc4..67e2310c 100644 --- a/src/site/markdown/development/build-cmake.md.in +++ b/src/site/markdown/development/build-cmake.md.in @@ -36,7 +36,6 @@ Building with CMake {#build-cmake} | APU_STATIC=yes | Link to the APR-Util static library. By default, the Log4cxx shared library is linked to the APR-Util shared library. If BUILD_SHARED_LIBS=off, the static APR-Util library is used. | | APR_STATIC=yes | Link to the APR static library. By default, the Log4cxx shared library is linked to the APR shared library. If BUILD_SHARED_LIBS=off, the static APR library is always used. | | LOG4CXX_TEST_PROGRAM_PATH=path | An extra path to prepend to the PATH for test programs. Log4cxx requires zip, sed, and grep on the PATH in order for the tests to work properly. | -| PREFER_BOOST=on | Prefer the Boost version of dependent libraries over standard library | | LOG4CXX_QT_SUPPORT=ON | Enable QString API and log4cxx::qt namespace methods, requires QtCore, choice of ON, OFF (default). | | LOG4CXX_EVENTS_AT_EXIT=ON | Prevent static data cleanup to allow event logging during application exit. | | LOG4CXX_FORMAT_NAMESPACE=std | Set LOG4CXX_FORMAT_NS=std when not provided in [target_compile_definitions](https://cmake.org/cmake/help/latest/command/target_compile_definitions.html). LOG4CXX_FORMAT_NS is used in `LOG4CXX_[level]_FMT` logging macros. | diff --git a/src/site/markdown/development/dependencies.md b/src/site/markdown/development/dependencies.md index e961057d..8c2ac4e3 100644 --- a/src/site/markdown/development/dependencies.md +++ b/src/site/markdown/development/dependencies.md @@ -92,27 +92,11 @@ All the above CMake options default to OFF except for the {fmt} library options. If the {fmt} library is found (by *find_package(fmt 7.1 QUIET)*) when Log4cxx is built, the options *ENABLE_FMT_ASYNC* and *ENABLE_FMT_LAYOUT* default to *ON*. -## A note on C++ version and Boost - -By default, Log4cxx requests C++20 features. This is to -avoid 3rd party dependencies as much as possible. If C++17 is not -available, a search for Boost will be taken and those libraries will be used -instead. If you would prefer to use Boost, there are two options you have: - -1. Pass *-DPREFER_BOOST=ON* to CMake when compiling. This will ignore the - results of the tests that check for the standard version of components that - are required. Note that this will switch all components, regardless of the - C++ version in effect at compile time. -2. Revert to an earlier standard using *-DCMAKE_CXX_STANDARD=11* for example. - This will still to check for standard versions of required components, but - it will fall back to using Boost for newer components added in C++17. - # Licenses(direct dependencies only) | Dependency | License | |------------|---------| | APR, APR-util | *Apache License, Version 2.0* | -| Boost | *Boost License, Version 1.0* | | {fmt} | *MIT* | | unixodbc | *LGPL* | | libesmtp | *LGPL* |
