From 9919dfc3b62cb5e51f32e3ac1e5fc8941e80dda1 Mon Sep 17 00:00:00 2001 From: Jonathan Peyton Date: Thu, 11 Jun 2015 17:36:16 +0000 Subject: Remove unused variables '__kmp_build_check_*' for non assert builds. Add new LIBOMP_ENABLE_ASSERTIONS macro which can be set in a standalone build or takes the value of LLVM_ENABLE_ASSERTIONS when inside llvm/projects. This change also defines the KMP_BUILD_ASSERT() macro to do nothing when ENABLE_ASSERTIONS is off. This means the __kmp_build_check_* types won't be defined and thus, no warnings. http://lists.cs.uiuc.edu/pipermail/openmp-dev/2015-June/000719.html Patch by Jack Howarth and Jonathan Peyton llvm-svn: 239546 --- openmp/runtime/cmake/Definitions.cmake | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'openmp/runtime/cmake') diff --git a/openmp/runtime/cmake/Definitions.cmake b/openmp/runtime/cmake/Definitions.cmake index b797e04a7d0..fe367d3520e 100644 --- a/openmp/runtime/cmake/Definitions.cmake +++ b/openmp/runtime/cmake/Definitions.cmake @@ -83,7 +83,9 @@ function(append_cpp_flags input_cpp_flags) ################################## # Other conditional definitions - append_definitions("-D KMP_USE_ASSERT") + if(${LIBOMP_ENABLE_ASSERTIONS}) + append_definitions("-D KMP_USE_ASSERT") + endif() append_definitions("-D KMP_DYNAMIC_LIB") if(${STUBS_LIBRARY}) append_definitions("-D KMP_STUB") -- cgit v1.2.3