Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

vcpkg port 1.8 fixes #1121

Merged
merged 23 commits into from
Jan 24, 2023
Merged
Show file tree
Hide file tree
Changes from 17 commits
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
80a30d9
Merge remote-tracking branch 'upstream/dev' into dev
trueqbit Jul 8, 2022
dae4287
Merge remote-tracking branch 'upstream/dev' into dev
trueqbit Jan 13, 2023
f776085
Corrected passing warning flags to msvc
trueqbit Jan 15, 2023
3154d24
Updated to Catch2 v3
trueqbit Jan 15, 2023
8e9625e
Fixed availability of chrono binding example
trueqbit Jan 15, 2023
5330ecd
Corrected appveyor vcpkg initialization
trueqbit Jan 15, 2023
a0acab7
Turned `type_is_nullable` into a specializable struct again
trueqbit Jan 16, 2023
b9bcc29
Fixed availability of pointer passing example
trueqbit Jan 16, 2023
3f1a03b
Disable vcpkg telemetry on appveyor builds
trueqbit Jan 16, 2023
0a20570
Correctly pin appveyor vcpkg test environment
trueqbit Jan 16, 2023
9532b82
Clang-formatted all files
trueqbit Jan 16, 2023
c21687b
Revert "removed PointerAlignment and changer DerivePointerAlignment t…
fnc12 Dec 9, 2020
5818dac
Applied new code formatting
trueqbit Jan 16, 2023
16720e3
Updated clang-format lint action
trueqbit Jan 16, 2023
b15409a
Updated Catch2 dependency handling
trueqbit Jan 16, 2023
848e54d
Remove dangling submodule path
trueqbit Jan 16, 2023
5ab4931
Corrected grammar in documentation for concepts
trueqbit Jan 16, 2023
1116c83
Another attempt to bootstrap vcpkg on windows
trueqbit Jan 23, 2023
5c369fb
Merge branch 'dev' into vcpkg-port-1.8-fixes
trueqbit Jan 23, 2023
2bdb84c
Another attempt to bootstrap vcpkg on windows
trueqbit Jan 23, 2023
9ed4f4c
Fixed stupid mistake in appveyor build path
trueqbit Jan 24, 2023
785868c
Try C++14 with Visual Studio 2022 instead of Visual Studio 2015 Update 3
trueqbit Jan 24, 2023
a4c4e6b
Runner-up: Conformance fallback for NSMDI
trueqbit Jan 24, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion .clang-format
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ ConstructorInitializerAllOnOneLineOrOnePerLine: false
ConstructorInitializerIndentWidth: 4
ContinuationIndentWidth: 4
Cpp11BracedListStyle: true
DerivePointerAlignment: true
DerivePointerAlignment: false
DisableFormat: false
ExperimentalAutoDetectBinPacking: false
FixNamespaceComments: false
Expand Down Expand Up @@ -94,6 +94,7 @@ PenaltyBreakString: 1000
PenaltyBreakTemplateDeclaration: 10
PenaltyExcessCharacter: 1000000
PenaltyReturnTypeOnItsOwnLine: 60
PointerAlignment: Left
ReflowComments: false
SortIncludes: false
SortUsingDeclarations: true
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/clang-format-lint.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,6 @@ jobs:
steps:
- uses: actions/checkout@v1
- name: clang-format lint
uses: DoozyX/clang-format-lint-action@v0.12
uses: DoozyX/clang-format-lint-action@v0.15
with:
clangFormatVersion: 12
clangFormatVersion: 15
25 changes: 17 additions & 8 deletions appveyor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -96,13 +96,18 @@ for:
if "%appveyor_build_worker_image%"=="Visual Studio 2015" (set generator="Visual Studio 14 2015" %architecture%)
install:
- |-
pushd C:\Tools\vcpkg
git fetch --tags && git checkout 2023.01.09
popd
C:\Tools\vcpkg\bootstrap-vcpkg.bat -disableMetrics
C:\Tools\vcpkg\vcpkg integrate install
vcpkg install sqlite3:%platform%-windows
set VCPKG_DEFAULT_TRIPLET=%platform%-windows
vcpkg install sqlite3 catch2
before_build:
- |-
mkdir compile
cd compile
cmake %SQLITE_ORM_CXX_STANDARD% -DSqliteOrm_BuildTests=ON .. -G %generator% -DCMAKE_TOOLCHAIN_FILE=C:/Tools/vcpkg/scripts/buildsystems/vcpkg.cmake
cmake %SQLITE_ORM_CXX_STANDARD% .. -G %generator% -DCMAKE_TOOLCHAIN_FILE=C:/Tools/vcpkg/scripts/buildsystems/vcpkg.cmake
# build examples, and run tests (ie make & make test)
build_script:
- |-
Expand All @@ -121,13 +126,17 @@ for:
# using custom vcpkg triplets for building and linking dynamic dependent libraries
install:
- |-
pushd $HOME/vcpkg
git fetch --tags && git checkout 2023.01.09
popd
$HOME/vcpkg/bootstrap-vcpkg.sh -disableMetrics
$HOME/vcpkg/vcpkg integrate install --overlay-triplets=vcpkg/triplets
vcpkg install sqlite3 --overlay-triplets=vcpkg/triplets
vcpkg install sqlite3 catch2 --overlay-triplets=vcpkg/triplets
before_build:
- |-
mkdir compile
cd compile
cmake $SQLITE_ORM_CXX_STANDARD -DSqliteOrm_BuildTests=ON .. -DCMAKE_TOOLCHAIN_FILE=$HOME/vcpkg/scripts/buildsystems/vcpkg.cmake
cmake $SQLITE_ORM_CXX_STANDARD .. -DCMAKE_TOOLCHAIN_FILE=$HOME/vcpkg/scripts/buildsystems/vcpkg.cmake
# build examples, and run tests (ie make & make test)
build_script:
- |-
Expand All @@ -145,15 +154,15 @@ for:
# using custom vcpkg triplets for building and linking dynamic dependent libraries
install:
- |-
git clone --depth 1 --branch 2022.05.10 https://github.com/microsoft/vcpkg.git $HOME/vcpkg
$HOME/vcpkg/booststrap.sh
git clone --depth 1 --branch 2023.01.09 https://github.com/microsoft/vcpkg.git $HOME/vcpkg
$HOME/vcpkg/bootstrap-vcpkg.sh -disableMetrics
$HOME/vcpkg/vcpkg integrate install --overlay-triplets=vcpkg/triplets
vcpkg install sqlite3 --overlay-triplets=vcpkg/triplets
vcpkg install sqlite3 catch2 --overlay-triplets=vcpkg/triplets
before_build:
- |-
mkdir compile
cd compile
cmake $SQLITE_ORM_CXX_STANDARD -DSqliteOrm_BuildTests=ON .. -DCMAKE_TOOLCHAIN_FILE=$HOME/vcpkg/scripts/buildsystems/vcpkg.cmake
cmake $SQLITE_ORM_CXX_STANDARD .. -DCMAKE_TOOLCHAIN_FILE=$HOME/vcpkg/scripts/buildsystems/vcpkg.cmake
# build examples, and run tests (ie make & make test)
build_script:
- |-
Expand Down
10 changes: 4 additions & 6 deletions dependencies/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,11 @@ include(FetchContent)

