Skip to content

Commit 240fafc

Browse files
authored
Merge pull request #101 from build-cpp/minor-cleanup
Cleanup
2 parents ee7fe38 + 7a7ddf2 commit 240fafc

File tree

27 files changed

+109
-168
lines changed

27 files changed

+109
-168
lines changed

.clang-format

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ PenaltyExcessCharacter: 1000000
7272
PenaltyReturnTypeOnItsOwnLine: 60
7373
PointerAlignment: Right
7474
ReflowComments: true
75-
SortIncludes: true
75+
SortIncludes: false
7676
SortUsingDeclarations: true
7777
SpaceAfterCStyleCast: false
7878
SpaceAfterTemplateKeyword: true

.github/workflows/build.yml

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,13 +10,20 @@ jobs:
1010
strategy:
1111
fail-fast: false
1212
matrix:
13-
os: [windows-2019, macos-10.15, ubuntu-20.04]
13+
os: [windows-2022, macos-11, ubuntu-20.04]
1414
env:
15-
BUILD_TYPE: Release
15+
BUILD_TYPE: 'Release'
16+
CMAKE_GENERATOR: 'Ninja'
1617
steps:
1718
- name: Checkout
1819
uses: actions/checkout@v3
1920

21+
- name: Install Ninja
22+
uses: seanmiddleditch/gha-setup-ninja@6263846cf3c17009dfc81604efabae16044fc074 # master
23+
24+
- name: Visual Studio Development Environment
25+
uses: ilammy/msvc-dev-cmd@cec98b9d092141f74527d0afa6feb2af698cfe89 # v1.12.1
26+
2027
- name: Tag cmkr.cmake
2128
if: ${{ startsWith(github.ref, 'refs/tags/') }}
2229
run: cmake -P "cmake/replace_tag.cmake"

.github/workflows/lint.yml

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
name: lint
2+
3+
on: [push]
4+
5+
jobs:
6+
lint:
7+
runs-on: ubuntu-latest
8+
9+
steps:
10+
- name: Checkout
11+
uses: actions/checkout@v3
12+
13+
- name: clang-format
14+
id: clang-format
15+
uses: DoozyX/clang-format-lint-action@c3b2c943e924028b93a707a5b1b017976ab8d50c # v0.15
16+
with:
17+
exclude: './third_party'
18+
extensions: 'c,h,cpp,hpp'
19+
clangFormatVersion: 15
20+
style: file
21+
22+
- name: clang-format instructions
23+
if: ${{ failure() && steps.clang-format.outcome == 'failure' }}
24+
run: |
25+
# Instructions for fixing the formatting errors
26+
echo -e "\n\033[0;31mTo fix the formatting, run:\nclang-format -style=file -i \$(git ls-files \"*.c\" \"*.h\" \"*.cpp\" \"*.hpp\")\033[0m\n"
27+
exit 1

.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,4 +9,5 @@ build*/
99
.idea/
1010
cmake-build*/
1111
CMakeLists.txt.user
12-
.vscode/
12+
.vscode/
13+
.DS_Store

CMakeLists.txt

Lines changed: 0 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

include/build.hpp

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,3 @@ int install();
1111

1212
} // namespace build
1313
} // namespace cmkr
14-
15-
int cmkr_build_run(int argc, char **argv);
16-
17-
int cmkr_build_clean();
18-
19-
int cmkr_build_install();

include/error.hpp

Lines changed: 0 additions & 27 deletions
This file was deleted.

include/fs.hpp

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
#pragma once
22

3-
#if ((defined(_MSVC_LANG) && _MSVC_LANG >= 201703L) || \
4-
(defined(__cplusplus) && __cplusplus >= 201703L)) && \
5-
defined(__has_include)
3+
#if ((defined(_MSVC_LANG) && _MSVC_LANG >= 201703L) || (defined(__cplusplus) && __cplusplus >= 201703L)) && defined(__has_include)
64
#if __has_include(<filesystem>) && (!defined(__MAC_OS_X_VERSION_MIN_REQUIRED) || __MAC_OS_X_VERSION_MIN_REQUIRED >= 101500)
75
#define GHC_USE_STD_FS
86
#include <filesystem>

include/help.hpp

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,3 @@ const char *message() noexcept;
99

1010
} // namespace help
1111
} // namespace cmkr
12-
13-
const char *cmkr_help_version(void);
14-
15-
const char *cmkr_help_message(void);

include/project_parser.hpp

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
11
#pragma once
22

3-
#include <mpark/variant.hpp>
3+
#include <vector>
44
#include <string>
5+
6+
#include <mpark/variant.hpp>
57
#include <tsl/ordered_map.h>
68
#include <tsl/ordered_set.h>
7-
#include <vector>
89

910
namespace cmkr {
1011
namespace parser {
@@ -47,6 +48,10 @@ struct Vcpkg {
4748
};
4849

4950
std::vector<Package> packages;
51+
52+
bool enabled() const {
53+
return !packages.empty();
54+
}
5055
};
5156

5257
enum TargetType {

0 commit comments

Comments
 (0)