Skip to content
Snippets Groups Projects
Unverified Commit c2e104c5 authored by Yaroslav Lobankov's avatar Yaroslav Lobankov
Browse files

build: fix static build error when compiling with Clang on Linux

This patch fixes the following error when building tarantool statically
with Clang compiler on a Linux system:

    error: argument unused during compilation: '-static-libstdc++'

Fixes #9646

NO_DOC=build issue
NO_TEST=build issue
NO_CHANGELOG=build issue

(cherry picked from commit 64afe49b)
parent 5fa2d0aa
No related branches found
No related tags found
No related merge requests found
......@@ -28,6 +28,7 @@ elseif(UNIX)
libgcc_s
libpthread
libsvace
libstdc++
)
else()
message(FATAL_ERROR "Unknown platform")
......
......@@ -167,10 +167,10 @@ endif()
option(ENABLE_BUNDLED_LIBUNWIND "Bundled libunwind will be built"
${ENABLE_BUNDLED_LIBUNWIND_DEFAULT})
# On macOS there is no '-static-libstdc++' flag and it's use will
# raise following error:
# error: argument unused during compilation: '-static-libstdc++'
if(BUILD_STATIC AND NOT TARGET_OS_DARWIN)
# In Clang there is no '-static-libstdc++' flag and its use will raise
# the following error:
# clang: error: argument unused during compilation: '-static-libstdc++'
if(BUILD_STATIC AND NOT CMAKE_CXX_COMPILER_ID STREQUAL "Clang")
# Static linking for c++ routines
add_compile_flags("C;CXX" "-static-libstdc++")
endif()
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment