Skip to content

Commit

Permalink
[7570] genquery2: change dirs of generated files and private headers,…
Browse files Browse the repository at this point in the history
… reduce scope of warning disable, touch-up cmake
  • Loading branch information
SwooshyCueb authored and korydraughn committed Apr 1, 2024
1 parent b719412 commit edd4b7a
Show file tree
Hide file tree
Showing 13 changed files with 29 additions and 45 deletions.
2 changes: 1 addition & 1 deletion server/api/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,7 @@ target_include_directories(
"$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>"
"$<BUILD_INTERFACE:${CMAKE_IRODS_SOURCE_DIR}/plugins/api/include>"
"$<BUILD_INTERFACE:${CMAKE_IRODS_SOURCE_DIR}/server/core/include>"
"$<BUILD_INTERFACE:${CMAKE_BINARY_DIR}/server/genquery2>" # For parser.hpp.
"$<BUILD_INTERFACE:${CMAKE_IRODS_BINARY_DIR}/server/genquery2/dsl>" # For parser.hpp.
"$<BUILD_INTERFACE:${CMAKE_IRODS_SOURCE_DIR}/server/genquery2/include>"
"$<BUILD_INTERFACE:${CMAKE_IRODS_SOURCE_DIR}/lib/administration/user/include>"
"$<BUILD_INTERFACE:${CMAKE_IRODS_SOURCE_DIR}/lib/administration/zone/include>"
Expand Down
8 changes: 2 additions & 6 deletions server/api/src/rs_genquery2.cpp
Original file line number Diff line number Diff line change
@@ -1,11 +1,7 @@
#include "irods/rs_genquery2.hpp"

#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Woverloaded-virtual"
#include "irods/genquery2_driver.hpp"
#pragma clang diagnostic pop

#include "irods/genquery2_sql.hpp"
#include "irods/private/genquery2_driver.hpp"
#include "irods/private/genquery2_sql.hpp"

#include "irods/apiHandler.hpp"
#include "irods/catalog_utilities.hpp"
Expand Down
41 changes: 13 additions & 28 deletions server/genquery2/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,13 @@ find_package(BISON 3.0.4 REQUIRED)
set(IRODS_FLEX_LEXER_NAME irods_lexer)
set(IRODS_BISON_PARSER_NAME irods_parser)

FLEX_TARGET(${IRODS_FLEX_LEXER_NAME} dsl/lexer.l ${CMAKE_CURRENT_BINARY_DIR}/lexer.cpp)
BISON_TARGET(${IRODS_BISON_PARSER_NAME} dsl/parser.y ${CMAKE_CURRENT_BINARY_DIR}/parser.cpp)
# Normally, we would do this at build-time, but FLEX_TARGET and BISON_TARGET don't actually define targets,
# therefore there's no good mechanism to add a dependency to the flex and bison targets.
# The source file property OBJECT_DEPENDS is *supposed* to work for this, but doesn't.
file(MAKE_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/dsl")

FLEX_TARGET(${IRODS_FLEX_LEXER_NAME} "${CMAKE_CURRENT_SOURCE_DIR}/dsl/lexer.l" "${CMAKE_CURRENT_BINARY_DIR}/dsl/lexer.cpp")
BISON_TARGET(${IRODS_BISON_PARSER_NAME} "${CMAKE_CURRENT_SOURCE_DIR}/dsl/parser.y" "${CMAKE_CURRENT_BINARY_DIR}/dsl/parser.cpp")
ADD_FLEX_BISON_DEPENDENCY(${IRODS_FLEX_LEXER_NAME} ${IRODS_BISON_PARSER_NAME})

set(IRODS_PARSER_NAME irods_genquery2_parser)
Expand All @@ -32,39 +37,19 @@ target_compile_definitions(
IRODS_ENABLE_SYSLOG
)

# Defined here since it's isolated to this specific target.
target_compile_options(
${IRODS_PARSER_NAME}
PRIVATE
"-Wno-overloaded-virtual"
)

target_include_directories(
${IRODS_PARSER_NAME}
PUBLIC
"$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>"
"$<BUILD_INTERFACE:${CMAKE_CURRENT_BINARY_DIR}/dsl>"
PRIVATE
${CMAKE_CURRENT_BINARY_DIR}
${CMAKE_CURRENT_SOURCE_DIR}/include
${IRODS_EXTERNALS_FULLPATH_BOOST}/include
"${IRODS_EXTERNALS_FULLPATH_BOOST}/include"
)

target_link_libraries(
${IRODS_PARSER_NAME}
PUBLIC
irods_common
nlohmann_json::nlohmann_json
fmt::fmt
)

if (${IRODS_VERSION} VERSION_GREATER "4.3.1")
target_link_libraries(
${IRODS_PARSER_NAME}
PRIVATE
irods_common
fmt::fmt
)
else()
target_include_directories(
${IRODS_PARSER_NAME}
PRIVATE
${IRODS_EXTERNALS_FULLPATH_FMT}/include
${IRODS_EXTERNALS_FULLPATH_SPDLOG}/include
)
endif()
2 changes: 1 addition & 1 deletion server/genquery2/dsl/lexer.l
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
%{
#include "irods/genquery2_driver.hpp"
#include "irods/private/genquery2_driver.hpp"

#include <fmt/format.h>

Expand Down
4 changes: 2 additions & 2 deletions server/genquery2/dsl/parser.y
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ This option causes make_* functions to be generated for each token kind.

/* Code to be included in the parser's implementation file. */
%code requires {
#include "irods/genquery2_ast_types.hpp"
#include "irods/private/genquery2_ast_types.hpp"

#include <string>
#include <vector>
Expand All @@ -58,7 +58,7 @@ This option causes make_* functions to be generated for each token kind.
}

%code {
#include "irods/genquery2_driver.hpp"
#include "irods/private/genquery2_driver.hpp"

auto yylex(irods::experimental::genquery2::driver&) -> yy::parser::symbol_type;
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
#ifndef IRODS_GENQUERY2_DRIVER_HPP
#define IRODS_GENQUERY2_DRIVER_HPP

#include "irods/genquery2_scanner.hpp"
#include "irods/genquery2_ast_types.hpp" // For irods::experimental::api::genquery2::select.
#include "irods/private/genquery2_scanner.hpp"
#include "irods/private/genquery2_ast_types.hpp" // For irods::experimental::api::genquery2::select.

#include "parser.hpp" // Generated by Bison.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,10 @@ namespace irods::experimental::genquery2
class scanner : public yyFlexLexer
{
public:
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Woverloaded-virtual"
auto yylex(driver& _driver) -> yy::parser::symbol_type;
#pragma clang diagnostic pop
}; // class scanner
} // namespace irods::experimental::genquery2

Expand Down
2 changes: 1 addition & 1 deletion server/genquery2/src/genquery2_driver.cpp
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#include "irods/genquery2_driver.hpp"
#include "irods/private/genquery2_driver.hpp"

#include <sstream>

Expand Down
8 changes: 4 additions & 4 deletions server/genquery2/src/genquery2_sql.cpp
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
#include "irods/genquery2_sql.hpp"
#include "irods/private/genquery2_sql.hpp"

#include "irods/genquery2_ast_types.hpp"
#include "irods/vertex_property.hpp"
#include "irods/edge_property.hpp"
#include "irods/private/genquery2_ast_types.hpp"
#include "irods/private/vertex_property.hpp"
#include "irods/private/edge_property.hpp"
#include "irods/genquery2_table_column_mappings.hpp"

#include "irods/irods_at_scope_exit.hpp"
Expand Down

0 comments on commit edd4b7a

Please sign in to comment.