[log4cxx] Upgrade to 0.11.0 (#13767)

* [log4cxx] Upgrade to newly released 0.11.0

* [log4cxx] 0.11.0 should build everywhere except uwp

* Changes suggested by @ras0219

* Prevent WIN32 libraries being used on linux

* Prevent WIN32 libraries being used on linux

* Prevent WIN32 libraries being used on linux

* Update ports/log4cxx/portfile.cmake

Co-authored-by: Stephen Webb <stephen.webb@sabreautonomous.com.au>
Co-authored-by: Jack·Boos·Yu <47264268+JackBoosY@users.noreply.github.com>
This commit is contained in:
Stephen Webb 2020-10-07 09:00:58 +11:00 committed by GitHub
parent 524a7c61f3
commit 41ec19fa8a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
7 changed files with 95 additions and 434 deletions

View File

@ -1,337 +0,0 @@
diff --git a/src/main/cpp/locationinfo.cpp b/src/main/cpp/locationinfo.cpp
index e76ea29c..edcc05f5 100644
--- a/src/main/cpp/locationinfo.cpp
+++ b/src/main/cpp/locationinfo.cpp
@@ -148,7 +148,7 @@ void LocationInfo::write(ObjectOutputStream& os, Pool& p) const {
if (lineNumber == -1 && fileName == NA && methodName == NA_METHOD) {
os.writeNull(p);
} else {
- char prolog[] = {
+ uint8_t prolog[] = {
0x72, 0x00, 0x21, 0x6F, 0x72, 0x67, 0x2E,
0x61, 0x70, 0x61, 0x63, 0x68, 0x65, 0x2E, 0x6C,
0x6F, 0x67, 0x34, 0x6A, 0x2E, 0x73, 0x70, 0x69,
@@ -161,7 +161,7 @@ void LocationInfo::write(ObjectOutputStream& os, Pool& p) const {
0x61, 0x76, 0x61, 0x2F, 0x6C, 0x61, 0x6E, 0x67,
0x2F, 0x53, 0x74, 0x72, 0x69, 0x6E, 0x67, 0x3B,
0x78, 0x70 };
- os.writeProlog("org.apache.log4j.spi.LocationInfo", 2, prolog, sizeof(prolog), p);
+ os.writeProlog("org.apache.log4j.spi.LocationInfo", 2, (char *)prolog, sizeof(prolog), p);
char* line = p.itoa(lineNumber);
//
// construct Java-like fullInfo (replace "::" with ".")
diff --git a/src/main/cpp/loggingevent.cpp b/src/main/cpp/loggingevent.cpp
index 1c0d4be7..ba662147 100644
--- a/src/main/cpp/loggingevent.cpp
+++ b/src/main/cpp/loggingevent.cpp
@@ -236,7 +236,7 @@ void LoggingEvent::setProperty(const LogString& key, const LogString& value)
void LoggingEvent::writeProlog(ObjectOutputStream& os, Pool& p) {
- char classDesc[] = {
+ uint8_t classDesc[] = {
0x72, 0x00, 0x21,
0x6F, 0x72, 0x67, 0x2E, 0x61, 0x70, 0x61, 0x63,
0x68, 0x65, 0x2E, 0x6C, 0x6F, 0x67, 0x34, 0x6A,
@@ -292,7 +292,7 @@ void LoggingEvent::writeProlog(ObjectOutputStream& os, Pool& p) {
0x3B, 0x78, 0x70 };
os.writeProlog("org.apache.log4j.spi.LoggingEvent",
- 8, classDesc, sizeof(classDesc), p);
+ 8, (char *)classDesc, sizeof(classDesc), p);
}
void LoggingEvent::write(helpers::ObjectOutputStream& os, Pool& p) const {
diff --git a/src/main/cpp/objectoutputstream.cpp b/src/main/cpp/objectoutputstream.cpp
index 7cd696b8..f80261d9 100644
--- a/src/main/cpp/objectoutputstream.cpp
+++ b/src/main/cpp/objectoutputstream.cpp
@@ -36,8 +36,8 @@ ObjectOutputStream::ObjectOutputStream(OutputStreamPtr outputStream, Pool& p)
objectHandle(0x7E0000),
classDescriptions(new ClassDescriptionMap())
{
- char start[] = { 0xAC, 0xED, 0x00, 0x05 };
- ByteBuffer buf(start, sizeof(start));
+ uint8_t start[] = { 0xAC, 0xED, 0x00, 0x05 };
+ ByteBuffer buf((char *)start, sizeof(start));
os->write(buf, p);
}
@@ -81,7 +81,7 @@ void ObjectOutputStream::writeObject(const MDC::Map& val, Pool& p) {
//
// TC_OBJECT and the classDesc for java.util.Hashtable
//
- char prolog[] = {
+ uint8_t prolog[] = {
0x72, 0x00, 0x13, 0x6A, 0x61, 0x76, 0x61,
0x2E, 0x75, 0x74, 0x69, 0x6C, 0x2E, 0x48, 0x61,
0x73, 0x68, 0x74, 0x61, 0x62, 0x6C, 0x65, 0x13,
@@ -90,12 +90,12 @@ void ObjectOutputStream::writeObject(const MDC::Map& val, Pool& p) {
0x64, 0x46, 0x61, 0x63, 0x74, 0x6F, 0x72, 0x49,
0x00, 0x09, 0x74, 0x68, 0x72, 0x65, 0x73, 0x68,
0x6F, 0x6C, 0x64, 0x78, 0x70 };
- writeProlog("java.util.Hashtable", 1, prolog, sizeof(prolog), p);
+ writeProlog("java.util.Hashtable", 1, (char *)prolog, sizeof(prolog), p);
//
// loadFactor = 0.75, threshold = 5, blockdata start, buckets.size = 7
- char data[] = { 0x3F, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x05,
+ uint8_t data[] = { 0x3F, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x05,
TC_BLOCKDATA, 0x08, 0x00, 0x00, 0x00, 0x07 };
- ByteBuffer dataBuf(data, sizeof(data));
+ ByteBuffer dataBuf((char *)data, sizeof(data));
os->write(dataBuf, p);
char size[4];
size_t sz = val.size();
diff --git a/src/main/cpp/simpledateformat.cpp b/src/main/cpp/simpledateformat.cpp
index f18dfc75..cbce2db9 100644
--- a/src/main/cpp/simpledateformat.cpp
+++ b/src/main/cpp/simpledateformat.cpp
@@ -126,7 +126,7 @@ namespace log4cxx
size_t start = 0;
std::basic_ostringstream<wchar_t> os;
for(; valueIter != values.end(); valueIter++) {
- PUT_FACET(facet, os, &time, (wchar_t) wspec);
+ PUT_FACET(facet, os, &time, wspec);
Transcoder::decode(os.str().substr(start), *valueIter);
start = os.str().length();
(*inc)(time, aprtime);
diff --git a/src/main/cpp/stringhelper.cpp b/src/main/cpp/stringhelper.cpp
index ca4b1ace..b89dc65d 100644
--- a/src/main/cpp/stringhelper.cpp
+++ b/src/main/cpp/stringhelper.cpp
@@ -21,6 +21,7 @@
#include <log4cxx/helpers/transcoder.h>
#include <algorithm>
#include <vector>
+#include <iterator>
#include <apr_strings.h>
#include <log4cxx/helpers/pool.h>
#if !defined(LOG4CXX)
diff --git a/src/main/include/log4cxx/asyncappender.h b/src/main/include/log4cxx/asyncappender.h
index cbe9b3c7..86a7371c 100644
--- a/src/main/include/log4cxx/asyncappender.h
+++ b/src/main/include/log4cxx/asyncappender.h
@@ -35,6 +35,7 @@
namespace log4cxx
{
+ LOG4CXX_LIST_DEF(LoggingEventList, log4cxx::spi::LoggingEventPtr);
/**
The AsyncAppender lets users log events asynchronously. It uses a
@@ -194,7 +195,6 @@ namespace log4cxx
/**
* Event buffer.
*/
- LOG4CXX_LIST_DEF(LoggingEventList, log4cxx::spi::LoggingEventPtr);
LoggingEventList buffer;
/**
diff --git a/src/main/include/log4cxx/helpers/bytearrayinputstream.h b/src/main/include/log4cxx/helpers/bytearrayinputstream.h
index 92bcb595..11d33def 100755
--- a/src/main/include/log4cxx/helpers/bytearrayinputstream.h
+++ b/src/main/include/log4cxx/helpers/bytearrayinputstream.h
@@ -32,6 +32,7 @@ namespace log4cxx
{
namespace helpers {
+ LOG4CXX_LIST_DEF(ByteList, unsigned char);
/**
* InputStream implemented on top of a byte array.
@@ -39,7 +40,6 @@ namespace log4cxx
class LOG4CXX_EXPORT ByteArrayInputStream : public InputStream
{
private:
- LOG4CXX_LIST_DEF(ByteList, unsigned char);
ByteList buf;
size_t pos;
diff --git a/src/main/include/log4cxx/helpers/bytearrayoutputstream.h b/src/main/include/log4cxx/helpers/bytearrayoutputstream.h
index 34e3d095..1f4233da 100644
--- a/src/main/include/log4cxx/helpers/bytearrayoutputstream.h
+++ b/src/main/include/log4cxx/helpers/bytearrayoutputstream.h
@@ -34,6 +34,7 @@ namespace log4cxx
namespace helpers {
class Pool;
+ LOG4CXX_LIST_DEF(ByteList, unsigned char);
/**
* OutputStream implemented on top of std::vector
@@ -41,7 +42,6 @@ namespace log4cxx
class LOG4CXX_EXPORT ByteArrayOutputStream : public OutputStream
{
private:
- LOG4CXX_LIST_DEF(ByteList, unsigned char);
ByteList array;
public:
diff --git a/src/main/include/log4cxx/helpers/simpledateformat.h b/src/main/include/log4cxx/helpers/simpledateformat.h
index 9c27f685..0b4dc5fd 100644
--- a/src/main/include/log4cxx/helpers/simpledateformat.h
+++ b/src/main/include/log4cxx/helpers/simpledateformat.h
@@ -39,6 +39,8 @@ namespace log4cxx
class PatternToken;
}
+ LOG4CXX_LIST_DEF(PatternTokenList, log4cxx::helpers::SimpleDateFormatImpl::PatternToken*);
+
/**
* Concrete class for formatting and parsing dates in a
* locale-sensitive manner.
@@ -75,8 +77,6 @@ namespace log4cxx
/**
* List of tokens.
*/
- LOG4CXX_LIST_DEF(PatternTokenList, log4cxx::helpers::SimpleDateFormatImpl::PatternToken*);
-
PatternTokenList pattern;
static void addToken(const logchar spec, const int repeat, const std::locale* locale, PatternTokenList& pattern);
diff --git a/src/main/include/log4cxx/helpers/socketoutputstream.h b/src/main/include/log4cxx/helpers/socketoutputstream.h
index 6bca1733..0c6fbb4f 100644
--- a/src/main/include/log4cxx/helpers/socketoutputstream.h
+++ b/src/main/include/log4cxx/helpers/socketoutputstream.h
@@ -32,6 +32,7 @@ namespace log4cxx
{
namespace helpers
{
+ LOG4CXX_LIST_DEF(ByteList, unsigned char);
class LOG4CXX_EXPORT SocketOutputStream : public OutputStream
{
@@ -50,7 +51,6 @@ namespace log4cxx
virtual void write(ByteBuffer& buf, Pool& p);
private:
- LOG4CXX_LIST_DEF(ByteList, unsigned char);
ByteList array;
SocketPtr socket;
//
diff --git a/src/main/include/log4cxx/net/sockethubappender.h b/src/main/include/log4cxx/net/sockethubappender.h
index 89948334..b4269943 100644
--- a/src/main/include/log4cxx/net/sockethubappender.h
+++ b/src/main/include/log4cxx/net/sockethubappender.h
@@ -38,6 +38,8 @@ namespace log4cxx
}
namespace net
{
+ LOG4CXX_LIST_DEF(ObjectOutputStreamList, log4cxx::helpers::ObjectOutputStreamPtr);
+
/**
Sends {@link log4cxx::spi::LoggingEvent LoggingEvent} objects to a set of remote log
servers, usually a SocketNode.
@@ -112,7 +114,6 @@ namespace log4cxx
static int DEFAULT_PORT;
int port;
- LOG4CXX_LIST_DEF(ObjectOutputStreamList, log4cxx::helpers::ObjectOutputStreamPtr);
ObjectOutputStreamList streams;
bool locationInfo;
diff --git a/src/main/include/log4cxx/net/telnetappender.h b/src/main/include/log4cxx/net/telnetappender.h
index 5cbe2b0b..17678d86 100644
--- a/src/main/include/log4cxx/net/telnetappender.h
+++ b/src/main/include/log4cxx/net/telnetappender.h
@@ -39,6 +39,8 @@ namespace log4cxx
}
namespace net
{
+ typedef log4cxx::helpers::SocketPtr Connection;
+ LOG4CXX_LIST_DEF(ConnectionList, Connection);
/**
<p>The TelnetAppender is a log4cxx appender that specializes in
writing to a read-only socket. The output is provided in a
@@ -131,9 +133,6 @@ servlet.
TelnetAppender(const TelnetAppender&);
TelnetAppender& operator=(const TelnetAppender&);
- typedef log4cxx::helpers::SocketPtr Connection;
- LOG4CXX_LIST_DEF(ConnectionList, Connection);
-
void write(log4cxx::helpers::ByteBuffer&);
void writeStatus(const log4cxx::helpers::SocketPtr& socket, const LogString& msg, log4cxx::helpers::Pool& p);
ConnectionList connections;
diff --git a/src/main/include/log4cxx/patternlayout.h b/src/main/include/log4cxx/patternlayout.h
index 55d6eb5b..d084b6cb 100644
--- a/src/main/include/log4cxx/patternlayout.h
+++ b/src/main/include/log4cxx/patternlayout.h
@@ -32,6 +32,8 @@
namespace log4cxx
{
+ LOG4CXX_LIST_DEF(LoggingEventPatternConverterList, log4cxx::pattern::LoggingEventPatternConverterPtr);
+ LOG4CXX_LIST_DEF(FormattingInfoList, log4cxx::pattern::FormattingInfoPtr);
/**
@@ -334,13 +336,11 @@ namespace log4cxx
/**
* Pattern converters.
*/
- LOG4CXX_LIST_DEF(LoggingEventPatternConverterList, log4cxx::pattern::LoggingEventPatternConverterPtr);
LoggingEventPatternConverterList patternConverters;
/**
* Field widths and alignment corresponding to pattern converters.
*/
- LOG4CXX_LIST_DEF(FormattingInfoList, log4cxx::pattern::FormattingInfoPtr);
FormattingInfoList patternFields;
diff --git a/src/main/include/log4cxx/rolling/rollingpolicybase.h b/src/main/include/log4cxx/rolling/rollingpolicybase.h
index 154b17d9..ab8dad70 100755
--- a/src/main/include/log4cxx/rolling/rollingpolicybase.h
+++ b/src/main/include/log4cxx/rolling/rollingpolicybase.h
@@ -34,6 +34,8 @@
namespace log4cxx {
namespace rolling {
+ LOG4CXX_LIST_DEF(PatternConverterList, log4cxx::pattern::PatternConverterPtr);
+ LOG4CXX_LIST_DEF(FormattingInfoList, log4cxx::pattern::FormattingInfoPtr);
/**
* Implements methods common to most, it not all, rolling
@@ -57,13 +59,11 @@ namespace log4cxx {
/**
* File name pattern converters.
*/
- LOG4CXX_LIST_DEF(PatternConverterList, log4cxx::pattern::PatternConverterPtr);
PatternConverterList patternConverters;
/**
* File name field specifiers.
*/
- LOG4CXX_LIST_DEF(FormattingInfoList, log4cxx::pattern::FormattingInfoPtr);
FormattingInfoList patternFields;
/**
diff --git a/src/main/include/log4cxx/spi/loggingevent.h b/src/main/include/log4cxx/spi/loggingevent.h
index 25f5c0dd..102bea21 100644
--- a/src/main/include/log4cxx/spi/loggingevent.h
+++ b/src/main/include/log4cxx/spi/loggingevent.h
@@ -43,6 +43,7 @@ namespace log4cxx
namespace spi
{
+ LOG4CXX_LIST_DEF(KeySet, LogString);
/**
The internal representation of logging events. When an affirmative
@@ -152,7 +153,6 @@ namespace log4cxx
*/
bool getMDC(const LogString& key, LogString& dest) const;
- LOG4CXX_LIST_DEF(KeySet, LogString);
/**
* Returns the set of of the key values in the MDC for the event.
* The returned set is unmodifiable by the caller.
@@ -160,6 +160,7 @@ namespace log4cxx
* @return Set an unmodifiable set of the MDC keys.
*
*/
+ typedef spi::KeySet KeySet;
KeySet getMDCKeySet() const;
/**

View File

@ -1,75 +0,0 @@
cmake_minimum_required(VERSION 2.8.9)
project (log4cxx)
find_path(APR_INCLUDE_DIR
NAMES apr.h
)
if(APR_INCLUDE_DIR-NOTFOUND)
message(FATAL_ERROR "Cannot locate apr.h")
endif()
find_library(APR_LIBRARIES
NAMES libapr-1
)
if(APR_LIBRARIES-NOTFOUND)
message(FATAL_ERROR "Cannot locate the library of `libapr-1`")
endif()
find_path(APRUTIL_INCLUDE_DIR
NAMES apu.h
)
if(APRUTIL_INCLUDE_DIR-NOTFOUND)
message(FATAL_ERROR "Cannot locate apu.h")
endif()
find_library(APRUTIL_LIBRARIES
NAMES libaprutil-1
)
if(APRUTIL_LIBRARIES-NOTFOUND)
message(FATAL_ERROR "Cannot locate the library of `libaprutil-1`")
endif()
add_compile_options(
/wd4101
/wd4275
/wd4251
/wd4250
)
configure_file(src/main/include/log4cxx/log4cxx.hw
${PROJECT_BINARY_DIR}/include/log4cxx/log4cxx.h COPYONLY)
configure_file(src/main/include/log4cxx/private/log4cxx_private.hw
${PROJECT_BINARY_DIR}/include/log4cxx/private/log4cxx_private.h COPYONLY)
set(LOG4CXX_INCLUDE_DIRECTORIES
${PROJECT_BINARY_DIR}/include
src/main/include
${APR_INCLUDE_DIR}
${APRUTIL_INCLUDE_DIR}
)
file(GLOB_RECURSE LOG4CXX_SRC
"${PROJECT_SOURCE_DIR}/src/main/cpp/*.cpp"
)
add_library(log4cxx SHARED ${LOG4CXX_SRC})
target_include_directories(log4cxx PUBLIC ${LOG4CXX_INCLUDE_DIRECTORIES})
SET_TARGET_PROPERTIES(log4cxx PROPERTIES COMPILE_DEFINITIONS "_USRDLL;DLL_EXPORTS;LOG4CXX;WIN32")
target_link_libraries(log4cxx
${APRUTIL_LIBRARIES}
${APR_LIBRARIES}
odbc32
)
install(TARGETS log4cxx
RUNTIME DESTINATION bin
LIBRARY DESTINATION lib
ARCHIVE DESTINATION lib
)
INSTALL(DIRECTORY src/main/include/ DESTINATION include
FILES_MATCHING PATTERN "*.h")
INSTALL(DIRECTORY ${PROJECT_BINARY_DIR}/include/ DESTINATION include
FILES_MATCHING PATTERN "*.h")

View File

@ -1,6 +1,6 @@
Source: log4cxx
Version: 0.10.0-2
Homepage: https://logging.apache.org/log4cxx/
Description: Apache log4cxx is a logging framework for C++ patterned after Apache log4j, which uses Apache Portable Runtime for most platform-specific code and should be usable on any platform supported by APR. Apache log4cxx is licensed under the Apache License, an open source license certified by the Open Source Initiative.
Version: 0.11.0
Homepage: https://logging.apache.org/log4cxx
Description: Apache log4cxx is a logging framework for C++ patterned after Apache log4j, which uses Apache Portable Runtime for most platform-specific code and should be usable on any platform supported by APR
Supports: !uwp
Build-Depends: apr, apr-util
Supports: windows&!(uwp|arm|static)

59
ports/log4cxx/expat.patch Normal file
View File

@ -0,0 +1,59 @@
diff --git a/CMakeLists.txt b/CMakeLists.txt
index d30a71b..3ecf5f0 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -23,6 +23,9 @@ find_package(APR REQUIRED)
# Find Apache Runtime Utilities
find_package(APR-Util REQUIRED)
+# Find expat for XML parsing
+find_package(EXPAT REQUIRED)
+
# Building
add_subdirectory(src)
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
index 3e0cb17..9a450b7 100644
--- a/src/CMakeLists.txt
+++ b/src/CMakeLists.txt
@@ -1,7 +1,7 @@
add_subdirectory(main)
target_compile_definitions(log4cxx PRIVATE ${LOG4CXX_COMPILE_DEFINITIONS} ${APR_COMPILE_DEFINITIONS} ${APR_UTIL_COMPILE_DEFINITIONS} )
target_include_directories(log4cxx INTERFACE $<INSTALL_INTERFACE:include> PRIVATE ${APR_INCLUDE_DIR} ${APR_UTIL_INCLUDE_DIR})
-target_link_libraries(log4cxx PRIVATE ${APR_UTIL_LIBRARIES} ${XMLLIB_LIBRARIES} ${APR_LIBRARIES} ${APR_SYSTEM_LIBS})
+target_link_libraries(log4cxx PRIVATE ${APR_UTIL_LIBRARIES} EXPAT::EXPAT ${APR_LIBRARIES} ${APR_SYSTEM_LIBS})
if(WIN32)
# The ODBC appender is always enabled in the Windows configuration
target_link_libraries(log4cxx PRIVATE odbc32.lib)
diff --git a/src/cmake/FindAPR-Util.cmake b/src/cmake/FindAPR-Util.cmake
index bb4e951..75093d8 100644
--- a/src/cmake/FindAPR-Util.cmake
+++ b/src/cmake/FindAPR-Util.cmake
@@ -38,7 +38,6 @@ if(EXISTS ${APR_UTIL_CONFIG_EXECUTABLE})
_apu_invoke(_apu_util_link_args --link-ld)
string(REGEX MATCH "-L([^ ]+)" _apu_util_L_flag ${_apu_util_link_args})
find_library(APR_UTIL_LIBRARIES NAMES libaprutil-1.a PATHS "${CMAKE_MATCH_1}")
- _apu_invoke(XMLLIB_LIBRARIES --libs)
set(APR_UTIL_COMPILE_DEFINITIONS APU_DECLARE_STATIC)
else()
_apu_invoke(APR_UTIL_LIBRARIES --link-ld)
@@ -48,8 +47,6 @@ else()
if (APU_STATIC OR NOT BUILD_SHARED_LIBS)
set(APR_UTIL_COMPILE_DEFINITIONS APU_DECLARE_STATIC)
find_library(APR_UTIL_LIBRARIES NAMES aprutil-1)
- find_library(XMLLIB_LIBRARIES NAMES libexpat)
- find_program(XMLLIB_DLL libexpat.dll)
else()
find_library(APR_UTIL_LIBRARIES NAMES libaprutil-1)
find_program(APR_UTIL_DLL libaprutil-1.dll)
diff --git a/src/test/cpp/xml/CMakeLists.txt b/src/test/cpp/xml/CMakeLists.txt
index bddfe48..138c489 100644
--- a/src/test/cpp/xml/CMakeLists.txt
+++ b/src/test/cpp/xml/CMakeLists.txt
@@ -4,5 +4,5 @@ add_executable(xmltests
xmllayouttestcase
)
-target_link_libraries(xmltests PRIVATE ${APR_UTIL_LIBRARIES} ${XMLLIB_LIBRARIES})
+target_link_libraries(xmltests PRIVATE ${APR_UTIL_LIBRARIES} EXPAT::EXPAT)
set(ALL_LOG4CXX_TESTS ${ALL_LOG4CXX_TESTS} xmltests PARENT_SCOPE)

17
ports/log4cxx/linux.patch Normal file
View File

@ -0,0 +1,17 @@
diff --git a/src/cmake/FindAPR.cmake b/src/cmake/FindAPR.cmake
index a204ece..4d2b48d 100644
--- a/src/cmake/FindAPR.cmake
+++ b/src/cmake/FindAPR.cmake
@@ -45,7 +45,11 @@ if(EXISTS ${APR_CONFIG_EXECUTABLE})
else()
find_path(APR_INCLUDE_DIR apr.h PATH_SUFFIXES apr-1)
if (APR_STATIC OR NOT BUILD_SHARED_LIBS)
- set(APR_SYSTEM_LIBS ws2_32 mswsock rpcrt4)
+ if(WIN32)
+ set(APR_SYSTEM_LIBS ws2_32 mswsock rpcrt4)
+ else()
+ set(APR_SYSTEM_LIBS pthread)
+ endif()
set(APR_COMPILE_DEFINITIONS APR_DECLARE_STATIC)
find_library(APR_LIBRARIES NAMES apr-1)
else()

View File

@ -1,31 +1,32 @@
vcpkg_fail_port_install(ON_TARGET "Linux" "OSX" "UWP" "arm" "arm64")
vcpkg_check_linkage(ONLY_DYNAMIC_LIBRARY)
set(LOG4CXX_VERSION 0.10.0)
set(VERSION 0.11.0)
vcpkg_download_distfile(ARCHIVE
URLS "https://archive.apache.org/dist/logging/log4cxx/0.10.0/apache-log4cxx-0.10.0.tar.gz"
FILENAME "apache-log4cxx-0.10.0.tar.gz"
SHA512 1c34d80983db5648bc4582ddcf6b4fdefdc6594c2769f95235f5441cd6d03cf279cc8f365e9a687085b113f79ebac9d7d33a54b6aa3b3b808c0e1a56a15ffa37
URLS "https://archive.apache.org/dist/logging/log4cxx/${VERSION}/apache-log4cxx-${VERSION}.tar.gz"
FILENAME "apache-log4cxx-${VERSION}.tar.gz"
SHA512 f8aa37c9c094e7a4d6ca92dff13c032f69f1e078c51ea55e284fcb931c13256b08950af3ea6eaf7a12282240f6073e9acab19bfe217f88dbd62a5d2360f3fbdd
)
vcpkg_extract_source_archive_ex(
OUT_SOURCE_PATH SOURCE_PATH
ARCHIVE ${ARCHIVE}
REF ${LOG4CXX_VERSION}
REF ${VERSION}
PATCHES
001_msvc.patch
expat.patch
linux.patch
)
file(COPY ${CMAKE_CURRENT_LIST_DIR}/CMakeLists.txt DESTINATION ${SOURCE_PATH})
vcpkg_configure_cmake(
SOURCE_PATH ${SOURCE_PATH}
PREFER_NINJA
OPTIONS
-DLOG4CXX_INSTALL_PDB=OFF # Installing pdbs failed on debug static. So, disable it and let vcpkg_copy_pdbs() do it
)
vcpkg_install_cmake()
file(INSTALL ${SOURCE_PATH}/LICENSE DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright)
vcpkg_fixup_cmake_targets(CONFIG_PATH share/cmake/log4cxx)
file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include ${CURRENT_PACKAGES_DIR}/debug/share)
file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/include")
vcpkg_copy_pdbs()
# Handle copyright
file(INSTALL ${SOURCE_PATH}/LICENSE DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright)

View File

@ -935,12 +935,8 @@ lmdb:arm-uwp=fail
lmdb:x64-uwp=fail
log4cplus:arm-uwp=fail
log4cplus:x64-uwp=fail
log4cxx:arm64-windows=fail
log4cxx:arm-uwp=fail
log4cxx:x64-linux=fail
log4cxx:x64-uwp=fail
log4cxx:x64-windows-static=fail
log4cxx:x64-osx=fail
lua:arm-uwp=fail
lua:x64-uwp=fail
luajit:arm64-windows = skip