Skip to content

Commit e3f31b6

Browse files
committed
fix build
1 parent 2d7ded0 commit e3f31b6

File tree

5 files changed

+13
-59
lines changed

5 files changed

+13
-59
lines changed

.clang-tidy

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
Checks: >
2+
clang-analyzer-*,
3+
cppcoreguidelines-*,
4+
modernize-*,
5+
performance-*,
6+
readability-*
7+
WarningsAsErrors: '*'
8+
9+
HeaderFilterRegex: '^(?!.*(3rdparty|build)).*$'

format.sh

Lines changed: 1 addition & 58 deletions
Original file line numberDiff line numberDiff line change
@@ -249,63 +249,6 @@ else
249249
fi
250250
echo 'tile-lang clang-format: Done'
251251

252-
253-
# Check if clang-tidy is installed and get the version
254-
if command -v clang-tidy &>/dev/null; then
255-
CLANG_TIDY_VERSION=$(clang-tidy --version | head -n 1 | awk '{print $3}')
256-
tool_version_check "clang-tidy" "$CLANG_TIDY_VERSION" "$(grep clang-tidy requirements-dev.txt | cut -d'=' -f3)"
257-
else
258-
echo "clang-tidy not found. Skipping C++ static analysis."
259-
CLANG_TIDY_AVAILABLE=false
260-
fi
261-
262-
# Function to run clang-tidy
263-
clang_tidy() {
264-
clang-tidy "$@" -- -std=c++17
265-
}
266-
267-
# Run clang-tidy on all C/C++ files
268-
clang_tidy_all() {
269-
find . -type f \( -name '*.c' -o -name '*.cc' -o -name '*.cpp' -o -name '*.h' -o -name '*.hpp' \) \
270-
-not -path "./3rdparty/*" -not -path "./build/*" \
271-
| xargs -I{} clang-tidy -extra-arg-before=-xc++ {} -- -std=c++17
272-
}
273-
274-
# Run clang-tidy on changed C/C++ files relative to main
275-
clang_tidy_changed() {
276-
if git show-ref --verify --quiet refs/remotes/origin/main; then
277-
BASE_BRANCH="origin/main"
278-
else
279-
BASE_BRANCH="main"
280-
fi
281-
282-
MERGEBASE="$(git merge-base $BASE_BRANCH HEAD)"
283-
284-
if ! git diff --diff-filter=ACM --quiet --exit-code "$MERGEBASE" -- '*.c' '*.cc' '*.cpp' '*.h' '*.hpp' &>/dev/null; then
285-
git diff --name-only --diff-filter=ACM "$MERGEBASE" -- '*.c' '*.cc' '*.cpp' '*.h' '*.hpp' | xargs -I{} clang-tidy -extra-arg-before=-xc++ {} -- -std=c++17
286-
fi
287-
}
288-
289-
# Add clang-tidy support to the main script logic
290-
echo 'tile-lang clang-tidy: Check Start'
291-
292-
if [[ "$CLANG_TIDY_AVAILABLE" != false ]]; then
293-
if [[ "$1" == '--files' ]]; then
294-
# If --files is given, analyze only the provided files
295-
clang_tidy "${@:2}"
296-
elif [[ "$1" == '--all' ]]; then
297-
# If --all is given, analyze all eligible C/C++ files
298-
clang_tidy_all
299-
else
300-
# Otherwise, analyze only changed C/C++ files
301-
clang_tidy_changed
302-
fi
303-
else
304-
echo "clang-tidy is not available. Skipping static analysis."
305-
fi
306-
307-
echo 'tile-lang clang-tidy: Done'
308-
309252
# Check if there are any uncommitted changes after all formatting steps.
310253
# If there are, ask the user to review and stage them.
311254
if ! git diff --quiet &>/dev/null; then
@@ -326,4 +269,4 @@ if ! git diff --quiet &>/dev/null; then
326269
exit 1
327270
fi
328271

329-
echo 'tile-lang: All checks passed'
272+
echo 'tile-lang: All checks passed'

requirements-build.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
# Should be mirrored in pyproject.toml
2+
Cython
23
build
34
cmake>=3.26
45
packaging

requirements-test.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
# lint requirements
22
-r requirements-lint.txt
33
# build requirements
4+
Cython
45
cmake>=3.26
56
# runtime requirements
67
cffi

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -640,7 +640,7 @@ def build_cmake(self, ext):
640640
# -DCMAKE_LIBRARY_OUTPUT_DIRECTORY sets where built libraries go
641641
# -DPYTHON_EXECUTABLE ensures that the correct Python is used
642642
cmake_args = [
643-
f"-DCMAKE_LIBRARY_OUTPUT_DIRECTORY={extdir}", f"-DPYTHON_EXECUTABLE={sys.executable}",
643+
f"-DCMAKE_LIBRARY_OUTPUT_DIRECTORY={extdir}", f"-DPython_EXECUTABLE={sys.executable}",
644644
f"-DCMAKE_BUILD_TYPE={'Debug' if DEBUG_MODE else 'Release'}"
645645
]
646646

0 commit comments

Comments
 (0)