Skip to content

Commit

Permalink
🐛 Fix clang-tidy detection (#19)
Browse files Browse the repository at this point in the history
* 📝 remove old disclaimer

* 🐛 Fix clang-tidy detection
  • Loading branch information
kammce authored Dec 7, 2024
1 parent 3c957ad commit 8d23c5d
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 18 deletions.
6 changes: 0 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -267,9 +267,3 @@ See [`CONTRIBUTING.md`](CONTRIBUTING.md) for details.
## License

Apache 2.0; see [`LICENSE`](LICENSE) for details.

## Disclaimer

This project is not an official Google project. It is not supported by
Google and Google specifically disclaims all warranties as to its quality,
merchantability, or fitness for a particular purpose.
20 changes: 9 additions & 11 deletions cmake/build.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -40,15 +40,16 @@ if(WIN32)
# Disable clang-tidy for Windows builds
set(CMAKE_CXX_CLANG_TIDY "")
else()
# Find clang-tidy-17
find_program(LIBHAL_CLANG_TIDY_PROGRAM NAMES "clang-tidy-17" DOC
"Path to clang-tidy executable")
# Find clang-tidy "clang-tidy"
find_program(LIBHAL_CLANG_TIDY_PROGRAM
NAMES "clang-tidy" "clang-tidy-17" "clang-tidy-18"
DOC "Path to clang-tidy executable")

if(NOT LIBHAL_CLANG_TIDY_PROGRAM)
message(STATUS "${LIBHAL_TITLE} clang-tidy not found.")
else()
# Set clang-tidy as a CXX language standard option
message(STATUS "${LIBHAL_TITLE} clang-tidy-17 AVAILABLE!")
message(STATUS "${LIBHAL_TITLE} clang-tidy AVAILABLE!")
set(LIBHAL_CLANG_TIDY_CONFIG_FILE
"${LIBHAL_SCRIPT_PATH}/clang-tidy.conf")
set(LIBHAL_CLANG_TIDY "${LIBHAL_CLANG_TIDY_PROGRAM}"
Expand Down Expand Up @@ -97,8 +98,7 @@ function(libhal_make_library)
-Wall
-Wextra
-Wshadow
-fexceptions
-fno-rtti)
$<$<COMPILE_LANGUAGE:CXX>:-fexceptions -fno-rtti>)
target_link_libraries(${LIBRARY_ARGS_LIBRARY_NAME} PUBLIC
${LIBRARY_ARGS_LINK_LIBRARIES})
install(TARGETS ${LIBRARY_ARGS_LIBRARY_NAME})
Expand Down Expand Up @@ -269,8 +269,7 @@ function(libhal_build_demos)
-Wall
-Wextra
-Wshadow
-fexceptions
-fno-rtti
$<$<COMPILE_LANGUAGE:CXX>:-fexceptions -fno-rtti>
)
target_link_libraries(startup_code PRIVATE
picolibc
Expand All @@ -294,8 +293,7 @@ function(libhal_build_demos)
-Wall
-Wextra
-Wshadow
-fexceptions
-fno-rtti
$<$<COMPILE_LANGUAGE:CXX>:-fexceptions -fno-rtti>
)
target_link_libraries(${elf} PRIVATE
startup_code
Expand All @@ -316,4 +314,4 @@ function(libhal_build_demos)
_libhal_add_clang_tidy_check(${elf})
endif()
endforeach()
endfunction()
endfunction()
2 changes: 1 addition & 1 deletion conanfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@

class libhal_cmake_util_conan(ConanFile):
name = "libhal-cmake-util"
version = "4.1.2"
version = "4.1.3"
license = "Apache-2.0"
homepage = "https://libhal.github.io/libhal-armcortex"
description = ("A collection of CMake scripts for ARM Cortex ")
Expand Down

0 comments on commit 8d23c5d

Please sign in to comment.