Skip to content

Commit 2a5cd10

Browse files
committed
build: mark BTAS as SYSTEM include
GitLab CI (gcc-14, CUDA cell) failed compiling examples/demo with TA_WERROR=ON because btas/generic/converge_class.h trips -Wreturn-type on two non-void members lacking a return statement — upstream BTAS bug TA can't fix. Mirror the range-v3 carve-out: set INTERFACE_SYSTEM_INCLUDE_DIRECTORIES on the BTAS target so its headers are consumed via -isystem, taking them out of -Werror scope. Resolve through ALIASED_TARGET first so it works whether BTAS::BTAS is the imported target or an in-tree alias.
1 parent 971d407 commit 2a5cd10

1 file changed

Lines changed: 17 additions & 0 deletions

File tree

cmake/modules/FindOrFetchBTAS.cmake

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,3 +75,20 @@ endif(NOT TARGET BTAS::BTAS)
7575
if (NOT TARGET BTAS::BTAS)
7676
message(FATAL_ERROR "FindOrFetchBTAS could not make BTAS::BTAS target available")
7777
endif(NOT TARGET BTAS::BTAS)
78+
79+
# Treat BTAS headers as system: header-only library, no include-order
80+
# risk against TA's headers, and BTAS upstream trips warnings TA itself
81+
# can't fix (e.g. btas/generic/converge_class.h -Wreturn-type on gcc).
82+
# Carved out specifically here despite the top-level
83+
# CMAKE_NO_SYSTEM_FROM_IMPORTED=TRUE.
84+
get_target_property(_btas_aliased BTAS::BTAS ALIASED_TARGET)
85+
if (NOT _btas_aliased)
86+
set(_btas_aliased BTAS::BTAS)
87+
endif()
88+
get_target_property(_btas_inc ${_btas_aliased} INTERFACE_INCLUDE_DIRECTORIES)
89+
if (_btas_inc)
90+
set_target_properties(${_btas_aliased} PROPERTIES
91+
INTERFACE_SYSTEM_INCLUDE_DIRECTORIES "${_btas_inc}")
92+
endif()
93+
unset(_btas_inc)
94+
unset(_btas_aliased)

0 commit comments

Comments
 (0)