Skip to content

Commit

Permalink
Changes
Browse files Browse the repository at this point in the history
- relax exception guarantees in Statement API;
- update error conditions.
  • Loading branch information
dmitigr committed Nov 25, 2022
1 parent 38a9f19 commit 674269d
Show file tree
Hide file tree
Showing 61 changed files with 1,045 additions and 906 deletions.
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,3 @@ cmake-build-*
_private
doxygen
Doxyfile
tool/cpplipa_*deps.sh
168 changes: 85 additions & 83 deletions CMakeLists.txt

Large diffs are not rendered by default.

16 changes: 8 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ Create `hello/CMakeLists.txt`:
```cmake
cmake_minimum_required(VERSION 3.16)
project(foo)
find_package(dmitigr_cpplipa REQUIRED COMPONENTS pgfe)
find_package(dmitigr_libs REQUIRED COMPONENTS pgfe)
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
add_executable(hello hello.cpp)
Expand All @@ -159,7 +159,7 @@ cmake --build .

### Advanced usage

For more details please, see [usage section][dmitigr_cpplipa_usage] for hints
For more details please, see [usage section][dmitigr_libs_usage] for hints
how to link Pgfe.

## Quick tutorial
Expand All @@ -185,7 +185,7 @@ auto make_options()
{
return Connection_options{}
.set(Communication_mode::net)
.set_net_hostname("localhost")
.set_hostname("localhost")
.set_database("db")
.set_username("user")
.set_password("password");
Expand Down Expand Up @@ -622,8 +622,8 @@ Pgfe is depends on the [libpq] library.

## CMake options

Since Pgfe is a C++ library subpackage of [Cpplipa][dmitigr_cpplipa], almost
all the [CMake options of Cpplipa][dmitigr_cpplipa_cmake_options] are applicable
Since Pgfe is a C++ library subpackage of [Igrilibs][dmitigr_libs], almost
all the [CMake options of Igrilibs][dmitigr_libs_cmake_options] are applicable
to Pgfe.

Please, pay attention to the following:
Expand All @@ -636,9 +636,9 @@ Please, pay attention to the following:
doesn't selects the build configuration within the generated build environment.
The [CMake] command line option `--config` should be used for that purpose.

[dmitigr_cpplipa]: https://github.com/dmitigr/cpplipa
[dmitigr_cpplipa_cmake_options]: https://github.com/dmitigr/cpplipa#cmake-options
[dmitigr_cpplipa_usage]: https://github.com/dmitigr/cpplipa.git#usage
[dmitigr_libs]: https://github.com/dmitigr/igrilibs
[dmitigr_libs_cmake_options]: https://github.com/dmitigr/igrilibs#cmake-options
[dmitigr_libs_usage]: https://github.com/dmitigr/igrilibs.git#usage
[dmitigr_pgfe]: https://github.com/dmitigr/pgfe.git

[PostgreSQL]: https://www.postgresql.org/
Expand Down
2 changes: 1 addition & 1 deletion cmake/dmitigr.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ function(dmitigr_append_cppfs libraries)
list(APPEND ${libraries} stdc++fs)
endif()
elseif(CMAKE_CXX_COMPILER_ID STREQUAL "Clang")
if (DMITIGR_CPPLIPA_CLANG_USE_LIBCPP)
if (DMITIGR_LIBS_CLANG_USE_LIBCPP)
if (CMAKE_CXX_COMPILER_VERSION VERSION_LESS "7")
list(APPEND ${libraries} c++experimental)
elseif(CMAKE_CXX_COMPILER_VERSION VERSION_LESS "9")
Expand Down
6 changes: 5 additions & 1 deletion cmake/dmitigr_base.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -18,15 +18,19 @@
# Info
# ------------------------------------------------------------------------------

dmitigr_cpplipa_set_library_info(base 0 0 0 "Base stuff")
dmitigr_libs_set_library_info(base 0 0 0 "Base stuff")

# ------------------------------------------------------------------------------
# Sources
# ------------------------------------------------------------------------------

set(dmitigr_base_headers
assert.hpp
endianness.hpp
enum_bitmask.hpp
err.hpp
errc.hpp
errctg.hpp
exceptions.hpp
ret.hpp
)
73 changes: 0 additions & 73 deletions cmake/dmitigr_cpplipa_libraries_all.cmake

This file was deleted.

2 changes: 1 addition & 1 deletion cmake/dmitigr_fs.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
# Info
# ------------------------------------------------------------------------------

dmitigr_cpplipa_set_library_info(fs 0 0 0 "Standard filesystem extensions")
dmitigr_libs_set_library_info(fs 0 0 0 "Standard filesystem extensions")

# ------------------------------------------------------------------------------
# Sources
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,10 @@
# See the License for the specific language governing permissions and
# limitations under the License.

function(dmitigr_cpplipa_load_with_deps component)
function(dmitigr_libs_load_with_deps component)
# Loading the component's dependencies
foreach(dep ${dmitigr_cpplipa_${component}_deps})
dmitigr_cpplipa_load_with_deps(${dep})
foreach(dep ${dmitigr_libs_${component}_deps})
dmitigr_libs_load_with_deps(${dep})
endforeach()

# Loading the component
Expand All @@ -42,13 +42,13 @@ endfunction()

# ------------------------------------------------------------------------------

include(${CMAKE_CURRENT_LIST_DIR}/dmitigr_cpplipa_libraries.cmake)
include(${CMAKE_CURRENT_LIST_DIR}/dmitigr_cpplipa_libraries_all.cmake)
include(${CMAKE_CURRENT_LIST_DIR}/dmitigr_libs.cmake)
include(${CMAKE_CURRENT_LIST_DIR}/dmitigr_libs_package.cmake)

if(NOT dmitigr_cpplipa_FIND_COMPONENTS)
set(dmitigr_cpplipa_FIND_COMPONENTS ${dmitigr_cpplipa_libraries})
if(NOT dmitigr_libs_FIND_COMPONENTS)
set(dmitigr_libs_FIND_COMPONENTS ${dmitigr_libs_package})
endif()

foreach(component ${dmitigr_cpplipa_FIND_COMPONENTS})
dmitigr_cpplipa_load_with_deps(${component})
foreach(component ${dmitigr_libs_FIND_COMPONENTS})
dmitigr_libs_load_with_deps(${component})
endforeach()
76 changes: 68 additions & 8 deletions cmake/dmitigr_cpplipa.cmake → cmake/dmitigr_libs.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -24,13 +24,73 @@
# dmitigr_${lib}_test_${test}_target_link_libraries
# dmitigr_${lib}_test_${test}_target_compile_definitions

include(${CMAKE_CURRENT_LIST_DIR}/dmitigr_cpplipa_libraries_all.cmake)
# ------------------------------------------------------------------------------
# Library list
# ------------------------------------------------------------------------------

set(dmitigr_libs
# Level 0 (base level)
base
# Level 1
algo dt fs hsh ipc math os que rnd str tpl util uv
# Level 2
log mulf net rajson sqlixx url
# Level 3
concur fcgi http jrpc msg pgfe prg ws wscl
# Level 4
lisp
# Level 5
web
)

# ------------------------------------------------------------------------------
# Dependency lists
# ------------------------------------------------------------------------------

# Third-parties
set(dmitigr_libs_3rdparty_uwebsockets_deps 3rdparty_usockets)

# Level 1
set(dmitigr_libs_algo_deps base)
set(dmitigr_libs_dt_deps base)
set(dmitigr_libs_fs_deps)
set(dmitigr_libs_hsh_deps)
set(dmitigr_libs_ipc_deps base)
set(dmitigr_libs_math_deps base)
set(dmitigr_libs_os_deps base)
set(dmitigr_libs_que_deps)
set(dmitigr_libs_rnd_deps base)
set(dmitigr_libs_str_deps base)
set(dmitigr_libs_tpl_deps base)
set(dmitigr_libs_util_deps base)
set(dmitigr_libs_uv_deps base)
# Level 2
set(dmitigr_libs_log_deps base fs os str)
set(dmitigr_libs_mulf_deps base str)
set(dmitigr_libs_net_deps base fs os)
set(dmitigr_libs_rajson_deps base fs 3rdparty_rapidjson)
set(dmitigr_libs_sqlixx_deps base fs)
set(dmitigr_libs_url_deps base str)
# Level 3
set(dmitigr_libs_concur_deps base log)
set(dmitigr_libs_fcgi_deps base fs math net)
set(dmitigr_libs_http_deps base dt net str)
set(dmitigr_libs_jrpc_deps base algo math rajson str)
set(dmitigr_libs_msg_deps base fs ipc os rajson sqlixx)
set(dmitigr_libs_pgfe_deps base fs net str util)
set(dmitigr_libs_prg_deps base fs log os rajson str)
set(dmitigr_libs_ws_deps base fs http net 3rdparty_uwebsockets)
set(dmitigr_libs_wscl_deps base net 3rdparty_uwsc)
# Level 4
set(dmitigr_libs_lisp_deps base)
# Level 5
set(dmitigr_libs_web_deps base concur fs http jrpc lisp log prg str tpl url ws)

# ------------------------------------------------------------------------------
# Source type list
# ------------------------------------------------------------------------------

set(dmitigr_cpplipa_source_types
set(dmitigr_libs_source_types
headers
build_only_sources
implementations
Expand All @@ -42,10 +102,10 @@ set(dmitigr_cpplipa_source_types
# Dependency related stuff
# ------------------------------------------------------------------------------

function(dmitigr_cpplipa_get_deps res_var lib)
foreach(dep ${dmitigr_cpplipa_${lib}_deps})
function(dmitigr_libs_get_deps res_var lib)
foreach(dep ${dmitigr_libs_${lib}_deps})
# Getting dependencies of dep
dmitigr_cpplipa_get_deps(dep_deps ${dep})
dmitigr_libs_get_deps(dep_deps ${dep})

# Adding dependencies of dep to the result
foreach(d ${dep_deps})
Expand All @@ -67,7 +127,7 @@ endfunction()
# Target compile options
# ------------------------------------------------------------------------------

function(dmitigr_cpplipa_target_compile_options t)
function(dmitigr_libs_target_compile_options t)
if (CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
target_compile_options(${t} PRIVATE
-pedantic
Expand Down Expand Up @@ -111,7 +171,7 @@ endfunction()

# ------------------------------------------------------------------------------

macro(dmitigr_cpplipa_set_library_info lib
macro(dmitigr_libs_set_library_info lib
version_major version_minor version_patch description)
if((${version_major} LESS 0)
OR (${version_minor} LESS 0) OR (${version_patch} LESS 0))
Expand Down Expand Up @@ -141,7 +201,7 @@ endmacro()

# ------------------------------------------------------------------------------

macro(dmitigr_cpplipa_set_library_info_lib_variables lib)
macro(dmitigr_libs_set_library_info_lib_variables lib)
set(dmitigr_lib_name ${dmitigr_${lib}_name})
set(dmitigr_lib_NAME ${dmitigr_${lib}_NAME})
set(dmitigr_lib_Name ${dmitigr_${lib}_Name})
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,4 @@
# See the License for the specific language governing permissions and
# limitations under the License.

set(dmitigr_cpplipa_libraries "@dmitigr_cpplipa_libraries@")
set(dmitigr_libs_package "base;fs;os;str;util;net;pgfe")
17 changes: 17 additions & 0 deletions cmake/dmitigr_libs_package.cmake.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# -*- cmake -*-
#
# Copyright 2022 Dmitry Igrishin
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

set(dmitigr_libs_package "@dmitigr_libs_package@")
4 changes: 2 additions & 2 deletions cmake/dmitigr_net.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
# Info
# ------------------------------------------------------------------------------

dmitigr_cpplipa_set_library_info(net 0 0 0 "Networking")
dmitigr_libs_set_library_info(net 0 0 0 "Networking")

# ------------------------------------------------------------------------------
# Sources
Expand Down Expand Up @@ -59,7 +59,7 @@ endif()
# Tests
# ------------------------------------------------------------------------------

if(DMITIGR_CPPLIPA_TESTS)
if(DMITIGR_LIBS_TESTS)
if(UNIX AND NOT CMAKE_SYSTEM_NAME MATCHES MSYS|MinGW|Cygwin)
set(dmitigr_net_tests net)
set(dmitigr_net_tests_target_link_libraries dmitigr_base)
Expand Down
2 changes: 1 addition & 1 deletion cmake/dmitigr_os.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
# Info
# ------------------------------------------------------------------------------

dmitigr_cpplipa_set_library_info(os 0 0 0 "OS basics")
dmitigr_libs_set_library_info(os 0 0 0 "OS basics")

# ------------------------------------------------------------------------------
# Sources
Expand Down
Loading

0 comments on commit 674269d

Please sign in to comment.