-
|
I’m a bit confused that As a result, every library that links against I also noticed that Poco builds fine even when So my questions are:
For reference, this is the line where |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments
-
|
I don't know the answer. I think I would like to know as well. But, if you're looking for a workaround, this is what I do to remove function(remove_unicode)
message(STATUS "remove UNICODE from " ${ARGV0})
get_target_property(defs ${ARGV0} COMPILE_DEFINITIONS)
list(FILTER defs EXCLUDE REGEX [[^UNICODE$]])
list(FILTER defs EXCLUDE REGEX [[^_UNICODE$]])
set_property(TARGET ${ARGV0} PROPERTY COMPILE_DEFINITIONS ${defs})
get_target_property(defs ${ARGV0} INTERFACE_COMPILE_DEFINITIONS)
list(FILTER defs EXCLUDE REGEX [[^UNICODE$]])
list(FILTER defs EXCLUDE REGEX [[^_UNICODE$]])
set_property(TARGET ${ARGV0} PROPERTY INTERFACE_COMPILE_DEFINITIONS ${defs})
get_target_property(defs ${ARGV0} COMPILE_DEFINITIONS_DEBUG)
list(FILTER defs EXCLUDE REGEX [[^UNICODE$]])
list(FILTER defs EXCLUDE REGEX [[^_UNICODE$]])
set_property(TARGET ${ARGV0} PROPERTY COMPILE_DEFINITIONS_DEBUG ${defs})
get_target_property(defs ${ARGV0} COMPILE_DEFINITIONS_RELEASE)
list(FILTER defs EXCLUDE REGEX [[^UNICODE$]])
list(FILTER defs EXCLUDE REGEX [[^_UNICODE$]])
set_property(TARGET ${ARGV0} PROPERTY COMPILE_DEFINITIONS_RELEASE ${defs})
endfunction()
if (MSVC)
remove_unicode(Util)
remove_unicode(Foundation)
remove_unicode(Data)
remove_unicode(DataSQLite)
remove_unicode(XML)
remove_unicode(JSON)
remove_unicode(Net)
endif() |
Beta Was this translation helpful? Give feedback.
-
AnalysisGood questions! After analyzing the POCO codebase, here's what I found: POCO's Internal Unicode HandlingPOCO explicitly uses the wide-character (
POCO does not use:
Answers to Your Questions1. Is it a strict requirement that POCO be built with No. Since POCO explicitly calls 2. Is it a strict requirement that client projects have these definitions? No - for the same reason. POCO's public API uses Why Is It Defined?The Potential ChangeThe
If you'd like to see this changed, feel free to open a feature request. The workaround @andrewauclair provided is a reasonable solution in the meantime. |
Beta Was this translation helpful? Give feedback.
Analysis
Good questions! After analyzing the POCO codebase, here's what I found:
POCO's Internal Unicode Handling
POCO explicitly uses the wide-character (
W) Windows APIs throughout its Windows implementations:CreateFileW(),FindFirstFileW(),GetFileAttributesW(),GetModuleFileNameW(), etc.UnicodeConverter::toUTF16()to convert UTF-8 strings to UTF-16 for Windows API callsPOCO does not use:
TCHARor theTEXT()/_T()macrosCreateFile(which resolve toCreateFileAorCreateFileWbased onUNICODE)#ifdef UNICODEconditional compilation in the core Foundation codeAnswers to Your Questions
1. Is it a strict requirement that POCO be buil…