Skip to content

Commit ee0e0d7

Browse files
committed
Remove a bunch of dead code
1 parent 9d6897b commit ee0e0d7

File tree

11 files changed

+11
-123
lines changed

11 files changed

+11
-123
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

.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/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: 3 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 {

src/arguments.cpp

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,8 @@
22
#include "build.hpp"
33
#include "cmake_generator.hpp"
44
#include "help.hpp"
5-
65
#include "fs.hpp"
7-
#include <exception>
8-
#include <iostream>
6+
97
#include <stdexcept>
108
#include <string>
119
#include <vector>

src/build.cpp

Lines changed: 4 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,10 @@
11
#include "build.hpp"
22
#include "cmake_generator.hpp"
3-
#include "error.hpp"
43
#include "project_parser.hpp"
54

65
#include "fs.hpp"
7-
#include <cstddef>
86
#include <cstdlib>
97
#include <sstream>
10-
#include <stdexcept>
11-
#include <system_error>
128

139
namespace cmkr {
1410
namespace build {
@@ -17,7 +13,7 @@ int run(int argc, char **argv) {
1713
parser::Project project(nullptr, ".", true);
1814
if (argc > 2) {
1915
for (int i = 2; i < argc; ++i) {
20-
project.build_args.push_back(argv[i]);
16+
project.build_args.emplace_back(argv[i]);
2117
}
2218
}
2319
std::stringstream ss;
@@ -48,13 +44,13 @@ int run(int argc, char **argv) {
4844
}
4945

5046
int clean() {
51-
bool ret = false;
47+
bool success = false;
5248
parser::Project project(nullptr, ".", true);
5349
if (fs::exists(project.build_dir)) {
54-
ret = fs::remove_all(project.build_dir);
50+
success = fs::remove_all(project.build_dir);
5551
fs::create_directory(project.build_dir);
5652
}
57-
return !ret;
53+
return success ? EXIT_SUCCESS : EXIT_FAILURE;
5854
}
5955

6056
int install() {
@@ -64,33 +60,3 @@ int install() {
6460
}
6561
} // namespace build
6662
} // namespace cmkr
67-
68-
int cmkr_build_run(int argc, char **argv) {
69-
try {
70-
return cmkr::build::run(argc, argv);
71-
} catch (const std::system_error &e) {
72-
return e.code().value();
73-
} catch (...) {
74-
return cmkr::error::Status(cmkr::error::Status::Code::BuildError);
75-
}
76-
}
77-
78-
int cmkr_build_clean(void) {
79-
try {
80-
return cmkr::build::clean();
81-
} catch (const std::system_error &e) {
82-
return e.code().value();
83-
} catch (...) {
84-
return cmkr::error::Status(cmkr::error::Status::Code::CleanError);
85-
}
86-
}
87-
88-
int cmkr_build_install(void) {
89-
try {
90-
return cmkr::build::install();
91-
} catch (const std::system_error &e) {
92-
return e.code().value();
93-
} catch (...) {
94-
return cmkr::error::Status(cmkr::error::Status::Code::InstallError);
95-
}
96-
}

src/error.cpp

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

0 commit comments

Comments
 (0)