Author: jgardou
Date: Thu Oct 14 11:03:20 2010
New Revision: 49141
URL:
http://svn.reactos.org/svn/reactos?rev=49141&view=rev
Log:
[CMAKE]
- add kernelmodedriver module type
- add set_cpp macro, which takes care of all c++ stuff for you
- hackfix stlport headers for c++ kernel mode modules.
- complain about explorer
- solitaire, telnet and uniata now build happily against stlport
Modified:
branches/cmake-bringup/base/applications/games/CMakeLists.txt
branches/cmake-bringup/base/applications/games/solitaire/CMakeLists.txt
branches/cmake-bringup/base/applications/network/CMakeLists.txt
branches/cmake-bringup/base/applications/network/telnet/CMakeLists.txt
branches/cmake-bringup/base/shell/explorer/CMakeLists.txt
branches/cmake-bringup/drivers/storage/ide/uniata/CMakeLists.txt
branches/cmake-bringup/gcc.cmake
branches/cmake-bringup/lib/3rdparty/stlport/CMakeLists.txt
branches/cmake-bringup/lib/3rdparty/stlport/stlport/stl/config/_windows.h
Modified: branches/cmake-bringup/base/applications/games/CMakeLists.txt
URL:
http://svn.reactos.org/svn/reactos/branches/cmake-bringup/base/applications…
==============================================================================
--- branches/cmake-bringup/base/applications/games/CMakeLists.txt [iso-8859-1] (original)
+++ branches/cmake-bringup/base/applications/games/CMakeLists.txt [iso-8859-1] Thu Oct 14
11:03:20 2010
@@ -1,4 +1,4 @@
-#add_subdirectory(solitaire)
+add_subdirectory(solitaire)
#add_subdirectory(spider)
add_subdirectory(winemine)
Modified: branches/cmake-bringup/base/applications/games/solitaire/CMakeLists.txt
URL:
http://svn.reactos.org/svn/reactos/branches/cmake-bringup/base/applications…
==============================================================================
--- branches/cmake-bringup/base/applications/games/solitaire/CMakeLists.txt [iso-8859-1]
(original)
+++ branches/cmake-bringup/base/applications/games/solitaire/CMakeLists.txt [iso-8859-1]
Thu Oct 14 11:03:20 2010
@@ -1,5 +1,6 @@
set_unicode()
+set_cpp()
include_directories(${REACTOS_SOURCE_DIR}/lib/3rdparty/cardlib)
@@ -9,8 +10,8 @@
solitaire.cpp
rsrc.rc)
-target_link_libraries(sol stlport cardlib)
+target_link_libraries(sol cardlib)
set_module_type(sol win32gui)
-add_importlibs(sol advapi32 comctl32 user32 gdi32 msvcrt)
+add_importlibs(sol advapi32 comctl32 user32 gdi32 kernel32 msvcrt)
Modified: branches/cmake-bringup/base/applications/network/CMakeLists.txt
URL:
http://svn.reactos.org/svn/reactos/branches/cmake-bringup/base/applications…
==============================================================================
--- branches/cmake-bringup/base/applications/network/CMakeLists.txt [iso-8859-1]
(original)
+++ branches/cmake-bringup/base/applications/network/CMakeLists.txt [iso-8859-1] Thu Oct
14 11:03:20 2010
@@ -9,6 +9,6 @@
add_subdirectory(nslookup)
add_subdirectory(ping)
#add_subdirectory(route)
-#add_subdirectory(telnet)
+add_subdirectory(telnet)
add_subdirectory(tracert)
#add_subdirectory(whois)
Modified: branches/cmake-bringup/base/applications/network/telnet/CMakeLists.txt
URL:
http://svn.reactos.org/svn/reactos/branches/cmake-bringup/base/applications…
==============================================================================
--- branches/cmake-bringup/base/applications/network/telnet/CMakeLists.txt [iso-8859-1]
(original)
+++ branches/cmake-bringup/base/applications/network/telnet/CMakeLists.txt [iso-8859-1]
Thu Oct 14 11:03:20 2010
@@ -1,4 +1,6 @@
add_definitions(-D_CRT_NONSTDC_NO_DEPRECATE)
+
+set_cpp()
add_executable(telnet
src/ansiprsr.cpp
@@ -22,8 +24,6 @@
src/ttelhndl.cpp
telnet.rc)
-target_link_libraries(telnet stlport)
-
set_module_type(telnet win32cui)
-add_importlibs(telnet ws2_32 user32 msvcrt kernel32)
+add_importlibs(telnet ws2_32 user32 kernel32 msvcrt)
Modified: branches/cmake-bringup/base/shell/explorer/CMakeLists.txt
URL:
http://svn.reactos.org/svn/reactos/branches/cmake-bringup/base/shell/explor…
==============================================================================
--- branches/cmake-bringup/base/shell/explorer/CMakeLists.txt [iso-8859-1] (original)
+++ branches/cmake-bringup/base/shell/explorer/CMakeLists.txt [iso-8859-1] Thu Oct 14
11:03:20 2010
@@ -2,6 +2,10 @@
add_subdirectory(notifyhook)
set_unicode()
+
+#NOTE : explorer doesn't follow standard c++, and so doesn't compile with stlport
headers
+#I'm not willing to do it if explorer_new is hanging around
+set(CMAKE_CXX_COMPILE_OBJECT "<CMAKE_CXX_COMPILER> <DEFINES>
<FLAGS> -o <OBJECT> -c <SOURCE>")
add_definitions(-DWIN32)
add_definitions(-D__WINDRES__)
Modified: branches/cmake-bringup/drivers/storage/ide/uniata/CMakeLists.txt
URL:
http://svn.reactos.org/svn/reactos/branches/cmake-bringup/drivers/storage/i…
==============================================================================
--- branches/cmake-bringup/drivers/storage/ide/uniata/CMakeLists.txt [iso-8859-1]
(original)
+++ branches/cmake-bringup/drivers/storage/ide/uniata/CMakeLists.txt [iso-8859-1] Thu Oct
14 11:03:20 2010
@@ -1,7 +1,7 @@
-
-set(CMAKE_CXX_CREATE_SHARED_LIBRARY "<CMAKE_CXX_COMPILER>
<CMAKE_SHARED_LIBRARY_CXX_FLAGS> <LINK_FLAGS>
<CMAKE_SHARED_LIBRARY_CREATE_CXX_FLAGS> -o <TARGET> <OBJECTS>
<LINK_LIBRARIES>")
include_directories(inc)
+
+set_cpp()
add_library(uniata SHARED
id_ata.cpp
@@ -14,13 +14,8 @@
idedma.rc
ros_glue/ros_glue.cpp)
-set_target_properties(uniata PROPERTIES LINK_FLAGS "-Wl,-entry,_DriverEntry@8
-Wl,--image-base,0x00010000 -Wl,--exclude-all-symbols -Wl,--subsystem,native" SUFFIX
".sys")
+set_module_type(uniata kernelmodedriver)
-target_link_libraries(uniata
- -lscsiport
- -lntoskrnl
- -lhal
- -lgcc)
+add_importlibs(uniata scsiport ntoskrnl hal)
-add_dependencies(uniata psdk bugcodes buildno_header)
add_minicd_target(uniata reactos uniata.sys)
Modified: branches/cmake-bringup/gcc.cmake
URL:
http://svn.reactos.org/svn/reactos/branches/cmake-bringup/gcc.cmake?rev=491…
==============================================================================
--- branches/cmake-bringup/gcc.cmake [iso-8859-1] (original)
+++ branches/cmake-bringup/gcc.cmake [iso-8859-1] Thu Oct 14 11:03:20 2010
@@ -18,7 +18,7 @@
add_definitions(-pipe -fms-extensions)
# stlport includes
-set(CMAKE_CXX_COMPILE_OBJECT "<CMAKE_CXX_COMPILER> <DEFINES>
<FLAGS> -o <OBJECT> -c <SOURCE>")
+set(CMAKE_CXX_COMPILE_OBJECT "<CMAKE_CXX_COMPILER> <DEFINES>
-I${REACTOS_SOURCE_DIR}/lib/3rdparty/stlport/stlport <FLAGS> -o <OBJECT> -c
<SOURCE>")
set(CMAKE_C_CREATE_SHARED_LIBRARY "<CMAKE_C_COMPILER>
<CMAKE_SHARED_LIBRARY_C_FLAGS> <LINK_FLAGS>
<CMAKE_SHARED_LIBRARY_CREATE_C_FLAGS> -o <TARGET> <OBJECTS>
<LINK_LIBRARIES>")
@@ -35,14 +35,6 @@
# Optimizations
add_definitions(-Os -fno-strict-aliasing -ftracer -momit-leaf-frame-pointer
-mpreferred-stack-boundary=2 -fno-set-stack-executable -fno-optimize-sibling-calls)
-
-#linkage hell...
-#add_library(gcc STATIC IMPORTED)
-#set_target_properties(gcc PROPERTIES IMPORTED_LOCATION
${REACTOS_SOURCE_DIR}/importlibs/libgcc.a
-# IMPORTED_LINK_INTERFACE_LIBRARIES "mingw_common -lkernel32")
-#add_library(supc++ STATIC IMPORTED)
-#set_target_properties(supc++ PROPERTIES IMPORTED_LOCATION
${REACTOS_SOURCE_DIR}/importlibs/libsupc++.a
-# IMPORTED_LINK_INTERFACE_LIBRARIES "gcc -lmsvcrt")
# Macros
macro(set_entrypoint MODULE ENTRYPOINT)
@@ -76,7 +68,11 @@
macro(set_module_type MODULE TYPE)
add_dependencies(${MODULE} psdk buildno_header)
-
+
+ if(${IS_CPP})
+ target_link_libraries(${MODULE} stlport -lsupc++ -lgcc)
+ endif()
+
if(${TYPE} MATCHES nativecui)
set_subsystem(${MODULE} native)
set_entrypoint(${MODULE} NtProcessStartup@4)
@@ -112,6 +108,12 @@
set_entrypoint(${MODULE} DllMain@12)
set_target_properties(${MODULE} PROPERTIES SUFFIX ".cpl")
endif()
+ if(${TYPE} MATCHES kernelmodedriver)
+ set_target_properties(${MODULE} PROPERTIES LINK_FLAGS
"-Wl,--image-base,0x00010000 -Wl,--exclude-all-symbols" SUFFIX
".sys")
+ set_entrypoint(${MODULE} DriverEntry@8)
+ set_subsystem(${MODULE} native)
+ add_dependencies(${MODULE} bugcodes)
+ endif()
endmacro()
endif()
@@ -120,6 +122,10 @@
add_definitions(-DUNICODE -D_UNICODE)
set(IS_UNICODE 1)
endmacro()
+
+macro(set_cpp)
+ set(IS_CPP 1)
+ endmacro()
# Workaround lack of mingw RC support in cmake
macro(set_rc_compiler)
Modified: branches/cmake-bringup/lib/3rdparty/stlport/CMakeLists.txt
URL:
http://svn.reactos.org/svn/reactos/branches/cmake-bringup/lib/3rdparty/stlp…
==============================================================================
--- branches/cmake-bringup/lib/3rdparty/stlport/CMakeLists.txt [iso-8859-1] (original)
+++ branches/cmake-bringup/lib/3rdparty/stlport/CMakeLists.txt [iso-8859-1] Thu Oct 14
11:03:20 2010
@@ -41,9 +41,3 @@
src/cxa.c)
add_library(stlport ${SOURCE})
-
-if(NOT MSVC)
- #those are mandatory to get correctly ordered linked libraries.
- #target_link_libraries(stlport supc++ msvcrt.dll.a)
- #add_importlibs(stlport msvcrt)
-endif()
Modified: branches/cmake-bringup/lib/3rdparty/stlport/stlport/stl/config/_windows.h
URL:
http://svn.reactos.org/svn/reactos/branches/cmake-bringup/lib/3rdparty/stlp…
==============================================================================
--- branches/cmake-bringup/lib/3rdparty/stlport/stlport/stl/config/_windows.h [iso-8859-1]
(original)
+++ branches/cmake-bringup/lib/3rdparty/stlport/stlport/stl/config/_windows.h [iso-8859-1]
Thu Oct 14 11:03:20 2010
@@ -44,7 +44,7 @@
# endif
#endif /* _STLP_BIG_ENDIAN */
-#if !defined (_STLP_WINDOWS_H_INCLUDED)
+#if !defined (_STLP_WINDOWS_H_INCLUDED) && !defined(_WDMDDK_) //let's hope it
will work long enough...
# define _STLP_WINDOWS_H_INCLUDED
# if defined (__BUILDING_STLPORT)
# include <stl/config/_native_headers.h>