[ros-diffs] [tfaber] 53971: [CMAKE] - Add a flag to distinguish Ansi and Unicode message tables. Keep them Ansi for now pending further testing - Apply this to MSVC build as well. Fixes ntoskrnl messages incor...

tfaber at svn.reactos.org tfaber at svn.reactos.org
Mon Oct 3 19:09:26 UTC 2011


Author: tfaber
Date: Mon Oct  3 19:09:26 2011
New Revision: 53971

URL: http://svn.reactos.org/svn/reactos?rev=53971&view=rev
Log:
[CMAKE]
- Add a flag to distinguish Ansi and Unicode message tables. Keep them Ansi for now pending further testing
- Apply this to MSVC build as well. Fixes ntoskrnl messages incorrectly being Unicode

Modified:
    trunk/reactos/cmake/CMakeMacros.cmake
    trunk/reactos/cmake/gcc.cmake
    trunk/reactos/cmake/msvc.cmake
    trunk/reactos/include/reactos/mc/CMakeLists.txt

Modified: trunk/reactos/cmake/CMakeMacros.cmake
URL: http://svn.reactos.org/svn/reactos/trunk/reactos/cmake/CMakeMacros.cmake?rev=53971&r1=53970&r2=53971&view=diff
==============================================================================
--- trunk/reactos/cmake/CMakeMacros.cmake [iso-8859-1] (original)
+++ trunk/reactos/cmake/CMakeMacros.cmake [iso-8859-1] Mon Oct  3 19:09:26 2011
@@ -34,13 +34,18 @@
     file(APPEND ${REACTOS_BINARY_DIR}/dependencies.graphml "  </graph>\n</graphml>\n")
 endfunction()
 
-function(add_message_headers)
+function(add_message_headers _type)
+    if(${_type} STREQUAL UNICODE)
+        set(_flag "-U")
+    else()
+        set(_flag "-A")
+    endif()
     foreach(_in_FILE ${ARGN})
         get_filename_component(FILE ${_in_FILE} NAME_WE)
-        macro_mc(${FILE})
+        macro_mc(${_flag} ${FILE})
         add_custom_command(
             OUTPUT ${REACTOS_BINARY_DIR}/include/reactos/${FILE}.rc ${REACTOS_BINARY_DIR}/include/reactos/${FILE}.h
-            COMMAND ${COMMAND_MC}
+            COMMAND ${COMMAND_MC} ${MC_FLAGS}
             DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/${FILE}.mc)
         set_source_files_properties(
             ${REACTOS_BINARY_DIR}/include/reactos/${FILE}.h ${REACTOS_BINARY_DIR}/include/reactos/${FILE}.rc

Modified: trunk/reactos/cmake/gcc.cmake
URL: http://svn.reactos.org/svn/reactos/trunk/reactos/cmake/gcc.cmake?rev=53971&r1=53970&r2=53971&view=diff
==============================================================================
--- trunk/reactos/cmake/gcc.cmake [iso-8859-1] (original)
+++ trunk/reactos/cmake/gcc.cmake [iso-8859-1] Mon Oct  3 19:09:26 2011
@@ -249,8 +249,8 @@
     set_source_files_properties(${CMAKE_CURRENT_BINARY_DIR}/${_file}_stubs.c PROPERTIES GENERATED TRUE)
 endfunction()
 
-macro(macro_mc FILE)
-    set(COMMAND_MC ${CMAKE_MC_COMPILER} -A -b ${CMAKE_CURRENT_SOURCE_DIR}/${FILE}.mc -r ${REACTOS_BINARY_DIR}/include/reactos -h ${REACTOS_BINARY_DIR}/include/reactos)
+macro(macro_mc FLAG FILE)
+    set(COMMAND_MC ${CMAKE_MC_COMPILER} ${FLAG} -b ${CMAKE_CURRENT_SOURCE_DIR}/${FILE}.mc -r ${REACTOS_BINARY_DIR}/include/reactos -h ${REACTOS_BINARY_DIR}/include/reactos)
 endmacro()
 
 #pseh lib, needed with mingw

Modified: trunk/reactos/cmake/msvc.cmake
URL: http://svn.reactos.org/svn/reactos/trunk/reactos/cmake/msvc.cmake?rev=53971&r1=53970&r2=53971&view=diff
==============================================================================
--- trunk/reactos/cmake/msvc.cmake [iso-8859-1] (original)
+++ trunk/reactos/cmake/msvc.cmake [iso-8859-1] Mon Oct  3 19:09:26 2011
@@ -174,8 +174,8 @@
         PROPERTIES GENERATED TRUE)
 endfunction()
 
-macro(macro_mc FILE)
-    set(COMMAND_MC mc -r ${REACTOS_BINARY_DIR}/include/reactos -h ${REACTOS_BINARY_DIR}/include/reactos ${CMAKE_CURRENT_SOURCE_DIR}/${FILE}.mc)
+macro(macro_mc FLAG FILE)
+    set(COMMAND_MC mc ${FLAG} -r ${REACTOS_BINARY_DIR}/include/reactos -h ${REACTOS_BINARY_DIR}/include/reactos ${CMAKE_CURRENT_SOURCE_DIR}/${FILE}.mc)
 endmacro()
 
 file(MAKE_DIRECTORY ${CMAKE_BINARY_DIR}/importlibs)

Modified: trunk/reactos/include/reactos/mc/CMakeLists.txt
URL: http://svn.reactos.org/svn/reactos/trunk/reactos/include/reactos/mc/CMakeLists.txt?rev=53971&r1=53970&r2=53971&view=diff
==============================================================================
--- trunk/reactos/include/reactos/mc/CMakeLists.txt [iso-8859-1] (original)
+++ trunk/reactos/include/reactos/mc/CMakeLists.txt [iso-8859-1] Mon Oct  3 19:09:26 2011
@@ -1,9 +1,13 @@
 
-list(APPEND SOURCE
-    bugcodes.mc
+list(APPEND ANSI_SOURCE
+    bugcodes.mc)
+
+list(APPEND UNICODE_SOURCE
     errcodes.mc
     neteventmsg.mc
     ntstatus.mc
     pciclass.mc)
 
-add_message_headers(${SOURCE})
+add_message_headers(ANSI ${ANSI_SOURCE})
+# FIXME: this needs testing before switching to unicode
+add_message_headers(ANSI ${UNICODE_SOURCE})




More information about the Ros-diffs mailing list