Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for building log4cxx as a statically linked library on Windows #21

Merged
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/cmake/FindAPR-Util.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ if(EXISTS ${APR_UTIL_CONFIG_EXECUTABLE})
_apu_invoke(APR_UTIL_LIBRARIES --link-ld)
else()
find_path(APR_UTIL_INCLUDE_DIR apu.h PATH_SUFFIXES apr-1)
if (LINK_APR_UTIL_STATICALLY OR NOT BUILD_SHARED_LIBS)
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)
Expand Down
2 changes: 1 addition & 1 deletion src/cmake/FindAPR.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ if(EXISTS ${APR_CONFIG_EXECUTABLE})
_apr_invoke(APR_LIBRARIES --link-ld)
else()
find_path(APR_INCLUDE_DIR apr.h PATH_SUFFIXES apr-1)
if (LINK_APR_STATICALLY OR NOT BUILD_SHARED_LIBS)
if (APR_STATIC OR NOT BUILD_SHARED_LIBS)
set(APR_SYSTEM_LIBS ws2_32 mswsock rpcrt4)
set(APR_COMPILE_DEFINITIONS APR_DECLARE_STATIC)
find_library(APR_LIBRARIES NAMES apr-1)
Expand Down
6 changes: 6 additions & 0 deletions src/site/apt/building/cmake.apt
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,12 @@ $ sudo make install
*------------------------+---------------------------------------------------------------------------------------------+
| -DBUILD_SHARED_LIBS=off| Build log4cxx as a static library. A dynamically linked log4cxx library is built by default.|
| | Any compilation unit that includes a log4cxx header must define LOG4CXX_STATIC. |
*------------------------+---------------------------------------------------------------------------------------------+
| -DAPU_STATIC | Link to the APR-Util static library. By default, the log4cxx shared library is linked to the|
ams-tschoening marked this conversation as resolved.
Show resolved Hide resolved
| | APR-Util shared library. If BUILD_SHARED_LIBS=off, the static APR-Util library is used. |
*------------------------+---------------------------------------------------------------------------------------------+
| -DAPR_STATIC | 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. |
*------------------------+---------------------------------------------------------------------------------------------+

Building and testing log4cxx on a Microsoft Windows with APR, Expat and APR-Util built from source
Expand Down