build: enable Wundef

This commit is contained in:
Dmitrii Zarukin
2025-04-25 11:24:51 -07:00
committed by Dmitry Zarukin
parent a21297e5d3
commit 1c825b46bb
2 changed files with 6 additions and 0 deletions

View File

@ -53,6 +53,10 @@ endif()
# the macros to avoid code duplication and ensure consistency.
macro(platform_unix_and_mingw_common_ccxx_flags var)
append(${var} "-Wall -Wno-unknown-pragmas")
# TODO: remove Aarch64 limitation when ACL hits are resolved.
if(NOT DNNL_TARGET_ARCH STREQUAL "AARCH64")
append(${var} "-Wundef")
endif()
append_if(DNNL_WERROR ${var} "-Werror")
append(${var} "-fvisibility=internal")
endmacro()

View File

@ -6,6 +6,8 @@ if(WIN32 AND DNNL_WITH_SYCL)
append(CMAKE_CXX_FLAGS "-Wno-ignored-attributes")
endif()
string(REGEX REPLACE "-Wundef" "" CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}")
set(TARGET_NAME dnnl_gtest)
set(MAIN_SRC "src/gtest-all.cc")
source_group("" FILES ${MAIN_SRC})