From 6852c5ad6b8d5a0873f4c11dffc31f8d78c84bf8 Mon Sep 17 00:00:00 2001 From: Leonid Vasiliev Date: Tue, 2 Jun 2020 12:12:30 +0300 Subject: [PATCH] small: fix small compilation If SMALL_EMBEDDED is used, "small" will try to compile with the default flags, but it can't be compiled with std=c89. Look like a "small" library bug. So, we will use std=c99 globally as workaround. See https://github.com/tarantool/small/issues/25 Part of #59 @Totktonada: added the comment. --- CMakeLists.txt | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 69fc55f..12fb5bb 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -15,7 +15,13 @@ find_package(CyrusSASL) # include(cmake/FindTarantool.cmake) include_directories(${TARANTOOL_INCLUDE_DIRS}) -set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fPIC") +# We should add -std=c99 before small library inclusion, because +# the library does not enforce a C dialect, but unable to be built +# with -std=gnu90 (which is default on GCC 4.8, which is shipped +# with Ubuntu Trusty). +# +# See https://github.com/tarantool/small/issues/25 +set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fPIC -std=c99") find_program(GIT git) if (EXISTS "${CMAKE_SOURCE_DIR}/.git" AND GIT)