mirror of
https://github.com/ROCm/composable_kernel.git
synced 2026-05-14 02:02:46 +00:00
Introduce cmake USE_GLIBCXX_ASSERTIONS option (#1404)
A standard option in Fedora packaging that is used to check
the correctness of c++ use of the standard c++ library.
Signed-off-by: Tom Rix <trix@redhat.com>
Co-authored-by: Illia Silin <98187287+illsilin@users.noreply.github.com>
[ROCm/composable_kernel commit: 733f33af78]
This commit is contained in:
@@ -235,6 +235,16 @@ set(CMAKE_CXX_STANDARD_REQUIRED ON)
|
||||
set(CMAKE_CXX_EXTENSIONS OFF)
|
||||
message("CMAKE_CXX_COMPILER: ${CMAKE_CXX_COMPILER}")
|
||||
|
||||
# https://gcc.gnu.org/onlinedocs/libstdc++/manual/using_macros.html
|
||||
# _GLIBCXX_ASSERTIONS
|
||||
# Undefined by default. When defined, enables extra error checking in the form of
|
||||
# precondition assertions, such as bounds checking in strings and null pointer
|
||||
# checks when dereferencing smart pointers
|
||||
option(USE_GLIBCXX_ASSERTIONS "Turn on additional c++ library checks." OFF)
|
||||
if(USE_GLIBCXX_ASSERTIONS)
|
||||
add_compile_options(-Wp,-D_GLIBCXX_ASSERTIONS)
|
||||
endif()
|
||||
|
||||
## HIP
|
||||
set(CMAKE_HIP_PLATFORM amd)
|
||||
set(CMAKE_HIP_COMPILER ${CMAKE_CXX_COMPILER})
|
||||
|
||||
Reference in New Issue
Block a user