From 8065c5187508bca7de4711b627891f5ef5968e48 Mon Sep 17 00:00:00 2001 From: Hans Wennborg Date: Mon, 27 Jun 2016 18:03:45 +0000 Subject: [PATCH] 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. llvm-svn: 273898 --- openmp/runtime/cmake/LibompDefinitions.cmake | 2 ++ openmp/runtime/src/CMakeLists.txt | 2 +- openmp/runtime/src/thirdparty/ittnotify/ittnotify_static.c | 5 +++++ 3 files changed, 8 insertions(+), 1 deletion(-) diff --git a/openmp/runtime/cmake/LibompDefinitions.cmake b/openmp/runtime/cmake/LibompDefinitions.cmake index c4cfbb941413..c3e3427a61d8 100644 --- a/openmp/runtime/cmake/LibompDefinitions.cmake +++ b/openmp/runtime/cmake/LibompDefinitions.cmake @@ -21,6 +21,8 @@ function(libomp_get_definitions_flags cppflags) 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") diff --git a/openmp/runtime/src/CMakeLists.txt b/openmp/runtime/src/CMakeLists.txt index 9f8d2b0b0b2e..57d7c2f15f6f 100644 --- a/openmp/runtime/src/CMakeLists.txt +++ b/openmp/runtime/src/CMakeLists.txt @@ -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 diff --git a/openmp/runtime/src/thirdparty/ittnotify/ittnotify_static.c b/openmp/runtime/src/thirdparty/ittnotify/ittnotify_static.c index 5f365730eaca..f84512d2126b 100644 --- a/openmp/runtime/src/thirdparty/ittnotify/ittnotify_static.c +++ b/openmp/runtime/src/thirdparty/ittnotify/ittnotify_static.c @@ -8,6 +8,11 @@ // //===----------------------------------------------------------------------===// +#if ITT_PLATFORM==ITT_PLATFORM_WIN +#define UNICODE +#define _UNICODE +#endif + #include "kmp_config.h" #include "ittnotify_config.h"