Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
7 changes: 3 additions & 4 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,9 @@ jobs:
os:
- windows-2022
- ubuntu-22.04
- macos-13
# - macos-14
- macos-14
compiler:
- llvm
- llvm-19
- gcc
vcvarsall:
- true
Expand Down Expand Up @@ -63,7 +62,7 @@ jobs:
cmake: true
ninja: true
vcpkg: true
conan: 2.6.0
conan: true
cppcheck: true
cmakelang: true
clang-tidy: true
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ include(${_project_options_SOURCE_DIR}/Index.cmake)
# install vcpkg dependencies: - should be called before defining project()
run_vcpkg(
VCPKG_URL "https://github.com/microsoft/vcpkg.git"
VCPKG_REV "86a181505ac6460f98496a79abdee6a0f49905ec"
VCPKG_REV "0cb95c860ea83aafc1b24350510b30dec535989a"
)
# Install conan dependencies: - should be called before defining project()
run_conan()
Expand Down
1 change: 1 addition & 0 deletions cspell.config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ allowCompoundWords: true
enableGlobDot: true
words:
- aarch
- cmakelang
- aminya
- Amnet
- anotherproj
Expand Down
2 changes: 1 addition & 1 deletion docs/src/project_options_example.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ include(${_project_options_SOURCE_DIR}/Index.cmake)
# install vcpkg dependencies: - should be called before defining project()
run_vcpkg(
VCPKG_URL "https://github.com/microsoft/vcpkg.git"
VCPKG_REV "86a181505ac6460f98496a79abdee6a0f49905ec"
VCPKG_REV "0cb95c860ea83aafc1b24350510b30dec535989a"
)
# Install conan dependencies: - should be called before defining project()
run_conan()
Expand Down
5 changes: 5 additions & 0 deletions src/Index.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,11 @@ if(POLICY CMP0141)
cmake_policy(SET CMP0141 NEW)
endif()

if(CMAKE_VERSION VERSION_GREATER_EQUAL "3.31.0")
# normalize install directories
cmake_policy(SET CMP0177 NEW)
endif()

# only useable here
set(ProjectOptions_SRC_DIR "${CMAKE_CURRENT_LIST_DIR}")

Expand Down
2 changes: 1 addition & 1 deletion src/Vcpkg.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,7 @@ Or by specifying the options

run_vcpkg(
VCPKG_URL "https://github.com/microsoft/vcpkg.git"
VCPKG_REV "86a181505ac6460f98496a79abdee6a0f49905ec"
VCPKG_REV "0cb95c860ea83aafc1b24350510b30dec535989a"
ENABLE_VCPKG_UPDATE
)

Expand Down
4 changes: 2 additions & 2 deletions tests/emscripten/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,6 @@
#endif

int main() {
printf("hello, world!\n");
return 0;
printf("hello, world!\n");
return 0;
}
4 changes: 2 additions & 2 deletions tests/install/src/another_main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@
#include <mylib2/lib.hpp>

int main() {
some_fun2();
return some_fun2();
some_fun2();
return some_fun2();
}
2 changes: 1 addition & 1 deletion tests/install/vcpkg.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"$schema": "https://raw.githubusercontent.com/microsoft/vcpkg-tool/main/docs/vcpkg.schema.json",
"name": "another-project",
"version-string": "0.1.0",
"builtin-baseline": "86a181505ac6460f98496a79abdee6a0f49905ec",
"builtin-baseline": "0cb95c860ea83aafc1b24350510b30dec535989a",
"dependencies": [
{
"name": "eigen3",
Expand Down
4 changes: 2 additions & 2 deletions tests/minimal/main.cpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#include <fmt/core.h>

int main() {
fmt::print("Hello World!");
return 0;
fmt::print("Hello World!");
return 0;
}
2 changes: 1 addition & 1 deletion tests/myproj/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ if(ENABLE_CROSS_COMPILING)
endif()

run_vcpkg(VCPKG_URL "https://github.com/microsoft/vcpkg.git" VCPKG_REV
"86a181505ac6460f98496a79abdee6a0f49905ec" ENABLE_VCPKG_UPDATE
"0cb95c860ea83aafc1b24350510b30dec535989a" ENABLE_VCPKG_UPDATE
)
run_conan()

Expand Down
12 changes: 6 additions & 6 deletions tests/myproj/include/mylib/lib.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,13 @@
#include <cstring>

int some_fun() {
fmt::print("Hello from fmt{}", "!");
fmt::print("Hello from fmt{}", "!");

// populate an Eigen vector with the values
auto eigen_vec = Eigen::VectorXd::LinSpaced(10, 0, 1);
// populate an Eigen vector with the values
auto eigen_vec = Eigen::VectorXd::LinSpaced(10, 0, 1);

// print the vector
fmt::print("[{}]", fmt::join(eigen_vec, ", "));
// print the vector
fmt::print("[{}]", fmt::join(eigen_vec, ", "));

return 0;
return 0;
}
18 changes: 9 additions & 9 deletions tests/myproj/libs/mythirdpartylib/include/Foo.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,18 +8,18 @@
namespace mythirdpartylib {

class MYTHIRDPARTYLIB_EXPORT Foo {
public:
Foo() = default;
public:
Foo() = default;

/*implicit*/ Foo(int a) : m_a(a) {}
/*implicit*/ Foo(int a) : m_a(a) {}

int a() const { return m_a; }
int a() const { return m_a; }

void update(bool b, bool c, bool d);
void bad(std::vector<std::string> &v);
void update(bool b, bool c, bool d);
void bad(std::vector<std::string> &v);

private:
int m_a;
private:
int m_a;
};

}// namespace mythirdpartylib
} // namespace mythirdpartylib
20 changes: 10 additions & 10 deletions tests/myproj/libs/mythirdpartylib/src/Foo.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,22 +3,22 @@
namespace mythirdpartylib {

void Foo::update(bool b, bool c, bool d) {
int e = b + d;
m_a = e;
int e = b + d;
m_a = e;
}

void Foo::bad(std::vector<std::string> &v) {
std::string val = "hello";
int index = -1;// bad, plus should use gsl::index
for (int i = 0; i < v.size(); ++i) {
if (v[i] == val) {
index = i;
break;
}
std::string val = "hello";
int index = -1; // bad, plus should use gsl::index
for (int i = 0; i < v.size(); ++i) {
if (v[i] == val) {
index = i;
break;
}
}
}

static Foo foo(5);
static Foo bar = 42;

}// namespace mythirdpartylib
} // namespace mythirdpartylib
22 changes: 11 additions & 11 deletions tests/myproj/src/main/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,32 +4,32 @@
#include <fmt/ranges.h>

// test std libraries
#include <iostream>

Check warning on line 7 in tests/myproj/src/main/main.cpp

View workflow job for this annotation

GitHub Actions / Test (macos-14, gcc, true)

included header iostream is not used directly [misc-include-cleaner]
#include <string>

Check warning on line 8 in tests/myproj/src/main/main.cpp

View workflow job for this annotation

GitHub Actions / Test (macos-14, gcc, true)

included header string is not used directly [misc-include-cleaner]
#include <string_view>

Check warning on line 9 in tests/myproj/src/main/main.cpp

View workflow job for this annotation

GitHub Actions / Test (macos-14, gcc, true)

included header string_view is not used directly [misc-include-cleaner]

// test c libraries
#include <cassert>
#include <cctype>
#include <cstddef>
#include <cstdint>

Check warning on line 15 in tests/myproj/src/main/main.cpp

View workflow job for this annotation

GitHub Actions / Test (macos-14, gcc, true)

included header cstdint is not used directly [misc-include-cleaner]
#include <cstring>

int main() {
fmt::print("Hello from fmt{}", "!");
fmt::print("Hello from fmt{}", "!");

Check warning on line 19 in tests/myproj/src/main/main.cpp

View workflow job for this annotation

GitHub Actions / Test (macos-14, gcc, true)

no header providing "fmt::print" is directly included [misc-include-cleaner]

Eigen::VectorXd eigen_vec = Eigen::Vector3d(1, 2, 3);
fmt::print("[{}]", fmt::join(eigen_vec, ", "));
Eigen::VectorXd eigen_vec = Eigen::Vector3d(1, 2, 3);

Check warning on line 21 in tests/myproj/src/main/main.cpp

View workflow job for this annotation

GitHub Actions / Test (macos-14, gcc, true)

no header providing "Eigen::VectorXd" is directly included [misc-include-cleaner]
fmt::print("[{}]", fmt::join(eigen_vec, ", "));

Check warning on line 22 in tests/myproj/src/main/main.cpp

View workflow job for this annotation

GitHub Actions / Test (macos-14, gcc, true)

no header providing "fmt::print" is directly included [misc-include-cleaner]

#if !defined(__MINGW32__) && !defined(__MSYS__)// TODO fails
Eigen::VectorXd eigen_vec2 = Eigen::VectorXd::LinSpaced(10, 0, 1);
fmt::print("[{}]", fmt::join(eigen_vec2, ", "));
#if !defined(__MINGW32__) && !defined(__MSYS__) // TODO fails
Eigen::VectorXd eigen_vec2 = Eigen::VectorXd::LinSpaced(10, 0, 1);

Check warning on line 25 in tests/myproj/src/main/main.cpp

View workflow job for this annotation

GitHub Actions / Test (macos-14, gcc, true)

10 is a magic number; consider replacing it with a named constant [cppcoreguidelines-avoid-magic-numbers,readability-magic-numbers]
fmt::print("[{}]", fmt::join(eigen_vec2, ", "));
#endif

// trigger address sanitizer
// int *p = nullptr;
// *p = 1;
// trigger address sanitizer
// int *p = nullptr;
// *p = 1;

// trigger compiler warnings, clang-tidy, and cppcheck
int a;
// trigger compiler warnings, clang-tidy, and cppcheck
int a;

Check warning on line 34 in tests/myproj/src/main/main.cpp

View workflow job for this annotation

GitHub Actions / Test (macos-14, gcc, true)

variable 'a' is not initialized [cppcoreguidelines-init-variables]

Check warning on line 34 in tests/myproj/src/main/main.cpp

View workflow job for this annotation

GitHub Actions / Test (macos-14, gcc, true)

unused variable 'a' [clang-diagnostic-unused-variable]
}
14 changes: 7 additions & 7 deletions tests/myproj/src/mylib2/lib.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -16,15 +16,15 @@
#include <cstring>

int some_fun2() {
fmt::print("Hello from fmt{}", "!");
fmt::print("Hello from fmt{}", "!");

Eigen::VectorXd eigen_vec = Eigen::Vector3d(1, 2, 3);
fmt::print("[{}]", fmt::join(eigen_vec, ", "));
Eigen::VectorXd eigen_vec = Eigen::Vector3d(1, 2, 3);
fmt::print("[{}]", fmt::join(eigen_vec, ", "));

#if !defined(__MINGW32__) && !defined(__MSYS__)// TODO fails
Eigen::VectorXd eigen_vec2 = Eigen::VectorXd::LinSpaced(10, 0, 1);
fmt::print("[{}]", fmt::join(eigen_vec2, ", "));
#if !defined(__MINGW32__) && !defined(__MSYS__) // TODO fails
Eigen::VectorXd eigen_vec2 = Eigen::VectorXd::LinSpaced(10, 0, 1);
fmt::print("[{}]", fmt::join(eigen_vec2, ", "));
#endif

return 0;
return 0;
}
2 changes: 1 addition & 1 deletion tests/myproj/vcpkg.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"$schema": "https://raw.githubusercontent.com/microsoft/vcpkg-tool/main/docs/vcpkg.schema.json",
"name": "myproject",
"version-string": "0.1.0",
"builtin-baseline": "86a181505ac6460f98496a79abdee6a0f49905ec",
"builtin-baseline": "0cb95c860ea83aafc1b24350510b30dec535989a",
"dependencies": [
{
"name": "eigen3",
Expand Down
10 changes: 5 additions & 5 deletions tests/rpi3/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,11 @@ char uart_getc() { return 'a'; }
void uart_puts(char *s) {}

void main() {
uart_init();
uart_init();

uart_puts("Hello World!\n");
uart_puts("Hello World!\n");

while (1) {
uart_send(uart_getc());
}
while (1) {
uart_send(uart_getc());
}
}
4 changes: 2 additions & 2 deletions tests/rpi3/main.cpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#include <iostream>

int main() {
std::cout << "Hello World!";
return 0;
std::cout << "Hello World!";
return 0;
}
4 changes: 2 additions & 2 deletions tests/rpi4-vcpkg/main.cpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#include <fmt/core.h>

int main() {
fmt::print("Hello World!");
return 0;
fmt::print("Hello World!");
return 0;
}
4 changes: 2 additions & 2 deletions tests/rpi4/main.cpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#include <iostream>

int main() {
std::cout << "Hello World!";
return 0;
std::cout << "Hello World!";
return 0;
}
Loading