Skip to content

Commit dd02eb4

Browse files
author
Tor Didriksen
committed
Bug#35589020 Build failure for Visual Studio 2019 and Bison 3.8.2
Code generated by Bison 3.8.2 gives: warning c4102: 'yyexhtaustedlab': unreferenced label when building with Visual Studio 2019 Disable warning by adding option /wd4102 Also look up FLEX_EXECUTABLE, so we can verify that the "lock order" grammar builds OK. Change-Id: Ia511347628705da96749ba07d6183be2c6b239e5
1 parent 4fbdffa commit dd02eb4

File tree

2 files changed

+19
-0
lines changed

2 files changed

+19
-0
lines changed

cmake/bison.cmake

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,18 @@ IF(WIN32 AND NOT DEFINED BISON_EXECUTABLE)
9898
NO_DEFAULT_PATH
9999
PATHS ${NATIVE_BISON_PATHS}
100100
)
101+
# Look for Flex also, we may need it later.
102+
IF(BISON_EXECUTABLE)
103+
FIND_PROGRAM(FLEX_EXECUTABLE
104+
NAMES flex win-flex win_flex
105+
NO_DEFAULT_PATH
106+
PATHS ${NATIVE_BISON_PATHS}
107+
)
108+
FIND_PATH(FLEX_INCLUDE_DIR FlexLexer.h
109+
NO_DEFAULT_PATH
110+
PATHS ${NATIVE_BISON_PATHS}
111+
)
112+
ENDIF()
101113
ENDIF()
102114

103115
FIND_PACKAGE(BISON)

sql/CMakeLists.txt

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -889,6 +889,13 @@ IF(WIN32 AND NOT WIN32_CLANG)
889889
COMPILE_FLAGS "/d2OptimizeHugeFunctions")
890890
ENDIF()
891891

892+
# 'yyexhtaustedlab': unreferenced label
893+
IF(WIN32 AND NOT WIN32_CLANG)
894+
ADD_COMPILE_FLAGS(${CMAKE_CURRENT_BINARY_DIR}/sql_yacc.cc
895+
${CMAKE_CURRENT_BINARY_DIR}/sql_hints.yy.cc
896+
COMPILE_FLAGS "/wd4102")
897+
ENDIF()
898+
892899
# Common for all versions of GCC/Clang
893900
# Bison output uses undefined symbols in #if checks
894901
IF(MY_COMPILER_IS_GNU_OR_CLANG)

0 commit comments

Comments
 (0)