Skip to content

Commit

Permalink
small: fix small compilation
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
LeonidVas authored and Totktonada committed Jun 3, 2020
1 parent d168814 commit 0e362f6
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 0e362f6

Please sign in to comment.