[Openmp-commits] [openmp] r273898 - Fix the Windows build after r273599

Hans Wennborg via Openmp-commits openmp-commits at lists.llvm.org
Mon Jun 27 11:03:45 PDT 2016


Author: hans
Date: Mon Jun 27 13:03:45 2016
New Revision: 273898

URL: http://llvm.org/viewvc/llvm-project?rev=273898&view=rev
Log:
Fix the Windows build after r273599

That patch made all LLVM projects build with -DUNICODE. However, this doesn't
work for the OpenMP runtime.

But just overriding the flag with -UUNICODE breaks compiling ittnotify_static.c,
which for some reason needs to be compiled with -DUNICIODE. Note that compiling
ittnotify.h with -DUNICODE does not work though.

This seems like a mess. This commit fixes it for now, but it would be great
if someone who works on the OpenMP runtime could fix it properly.

Modified:
    openmp/trunk/runtime/cmake/LibompDefinitions.cmake
    openmp/trunk/runtime/src/CMakeLists.txt
    openmp/trunk/runtime/src/thirdparty/ittnotify/ittnotify_static.c

Modified: openmp/trunk/runtime/cmake/LibompDefinitions.cmake
URL: http://llvm.org/viewvc/llvm-project/openmp/trunk/runtime/cmake/LibompDefinitions.cmake?rev=273898&r1=273897&r2=273898&view=diff
==============================================================================
--- openmp/trunk/runtime/cmake/LibompDefinitions.cmake (original)
+++ openmp/trunk/runtime/cmake/LibompDefinitions.cmake Mon Jun 27 13:03:45 2016
@@ -21,6 +21,8 @@ function(libomp_get_definitions_flags cp
     libomp_append(cppflags_local "-D _USRDLL")
     libomp_append(cppflags_local "-D _ITERATOR_DEBUG_LEVEL=0" IF_TRUE DEBUG_BUILD)
     libomp_append(cppflags_local "-D _DEBUG" IF_TRUE DEBUG_BUILD)
+    libomp_append(cppflags_local "-UUNICODE")
+    libomp_append(cppflags_local "-U_UNICODE")
   else()
     libomp_append(cppflags_local "-D _GNU_SOURCE")
     libomp_append(cppflags_local "-D _REENTRANT")

Modified: openmp/trunk/runtime/src/CMakeLists.txt
URL: http://llvm.org/viewvc/llvm-project/openmp/trunk/runtime/src/CMakeLists.txt?rev=273898&r1=273897&r2=273898&view=diff
==============================================================================
--- openmp/trunk/runtime/src/CMakeLists.txt (original)
+++ openmp/trunk/runtime/src/CMakeLists.txt Mon Jun 27 13:03:45 2016
@@ -192,7 +192,7 @@ if(WIN32)
   libomp_append(LIBOMP_MASM_DEFINITIONS "-DOMPT_SUPPORT" IF_TRUE_1_0 LIBOMP_OMPT_SUPPORT)
   libomp_list_to_string("${LIBOMP_MASM_DEFINITIONS}" LIBOMP_MASM_DEFINITIONS)
   set_property(SOURCE z_Windows_NT-586_asm.asm APPEND_STRING PROPERTY COMPILE_FLAGS " ${LIBOMP_MASM_DEFINITIONS}")
-  set_source_files_properties(thirdparty/ittnotify/ittnotify_static.c PROPERTIES COMPILE_DEFINITIONS "UNICODE")
+  #set_source_files_properties(thirdparty/ittnotify/ittnotify_static.c PROPERTIES COMPILE_DEFINITIONS "UNICODE")
 
   # Create Windows import library
   # the import library is "re-linked" to include kmp_import.c which prevents

Modified: openmp/trunk/runtime/src/thirdparty/ittnotify/ittnotify_static.c
URL: http://llvm.org/viewvc/llvm-project/openmp/trunk/runtime/src/thirdparty/ittnotify/ittnotify_static.c?rev=273898&r1=273897&r2=273898&view=diff
==============================================================================
--- openmp/trunk/runtime/src/thirdparty/ittnotify/ittnotify_static.c (original)
+++ openmp/trunk/runtime/src/thirdparty/ittnotify/ittnotify_static.c Mon Jun 27 13:03:45 2016
@@ -8,6 +8,11 @@
 //
 //===----------------------------------------------------------------------===//
 
+#if ITT_PLATFORM==ITT_PLATFORM_WIN
+#define UNICODE
+#define _UNICODE
+#endif
+
 #include "kmp_config.h"
 #include "ittnotify_config.h"
 




More information about the Openmp-commits mailing list