Author: cfinck
Date: Tue Oct 4 12:37:52 2016
New Revision: 72899
URL:
http://svn.reactos.org/svn/reactos?rev=72899&view=rev
Log:
[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
Modified:
trunk/reactos/CMakeLists.txt
trunk/reactos/sdk/lib/cmlib/CMakeLists.txt
trunk/reactos/sdk/lib/inflib/CMakeLists.txt
trunk/reactos/sdk/tools/mkhive/CMakeLists.txt
trunk/reactos/sdk/tools/xml2sdb/CMakeLists.txt
Modified: trunk/reactos/CMakeLists.txt
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/CMakeLists.txt?rev=72899&a…
==============================================================================
--- trunk/reactos/CMakeLists.txt [iso-8859-1] (original)
+++ trunk/reactos/CMakeLists.txt [iso-8859-1] Tue Oct 4 12:37:52 2016
@@ -94,8 +94,6 @@
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)
Modified: trunk/reactos/sdk/lib/cmlib/CMakeLists.txt
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/sdk/lib/cmlib/CMakeLists.t…
==============================================================================
--- trunk/reactos/sdk/lib/cmlib/CMakeLists.txt [iso-8859-1] (original)
+++ trunk/reactos/sdk/lib/cmlib/CMakeLists.txt [iso-8859-1] Tue Oct 4 12:37:52 2016
@@ -26,5 +26,10 @@
-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()
Modified: trunk/reactos/sdk/lib/inflib/CMakeLists.txt
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/sdk/lib/inflib/CMakeLists.…
==============================================================================
--- trunk/reactos/sdk/lib/inflib/CMakeLists.txt [iso-8859-1] (original)
+++ trunk/reactos/sdk/lib/inflib/CMakeLists.txt [iso-8859-1] Tue Oct 4 12:37:52 2016
@@ -23,8 +23,10 @@
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()
Modified: trunk/reactos/sdk/tools/mkhive/CMakeLists.txt
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/sdk/tools/mkhive/CMakeList…
==============================================================================
--- trunk/reactos/sdk/tools/mkhive/CMakeLists.txt [iso-8859-1] (original)
+++ trunk/reactos/sdk/tools/mkhive/CMakeLists.txt [iso-8859-1] Tue Oct 4 12:37:52 2016
@@ -15,4 +15,9 @@
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)
Modified: trunk/reactos/sdk/tools/xml2sdb/CMakeLists.txt
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/sdk/tools/xml2sdb/CMakeLis…
==============================================================================
--- trunk/reactos/sdk/tools/xml2sdb/CMakeLists.txt [iso-8859-1] (original)
+++ trunk/reactos/sdk/tools/xml2sdb/CMakeLists.txt [iso-8859-1] Tue Oct 4 12:37:52 2016
@@ -1,12 +1,5 @@
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
@@ -17,3 +10,9 @@
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()