[Openmp-commits] [PATCH] D55952: [libomptarget] Introduce LIBOMPTARGET_ENABLE_DEBUG cmake option.

Michael Kruse via Phabricator via Openmp-commits openmp-commits at lists.llvm.org
Mon Mar 11 16:43:26 PDT 2019


Meinersbur updated this revision to Diff 190185.
Meinersbur added a comment.
Herald added a subscriber: jdoerfert.
Herald added a project: OpenMP.

- Define OMPTARGET_DEBUG preprocessor symbol if LIBOMPTARGET_ENABLE_DEBUG
- Fix regression test execution


Repository:
  rOMP OpenMP

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D55952/new/

https://reviews.llvm.org/D55952

Files:
  libomptarget/CMakeLists.txt
  libomptarget/test/CMakeLists.txt


Index: libomptarget/test/CMakeLists.txt
===================================================================
--- libomptarget/test/CMakeLists.txt
+++ libomptarget/test/CMakeLists.txt
@@ -6,7 +6,7 @@
   return()
 endif()
 
-if(LIBOMPTARGET_CMAKE_BUILD_TYPE MATCHES debug)
+if(LIBOMPTARGET_ENABLE_DEBUG)
   set(LIBOMPTARGET_DEBUG True)
 else()
   set(LIBOMPTARGET_DEBUG False)
Index: libomptarget/CMakeLists.txt
===================================================================
--- libomptarget/CMakeLists.txt
+++ libomptarget/CMakeLists.txt
@@ -40,13 +40,17 @@
 # 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)
+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)


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D55952.190185.patch
Type: text/x-patch
Size: 1536 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/openmp-commits/attachments/20190311/4e663d33/attachment.bin>


More information about the Openmp-commits mailing list