mirror of
https://github.com/reactos/reactos.git
synced 2025-05-17 16:27:00 +00:00
[SHLWAPI] Use an object library to separate C & C++ compilation units
CORE-17423
This commit is contained in:
parent
3476cdae77
commit
93d741c3f4
1 changed files with 10 additions and 3 deletions
|
@ -27,21 +27,28 @@ list(APPEND SOURCE
|
|||
url.c)
|
||||
|
||||
list(APPEND PCH_SKIP_SOURCE
|
||||
autocomp.cpp
|
||||
wsprintf.c
|
||||
${CMAKE_CURRENT_BINARY_DIR}/shlwapi_stubs.c)
|
||||
|
||||
add_library(shlwapi MODULE
|
||||
${SOURCE}
|
||||
${PCH_SKIP_SOURCE}
|
||||
$<TARGET_OBJECTS:shlwapi_autocomp>
|
||||
shlwapi.rc
|
||||
${CMAKE_CURRENT_BINARY_DIR}/shlwapi.def)
|
||||
|
||||
# our C++ atlbase.h conflicts with the one from wine, so only use wine includes for C
|
||||
target_include_directories(shlwapi BEFORE PRIVATE $<$<COMPILE_LANGUAGE:C>:${REACTOS_SOURCE_DIR}/sdk/include/reactos/wine>)
|
||||
# Unfortunately, we can't use different includes for C & C++ in VS generator, so use an object library to achieve this
|
||||
target_include_directories(shlwapi BEFORE PRIVATE ${REACTOS_SOURCE_DIR}/sdk/include/reactos/wine)
|
||||
|
||||
add_library(shlwapi_autocomp OBJECT autocomp.cpp)
|
||||
target_link_libraries(shlwapi_autocomp PRIVATE atl_classes)
|
||||
target_compile_definitions(shlwapi_autocomp PRIVATE $<TARGET_PROPERTY:shlwapi,COMPILE_DEFINITIONS>)
|
||||
target_compile_options(shlwapi_autocomp PRIVATE $<TARGET_PROPERTY:shlwapi,COMPILE_OPTIONS>)
|
||||
add_dependencies(shlwapi_autocomp psdk)
|
||||
|
||||
set_module_type(shlwapi win32dll UNICODE)
|
||||
target_link_libraries(shlwapi uuid wine cpprt atl_classes)
|
||||
target_link_libraries(shlwapi uuid wine cpprt)
|
||||
add_delay_importlibs(shlwapi userenv oleaut32 ole32 comdlg32 mpr mlang urlmon shell32 winmm version)
|
||||
add_importlibs(shlwapi user32 gdi32 advapi32 wininet msvcrt kernel32 ntdll)
|
||||
add_pch(shlwapi precomp.h "${PCH_SKIP_SOURCE}")
|
||||
|
|
Loading…
Reference in a new issue