Skip to content

Commit 3df7141

Browse files
committed
get rid of check-rules
1 parent dfd12f3 commit 3df7141

3 files changed

Lines changed: 6 additions & 17 deletions

File tree

CMakeLists.txt

Lines changed: 4 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -151,6 +151,10 @@ add_custom_target("check"
151151
DEPENDS check-libcc2rs check-unit
152152
)
153153

154+
add_custom_target("check-all"
155+
DEPENDS check check-benchmarks
156+
)
157+
154158
set(RULES_IR_DIR "${CMAKE_BINARY_DIR}/rules")
155159

156160
file(GLOB rule_subdirs ${PROJECT_SOURCE_DIR}/rules/*)
@@ -201,14 +205,3 @@ add_custom_command(
201205

202206
add_custom_target("preprocess-rust-rules" ALL
203207
DEPENDS ${rust_rules_ir_outputs})
204-
205-
add_custom_target("check-rules"
206-
COMMAND ${CMAKE_COMMAND} -E rm -rf "${RULES_IR_DIR}"
207-
COMMAND ${CMAKE_COMMAND} --build ${CMAKE_BINARY_DIR} --target preprocess-cpp-rules
208-
COMMAND ${CMAKE_COMMAND} --build ${CMAKE_BINARY_DIR} --target preprocess-rust-rules
209-
WORKING_DIRECTORY ${PROJECT_SOURCE_DIR}
210-
)
211-
212-
add_custom_target("check-all"
213-
DEPENDS check-libcc2rs check-rules check-unit check-benchmarks
214-
)

README.md

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -133,9 +133,6 @@ ninja check-benchmarks
133133
# Check benchmark output without executing binaries
134134
SKIP_RUN=1 ninja check-benchmarks
135135

136-
# Regenerate and check if the IR for the rules changed
137-
ninja check-rules
138-
139136
# Regenerate expected output for unit tests after intentional changes
140137
REPLACE_EXPECTED=1 ninja check-unit
141138
```

cpp2rust/cpp2rust.cpp

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -103,9 +103,8 @@ static bool HasIRFiles(const fs::path &dir) {
103103
}
104104

105105
static bool ResolveRulesDir() {
106-
std::array<fs::path, 3> candidates = {fs::path("./rules"),
107-
fs::path("../rules"),
108-
GetExecutableDir() / "../rules"};
106+
std::array<fs::path, 2> candidates = {
107+
fs::path("./rules"), GetExecutableDir().parent_path() / "rules"};
109108

110109
for (const auto &dir : candidates) {
111110
if (fs::exists(dir) && fs::is_directory(dir) && HasIRFiles(dir)) {

0 commit comments

Comments
 (0)