From d72c80e112e7f053d15af8e9f605fdf21eb76fd1 Mon Sep 17 00:00:00 2001 From: King_DuckZ Date: Fri, 29 Sep 2017 20:26:06 +0100 Subject: [PATCH] Change the generated create_tables_query from c to cpp. --- cmake/binary_resource | 2 +- src/backends/postgresql/CMakeLists.txt | 5 ++-- .../postgresql/backend_postgresql_config.h.in | 23 +++++++++++++++++++ src/backends/postgresql/create_tables.cpp | 2 +- ...tables_query.h => create_tables_query.hpp} | 0 5 files changed, 28 insertions(+), 4 deletions(-) create mode 100644 src/backends/postgresql/backend_postgresql_config.h.in rename src/backends/postgresql/{create_tables_query.h => create_tables_query.hpp} (100%) diff --git a/cmake/binary_resource b/cmake/binary_resource index 38719ba..07053fc 160000 --- a/cmake/binary_resource +++ b/cmake/binary_resource @@ -1 +1 @@ -Subproject commit 38719ba8f513611232cd300ed4614c047391b956 +Subproject commit 07053fcc0bd6c5aa05e51f08ad3eae2e8d4befc8 diff --git a/src/backends/postgresql/CMakeLists.txt b/src/backends/postgresql/CMakeLists.txt index d2bffeb..45d12c6 100644 --- a/src/backends/postgresql/CMakeLists.txt +++ b/src/backends/postgresql/CMakeLists.txt @@ -1,4 +1,4 @@ -project(${bare_name}-backend-postgresql CXX C) +project(${bare_name}-backend-postgresql CXX) find_package(ZLIB) @@ -12,6 +12,7 @@ endif() make_binary_resource(${gzip} INPUT ${CMAKE_BINARY_DIR}/dindexer.sql ARRAY_NAME create_tables_query + EXTENSION .cpp ) add_library(${PROJECT_NAME} SHARED @@ -21,7 +22,7 @@ add_library(${PROJECT_NAME} SHARED scan.cpp navigate.cpp backend_postgresql.cpp - ${CMAKE_CURRENT_BINARY_DIR}/create_tables_query.c + ${CMAKE_CURRENT_BINARY_DIR}/create_tables_query.cpp create_tables.cpp ) diff --git a/src/backends/postgresql/backend_postgresql_config.h.in b/src/backends/postgresql/backend_postgresql_config.h.in new file mode 100644 index 0000000..436cc25 --- /dev/null +++ b/src/backends/postgresql/backend_postgresql_config.h.in @@ -0,0 +1,23 @@ +/* Copyright 2015, 2016, Michele Santullo + * This file is part of "dindexer". + * + * "dindexer" is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * "dindexer" is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with "dindexer". If not, see . + */ + +#ifndef id119764EBCC3345668A406E9A8FC1B6C7 +#define id119764EBCC3345668A406E9A8FC1B6C7 + +#cmakedefine ZLIB_FOUND + +#endif diff --git a/src/backends/postgresql/create_tables.cpp b/src/backends/postgresql/create_tables.cpp index 68cec41..067e19f 100644 --- a/src/backends/postgresql/create_tables.cpp +++ b/src/backends/postgresql/create_tables.cpp @@ -16,7 +16,7 @@ */ #include "create_tables.hpp" -#include "create_tables_query.h" +#include "create_tables_query.hpp" #include "pq/connection.hpp" #include "backend_postgresql_config.h" #if defined(ZLIB_FOUND) diff --git a/src/backends/postgresql/create_tables_query.h b/src/backends/postgresql/create_tables_query.hpp similarity index 100% rename from src/backends/postgresql/create_tables_query.h rename to src/backends/postgresql/create_tables_query.hpp