* For anyone who wants to work only on a certain module (or a set of modules), you can add "project(module)" to the related CMake file. This will generate a solution that contains all the required dependencies needed to compile only that module, without having to open a huge solution with 900+ projects.
* We'll create a wiki page to explain how to use this in detail.
* Dedicated to all VS users. Have fun ;)
svn path=/trunk/; revision=58141
windows/wlregistry.c)
if(ARCH STREQUAL "i386")
+ list(APPEND FREELDR_COMMON_ASM_SOURCE
+ arch/i386/entry.S
+ arch/i386/i386pnp.S
+ arch/i386/i386trap.S
+ arch/i386/linux.S
+ arch/i386/mb.S)
list(APPEND FREELDR_COMMON_SOURCE
arch/i386/archmach.c
arch/i386/custom.c
arch/i386/drivemap.c
- arch/i386/entry.S
arch/i386/halstub.c
arch/i386/hardware.c
arch/i386/hwacpi.c
arch/i386/i386bug.c
arch/i386/i386disk.c
arch/i386/i386idt.c
- arch/i386/i386pnp.S
arch/i386/i386rtl.c
- arch/i386/i386trap.S
arch/i386/i386vid.c
- arch/i386/linux.S
arch/i386/machpc.c
- arch/i386/mb.S
arch/i386/miscboot.c
arch/i386/ntoskrnl.c
arch/i386/pccons.c
windows/headless.c
disk/scsiport.c)
if(NOT MSVC)
- list(APPEND FREELDR_COMMON_SOURCE
- arch/i386/drvmap.S)
+ list(APPEND FREELDR_COMMON_SOURCE arch/i386/drvmap.S)
endif()
elseif(ARCH STREQUAL "amd64")
- list(APPEND FREELDR_COMMON_SOURCE
+ list(APPEND FREELDR_COMMON_ASM_SOURCE
arch/amd64/entry.S
arch/amd64/int386.S
- arch/amd64/pnpbios.S
+ arch/amd64/pnpbios.S)
+ list(APPEND FREELDR_COMMON_SOURCE
arch/i386/hardware.c
arch/i386/hwacpi.c
arch/i386/hwapm.c
endif()
if((NOT MSVC) AND (CMAKE_VERSION VERSION_GREATER 2.8.7))
- add_library(freeldr_common OBJECT ${FREELDR_COMMON_SOURCE})
+ add_library(freeldr_common OBJECT ${FREELDR_COMMON_SOURCE} ${FREELDR_COMMON_ASM_SOURCE})
else()
- add_library(freeldr_common ${FREELDR_COMMON_SOURCE})
+ add_asm_files(freeldr_common_asm ${FREELDR_COMMON_ASM_SOURCE})
+ add_library(freeldr_common ${FREELDR_COMMON_SOURCE} ${freeldr_common_asm})
endif()
add_dependencies(freeldr_common bugcodes)
add_target_link_flags(freeldr_pe "-Wl,--strip-all,--exclude-all-symbols,--file-alignment,0x1000,-T,${CMAKE_CURRENT_SOURCE_DIR}/freeldr_i386.lds")
add_target_link_flags(freeldr_pe_dbg "-Wl,--exclude-all-symbols,--file-alignment,0x1000,-T,${CMAKE_CURRENT_SOURCE_DIR}/freeldr_i386.lds")
else()
- add_target_link_flags(freeldr_pe "/ignore:4078 /ignore:4254 /DRIVER /FIXED /ALIGN:0x400 /SECTION:.text,ERW /SECTION:.data,RW /MERGE:.text16=.text /MERGE:.data=.text /MERGE:.rdata=.text /MERGE:.bss=.text /SUBSYSTEM:BOOT_APPLICATION")
- add_target_link_flags(freeldr_pe_dbg "/ignore:4078 /ignore:4254 /DRIVER /FIXED /ALIGN:0x400 /SECTION:.text,ERW /SECTION:.data,RW /MERGE:.text16=.text /MERGE:.data=.text /MERGE:.rdata=.text /MERGE:.bss=.text /SUBSYSTEM:BOOT_APPLICATION")
+ add_target_link_flags(freeldr_pe "/ignore:4078 /ignore:4254 /DRIVER /FIXED /ALIGN:0x400 /SECTION:.text,ERW /SECTION:.data,RW /MERGE:.text16=.text /MERGE:.data=.text /MERGE:.rdata=.text /MERGE:.bss=.text ")
+ add_target_link_flags(freeldr_pe_dbg "/ignore:4078 /ignore:4254 /DRIVER /FIXED /ALIGN:0x400 /SECTION:.text,ERW /SECTION:.data,RW /MERGE:.text16=.text /MERGE:.data=.text /MERGE:.rdata=.text /MERGE:.bss=.text")
endif()
set_image_base(freeldr_pe 0x10000)
target_link_libraries(freeldr_pe_dbg mini_hal)
endif()
-if(MSVC OR NOT CMAKE_VERSION VERSION_GREATER 2.8.7)
+if(MSVC OR (NOT CMAKE_VERSION VERSION_GREATER 2.8.7))
target_link_libraries(freeldr_pe freeldr_common)
target_link_libraries(freeldr_pe_dbg freeldr_common)
endif()
add_target_link_flags(setupldr_pe "-Wl,--strip-all,--exclude-all-symbols,--file-alignment,0x1000,-T,${CMAKE_CURRENT_SOURCE_DIR}/freeldr_i386.lds")
add_target_link_flags(setupldr_pe_dbg "-Wl,--exclude-all-symbols,--file-alignment,0x1000,-T,${CMAKE_CURRENT_SOURCE_DIR}/freeldr_i386.lds")
else()
- add_target_link_flags(setupldr_pe "/ignore:4078 /ignore:4254 /DRIVER /FIXED /ALIGN:0x400 /SECTION:.text,ERW /SECTION:.data,RW /MERGE:.text16=.text /MERGE:.data=.text /MERGE:.rdata=.text /MERGE:.bss=.text /SUBSYSTEM:BOOT_APPLICATION")
- add_target_link_flags(setupldr_pe_dbg "/ignore:4078 /ignore:4254 /DRIVER /FIXED /ALIGN:0x400 /SECTION:.text,ERW /SECTION:.data,RW /MERGE:.text16=.text /MERGE:.data=.text /MERGE:.rdata=.text /MERGE:.bss=.text /SUBSYSTEM:BOOT_APPLICATION")
+ add_target_link_flags(setupldr_pe "/ignore:4078 /ignore:4254 /DRIVER /FIXED /ALIGN:0x400 /SECTION:.text,ERW /SECTION:.data,RW /MERGE:.text16=.text /MERGE:.data=.text /MERGE:.rdata=.text /MERGE:.bss=.text")
+ add_target_link_flags(setupldr_pe_dbg "/ignore:4078 /ignore:4254 /DRIVER /FIXED /ALIGN:0x400 /SECTION:.text,ERW /SECTION:.data,RW /MERGE:.text16=.text /MERGE:.data=.text /MERGE:.rdata=.text /MERGE:.bss=.text")
endif()
add_target_compile_definitions(setupldr_pe FREELDR_REACTOS_SETUP)
#get file if we need to
if(NOT _CD_FILE)
- get_target_property(_CD_FILE ${_CD_TARGET} LOCATION)
+ get_target_property(_CD_FILE ${_CD_TARGET} LOCATION_${CMAKE_BUILD_TYPE})
endif()
#do we add it to all CDs?
function(allow_warnings __module)
add_target_compile_flags(${__module} "-Wno-error")
endfunction()
+
+macro(add_asm_files _target)
+ list(APPEND ${_target} ${ARGN})
+endmacro()
+
add_compile_flags("/Ob2 /D NDEBUG")
endif()
-if(${_MACHINE_ARCH_FLAG} MATCHES X86)
- set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} /SAFESEH:NO /NODEFAULTLIB /RELEASE")
- set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} /SAFESEH:NO /NODEFAULTLIB /RELEASE")
- set(CMAKE_MODULE_LINKER_FLAGS "${CMAKE_MODULE_LINKER_FLAGS} /SAFESEH:NO /NODEFAULTLIB /RELEASE")
+if(MSVC_IDE)
+ add_compile_flags("/MP")
endif()
-set(CMAKE_RC_COMPILE_OBJECT "<CMAKE_RC_COMPILER> <FLAGS> <DEFINES> ${I18N_DEFS} /fo<OBJECT> <SOURCE>")
+if(${_MACHINE_ARCH_FLAG} MATCHES X86)
+ set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} /MANIFEST:NO /INCREMENTAL:NO /SAFESEH:NO /NODEFAULTLIB /RELEASE")
+ set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} /MANIFEST:NO /INCREMENTAL:NO /SAFESEH:NO /NODEFAULTLIB /RELEASE")
+ set(CMAKE_MODULE_LINKER_FLAGS "${CMAKE_MODULE_LINKER_FLAGS} /MANIFEST:NO /INCREMENTAL:NO /SAFESEH:NO /NODEFAULTLIB /RELEASE")
+endif()
-if(MSVC_IDE)
- # Asm source files are not supported in VS generators yet. As a result, <DEFINES> isn't recognized.
- # We may temporarily use just the global defines, but this is not a solution as some modules (minihal for example) apply additional definitions to source files, so we get an incorrect build of such targets.
- get_directory_property(definitions DEFINITIONS)
- set(CMAKE_ASM_COMPILE_OBJECT
- "cl /nologo /X /I${REACTOS_SOURCE_DIR}/include/asm /I${REACTOS_BINARY_DIR}/include/asm <FLAGS> ${definitions} /D__ASM__ /D_USE_ML /EP /c <SOURCE> > <OBJECT>.tmp"
- "<CMAKE_ASM_COMPILER> /nologo /Cp /Fo<OBJECT> /c /Ta <OBJECT>.tmp")
+if(MSVC_IDE AND (CMAKE_VERSION MATCHES "ReactOS"))
+ # for VS builds we'll only have en-US in resource files
+ add_definitions(/DLANGUAGE_EN_US)
else()
- # NMake Makefiles
+ set(CMAKE_RC_COMPILE_OBJECT "<CMAKE_RC_COMPILER> <FLAGS> <DEFINES> ${I18N_DEFS} /fo<OBJECT> <SOURCE>")
set(CMAKE_ASM_COMPILE_OBJECT
"cl /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"
"<CMAKE_ASM_COMPILER> /nologo /Cp /Fo<OBJECT> /c /Ta <OBJECT>.tmp")
endfunction()
function(set_subsystem MODULE SUBSYSTEM)
- add_target_link_flags(${MODULE} "/subsystem:${SUBSYSTEM}")
+ add_target_link_flags(${MODULE} "/SUBSYSTEM:${SUBSYSTEM}")
endfunction()
function(set_image_base MODULE IMAGE_BASE)
function(allow_warnings __module)
endfunction()
+
+macro(add_asm_files _target)
+ if(MSVC_IDE AND (CMAKE_VERSION MATCHES "ReactOS"))
+ get_defines(_directory_defines)
+ get_includes(_directory_includes)
+ get_directory_property(_defines COMPILE_DEFINITIONS)
+ foreach(_source_file ${ARGN})
+ get_filename_component(_source_file_base_name ${_source_file} NAME_WE)
+ set(_preprocessed_asm_file ${CMAKE_CURRENT_BINARY_DIR}/asm/${_source_file_base_name}_${_target}.tmp)
+ set(_object_file ${CMAKE_CURRENT_BINARY_DIR}/asm/${_source_file_base_name}_${_target}.obj)
+ set(_source_file_full_path ${CMAKE_CURRENT_SOURCE_DIR}/${_source_file})
+ get_source_file_property(_defines_semicolon_list ${_source_file_full_path} COMPILE_DEFINITIONS)
+ unset(_source_file_defines)
+ foreach(_define ${_defines_semicolon_list})
+ if(NOT ${_define} STREQUAL "NOTFOUND")
+ list(APPEND _source_file_defines -D${_define})
+ endif()
+ endforeach()
+ add_custom_command(
+ OUTPUT ${_preprocessed_asm_file} ${_object_file}
+ COMMAND cl /nologo /X /I${REACTOS_SOURCE_DIR}/include/asm /I${REACTOS_BINARY_DIR}/include/asm ${_directory_includes} ${_source_file_defines} ${_directory_defines} /D__ASM__ /D_USE_ML /EP /c ${_source_file_full_path} > ${_preprocessed_asm_file} && ${CMAKE_ASM_COMPILER} /nologo /Cp /Fo${_object_file} /c /Ta ${_preprocessed_asm_file}
+ DEPENDS ${_source_file_full_path})
+ set_source_files_properties(${_object_file} PROPERTIES EXTERNAL_OBJECT 1)
+ list(APPEND ${_target} ${_object_file})
+ endforeach()
+ else()
+ list(APPEND ${_target} ${ARGN})
+ endif()
+endmacro()
${CMAKE_CURRENT_BINARY_DIR}/ntdll.def)
if(ARCH STREQUAL "i386")
- list(APPEND SOURCE dispatch/i386/dispatch.S)
+ list(APPEND ASM_SOURCE dispatch/i386/dispatch.S)
elseif(ARCH STREQUAL "amd64")
- list(APPEND SOURCE dispatch/amd64/dispatch.S)
+ list(APPEND ASM_SOURCE dispatch/amd64/dispatch.S)
elseif(ARCH STREQUAL "arm")
- list(APPEND SOURCE dispatch/arm/stubs_asm.s)
+ list(APPEND ASM_SOURCE dispatch/arm/stubs_asm.s)
else()
list(APPEND SOURCE dispatch/dispatch.c)
-endif(ARCH STREQUAL "i386")
+endif()
-add_library(ntdll SHARED ${SOURCE})
+add_asm_files(ntdll_asm ${ASM_SOURCE})
+add_library(ntdll SHARED ${SOURCE} ${ntdll_asm})
set_module_type(ntdll win32dll ENTRYPOINT 0)
${CMAKE_CURRENT_BINARY_DIR}/kernel32.def)
if(ARCH STREQUAL "i386")
- list(APPEND SOURCE
+ list(APPEND ASM_SOURCE
client/i386/fiber.S
client/i386/thread.S)
elseif(ARCH STREQUAL "amd64")
- list(APPEND SOURCE
+ list(APPEND ASM_SOURCE
client/amd64/fiber.S
client/amd64/thread.S)
endif()
-add_library(kernel32 SHARED ${SOURCE})
+add_asm_files(kernel32_asm ${ASM_SOURCE})
+add_library(kernel32 SHARED ${SOURCE} ${kernel32_asm})
set_module_type(kernel32 win32dll ENTRYPOINT DllMain 12)
target_link_libraries(kernel32 wine chkstk ${PSEH_LIB})
add_importlibs(kernel32 ntdll)
${CMAKE_CURRENT_BINARY_DIR}/oleaut32.def)
if(MSVC)
- list(APPEND SOURCE msvc.S)
+ add_asm_files(oleaut32_asm msvc.S)
endif()
-add_library(oleaut32 SHARED ${SOURCE})
+add_library(oleaut32 SHARED ${SOURCE} ${oleaut32_asm})
add_idl_headers(oleaut32_idlheader oleaut32_oaidl.idl)
add_dependencies(oleaut32 oleaut32_idlheader)
set_module_type(oleaut32 win32dll)
${CMAKE_CURRENT_BINARY_DIR}/rpcrt4_stubs.c
${CMAKE_CURRENT_BINARY_DIR}/rpcrt4.def)
-if(MSVC)
- list(APPEND SOURCE msvc.S)
-endif()
-
remove_definitions(-D_WIN32_WINNT=0x502)
add_definitions(-D_WIN32_WINNT=0x600)
include_directories(${REACTOS_SOURCE_DIR}/include/reactos/wine)
+if(MSVC)
+ add_asm_files(rpcrt4_asm msvc.S)
+endif()
+
add_library(rpcrt4 SHARED
${SOURCE}
+ ${rpcrt4_asm}
rpcrt4.rc)
set_module_type(rpcrt4 win32dll)
+PROJECT(Drivers)
+
add_subdirectory(base)
add_subdirectory(battery)
add_subdirectory(bluetooth)
${CMAKE_CURRENT_BINARY_DIR}/ks.def)
if(MSVC)
- list(APPEND SOURCE msvc.S)
+ add_asm_files(ks_asm msvc.S)
endif()
-add_library(ks SHARED ${SOURCE})
+add_library(ks SHARED ${SOURCE} ${ks_asm})
set_target_properties(ks PROPERTIES SUFFIX ".sys")
+project(HAL)
if((ARCH STREQUAL "i386") OR (ARCH STREQUAL "amd64"))
add_subdirectory(halx86)
elseif(ARCH STREQUAL "arm")
generic/portio.c)
endif()
-if(CMAKE_VERSION VERSION_GREATER 2.8.7)
+if(NOT MSVC AND (CMAKE_VERSION VERSION_GREATER 2.8.7))
add_library(lib_hal_generic OBJECT ${HAL_GENERIC_SOURCE})
else()
add_library(lib_hal_generic ${HAL_GENERIC_SOURCE})
legacy/halpnpdd.c
legacy/halpcat.c)
- if(CMAKE_VERSION VERSION_GREATER 2.8.7)
+ if(NOT MSVC AND (CMAKE_VERSION VERSION_GREATER 2.8.7))
add_library(lib_hal_legacy OBJECT ${HAL_LEGACY_SOURCE})
else()
add_library(lib_hal_legacy ${HAL_LEGACY_SOURCE})
#add_pch(lib_hal_legacy include/hal.h)
- if(NOT CMAKE_VERSION VERSION_GREATER 2.8.7)
+ if(MSVC OR (NOT CMAKE_VERSION VERSION_GREATER 2.8.7))
target_link_libraries(lib_hal_legacy lib_hal_generic)
endif()
acpi/busemul.c
legacy/bus/pcibus.c)
-if(CMAKE_VERSION VERSION_GREATER 2.8.7)
+if(NOT MSVC AND (CMAKE_VERSION VERSION_GREATER 2.8.7))
add_library(lib_hal_acpi OBJECT ${HAL_ACPI_SOURCE})
else()
add_library(lib_hal_acpi ${HAL_ACPI_SOURCE})
endif()
#add_pch(lib_hal_acpi include/hal.h)
-if(NOT CMAKE_VERSION VERSION_GREATER 2.8.7)
+if(MSVC OR (NOT CMAKE_VERSION VERSION_GREATER 2.8.7))
target_link_libraries(lib_hal_acpi lib_hal_generic)
endif()
generic/spinlock.c
up/processor.c)
-if(CMAKE_VERSION VERSION_GREATER 2.8.7)
+if(NOT MSVC AND (CMAKE_VERSION VERSION_GREATER 2.8.7))
add_library(lib_hal_up OBJECT ${HAL_UP_SOURCE})
endif()
+list(APPEND HAL_APIC_ASM_SOURCE
+ apic/apictrap.S
+ apic/tsccal.S)
+
list(APPEND HAL_APIC_SOURCE
apic/apic.c
apic/apictimer.c
- apic/apictrap.S
apic/halinit_apic.c
apic/rtctimer.c
- apic/tsc.c
- apic/tsccal.S)
+ apic/tsc.c)
if(ARCH STREQUAL "i386")
+ list(APPEND HAL_PIC_ASM_SOURCE
+ generic/systimer.S
+ generic/trap.S)
list(APPEND HAL_PIC_SOURCE
generic/profil.c
generic/timer.c
- generic/systimer.S
- generic/trap.S
up/halinit_up.c
up/pic.c)
- if(CMAKE_VERSION VERSION_GREATER 2.8.7)
- add_library(lib_hal_pic OBJECT ${HAL_PIC_SOURCE})
+ if(NOT MSVC AND (CMAKE_VERSION VERSION_GREATER 2.8.7))
+ add_library(lib_hal_pic OBJECT ${HAL_PIC_SOURCE} ${HAL_PIC_ASM_SOURCE})
endif()
list(APPEND MINI_HAL_SOURCE
spec2def(hal.dll ../hal.spec ADD_IMPORTLIB)
# hal
- if(CMAKE_VERSION VERSION_GREATER 2.8.7)
+ if(NOT MSVC AND (CMAKE_VERSION VERSION_GREATER 2.8.7))
add_library(hal SHARED
$<TARGET_OBJECTS:lib_hal_generic>
$<TARGET_OBJECTS:lib_hal_legacy>
up/halup.rc
${CMAKE_CURRENT_BINARY_DIR}/hal.def)
else()
+ add_asm_files(hal_asm
+ ${HAL_PIC_ASM_SOURCE}
+ generic/v86.S)
add_library(hal SHARED
${HAL_UP_SOURCE}
${HAL_PIC_SOURCE}
- generic/v86.S
+ ${hal_asm}
up/halup.rc
${CMAKE_CURRENT_BINARY_DIR}/hal.def)
endif()
- if(NOT CMAKE_VERSION VERSION_GREATER 2.8.7)
+ if(MSVC OR (NOT CMAKE_VERSION VERSION_GREATER 2.8.7))
target_link_libraries(hal lib_hal_generic lib_hal_legacy)
endif()
target_link_libraries(hal libcntpr)
# hal acpi
spec2def(halacpi.dll ../hal.spec)
- if(CMAKE_VERSION VERSION_GREATER 2.8.7)
+ if(NOT MSVC AND (CMAKE_VERSION VERSION_GREATER 2.8.7))
add_library(halacpi SHARED
$<TARGET_OBJECTS:lib_hal_generic>
$<TARGET_OBJECTS:lib_hal_acpi>
acpi/halacpi.rc
${CMAKE_CURRENT_BINARY_DIR}/halacpi.def)
else()
+ set_source_files_properties(${HAL_PIC_ASM_SOURCE} generic/v86.S PROPERTIES COMPILE_DEFINITIONS "CONFIG_ACPI")
+ add_asm_files(halacpi_asm ${HAL_PIC_ASM_SOURCE} generic/v86.S)
add_library(halacpi SHARED
${HAL_UP_SOURCE}
${HAL_PIC_SOURCE}
- generic/v86.S
+ ${halacpi_asm}
acpi/halacpi.rc
${CMAKE_CURRENT_BINARY_DIR}/halacpi.def)
endif()
- if(NOT CMAKE_VERSION VERSION_GREATER 2.8.7)
+ if(MSVC OR (NOT CMAKE_VERSION VERSION_GREATER 2.8.7))
target_link_libraries(halacpi lib_hal_generic lib_hal_acpi)
endif()
target_link_libraries(halacpi libcntpr)
else()
if(ARCH STREQUAL "i386")
- list(APPEND SOURCE
- dummy.c
+ list(APPEND ASM_SOURCE
i386/seh.s
i386/seh_prolog.s)
+ list(APPEND SOURCE dummy.c)
elseif(ARCH STREQUAL "amd64")
- list(APPEND SOURCE
- dummy.c
+ list(APPEND ASM_SOURCE
amd64/seh.s
amd64/seh_prolog.s)
+ list(APPEND SOURCE dummy.c)
endif()
- add_library(pseh ${SOURCE})
+ add_asm_files(pseh_asm ${ASM_SOURCE})
+ add_library(pseh ${SOURCE} ${pseh_asm})
add_dependencies(pseh asm)
endif()
handle.c
heap.c
heapdbg.c
- heappage.c
+ heappage.c
image.c
interlck.c
message.c
workitem.c)
if(ARCH STREQUAL "i386")
- list(APPEND SOURCE
+ list(APPEND ASM_SOURCE
i386/debug_asm.S
i386/except_asm.s
- i386/except.c
i386/interlck.S
i386/rtlmem.s
i386/rtlswap.S
- i386/res_asm.s
+ i386/res_asm.s)
+ list(APPEND SOURCE
+ i386/except.c
i386/thread.c)
elseif(ARCH STREQUAL "amd64")
- list(APPEND SOURCE
- byteswap.c
+ list(APPEND ASM_SOURCE
amd64/debug_asm.S
amd64/except_asm.S
- amd64/slist.S
+ amd64/slist.S)
+ list(APPEND SOURCE
+ byteswap.c
amd64/unwind.c
amd64/stubs.c
mem.c)
elseif(ARCH STREQUAL "arm")
+ list(APPEND ASM_SOURCE arm/debug_asm.S)
list(APPEND SOURCE
byteswap.c
- arm/debug_asm.S
mem.c)
elseif(ARCH STREQUAL "powerpc")
+ list(APPEND ASM_SOURCE
+ powerpc/rtlmem.s
+ powerpc/rtlswap.s)
list(APPEND SOURCE
byteswap.c
powerpc/debug.c
powerpc/except.c
powerpc/interlocked.c
- powerpc/rtlmem.s
- powerpc/rtlswap.s
powerpc/thread.c)
endif()
-add_library(rtl ${SOURCE})
+add_asm_files(rtl_asm ${ASM_SOURCE})
+add_library(rtl ${SOURCE} ${rtl_asm})
add_pch(rtl rtl.h)
add_dependencies(rtl psdk asm)
add_definitions(-D_CRTBLD)
if(ARCH STREQUAL "i386")
- list(APPEND CHKSTK_SOURCE except/i386/chkstk_asm.s)
+ list(APPEND CHKSTK_ASM_SOURCE except/i386/chkstk_asm.s)
if(NOT MSVC)
list(APPEND CHKSTK_SOURCE except/i386/chkstk_ms.s)
endif()
elseif(ARCH STREQUAL "amd64")
- list(APPEND CHKSTK_SOURCE except/amd64/chkstk_asm.s)
+ list(APPEND CHKSTK_ASM_SOURCE except/amd64/chkstk_asm.s)
if(NOT MSVC)
list(APPEND CHKSTK_SOURCE except/amd64/chkstk_ms.s)
endif()
elseif(ARCH STREQUAL "powerpc")
- list(APPEND CHKSTK_SOURCE except/powerpc/chkstk_asm.s)
+ list(APPEND CHKSTK_ASM_SOURCE except/powerpc/chkstk_asm.s)
endif()
-add_library(chkstk ${CHKSTK_SOURCE})
+add_asm_files(chkstk_lib_asm ${CHKSTK_ASM_SOURCE})
+add_library(chkstk ${CHKSTK_SOURCE} ${chkstk_lib_asm})
+set_target_properties(chkstk PROPERTIES LINKER_LANGUAGE "C")
add_dependencies(chkstk asm)
include(crt.cmake)
wine/undname.c)
if(ARCH STREQUAL "i386")
- list(APPEND CRT_SOURCE
+ list(APPEND CRT_ASM_SOURCE
except/i386/chkesp.s
except/i386/prolog.s
except/i386/seh.s
except/i386/seh_prolog.s
- except/i386/unwind.c
- float/i386/clearfp.c
- float/i386/cntrlfp.c
- float/i386/fpreset.c
- float/i386/logb.c
- float/i386/statfp.c
math/i386/alldiv_asm.s
math/i386/alldvrm_asm.s
math/i386/allmul_asm.s
math/i386/sqrt_asm.s
math/i386/tan_asm.s
math/i386/atan2_asm.s
- math/i386/ci.c
- math/i386/cicos.c
- math/i386/cilog.c
- math/i386/cipow.c
- math/i386/cisin.c
- math/i386/cisqrt.c
math/i386/exp_asm.s
math/i386/fmod_asm.s
math/i386/fmodf_asm.s
- math/i386/ldexp.c
mem/i386/memchr_asm.s
mem/i386/memmove_asm.s
mem/i386/memset_asm.s
string/i386/wcsncpy_asm.s
string/i386/wcsnlen_asm.s
string/i386/wcsrchr_asm.s)
+
+ list(APPEND CRT_SOURCE
+ except/i386/unwind.c
+ float/i386/clearfp.c
+ float/i386/cntrlfp.c
+ float/i386/fpreset.c
+ float/i386/logb.c
+ float/i386/statfp.c
+ math/i386/ci.c
+ math/i386/cicos.c
+ math/i386/cilog.c
+ math/i386/cipow.c
+ math/i386/cisin.c
+ math/i386/cisqrt.c
+ math/i386/ldexp.c)
if(MSVC)
- list(APPEND CRT_SOURCE
+ list(APPEND CRT_ASM_SOURCE
except/i386/cpp.s)
endif()
elseif(ARCH STREQUAL "amd64")
- list(APPEND CRT_SOURCE
+ list(APPEND CRT_ASM_SOURCE
except/amd64/seh.s
- except/amd64/ehandler.c
float/amd64/clearfp.S
float/amd64/getsetfpcw.S
- float/i386/cntrlfp.c
float/amd64/fpreset.S
float/amd64/logb.S
- float/i386/statfp.c
math/amd64/acos.S
math/amd64/acosf.S
math/amd64/atan.S
math/amd64/sqrtf.S
math/amd64/tan.S
setjmp/amd64/setjmp.s)
+
+ list(APPEND CRT_SOURCE
+ except/amd64/ehandler.c
+ float/i386/cntrlfp.c
+ float/i386/statfp.c)
if(MSVC)
- list(APPEND CRT_SOURCE
+ list(APPEND CRT_ASM_SOURCE
except/amd64/cpp.s)
endif()
endif()
string/wcsrchr.c)
endif()
-add_library(crt ${CRT_SOURCE})
+set_source_files_properties(${CRT_ASM_SOURCE} PROPERTIES COMPILE_DEFINITIONS "__MINGW_IMPORT=extern;USE_MSVCRT_PREFIX;_MSVCRT_LIB_;_MSVCRT_;_MT;CRTDLL")
+add_asm_files(crt_asm ${CRT_ASM_SOURCE})
+
+add_library(crt ${CRT_SOURCE} ${crt_asm})
target_link_libraries(crt chkstk)
add_target_compile_definitions(crt
__MINGW_IMPORT=extern
wstring/wcsstr.c)
if(ARCH STREQUAL "i386")
- list(APPEND LIBCNTPR_SOURCE
+ list(APPEND LIBCNTPR_ASM_SOURCE
except/i386/chkstk_asm.s
except/i386/seh.s
except/i386/seh_prolog.s
math/i386/sin_asm.s
math/i386/sqrt_asm.s
math/i386/tan_asm.s
+ misc/i386/readcr4.S)
+
+ list(APPEND LIBCNTPR_SOURCE
math/i386/ci.c
math/i386/cicos.c
math/i386/cilog.c
math/i386/cipow.c
math/i386/cisin.c
- math/i386/cisqrt.c
- misc/i386/readcr4.S)
+ math/i386/cisqrt.c)
if(NOT MSVC)
list(APPEND LIBCNTPR_SOURCE except/i386/chkstk_ms.s)
endif()
elseif(ARCH STREQUAL "amd64")
- list(APPEND LIBCNTPR_SOURCE
- except/amd64/ehandler.c
+ list(APPEND LIBCNTPR_ASM_SOURCE
except/amd64/chkstk_asm.s
except/amd64/seh.s
setjmp/amd64/setjmp.s
- math/cos.c
- math/sin.c
math/amd64/atan.S
math/amd64/atan2.S
math/amd64/ceil.S
math/amd64/pow.S
math/amd64/sqrt.S
math/amd64/tan.S)
+ list(APPEND LIBCNTPR_SOURCE
+ except/amd64/ehandler.c
+ math/cos.c
+ math/sin.c)
endif()
if(ARCH STREQUAL "i386")
- list(APPEND LIBCNTPR_SOURCE
+ list(APPEND LIBCNTPR_ASM_SOURCE
mem/i386/memchr_asm.s
mem/i386/memmove_asm.s
mem/i386/memset_asm.s
string/wcsrchr.c)
endif()
-add_library(libcntpr ${LIBCNTPR_SOURCE})
+set_source_files_properties(${LIBCNTPR_ASM_SOURCE} PROPERTIES COMPILE_DEFINITIONS "NO_RTL_INLINES;_NTSYSTEM_;_NTDLLBUILD_;_LIBCNT_;__CRT__NO_INLINE;CRTDLL")
+add_asm_files(libcntpr_asm ${LIBCNTPR_ASM_SOURCE})
+
+add_library(libcntpr ${LIBCNTPR_SOURCE} ${libcntpr_asm})
add_target_compile_definitions(libcntpr
NO_RTL_INLINES
_NTSYSTEM_
misc/fltused.c
misc/isblank.c
misc/iswblank.c
- misc/ofmt_stub.c
-)
+ misc/ofmt_stub.c)
if(NOT MSVC)
list(APPEND MSVCRTEX_SOURCE
endif()
if(ARCH STREQUAL "i386")
- list(APPEND MSVCRTEX_SOURCE
+ list(APPEND MSVCRTEX_ASM_SOURCE
except/i386/chkstk_asm.s
except/i386/chkstk_ms.s
+ math/i386/ftol2_asm.s
+ math/i386/alldiv_asm.s)
+ list(APPEND MSVCRTEX_SOURCE
math/i386/ci.c
math/i386/cicos.c
math/i386/cilog.c
math/i386/cipow.c
math/i386/cisin.c
- math/i386/cisqrt.c
- math/i386/ftol2_asm.s
- math/i386/alldiv_asm.s)
+ math/i386/cisqrt.c)
elseif(ARCH STREQUAL "amd64")
- list(APPEND MSVCRTEX_SOURCE
+ list(APPEND MSVCRTEX_ASM_SOURCE
except/amd64/chkstk_asm.s
except/amd64/chkstk_ms.s)
endif()
list(APPEND MSVCRTEX_SOURCE startup/gccmain.c)
endif()
-add_library(msvcrtex ${MSVCRTEX_SOURCE})
+set_source_files_properties(${MSVCRTEX_ASM_SOURCE} PROPERTIES COMPILE_DEFINITIONS "_DLL;_MSVCRTEX_")
+add_asm_files(msvcrtex_asm ${MSVCRTEX_ASM_SOURCE})
+
+add_library(msvcrtex ${MSVCRTEX_SOURCE} ${msvcrtex_asm})
add_target_compile_definitions(msvcrtex _DLL _MSVCRTEX_)
set_source_files_properties(startup/crtdll.c PROPERTIES COMPILE_DEFINITIONS CRTDLL)
set_source_files_properties(startup/crtexe.c
set_source_files_properties(${CMAKE_CURRENT_SOURCE_DIR}/moldname-msvcrt.def PROPERTIES EXTERNAL_OBJECT TRUE)
set_target_properties(oldnames PROPERTIES LINKER_LANGUAGE "IMPLIB" PREFIX "")
else()
- add_library(oldnames oldnames-msvcrt.S)
+ add_asm_files(oldnames_asm oldnames-msvcrt.S)
+ add_library(oldnames ${oldnames_asm})
+ set_target_properties(oldnames PROPERTIES LINKER_LANGUAGE "C")
endif()
ex/work.c
ex/xipdisp.c
ex/zone.c
- ex/zw.S
fsrtl/dbcsname.c
fsrtl/fastio.c
fsrtl/faulttol.c
wmi/wmi.c
ntoskrnl.rc)
+list(APPEND ASM_SOURCE ex/zw.S)
+
if(ARCH STREQUAL "i386")
- list(APPEND SOURCE
- config/i386/cmhardwr.c
+ list(APPEND ASM_SOURCE
ex/i386/fastinterlck_asm.S
ex/i386/ioport.S
+ ke/i386/ctxswitch.S
+ ke/i386/trap.s
+ ke/i386/usercall_asm.S
+ rtl/i386/stack.S)
+ list(APPEND SOURCE
+ config/i386/cmhardwr.c
ke/i386/abios.c
ke/i386/cpu.c
ke/i386/context.c
- ke/i386/ctxswitch.S
ke/i386/exp.c
ke/i386/irqobj.c
ke/i386/kiinit.c
ke/i386/mtrr.c
ke/i386/patpge.c
ke/i386/thrdini.c
- ke/i386/trap.s
ke/i386/traphdlr.c
- ke/i386/usercall_asm.S
ke/i386/usercall.c
ke/i386/v86vdm.c
mm/i386/page.c
mm/ARM3/i386/init.c
ps/i386/psctx.c
ps/i386/psldt.c
- rtl/i386/stack.S
vdm/vdmmain.c
vdm/vdmexec.c)
elseif(ARCH STREQUAL "amd64")
+ list(APPEND ASM_SOURCE
+ ke/amd64/boot.S
+ ke/amd64/ctxswitch.S
+ ke/amd64/trap.S)
list(APPEND SOURCE
config/i386/cmhardwr.c
- ke/amd64/boot.S
ke/amd64/context.c
ke/amd64/cpu.c
- ke/amd64/ctxswitch.S
ke/amd64/except.c
ke/amd64/interrupt.c
ke/amd64/irql.c
ke/amd64/spinlock.c
ke/amd64/stubs.c
ke/amd64/thrdini.c
- ke/amd64/trap.S
mm/amd64/init.c
mm/amd64/page.c
ps/amd64/psctx.c)
elseif(ARCH STREQUAL "arm")
+ list(APPEND ASM_SOURCE
+ ke/arm/boot.s
+ ke/arm/ctxswtch.s
+ ke/arm/stubs_asm.s
+ ke/arm/trap.s)
list(APPEND SOURCE
config/arm/cmhardwr.c
- ke/arm/boot.s
ke/arm/cpu.c
- ke/arm/ctxswtch.s
ke/arm/exp.c
ke/arm/kiinit.c
- ke/arm/stubs_asm.s
ke/arm/thrdini.c
- ke/arm/trap.s
ke/arm/trapc.c
ke/arm/usercall.c
mm/arm/page.c
ps/arm/psctx.c
rtl/arm/rtlexcpt.c)
elseif(ARCH STREQUAL "powerpc")
+ list(APPEND ASM_SOURCE
+ ke/powerpc/main_asm.S
+ ke/powerpc/ctxhelp.S)
list(APPEND SOURCE
config/powerpc/cmhardwr.c
- ke/powerpc/main_asm.S
ke/powerpc/cpu.c
ke/powerpc/exp.c
ke/powerpc/kiinit.c
ke/powerpc/systimer.c
ke/powerpc/thrdini.c
ke/powerpc/ctxswitch.c
- ke/powerpc/ctxhelp.S
mm/powerpc/pfault.c
mm/powerpc/page.c)
endif()
kd/i386/kdmemsup.c
kd/wrappers/gdbstub.c)
if(KDBG)
- list(APPEND SOURCE
- kdbg/i386/i386-dis.c
- kdbg/i386/kdb_help.S)
+ list(APPEND ASM_SOURCE kdbg/i386/kdb_help.S)
+ list(APPEND SOURCE kdbg/i386/i386-dis.c)
endif()
elseif(ARCH STREQUAL "amd64")
list(APPEND SOURCE
kd/amd64/kd.c
kd/amd64/kdmemsup.c)
if(KDBG)
+ list(APPEND ASM_SOURCE kdbg/amd64/kdb_help.S)
list(APPEND SOURCE
kdbg/amd64/i386-dis.c
- kdbg/amd64/kdb_help.S
kdbg/amd64/kdb.c)
endif()
elseif(ARCH STREQUAL "powerpc")
endif()
+add_asm_files(ntoskrnl_asm ${ASM_SOURCE})
+
add_executable(ntoskrnl
+ ${ntoskrnl_asm}
${SOURCE}
${CMAKE_CURRENT_BINARY_DIR}/ntoskrnl.def)
if(BUILD_MP)
spec2def(ntkrnlmp.exe ntoskrnl.spec)
+ if(MSVC_IDE AND (CMAKE_VERSION MATCHES "ReactOS"))
+ set_source_files_properties(${ASM_SOURCE} PROPERTIES COMPILE_DEFINITIONS "CONFIG_SMP")
+ endif()
+
+ add_asm_files(ntkrnlmp_asm ${ASM_SOURCE})
+
add_executable(ntkrnlmp
+ ${ntkrnlmp_asm}
${SOURCE}
${CMAKE_CURRENT_BINARY_DIR}/ntkrnlmp.def)
add_cd_file(TARGET ntkrnlmp DESTINATION reactos/system32 NO_CAB FOR all)
endif()
-add_library(ntdllsys ntdll.S)
+add_asm_files(ntdllsys_asm ntdll.S)
+add_library(ntdllsys ${ntdllsys_asm})
+set_target_properties(ntdllsys PROPERTIES LINKER_LANGUAGE "C")
gdi/ntgdi/xformobj.c
gdi/eng/stubs.c
gdi/eng/umpdstubs.c
- win32k.rc)
+ win32k.rc
+ ${CMAKE_CURRENT_BINARY_DIR}/win32k.def)
if(USE_DIBLIB)
add_definitions(-D_USE_DIBLIB_)
endif()
if(ARCH STREQUAL "i386")
-list(APPEND SOURCE
+list(APPEND ASM_SOURCE
gdi/dib/i386/dib24bpp_hline.s
gdi/dib/i386/dib32bpp_hline.s
gdi/dib/i386/dib32bpp_colorfill.s
gdi/ntgdi/gdikdbgext.c)
endif()
-add_library(win32k SHARED
- ${CMAKE_CURRENT_BINARY_DIR}/win32k.def
- ${SOURCE})
+add_asm_files(win32k_asm ${ASM_SOURCE})
+add_library(win32k SHARED ${SOURCE} ${win32k_asm})
set_module_type(win32k kernelmodedriver)
add_pch(win32k pch.h)
add_cd_file(TARGET win32k DESTINATION reactos/system32 FOR all)
-add_library(win32ksys sys-stubs.S)
set_source_files_properties(sys-stubs.S PROPERTIES OBJECT_DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/w32ksvc.h)
+add_asm_files(win32ksys_asm sys-stubs.S)
+add_library(win32ksys ${win32ksys_asm})
+set_target_properties(win32ksys PROPERTIES LINKER_LANGUAGE "C")