From a522726b1e5c97b03391c3e1e2b4ba15b2d51b28 Mon Sep 17 00:00:00 2001 From: Timo Kreuzer Date: Tue, 23 Aug 2011 08:13:33 +0000 Subject: [PATCH] [CMAKE] - fix usage of set_entrypoint - link libpng to ntdll on amd64 - build crtdll and nmidebug only on x86 - silence some linker warnings on MSVC - compile riched20/msvc-thiscall.c only on x86 - Add WIN64 definition to acpica - Add ehandler.c to libcntpr svn path=/trunk/; revision=53396 --- reactos/dll/3rdparty/libpng/CMakeLists.txt | 3 +++ reactos/dll/win32/CMakeLists.txt | 8 ++++++-- reactos/dll/win32/crtdll/CMakeLists.txt | 2 +- reactos/dll/win32/fmifs/CMakeLists.txt | 2 +- reactos/dll/win32/kernel32/CMakeLists.txt | 2 +- reactos/dll/win32/msacm32/CMakeLists.txt | 2 +- reactos/dll/win32/msvcrt/CMakeLists.txt | 4 +++- reactos/dll/win32/msvcrt20/CMakeLists.txt | 8 +++++--- reactos/dll/win32/msvcrt40/CMakeLists.txt | 6 ++++-- reactos/dll/win32/riched20/CMakeLists.txt | 4 +++- reactos/drivers/base/CMakeLists.txt | 5 +++-- reactos/drivers/bus/acpi/CMakeLists.txt | 4 ++++ reactos/drivers/video/displays/framebuf/CMakeLists.txt | 2 +- .../drivers/video/displays/framebuf_new/CMakeLists.txt | 2 +- reactos/drivers/video/displays/vga/CMakeLists.txt | 2 +- reactos/drivers/video/font/bmfd/CMakeLists.txt | 2 +- reactos/drivers/video/font/ftfd/CMakeLists.txt | 2 +- reactos/hal/halx86/CMakeLists.txt | 2 +- reactos/lib/sdk/crt/libcntpr.cmake | 1 + reactos/ntoskrnl/CMakeLists.txt | 2 +- 20 files changed, 43 insertions(+), 22 deletions(-) diff --git a/reactos/dll/3rdparty/libpng/CMakeLists.txt b/reactos/dll/3rdparty/libpng/CMakeLists.txt index 199e59a1d9e..403dbb7227b 100644 --- a/reactos/dll/3rdparty/libpng/CMakeLists.txt +++ b/reactos/dll/3rdparty/libpng/CMakeLists.txt @@ -30,5 +30,8 @@ add_library(libpng SHARED set_entrypoint(libpng 0) target_link_libraries(libpng zlib) add_importlibs(libpng msvcrt kernel32) +if(ARCH MATCHES amd64) + add_importlibs(libpng ntdll) +endif() add_dependencies(libpng psdk) add_cd_file(TARGET libpng DESTINATION reactos/system32 FOR all) diff --git a/reactos/dll/win32/CMakeLists.txt b/reactos/dll/win32/CMakeLists.txt index 4d4a4b8633e..0e1fa7a88f2 100644 --- a/reactos/dll/win32/CMakeLists.txt +++ b/reactos/dll/win32/CMakeLists.txt @@ -22,7 +22,9 @@ add_subdirectory(comctl32) add_subdirectory(comdlg32) add_subdirectory(compstui) add_subdirectory(credui) -add_subdirectory(crtdll) +if(ARCH MATCHES i386) + add_subdirectory(crtdll) # only built on x86 +endif() add_subdirectory(crypt32) add_subdirectory(cryptdlg) add_subdirectory(cryptdll) @@ -210,7 +212,9 @@ add_subdirectory(usp10) add_subdirectory(uxtheme) add_subdirectory(vdmdbg) add_subdirectory(version) -add_subdirectory(wdmaud.drv) +if(ARCH MATCHES i386) + add_subdirectory(wdmaud.drv) +endif() add_subdirectory(windowscodecs) add_subdirectory(winemp3.acm) add_subdirectory(winfax) diff --git a/reactos/dll/win32/crtdll/CMakeLists.txt b/reactos/dll/win32/crtdll/CMakeLists.txt index 3bc01d6a721..942a34a840a 100644 --- a/reactos/dll/win32/crtdll/CMakeLists.txt +++ b/reactos/dll/win32/crtdll/CMakeLists.txt @@ -21,7 +21,7 @@ add_library(crtdll SHARED ${SOURCE}) set_module_type(crtdll win32dll) -set_entrypoint(crtdll DllMain@12) +set_entrypoint(crtdll DllMain 12) target_link_libraries(crtdll wine crt) diff --git a/reactos/dll/win32/fmifs/CMakeLists.txt b/reactos/dll/win32/fmifs/CMakeLists.txt index af7b7bfb87a..469391c2d98 100644 --- a/reactos/dll/win32/fmifs/CMakeLists.txt +++ b/reactos/dll/win32/fmifs/CMakeLists.txt @@ -15,7 +15,7 @@ list(APPEND SOURCE ${CMAKE_CURRENT_BINARY_DIR}/fmifs.def) add_library(fmifs SHARED ${SOURCE}) -set_entrypoint(fmifs InitializeFmIfs@12) +set_entrypoint(fmifs InitializeFmIfs 12) add_importlibs(fmifs kernel32 ntdll) add_pch(fmifs precomp.h) add_dependencies(fmifs psdk) diff --git a/reactos/dll/win32/kernel32/CMakeLists.txt b/reactos/dll/win32/kernel32/CMakeLists.txt index 6fbb71e4649..114d7d16ce8 100644 --- a/reactos/dll/win32/kernel32/CMakeLists.txt +++ b/reactos/dll/win32/kernel32/CMakeLists.txt @@ -93,7 +93,7 @@ endif(ARCH MATCHES i386) add_library(kernel32 SHARED ${SOURCE}) -set_entrypoint(kernel32 DllMain@12) +set_entrypoint(kernel32 DllMain 12) set_image_base(kernel32 ${baseaddress_kernel32}) target_link_libraries(kernel32 wine chkstk ${PSEH_LIB}) diff --git a/reactos/dll/win32/msacm32/CMakeLists.txt b/reactos/dll/win32/msacm32/CMakeLists.txt index 8eb85ac3eb1..c000ed2213e 100644 --- a/reactos/dll/win32/msacm32/CMakeLists.txt +++ b/reactos/dll/win32/msacm32/CMakeLists.txt @@ -20,7 +20,7 @@ list(APPEND SOURCE add_library(msacm32 SHARED ${SOURCE}) -set_entrypoint(msacm32 DllMain@12) +set_entrypoint(msacm32 DllMain 12) set_image_base(msacm32 ${baseaddress_msacm32}) target_link_libraries(msacm32 wine) diff --git a/reactos/dll/win32/msvcrt/CMakeLists.txt b/reactos/dll/win32/msvcrt/CMakeLists.txt index b7151348b10..df950e5ccc8 100644 --- a/reactos/dll/win32/msvcrt/CMakeLists.txt +++ b/reactos/dll/win32/msvcrt/CMakeLists.txt @@ -33,7 +33,9 @@ set_image_base(msvcrt ${baseaddress_msvcrt}) target_link_libraries(msvcrt crt wine) -if(NOT MSVC) +if(MSVC) + add_linkerflag(msvcrt "/ignore:4102") +else() target_link_libraries(msvcrt pseh) endif() diff --git a/reactos/dll/win32/msvcrt20/CMakeLists.txt b/reactos/dll/win32/msvcrt20/CMakeLists.txt index db4d235d7df..0d4714aeb5e 100644 --- a/reactos/dll/win32/msvcrt20/CMakeLists.txt +++ b/reactos/dll/win32/msvcrt20/CMakeLists.txt @@ -20,13 +20,15 @@ list(APPEND SOURCE ${CMAKE_CURRENT_BINARY_DIR}/msvcrt20.def) add_library(msvcrt20 SHARED ${SOURCE}) -set_entrypoint(msvcrt20 DllMain@12) +set_entrypoint(msvcrt20 DllMain 12) set_image_base(msvcrt20 ${baseaddress_msvcrt20}) target_link_libraries(msvcrt20 crt wine) -if(NOT MSVC) - target_link_libraries(msvcrt20 pseh) +if(MSVC) + add_linkerflag(msvcrt20 "/ignore:4102") +else() + target_link_libraries(msvcrt20 pseh) endif() add_importlibs(msvcrt20 kernel32 ntdll) diff --git a/reactos/dll/win32/msvcrt40/CMakeLists.txt b/reactos/dll/win32/msvcrt40/CMakeLists.txt index 747351d74f0..009f05d70b3 100644 --- a/reactos/dll/win32/msvcrt40/CMakeLists.txt +++ b/reactos/dll/win32/msvcrt40/CMakeLists.txt @@ -21,11 +21,13 @@ list(APPEND SOURCE add_library(msvcrt40 SHARED ${SOURCE}) set_image_base(msvcrt40 ${baseaddress_msvcrt40}) -set_entrypoint(msvcrt40 DllMain@12) +set_entrypoint(msvcrt40 DllMain 12) target_link_libraries(msvcrt40 crt wine) -if(NOT MSVC) +if(MSVC) + add_linkerflag(msvcrt40 "/ignore:4102") +else() target_link_libraries(msvcrt40 pseh) endif() diff --git a/reactos/dll/win32/riched20/CMakeLists.txt b/reactos/dll/win32/riched20/CMakeLists.txt index b73767d15c7..89281ad5394 100644 --- a/reactos/dll/win32/riched20/CMakeLists.txt +++ b/reactos/dll/win32/riched20/CMakeLists.txt @@ -30,7 +30,9 @@ list(APPEND SOURCE ${CMAKE_CURRENT_BINARY_DIR}/riched20.def) if(MSVC) - list(APPEND SOURCE msvc-thiscall.c) + if (ARCH MATCHES i386) + list(APPEND SOURCE msvc-thiscall.c) + endif() set_source_files_properties(txthost.c txtsrv.c PROPERTIES COMPILE_FLAGS "/FImsvc.h") endif() diff --git a/reactos/drivers/base/CMakeLists.txt b/reactos/drivers/base/CMakeLists.txt index f7f03b18556..a16d0add866 100644 --- a/reactos/drivers/base/CMakeLists.txt +++ b/reactos/drivers/base/CMakeLists.txt @@ -7,6 +7,7 @@ add_subdirectory(kddll) else() add_subdirectory(kdcom) endif() - -add_subdirectory(nmidebug) +if(ARCH MATCHES i386) + add_subdirectory(nmidebug) +endif() add_subdirectory(null) diff --git a/reactos/drivers/bus/acpi/CMakeLists.txt b/reactos/drivers/bus/acpi/CMakeLists.txt index 05ac856d11e..42b1bff3940 100644 --- a/reactos/drivers/bus/acpi/CMakeLists.txt +++ b/reactos/drivers/bus/acpi/CMakeLists.txt @@ -3,6 +3,10 @@ include_directories( include acpica/include) +if(ARCH MATCHES amd64) + add_definitions(-DWIN64) +endif() + add_library(acpica acpica/dispatcher/dsfield.c acpica/dispatcher/dsinit.c diff --git a/reactos/drivers/video/displays/framebuf/CMakeLists.txt b/reactos/drivers/video/displays/framebuf/CMakeLists.txt index dd9db6f11b9..237d51f62ed 100644 --- a/reactos/drivers/video/displays/framebuf/CMakeLists.txt +++ b/reactos/drivers/video/displays/framebuf/CMakeLists.txt @@ -11,7 +11,7 @@ add_library(framebuf SHARED ${CMAKE_CURRENT_BINARY_DIR}/framebuf.def) add_pch(framebuf framebuf.h) -set_entrypoint(framebuf DrvEnableDriver@12) +set_entrypoint(framebuf DrvEnableDriver 12) set_subsystem(framebuf native) set_image_base(framebuf 0x00010000) target_link_libraries(framebuf libcntpr) diff --git a/reactos/drivers/video/displays/framebuf_new/CMakeLists.txt b/reactos/drivers/video/displays/framebuf_new/CMakeLists.txt index 8e7a39748f2..69db3dada72 100644 --- a/reactos/drivers/video/displays/framebuf_new/CMakeLists.txt +++ b/reactos/drivers/video/displays/framebuf_new/CMakeLists.txt @@ -20,7 +20,7 @@ if(ARCH MATCHES i386) endif() endif() -set_entrypoint(framebuf_new DrvEnableDriver@12) +set_entrypoint(framebuf_new DrvEnableDriver 12) set_subsystem(framebuf_new native) set_image_base(framebuf_new 0x00010000) diff --git a/reactos/drivers/video/displays/vga/CMakeLists.txt b/reactos/drivers/video/displays/vga/CMakeLists.txt index ddbb639f701..c4bab970b2d 100644 --- a/reactos/drivers/video/displays/vga/CMakeLists.txt +++ b/reactos/drivers/video/displays/vga/CMakeLists.txt @@ -15,7 +15,7 @@ add_library(vgaddi SHARED vgaddi.rc ${CMAKE_CURRENT_BINARY_DIR}/vgaddi.def) -set_entrypoint(vgaddi DrvEnableDriver@12) +set_entrypoint(vgaddi DrvEnableDriver 12) set_subsystem(vgaddi native) set_image_base(vgaddi 0x00010000) add_pch(vgaddi vgaddi.h) diff --git a/reactos/drivers/video/font/bmfd/CMakeLists.txt b/reactos/drivers/video/font/bmfd/CMakeLists.txt index 5380e79adf5..e99b7626929 100644 --- a/reactos/drivers/video/font/bmfd/CMakeLists.txt +++ b/reactos/drivers/video/font/bmfd/CMakeLists.txt @@ -5,7 +5,7 @@ add_library(bmfd SHARED glyph.c) add_pch(bmfd bmfd.h) -set_entrypoint(bmfd BmfdEnableDriver@12) +set_entrypoint(bmfd BmfdEnableDriver 12) set_subsystem(bmfd native) set_image_base(bmfd 0x00010000) target_link_libraries(bmfd libcntpr) diff --git a/reactos/drivers/video/font/ftfd/CMakeLists.txt b/reactos/drivers/video/font/ftfd/CMakeLists.txt index c2e66436c6c..817a76c0614 100644 --- a/reactos/drivers/video/font/ftfd/CMakeLists.txt +++ b/reactos/drivers/video/font/ftfd/CMakeLists.txt @@ -11,7 +11,7 @@ add_library(ftfd SHARED sprintf.c ${CMAKE_CURRENT_BINARY_DIR}/ftfd.def) -set_entrypoint(ftfd FtfdEnableDriver@12) +set_entrypoint(ftfd FtfdEnableDriver 12) set_subsystem(ftfd native) set_image_base(ftfd ${baseaddress_ftfd}) diff --git a/reactos/hal/halx86/CMakeLists.txt b/reactos/hal/halx86/CMakeLists.txt index a533fec2adf..23f49cff365 100644 --- a/reactos/hal/halx86/CMakeLists.txt +++ b/reactos/hal/halx86/CMakeLists.txt @@ -96,7 +96,7 @@ if(ARCH MATCHES i386) add_pch(hal include/hal.h) add_dependencies(hal psdk bugcodes) - set_entrypoint(hal HalInitSystem@8) + set_entrypoint(hal HalInitSystem 8) set_subsystem(hal native) set_image_base(hal 0x00010000) add_importlibs(hal ntoskrnl) diff --git a/reactos/lib/sdk/crt/libcntpr.cmake b/reactos/lib/sdk/crt/libcntpr.cmake index 011b9c3e3d5..8fa7984e4d9 100644 --- a/reactos/lib/sdk/crt/libcntpr.cmake +++ b/reactos/lib/sdk/crt/libcntpr.cmake @@ -98,6 +98,7 @@ if(ARCH MATCHES i386) endif() elseif(ARCH MATCHES amd64) list(APPEND LIBCNTPR_SOURCE + except/amd64/ehandler.c except/amd64/chkstk_asm.s except/amd64/seh.s setjmp/amd64/setjmp.s diff --git a/reactos/ntoskrnl/CMakeLists.txt b/reactos/ntoskrnl/CMakeLists.txt index f970b480d41..ac85693f36c 100644 --- a/reactos/ntoskrnl/CMakeLists.txt +++ b/reactos/ntoskrnl/CMakeLists.txt @@ -421,7 +421,7 @@ endif() add_executable(ntoskrnl ${SOURCE}) if (ARCH MATCHES i386) - set_entrypoint(ntoskrnl KiSystemStartup@4) + set_entrypoint(ntoskrnl KiSystemStartup 4) else() set_entrypoint(ntoskrnl KiSystemStartup) endif()