Skip to content

Commit

Permalink
Merge r1917112 from apr/trunk:
Browse files Browse the repository at this point in the history
* CMakeLists.txt: Declare TARGET_LINK_LIBRARIES dependencies as private, since
  they are not exposed in public API.

git-svn-id: https://svn.apache.org/repos/asf/apr/apr-util/branches/1.7.x@1920400 13f79535-47bb-0310-9956-ffa450edef68
  • Loading branch information
Ivan Zhakov committed Sep 2, 2024
1 parent 7a48a7f commit 6035711
Showing 1 changed file with 12 additions and 7 deletions.
19 changes: 12 additions & 7 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -287,7 +287,8 @@ IF(APU_BUILD_SHARED)
ADD_LIBRARY(libaprutil-1 SHARED ${APR_SOURCES} ${APR_PUBLIC_HEADERS_GENERATED} libaprutil.rc)
SET(install_targets ${install_targets} libaprutil-1)
SET(install_bin_pdb ${install_bin_pdb} ${PROJECT_BINARY_DIR}/libaprutil-1.pdb)
TARGET_LINK_LIBRARIES(libaprutil-1 ${XMLLIB_LIBRARIES} ${APR_LIBRARIES})
TARGET_LINK_LIBRARIES(libaprutil-1
PRIVATE ${XMLLIB_LIBRARIES} ${APR_LIBRARIES})
TARGET_COMPILE_DEFINITIONS(libaprutil-1
PRIVATE "APU_DECLARE_EXPORT;APR_DECLARE_IMPORT;XML_STATIC;WINNT"
INTERFACE "APU_DECLARE_IMPORT")
Expand All @@ -296,7 +297,8 @@ ENDIF()
IF(APU_BUILD_STATIC)
ADD_LIBRARY(aprutil-1 STATIC ${APR_SOURCES} ${APR_PUBLIC_HEADERS_GENERATED})
SET(install_targets ${install_targets} aprutil-1)
TARGET_LINK_LIBRARIES(aprutil-1 ${APR_LIBRARIES} ${XMLLIB_LIBRARIES})
TARGET_LINK_LIBRARIES(aprutil-1
PRIVATE ${APR_LIBRARIES} ${XMLLIB_LIBRARIES})
TARGET_COMPILE_DEFINITIONS(aprutil-1
PRIVATE "APU_DECLARE_STATIC;APR_DECLARE_STATIC;APU_DSO_MODULE_BUILD;XML_STATIC"
INTERFACE "APU_DECLARE_STATIC")
Expand All @@ -314,15 +316,17 @@ IF(APU_HAVE_CRYPTO)
SET_TARGET_PROPERTIES(apr_crypto_openssl-1 PROPERTIES COMPILE_FLAGS "-DAPR_DECLARE_IMPORT")
TARGET_COMPILE_DEFINITIONS(apr_crypto_openssl-1
PRIVATE "DLL_NAME=apr_crypto_openssl")
TARGET_LINK_LIBRARIES(apr_crypto_openssl-1 libaprutil-1 ${APR_LIBRARIES} ${OPENSSL_LIBRARIES})
TARGET_LINK_LIBRARIES(apr_crypto_openssl-1
PRIVATE libaprutil-1 ${APR_LIBRARIES} ${OPENSSL_LIBRARIES})
ENDIF()

IF(APU_HAVE_ODBC)
ADD_LIBRARY(apr_dbd_odbc-1 SHARED dbd/apr_dbd_odbc.c libaprutil.rc)
SET(install_targets ${install_targets} apr_dbd_odbc-1)
SET(install_bin_pdb ${install_bin_pdb} ${PROJECT_BINARY_DIR}/apr_dbd_odbc-1.pdb)
SET(dbd_drivers ${dbd_drivers} odbc)
TARGET_LINK_LIBRARIES(apr_dbd_odbc-1 libaprutil-1 ${APR_LIBRARIES} odbc32 odbccp32)
TARGET_LINK_LIBRARIES(apr_dbd_odbc-1
PRIVATE libaprutil-1 ${APR_LIBRARIES} odbc32 odbccp32)
SET_PROPERTY(TARGET apr_dbd_odbc-1 APPEND PROPERTY LINK_FLAGS /export:apr_dbd_odbc_driver)
SET_TARGET_PROPERTIES(apr_dbd_odbc-1 PROPERTIES COMPILE_DEFINITIONS "APU_HAVE_ODBC;HAVE_SQL_H;APR_DECLARE_IMPORT;APU_DSO_MODULE_BUILD;WINNT")
TARGET_COMPILE_DEFINITIONS(apr_dbd_odbc-1
Expand All @@ -334,7 +338,8 @@ IF(APR_HAS_LDAP)
ldap/apr_ldap_rebind.c libaprutil.rc)
SET(install_targets ${install_targets} apr_ldap-1)
SET(install_bin_pdb ${install_bin_pdb} ${PROJECT_BINARY_DIR}/apr_ldap-1.pdb)
TARGET_LINK_LIBRARIES(apr_ldap-1 libaprutil-1 ${APR_LIBRARIES} ${LDAP_LIBRARIES})
TARGET_LINK_LIBRARIES(apr_ldap-1 libaprutil-1
PRIVATE ${APR_LIBRARIES} ${LDAP_LIBRARIES})
SET_TARGET_PROPERTIES(apr_ldap-1 PROPERTIES COMPILE_DEFINITIONS "WINNT")
SET_TARGET_PROPERTIES(apr_ldap-1 PROPERTIES COMPILE_FLAGS "-DAPR_DECLARE_IMPORT")
TARGET_COMPILE_DEFINITIONS(apr_ldap-1
Expand All @@ -357,10 +362,10 @@ IF(APR_BUILD_TESTAPR)
${PROJECT_BINARY_DIR}/data/billion-laughs.xml)

IF(TEST_STATIC_LIBS)
SET(whichapr aprutil-1)
SET(whichapr "${APR_LIBRARIES};aprutil-1")
SET(apiflag "-DAPR_DECLARE_STATIC")
ELSE()
SET(whichapr libaprutil-1)
SET(whichapr "${APR_LIBRARIES};libaprutil-1")
SET(apiflag)
ENDIF()

Expand Down

0 comments on commit 6035711

Please sign in to comment.