From 9b875a83e04a6618b67d7031bde0b268420d823e Mon Sep 17 00:00:00 2001
From: Dmitry Simonenko <pmwkaa@gmail.com>
Date: Thu, 11 Apr 2013 15:30:46 +0400
Subject: [PATCH] libgcc compiler check fix.

---
 CMakeLists.txt                    | 2 +-
 connector/c/tnt/CMakeLists.txt    | 2 +-
 connector/c/tntnet/CMakeLists.txt | 4 +++-
 connector/c/tntrpl/CMakeLists.txt | 4 +++-
 connector/c/tntsql/CMakeLists.txt | 4 +++-
 5 files changed, 11 insertions(+), 5 deletions(-)

diff --git a/CMakeLists.txt b/CMakeLists.txt
index 8e4c25efc3..149471af5c 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -190,7 +190,7 @@ endif()
 # usable on a system which has only gcc 4.1, statically link with
 # builtin libgcc by default.
 #
-if (CMAKE_COMPILER_IS_GNUCC and not CMAKE_COMPILER_IS_CLANG)
+if (CMAKE_COMPILER_IS_GNUCC AND NOT CMAKE_COMPILER_IS_CLANG)
     add_compile_flags("C;CXX;OBJC;OBJCXX" "-static-libgcc")
 endif()
 
diff --git a/connector/c/tnt/CMakeLists.txt b/connector/c/tnt/CMakeLists.txt
index cdae7dee71..657f203a4c 100644
--- a/connector/c/tnt/CMakeLists.txt
+++ b/connector/c/tnt/CMakeLists.txt
@@ -47,7 +47,7 @@ set (tnt_sources
 string(REPLACE "-static-libgcc" "" CMAKE_C_FLAGS "${CMAKE_C_FLAGS}")
 string(REPLACE "-static" "" CMAKE_C_FLAGS "${CMAKE_C_FLAGS}")
 
-if (CMAKE_COMPILER_IS_GNUCC and not CMAKE_COMPILER_IS_CLANG)
+if (CMAKE_COMPILER_IS_GNUCC AND NOT CMAKE_COMPILER_IS_CLANG)
     set (tnt_cflags "${tnt_cflags} -static-libgcc")
 endif()
 
diff --git a/connector/c/tntnet/CMakeLists.txt b/connector/c/tntnet/CMakeLists.txt
index 46e22f7813..18c2830d44 100644
--- a/connector/c/tntnet/CMakeLists.txt
+++ b/connector/c/tntnet/CMakeLists.txt
@@ -38,7 +38,9 @@ set (tntnet_sources
 string(REPLACE "-static-libgcc" "" CMAKE_C_FLAGS "${CMAKE_C_FLAGS}")
 string(REPLACE "-static" "" CMAKE_C_FLAGS "${CMAKE_C_FLAGS}")
 
-set (tnt_cflags "${tnt_cflags} -static-libgcc")
+if (CMAKE_COMPILER_IS_GNUCC AND NOT CMAKE_COMPILER_IS_CLANG)
+    set (tnt_cflags "${tnt_cflags} -static-libgcc")
+endif()
 
 #
 # Static library
diff --git a/connector/c/tntrpl/CMakeLists.txt b/connector/c/tntrpl/CMakeLists.txt
index 7dc2794ffd..42594df340 100644
--- a/connector/c/tntrpl/CMakeLists.txt
+++ b/connector/c/tntrpl/CMakeLists.txt
@@ -35,7 +35,9 @@ set (tntrpl_sources tnt_log.c tnt_dir.c tnt_xlog.c tnt_snapshot.c tnt_rpl.c
 string(REPLACE "-static-libgcc" "" CMAKE_C_FLAGS "${CMAKE_C_FLAGS}")
 string(REPLACE "-static" "" CMAKE_C_FLAGS "${CMAKE_C_FLAGS}")
 
-set (tnt_cflags "${tnt_cflags} -static-libgcc")
+if (CMAKE_COMPILER_IS_GNUCC AND NOT CMAKE_COMPILER_IS_CLANG)
+    set (tnt_cflags "${tnt_cflags} -static-libgcc")
+endif()
 
 #
 # Static library
diff --git a/connector/c/tntsql/CMakeLists.txt b/connector/c/tntsql/CMakeLists.txt
index 655e4e3c37..2ff74dd62e 100644
--- a/connector/c/tntsql/CMakeLists.txt
+++ b/connector/c/tntsql/CMakeLists.txt
@@ -37,7 +37,9 @@ set (tntsql_sources
 string(REPLACE "-static-libgcc" "" CMAKE_C_FLAGS "${CMAKE_C_FLAGS}")
 string(REPLACE "-static" "" CMAKE_C_FLAGS "${CMAKE_C_FLAGS}")
 
-set (tnt_cflags "${tnt_cflags} -static-libgcc")
+if (CMAKE_COMPILER_IS_GNUCC AND NOT CMAKE_COMPILER_IS_CLANG)
+    set (tnt_cflags "${tnt_cflags} -static-libgcc")
+endif()
 
 #
 # Static library
-- 
GitLab