diff options
| author | Lily <47812810+LilyWangL@users.noreply.github.com> | 2019-10-27 10:39:19 +0800 |
|---|---|---|
| committer | Robert Schumacher <roschuma@microsoft.com> | 2019-10-26 19:39:19 -0700 |
| commit | 431d3f35e9536cc871332e58b58f3e980ac31a5c (patch) | |
| tree | 530dcda37a137868c7e5160f96a1e6d2be413fda | |
| parent | 2ade1ec32b891fac9cd30c37066ca26dd86da3d4 (diff) | |
| download | vcpkg-431d3f35e9536cc871332e58b58f3e980ac31a5c.tar.gz vcpkg-431d3f35e9536cc871332e58b58f3e980ac31a5c.zip | |
[log4cpp] Fix link static library (#8741)
* [log4cpp] Fix link static library
* [log4cpp] Unneeded removal of /bin in static mode
| -rw-r--r-- | ports/log4cpp/CONTROL | 2 | ||||
| -rw-r--r-- | ports/log4cpp/Fix-StaticSupport.patch | 26 | ||||
| -rw-r--r-- | ports/log4cpp/portfile.cmake | 5 |
3 files changed, 28 insertions, 5 deletions
diff --git a/ports/log4cpp/CONTROL b/ports/log4cpp/CONTROL index 9706c1316..11c37843b 100644 --- a/ports/log4cpp/CONTROL +++ b/ports/log4cpp/CONTROL @@ -1,5 +1,5 @@ Source: log4cpp -Version: 2.9.1-1 +Version: 2.9.1-2 Homepage: https://github.com/orocos-toolchain/log4cpp Description: Log4cpp is library of C++ classes for flexible logging to files, syslog, IDSA and other destinations. It is modeled after the Log4j Java library, staying as close to their API as is reasonable. diff --git a/ports/log4cpp/Fix-StaticSupport.patch b/ports/log4cpp/Fix-StaticSupport.patch new file mode 100644 index 000000000..8053b4ce5 --- /dev/null +++ b/ports/log4cpp/Fix-StaticSupport.patch @@ -0,0 +1,26 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 529c18e..beace9e 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -21,7 +21,11 @@ SET(LOG4CPP_LIBS) + + IF (WIN32) + SET (CMAKE_DEBUG_POSTFIX "d") +- LIST(APPEND LOG4CPP_CFLAGS -D_CRT_SECURE_NO_WARNINGS -DLOG4CPP_HAS_DLL -DLOG4CPP_BUILD_DLL ) ++ IF (BUILD_SHARED_LIBS) ++ LIST(APPEND LOG4CPP_CFLAGS -D_CRT_SECURE_NO_WARNINGS -DLOG4CPP_HAS_DLL -DLOG4CPP_BUILD_DLL ) ++ ELSE () ++ LIST(APPEND LOG4CPP_CFLAGS -D_CRT_SECURE_NO_WARNINGS ) ++ ENDIF () + ELSE (WIN32) + IF (APPLE) + # LIST(APPEND LOG4CPP_CFLAGS -DLOG4CPP_HAVE_SSTREAM) +@@ -32,7 +36,7 @@ ENDIF (WIN32) + + SET ( LOG4CPP_LIBRARY_NAME "orocos-log4cpp" ) + +-ADD_LIBRARY ( ${LOG4CPP_LIBRARY_NAME} SHARED ++ADD_LIBRARY ( ${LOG4CPP_LIBRARY_NAME} + src/Appender.cpp + src/AppenderSkeleton.cpp + src/AppendersFactory.cpp diff --git a/ports/log4cpp/portfile.cmake b/ports/log4cpp/portfile.cmake index 56688c6f7..44c915876 100644 --- a/ports/log4cpp/portfile.cmake +++ b/ports/log4cpp/portfile.cmake @@ -12,6 +12,7 @@ vcpkg_from_github( HEAD_REF master PATCHES fix-install-targets.patch + Fix-StaticSupport.patch ) vcpkg_configure_cmake( @@ -25,10 +26,6 @@ file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include) vcpkg_fixup_cmake_targets(CONFIG_PATH lib/pkgconfig TARGET_PATH share/${PORT}) file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/share) -if(VCPKG_LIBRARY_LINKAGE STREQUAL static) - file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/bin ${CURRENT_PACKAGES_DIR}/debug/bin) -endif() - vcpkg_copy_pdbs() # Handle copyright |
