* Sync up to trunk head (r64829).
[reactos.git] / cmake / CMakeMacros.cmake
index 03e53bd..85eff72 100644 (file)
@@ -502,14 +502,6 @@ function(add_importlibs _module)
         if("${LIB}" MATCHES "msvcrt")
             add_target_compile_definitions(${_module} _DLL __USE_CRTIMP)
             target_link_libraries(${_module} msvcrtex)
-            if(MSVC)
-                if(RUNTIME_CHECKS)
-                    if(NOT ${_module} STREQUAL "kernel32")
-                        add_target_compile_flags(${_module} "/RTC1")
-                        target_link_libraries(${_module} RunTmChk.lib)
-                    endif()
-                endif()
-            endif()
         endif()
         target_link_libraries(${_module} lib${LIB})
         add_dependencies(${_module} lib${LIB})
@@ -533,17 +525,6 @@ function(set_module_type MODULE TYPE)
         set(__subsystem console)
     elseif(${TYPE} STREQUAL win32gui)
         set(__subsystem windows)
-    elseif(${TYPE} STREQUAL kbdlayout)
-        set_entrypoint(${MODULE} 0)
-        set_image_base(${MODULE} 0x5FFF0000)
-        set_subsystem(${MODULE} native)
-        if (MSVC)
-            # Merge the .text and .rdata section into the .data section
-            add_target_link_flags(${MODULE} "/ignore:4254 /SECTION:.data,ER /MERGE:.text=.data /MERGE:.rdata=.data /MERGE:.bss=.data /MERGE:.edata=.data")
-        else()
-            # Use a custom linker script
-            add_target_link_flags(${MODULE} "-Wl,-T,${CMAKE_SOURCE_DIR}/kbdlayout.lds")
-        endif()
     elseif(NOT ((${TYPE} STREQUAL win32dll) OR (${TYPE} STREQUAL win32ocx)
             OR (${TYPE} STREQUAL cpl) OR (${TYPE} STREQUAL module)))
         message(FATAL_ERROR "Unknown type ${TYPE} for module ${MODULE}")
@@ -618,19 +599,19 @@ function(set_module_type MODULE TYPE)
 
     #set base address
     if(__module_IMAGEBASE)
-        set_image_base(${MODULE} __module_IMAGEBASE)
+        set_image_base(${MODULE} ${__module_IMAGEBASE})
     elseif(${TYPE} STREQUAL win32dll)
         if(DEFINED baseaddress_${MODULE})
             set_image_base(${MODULE} ${baseaddress_${MODULE}})
         else()
             message(STATUS "${MODULE} has no base address")
         endif()
-    elseif((${TYPE} STREQUAL kernelmodedriver) OR (${TYPE} STREQUAL wdmdriver) OR (${TYPE} STREQUAL kernelmodedll))
+    elseif((${TYPE} STREQUAL kernelmodedriver) OR (${TYPE} STREQUAL wdmdriver) OR (${TYPE} STREQUAL kerneldll))
         set_image_base(${MODULE} 0x00010000)
     endif()
 
     # Now do some stuff which is specific to each type
-    if((${TYPE} STREQUAL kernelmodedriver) OR (${TYPE} STREQUAL wdmdriver) OR (${TYPE} STREQUAL kernelmodedll))
+    if((${TYPE} STREQUAL kernelmodedriver) OR (${TYPE} STREQUAL wdmdriver) OR (${TYPE} STREQUAL kerneldll))
         add_dependencies(${MODULE} bugcodes)
         if((${TYPE} STREQUAL kernelmodedriver) OR (${TYPE} STREQUAL wdmdriver))
             set_target_properties(${MODULE} PROPERTIES SUFFIX ".sys")