diff --git a/CMakeLists.txt b/CMakeLists.txt index c3a992f91..ad4157a88 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -205,8 +205,9 @@ endif() if(USING_GCC OR USING_CLANG) jerry_add_compile_flags(-std=c99 -pedantic) - # Turn off stack protector - jerry_add_compile_flags(-fno-builtin -fno-stack-protector) + if(JERRY_MATH) + jerry_add_compile_flags(-fno-builtin) + endif() jerry_add_compile_warnings(all extra format-nonliteral init-self conversion sign-conversion format-security missing-declarations shadow strict-prototypes undef old-style-definition) jerry_add_compile_flags(-Wno-stack-protector -Wno-attributes -Werror) endif() diff --git a/jerry-core/CMakeLists.txt b/jerry-core/CMakeLists.txt index 4d06a9b07..44cdba97d 100644 --- a/jerry-core/CMakeLists.txt +++ b/jerry-core/CMakeLists.txt @@ -714,7 +714,7 @@ if(JERRY_MATH) set(JERRY_CORE_PKGCONFIG_REQUIRES libjerry-math) else() if(USING_GCC OR USING_CLANG) - set(CMAKE_REQUIRED_FLAGS "-Wno-error=strict-prototypes") + set(CMAKE_REQUIRED_FLAGS "-Wno-error -Wno-error=strict-prototypes") endif() check_library_exists(m sin "" HAVE_M_LIB) if(HAVE_M_LIB)