You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@logging.apache.org by sw...@apache.org on 2023/08/21 06:10:52 UTC

[logging-log4cxx] branch master updated: Revert "Use cmake recommended try_compile signatures (#262)" as there signatures require version 2.25

This is an automated email from the ASF dual-hosted git repository.

swebb2066 pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/logging-log4cxx.git


The following commit(s) were added to refs/heads/master by this push:
     new c8d9a6a1 Revert "Use cmake recommended try_compile signatures (#262)" as there signatures require version 2.25
c8d9a6a1 is described below

commit c8d9a6a15ae540786260503d98a20926b754a366
Author: Stephen Webb <sw...@gmail.com>
AuthorDate: Mon Aug 21 16:05:38 2023 +1000

    Revert "Use cmake recommended try_compile signatures (#262)"
    as there signatures require version 2.25
---
 src/cmake/FindODBC.cmake                               |  4 ++--
 src/cmake/boost-fallback/boost-fallback.cmake          | 15 ++++++---------
 .../compiler-features/check-compiler-support.cmake     | 18 +++++++++---------
 src/cmake/pthread/log4cxx-pthread.cmake                | 14 ++++++--------
 4 files changed, 23 insertions(+), 28 deletions(-)

diff --git a/src/cmake/FindODBC.cmake b/src/cmake/FindODBC.cmake
index 2e06c46c..95bb5952 100644
--- a/src/cmake/FindODBC.cmake
+++ b/src/cmake/FindODBC.cmake
@@ -7,8 +7,8 @@ include(FindPackageHandleStandardArgs)
 # ODBC_FOUND, set to 'yes' if found
 if(WIN32)
   set(ODBC_LIBRARIES odbc32.lib user32.lib)
-  try_compile(ODBC_FOUND
-    SOURCES "${CMAKE_CURRENT_LIST_DIR}/SQLAllocHandleTest.cpp"
+  try_compile(ODBC_FOUND "${CMAKE_BINARY_DIR}/find-odbc"
+    "${CMAKE_CURRENT_LIST_DIR}/SQLAllocHandleTest.cpp"
     LINK_LIBRARIES ${ODBC_LIBRARIES})
 else()
   option(ODBC_STATIC "Link to the odbc static library" OFF)
diff --git a/src/cmake/boost-fallback/boost-fallback.cmake b/src/cmake/boost-fallback/boost-fallback.cmake
index fc4dfa20..93952a92 100644
--- a/src/cmake/boost-fallback/boost-fallback.cmake
+++ b/src/cmake/boost-fallback/boost-fallback.cmake
@@ -6,12 +6,10 @@
 
 include(FindThreads)
 
-try_compile(STD_FILESYSTEM_FOUND
-    SOURCES "${CMAKE_CURRENT_LIST_DIR}/test-stdfilesystem.cpp"
-)
-try_compile(STD_EXPERIMENTAL_FILESYSTEM_FOUND
-    SOURCES "${CMAKE_CURRENT_LIST_DIR}/test-stdexpfilesystem.cpp"
-)
+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)
@@ -20,9 +18,8 @@ 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
-            SOURCES "${CMAKE_CURRENT_LIST_DIR}/test-boostfilesystem.cpp"
-        )
+        try_compile(Boost_FILESYSTEM_FOUND "${CMAKE_BINARY_DIR}/boost-fallback-compile-tests"
+            "${CMAKE_CURRENT_LIST_DIR}/test-boostfilesystem.cpp")
     endif( ${Boost_FOUND} )
 endif()
 
diff --git a/src/cmake/compiler-features/check-compiler-support.cmake b/src/cmake/compiler-features/check-compiler-support.cmake
index 6b6b4ea5..7f5f9a3a 100644
--- a/src/cmake/compiler-features/check-compiler-support.cmake
+++ b/src/cmake/compiler-features/check-compiler-support.cmake
@@ -2,14 +2,14 @@
 #
 
 # Does the compiler support thread_local?
-try_compile(HAS_THREAD_LOCAL
-    SOURCES "${CMAKE_CURRENT_LIST_DIR}/test-thread-local.cpp"
-)
+try_compile(HAS_THREAD_LOCAL "${CMAKE_BINARY_DIR}/Testing/thread-local-test"
+    "${CMAKE_CURRENT_LIST_DIR}/test-thread-local.cpp"
+    CXX_STANDARD 11
+    )
 
 # Does the standard library support std::make_unique<T>>?
-try_compile(STD_MAKE_UNIQUE_FOUND
-    SOURCES "${CMAKE_CURRENT_LIST_DIR}/test-make-unique.cpp"
-)
+try_compile(STD_MAKE_UNIQUE_FOUND "${CMAKE_BINARY_DIR}/boost-fallback-compile-tests"
+    "${CMAKE_CURRENT_LIST_DIR}/test-make-unique.cpp")
 if( ${STD_MAKE_UNIQUE_FOUND} )
     set(STD_MAKE_UNIQUE_IMPL "std::make_unique")
     set(STD_MAKE_UNIQUE_FOUND 1)
@@ -20,7 +20,7 @@ endif()
 
 
 # Does the standard library support std::basic_string<UniChar> and std::basic_ostream<UniChar>?
-try_compile(STD_LIB_HAS_UNICODE_STRING
-    SOURCES "${CMAKE_CURRENT_LIST_DIR}/test-unicode.cpp"
-)
+try_compile(STD_LIB_HAS_UNICODE_STRING "${CMAKE_BINARY_DIR}/Testing/unicode-test"
+    "${CMAKE_CURRENT_LIST_DIR}/test-unicode.cpp"
+    )
 
diff --git a/src/cmake/pthread/log4cxx-pthread.cmake b/src/cmake/pthread/log4cxx-pthread.cmake
index 331bba75..bd9e8590 100644
--- a/src/cmake/pthread/log4cxx-pthread.cmake
+++ b/src/cmake/pthread/log4cxx-pthread.cmake
@@ -1,12 +1,10 @@
 include(FindThreads)
 
-try_compile(PTHREAD_SETNAME_NP_FOUND
-    SOURCES "${CMAKE_CURRENT_LIST_DIR}/test-pthread-setname.cpp"
-    LINK_LIBRARIES Threads::Threads
-)
+try_compile(PTHREAD_SETNAME_NP_FOUND "${CMAKE_BINARY_DIR}/pthread-compile-tests"
+    "${CMAKE_CURRENT_LIST_DIR}/test-pthread-setname.cpp"
+    LINK_LIBRARIES Threads::Threads )
 
-try_compile(PTHREAD_GETNAME_NP_FOUND
-    SOURCES "${CMAKE_CURRENT_LIST_DIR}/test-pthread-getname.cpp"
-    LINK_LIBRARIES Threads::Threads
-)
+try_compile(PTHREAD_GETNAME_NP_FOUND "${CMAKE_BINARY_DIR}/pthread-compile-tests"
+    "${CMAKE_CURRENT_LIST_DIR}/test-pthread-getname.cpp"
+    LINK_LIBRARIES Threads::Threads )