diff --git a/reactos/CMakeLists.txt b/reactos/CMakeLists.txt index 449b5b1e34d..4a3a8804a06 100644 --- a/reactos/CMakeLists.txt +++ b/reactos/CMakeLists.txt @@ -93,25 +93,6 @@ else() set(IMPORT_EXECUTABLES "${REACTOS_BUILD_TOOLS_DIR}/ImportExecutables.cmake" CACHE FILEPATH "Host executables") include(${IMPORT_EXECUTABLES}) - # Compiler specific definitions and macros - if(MSVC) - include(msc.cmake) - else() - include(gcc.cmake) - endif() - - # Generic macros - include(CMakeMacros.cmake) - - # IDL macros for widl/midl - include(cmake/idl-support.cmake) - - # Activate support for assembly source files - enable_language(ASM) - - # Activate language support for resource files - enable_language(RC) - if(DBG) add_definitions(-DDBG=1 -D_SEH_ENABLE_TRACE) endif() @@ -150,6 +131,25 @@ else() add_definitions(-DUSE_COMPILER_EXCEPTIONS) endif() + # Compiler specific definitions and macros + if(MSVC) + include(msc.cmake) + else() + include(gcc.cmake) + endif() + + # Generic macros + include(CMakeMacros.cmake) + + # IDL macros for widl/midl + include(cmake/idl-support.cmake) + + # Activate support for assembly source files + enable_language(ASM) + + # Activate language support for resource files + enable_language(RC) + include_directories( include include/psdk @@ -202,5 +202,4 @@ else() file(MAKE_DIRECTORY ${CMAKE_BINARY_DIR}/importlibs) add_dependency_footer() - endif() diff --git a/reactos/include/asm/CMakeLists.txt b/reactos/include/asm/CMakeLists.txt index 32f70eb9393..f7dc16511e7 100644 --- a/reactos/include/asm/CMakeLists.txt +++ b/reactos/include/asm/CMakeLists.txt @@ -16,9 +16,11 @@ elseif(ARCH MATCHES amd64) set(_filename ksamd64) endif() +get_target_property(genincdata_dll genincdata LOCATION) + add_custom_command( OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/${_filename}.inc - COMMAND native-geninc ${CMAKE_CURRENT_BINARY_DIR}/genincdata.dll ${CMAKE_CURRENT_BINARY_DIR}/${_filename}.inc ${OPT_MS} + COMMAND native-geninc ${genincdata_dll} ${CMAKE_CURRENT_BINARY_DIR}/${_filename}.inc ${OPT_MS} DEPENDS genincdata) add_custom_target(asm diff --git a/reactos/lib/sdk/crt/CMakeLists.txt b/reactos/lib/sdk/crt/CMakeLists.txt index c6ea7e15c2b..7d86713a2f6 100644 --- a/reactos/lib/sdk/crt/CMakeLists.txt +++ b/reactos/lib/sdk/crt/CMakeLists.txt @@ -4,19 +4,21 @@ include_directories(include) add_definitions(-D_CRTBLD) if(ARCH MATCHES i386) - list(APPEND CHKSTK_SOURCE - except/i386/chkstk_asm.s - except/i386/chkstk_ms.s) + list(APPEND CHKSTK_SOURCE except/i386/chkstk_asm.s) + if(NOT MSVC) + list(APPEND CHKSTK_SOURCE except/i386/chkstk_ms.s) + endif() elseif(ARCH MATCHES amd64) - list(APPEND CHKSTK_SOURCE - except/amd64/chkstk_asm.s - except/amd64/chkstk_ms.s) + list(APPEND CHKSTK_SOURCE except/amd64/chkstk_asm.s) + if(NOT MSVC) + list(APPEND CHKSTK_SOURCE except/amd64/chkstk_ms.s) + endif() elseif(ARCH MATCHES powerpc) - list(APPEND CHKSTK_SOURCE - except/powerpc/chkstk_asm.s) + list(APPEND CHKSTK_SOURCE except/powerpc/chkstk_asm.s) endif() add_library(chkstk ${CHKSTK_SOURCE}) +add_dependencies(chkstk asm) include(crt.cmake) include(libcntpr.cmake) diff --git a/reactos/lib/sdk/crt/libcntpr.cmake b/reactos/lib/sdk/crt/libcntpr.cmake index c3362d17da0..011b9c3e3d5 100644 --- a/reactos/lib/sdk/crt/libcntpr.cmake +++ b/reactos/lib/sdk/crt/libcntpr.cmake @@ -65,7 +65,6 @@ list(APPEND LIBCNTPR_SOURCE if(ARCH MATCHES i386) list(APPEND LIBCNTPR_SOURCE except/i386/chkstk_asm.s - except/i386/chkstk_ms.s except/i386/seh.s except/i386/seh_prolog.s setjmp/i386/setjmp.s @@ -94,6 +93,9 @@ if(ARCH MATCHES i386) math/i386/tan_asm.s math/i386/ci.c misc/i386/readcr4.S) + if(NOT MSVC) + list(APPEND LIBCNTPR_SOURCE except/i386/chkstk_ms.s) + endif() elseif(ARCH MATCHES amd64) list(APPEND LIBCNTPR_SOURCE except/amd64/chkstk_asm.s diff --git a/reactos/msc.cmake b/reactos/msc.cmake index 274a03ffd1a..5ce8eb88696 100644 --- a/reactos/msc.cmake +++ b/reactos/msc.cmake @@ -31,8 +31,17 @@ endif() link_directories("${REACTOS_BINARY_DIR}/importlibs" ${REACTOS_BINARY_DIR}/lib/sdk/crt) +set(CMAKE_RC_COMPILE_OBJECT " /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 ") + +get_directory_property(definitions DEFINITIONS) + +set(CMAKE_ASM_COMPILE_OBJECT + " /nologo /X /I${REACTOS_SOURCE_DIR}/include/asm /I${REACTOS_BINARY_DIR}/include/asm /I${REACTOS_SOURCE_DIR}/include /I${REACTOS_SOURCE_DIR}/include/psdk /I${REACTOS_SOURCE_DIR}/include/dxsdk /I${REACTOS_BINARY_DIR}/include /I${REACTOS_BINARY_DIR}/include/dxsdk /I${REACTOS_BINARY_DIR}/include/psdk /I${REACTOS_BINARY_DIR}/include/reactos /I${REACTOS_SOURCE_DIR}/include/crt /I${REACTOS_SOURCE_DIR}/include/ddk /I${REACTOS_SOURCE_DIR}/include/ndk /I${REACTOS_SOURCE_DIR}/include/reactos /I${REACTOS_SOURCE_DIR}/include/reactos/libs /I${REACTOS_SOURCE_DIR}/include/crt/msc ${definitions} /D__ASM__ /D_USE_ML /EP /c > .tmp" + " /nologo /Cp /Fo /c /Ta .tmp") + set(CMAKE_RC_CREATE_SHARED_LIBRARY ${CMAKE_C_CREATE_SHARED_LIBRARY}) set(CMAKE_ASM_CREATE_SHARED_LIBRARY ${CMAKE_C_CREATE_SHARED_LIBRARY}) +set(CMAKE_ASM_CREATE_STATIC_LIBRARY ${CMAKE_C_CREATE_STATIC_LIBRARY}) macro(add_pch _target_name _FILE) endmacro() diff --git a/reactos/toolchain-msvc.cmake b/reactos/toolchain-msvc.cmake index e2db500e731..d46476affd8 100644 --- a/reactos/toolchain-msvc.cmake +++ b/reactos/toolchain-msvc.cmake @@ -13,12 +13,6 @@ else() set(CMAKE_ASM_COMPILER ml) endif() -set(CMAKE_RC_COMPILE_OBJECT " /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 ") - -set(CMAKE_ASM_COMPILE_OBJECT - " /nologo /X /I${REACTOS_SOURCE_DIR}/include/asm /I${REACTOS_BINARY_DIR}/include/asm /D__ASM__ /D_USE_ML /EP /c > .tmp" - " /nologo /Cp /Fo /c /Ta .tmp") - set(CMAKE_C_STANDARD_LIBRARIES "" CACHE INTERNAL "") if(CMAKE_SYSTEM_PROCESSOR MATCHES "x86")