diff --git a/cmake/check_c_compiler_uses_glibc.cmake b/cmake/check_c_compiler_uses_glibc.cmake index 46755bec..4cb9f346 100644 --- a/cmake/check_c_compiler_uses_glibc.cmake +++ b/cmake/check_c_compiler_uses_glibc.cmake @@ -21,16 +21,17 @@ function(check_c_compiler_uses_glibc result_variable) include(CheckCSourceCompiles) set(GLIBC_TEST_CODE [====[ - #include + #include + #if defined(__GLIBC__) int main() { - void * buffer[1]; - int size = sizeof(buffer) / sizeof(void *); - backtrace(&buffer, size); return 0; } + #else + #error + #endif ]====]) check_c_source_compiles("${GLIBC_TEST_CODE}" ${result_variable}) - set(${result_variable} ${result_variable} PARENT_SCOPE) + set(${result_variable} "${${result_variable}}" PARENT_SCOPE) endfunction()