https://git.reactos.org/?p=reactos.git;a=commitdiff;h=9ef5a7eb7a58107611cd5…
commit 9ef5a7eb7a58107611cd5a3700516552eac40b2f
Author: Jérôme Gardou <jerome.gardou(a)reactos.org>
AuthorDate: Tue Apr 27 11:11:41 2021 +0200
Commit: Jérôme Gardou <jerome.gardou(a)reactos.org>
CommitDate: Tue Apr 27 11:54:12 2021 +0200
[CMAKE] Fix compilation with newer windres versions
Also use clang as preprocessor when using it
Also, use *our* headers instead of the platform ones
---
dll/win32/themeui/CMakeLists.txt | 1 +
sdk/cmake/gcc.cmake | 10 ++++++----
subsystems/mvdm/pifmgr/CMakeLists.txt | 1 +
3 files changed, 8 insertions(+), 4 deletions(-)
diff --git a/dll/win32/themeui/CMakeLists.txt b/dll/win32/themeui/CMakeLists.txt
index 6f2538967e4..85a814b6208 100644
--- a/dll/win32/themeui/CMakeLists.txt
+++ b/dll/win32/themeui/CMakeLists.txt
@@ -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)
diff --git a/sdk/cmake/gcc.cmake b/sdk/cmake/gcc.cmake
index 4efeda21d07..f542d34ef19 100644
--- a/sdk/cmake/gcc.cmake
+++ b/sdk/cmake/gcc.cmake
@@ -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)
diff --git a/subsystems/mvdm/pifmgr/CMakeLists.txt
b/subsystems/mvdm/pifmgr/CMakeLists.txt
index 31b82ca784c..9dcae9f691c 100644
--- a/subsystems/mvdm/pifmgr/CMakeLists.txt
+++ b/subsystems/mvdm/pifmgr/CMakeLists.txt
@@ -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)