1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28
|
From: Cordell Bloor <cgmb@slerp.xyz>
Date: Thu, 7 Nov 2024 00:57:58 -0700
Subject: optional werror
Add a CMake option to enable or disable the use of werror.
Forwarded: https://github.com/ROCm/roctracer/pull/107
---
CMakeLists.txt | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 14efcbb..4f22f67 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -37,7 +37,11 @@ endif()
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
-add_compile_options(-Wall -Werror)
+add_compile_options(-Wall)
+option(ROCTRACER_WERROR "Treat warnings as errors" ON)
+if(ROCTRACER_WERROR)
+ add_compile_options(-Werror)
+endif()
# To set addition RUNPATH in libraries
# installed in /opt/rocm-ver/lib/roctracer
set(ROCM_APPEND_PRIVLIB_RPATH "$ORIGIN/..")
|