[CMAKE]
authorTimo Kreuzer <timo.kreuzer@reactos.org>
Mon, 24 Jan 2011 18:13:40 +0000 (18:13 +0000)
committerTimo Kreuzer <timo.kreuzer@reactos.org>
Mon, 24 Jan 2011 18:13:40 +0000 (18:13 +0000)
Refactor IDL compilation:
- Move all macros to idl-support.cmake
- Make rpc proxy a static library, instead of fiddeling with SOURCE variable
- Merge client and server rpc libraries into one library
- Reorder global makelist file a little
- Improve configure script
- Improve naming, use add_* when a target is added, generate_* when only a file is generated
- Don't compile wbemcli.idl on MSVC (temp hack)
- Don't compile rossym on MSVC, we don't use it
- Use ml64 as assembler when compiling for amd64
- fix spec2def invocation

svn path=/branches/cmake-bringup/; revision=50478

36 files changed:
CMakeLists.txt
CMakeMacros.cmake
base/services/eventlog/CMakeLists.txt
base/services/rpcss/CMakeLists.txt
base/services/umpnpmgr/CMakeLists.txt
base/services/wlansvc/CMakeLists.txt
base/system/services/CMakeLists.txt
cmake/idl-support.cmake [new file with mode: 0644]
configure.cmd
dll/directx/quartz/CMakeLists.txt
dll/win32/actxprxy/CMakeLists.txt
dll/win32/advapi32/CMakeLists.txt
dll/win32/atl/CMakeLists.txt
dll/win32/lsasrv/CMakeLists.txt
dll/win32/mshtml/CMakeLists.txt
dll/win32/msi/CMakeLists.txt
dll/win32/mstask/CMakeLists.txt
dll/win32/ole32/CMakeLists.txt
dll/win32/oleaut32/CMakeLists.txt
dll/win32/qmgr/CMakeLists.txt
dll/win32/qmgrprxy/CMakeLists.txt
dll/win32/rpcrt4/CMakeLists.txt
dll/win32/setupapi/CMakeLists.txt
dll/win32/shell32/CMakeLists.txt
dll/win32/sti/CMakeLists.txt
dll/win32/urlmon/CMakeLists.txt
dll/win32/wlanapi/CMakeLists.txt
gcc.cmake
include/dxsdk/CMakeLists.txt
include/psdk/CMakeLists.txt
include/reactos/idl/CMakeLists.txt
include/reactos/wine/CMakeLists.txt
lib/rossym/CMakeLists.txt
msc.cmake
toolchain-mingw32.cmake
toolchain-msvc.cmake

index 1ce930a..643f4b1 100644 (file)
@@ -8,6 +8,14 @@ include(include/reactos/version.cmake)
 # Don't escape preprocessor definition values added via add_definitions
 cmake_policy(SET CMP0005 OLD)
 
+set(CMAKE_INCLUDE_CURRENT_DIR ON)
+set(CMAKE_INCLUDE_DIRECTORIES_PROJECT_BEFORE ON)
+set(CMAKE_SHARED_LIBRARY_PREFIX "")
+set(CMAKE_SKIP_PREPROCESSED_SOURCE_RULES TRUE)
+set(CMAKE_SKIP_ASSEMBLY_SOURCE_RULES TRUE)
+set(CMAKE_COLOR_MAKEFILE OFF)
+set_property(GLOBAL PROPERTY RULE_MESSAGES OFF)
+
 if(NOT ARCH)
     set(ARCH i386)
 endif()
@@ -22,6 +30,8 @@ elseif(ARCH MATCHES arm)
     include(config-arm.cmake)
 endif()
 
+add_definitions(-D__REACTOS__)
+
 if(NOT CMAKE_CROSSCOMPILING)
 
     add_definitions(-DTARGET_${ARCH})
@@ -51,6 +61,16 @@ if(NOT CMAKE_CROSSCOMPILING)
 
 else()
 
+    # Do some cleanup
+    file(REMOVE
+        ${REACTOS_BINARY_DIR}/dependencies.graphml
+        ${REACTOS_BINARY_DIR}/boot/ros_livecd.txt
+        ${REACTOS_BINARY_DIR}/boot/ros_livecd_target.txt
+        ${REACTOS_BINARY_DIR}/boot/ros_minicd.txt
+        ${REACTOS_BINARY_DIR}/boot/ros_minicd_target.txt
+        ${REACTOS_BINARY_DIR}/boot/ros_cab.txt
+        ${REACTOS_BINARY_DIR}/boot/ros_cab_target.txt)
+
     if(NOT DEFINED REACTOS_BUILD_TOOLS_DIR)
         set(REACTOS_BUILD_TOOLS_DIR ${REACTOS_SOURCE_DIR}/build)
     endif()
@@ -58,42 +78,18 @@ else()
     set(IMPORT_EXECUTABLES "${REACTOS_BUILD_TOOLS_DIR}/ImportExecutables.cmake" CACHE FILEPATH "Host executables")
     include(${IMPORT_EXECUTABLES})
 
-endif()
-
-# Compiler specific definitions and macros
-if(MSVC)
-    include(msc.cmake)
-else()
-    include(gcc.cmake)
-endif()
-
-# Generic macros
-include(CMakeMacros.cmake)
-
-set(CMAKE_INCLUDE_CURRENT_DIR ON)
-set(CMAKE_INCLUDE_DIRECTORIES_PROJECT_BEFORE ON)
-set(CMAKE_SHARED_LIBRARY_PREFIX "")
-
-set(CMAKE_SKIP_PREPROCESSED_SOURCE_RULES TRUE)
-set(CMAKE_SKIP_ASSEMBLY_SOURCE_RULES TRUE)
-
-set(CMAKE_COLOR_MAKEFILE OFF)
-
-set_property(GLOBAL PROPERTY RULE_MESSAGES OFF)
-
-add_definitions(-D__REACTOS__)
+    # Compiler specific definitions and macros
+    if(MSVC)
+        include(msc.cmake)
+    else()
+        include(gcc.cmake)
+    endif()
 
-if(CMAKE_CROSSCOMPILING)
+    # Generic macros
+    include(CMakeMacros.cmake)
 
-    #Some cleanup
-    file(REMOVE
-        ${REACTOS_BINARY_DIR}/dependencies.graphml
-        ${REACTOS_BINARY_DIR}/boot/ros_livecd.txt
-        ${REACTOS_BINARY_DIR}/boot/ros_livecd_target.txt
-        ${REACTOS_BINARY_DIR}/boot/ros_minicd.txt
-        ${REACTOS_BINARY_DIR}/boot/ros_minicd_target.txt
-        ${REACTOS_BINARY_DIR}/boot/ros_cab.txt
-        ${REACTOS_BINARY_DIR}/boot/ros_cab_target.txt)
+    # IDL macros for widl/midl
+    include(cmake/idl-support.cmake)
 
     #Some useful variables
     set(LIVECD_DIR "${REACTOS_BINARY_DIR}/boot/livecd")
@@ -118,7 +114,11 @@ if(CMAKE_CROSSCOMPILING)
     endif()
 
     # Version Options
