Skip to content

Commit

Permalink
[cmake] Cleanup APRutil dependency (#250)
Browse files Browse the repository at this point in the history
Make sure we don't reference it on Mac
  • Loading branch information
tobil4sk authored Feb 16, 2022
1 parent 14b348b commit 58e8ca7
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 5 deletions.
5 changes: 4 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -106,10 +106,13 @@ set(external_deps
PCRE
Sqlite3
APR
APRutil
Apache
MbedTLS
)
# Mac build uses a newer version of APR which already contains APRutil
if (NOT APPLE)
list(APPEND external_deps APRutil)
endif()

if (WIN32)
set(STATIC_DEPS_DEFAULT "all")
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ Settings that allow to exclude libraries and their dependencies from the build;

Default value: `all` for Windows, `none` otherwise

It defines the dependencies that should be linked statically. Can be `all`, `none`, or a list of library names (e.g. `BoehmGC;Zlib;OpenSSL;MariaDBConnector;PCRE;Sqlite3;APR;APRutil;Apache;MbedTLS`).
It defines the dependencies that should be linked statically. Can be `all`, `none`, or a list of library names (e.g. `BoehmGC;Zlib;OpenSSL;MariaDBConnector;PCRE;Sqlite3;APR;APRutil;Apache;MbedTLS`). NOTE: On MacOS, APRutil cannot be added here as it has become part of the APR version used on MacOS builds.

CMake will automatically download and build the specified dependencies into the build folder. If a library is not present in this list, it should be installed manually, and it will be linked dynamically.

Expand Down
5 changes: 3 additions & 2 deletions libs/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -179,12 +179,13 @@ if (WITH_APACHE)
INSTALL_COMMAND echo skip install
)
set(APACHE_INCLUDE_DIRS
${CMAKE_BINARY_DIR}/libs/src/install-prefix/include/apr-1
${CMAKE_BINARY_DIR}/libs/src/Apache/include
${CMAKE_BINARY_DIR}/libs/src/Apache/os/unix
)
if (APPLE)
list(APPEND APACHE_INCLUDE_DIRS ${CMAKE_BINARY_DIR}/libs/src/APR/include)
list(APPEND APACHE_INCLUDE_DIRS ${CMAKE_BINARY_DIR}/libs/src/install-prefix/include/apr-2)
else()
list(APPEND APACHE_INCLUDE_DIRS ${CMAKE_BINARY_DIR}/libs/src/install-prefix/include/apr-1)
endif()
set(APACHE_LIBRARIES

Expand Down
5 changes: 4 additions & 1 deletion libs/mod_neko/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,10 @@ target_link_libraries(mod_neko2.ndll libneko ${APACHE_LIBRARIES})

# In static Apache case build dependencies first
if (STATIC_APACHE)
add_dependencies(mod_neko2.ndll Apache APR APRutil)
add_dependencies(mod_neko2.ndll Apache APR)
if (NOT APPLE)
add_dependencies(mod_neko2.ndll APRutil)
endif()
endif()

set_target_properties(mod_neko2.ndll
Expand Down

0 comments on commit 58e8ca7

Please sign in to comment.