From: Colin Finck Date: Tue, 4 Oct 2016 12:37:52 +0000 (+0000) Subject: [HOST_TOOLS] X-Git-Tag: ReactOS-0.4.3~156 X-Git-Url: https://git.reactos.org/?p=reactos.git;a=commitdiff_plain;h=dc5f65c8d99720ce437a510d6d1ff42a4fccee62 [HOST_TOOLS] Defining -fshort-wchar globally for all host tools breaks every possibility to interact with the host's Unicode support for some operating systems with 4 byte wchar_t (like Mac OS X). Let's better define no additional global flags and only add -fshort-wchar for the host modules that really need a 2-byte wchar_t for writing ReactOS data files. These are cmlibhost, inflibhost, mkhive and xml2sdb. Also add -Wno-multichar only for cmlibhost, where it's required. In preparation for CORE-11988 svn path=/trunk/; revision=72899 --- diff --git a/reactos/CMakeLists.txt b/reactos/CMakeLists.txt index 78c9ae02988..7ca06686eef 100644 --- a/reactos/CMakeLists.txt +++ b/reactos/CMakeLists.txt @@ -94,8 +94,6 @@ if(NOT CMAKE_CROSSCOMPILING) add_definitions(/D_ALLOW_KEYWORD_MACROS) endif() add_definitions(/Dinline=__inline) - else() - add_compile_flags("-fshort-wchar -Wno-multichar") endif() include_directories(sdk/include/host) diff --git a/reactos/sdk/lib/cmlib/CMakeLists.txt b/reactos/sdk/lib/cmlib/CMakeLists.txt index 258fba9611e..21839350111 100644 --- a/reactos/sdk/lib/cmlib/CMakeLists.txt +++ b/reactos/sdk/lib/cmlib/CMakeLists.txt @@ -26,5 +26,10 @@ else() -D__NO_CTYPE_INLINES -DCMLIB_HOST) add_library(cmlibhost ${SOURCE}) + + if(NOT MSVC) + add_target_compile_flags(cmlibhost "-fshort-wchar -Wno-multichar") + endif() + target_link_libraries(cmlibhost unicode) endif() diff --git a/reactos/sdk/lib/inflib/CMakeLists.txt b/reactos/sdk/lib/inflib/CMakeLists.txt index 4fc96941bfd..e6ed96f8c13 100644 --- a/reactos/sdk/lib/inflib/CMakeLists.txt +++ b/reactos/sdk/lib/inflib/CMakeLists.txt @@ -23,8 +23,10 @@ else() add_definitions(-D__NO_CTYPE_INLINES -DINFLIB_HOST) add_library(inflibhost ${SOURCE}) + if(NOT MSVC) - add_target_compile_flags(inflibhost "-Wpointer-arith -Wwrite-strings") + add_target_compile_flags(inflibhost "-fshort-wchar -Wpointer-arith -Wwrite-strings") endif() + target_link_libraries(inflibhost unicode) endif() diff --git a/reactos/sdk/tools/mkhive/CMakeLists.txt b/reactos/sdk/tools/mkhive/CMakeLists.txt index 7903d11f3c8..5f9446f7ae6 100644 --- a/reactos/sdk/tools/mkhive/CMakeLists.txt +++ b/reactos/sdk/tools/mkhive/CMakeLists.txt @@ -15,4 +15,9 @@ list(APPEND SOURCE rtl.c) add_host_tool(mkhive ${SOURCE}) + +if(NOT MSVC) + add_target_compile_flags(mkhive "-fshort-wchar") +endif() + target_link_libraries(mkhive unicode cmlibhost inflibhost) diff --git a/reactos/sdk/tools/xml2sdb/CMakeLists.txt b/reactos/sdk/tools/xml2sdb/CMakeLists.txt index 8eb9e230efe..6997c6f730e 100644 --- a/reactos/sdk/tools/xml2sdb/CMakeLists.txt +++ b/reactos/sdk/tools/xml2sdb/CMakeLists.txt @@ -1,13 +1,6 @@ add_definitions(-DSDBWRITE_HOSTTOOL=1) -if(MSVC) - set_property(SOURCE main.cpp tinyxml2.cpp xml2sdb.cpp APPEND_STRING PROPERTY COMPILE_FLAGS " /EHsc") -else() - add_compile_flags("-fshort-wchar -Wno-multichar") -endif() - - list(APPEND SOURCE main.cpp tinyxml2.cpp @@ -17,3 +10,9 @@ list(APPEND SOURCE include_directories(${REACTOS_SOURCE_DIR}/dll/appcompat/apphelp) add_host_tool(xml2sdb ${SOURCE}) + +if(MSVC) + set_source_files_properties(${SOURCE} PROPERTIES COMPILE_FLAGS " /EHsc") +else() + add_target_compile_flags(xml2sdb "-fshort-wchar") +endif()