* Move CMAKE_RC_COMPILE_OBJECT and CMAKE_ASM_COMPILE_OBJECT to msc.cmake.
* Fix CMAKE_ASM_COMPILE_OBJECT to account for the needed includes and defines.
* Add CMAKE_ASM_CREATE_STATIC_LIBRARY to handle our asm static lib.
* Don't include chkstk_ms.s into chkstk and libcntpr for msvc.
* Add missing chkstk -> asm dependency.
* Don't make an assumption about the location of genincdata.dll.
* Move definition on top of the included cmake files in the root cmake file.
* This brings the VS solution to a working state, many modules can compile now.

svn path=/trunk/; revision=52190
This commit is contained in:
Amine Khaldi 2011-06-11 16:09:57 +00:00
parent feb81e4924
commit 7d25a0c11b
6 changed files with 44 additions and 36 deletions

View file

@ -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()

View file

@ -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

View file

@ -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)

View file

@ -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

View file

@ -31,8 +31,17 @@ endif()
link_directories("${REACTOS_BINARY_DIR}/importlibs" ${REACTOS_BINARY_DIR}/lib/sdk/crt)
set(CMAKE_RC_COMPILE_OBJECT "<CMAKE_RC_COMPILER> <DEFINES> /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 <OBJECT> <SOURCE>")
get_directory_property(definitions DEFINITIONS)
set(CMAKE_ASM_COMPILE_OBJECT
"<CMAKE_C_COMPILER> /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 <SOURCE> > <OBJECT>.tmp"
"<CMAKE_ASM_COMPILER> /nologo /Cp /Fo<OBJECT> /c /Ta <OBJECT>.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()

View file

@ -13,12 +13,6 @@ else()
set(CMAKE_ASM_COMPILER ml)
endif()
set(CMAKE_RC_COMPILE_OBJECT "<CMAKE_RC_COMPILER> <DEFINES> /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 <OBJECT> <SOURCE>")
set(CMAKE_ASM_COMPILE_OBJECT
"<CMAKE_C_COMPILER> /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")
set(CMAKE_C_STANDARD_LIBRARIES "" CACHE INTERNAL "")
if(CMAKE_SYSTEM_PROCESSOR MATCHES "x86")