Skip to content

Commit 0e362f6

Browse files
LeonidVasTotktonada
authored andcommitted
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 tarantool/small#25 Part of #59 @Totktonada: added the comment.
1 parent d168814 commit 0e362f6

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

CMakeLists.txt

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,13 @@ find_package(CyrusSASL)
1515
# include(cmake/FindTarantool.cmake)
1616
include_directories(${TARANTOOL_INCLUDE_DIRS})
1717

18-
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fPIC")
18+
# We should add -std=c99 before small library inclusion, because
19+
# the library does not enforce a C dialect, but unable to be built
20+
# with -std=gnu90 (which is default on GCC 4.8, which is shipped
21+
# with Ubuntu Trusty).
22+
#
23+
# See https://github.com/tarantool/small/issues/25
24+
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fPIC -std=c99")
1925

2026
find_program(GIT git)
2127
if (EXISTS "${CMAKE_SOURCE_DIR}/.git" AND GIT)

0 commit comments

Comments
 (0)