[ros-diffs] [akhaldi] 52190: [CMAKE] * 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_CRE...

akhaldi at svn.reactos.org akhaldi at svn.reactos.org
Sat Jun 11 16:09:57 UTC 2011


Author: akhaldi
Date: Sat Jun 11 16:09:57 2011
New Revision: 52190

URL: http://svn.reactos.org/svn/reactos?rev=52190&view=rev
Log:
[CMAKE]
* 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.

Modified:
    trunk/reactos/CMakeLists.txt
    trunk/reactos/include/asm/CMakeLists.txt
    trunk/reactos/lib/sdk/crt/CMakeLists.txt
    trunk/reactos/lib/sdk/crt/libcntpr.cmake
    trunk/reactos/msc.cmake
    trunk/reactos/toolchain-msvc.cmake

Modified: trunk/reactos/CMakeLists.txt
URL: http://svn.reactos.org/svn/reactos/trunk/reactos/CMakeLists.txt?rev=52190&r1=52189&r2=52190&view=diff
==============================================================================
--- trunk/reactos/CMakeLists.txt [iso-8859-1] (original)
+++ trunk/reactos/CMakeLists.txt [iso-8859-1] Sat Jun 11 16:09:57 2011
@@ -93,25 +93,6 @@
     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()
@@ -149,6 +130,25 @@
     elseif(ARCH MATCHES arm)
         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
@@ -202,5 +202,4 @@
     file(MAKE_DIRECTORY ${CMAKE_BINARY_DIR}/importlibs)
 
     add_dependency_footer()
-
-endif()
+endif()

Modified: trunk/reactos/include/asm/CMakeLists.txt
URL: http://svn.reactos.org/svn/reactos/trunk/reactos/include/asm/CMakeLists.txt?rev=52190&r1=52189&r2=52190&view=diff
==============================================================================
--- trunk/reactos/include/asm/CMakeLists.txt [iso-8859-1] (original)
+++ trunk/reactos/include/asm/CMakeLists.txt [iso-8859-1] Sat Jun 11 16:09:57 2011
@@ -16,9 +16,11 @@
     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

Modified: trunk/reactos/lib/sdk/crt/CMakeLists.txt
URL: http://svn.reactos.org/svn/reactos/trunk/reactos/lib/sdk/crt/CMakeLists.txt?rev=52190&r1=52189&r2=52190&view=diff
==============================================================================
--- trunk/reactos/lib/sdk/crt/CMakeLists.txt [iso-8859-1] (original)
+++ trunk/reactos/lib/sdk/crt/CMakeLists.txt [iso-8859-1] Sat Jun 11 16:09:57 2011
@@ -4,19 +4,21 @@
 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)

Modified: trunk/reactos/lib/sdk/crt/libcntpr.cmake
URL: http://svn.reactos.org/svn/reactos/trunk/reactos/lib/sdk/crt/libcntpr.cmake?rev=52190&r1=52189&r2=52190&view=diff
==============================================================================
--- trunk/reactos/lib/sdk/crt/libcntpr.cmake [iso-8859-1] (original)
+++ trunk/reactos/lib/sdk/crt/libcntpr.cmake [iso-8859-1] Sat Jun 11 16:09:57 2011
@@ -65,7 +65,6 @@
 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 @@
         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

Modified: trunk/reactos/msc.cmake
URL: http://svn.reactos.org/svn/reactos/trunk/reactos/msc.cmake?rev=52190&r1=52189&r2=52190&view=diff
==============================================================================
--- trunk/reactos/msc.cmake [iso-8859-1] (original)
+++ trunk/reactos/msc.cmake [iso-8859-1] Sat Jun 11 16:09:57 2011
@@ -31,8 +31,17 @@
 
 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()

Modified: trunk/reactos/toolchain-msvc.cmake
URL: http://svn.reactos.org/svn/reactos/trunk/reactos/toolchain-msvc.cmake?rev=52190&r1=52189&r2=52190&view=diff
==============================================================================
--- trunk/reactos/toolchain-msvc.cmake [iso-8859-1] (original)
+++ trunk/reactos/toolchain-msvc.cmake [iso-8859-1] Sat Jun 11 16:09:57 2011
@@ -13,12 +13,6 @@
     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")




More information about the Ros-diffs mailing list