-    add_definitions(-DWINVER=0x502 -D_WIN32_IE=0x600 -D_WIN32_WINNT=0x502 -D_WIN32_WINDOWS=0x502 -D_SETUPAPI_VER=0x502)
+    add_definitions(-DWINVER=0x502
+                    -D_WIN32_IE=0x600
+                    -D_WIN32_WINNT=0x502
+                    -D_WIN32_WINDOWS=0x502
+                    -D_SETUPAPI_VER=0x502)
 
     # Arch Options
     if(ARCH MATCHES i386)
index 95fc7be..1e75108 100644 (file)
@@ -32,40 +32,6 @@ endmacro()
 \r
 endif()\r
 \r
-macro(idl_compile_object OBJECT SOURCE)\r
-    get_property(FLAGS SOURCE ${SOURCE} PROPERTY COMPILE_FLAGS)\r
-    get_property(DEFINES SOURCE ${SOURCE} PROPERTY COMPILE_DEFINITIONS)\r
-    get_property(INCLUDE_DIRECTORIES DIRECTORY PROPERTY INCLUDE_DIRECTORIES)\r
-\r
-    foreach(DIR ${INCLUDE_DIRECTORIES})\r
-        set(FLAGS "${FLAGS} -I${DIR}")\r
-    endforeach()\r
-\r
-    set(IDL_COMMAND ${CMAKE_IDL_COMPILE_OBJECT})\r
-    string(REPLACE "<CMAKE_IDL_COMPILER>" "${CMAKE_IDL_COMPILER}" IDL_COMMAND "${IDL_COMMAND}")\r
-    string(REPLACE <FLAGS> "${FLAGS}" IDL_COMMAND "${IDL_COMMAND}")\r
-    string(REPLACE "<DEFINES>" "${DEFINES}" IDL_COMMAND "${IDL_COMMAND}")\r
-    string(REPLACE "<OBJECT>" "${OBJECT}" IDL_COMMAND "${IDL_COMMAND}")\r
-    string(REPLACE "<SOURCE>" "${SOURCE}" IDL_COMMAND "${IDL_COMMAND}")\r
-    separate_arguments(IDL_COMMAND)\r
-\r
-    add_custom_command(\r
-        OUTPUT ${OBJECT}\r
-        COMMAND ${IDL_COMMAND}\r
-        DEPENDS ${SOURCE}\r
-        VERBATIM)\r
-endmacro()\r
-\r
-macro(add_interface_definitions TARGET)\r
-    foreach(SOURCE ${ARGN})\r
-        get_filename_component(FILE ${SOURCE} NAME_WE)\r
-        set(OBJECT ${CMAKE_CURRENT_BINARY_DIR}/${FILE}.h)\r
-        idl_compile_object(${OBJECT} ${CMAKE_CURRENT_SOURCE_DIR}/${SOURCE})\r
-        list(APPEND OBJECTS ${OBJECT})\r
-    endforeach()\r
-    add_custom_target(${TARGET} ALL DEPENDS ${OBJECTS})\r
-endmacro()\r
-\r
 macro(add_minicd_target _targetname _dir) # optional parameter: _nameoncd\r
     if("${ARGN}" STREQUAL "")\r
         get_target_property(FILENAME ${_targetname} LOCATION)\r
@@ -151,97 +117,6 @@ macro(add_cab FILENAME _num)
     add_livecd(${FILENAME} ${_dir})\r
 endmacro()\r
 \r
-macro(custom_incdefs)\r
-    if(NOT DEFINED result_incs) #rpc_defines\r
-        get_directory_property(rpc_defines COMPILE_DEFINITIONS)\r
-        get_directory_property(rpc_includes INCLUDE_DIRECTORIES)\r
-\r
-        foreach(arg ${rpc_defines})\r
-            set(result_defs ${result_defs} -D${arg})\r
-        endforeach()\r
-\r
-        foreach(arg ${rpc_includes})\r
-            set(result_incs -I${arg} ${result_incs})\r
-        endforeach()\r
-    endif()\r
-endmacro()\r
-\r
-macro(rpcproxy TARGET)\r
-    custom_incdefs()\r
-    list(APPEND SOURCE ${CMAKE_CURRENT_BINARY_DIR}/${TARGET}_proxy.dlldata.c)\r
-\r
-    foreach(_in_FILE ${ARGN})\r
-        get_filename_component(FILE ${_in_FILE} NAME_WE)\r
-        add_custom_command(\r
-            OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/${FILE}_p.h ${CMAKE_CURRENT_BINARY_DIR}/${FILE}_p.c\r
-            COMMAND ${IDL_COMPILER} ${result_incs} ${result_defs} ${IDL_FLAGS} ${IDL_HEADER_ARG} ${CMAKE_CURRENT_BINARY_DIR}/${FILE}_p.h ${IDL_PROXY_ARG} ${CMAKE_CURRENT_BINARY_DIR}/${FILE}_p.c ${CMAKE_CURRENT_SOURCE_DIR}/${FILE}.idl\r
-            DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/${FILE}.idl)\r
-        set_source_files_properties(\r
-            ${CMAKE_CURRENT_BINARY_DIR}/${FILE}_c.h ${CMAKE_CURRENT_BINARY_DIR}/${FILE}_p.c\r
-            PROPERTIES GENERATED TRUE)\r
-        list(APPEND SOURCE ${CMAKE_CURRENT_BINARY_DIR}/${FILE}_p.c)\r
-        list(APPEND IDLS ${CMAKE_CURRENT_SOURCE_DIR}/${FILE}.idl)\r
-    endforeach()\r
-\r
-    add_custom_command(\r
-        OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/${TARGET}_proxy.dlldata.c\r
-        COMMAND ${IDL_COMPILER} ${result_incs} ${result_defs} ${IDL_FLAGS} ${IDL_DLLDATA_ARG} ${CMAKE_CURRENT_BINARY_DIR}/${TARGET}_proxy.dlldata.c ${IDLS}\r
-        DEPENDS ${IDLS})\r
-    set_source_files_properties(\r
-        ${CMAKE_CURRENT_BINARY_DIR}/${TARGET}_proxy.dlldata.c\r
-        PROPERTIES GENERATED TRUE)\r
-endmacro()\r
-\r
-macro(idl_files)\r
-    custom_incdefs()\r
-    foreach(_in_FILE ${ARGN})\r
-        get_filename_component(FILE ${_in_FILE} NAME_WE)\r
-        add_custom_command(\r
-            OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/${FILE}_s.h ${CMAKE_CURRENT_BINARY_DIR}/${FILE}_s.c\r
-            COMMAND ${IDL_COMPILER} ${result_incs} ${result_defs} ${IDL_FLAGS} -h -H ${CMAKE_CURRENT_BINARY_DIR}/${FILE}_s.h ${IDL_SERVER_ARG} ${CMAKE_CURRENT_BINARY_DIR}/${FILE}_s.c ${CMAKE_CURRENT_SOURCE_DIR}/${FILE}.idl\r
-            DEPENDS ${_in_file})\r
-        set_source_files_properties(\r
-            ${CMAKE_CURRENT_BINARY_DIR}/${FILE}_s.h ${CMAKE_CURRENT_BINARY_DIR}/${FILE}_s.c\r
-            PROPERTIES GENERATED TRUE)\r
-        add_library(${FILE}_server ${CMAKE_CURRENT_BINARY_DIR}/${FILE}_s.c)\r
-        add_dependencies(${FILE}_server psdk)\r
-\r
-        add_custom_command(\r
-            OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/${FILE}_c.h ${CMAKE_CURRENT_BINARY_DIR}/${FILE}_c.c\r
-            COMMAND ${IDL_COMPILER} ${result_incs} ${result_defs} ${IDL_FLAGS} -h -H ${CMAKE_CURRENT_BINARY_DIR}/${FILE}_c.h ${IDL_CLIENT_ARG} ${CMAKE_CURRENT_BINARY_DIR}/${FILE}_c.c ${CMAKE_CURRENT_SOURCE_DIR}/${FILE}.idl\r
-            DEPENDS ${_in_file})\r
-        set_source_files_properties(\r
-            ${CMAKE_CURRENT_BINARY_DIR}/${FILE}_c.h ${CMAKE_CURRENT_BINARY_DIR}/${FILE}_c.c\r
-            PROPERTIES GENERATED TRUE)\r
-        add_library(${FILE}_client ${CMAKE_CURRENT_BINARY_DIR}/${FILE}_c.c)\r
-        add_dependencies(${FILE}_client psdk)\r
-    endforeach()\r
-endmacro()\r
-\r
-macro(add_typelib TARGET)\r
-    custom_incdefs()\r
-    foreach(SOURCE ${ARGN})\r
-        get_filename_component(FILE ${SOURCE} NAME_WE)\r
-        set(OBJECT ${CMAKE_CURRENT_BINARY_DIR}/${FILE}.tlb)\r
-        add_custom_command(\r
-            OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/${FILE}.tlb\r
-            COMMAND ${IDL_COMPILER} ${result_incs} ${IDL_FLAGS} ${IDL_TYPELIB_ARG} ${CMAKE_CURRENT_BINARY_DIR}/${FILE}.tlb ${CMAKE_CURRENT_SOURCE_DIR}/${SOURCE}\r
-            DEPENDS ${SOURCE})\r
-        list(APPEND OBJECTS ${OBJECT})\r
-    endforeach()\r
-    add_custom_target(${TARGET} ALL DEPENDS ${OBJECTS})\r
-endmacro()\r
-\r
-macro(add_idl_interface IDL_FILE)\r
-    custom_incdefs()\r
-    get_filename_component(FILE ${IDL_FILE} NAME_WE)\r
-    add_custom_command(\r
-        OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/${FILE}_i.c\r
-        COMMAND ${IDL_COMPILER} ${result_incs} ${result_defs} ${IDL_FLAGS} ${IDL_INTERFACE_ARG} ${CMAKE_CURRENT_BINARY_DIR}/${FILE}_i.c ${CMAKE_CURRENT_SOURCE_DIR}/${IDL_FILE}\r
-        DEPENDS ${IDL_FILE})\r
-    set_source_files_properties(${CMAKE_CURRENT_BINARY_DIR}/${FILE}_i.c PROPERTIES GENERATED TRUE)\r
-endmacro()\r
-\r
 macro(add_dependency_node _node)\r
     if(GENERATE_DEPENDENCY_GRAPH)\r
         get_target_property(_type ${_node} TYPE)\r
