mirror of
https://github.com/reactos/reactos.git
synced 2024-08-03 18:10:54 +00:00
[CMAKE]
Add a new macro set_export_spec(), that replaces the use of spec2def + adding the generated def file to the sources Remove EXTERNAL_OBJECT TRUE property for the generated def files. svn path=/branches/cmake-bringup/; revision=49629
This commit is contained in:
parent
5054fc46a3
commit
390cf6bc5f
|
@ -1,19 +1,17 @@
|
|||
|
||||
set_unicode()
|
||||
|
||||
spec2def(acledit.dll acledit.spec)
|
||||
|
||||
list(APPEND SOURCE
|
||||
acledit.c
|
||||
stubs.c
|
||||
acledit.rc
|
||||
${CMAKE_CURRENT_BINARY_DIR}/acledit.def)
|
||||
|
||||
acledit.rc)
|
||||
|
||||
add_library(acledit SHARED ${SOURCE})
|
||||
|
||||
set_module_type(acledit win32dll)
|
||||
|
||||
set_export_spec(acledit acledit.spec)
|
||||
|
||||
add_importlibs(acledit ntdll)
|
||||
|
||||
add_cab_target(acledit 1)
|
||||
|
|
|
@ -17,7 +17,8 @@ add_library(aclui SHARED
|
|||
|
||||
set_module_type(aclui win32dll)
|
||||
|
||||
set_pdef_file(aclui aclui.pdef)
|
||||
set_export_spec(aclui aclui.spec aclui.dll)
|
||||
|
||||
add_importlib_target(${CMAKE_CURRENT_BINARY_DIR}/aclui.def)
|
||||
|
||||
add_importlibs(aclui user32 gdi32 comctl32 ole32 oleaut32 advapi32 uxtheme kernel32 ntdll)
|
||||
|
|
|
@ -5,7 +5,8 @@ add_library(avicap32 SHARED avicap32.c avicap32.rc)
|
|||
|
||||
set_module_type(avicap32 win32dll)
|
||||
|
||||
set_pdef_file(avicap32 avicap32.pdef)
|
||||
set_export_spec(avicap32 avicap32.spec)
|
||||
|
||||
add_importlib_target(${CMAKE_CURRENT_BINARY_DIR}/avicap32.def)
|
||||
|
||||
target_link_libraries(avicap32 wine)
|
||||
|
|
|
@ -5,7 +5,8 @@ add_library(batt SHARED batt.c batt.rc)
|
|||
|
||||
set_module_type(batt win32dll)
|
||||
|
||||
set_pdef_file(batt batt.pdef)
|
||||
set_export_spec(batt batt.spec)
|
||||
|
||||
add_importlib_target(${CMAKE_CURRENT_BINARY_DIR}/batt.def)
|
||||
|
||||
add_importlibs(batt kernel32)
|
||||
|
|
|
@ -3,11 +3,13 @@ set_unicode()
|
|||
|
||||
add_library(beepmidi SHARED beepmidi.c)
|
||||
|
||||
set_pdef_file(beepmidi beepmidi.pdef)
|
||||
set_export_spec(beepmidi beepmidi.spec)
|
||||
|
||||
add_importlib_target(${CMAKE_CURRENT_BINARY_DIR}/beepmidi.def)
|
||||
|
||||
set_entrypoint(beepmidi 0)
|
||||
|
||||
add_importlibs(beepmidi winmm kernel32 ntdll)
|
||||
add_dependencies(beepmidi psdk)
|
||||
add_cab_target(beepmidi 1)
|
||||
add_cab_target(beepmidi 1)
|
||||
|
||||
|
|
|
@ -6,7 +6,8 @@ add_definitions(-DCARDSTYLE_DEFAULT)
|
|||
|
||||
add_library(cards SHARED cards.c cards.rc)
|
||||
|
||||
set_pdef_file(cards cards.pdef)
|
||||
set_export_spec(cards cards.spec)
|
||||
|
||||
add_importlib_target(${CMAKE_CURRENT_BINARY_DIR}/cards.def)
|
||||
|
||||
set_module_type(cards win32dll)
|
||||
|
|
|
@ -4,13 +4,14 @@ include_directories(${REACTOS_SOURCE_DIR}/include/reactos/wine)
|
|||
|
||||
add_library(compstui SHARED compstui_main.c)
|
||||
|
||||
set_pdef_file(compstui compstui.pdef)
|
||||
add_importlib_target(${CMAKE_CURRENT_BINARY_DIR}/compstui.def)
|
||||
|
||||
set_module_type(compstui win32dll)
|
||||
|
||||
set_export_spec(compstui compstui.spec)
|
||||
|
||||
target_link_libraries(compstui wine)
|
||||
|
||||
add_importlibs(compstui kernel32 ntdll)
|
||||
|
||||
add_cab_target(compstui 1)
|
||||
add_importlib_target(compstui.spec)
|
||||
|
||||
|
|
|
@ -49,7 +49,7 @@ target_link_libraries(gdi32
|
|||
dxguid
|
||||
${PSEH_LIB})
|
||||
|
||||
set_pdef_file(gdi32 gdi32.pdef)
|
||||
set_export_spec(gdi32 gdi32.spec)
|
||||
|
||||
add_importlibs(gdi32 user32 advapi32 kernel32 ntdll)
|
||||
add_pch(gdi32 ${CMAKE_CURRENT_SOURCE_DIR}/include/precomp.h ${SOURCE})
|
||||
|
|
|
@ -5,7 +5,8 @@ include_directories(${REACTOS_SOURCE_DIR}/include/reactos/wine)
|
|||
|
||||
add_library(getuname SHARED getuname.c getuname.rc)
|
||||
|
||||
set_pdef_file(getuname getuname.pdef)
|
||||
set_export_spec(getuname getuname.spec)
|
||||
|
||||
add_importlib_target(${CMAKE_CURRENT_BINARY_DIR}/getuname.def)
|
||||
|
||||
set_module_type(getuname win32dll)
|
||||
|
|
|
@ -4,7 +4,8 @@ include_directories(${REACTOS_SOURCE_DIR}/include/reactos/wine)
|
|||
|
||||
add_library(localui SHARED localui.c localui.rc)
|
||||
|
||||
set_pdef_file(localui localui.pdef)
|
||||
set_export_spec(localui localui.spec)
|
||||
|
||||
add_importlib_target(${CMAKE_CURRENT_BINARY_DIR}/localui.def)
|
||||
|
||||
set_module_type(localui win32dll)
|
||||
|
|
|
@ -6,7 +6,8 @@ include_directories(include)
|
|||
|
||||
add_library(lpk SHARED dllmain.c stub.c lpk.rc)
|
||||
|
||||
set_pdef_file(lpk lpk.pdef)
|
||||
set_export_spec(lpk lpk.spec)
|
||||
|
||||
add_importlib_target(${CMAKE_CURRENT_BINARY_DIR}/lpk.def)
|
||||
|
||||
set_module_type(lpk win32dll)
|
||||
|
|
29
gcc.cmake
29
gcc.cmake
|
@ -161,27 +161,20 @@ MACRO(spec2def _dllname _spec_file)
|
|||
COMMAND native-winebuild -o ${CMAKE_CURRENT_BINARY_DIR}/${_file}.def --def -E ${CMAKE_CURRENT_SOURCE_DIR}/${_spec_file} --filename ${_dllname}
|
||||
DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/${_spec_file})
|
||||
set_source_files_properties(${CMAKE_CURRENT_BINARY_DIR}/${_file}.def
|
||||
PROPERTIES GENERATED TRUE EXTERNAL_OBJECT TRUE)
|
||||
PROPERTIES GENERATED TRUE)
|
||||
ENDMACRO(spec2def _dllname _spec_file)
|
||||
|
||||
macro(pdef2def _pdef_file)
|
||||
get_filename_component(_file ${_pdef_file} NAME_WE)
|
||||
add_custom_command(
|
||||
OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/${_file}.def
|
||||
COMMAND ${MINGW_PREFIX}cpp -o ${CMAKE_CURRENT_BINARY_DIR}/${_file}.def -P -E ${CMAKE_CURRENT_SOURCE_DIR}/${_pdef_file}
|
||||
DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/${_pdef_file})
|
||||
set_source_files_properties(${CMAKE_CURRENT_BINARY_DIR}/${_file}.def
|
||||
PROPERTIES GENERATED TRUE EXTERNAL_OBJECT TRUE)
|
||||
add_custom_target(
|
||||
${_file}_def
|
||||
DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/${_file}.def)
|
||||
endmacro(pdef2def _pdef_file)
|
||||
|
||||
macro(set_pdef_file _module _pdef_file)
|
||||
pdef2def(${_pdef_file})
|
||||
get_filename_component(_file ${_pdef_file} NAME_WE)
|
||||
# Optional 3rd parameter: dllname
|
||||
macro(set_export_spec _module _spec_file)
|
||||
get_filename_component(_file ${_spec_file} NAME_WE)
|
||||
if (${ARGC} GREATER 2)
|
||||
set(_dllname ${ARGV2})
|
||||
else()
|
||||
set(_dllname ${_file}.dll)
|
||||
endif()
|
||||
spec2def(${_dllname} ${_spec_file})
|
||||
target_link_libraries(${_module} "${CMAKE_CURRENT_BINARY_DIR}/${_file}.def")
|
||||
add_dependencies(${_module} ${_file}_def)
|
||||
add_dependencies(${_module} ${CMAKE_CURRENT_BINARY_DIR}/${_file}.def)
|
||||
endmacro()
|
||||
|
||||
#pseh lib, needed with mingw
|
||||
|
|
27
msc.cmake
27
msc.cmake
|
@ -155,25 +155,20 @@ MACRO(spec2def _dllname _spec_file)
|
|||
COMMAND native-spec2pdef -n --dll ${_dllname} ${CMAKE_CURRENT_SOURCE_DIR}/${_spec_file} ${CMAKE_CURRENT_BINARY_DIR}/${_file}.def
|
||||
DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/${_spec_file})
|
||||
set_source_files_properties(${CMAKE_CURRENT_BINARY_DIR}/${_file}.def
|
||||
PROPERTIES GENERATED TRUE EXTERNAL_OBJECT TRUE)
|
||||
PROPERTIES GENERATED TRUE)
|
||||
ENDMACRO(spec2def _dllname _spec_file)
|
||||
|
||||
macro(pdef2def _pdef_file)
|
||||
get_filename_component(_file ${_pdef_file} NAME_WE)
|
||||
add_custom_command(
|
||||
OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/${_file}.def
|
||||
COMMAND ${CMAKE_C_COMPILER} /EP /c ${CMAKE_CURRENT_SOURCE_DIR}/${_pdef_file} > ${CMAKE_CURRENT_BINARY_DIR}/${_file}.def
|
||||
DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/${_pdef_file})
|
||||
add_custom_target(
|
||||
${_file}_def
|
||||
DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/${_file}.def)
|
||||
endmacro(pdef2def _pdef_file)
|
||||
|
||||
macro(set_pdef_file _module _pdef_file)
|
||||
pdef2def(${_pdef_file})
|
||||
get_filename_component(_file ${_pdef_file} NAME_WE)
|
||||
# Optional 3rd parameter: dllname
|
||||
macro(set_export_spec _module _spec_file)
|
||||
get_filename_component(_file ${_spec_file} NAME_WE)
|
||||
if (${ARGC} GREATER 2)
|
||||
set(_dllname ${ARGV2})
|
||||
else()
|
||||
set(_dllname ${_file}.dll)
|
||||
endif()
|
||||
spec2def(${_dllname} ${_spec_file})
|
||||
add_linkerflag(${_module} "/DEF:${CMAKE_CURRENT_BINARY_DIR}/${_file}.def")
|
||||
add_dependencies(${_module} ${_file}_def)
|
||||
add_dependencies(${_module} ${CMAKE_CURRENT_BINARY_DIR}/${_file}.def)
|
||||
endmacro()
|
||||
|
||||
file(MAKE_DIRECTORY ${CMAKE_BINARY_DIR}/importlibs)
|
||||
|
|
Loading…
Reference in a new issue