2024-11-27 20:31:31 +01:00
|
|
|
if(MSVC)
|
|
|
|
|
set(COMPILE_WARN_OPTS "/W0")
|
2024-08-27 09:03:44 +02:00
|
|
|
else()
|
2024-11-27 20:31:31 +01:00
|
|
|
set(COMPILE_WARN_OPTS "-w")
|
2024-08-27 09:03:44 +02:00
|
|
|
endif()
|
|
|
|
|
set(COMPILE_WARN_OPTS "${COMPILE_WARN_OPTS}" CACHE STRING "cached value")
|
|
|
|
|
|
2024-11-27 20:31:31 +01:00
|
|
|
function(disable_warnings_for_directory dir)
|
|
|
|
|
if(CMAKE_VERSION VERSION_GREATER_EQUAL "3.19.0")
|
|
|
|
|
set_property(DIRECTORY "${dir}" PROPERTY COMPILE_OPTIONS ${COMPILE_WARN_OPTS})
|
|
|
|
|
endif()
|
2024-08-27 09:03:44 +02:00
|
|
|
|
2024-11-27 20:31:31 +01:00
|
|
|
file(MAKE_DIRECTORY "${dir}")
|
|
|
|
|
set(ctidy "${dir}/.clang-tidy")
|
|
|
|
|
file(WRITE ${ctidy} "Checks: '-*,misc-definitions-in-headers'\n")
|
|
|
|
|
file(APPEND ${ctidy} "CheckOptions:\n")
|
|
|
|
|
file(APPEND ${ctidy} "\t- { key: HeaderFileExtensions, value: \"x\" }\n")
|
2024-08-27 09:03:44 +02:00
|
|
|
endfunction()
|