index 167649b..570c1c3 100644 (file)
@@ -12,7 +12,7 @@ list(APPEND SOURCE
 
 add_executable(eventlog ${CMAKE_CURRENT_BINARY_DIR}/eventlog_eventlog.h.gch ${SOURCE})
 
-target_link_libraries(eventlog eventlogrpc_server ${PSEH_LIB})
+target_link_libraries(eventlog eventlogrpc ${PSEH_LIB})
 
 add_pch(eventlog ${CMAKE_CURRENT_SOURCE_DIR}/eventlog.h ${SOURCE})
 
index 214db30..3ea2156 100644 (file)
@@ -12,7 +12,7 @@ include_directories(${REACTOS_BINARY_DIR}/include/reactos/wine)
 
 add_executable(rpcss ${SOURCE})
 
-target_link_libraries(rpcss epm_server irot_server ${PSEH_LIB} wine)
+target_link_libraries(rpcss epmrpc irotrpc ${PSEH_LIB} wine)
 
 set_module_type(rpcss win32cui)
 
index 923acc9..03ccbec 100644 (file)
@@ -7,7 +7,7 @@ remove_definitions(-D_WIN32_WINNT=0x502)
 add_definitions(-D_WIN32_WINNT=0x600)
 
 add_executable(umpnpmgr umpnpmgr.c umpnpmgr.rc)
-target_link_libraries(umpnpmgr pnp_server wdmguid ${PSEH_LIB})
+target_link_libraries(umpnpmgr pnprpc wdmguid ${PSEH_LIB})
 
 set_module_type(umpnpmgr win32cui)
 add_importlibs(umpnpmgr advapi32 rpcrt4 userenv msvcrt kernel32 ntdll)
index 305aefa..284e925 100644 (file)
@@ -4,7 +4,7 @@ include_directories(${REACTOS_BINARY_DIR}/include/reactos/idl)
 
 add_executable(wlansvc wlansvc.c rpcserver.c)
 
-target_link_libraries(wlansvc wlansvc_server ${PSEH_LIB})
+target_link_libraries(wlansvc wlansvcrpc ${PSEH_LIB})
 
 set_module_type(wlansvc win32cui)
 add_importlibs(wlansvc advapi32 rpcrt4 iphlpapi msvcrt kernel32 ntdll)
index 63f31bb..ef34a52 100644 (file)
@@ -17,7 +17,7 @@ list(APPEND SOURCE
 add_executable(services ${CMAKE_CURRENT_BINARY_DIR}/services_services.h.gch ${SOURCE})
 
 target_link_libraries(services
-    svcctl_server
+    svcctlrpc
     ${PSEH_LIB})
 
 add_pch(services ${CMAKE_CURRENT_SOURCE_DIR}/services.h ${SOURCE})
diff --git a/cmake/idl-support.cmake b/cmake/idl-support.cmake
new file mode 100644 (file)
index 0000000..4a5ad90
--- /dev/null
@@ -0,0 +1,151 @@
+
+#idl files support
+if(MSVC)
+    set(IDL_COMPILER midl)
+    set(IDL_HEADER_ARG /h) #.h
+    set(IDL_HEADER_ARG2 /h) #.h
+    set(IDL_TYPELIB_ARG /tlb) #.tlb
+    set(IDL_SERVER_ARG /sstub) #.c for stub server library
+    set(IDL_CLIENT_ARG /cstub) #.c for stub client library
+    set(IDL_PROXY_ARG /proxy)
+    set(IDL_INTERFACE_ARG /iid)
+    if(ARCH MATCHES i386)
+        set(IDL_FLAGS /win32)
+    elseif(ARCH MATCHES amd64)
+        set(IDL_FLAGS /amd64)
+    else()
+        set(IDL_FLAGS "")
+    endif()
+else()
+    set(IDL_COMPILER native-widl)
+    set(IDL_HEADER_ARG -h -o) #.h
+    set(IDL_HEADER_ARG2 -h -H) #.h
+    set(IDL_TYPELIB_ARG -t -o) #.tlb
+    set(IDL_SERVER_ARG -s -S) #.c for server library
+    set(IDL_CLIENT_ARG -c -C) #.c for stub client library
+    set(IDL_PROXY_ARG -p -P)
+    set(IDL_INTERFACE_ARG -u -o)
+    if(ARCH MATCHES i386)
+        set(IDL_FLAGS -m32 --win32)
+    elseif(ARCH MATCHES amd64)
+        set(IDL_FLAGS -m64 --win64)
+    else()
+        set(IDL_FLAGS "")
+    endif()
+endif()
+
+
+macro(get_includes OUTPUT_VAR)
+    get_directory_property(_includes INCLUDE_DIRECTORIES)
+    foreach(arg ${_includes})
+        set(${OUTPUT_VAR} -I${arg} ${${OUTPUT_VAR}})
+    endforeach()
+endmacro()
+
+macro(get_defines OUTPUT_VAR)
+    get_directory_property(_defines COMPILE_DEFINITIONS)
+    foreach(arg ${_defines})
+        set(${OUTPUT_VAR} ${${OUTPUT_VAR}} -D${arg})
+    endforeach()
+endmacro()
+
+macro(add_typelib TARGET)
+    get_includes(INCLUDES)
+    get_defines(DEFINES)
+    foreach(FILE ${ARGN})
+        get_filename_component(NAME ${FILE} NAME_WE)
+        add_custom_command(
+            OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/${NAME}.tlb
+            COMMAND ${IDL_COMPILER} ${INCLUDES} ${DEFINES} ${IDL_FLAGS} ${IDL_TYPELIB_ARG} ${CMAKE_CURRENT_BINARY_DIR}/${NAME}.tlb ${CMAKE_CURRENT_SOURCE_DIR}/${FILE}
+            DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/${FILE})
+        list(APPEND OBJECTS ${CMAKE_CURRENT_BINARY_DIR}/${NAME}.tlb)
+    endforeach()
+    add_custom_target(${TARGET} ALL DEPENDS ${OBJECTS})
+endmacro()
+
+macro(add_idl_headers TARGET)
+    get_includes(INCLUDES)
+    get_defines(DEFINES)
+    foreach(FILE ${ARGN})
+        get_filename_component(NAME ${FILE} NAME_WE)
+        set(HEADER ${CMAKE_CURRENT_BINARY_DIR}/${NAME}.h)
+        add_custom_command(
+            OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/${NAME}.h
+            COMMAND ${IDL_COMPILER} ${INCLUDES} ${DEFINES} ${IDL_FLAGS} ${IDL_HEADER_ARG} ${CMAKE_CURRENT_BINARY_DIR}/${NAME}.h ${CMAKE_CURRENT_SOURCE_DIR}/${FILE}
+            DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/${FILE})
+        list(APPEND HEADERS ${HEADER})
+    endforeach()
+    add_custom_target(${TARGET} ALL DEPENDS ${HEADERS})
+endmacro()
+
+macro(add_rpcproxy_library TARGET)
+    get_includes(INCLUDES)
+    get_defines(DEFINES)
+    foreach(FILE ${ARGN})
+        get_filename_component(NAME ${FILE} NAME_WE)
+        if(MSVC)
+            set(IDL_DLLDATA_ARG /dlldata ${CMAKE_CURRENT_BINARY_DIR}/${TARGET}_proxy.dlldata.c)
+        else()
+            set(IDL_DLLDATA_ARG "")
+        endif()
+        add_custom_command(
+            OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/${NAME}_p.h ${CMAKE_CURRENT_BINARY_DIR}/${NAME}_p.c
+            COMMAND ${IDL_COMPILER} ${INCLUDES} ${DEFINES} ${IDL_FLAGS} ${IDL_HEADER_ARG} ${CMAKE_CURRENT_BINARY_DIR}/${NAME}_p.h ${IDL_PROXY_ARG} ${CMAKE_CURRENT_BINARY_DIR}/${NAME}_p.c ${IDL_DLLDATA_ARG} ${CMAKE_CURRENT_SOURCE_DIR}/${FILE}
+            DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/${FILE})
+        set_source_files_properties(
+            ${CMAKE_CURRENT_BINARY_DIR}/${NAME}_c.h ${CMAKE_CURRENT_BINARY_DIR}/${NAME}_p.c
+            PROPERTIES GENERATED TRUE)
+        list(APPEND rpcproxy_SOURCES ${CMAKE_CURRENT_BINARY_DIR}/${NAME}_p.c)
+        list(APPEND IDLS ${CMAKE_CURRENT_SOURCE_DIR}/${NAME}.idl)
+    endforeach()
+
+    if(NOT MSVC)
+        # Extra pass to generate dlldata for widl
+        add_custom_command(
+            OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/${TARGET}_proxy.dlldata.c
+            COMMAND ${IDL_COMPILER} ${INCLUDES} ${DEFINES} ${IDL_FLAGS} --dlldata-only -o ${CMAKE_CURRENT_BINARY_DIR}/${TARGET}_proxy.dlldata.c ${IDLS}
+            DEPENDS ${IDLS})
+    endif()
+    set_source_files_properties(
+        ${CMAKE_CURRENT_BINARY_DIR}/${TARGET}_proxy.dlldata.c
+        PROPERTIES GENERATED TRUE)
+    add_library(${TARGET} ${CMAKE_CURRENT_BINARY_DIR}/${TARGET}_proxy.dlldata.c ${rpcproxy_SOURCES})
+endmacro()
+
+macro(add_rpc_library TARGET)
+    get_includes(INCLUDES)
+    get_defines(DEFINES)
+    foreach(FILE ${ARGN})
+        get_filename_component(NAME ${FILE} NAME_WE)
+        add_custom_command(
+            OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/${NAME}_s.h ${CMAKE_CURRENT_BINARY_DIR}/${NAME}_s.c
+            COMMAND ${IDL_COMPILER} ${INCLUDES} ${DEFINES} ${IDL_FLAGS} ${IDL_HEADER_ARG2} ${CMAKE_CURRENT_BINARY_DIR}/${NAME}_s.h ${IDL_SERVER_ARG} ${CMAKE_CURRENT_BINARY_DIR}/${NAME}_s.c ${CMAKE_CURRENT_SOURCE_DIR}/${FILE}
+            DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/${FILE})
+        set_source_files_properties(
+            ${CMAKE_CURRENT_BINARY_DIR}/${NAME}_s.h ${CMAKE_CURRENT_BINARY_DIR}/${NAME}_s.c
+            PROPERTIES GENERATED TRUE)
+        list(APPEND server_SOURCES ${CMAKE_CURRENT_BINARY_DIR}/${NAME}_s.c)
+
+        add_custom_command(
+            OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/${NAME}_c.h ${CMAKE_CURRENT_BINARY_DIR}/${NAME}_c.c
+            COMMAND ${IDL_COMPILER} ${INCLUDES} ${DEFINES} ${IDL_FLAGS} ${IDL_HEADER_ARG2} ${CMAKE_CURRENT_BINARY_DIR}/${NAME}_c.h ${IDL_CLIENT_ARG} ${CMAKE_CURRENT_BINARY_DIR}/${NAME}_c.c ${CMAKE_CURRENT_SOURCE_DIR}/${FILE}
+            DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/${FILE})
+        set_source_files_properties(
+            ${CMAKE_CURRENT_BINARY_DIR}/${NAME}_c.h ${CMAKE_CURRENT_BINARY_DIR}/${NAME}_c.c
+            PROPERTIES GENERATED TRUE)
+        list(APPEND client_SOURCES ${CMAKE_CURRENT_BINARY_DIR}/${NAME}_c.c)
+    endforeach()
+    add_library(${TARGET} ${server_SOURCES} ${client_SOURCES})
+    add_dependencies(${TARGET} psdk)
+endmacro()
+
+macro(generate_idl_iids IDL_FILE)
+    get_includes(INCLUDES)
+    get_defines(DEFINES)
+    get_filename_component(NAME ${IDL_FILE} NAME_WE)
+    add_custom_command(
+        OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/${NAME}_i.c
+        COMMAND ${IDL_COMPILER} ${INCLUDES} ${DEFINES} ${IDL_FLAGS} ${IDL_INTERFACE_ARG} ${CMAKE_CURRENT_BINARY_DIR}/${NAME}_i.c ${CMAKE_CURRENT_SOURCE_DIR}/${IDL_FILE}
+        DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/${IDL_FILE})
+    set_source_files_properties(${CMAKE_CURRENT_BINARY_DIR}/${NAME}_i.c PROPERTIES GENERATED TRUE)
+endmacro()
index e0eb0b2..669c3e7 100644 (file)
@@ -11,10 +11,12 @@ if not "%ROS_ARCH%" == "" (
 )
 if not "%DDK_TARGET_OS%" == "" (
     echo Detected DDK/WDK for %_BUILDARCH%
-    set ARCH=%_BUILDARCH%
     if "%_BUILDARCH%" == "x86" (
         set ARCH=i386
     )
+    if "%_BUILDARCH%" == "AMD64" (
+        set ARCH=amd64
+    )
     set BUILD_ENVIRONMENT=WDK
 )
 
@@ -25,7 +27,9 @@ if not exist host-tools (
     mkdir host-tools
 )
 cd host-tools
-del CMakeCache.txt /q
+if EXIST CMakeCache.txt (
+    del CMakeCache.txt /q
+)
 set REACTOS_BUILD_TOOLS_DIR=%CD%
 if "%BUILD_ENVIRONMENT%" == "MINGW" (
        cmake -G "MinGW Makefiles" -DARCH=%ARCH% %ROS_SOURCE_DIR%
@@ -41,7 +45,9 @@ if not exist reactos (
 )
 
 cd reactos
-del CMakeCache.txt /q
+if EXIST CMakeCache.txt (
+    del CMakeCache.txt /q
+)
 if "%BUILD_ENVIRONMENT%" == "MINGW" (
     cmake -G "MinGW Makefiles" -DCMAKE_TOOLCHAIN_FILE=toolchain-mingw32.cmake -DARCH=%ARCH% -DREACTOS_BUILD_TOOLS_DIR:DIR="%REACTOS_BUILD_TOOLS_DIR%" %ROS_SOURCE_DIR%
 )
index 75ba2cb..66c8e35 100644 (file)
@@ -14,7 +14,7 @@ include_directories(${REACTOS_SOURCE_DIR}/include/reactos/wine)
 
 spec2def(quartz.dll quartz.spec)
 
-rpcproxy(quartz quartz_strmif.idl)
+add_rpcproxy_library(quartzproxy quartz_strmif.idl)
 
 list(APPEND SOURCE
     avidec.c
@@ -49,6 +49,7 @@ add_library(quartz SHARED ${SOURCE})
 set_module_type(quartz win32dll)
 
 target_link_libraries(quartz
+    quartzproxy
     strmiids
     uuid
     wine
index 870d5f6..a3ebbb8 100644 (file)
@@ -4,7 +4,7 @@ include_directories(${REACTOS_SOURCE_DIR}/include/reactos/wine)
 
 spec2def(actxprxy.dll actxprxy.spec)
 
-rpcproxy(actxprxy
+add_rpcproxy_library(actxprxylib
     actxprxy_activscp.idl
     actxprxy_comcat.idl
     actxprxy_docobj.idl
@@ -25,6 +25,7 @@ add_library(actxprxy SHARED ${SOURCE})
 set_entrypoint(actxprxy 0)
 
 target_link_libraries(actxprxy
+    actxprxylib
     uuid
     wine
     ${PSEH_LIB})
index 6f24978..b20aba7 100644 (file)
@@ -52,9 +52,9 @@ add_library(advapi32 SHARED
 set_module_type(advapi32 win32dll)
 
 target_link_libraries(advapi32
-    svcctl_client
-    lsa_client
-    eventlogrpc_client
+    svcctlrpc
+    lsarpc
+    eventlogrpc
     wine
     ${PSEH_LIB})
 
index 0281951..f6376ab 100644 (file)
@@ -6,7 +6,7 @@ add_definitions(-D_WIN32_WINNT=0x600)
 
 include_directories(${REACTOS_SOURCE_DIR}/include/reactos/wine)
 
-add_interface_definitions(atl_atliface_header atliface.idl)
+add_idl_headers(atl_atliface_header atliface.idl)
 
 set_rc_compiler()
 spec2def(atl.dll atl.spec)
index a2a69b8..2f1718c 100644 (file)
@@ -23,7 +23,7 @@ add_library(lsasrv SHARED ${SOURCE})
 set_entrypoint(lsasrv 0)
 
 target_link_libraries(lsasrv
-    lsa_server
+    lsarpc
     wine
     ${PSEH_LIB})
 
index 8714e3b..c9be5b8 100644 (file)
@@ -9,7 +9,7 @@ add_definitions(
 
 include_directories(${REACTOS_SOURCE_DIR}/include/reactos/wine)
 
-add_interface_definitions(mshtml_nsiface_header nsiface.idl)
+add_idl_Headers(mshtml_nsiface_header nsiface.idl)
 
 set_rc_compiler()
 
index 008836f..21ddcfc 100644 (file)
@@ -7,7 +7,7 @@ add_definitions(-D_WIN32_WINNT=0x600)
 
 spec2def(msi.dll msi.spec)
 
-add_idl_interface(msiserver.idl)
+generate_idl_iids(msiserver.idl)
 
 list(APPEND SOURCE
     action.c
@@ -60,7 +60,7 @@ list(APPEND SOURCE
 
 add_library(msi SHARED ${SOURCE})
 
-add_interface_definitions(msi_idlheader msiserver.idl)
+add_idl_Headers(msi_idlheader msiserver.idl)
 
 add_typelib(msi_tlb msiserver.idl)
 
index 8fc8c60..d5d0406 100644 (file)
@@ -9,7 +9,7 @@ add_definitions(-D_WIN32_WINNT=0x600)
 
 include_directories(${REACTOS_SOURCE_DIR}/include/reactos/wine)
 
-add_idl_interface(mstask_local.idl)
+generate_idl_iids(mstask_local.idl)
 
 spec2def(mstask.dll mstask.spec)
 
index 09fc961..e9a0dec 100644 (file)
@@ -54,9 +54,9 @@ include_directories(
     ${CMAKE_CURRENT_BINARY_DIR}
     ${REACTOS_SOURCE_DIR}/include/reactos/wine)
 
-add_interface_definitions(ole32idl dcom.idl irot.idl)
+add_idl_headers(ole32idl dcom.idl irot.idl)
 
-rpcproxy(ole32
+add_rpcproxy_library(ole32proxy
     dcom.idl
     ole32_unknwn.idl
     ole32_objidl.idl
@@ -69,8 +69,9 @@ add_library(ole32 SHARED ${SOURCE})
 set_module_type(ole32 win32dll)
 
 target_link_libraries(ole32
+    ole32proxy
     wine
-    irot_client
+    irotrpc
     uuid
     ${PSEH_LIB})
     
index c641ab0..4423820 100644 (file)
@@ -46,13 +46,14 @@ include_directories(
 
 spec2def(oleaut32.dll oleaut32.spec)
 
-rpcproxy(oleaut32 oleaut32_oaidl.idl oleaut32_ocidl.idl)
+add_rpcproxy_library(oleaut32proxy oleaut32_oaidl.idl oleaut32_ocidl.idl)
 
 add_library(oleaut32 SHARED ${SOURCE})
 
 set_module_type(oleaut32 win32dll)
 
 target_link_libraries(oleaut32
+    oleaut32proxy
     wine
     wineldr
     uuid
index 1db6c3f..1d00c96 100644 (file)
@@ -2,7 +2,7 @@
 add_definitions(-D__WINESRC__)
 include_directories(${REACTOS_SOURCE_DIR}/include/reactos/wine)
 
-add_idl_interface(qmgr_local.idl)
+generate_idl_iids(qmgr_local.idl)
 
 spec2def(qmgr.dll qmgr.spec)
 
@@ -21,7 +21,7 @@ list(APPEND SOURCE
 
 add_library(qmgr SHARED ${SOURCE})
 
-add_interface_definitions(qmgr_idlheader qmgr_local.idl)
+add_idl_headers(qmgr_idlheader qmgr_local.idl)
 
 set_module_type(qmgr win32dll)
 target_link_libraries(qmgr uuid wine)
index ecd9446..1659811 100644 (file)
@@ -5,7 +5,7 @@ add_definitions(
 
 include_directories(${REACTOS_SOURCE_DIR}/include/reactos/wine)
 
-add_idl_interface(qmgrprxy.idl)
+generate_idl_iids(qmgrprxy.idl)
 
 spec2def(qmgrprxy.dll qmgrprxy.spec)
 
@@ -14,11 +14,11 @@ list(APPEND SOURCE
     ${CMAKE_CURRENT_BINARY_DIR}/qmgrprxy_i.c
     ${CMAKE_CURRENT_BINARY_DIR}/qmgrprxy.def)
 
-rpcproxy(qmgrprxy qmgrprxy.idl)
+add_rpcproxy_library(qmgrprxylib qmgrprxy.idl)
 
 add_library(qmgrprxy SHARED ${SOURCE})
 
 set_module_type(qmgrprxy win32dll)
-target_link_libraries(qmgrprxy ${PSEH_LIB} wine)
+target_link_libraries(qmgrprxy qmgrprxylib ${PSEH_LIB} wine)
 add_importlibs(qmgrprxy rpcrt4 msvcrt kernel32 ntdll)
 add_cab_target(qmgrprxy 1)
index 7e8d43c..c62df39 100644 (file)
@@ -43,7 +43,7 @@ include_directories(
 target_link_libraries(rpcrt4
     wine
     uuid
-    epm_client
+    epmrpc
     ${PSEH_LIB})
 
 add_importlibs(rpcrt4 msvcrt user32 advapi32 secur32 iphlpapi ws2_32 kernel32 ntdll)
index 40e3095..1347ac7 100644 (file)
@@ -40,7 +40,7 @@ add_library(setupapi SHARED ${SOURCE})
 set_module_type(setupapi win32dll)
 
 target_link_libraries(setupapi
-    pnp_client
+    pnprpc
     uuid
     wine
     ${PSEH_LIB})
index 1a4e2b4..87b20b4 100644 (file)
@@ -12,7 +12,7 @@ include_directories(
     ${REACTOS_SOURCE_DIR}/lib/recyclebin
     ${REACTOS_SOURCE_DIR})
 
-add_idl_interface(shobjidl_local.idl)
+generate_idl_iids(shobjidl_local.idl)
 
 spec2def(shell32.dll shell32.spec)
 
index f069fbf..c1c7fa6 100644 (file)
@@ -18,13 +18,14 @@ list(APPEND SOURCE
     sti_main.c
     ${CMAKE_CURRENT_BINARY_DIR}/sti.def)
 
-rpcproxy(sti sti_wia.idl)
+add_rpcproxy_library(stiproxy sti_wia.idl)
 
 add_library(sti SHARED ${SOURCE})
 
 set_entrypoint(sti 0)
 
 target_link_libraries(sti
+    stiproxy
     wine
     uuid
     ${PSEH_LIB})
index ca1835c..0c40f2f 100644 (file)
@@ -8,7 +8,7 @@ include_directories(${REACTOS_SOURCE_DIR}/include/reactos/wine)
 
 spec2def(urlmon.dll urlmon.spec)
 
-rpcproxy(urlmon urlmon_urlmon.idl)
+add_rpcproxy_library(urlmonproxy urlmon_urlmon.idl)
 
 list(APPEND SOURCE
     bindctx.c
@@ -42,6 +42,7 @@ add_library(urlmon SHARED ${SOURCE})
 set_module_type(urlmon win32dll)
 
 target_link_libraries(urlmon
+    urlmonproxy
     uuid
     wine
     ${PSEH_LIB})
index 93fd1c3..47320e1 100644 (file)
@@ -12,7 +12,7 @@ add_library(wlanapi SHARED ${SOURCE})
 set_entrypoint(wlanapi 0)
 
 target_link_libraries(wlanapi
-    wlansvc_client
+    wlansvcrpc
     wine
     ${PSEH_LIB})
 
index 79b1111..e32d6af 100644 (file)
--- a/gcc.cmake
+++ b/gcc.cmake
@@ -1,6 +1,4 @@
 
-if(CMAKE_CROSSCOMPILING)
-
 # Linking
 if(ARCH MATCHES i386)
 link_directories("${REACTOS_SOURCE_DIR}/importlibs")
@@ -317,5 +315,3 @@ endmacro()
 
 #pseh lib, needed with mingw
 set(PSEH_LIB "pseh")
-
-endif(CMAKE_CROSSCOMPILING)
index 0d19a12..97fb266 100644 (file)
@@ -24,4 +24,4 @@ list(APPEND SOURCE
     #vmrender.idl
 )
 
-add_interface_definitions(dxsdk ${SOURCE})
+add_idl_headers(dxsdk ${SOURCE})
index f572856..db9fa09 100644 (file)
@@ -92,7 +92,6 @@ list(APPEND SOURCE
     urlmon.idl
     vmr9.idl
 #   vmrender.idl
-    wbemcli.idl
     wia_lh.idl
     wia_xp.idl
     winsxs.idl
@@ -104,10 +103,11 @@ list(APPEND SOURCE
 
 if(NOT MSVC)
   list(APPEND SOURCE
+    wbemcli.idl
     wincodec.idl
     wuapi.idl)
 endif()
 
-add_interface_definitions(psdk ${SOURCE})
+add_idl_headers(psdk ${SOURCE})
 
 add_typelib(stdole2 stdole2.idl)
index c6f98c3..dd71249 100644 (file)
@@ -1,15 +1,12 @@
 
 include_directories(.)
 
-list(APPEND SOURCE
-    eventlogrpc.idl
-    lsa.idl
-    svcctl.idl
-    wlansvc.idl)
-
-idl_files(${SOURCE})
+add_rpc_library(eventlogrpc eventlogrpc.idl)
+add_rpc_library(lsarpc lsa.idl)
+add_rpc_library(svcctlrpc svcctl.idl)
+add_rpc_library(wlansvcrpc wlansvc.idl)
 
 remove_definitions(-D_WIN32_WINNT=0x502)
 add_definitions(-D_WIN32_WINNT=0x600)
 
-idl_files(pnp.idl)
+add_rpc_library(pnprpc pnp.idl)
index 4a50104..828e0e2 100644 (file)
@@ -1,9 +1,7 @@
 
-add_interface_definitions(wineheaders itss.idl wined3d.idl)
+add_idl_headers(wineheaders itss.idl wined3d.idl)
+add_idl_headers(winesdk epm.idl irot.idl)
 
-list(APPEND SOURCE
-    epm.idl
-    irot.idl)
+add_rpc_library(epmrpc epm.idl)
+add_rpc_library(irotrpc irot.idl)
 
-idl_files(${SOURCE})
-add_interface_definitions(winesdk ${SOURCE})
index 6cabe50..2989ea1 100644 (file)
@@ -1,4 +1,5 @@
 
+if(NOT MSVC)
 add_definitions(-D_NTSYSTEM_)
 list(APPEND SOURCE
     delete.c
@@ -20,3 +21,4 @@ list(APPEND SOURCE
     zwfile.c)
 add_library(rossym ${SOURCE})
 add_dependencies(rossym psdk bugcodes)
+endif()
index b6d2c7d..1080c11 100644 (file)
--- a/msc.cmake
+++ b/msc.cmake
@@ -1,12 +1,4 @@
 \r
-if(CMAKE_SYSTEM_PROCESSOR MATCHES "x86")\r
-    add_definitions(-D__i386__)\r
-endif()\r
-\r
-add_definitions(-Dinline=__inline)\r
-\r
-if(CMAKE_CROSSCOMPILING)\r
-\r
 if(OPTIMIZE STREQUAL "1")\r
     add_definitions(/O1)\r
 elseif(OPTIMIZE STREQUAL "2")\r
@@ -28,6 +20,10 @@ if(${_MACHINE_ARCH_FLAG} MATCHES X86)
   set(CMAKE_MODULE_LINKER_FLAGS "${CMAKE_MODULE_LINKER_FLAGS} /SAFESEH:NO")\r
 endif()\r
 \r
+if(${ARCH} MATCHES amd64)\r
+    add_definitions(-D__x86_64)\r
+endif()\r
+\r
 link_directories("${REACTOS_BINARY_DIR}/importlibs" ${REACTOS_BINARY_DIR}/lib/3rdparty/mingw)\r
 \r
 set(CMAKE_RC_CREATE_SHARED_LIBRARY "<CMAKE_C_COMPILER> <CMAKE_SHARED_LIBRARY_C_FLAGS> <LINK_FLAGS> <CMAKE_SHARED_LIBRARY_CREATE_C_FLAGS> -o <TARGET> <OBJECTS> <LINK_LIBRARIES>")\r
@@ -137,16 +133,6 @@ macro(set_rc_compiler)
 # dummy, this workaround is only needed in mingw due to lack of RC support in cmake\r
 endmacro()\r
 \r
-#idl files support\r
-set(IDL_COMPILER midl)\r
-set(IDL_FLAGS /win32)\r
-set(IDL_HEADER_ARG /h) #.h\r
-set(IDL_TYPELIB_ARG /tlb) #.tlb\r
-set(IDL_SERVER_ARG /sstub) #.c for stub server library\r
-set(IDL_CLIENT_ARG /cstub) #.c for stub client library\r
-set(IDL_PROXY_ARG /proxy)\r
-set(IDL_DLLDATA_ARG /dlldata )\r
-\r
 # Thanks MS for creating a stupid linker\r
 macro(add_importlib_target _exports_file)\r
     get_filename_component(_name ${_exports_file} NAME_WE)\r
@@ -154,7 +140,7 @@ macro(add_importlib_target _exports_file)
     # Generate the asm stub file and the export def file\r
     add_custom_command(\r
         OUTPUT ${CMAKE_BINARY_DIR}/importlibs/lib${_name}_stubs.asm ${CMAKE_BINARY_DIR}/importlibs/lib${_name}_exp.def\r
-        COMMAND native-spec2def -@ -r -d=${CMAKE_BINARY_DIR}/importlibs/lib${_name}_exp.def -l=${CMAKE_BINARY_DIR}/importlibs/lib${_name}_stubs.asm ${CMAKE_CURRENT_SOURCE_DIR}/${_exports_file}\r
+        COMMAND native-spec2def --kill-at -r -d=${CMAKE_BINARY_DIR}/importlibs/lib${_name}_exp.def -l=${CMAKE_BINARY_DIR}/importlibs/lib${_name}_stubs.asm ${CMAKE_CURRENT_SOURCE_DIR}/${_exports_file}\r
         DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/${_exports_file})\r
 \r
     # Assemble the stub file\r
@@ -180,7 +166,7 @@ macro(add_importlib_target _exports_file)
     add_custom_target(\r
         lib${_name}\r
         DEPENDS ${CMAKE_BINARY_DIR}/importlibs/lib${_name}.lib)\r
-    \r
+\r
     add_dependencies(lib${_name} asm ${_dependencies})\r
 endmacro()\r
 \r
@@ -195,7 +181,7 @@ macro(spec2def _dllname _spec_file)
     get_filename_component(_file ${_spec_file} NAME_WE)\r
     add_custom_command(\r
         OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/${_file}.def ${CMAKE_CURRENT_BINARY_DIR}/${_file}_stubs.c\r
-        COMMAND native-spec2def -@ -n=${_dllname} -d=${CMAKE_CURRENT_BINARY_DIR}/${_file}.def -s=${CMAKE_CURRENT_BINARY_DIR}/${_file}_stubs.c ${CMAKE_CURRENT_SOURCE_DIR}/${_spec_file}\r
+        COMMAND native-spec2def --kill-at -n=${_dllname} -d=${CMAKE_CURRENT_BINARY_DIR}/${_file}.def -s=${CMAKE_CURRENT_BINARY_DIR}/${_file}_stubs.c ${CMAKE_CURRENT_SOURCE_DIR}/${_spec_file}\r
         DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/${_spec_file})\r
     set_source_files_properties(${CMAKE_CURRENT_BINARY_DIR}/${_file}.def ${CMAKE_CURRENT_BINARY_DIR}/${_file}_stubs.c\r
         PROPERTIES GENERATED TRUE)\r
@@ -222,5 +208,3 @@ file(MAKE_DIRECTORY ${CMAKE_BINARY_DIR}/importlibs)
 #pseh workaround\r
 set(PSEH_LIB "")\r
 \r
-endif(CMAKE_CROSSCOMPILING)\r
-\r
index 1d20922..b263d2d 100644 (file)
@@ -34,16 +34,6 @@ set(CMAKE_CXX_COMPILER ${CCACHE} ${MINGW_PREFIX}g++)
 set(CMAKE_RC_COMPILER ${MINGW_PREFIX}windres)
 set(CMAKE_ASM_COMPILER ${MINGW_PREFIX}gcc)
 set(CMAKE_ASM_COMPILE_OBJECT "<CMAKE_ASM_COMPILER> -x assembler-with-cpp -o <OBJECT> -I${REACTOS_SOURCE_DIR}/include/asm -I${REACTOS_BINARY_DIR}/include/asm <FLAGS> <DEFINES> -D__ASM__ -c <SOURCE>")
-set(CMAKE_IDL_COMPILER native-widl)
-
-if(ARCH MATCHES i386)
-set(CMAKE_IDL_COMPILE_OBJECT "<CMAKE_IDL_COMPILER> <FLAGS> <DEFINES> -m32 --win32 -h -o <OBJECT> <SOURCE>")
-elseif(ARCH MATCHES amd64)
-set(CMAKE_IDL_COMPILE_OBJECT "<CMAKE_IDL_COMPILER> <FLAGS> <DEFINES> -m64 --win64 -h -o <OBJECT> <SOURCE>")
-elseif(ARCH MATCHES arm)
-set(CMAKE_IDL_COMPILE_OBJECT "<CMAKE_IDL_COMPILER> <FLAGS> <DEFINES> -h -o <OBJECT> <SOURCE>")
-endif()
-
 set(CMAKE_RC_COMPILE_OBJECT "<CMAKE_RC_COMPILER> -i <SOURCE> <CMAKE_C_LINK_FLAGS> <DEFINES> -I${REACTOS_SOURCE_DIR}/include/psdk -I${REACTOS_BINARY_DIR}/include/psdk -I${REACTOS_SOURCE_DIR}/include/ -I${REACTOS_SOURCE_DIR}/include/reactos -I${REACTOS_BINARY_DIR}/include/reactos -I${REACTOS_SOURCE_DIR}/include/reactos/wine -I${REACTOS_SOURCE_DIR}/include/crt -I${REACTOS_SOURCE_DIR}/include/crt/mingw32 -O coff -o <OBJECT> ")
 
 # Use stdcall fixups, and don't link with anything by default unless we say so
index 208990b..218a27d 100644 (file)
@@ -6,12 +6,14 @@ set(CMAKE_SYSTEM_PROCESSOR i686)
 # which compilers to use for C and C++\r
 set(CMAKE_C_COMPILER cl)\r
 set(CMAKE_CXX_COMPILER cl)\r
-SET(CMAKE_RC_COMPILER rc)\r
-SET(CMAKE_ASM_COMPILER ml)\r
-SET(CMAKE_IDL_COMPILER midl)\r
+set(CMAKE_RC_COMPILER rc)\r
+if(${ARCH} MATCHES amd64)\r
+  set(CMAKE_ASM_COMPILER ml64)\r
+else()\r
+  set(CMAKE_ASM_COMPILER ml)\r
+endif()\r
 \r
-SET(CMAKE_RC_COMPILE_OBJECT "<CMAKE_RC_COMPILER> <DEFINES> /I${REACTOS_SOURCE_DIR}/include/psdk /I${REACTOS_BINARY_DIR}/include/psdk /I${REACTOS_SOURCE_DIR}/include /I${REACTOS_SOURCE_DIR}/include/reactos /I${REACTOS_BINARY_DIR}/include/reactos /I${REACTOS_SOURCE_DIR}/include/reactos/wine /I${REACTOS_SOURCE_DIR}/include/crt /I${REACTOS_SOURCE_DIR}/include/crt/mingw32 /fo <OBJECT> <SOURCE>")\r
-SET(CMAKE_IDL_COMPILE_OBJECT "<CMAKE_IDL_COMPILER> <FLAGS> <DEFINES> /win32 /Dstrict_context_handle= /h <OBJECT> <SOURCE>")\r
+set(CMAKE_RC_COMPILE_OBJECT "<CMAKE_RC_COMPILER> <DEFINES> /I${REACTOS_SOURCE_DIR}/include/psdk /I${REACTOS_BINARY_DIR}/include/psdk /I${REACTOS_SOURCE_DIR}/include /I${REACTOS_SOURCE_DIR}/include/reactos /I${REACTOS_BINARY_DIR}/include/reactos /I${REACTOS_SOURCE_DIR}/include/reactos/wine /I${REACTOS_SOURCE_DIR}/include/crt /I${REACTOS_SOURCE_DIR}/include/crt/mingw32 /fo <OBJECT> <SOURCE>")\r
 \r
 SET(CMAKE_ASM_COMPILE_OBJECT\r
     "<CMAKE_C_COMPILER> /nologo /X /I${REACTOS_SOURCE_DIR}/include/asm /I${REACTOS_BINARY_DIR}/include/asm <FLAGS> <DEFINES> /D__ASM__ /D_USE_ML /EP /c <SOURCE> > <OBJECT>.tmp"\r
@@ -29,3 +31,7 @@ set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY)
 set(CMAKE_BUILD_TYPE "RelwithDebInfo" CACHE STRING "Build Type")\r
 \r
 set(CMAKE_C_STANDARD_LIBRARIES "" CACHE INTERNAL "")\r
+\r
+if(CMAKE_SYSTEM_PROCESSOR MATCHES "x86")\r
+    add_definitions(-D__i386__)\r
+endif()\r