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

George Rokos via Phabricator via Openmp-commits openmp-commits at lists.llvm.org
Mon Dec 31 09:30:17 PST 2018


grokos added a comment.

I'm not sure what we are trying to do here. `OMPTARGET_DEBUG` is not an environment variable, it's a preprocessor definition. It is used by `libomptarget/include/omptarget.h` to include all necessary header files and define the `DEBUGP` macro appropriately, which in turn is used by `libomptarget/src/private.h` to define the `DP` macro used throughout the library.

The env var you are referring to is `LIBOMPTARGET_DEBUG` and it switches debug output on and off, provided that the library has been compiled with `-DOMPTARGET_DEBUG` so that the appropriate macros have been defined in `omptarget.h` and `private.h`.

If you want to make debug output available in release mode via a new `LIBOMPTARGET_ENABLE_DEBUG` cmake option, then you should add another check like:

  if(LIBOMPTARGET_ENABLE_DEBUG)
    add_definitions(-DOMPTARGET_DEBUG)
  endif()



================
Comment at: libomptarget/CMakeLists.txt:48
-if(LIBOMPTARGET_CMAKE_BUILD_TYPE MATCHES debug)
-  add_definitions(-DOMPTARGET_DEBUG)
-  add_definitions(-g)
----------------
This must stay, it's a preprocessor definition, not an env var.


Repository:
  rOMP OpenMP

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

https://reviews.llvm.org/D55952





More information about the Openmp-commits mailing list