From 533f85785b3149c13a68658294a5ec3f24f02143 Mon Sep 17 00:00:00 2001 From: Guy Harris Date: Sun, 4 Jan 2015 16:31:49 -0800 Subject: Don't check for nl80211 stuff if we don't have libnl. While we're at it, do the checks in the same order that we do in autotools. Change-Id: Ie253cdeb740a5be4a5817ce4f7ed683aeea868c8 Reviewed-on: https://code.wireshark.org/review/6316 Reviewed-by: Guy Harris --- ConfigureChecks.cmake | 56 ++++++++++++++++++++++++++++----------------------- 1 file changed, 31 insertions(+), 25 deletions(-) (limited to 'ConfigureChecks.cmake') diff --git a/ConfigureChecks.cmake b/ConfigureChecks.cmake index 14eb495344..fcf3535d49 100644 --- a/ConfigureChecks.cmake +++ b/ConfigureChecks.cmake @@ -116,28 +116,34 @@ check_symbol_exists(tzname "time.h" HAVE_TZNAME) # Check for stuff that isn't testable via the tests above #include(CheckCSourceCompiles) -check_c_source_compiles( - "#include - int main() { - enum nl80211_commands x = NL80211_CMD_SET_CHANNEL; - }" - HAVE_NL80211_CMD_SET_CHANNEL -) -check_c_source_compiles( - "#include - int main() { - enum nl80211_protocol_features x = NL80211_PROTOCOL_FEATURE_SPLIT_WIPHY_DUMP; - }" - HAVE_NL80211_SPLIT_WIPHY_DUMP -) -check_c_source_compiles( - "#include - int main() { - int x = NL80211_FREQUENCY_ATTR_MAX_TX_POWER; - x = NL80211_ATTR_SUPPORTED_IFTYPES; - x = NL80211_ATTR_SUPPORTED_COMMANDS; - x = NL80211_ATTR_WIPHY_FREQ; - x = NL80211_CHAN_NO_HT; - }" - HAVE_NL80211 -) + +# +# *If* we found libnl, check if we can use nl80211 stuff with it. +# +if (NL_FOUND) + check_c_source_compiles( + "#include + int main() { + int x = NL80211_FREQUENCY_ATTR_MAX_TX_POWER; + x = NL80211_ATTR_SUPPORTED_IFTYPES; + x = NL80211_ATTR_SUPPORTED_COMMANDS; + x = NL80211_ATTR_WIPHY_FREQ; + x = NL80211_CHAN_NO_HT; + }" + HAVE_NL80211 + ) + check_c_source_compiles( + "#include + int main() { + enum nl80211_commands x = NL80211_CMD_SET_CHANNEL; + }" + HAVE_NL80211_CMD_SET_CHANNEL + ) + check_c_source_compiles( + "#include + int main() { + enum nl80211_protocol_features x = NL80211_PROTOCOL_FEATURE_SPLIT_WIPHY_DUMP; + }" + HAVE_NL80211_SPLIT_WIPHY_DUMP + ) +endif() -- cgit v1.2.1