From 2924b90ea6ceea662410d42ed0c293c1cbbf4f45 Mon Sep 17 00:00:00 2001 From: Andreas Schneider Date: Tue, 13 Jan 2015 11:37:31 +0100 Subject: [PATCH] cmake: Fix ns_name_compress detection. On some platforms it is a macro and not a function. So we need to check if the macro exists. Signed-off-by: Andreas Schneider --- CMakeLists.txt | 4 +++- ConfigureChecks.cmake | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 3e7ae6a..6db0028 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -30,7 +30,6 @@ set(CMAKE_MODULE_PATH # add definitions include(DefineCMakeDefaults) include(DefinePlatformDefaults) -include(DefineCompilerFlags) include(DefineInstallationPaths) include(DefineOptions.cmake) include(CPackConfig.cmake) @@ -47,6 +46,9 @@ find_package(Threads) include(ConfigureChecks.cmake) configure_file(config.h.cmake ${CMAKE_CURRENT_BINARY_DIR}/config.h) +# Add compiler flags for the project now. +include(DefineCompilerFlags) + # check subdirectories add_subdirectory(src) diff --git a/ConfigureChecks.cmake b/ConfigureChecks.cmake index a68959f..be2f04c 100644 --- a/ConfigureChecks.cmake +++ b/ConfigureChecks.cmake @@ -94,7 +94,7 @@ check_function_exists(__res_search HAVE___RES_SEARCH) check_function_exists(res_nsearch HAVE_RES_NSEARCH) check_function_exists(__res_nsearch HAVE___RES_NSEARCH) -check_function_exists(ns_name_compress HAVE_NS_NAME_COMPRESS) +check_symbol_exists(ns_name_compress "sys/types.h;arpa/nameser.h" HAVE_NS_NAME_COMPRESS) if (UNIX) if (NOT LINUX) -- 2.34.1