diff --git a/runtime/cmake/LibompDefinitions.cmake b/runtime/cmake/LibompDefinitions.cmake index c3e3427a61d806fb9497dfa30940e740d5862069..c4cfbb9414133ac05b4c966db82f4aa8e4d4cbe8 100644 --- a/runtime/cmake/LibompDefinitions.cmake +++ b/runtime/cmake/LibompDefinitions.cmake @@ -21,8 +21,6 @@ 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/runtime/src/CMakeLists.txt b/runtime/src/CMakeLists.txt index 57d7c2f15f6f667efa6500831ed8f007efd58bc5..777434da447f01ff398a355e8f0d2ca129678350 100644 --- a/runtime/src/CMakeLists.txt +++ b/runtime/src/CMakeLists.txt @@ -31,6 +31,11 @@ add_custom_command( ) # Set the -D definitions for all sources +# UNICODE and _UNICODE are set in LLVM's CMake system. They affect the +# ittnotify code and should only be set when compiling ittnotify_static.c +# on Windows (done below). +# TODO: Fix the UNICODE usage in ittnotify code for Windows. +remove_definitions(-DUNICODE -D_UNICODE) libomp_get_definitions_flags(LIBOMP_CONFIGURED_DEFINITIONS_FLAGS) add_definitions(${LIBOMP_CONFIGURED_DEFINITIONS_FLAGS}) @@ -192,7 +197,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/runtime/src/thirdparty/ittnotify/ittnotify_static.c b/runtime/src/thirdparty/ittnotify/ittnotify_static.c index f84512d2126b11b3d4b19704eb295a72b14db7ab..5f365730eaca4bcdf8bb072766e43077c080b12b 100644 --- a/runtime/src/thirdparty/ittnotify/ittnotify_static.c +++ b/runtime/src/thirdparty/ittnotify/ittnotify_static.c @@ -8,11 +8,6 @@ // //===----------------------------------------------------------------------===// -#if ITT_PLATFORM==ITT_PLATFORM_WIN -#define UNICODE -#define _UNICODE -#endif - #include "kmp_config.h" #include "ittnotify_config.h"