Skip to content

Commit

Permalink
drop CFNetwork dependency for macOS
Browse files Browse the repository at this point in the history
  • Loading branch information
d99kris committed Mar 9, 2024
1 parent 8b35654 commit d27d359
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 8 deletions.
14 changes: 10 additions & 4 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -101,10 +101,6 @@ if (${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
list(APPEND CMAKE_PREFIX_PATH /opt/homebrew/opt/ncurses)
list(APPEND OPENSSL_ROOT_DIR /usr/local/opt/openssl)
list(APPEND OPENSSL_ROOT_DIR /opt/homebrew/opt/openssl)
FIND_LIBRARY(CARBON_LIBRARY CoreFoundation)
FIND_LIBRARY(CARBON_LIBRARY CFNetwork)
FIND_LIBRARY(CARBON_LIBRARY Security)
target_link_libraries(nmail PUBLIC z iconv "-framework CoreFoundation" "-framework Security" "-framework CFNetwork")
endif()

# Headers
Expand Down Expand Up @@ -205,6 +201,16 @@ else()
message(STATUS "Found libuuid: ${LIBUUID_LIBRARIES} and ${LIBUUID_HEADERS}")
endif()

# Dependency platform specifics
if (${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
if (NOT HAS_CUSTOM_LIBETPAN)
FIND_LIBRARY(CARBON_LIBRARY CoreFoundation)
FIND_LIBRARY(CARBON_LIBRARY Security)
FIND_LIBRARY(CARBON_LIBRARY CFNetwork)
target_link_libraries(nmail PUBLIC z iconv "-framework CoreFoundation" "-framework Security" "-framework CFNetwork")
endif()
endif()

# Includes
target_include_directories(nmail PRIVATE ${LIBETPAN_INCLUDE_DIR} ${XAPIAN_INCLUDE_DIR}
${MAGIC_HEADERS} ${CYRUS_SASL_INCLUDE_DIR}
Expand Down
10 changes: 8 additions & 2 deletions ext/libetpan/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -298,6 +298,7 @@ check_include_add_define("unistd.h" HAVE_UNISTD_H WARNING)

# Headers - Others (Disabled)
#check_include_add_define("lmdb.h" HAVE_LMDB_H NOTICE)
#check_include_add_define("CFNetwork/CFNetwork.h" HAVE_CFNETWORK NOTICE)

# Capabilities - Required
target_compile_definitions(${LIBNAME} PRIVATE HAVE___ATTRIBUTE__=1)
Expand Down Expand Up @@ -359,7 +360,9 @@ target_include_directories(${LIBNAME} PRIVATE ${CYRUS_SASL_INCLUDE_DIR})
# Find Dependencies - System Libs
if (${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
find_library(CARBON_LIBRARY CoreFoundation REQUIRED)
find_library(CARBON_LIBRARY CFNetwork REQUIRED)
if(${HAVE_CFNETWORK})
find_library(CARBON_LIBRARY CFNetwork REQUIRED)
endif()
find_library(CARBON_LIBRARY Security REQUIRED)
endif()

Expand All @@ -375,7 +378,10 @@ target_link_libraries(${LIBNAME} PUBLIC ${CURL_LIBRARIES} ${EXPAT_LIBRARIES} ${Z

# Linking (macOS)
if (${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
target_link_libraries(${LIBNAME} PUBLIC "-framework CoreFoundation" "-framework Security" "-framework CFNetwork")
target_link_libraries(${LIBNAME} PUBLIC iconv "-framework CoreFoundation" "-framework Security")
if(${HAVE_CFNETWORK})
target_link_libraries(${LIBNAME} PUBLIC "-framework CFNetwork")
endif()
endif()

# Install
Expand Down
2 changes: 1 addition & 1 deletion src/nmail.1
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
.\" DO NOT MODIFY THIS FILE! It was generated by help2man.
.TH NMAIL "1" "March 2024" "nmail v4.52" "User Commands"
.TH NMAIL "1" "March 2024" "nmail v4.53" "User Commands"
.SH NAME
nmail \- ncurses mail
.SH SYNOPSIS
Expand Down
2 changes: 1 addition & 1 deletion src/version.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

#include "version.h"

#define NMAIL_VERSION "4.52"
#define NMAIL_VERSION "4.53"

std::string Version::GetBuildOs()
{
Expand Down

0 comments on commit d27d359

Please sign in to comment.