From fac2f3fa5f9f421dec251c5dbb0fc60d2e55c0cf Mon Sep 17 00:00:00 2001 From: Tor Brede Vekterli Date: Mon, 18 Dec 2017 13:30:54 +0000 Subject: Make Flex and Bison outputs explicit in CMakeLists.txt Stating outputs in lexer and parser grammar files messes up the output directory and always places the outputs in the current working directory. This fixes #4435 --- document/src/vespa/document/select/CMakeLists.txt | 12 ++++++++---- document/src/vespa/document/select/grammar/lexer.ll | 4 ---- document/src/vespa/document/select/grammar/parser.yy | 3 --- 3 files changed, 8 insertions(+), 11 deletions(-) diff --git a/document/src/vespa/document/select/CMakeLists.txt b/document/src/vespa/document/select/CMakeLists.txt index 6dadd35e98a..bc73498622d 100644 --- a/document/src/vespa/document/select/CMakeLists.txt +++ b/document/src/vespa/document/select/CMakeLists.txt @@ -1,10 +1,14 @@ # Copyright 2017 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. -find_package(BISON REQUIRED) -find_package(FLEX REQUIRED) +find_package(BISON REQUIRED 3.0) +find_package(FLEX REQUIRED 2.5) -BISON_TARGET(DocSelParser grammar/parser.yy ${CMAKE_CURRENT_BINARY_DIR}/parser.cxx) -FLEX_TARGET(DocSelLexer grammar/lexer.ll ${CMAKE_CURRENT_BINARY_DIR}/lexer.cxx) +BISON_TARGET(DocSelParser grammar/parser.yy + ${CMAKE_CURRENT_BINARY_DIR}/parser.cxx + DEFINES_FILE ${CMAKE_CURRENT_BINARY_DIR}/parser.hxx) +FLEX_TARGET(DocSelLexer grammar/lexer.ll + ${CMAKE_CURRENT_BINARY_DIR}/lexer.cxx + DEFINES_FILE ${CMAKE_CURRENT_BINARY_DIR}/lexer.hxx) ADD_FLEX_BISON_DEPENDENCY(DocSelLexer DocSelParser) include_directories(${CMAKE_CURRENT_BINARY_DIR}) diff --git a/document/src/vespa/document/select/grammar/lexer.ll b/document/src/vespa/document/select/grammar/lexer.ll index 8cd5638c122..6483b5e8534 100644 --- a/document/src/vespa/document/select/grammar/lexer.ll +++ b/document/src/vespa/document/select/grammar/lexer.ll @@ -1,9 +1,5 @@ /* Copyright 2017 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. */ - /* We use the .*xx-suffix to denote a build-time generated file */ -%option outfile="lexer.cxx" -%option header-file="lexer.hxx" - %option c++ /* Uncomment to enable debug tracing of parsing */ /* %option debug */ diff --git a/document/src/vespa/document/select/grammar/parser.yy b/document/src/vespa/document/select/grammar/parser.yy index baf987355c9..f96bd50378f 100644 --- a/document/src/vespa/document/select/grammar/parser.yy +++ b/document/src/vespa/document/select/grammar/parser.yy @@ -1,8 +1,5 @@ /* Copyright 2017 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. */ -%output "parser.cxx" -%defines "parser.hxx" - /* Skeleton implementation included as part of the generated source. Note: _not_ covered by the GPL. */ %skeleton "lalr1.cc" -- cgit v1.2.3