summaryrefslogtreecommitdiffstats
path: root/openmp/libomptarget/CMakeLists.txt
diff options
context:
space:
mode:
Diffstat (limited to 'openmp/libomptarget/CMakeLists.txt')
-rw-r--r--openmp/libomptarget/CMakeLists.txt12
1 files changed, 8 insertions, 4 deletions
diff --git a/openmp/libomptarget/CMakeLists.txt b/openmp/libomptarget/CMakeLists.txt
index 9bbb5e6342e..a953662bf8b 100644
--- a/openmp/libomptarget/CMakeLists.txt
+++ b/openmp/libomptarget/CMakeLists.txt
@@ -40,13 +40,17 @@ set (LIBOMPTARGET_ALL_TARGETS "${LIBOMPTARGET_ALL_TARGETS} nvptx64-nvidia-cuda")
# the list of supported targets in the current system.
set (LIBOMPTARGET_SYSTEM_TARGETS "")
-# If building this library in debug mode, we define a macro to enable
-# dumping progress messages at runtime.
+# Check whether using debug mode. In debug mode, allow dumping progress
+# messages at runtime by default. Otherwise, it can be enabled
+# independently using the LIBOMPTARGET_ENABLE_DEBUG option.
string( TOLOWER "${CMAKE_BUILD_TYPE}" LIBOMPTARGET_CMAKE_BUILD_TYPE)
if(LIBOMPTARGET_CMAKE_BUILD_TYPE MATCHES debug)
+ option(LIBOMPTARGET_ENABLE_DEBUG "Allow debug output with the environment variable LIBOMPTARGET_DEBUG=1" ON)
+else()
+ option(LIBOMPTARGET_ENABLE_DEBUG "Allow debug output with the environment variable LIBOMPTARGET_DEBUG=1" OFF)
+endif()
+if(LIBOMPTARGET_ENABLE_DEBUG)
add_definitions(-DOMPTARGET_DEBUG)
- add_definitions(-g)
- add_definitions(-O0)
endif()
include_directories(include)
OpenPOWER on IntegriCloud