CMAKE_MINIMUM_REQUIRED (VERSION 3.1.0)
INCLUDE (CheckIncludeFiles)
INCLUDE (CheckTypeSize)
INCLUDE (CheckFunctionExists)
INCLUDE (CheckSymbolExists)
INCLUDE (CheckCSourceCompiles)
INCLUDE (CheckStructHasMember)
INCLUDE (CheckLibraryExists)
INCLUDE (GNUInstallDirs)
PROJECT (c-ares C)
# Set this version before release
SET (CARES_VERSION "1.15.0")
# This is for libtool compatibility, and specified in a form that is easily
# translatable from libtool (even if the actual form doesn't make sense).
# For instance, in an autotools project, in Makefile.am there is a line that
# contains something like:
# -version-info 4:0:2
# This breaks down into sections of current:revision:age
# This then generates a version of "(current-age).age.revision" with an
# interface version of "(current-age)"
# For example, a version of 4:0:2 would generate output such as:
# libname.so -> libname.so.2
# libname.so.2 -> libname.so.2.2.0
SET (CARES_LIB_VERSIONINFO "5:0:3")
OPTION (CARES_STATIC "Build as a static library" OFF)
OPTION (CARES_SHARED "Build as a shared library" ON)
OPTION (CARES_INSTALL "Create installation targets (chain builders may want to disable this)" ON)
OPTION (CARES_STATIC_PIC "Build the static library as PIC (position independent)" OFF)
OPTION (CARES_BUILD_TESTS "Build and run tests" OFF)
OPTION (CARES_BUILD_TOOLS "Build tools" ON)
# allow linking against the static runtime library in msvc
IF (MSVC)
OPTION (CARES_MSVC_STATIC_RUNTIME "Link against the static runtime library" OFF)
IF (CARES_MSVC_STATIC_RUNTIME)
# CMAKE_CONFIGURATION_TYPES is empty on non-IDE generators (Ninja, NMake)
# and that's why we also use CMAKE_BUILD_TYPE to cover for those generators.
# For IDE generators, CMAKE_BUILD_TYPE is usually empty
FOREACH (config_type ${CMAKE_CONFIGURATION_TYPES} ${CMAKE_BUILD_TYPE})
STRING (TOUPPER ${config_type} upper_config_type)
SET (flag_var "CMAKE_C_FLAGS_${upper_config_type}")
IF (${flag_var} MATCHES "/MD")
STRING (REGEX REPLACE "/MD" "/MT" ${flag_var} "${${flag_var}}")
ENDIF ()
ENDFOREACH ()
# clean up
SET (upper_config_type)
SET (config_type)
SET (flag_var)
ENDIF ()
ENDIF ()
# Keep build organized.
SET (CMAKE_RUNTIME_OUTPUT_DIRECTORY ${PROJECT_BINARY_DIR}/bin)
SET (CMAKE_LIBRARY_OUTPUT_DIRECTORY ${PROJECT_BINARY_DIR}/lib)
SET (CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${PROJECT_BINARY_DIR}/lib)
SET (PACKAGE_DIRECTORY ${PROJECT_BINARY_DIR}/package)
# Destinations for installing different kinds of targets (pass to install command).
SET (TARGETS_INST_DEST
RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}
INCLUDES DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}
)
# Look for dependent/required libraries
CHECK_LIBRARY_EXISTS (resolv res_servicename "" HAVE_RES_SERVICENAME_IN_LIBRESOLV)
IF (HAVE_RES_SERVICENAME_IN_LIBRESOLV)
SET (HAVE_LIBRESOLV 1)
ENDIF ()
IF (APPLE)
CHECK_C_SOURCE_COMPILES ("
#include <stdio.h>
#include <TargetConditionals.h>
int main() {
#if TARGET_OS_IPHONE == 0
#error Not an iPhone target
#endif
return 0;
}
"
IOS)
CHECK_C_SOURCE_COMPILES ("
#include <stdio.h>
#include <TargetConditionals.h>
int main() {
#if TARGET_OS_IPHONE == 0 || __IPHONE_OS_VERSION_MIN_REQUIRED < 100000
# error Not iOS v10
#endif
return 0;
}
"
IOS_V10)
CHECK_C_SOURCE_COMPILES ("
#include <stdio.h>
#include <AvailabilityMacros.h>
#ifndef MAC_OS_X_VERSION_10_12
# define MAC_OS_X_VERSION_10_12 101200
#endif
int main() {
#if MAC_OS_X_VERSION_MIN_REQUIRED < MAC_OS_X_VERSION_10_12
# error Not MacOSX 10.12 or higher
#endif
return 0;
}
"
MACOS_V1012)
ENDIF ()
IF (IOS AND HAVE_LIBRESOLV)
SET (CARES_USE_LIBRESOLV 1)
ENDIF()
CHECK_LIBRARY_EXISTS (nsl gethostbyname "" HAVE_LIBNSL)
CHECK_LIBRARY_EXISTS (socket gethostbyname "" HAVE_GHBN_LIBSOCKET)
CHECK_LIBRARY_EXISTS (socket socket "" HAVE_SOCKET_LIBSOCKET)
IF (HAVE_GHBN_LIBSOCKET OR HAVE_SOCKET_LIBSOCKET)
SET(HAVE_LIBSOCKET TRUE)
ENDIF ()
CHECK_LIBRARY_EXISTS (rt clock_gettime "" HAVE_LIBRT)
# Look for necessary includes
CHECK_INCLUDE_FILES (sys/types.h HAVE_SYS_TYPES_H)
CHECK_INCLUDE_FILES (sys/socket.h HAVE_SYS_SOCKET_H)
CHECK_INCLUDE_FILES (arpa/inet.h HAVE_ARPA_INET_H)
CHECK_INCLUDE_FILES (arpa/nameser_compat.h HAVE_ARPA_NAMESER_COMPAT_H)
CHECK_INCLUDE_FILES (arpa/nameser.h HAVE_ARPA_NAMESER_H)
CHECK_INCLUDE_FILES (assert.h HAVE_ASSERT_H)
CHECK_INCLUDE_FILES (errno.h HAVE_ERRNO_H)
CHECK_INCLUDE_FILES (fcntl.h HAVE_FCNTL_H)
CHECK_INCLUDE_FILES (inttypes.h HAVE_INTTYPES_H)
CHECK_INCLUDE_FILES (limits.h HAVE_LIMITS_H)
CHECK_INCLUDE_FILES (malloc.h HAVE_MALLOC_H)
CHECK_INCLUDE_FILES (memory.h HAVE_MEMORY_H)
CHECK_INCLUDE_FILES (netdb.h HAVE_NETDB_H)
CHECK_INCLUDE_FILES (netinet/in.h HAVE_NETINET_IN_H)
CHECK_INCLUDE_FILES (netinet/tcp.h HAVE_NETINET_TCP_H)
CHECK_INCLUDE_FILES (net/if.h HAVE_NET_IF_H)
CHECK_INCLUDE_FILES (signal.h HAVE_SIGNAL_H)
CHECK_INCLUDE_FILES (socket.h HAVE_SOCKET_H)
CHECK_INCLUDE_FILES (stdbool.h HAVE_STDBOOL_H)
CHECK_INCLUDE_FILES (stdint.h HAVE_STDINT_H)
CHECK_INCLUDE_FILES (stdlib.h HAVE_STDLIB_H)
CHECK_INCLUDE_FILES (strings.h HAVE_STRINGS_H)
CHECK_INCLUDE_FILES (string.h HAVE_STRING_H)
CHECK_INCLUDE_FILES (stropts.h HAVE_STROPTS_H)
CHECK_INCLUDE_FILES (sys/ioctl.h HAVE_SYS_IOCTL_H)
CHECK_INCLUDE_FILES (sys/param.h HAVE_SYS_PARAM_H)
CHECK_INCLUDE_FILES (sys/select.h HAVE_SYS_SELECT_H)
CHECK_INCLUDE_FILES (sys/socket.h HAVE_SYS_SOCKET_H)
CHECK_INCLUDE_FILES (sys/stat.h HAVE_SYS_STAT_H)
CHECK_INCLUDE_FILES (sys/time.h HAVE_SYS_TIME_H)
CHECK_INCLUDE_FILES (sys/types.h HAVE_SYS_TYPES_H)
CHECK_INCLUDE_FILES (sys/uio.h HAVE_SYS_UIO_H)
CHECK_INCLUDE_FILES (time.h HAVE_TIME_H)
CHECK_INCLUDE_FILES (dlfcn.h HAVE_DLFCN_H)
CHECK_INCLUDE_FILES (unistd.h HAVE_UNISTD_H)
# Include order matters for these windows files.
CHECK_INCLUDE_FILES ("winsock2.h;windows.h" HAVE_WINSOCK2_H)
CHECK_INCLUDE_FILES ("winsock2.h;ws2tcpip.h;windows.h" HAVE_WS2TCPIP_H)
CHECK_INCLUDE_FILES ("winsock.h;windows.h" HAVE_WINSOCK_H)
CHECK_INCLUDE_FILES (windows.h HAVE_WINDOWS_H)
# Set system-specific compiler flags
IF (CMAKE_SYSTEM_NAME STREQUAL "Darwin")
LIST (APPEND SYSFLAGS -D_DARWIN_C_SOURCE)
ELSEIF (CMAKE_SYSTEM_NAME STREQUAL "Linux")
LIST (APPEND SYSFLAGS -D_GNU_SOURCE -D_POSIX_C_SOURCE=199309L -D_XOPEN_SOURCE=600)
ELSEIF (CMAKE_SYSTEM_NAME STREQUAL "SunOS")
LIST (APPEND SYSFLAGS -D__EXTENSIONS__ -D_REENTRANT -D_XOPEN_SOURCE=600)
ELSEIF (CMAKE_SYSTEM_NAME STREQUAL "AIX")
LIST (APPEND SYSFLAGS -D_ALL_SOURCE -D_XOPEN_SOURCE=600 -D_USE_IRS)
ELSEIF (CMAKE_SYSTEM_NAME STREQUAL "FreeBSD")
# Don't define _XOPEN_SOURCE on FreeBSD, it actually reduces visibility instead of increasing it
ELSEIF (WIN32)
LIST (APPEND SYSFLAGS -DWIN32_LEAN_AND_MEAN -D_CRT_SECURE_NO_DEPRECATE -D_CRT_NONSTDC_NO_DEPRECATE -D_WIN32_WINNT=0x0600)
ENDIF ()
ADD_DEFINITIONS(${SYSFLAGS})
# Tell C-Ares about libraries to depend on
IF (HAVE_LIBRESOLV)
LIST (APPEND CARES_DEPENDENT_LIBS resolv)
ENDIF ()
IF (HAVE_LIBNSL)
LIST (APPEND CARES_DEPENDENT_LIBS nsl)
ENDIF ()
IF (HAVE_LIBSOCKET)
LIST (APPEND CARES_DEPENDENT_LIBS socket)
ENDIF ()
IF (HAVE_LIBRT)
LIST (APPEND CARES_DEPENDENT_LIBS rt)
ENDIF ()
IF (WIN32)
LIST (APPEND CARES_DEPENDENT_LIBS ws2_32)
ENDIF ()
# When checking for symbols, we need to make sure we set the proper
# headers, libraries, and d
没有合适的资源?快使用搜索试试~ 我知道了~
资源推荐
资源详情
资源评论
收起资源包目录
exosip2-5.1windows源码编译及例子VS2019可用 (1570个子文件)
adig.1 2KB
ahost.1 2KB
osip.1 2KB
acountry.1 2KB
ares_init_options.3 9KB
ares_library_init_android.3 5KB
ares_library_init.3 5KB
ares_search.3 5KB
ares_getnameinfo.3 4KB
ares_query.3 4KB
ares_library_cleanup.3 4KB
ares_set_servers.3 4KB
ares_parse_txt_reply.3 3KB
ares_set_socket_functions.3 3KB
ares_send.3 3KB
ares_get_servers.3 3KB
ares_gethostbyname.3 3KB
ares_gethostbyaddr.3 3KB
ares_process.3 3KB
ares_create_query.3 3KB
ares_free_data.3 3KB
ares_mkquery.3 3KB
ares_save_options.3 3KB
ares_gethostbyname_file.3 3KB
ares_init.3 2KB
ares_parse_naptr_reply.3 2KB
ares_parse_a_reply.3 2KB
ares_parse_srv_reply.3 2KB
ares_set_servers_csv.3 2KB
ares_parse_aaaa_reply.3 2KB
ares_parse_ptr_reply.3 2KB
ares_parse_mx_reply.3 2KB
ares_parse_soa_reply.3 2KB
ares_expand_name.3 2KB
ares_getsock.3 2KB
ares_parse_ns_reply.3 2KB
ares_expand_string.3 2KB
ares_set_sortlist.3 2KB
ares_inet_ntop.3 2KB
ares_timeout.3 2KB
ares_fds.3 2KB
ares_inet_pton.3 2KB
ares_free_hostent.3 2KB
ares_cancel.3 2KB
ares_set_local_dev.3 2KB
ares_destroy.3 2KB
ares_dup.3 1KB
ares_version.3 1KB
ares_set_local_ip6.3 1KB
ares_strerror.3 1KB
ares_destroy_options.3 1KB
ares_set_local_ip4.3 1KB
ares_library_initialized.3 1KB
ares_set_socket_configure_callback.3 1KB
ares_free_string.3 1KB
ares_set_socket_callback.3 1KB
ares_set_servers_ports_csv.3 32B
ares_set_servers_ports.3 28B
ares_get_servers_ports.3 28B
configure.ac 22KB
configure.ac 11KB
configure.ac 10KB
configure.ac 493B
Makefile.am 7KB
Makefile.am 2KB
Makefile.am 1KB
Makefile.am 1KB
Makefile.am 1KB
Makefile.am 936B
Makefile.am 834B
Makefile.am 637B
Makefile.am 505B
Makefile.am 280B
Makefile.am 238B
Makefile.am 190B
Makefile.am 179B
Makefile.am 170B
Makefile.am 154B
Makefile.am 124B
Makefile.am 117B
Makefile.am 97B
Makefile.am 83B
Makefile.am 77B
Makefile.am 68B
Makefile.am 64B
Makefile.am 54B
Makefile.am 50B
Makefile.am 34B
Makefile.am 30B
Makefile.am 20B
Makefile.am 18B
AUTHORS 1KB
AUTHORS 232B
AUTHORS 40B
get_ver.awk 1KB
INSTALL.bsd 193B
BUGS 31B
buildconf 8KB
ares_platform.c 482KB
eXutils.c 131KB
共 1570 条
- 1
- 2
- 3
- 4
- 5
- 6
- 16
资源评论
- 摸鱼儿v2023-02-28#文字清晰 #即装即用 #内容与标题一致 #符合预期
Herb2
- 粉丝: 26
- 资源: 1
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
最新资源
- 采用P-f和Q-V滞控的去中心化逆变器型交流微电网的模拟(Simulink仿真实现)
- 彩虹聚合二级域名DNS管理系统源码v1.3
- 【TOF相机笔记3】Simulink使用方法
- 算法部署-基于C++和Python使用ONNXRuntime部署RT-DETR目标检测算法-附项目源码-优质项目实战.zip
- Bitree.cpp
- 改变浏览器大小,图片(img)内容居中显示
- 全景分割-基于FAIR-DETR对Cityscapes数据集进行微调实现全景分割-附项目源码-优质项目实战.zip
- Tru master.m4a
- 基于ELMAN神经网络的用气量预测,基于ELMAN的天然气消费量预测(代码完整,数据齐全)
- 基于Vue3+ThreeJS实现机械臂控制和预览+源码+开发文档+代码解析(高分优秀项目)
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功