mirror of
https://github.com/gbdev/rgbds.git
synced 2026-09-13 17:27:06 +00:00
Enable automatic generation of compile_flags.txt for clang-tidy via make tidy (#2008)
This commit is contained in:
@@ -11,6 +11,7 @@
|
|||||||
*.gcno
|
*.gcno
|
||||||
*.gcda
|
*.gcda
|
||||||
*.gcov
|
*.gcov
|
||||||
|
/compile_flags.txt
|
||||||
CMakeCache.txt
|
CMakeCache.txt
|
||||||
CMakeFiles/
|
CMakeFiles/
|
||||||
cmake_install.cmake
|
cmake_install.cmake
|
||||||
|
|||||||
@@ -33,11 +33,13 @@ WARNFLAGS := -Wall -pedantic -Wno-unknown-warning-option \
|
|||||||
# Overridable CXXFLAGS
|
# Overridable CXXFLAGS
|
||||||
CXXFLAGS ?= -O3 -flto -DNDEBUG
|
CXXFLAGS ?= -O3 -flto -DNDEBUG
|
||||||
# Non-overridable CXXFLAGS
|
# Non-overridable CXXFLAGS
|
||||||
REALCXXFLAGS := ${CXXFLAGS} ${WARNFLAGS} -std=c++20 -I include -fno-exceptions -fno-rtti
|
REQUIREDCXXFLAGS := -std=c++20 -I include -fno-exceptions -fno-rtti
|
||||||
|
REALCXXFLAGS := ${CXXFLAGS} ${WARNFLAGS} ${REQUIREDCXXFLAGS}
|
||||||
# Overridable LDFLAGS
|
# Overridable LDFLAGS
|
||||||
LDFLAGS ?=
|
LDFLAGS ?=
|
||||||
# Non-overridable LDFLAGS
|
# Non-overridable LDFLAGS
|
||||||
REALLDFLAGS := ${LDFLAGS} ${WARNFLAGS} -DBUILD_VERSION_STRING=\"${VERSION_STRING}\"
|
REQUIREDLDFLAGS := -DBUILD_VERSION_STRING=\"${VERSION_STRING}\"
|
||||||
|
REALLDFLAGS := ${LDFLAGS} ${WARNFLAGS} ${REQUIREDLDFLAGS}
|
||||||
|
|
||||||
# Wrapper around bison that passes flags depending on what the version supports
|
# Wrapper around bison that passes flags depending on what the version supports
|
||||||
BISON := src/bison.sh
|
BISON := src/bison.sh
|
||||||
@@ -250,8 +252,10 @@ format:
|
|||||||
|
|
||||||
# Target used in development to check code with clang-tidy.
|
# Target used in development to check code with clang-tidy.
|
||||||
# Requires Bison-generated header files to exist.
|
# Requires Bison-generated header files to exist.
|
||||||
tidy: src/asm/parser.hpp src/link/script.hpp
|
tidy: src/asm/parser.hpp src/link/script.hpp compile_flags.txt
|
||||||
$Qclang-tidy -p . $$(git ls-files '*.[hc]pp')
|
$Qclang-tidy -p . $$(git ls-files '*.[hc]pp')
|
||||||
|
compile_flags.txt:
|
||||||
|
$Qprintf '%s\n' ${REQUIREDCXXFLAGS} ${REQUIREDLDFLAGS} >$@
|
||||||
|
|
||||||
# Target used in development to remove unused `#include` headers.
|
# Target used in development to remove unused `#include` headers.
|
||||||
iwyu:
|
iwyu:
|
||||||
|
|||||||
@@ -1,6 +0,0 @@
|
|||||||
-std=c++20
|
|
||||||
-I
|
|
||||||
include
|
|
||||||
-fno-exceptions
|
|
||||||
-fno-rtti
|
|
||||||
-fno-caret-diagnostics
|
|
||||||
@@ -65,7 +65,6 @@ rgbds/
|
|||||||
├── .clang-tidy
|
├── .clang-tidy
|
||||||
├── CMakeLists.txt
|
├── CMakeLists.txt
|
||||||
├── CMakePresets.json
|
├── CMakePresets.json
|
||||||
├── compile_flags.txt
|
|
||||||
├── Dockerfile
|
├── Dockerfile
|
||||||
└── Makefile
|
└── Makefile
|
||||||
```
|
```
|
||||||
@@ -129,8 +128,6 @@ rgbds/
|
|||||||
Defines how to build RGBDS with CMake.
|
Defines how to build RGBDS with CMake.
|
||||||
- **`CMakePresets.json`:**
|
- **`CMakePresets.json`:**
|
||||||
Defines some [presets](https://cmake.org/cmake/help/latest/manual/cmake-presets.7.html) useful for working with our CMake.
|
Defines some [presets](https://cmake.org/cmake/help/latest/manual/cmake-presets.7.html) useful for working with our CMake.
|
||||||
- **`compile_flags.txt`:**
|
|
||||||
Compiler flags for `clang-tidy`.
|
|
||||||
- **`Dockerfile`:**
|
- **`Dockerfile`:**
|
||||||
Defines how to build RGBDS with Docker (which we do in CI to provide a [container image](https://github.com/gbdev/rgbds/pkgs/container/rgbds)).
|
Defines how to build RGBDS with Docker (which we do in CI to provide a [container image](https://github.com/gbdev/rgbds/pkgs/container/rgbds)).
|
||||||
- **`Makefile`:**
|
- **`Makefile`:**
|
||||||
|
|||||||
Reference in New Issue
Block a user