diff --git a/cmake/Conky.cmake b/cmake/Conky.cmake index f862cb50..d74b1ab9 100644 --- a/cmake/Conky.cmake +++ b/cmake/Conky.cmake @@ -1,5 +1,14 @@ # vim: ts=4 sw=4 noet ai cindent syntax=cmake +# Conky 2.x requires GCC 4.4 or newer +try_compile(GCC4_WORKS + ${CMAKE_CURRENT_BINARY_DIR} + ${CMAKE_MODULE_PATH}/gcc44test.cc +) +if(NOT GCC4_WORKS) + message(FATAL_ERROR "Conky 2.x requires GCC 4.4.0 or newer") +endif(NOT GCC4_WORKS) + # Set system vars if(CMAKE_SYSTEM_NAME MATCHES "Linux") set(OS_LINUX true) diff --git a/cmake/gcc44test.cc b/cmake/gcc44test.cc new file mode 100644 index 00000000..87994e5b --- /dev/null +++ b/cmake/gcc44test.cc @@ -0,0 +1,8 @@ +/* Test for GCC >= 4.4.0 */ +#define GCC_VERSION (__GNUC__ * 10000 \ + + __GNUC_MINOR__ * 100 \ + + __GNUC_PATCHLEVEL__) +#if GCC_VERSION < 40400 +#error "GCC 4.4.0 or newer required" +#endif +int main() { return 1; }