[CMAKE] Fix compilation with newer windres versions

Also use clang as preprocessor when using it
Also, use *our* headers instead of the platform ones
This commit is contained in:
Jérôme Gardou 2021-04-27 11:11:41 +02:00
parent ba9a7decba
commit 9ef5a7eb7a
3 changed files with 8 additions and 4 deletions

View file

@ -1,4 +1,5 @@
add_library(themeui MODULE themeui.rc)
add_dependencies(themeui psdk)
set_module_type(themeui win32dll ENTRYPOINT 0)
add_cd_file(TARGET themeui DESTINATION reactos/system32 FOR all)

View file

@ -256,13 +256,15 @@ set(CMAKE_CXX_COMPILE_OBJECT "<CMAKE_CXX_COMPILER> <DEFINES> <INCLUDES> <FLAGS>
set(CMAKE_ASM_COMPILE_OBJECT "<CMAKE_ASM_COMPILER> ${_compress_debug_sections_flag} -x assembler-with-cpp -o <OBJECT> -I${REACTOS_SOURCE_DIR}/sdk/include/asm -I${REACTOS_BINARY_DIR}/sdk/include/asm <INCLUDES> <FLAGS> <DEFINES> -D__ASM__ -c <SOURCE>")
set(CMAKE_RC_COMPILE_OBJECT "<CMAKE_RC_COMPILER> -O coff <INCLUDES> <FLAGS> -DRC_INVOKED -D__WIN32__=1 -D__FLAT__=1 ${I18N_DEFS} <DEFINES> <SOURCE> <OBJECT>")
if (CLANG)
set(GCC_EXECUTABLE ${CMAKE_C_COMPILER_TARGET}-gcc)
if (CMAKE_C_COMPILER_ID STREQUAL "Clang")
set(RC_PREPROCESSOR_TARGET "--preprocessor-arg=--target=${CMAKE_C_COMPILER_TARGET}")
else()
set(GCC_EXECUTABLE ${CMAKE_C_COMPILER})
set(RC_PREPROCESSOR_TARGET "")
endif()
set(CMAKE_DEPFILE_FLAGS_RC "--preprocessor \"${GCC_EXECUTABLE} -E -xc-header -MMD -MF <DEPFILE> -MT <OBJECT>\" ")
# We have to pass args to windres. one... by... one...
set(CMAKE_DEPFILE_FLAGS_RC "--preprocessor=\"${CMAKE_C_COMPILER}\" ${RC_PREPROCESSOR_TARGET} --preprocessor-arg=-E --preprocessor-arg=-nostdinc --preprocessor-arg=-xc-header --preprocessor-arg=-MMD --preprocessor-arg=-MF --preprocessor-arg=<DEPFILE> --preprocessor-arg=-MT --preprocessor-arg=<OBJECT>")
# Optional 3rd parameter: stdcall stack bytes
function(set_entrypoint MODULE ENTRYPOINT)

View file

@ -2,5 +2,6 @@
file(GLOB pifmgr_rc_deps "res/*.*" "res_alt/*.*")
add_rc_deps(pifmgr.rc ${pifmgr_rc_deps})
add_library(pifmgr MODULE pifmgr.rc)
add_dependencies(pifmgr psdk)
set_module_type(pifmgr module UNICODE)
add_cd_file(TARGET pifmgr DESTINATION reactos/system32 FOR all)