if(CMAKE_PROJECT_NAME STREQUAL PROJECT_NAME AND BUILD_TESTING)
FetchContent_Declare(
catch2
Catch2
GIT_REPOSITORY https://github.com/catchorg/Catch2.git
GIT_TAG v2.13.2
GIT_TAG v3.2.1
)
endif()

if(CMAKE_PROJECT_NAME STREQUAL PROJECT_NAME AND BUILD_TESTING)
add_subdirectory(catch2)
endif()
add_subdirectory(sqlite3)

add_subdirectory(sqlite3)
2 changes: 1 addition & 1 deletion dependencies/catch2/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
FetchContent_MakeAvailable(catch2)
FetchContent_MakeAvailable(Catch2)
2 changes: 1 addition & 1 deletion dependencies/sqlite3/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
# find_package exposes targets only globally, but caches them. So call find_package again in the directory of usage
find_package(SQLite3 REQUIRED)
find_package(SQLite3 REQUIRED)
22 changes: 11 additions & 11 deletions dev/arg_values.h
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ namespace sqlite_orm {

arg_value() : arg_value(nullptr) {}

arg_value(sqlite3_value *value_) : value(value_) {}
arg_value(sqlite3_value* value_) : value(value_) {}

template<class T>
T get() const {
Expand Down Expand Up @@ -47,18 +47,18 @@ namespace sqlite_orm {
}

private:
sqlite3_value *value = nullptr;
sqlite3_value* value = nullptr;
};

struct arg_values {

struct iterator {

iterator(const arg_values &container_, int index_) :
iterator(const arg_values& container_, int index_) :
container(container_), index(index_),
currentValue(index_ < int(container_.size()) ? container_[index_] : arg_value()) {}

iterator &operator++() {
iterator& operator++() {
++this->index;
if(this->index < int(this->container.size())) {
this->currentValue = this->container[this->index];
Expand Down Expand Up @@ -87,27 +87,27 @@ namespace sqlite_orm {
}
}

arg_value *operator->() const {
arg_value* operator->() const {
return &this->currentValue;
}

bool operator==(const iterator &other) const {
bool operator==(const iterator& other) const {
return &other.container == &this->container && other.index == this->index;
}

bool operator!=(const iterator &other) const {
bool operator!=(const iterator& other) const {
return !(*this == other);
}

private:
const arg_values &container;
const arg_values& container;
int index = 0;
mutable arg_value currentValue;
};

arg_values() : arg_values(0, nullptr) {}

arg_values(int argsCount_, sqlite3_value **values_) : argsCount(argsCount_), values(values_) {}
arg_values(int argsCount_, sqlite3_value** values_) : argsCount(argsCount_), values(values_) {}

size_t size() const {
return this->argsCount;
Expand All @@ -119,7 +119,7 @@ namespace sqlite_orm {

arg_value operator[](int index) const {
if(index < this->argsCount && index >= 0) {
sqlite3_value *value = this->values[index];
sqlite3_value* value = this->values[index];
return {value};
} else {
throw std::system_error{orm_error_code::index_is_out_of_bounds};
Expand All @@ -140,6 +140,6 @@ namespace sqlite_orm {

private:
int argsCount = 0;
sqlite3_value **values = nullptr;
sqlite3_value** values = nullptr;
};
}
10 changes: 5 additions & 5 deletions dev/function.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,13 +24,13 @@ namespace sqlite_orm {

struct user_defined_function_base {
using func_call = std::function<
void(sqlite3_context *context, void *functionPointer, int argsCount, sqlite3_value **values)>;
using final_call = std::function<void(sqlite3_context *context, void *functionPointer)>;
void(sqlite3_context* context, void* functionPointer, int argsCount, sqlite3_value** values)>;
using final_call = std::function<void(sqlite3_context* context, void* functionPointer)>;

std::string name;
int argumentsCount = 0;
std::function<int *()> create;
void (*destroy)(int *) = nullptr;
std::function<int*()> create;
void (*destroy)(int*) = nullptr;

#ifndef SQLITE_ORM_AGGREGATE_NSDMI_SUPPORTED
user_defined_function_base(decltype(name) name_,
Expand Down Expand Up @@ -162,7 +162,7 @@ namespace sqlite_orm {
constexpr bool is_same_pvt_v<I, PointerArg, nullptr_t, polyfill::void_t<typename PointerArg::tag>> = true;

#if __cplusplus >= 201703L // using C++17 or higher
template<size_t I, const char *PointerArg, const char *Binding>
template<size_t I, const char* PointerArg, const char* Binding>
SQLITE_ORM_CONSTEVAL bool assert_same_pointer_type() {
constexpr bool valid = Binding == PointerArg;
static_assert(valid, "Pointer value types of I-th argument do not match");
Expand Down
2 changes: 1 addition & 1 deletion dev/statement_serializer.h
Original file line number Diff line number Diff line change
Expand Up @@ -788,7 +788,7 @@ namespace sqlite_orm {
using statement_type = conflict_clause_t;

template<class Ctx>
std::string operator()(const statement_type& statement, const Ctx& context) const {
std::string operator()(const statement_type& statement, const Ctx&) const {
switch(statement) {
case conflict_clause_t::rollback:
return "ROLLBACK";
Expand Down
2 changes: 1 addition & 1 deletion dev/storage.h
Original file line number Diff line number Diff line change
Expand Up @@ -586,7 +586,7 @@ namespace sqlite_orm {
static_assert(is_preparable_v<self, Ex>, "Expression must be a high-level statement");

decltype(auto) e2 = static_if<is_select_v<Ex>>(
[](auto expression) -> auto {
[](auto expression) -> auto{
expression.highest_level = true;
return expression;
},
Expand Down
22 changes: 11 additions & 11 deletions dev/table_name_collector.h
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ namespace sqlite_orm {

struct table_name_collector {
using table_name_set = std::set<std::pair<std::string, std::string>>;
using find_table_name_t = std::function<std::string(const std::type_index &)>;
using find_table_name_t = std::function<std::string(const std::type_index&)>;

find_table_name_t find_table_name;
mutable table_name_set table_names;
Expand All @@ -27,7 +27,7 @@ namespace sqlite_orm {
table_name_collector(find_table_name_t find_table_name) : find_table_name{move(find_table_name)} {}

template<class T>
table_name_set operator()(const T &) const {
table_name_set operator()(const T&) const {
return {};
}

Expand All @@ -37,30 +37,30 @@ namespace sqlite_orm {
}

template<class T, class F>
void operator()(const column_pointer<T, F> &) const {
void operator()(const column_pointer<T, F>&) const {
table_names.emplace(this->find_table_name(typeid(T)), "");
}

template<class T, class C>
void operator()(const alias_column_t<T, C> &a) const {
void operator()(const alias_column_t<T, C>& a) const {
(*this)(a.column, alias_extractor<T>::get());
}

template<class T>
void operator()(const count_asterisk_t<T> &) const {
void operator()(const count_asterisk_t<T>&) const {
auto tableName = this->find_table_name(typeid(T));
if(!tableName.empty()) {
table_names.emplace(move(tableName), "");
}
}

template<class T, satisfies_not<std::is_base_of, alias_tag, T> = true>
void operator()(const asterisk_t<T> &) const {
void operator()(const asterisk_t<T>&) const {
table_names.emplace(this->find_table_name(typeid(T)), "");
}

template<class T, satisfies<std::is_base_of, alias_tag, T> = true>
void operator()(const asterisk_t<T> &) const {
void operator()(const asterisk_t<T>&) const {
// note: not all alias classes have a nested A::type
static_assert(polyfill::is_detected_v<type_t, T>,
"alias<O> must have a nested alias<O>::type typename");
Expand All @@ -69,22 +69,22 @@ namespace sqlite_orm {
}

template<class T>
void operator()(const object_t<T> &) const {
void operator()(const object_t<T>&) const {
table_names.emplace(this->find_table_name(typeid(T)), "");
}

template<class T>
void operator()(const table_rowid_t<T> &) const {
void operator()(const table_rowid_t<T>&) const {
table_names.emplace(this->find_table_name(typeid(T)), "");
}

template<class T>
void operator()(const table_oid_t<T> &) const {
void operator()(const table_oid_t<T>&) const {
table_names.emplace(this->find_table_name(typeid(T)), "");
}

template<class T>
void operator()(const table__rowid_t<T> &) const {
void operator()(const table__rowid_t<T>&) const {
table_names.emplace(this->find_table_name(typeid(T)), "");
}
};
Expand Down
4 changes: 2 additions & 2 deletions dev/transaction_guard.h
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ namespace sqlite_orm {
connection(std::move(connection_)),
commit_func(move(commit_func_)), rollback_func(move(rollback_func_)) {}

transaction_guard_t(transaction_guard_t &&other) :
transaction_guard_t(transaction_guard_t&& other) :
commit_on_destroy(other.commit_on_destroy), connection(std::move(other.connection)),
commit_func(move(other.commit_func)), rollback_func(move(other.rollback_func)),
gotta_fire(other.gotta_fire) {
Expand All @@ -48,7 +48,7 @@ namespace sqlite_orm {
}
}

transaction_guard_t &operator=(transaction_guard_t &&) = delete;
transaction_guard_t& operator=(transaction_guard_t&&) = delete;

/**
* Call `COMMIT` explicitly. After this call
Expand Down
6 changes: 3 additions & 3 deletions dev/triggers.h
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ namespace sqlite_orm {
partial_trigger_t(T trigger_base, S... statements) :
base{std::move(trigger_base)}, statements{std::make_tuple<S...>(std::forward<S>(statements)...)} {}

partial_trigger_t &end() {
partial_trigger_t& end() {
return *this;
}
};
Expand Down Expand Up @@ -109,7 +109,7 @@ namespace sqlite_orm {

trigger_base_t(trigger_type_base type_base_) : type_base(std::move(type_base_)) {}

trigger_base_t &for_each_row() {
trigger_base_t& for_each_row() {
this->do_for_each_row = true;
return *this;
}
Expand Down Expand Up @@ -270,7 +270,7 @@ namespace sqlite_orm {
}

template<class T, class... S>
internal::trigger_t<T, S...> make_trigger(std::string name, const internal::partial_trigger_t<T, S...> &part) {
internal::trigger_t<T, S...> make_trigger(std::string name, const internal::partial_trigger_t<T, S...>& part) {
SQLITE_ORM_CLANG_SUPPRESS_MISSING_BRACES(return {move(name), std::move(part.base), std::move(part.statements)});
}

Expand Down
Loading