summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarko Mäkelä <marko.makela@mariadb.com>2022-10-10 09:36:43 +0300
committerMarko Mäkelä <marko.makela@mariadb.com>2022-10-10 09:36:43 +0300
commite05ab0cfc5f52c8c240bfc02239f199081d82f61 (patch)
tree0a485b5f93b09e157cb4c7deccf2c20b05bd9b31
parent56b97ca03ac19b5bf2d95494d861f49324008676 (diff)
downloadmariadb-git-e05ab0cfc5f52c8c240bfc02239f199081d82f61.tar.gz
Silence clang 13 -Wunused-but-set-variable for Bison
-rw-r--r--sql/CMakeLists.txt11
-rw-r--r--storage/innobase/CMakeLists.txt5
2 files changed, 14 insertions, 2 deletions
diff --git a/sql/CMakeLists.txt b/sql/CMakeLists.txt
index 58964fc0f80..d7ec42d6abb 100644
--- a/sql/CMakeLists.txt
+++ b/sql/CMakeLists.txt
@@ -1,5 +1,5 @@
# Copyright (c) 2006, 2014, Oracle and/or its affiliates.
-# Copyright (c) 2010, 2018, MariaDB Corporation
+# Copyright (c) 2010, 2022, MariaDB Corporation.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
@@ -145,7 +145,14 @@ SET (SQL_SOURCE
${CMAKE_CURRENT_BINARY_DIR}/lex_token.h
${MYSYS_LIBWRAP_SOURCE}
)
-
+
+IF(CMAKE_C_COMPILER_ID MATCHES "Clang" AND
+ NOT CMAKE_C_COMPILER_VERSION VERSION_LESS "13.0.0")
+ ADD_COMPILE_FLAGS(${CMAKE_CURRENT_BINARY_DIR}/sql_yacc.cc
+ ${CMAKE_CURRENT_BINARY_DIR}/sql_yacc_ora.cc
+ COMPILE_FLAGS "-Wno-unused-but-set-variable")
+ENDIF()
+
IF (CMAKE_SYSTEM_NAME MATCHES "Linux" OR
CMAKE_SYSTEM_NAME MATCHES "Windows" OR
CMAKE_SYSTEM_NAME MATCHES "SunOS" OR
diff --git a/storage/innobase/CMakeLists.txt b/storage/innobase/CMakeLists.txt
index bb6da42c51b..81b1acf8b9e 100644
--- a/storage/innobase/CMakeLists.txt
+++ b/storage/innobase/CMakeLists.txt
@@ -371,6 +371,11 @@ IF(MSVC)
# on generated file.
TARGET_COMPILE_OPTIONS(innobase PRIVATE "/wd4065")
ENDIF()
+IF(CMAKE_C_COMPILER_ID MATCHES "Clang" AND
+ NOT CMAKE_C_COMPILER_VERSION VERSION_LESS "13.0.0")
+ ADD_COMPILE_FLAGS(pars/pars0grm.cc fts/fts0pars.cc
+ COMPILE_FLAGS "-Wno-unused-but-set-variable")
+ENDIF()
IF(NOT (PLUGIN_INNOBASE STREQUAL DYNAMIC))
ADD_SUBDIRECTORY(${CMAKE_SOURCE_DIR}/extra/mariabackup ${CMAKE_BINARY_DIR}/extra/mariabackup)