mirror of
https://github.com/reactos/reactos.git
synced 2025-07-31 19:52:11 +00:00
[CMAKE]
- Remove last traces of mingw_common - adopt msvcrtex on msvc builds - Fix MSVC warnings in crtexe.c, already pushed upstream svn path=/trunk/; revision=51868
This commit is contained in:
parent
16c69e2493
commit
597107fc28
19 changed files with 290 additions and 70 deletions
|
@ -11,5 +11,5 @@ list(APPEND SOURCE
|
|||
add_library(kbsdll SHARED ${SOURCE})
|
||||
|
||||
set_module_type(kbsdll win32dll)
|
||||
add_importlibs(kbsdll user32 comctl32 kernel32 msvcrt)
|
||||
add_importlibs(kbsdll user32 comctl32 msvcrt kernel32)
|
||||
add_cd_file(TARGET kbsdll DESTINATION reactos/system32 FOR all)
|
||||
|
|
|
@ -64,8 +64,6 @@ target_link_libraries(explorer
|
|||
-lgcc
|
||||
-lmingwex
|
||||
wine
|
||||
mingw_wmain
|
||||
mingw_common
|
||||
uuid)
|
||||
|
||||
add_importlibs(explorer advapi32 gdi32 user32 ws2_32 msimg32 comctl32 ole32 oleaut32 shell32 notifyhook msvcrt kernel32 ntdll)
|
||||
|
|
|
@ -3,6 +3,6 @@ add_executable(autochk WIN32 autochk.c autochk.rc)
|
|||
|
||||
set_module_type(autochk nativecui)
|
||||
|
||||
target_link_libraries(autochk mingw_common nt)
|
||||
add_importlibs(autochk kernel32 ntdll)
|
||||
target_link_libraries(autochk nt)
|
||||
add_importlibs(autochk ntdll)
|
||||
add_cd_file(TARGET autochk DESTINATION reactos/system32 FOR all)
|
||||
|
|
|
@ -25,7 +25,7 @@ list(APPEND SOURCE
|
|||
|
||||
add_executable(smss WIN32 ${CMAKE_CURRENT_BINARY_DIR}/smss_smss.h.gch ${SOURCE})
|
||||
|
||||
target_link_libraries(smss mingw_common nt smlib)
|
||||
target_link_libraries(smss nt smlib)
|
||||
if(MSVC)
|
||||
target_link_libraries(smss msvcsup)
|
||||
set_entrypoint(smss DllMainCRTStartup)
|
||||
|
|
5
reactos/dll/3rdparty/libjpeg/CMakeLists.txt
vendored
5
reactos/dll/3rdparty/libjpeg/CMakeLists.txt
vendored
|
@ -61,11 +61,6 @@ add_library(libjpeg SHARED
|
|||
|
||||
set_entrypoint(libjpeg 0)
|
||||
|
||||
if(MSVC)
|
||||
# for _fltused
|
||||
target_link_libraries(libjpeg mingw_common)
|
||||
endif()
|
||||
|
||||
add_importlibs(libjpeg msvcrt kernel32)
|
||||
|
||||
add_dependencies(libjpeg psdk)
|
||||
|
|
2
reactos/dll/3rdparty/libpng/CMakeLists.txt
vendored
2
reactos/dll/3rdparty/libpng/CMakeLists.txt
vendored
|
@ -30,7 +30,7 @@ add_library(libpng SHARED
|
|||
|
||||
set_entrypoint(libpng 0)
|
||||
|
||||
target_link_libraries(libpng mingw_common zlib)
|
||||
target_link_libraries(libpng zlib)
|
||||
|
||||
add_importlibs(libpng msvcrt kernel32)
|
||||
|
||||
|
|
2
reactos/dll/3rdparty/libtiff/CMakeLists.txt
vendored
2
reactos/dll/3rdparty/libtiff/CMakeLists.txt
vendored
|
@ -53,7 +53,7 @@ add_library(libtiff SHARED
|
|||
|
||||
set_entrypoint(libtiff 0)
|
||||
|
||||
target_link_libraries(libtiff mingw_common zlib getopt)
|
||||
target_link_libraries(libtiff zlib getopt)
|
||||
|
||||
add_importlibs(libtiff user32 msvcrt kernel32)
|
||||
|
||||
|
|
|
@ -28,10 +28,6 @@ add_library(dnsapi SHARED
|
|||
set_entrypoint(dnsapi 0)
|
||||
|
||||
target_link_libraries(dnsapi adns)
|
||||
if(MSVC)
|
||||
target_link_libraries(dnsapi msvcsup)
|
||||
endif()
|
||||
|
||||
add_importlibs(dnsapi user32 ws2_32 iphlpapi msvcrt kernel32 ntdll)
|
||||
add_pch(dnsapi ${CMAKE_CURRENT_SOURCE_DIR}/dnsapi/precomp.h ${SOURCE})
|
||||
add_dependencies(dnsapi psdk)
|
||||
|
|
|
@ -13,9 +13,7 @@ add_library(olesvr32 SHARED ${SOURCE})
|
|||
|
||||
set_entrypoint(olesvr32 0)
|
||||
|
||||
target_link_libraries(olesvr32
|
||||
wine
|
||||
mingw_common)
|
||||
target_link_libraries(olesvr32 wine)
|
||||
|
||||
add_importlibs(olesvr32 kernel32 ntdll)
|
||||
add_dependencies(olesvr32 psdk)
|
||||
|
|
|
@ -18,7 +18,6 @@ set_entrypoint(winemp3.acm 0)
|
|||
set_target_properties(winemp3.acm PROPERTIES SUFFIX "")
|
||||
|
||||
target_link_libraries(winemp3.acm
|
||||
mingw_common
|
||||
wine
|
||||
libmpg123)
|
||||
|
||||
|
|
|
@ -8,18 +8,6 @@ include(libcntpr.cmake)
|
|||
include(msvcrtex.cmake)
|
||||
include(oldnames.cmake)
|
||||
|
||||
if(MSVC)
|
||||
# This is a temporary solution until we have proper crt libs
|
||||
list(APPEND MSVCSUP_SOURCE
|
||||
misc/fltused.c
|
||||
except/i386/chkstk_asm.s
|
||||
math/i386/ci.c
|
||||
math/i386/ftol2_asm.S)
|
||||
|
||||
add_library(msvcsup ${MSVCSUP_SOURCE})
|
||||
add_dependencies(msvcsup psdk asm)
|
||||
endif()
|
||||
|
||||
add_library(user32_wsprintf
|
||||
printf/streamout.c
|
||||
printf/wstreamout.c
|
||||
|
|
6
reactos/lib/sdk/crt/misc/ofmt_stub.c
Normal file
6
reactos/lib/sdk/crt/misc/ofmt_stub.c
Normal file
|
@ -0,0 +1,6 @@
|
|||
|
||||
int _get_output_format(void)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
|
@ -8,6 +8,7 @@ endif()
|
|||
list(APPEND MSVCRTEX_SOURCE
|
||||
startup/crtexe.c
|
||||
startup/wcrtexe.c
|
||||
startup/crtdll.c
|
||||
startup/_newmode.c
|
||||
startup/wildcard.c
|
||||
startup/tlssup.c
|
||||
|
@ -18,6 +19,7 @@ list(APPEND MSVCRTEX_SOURCE
|
|||
startup/atonexit.c
|
||||
startup/txtmode.c
|
||||
startup/pseudo-reloc.c
|
||||
startup/pseudo-reloc-list.c
|
||||
startup/tlsmcrt.c
|
||||
startup/tlsthrd.c
|
||||
startup/tlsmthread.c
|
||||
|
@ -28,10 +30,20 @@ list(APPEND MSVCRTEX_SOURCE
|
|||
startup/wdllargv.c
|
||||
startup/crt0_c.c
|
||||
startup/crt0_w.c
|
||||
|
||||
startup/dllentry.c
|
||||
misc/fltused.c
|
||||
misc/ofmt_stub.c
|
||||
)
|
||||
|
||||
if(ARCH MATCHES i386)
|
||||
list(APPEND MSVCRTEX_SOURCE
|
||||
except/i386/chkstk_asm.s
|
||||
math/i386/ci.c
|
||||
math/i386/ftol2_asm.S
|
||||
math/i386/alldiv_asm.s
|
||||
)
|
||||
endif()
|
||||
|
||||
if(MSVC)
|
||||
list(APPEND MSVCRTEX_SOURCE startup/mscmain.c)
|
||||
else()
|
||||
|
@ -40,6 +52,7 @@ endif()
|
|||
|
||||
add_library(msvcrtex ${MSVCRTEX_SOURCE})
|
||||
set_target_properties(msvcrtex PROPERTIES COMPILE_DEFINITIONS _M_CEE_PURE)
|
||||
set_source_files_properties(startup/crtdll.c PROPERTIES COMPILE_DEFINITIONS CRTDLL)
|
||||
|
||||
if(NOT MSVC)
|
||||
target_link_libraries(msvcrtex oldnames)
|
||||
|
|
215
reactos/lib/sdk/crt/startup/crtdll.c
Normal file
215
reactos/lib/sdk/crt/startup/crtdll.c
Normal file
|
@ -0,0 +1,215 @@
|
|||
/**
|
||||
* This file has no copyright assigned and is placed in the Public Domain.
|
||||
* This file is part of the w64 mingw-runtime package.
|
||||
* No warranty is given; refer to the file DISCLAIMER.PD within this package.
|
||||
*/
|
||||
|
||||
#ifdef CRTDLL
|
||||
#undef CRTDLL
|
||||
#ifndef _DLL
|
||||
#define _DLL
|
||||
#endif
|
||||
|
||||
#include <oscalls.h>
|
||||
#include <internal.h>
|
||||
#include <stdlib.h>
|
||||
#include <windows.h>
|
||||
#define _DECL_DLLMAIN
|
||||
#include <process.h>
|
||||
#include <crtdbg.h>
|
||||
|
||||
#ifndef _CRTIMP
|
||||
#ifdef CRTDLL
|
||||
#define _CRTIMP __declspec(dllexport)
|
||||
#else
|
||||
#ifdef _DLL
|
||||
#define _CRTIMP __declspec(dllimport)
|
||||
#else
|
||||
#define _CRTIMP
|
||||
#endif
|
||||
#endif
|
||||
#endif
|
||||
#include <sect_attribs.h>
|
||||
#include <locale.h>
|
||||
|
||||
extern void __cdecl _initterm(_PVFV *,_PVFV *);
|
||||
extern void __main ();
|
||||
extern void _pei386_runtime_relocator (void);
|
||||
extern _CRTALLOC(".CRT$XIA") _PIFV __xi_a[];
|
||||
extern _CRTALLOC(".CRT$XIZ") _PIFV __xi_z[];
|
||||
extern _CRTALLOC(".CRT$XCA") _PVFV __xc_a[];
|
||||
extern _CRTALLOC(".CRT$XCZ") _PVFV __xc_z[];
|
||||
|
||||
/* TLS initialization hook. */
|
||||
extern const PIMAGE_TLS_CALLBACK __dyn_tls_init_callback;
|
||||
|
||||
static int __proc_attached = 0;
|
||||
|
||||
extern _PVFV *__onexitbegin;
|
||||
extern _PVFV *__onexitend;
|
||||
|
||||
extern int mingw_app_type;
|
||||
|
||||
extern WINBOOL WINAPI DllMain (HANDLE hDllHandle, DWORD dwReason, LPVOID lpreserved);
|
||||
|
||||
extern WINBOOL WINAPI DllEntryPoint (HANDLE, DWORD, LPVOID);
|
||||
|
||||
static int pre_c_init (void);
|
||||
|
||||
_CRTALLOC(".CRT$XIAA") _PIFV pcinit = pre_c_init;
|
||||
|
||||
static int
|
||||
pre_c_init (void)
|
||||
{
|
||||
_PVFV *onexitbegin;
|
||||
|
||||
onexitbegin = (_PVFV *) malloc (32 * sizeof (_PVFV));
|
||||
__onexitend = __onexitbegin = (_PVFV *) _encode_pointer (onexitbegin);
|
||||
|
||||
if (onexitbegin == NULL)
|
||||
return 1;
|
||||
*onexitbegin = (_PVFV) NULL;
|
||||
return 0;
|
||||
}
|
||||
|
||||
WINBOOL WINAPI _CRT_INIT (HANDLE hDllHandle, DWORD dwReason, LPVOID lpreserved)
|
||||
{
|
||||
if (dwReason == DLL_PROCESS_DETACH)
|
||||
{
|
||||
if (__proc_attached > 0)
|
||||
__proc_attached--;
|
||||
else
|
||||
return FALSE;
|
||||
}
|
||||
if (dwReason == DLL_PROCESS_ATTACH)
|
||||
{
|
||||
void *lock_free = NULL;
|
||||
void *fiberid = ((PNT_TIB)NtCurrentTeb ())->StackBase;
|
||||
int nested = FALSE;
|
||||
|
||||
while ((lock_free = InterlockedCompareExchangePointer ((volatile PVOID *) &__native_startup_lock,
|
||||
fiberid, 0)) != 0)
|
||||
{
|
||||
if (lock_free == fiberid)
|
||||
{
|
||||
nested = TRUE;
|
||||
break;
|
||||
}
|
||||
Sleep(1000);
|
||||
}
|
||||
if (__native_startup_state != __uninitialized)
|
||||
{
|
||||
_amsg_exit(31);
|
||||
}
|
||||
else
|
||||
{
|
||||
__native_startup_state = __initializing;
|
||||
|
||||
_initterm ((_PVFV *) (void *) __xi_a, (_PVFV *) (void *) __xi_z);
|
||||
_initterm (__xc_a,__xc_z);
|
||||
__native_startup_state = __initialized;
|
||||
}
|
||||
if (! nested)
|
||||
{
|
||||
(void) InterlockedExchangePointer ((volatile PVOID *) &__native_startup_lock, 0);
|
||||
}
|
||||
if (__dyn_tls_init_callback != NULL)
|
||||
{
|
||||
__dyn_tls_init_callback (hDllHandle, DLL_THREAD_ATTACH, lpreserved);
|
||||
}
|
||||
__proc_attached++;
|
||||
}
|
||||
else if (dwReason == DLL_PROCESS_DETACH)
|
||||
{
|
||||
void *lock_free = NULL;
|
||||
while ((lock_free = InterlockedCompareExchangePointer ((volatile PVOID *) &__native_startup_lock,(PVOID) 1, 0)) != 0)
|
||||
{
|
||||
Sleep(1000);
|
||||
}
|
||||
if(__native_startup_state!=__initialized)
|
||||
{
|
||||
_amsg_exit (31);
|
||||
}
|
||||
else
|
||||
{
|
||||
_PVFV * onexitbegin = (_PVFV *) _decode_pointer (__onexitbegin);
|
||||
if (onexitbegin)
|
||||
{
|
||||
_PVFV *onexitend = (_PVFV *) _decode_pointer (__onexitend);
|
||||
while (--onexitend >= onexitbegin)
|
||||
if (*onexitend != NULL)
|
||||
(**onexitend) ();
|
||||
free (onexitbegin);
|
||||
__onexitbegin = __onexitend = (_PVFV *) NULL;
|
||||
}
|
||||
__native_startup_state = __uninitialized;
|
||||
(void) InterlockedExchangePointer ((volatile PVOID *) &__native_startup_lock, 0);
|
||||
}
|
||||
}
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
static WINBOOL __DllMainCRTStartup (HANDLE, DWORD, LPVOID);
|
||||
|
||||
WINBOOL WINAPI DllMainCRTStartup (HANDLE, DWORD, LPVOID);
|
||||
int __mingw_init_ehandler (void);
|
||||
|
||||
WINBOOL WINAPI
|
||||
DllMainCRTStartup (HANDLE hDllHandle, DWORD dwReason, LPVOID lpreserved)
|
||||
{
|
||||
mingw_app_type = 0;
|
||||
if (dwReason == DLL_PROCESS_ATTACH)
|
||||
{
|
||||
__security_init_cookie ();
|
||||
#ifdef _WIN64
|
||||
__mingw_init_ehandler ();
|
||||
#endif
|
||||
}
|
||||
return __DllMainCRTStartup (hDllHandle, dwReason, lpreserved);
|
||||
}
|
||||
|
||||
__declspec(noinline) WINBOOL
|
||||
__DllMainCRTStartup (HANDLE hDllHandle, DWORD dwReason, LPVOID lpreserved)
|
||||
{
|
||||
WINBOOL retcode = TRUE;
|
||||
|
||||
__native_dllmain_reason = dwReason;
|
||||
if (dwReason == DLL_PROCESS_DETACH && __proc_attached == 0)
|
||||
{
|
||||
retcode = FALSE;
|
||||
goto i__leave;
|
||||
}
|
||||
_pei386_runtime_relocator ();
|
||||
if (dwReason == DLL_PROCESS_ATTACH || dwReason == DLL_THREAD_ATTACH)
|
||||
{
|
||||
retcode = _CRT_INIT (hDllHandle, dwReason, lpreserved);
|
||||
if (!retcode)
|
||||
goto i__leave;
|
||||
retcode = DllEntryPoint (hDllHandle, dwReason, lpreserved);
|
||||
if (! retcode)
|
||||
{
|
||||
if (dwReason == DLL_PROCESS_ATTACH)
|
||||
_CRT_INIT (hDllHandle, DLL_PROCESS_DETACH, lpreserved);
|
||||
goto i__leave;
|
||||
}
|
||||
}
|
||||
if (dwReason == DLL_PROCESS_ATTACH)
|
||||
__main ();
|
||||
retcode = DllMain(hDllHandle,dwReason,lpreserved);
|
||||
if (dwReason == DLL_PROCESS_ATTACH && ! retcode)
|
||||
{
|
||||
DllMain (hDllHandle, DLL_PROCESS_DETACH, lpreserved);
|
||||
DllEntryPoint (hDllHandle, DLL_PROCESS_DETACH, lpreserved);
|
||||
_CRT_INIT (hDllHandle, DLL_PROCESS_DETACH, lpreserved);
|
||||
}
|
||||
if (dwReason == DLL_PROCESS_DETACH || dwReason == DLL_THREAD_DETACH)
|
||||
{
|
||||
retcode = DllEntryPoint (hDllHandle, dwReason, lpreserved);
|
||||
if (_CRT_INIT (hDllHandle, dwReason, lpreserved) == FALSE)
|
||||
retcode = FALSE;
|
||||
}
|
||||
i__leave:
|
||||
__native_dllmain_reason = UINT_MAX;
|
||||
return retcode ;
|
||||
}
|
||||
#endif
|
|
@ -56,7 +56,7 @@ extern int _dowildcard;
|
|||
#if defined(__GNUC__)
|
||||
int _MINGW_INSTALL_DEBUG_MATHERR __attribute__((weak)) = 0;
|
||||
#else
|
||||
int _MINGW_INSTALL_DEBUG_MATHERR = 0;
|
||||
int __declspec(selectany) _MINGW_INSTALL_DEBUG_MATHERR = 0;
|
||||
#endif
|
||||
extern int __defaultmatherr;
|
||||
extern _CRTIMP void __cdecl _initterm(_PVFV *, _PVFV *);
|
||||
|
@ -108,8 +108,8 @@ static void duplicate_ppstrings (int ac, char ***av);
|
|||
static int __cdecl pre_c_init (void);
|
||||
static void __cdecl pre_cpp_init (void);
|
||||
static void __cdecl __mingw_prepare_except_for_msvcr80_and_higher (void);
|
||||
_CRTALLOC(".CRT$XIAA") _PIFV mingw_pcinit = pre_c_init;
|
||||
_CRTALLOC(".CRT$XCAA") _PVFV mingw_pcppinit = pre_cpp_init;
|
||||
_CRTALLOC(".CRT$XIAA") _PIFV __declspec(selectany) mingw_pcinit = pre_c_init;
|
||||
_CRTALLOC(".CRT$XCAA") _PVFV __declspec(selectany) mingw_pcppinit = pre_cpp_init;
|
||||
|
||||
static int __cdecl
|
||||
pre_c_init (void)
|
||||
|
|
18
reactos/lib/sdk/crt/startup/dllentry.c
Normal file
18
reactos/lib/sdk/crt/startup/dllentry.c
Normal file
|
@ -0,0 +1,18 @@
|
|||
/**
|
||||
* This file has no copyright assigned and is placed in the Public Domain.
|
||||
* This file is part of the w64 mingw-runtime package.
|
||||
* No warranty is given; refer to the file DISCLAIMER.PD within this package.
|
||||
*/
|
||||
|
||||
#include <oscalls.h>
|
||||
#define _DECL_DLLMAIN
|
||||
#include <process.h>
|
||||
|
||||
BOOL WINAPI DllEntryPoint (HANDLE, DWORD, LPVOID);
|
||||
|
||||
BOOL WINAPI DllEntryPoint (HANDLE __UNUSED_PARAM(hDllHandle),
|
||||
DWORD __UNUSED_PARAM(dwReason),
|
||||
LPVOID __UNUSED_PARAM(lpreserved))
|
||||
{
|
||||
return TRUE;
|
||||
}
|
8
reactos/lib/sdk/crt/startup/pseudo-reloc-list.c
Normal file
8
reactos/lib/sdk/crt/startup/pseudo-reloc-list.c
Normal file
|
@ -0,0 +1,8 @@
|
|||
/**
|
||||
* This file has no copyright assigned and is placed in the Public Domain.
|
||||
* This file is part of the w64 mingw-runtime package.
|
||||
* No warranty is given; refer to the file DISCLAIMER.PD within this package.
|
||||
*/
|
||||
|
||||
char __RUNTIME_PSEUDO_RELOC_LIST_END__ = 0;
|
||||
char __RUNTIME_PSEUDO_RELOC_LIST__ = 0;
|
|
@ -26,7 +26,7 @@ if(${ARCH} MATCHES amd64)
|
|||
add_definitions(-D__x86_64)
|
||||
endif()
|
||||
|
||||
link_directories("${REACTOS_BINARY_DIR}/importlibs" ${REACTOS_BINARY_DIR}/lib/3rdparty/mingw)
|
||||
link_directories("${REACTOS_BINARY_DIR}/importlibs" ${REACTOS_BINARY_DIR}/lib/sdk/crt)
|
||||
|
||||
set(CMAKE_RC_CREATE_SHARED_LIBRARY ${CMAKE_C_CREATE_SHARED_LIBRARY})
|
||||
set(CMAKE_ASM_CREATE_SHARED_LIBRARY ${CMAKE_C_CREATE_SHARED_LIBRARY})
|
||||
|
@ -70,28 +70,21 @@ macro(set_module_type MODULE TYPE)
|
|||
if(${TYPE} MATCHES nativecui)
|
||||
set_subsystem(${MODULE} native)
|
||||
set_entrypoint(${MODULE} NtProcessStartup@4)
|
||||
endif()
|
||||
if (${TYPE} MATCHES win32gui)
|
||||
elseif (${TYPE} MATCHES win32gui)
|
||||
set_subsystem(${MODULE} windows)
|
||||
set_entrypoint(${MODULE} WinMainCRTStartup)
|
||||
if(IS_UNICODE)
|
||||
target_link_libraries(${MODULE} mingw_wmain)
|
||||
set_entrypoint(${MODULE} wWinMainCRTStartup)
|
||||
else()
|
||||
target_link_libraries(${MODULE} mingw_main)
|
||||
endif()
|
||||
target_link_libraries(${MODULE} mingw_common msvcsup)
|
||||
endif ()
|
||||
if (${TYPE} MATCHES win32cui)
|
||||
set_entrypoint(${MODULE} WinMainCRTStartup)
|
||||
endif(IS_UNICODE)
|
||||
elseif (${TYPE} MATCHES win32cui)
|
||||
set_subsystem(${MODULE} console)
|
||||
set_entrypoint(${MODULE} mainCRTStartup)
|
||||
if(IS_UNICODE)
|
||||
target_link_libraries(${MODULE} mingw_wmain)
|
||||
set_entrypoint(${MODULE} wmainCRTStartup)
|
||||
else()
|
||||
target_link_libraries(${MODULE} mingw_main)
|
||||
endif()
|
||||
target_link_libraries(${MODULE} mingw_common msvcsup)
|
||||
endif ()
|
||||
if(${TYPE} MATCHES win32dll)
|
||||
set_entrypoint(${MODULE} mainCRTStartup)
|
||||
endif(IS_UNICODE)
|
||||
elseif(${TYPE} MATCHES win32dll)
|
||||
# Need this only because mingw library is broken
|
||||
set_entrypoint(${MODULE} DllMainCRTStartup@12)
|
||||
if(DEFINED baseaddress_${MODULE})
|
||||
|
@ -99,29 +92,23 @@ macro(set_module_type MODULE TYPE)
|
|||
else()
|
||||
message(STATUS "${MODULE} has no base address")
|
||||
endif()
|
||||
target_link_libraries(${MODULE} mingw_common mingw_dllmain msvcsup)
|
||||
add_linkerflag(${MODULE} "/DLL")
|
||||
endif()
|
||||
if(${TYPE} MATCHES win32ocx)
|
||||
elseif(${TYPE} MATCHES win32ocx)
|
||||
set_entrypoint(${MODULE} DllMainCRTStartup@12)
|
||||
set_target_properties(${MODULE} PROPERTIES SUFFIX ".ocx")
|
||||
target_link_libraries(${MODULE} mingw_common mingw_dllmain msvcsup)
|
||||
add_linkerflag(${MODULE} "/DLL")
|
||||
endif()
|
||||
if(${TYPE} MATCHES cpl)
|
||||
elseif(${TYPE} MATCHES cpl)
|
||||
set_entrypoint(${MODULE} DllMainCRTStartup@12)
|
||||
set_target_properties(${MODULE} PROPERTIES SUFFIX ".cpl")
|
||||
target_link_libraries(${MODULE} mingw_common mingw_dllmain msvcsup)
|
||||
add_linkerflag(${MODULE} "/DLL")
|
||||
endif()
|
||||
if(${TYPE} MATCHES kernelmodedriver)
|
||||
elseif(${TYPE} MATCHES kernelmodedriver)
|
||||
set_target_properties(${MODULE} PROPERTIES SUFFIX ".sys")
|
||||
set_entrypoint(${MODULE} DriverEntry@8)
|
||||
set_subsystem(${MODULE} native)
|
||||
set_image_base(${MODULE} 0x00010000)
|
||||
add_linkerflag(${MODULE} "/DRIVER")
|
||||
add_dependencies(${MODULE} bugcodes)
|
||||
target_link_libraries(${MODULE} msvcsup)
|
||||
target_link_libraries(${MODULE})
|
||||
endif()
|
||||
endmacro()
|
||||
|
||||
|
@ -182,6 +169,9 @@ endmacro()
|
|||
|
||||
macro(add_importlibs MODULE)
|
||||
foreach(LIB ${ARGN})
|
||||
if ("${LIB}" MATCHES "msvcrt")
|
||||
target_link_libraries(${MODULE} msvcrtex)
|
||||
endif()
|
||||
target_link_libraries(${MODULE} ${CMAKE_BINARY_DIR}/importlibs/lib${LIB}.lib)
|
||||
add_dependencies(${MODULE} lib${LIB})
|
||||
endforeach()
|
||||
|
|
|
@ -9,11 +9,7 @@ add_executable(ntvdm
|
|||
|
||||
set_module_type(ntvdm win32cui)
|
||||
|
||||
target_link_libraries(ntvdm
|
||||
mingw_main
|
||||
mingw_common)
|
||||
|
||||
add_importlibs(ntvdm ntdll user32 gdi32 advapi32 kernel32 msvcrt)
|
||||
add_importlibs(ntvdm ntdll user32 gdi32 advapi32 msvcrt kernel32)
|
||||
add_dependencies(ntvdm ndk bugcodes)
|
||||
|
||||
add_cd_file(TARGET ntvdm DESTINATION reactos/system32 FOR all)
|
||||
add_cd_file(TARGET ntvdm DESTINATION reactos/system32 FOR all)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue