[SHELL32] Fix Control_RunDLLW (#5400)
[reactos.git] / dll / win32 / ole32 / CMakeLists.txt
index 3278122..2ba952e 100644 (file)
@@ -5,6 +5,7 @@ add_definitions(-D_WIN32_WINNT=0x600)
 add_definitions(
     -D__WINESRC__
     -D_OLE32_
+    -D__ROS_LONG64__
     -DCOM_NO_WINDOWS_H
     -DENTRY_PREFIX=OLE32_
     -DPROXY_CLSID=CLSID_PSFactoryBuffer
@@ -57,31 +58,39 @@ list(APPEND SOURCE
     stg_stream.c
     storage32.c
     stubmanager.c
-    usrmarshal.c
-    precomp.h
-    ${CMAKE_CURRENT_BINARY_DIR}/dcom_i.c
-    ${CMAKE_CURRENT_BINARY_DIR}/irot_c.c)
+    usrmarshal.c)
 
 if(MSVC AND (ARCH STREQUAL "i386"))
     list(APPEND SOURCE msvc-thiscall.c)
 endif()
 
-add_library(ole32 SHARED
-    ${SOURCE}
+list(APPEND PCH_SKIP_SOURCE
     guid.c
-    ole32res.rc
     ${CMAKE_CURRENT_BINARY_DIR}/dcom_p.c
     ${CMAKE_CURRENT_BINARY_DIR}/ole32_objidl_p.c
     ${CMAKE_CURRENT_BINARY_DIR}/ole32_oleidl_p.c
     ${CMAKE_CURRENT_BINARY_DIR}/ole32_unknwn_p.c
     ${CMAKE_CURRENT_BINARY_DIR}/ole32_stubs.c
-    ${CMAKE_CURRENT_BINARY_DIR}/proxy.dlldata.c
+    ${CMAKE_CURRENT_BINARY_DIR}/proxy.dlldata.c)
+
+add_library(ole32 MODULE
+    ${SOURCE}
+    ${PCH_SKIP_SOURCE}
+    ole32res.rc
+    ${CMAKE_CURRENT_BINARY_DIR}/dcom_i.c
+    ${CMAKE_CURRENT_BINARY_DIR}/irot_c.c
     ${CMAKE_CURRENT_BINARY_DIR}/ole32.def)
 
+if(MSVC)
+    # Disable warning C4090: '=': different 'const' qualifiers
+    # Disable warning C4146: unary minus operator applied to unsigned type, result still unsigned
+    target_compile_options(ole32 PRIVATE /wd4090 /wd4146)
+endif()
+
 set_module_type(ole32 win32dll)
 target_link_libraries(ole32 wine uuid ${PSEH_LIB})
 add_delay_importlibs(ole32 oleaut32)
 add_importlibs(ole32 advapi32 user32 gdi32 rpcrt4 msvcrt kernel32 kernel32_vista ntdll)
 add_dependencies(ole32 ole32idl)
-add_pch(ole32 precomp.h SOURCE)
+add_pch(ole32 precomp.h "${PCH_SKIP_SOURCE}")
 add_cd_file(TARGET ole32 DESTINATION reactos/system32 FOR all)