From 3b7c7d8e68251eaad3cc499647d52c88dba82980 Mon Sep 17 00:00:00 2001 From: Timo Kreuzer Date: Fri, 6 Oct 2023 20:07:02 +0300 Subject: [PATCH] [CMAKE] Don't use precompiled headers for autogenerated stub files --- sdk/cmake/gcc.cmake | 3 +++ sdk/cmake/msvc.cmake | 3 +++ 2 files changed, 6 insertions(+) diff --git a/sdk/cmake/gcc.cmake b/sdk/cmake/gcc.cmake index a4a013ed6a0..0eefc577a60 100644 --- a/sdk/cmake/gcc.cmake +++ b/sdk/cmake/gcc.cmake @@ -425,6 +425,9 @@ function(spec2def _dllname _spec_file) COMMAND native-spec2def -n=${_dllname} -a=${ARCH2} -d=${CMAKE_CURRENT_BINARY_DIR}/${_file}.def -s=${CMAKE_CURRENT_BINARY_DIR}/${_file}_stubs.c ${__with_relay_arg} ${__version_arg} ${CMAKE_CURRENT_SOURCE_DIR}/${_spec_file} DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/${_spec_file} native-spec2def) + # Do not use precompiled headers for the stub file + set_source_files_properties(${CMAKE_CURRENT_BINARY_DIR}/${_file}_stubs.c PROPERTIES SKIP_PRECOMPILE_HEADERS ON) + if(__spec2def_ADD_IMPORTLIB) set(_extraflags) if(__spec2def_NO_PRIVATE_WARNINGS) diff --git a/sdk/cmake/msvc.cmake b/sdk/cmake/msvc.cmake index 8dcfc8d43cc..dd3df55021d 100644 --- a/sdk/cmake/msvc.cmake +++ b/sdk/cmake/msvc.cmake @@ -396,6 +396,9 @@ function(spec2def _dllname _spec_file) COMMAND native-spec2def --ms -a=${SPEC2DEF_ARCH} -n=${_dllname} -d=${CMAKE_CURRENT_BINARY_DIR}/${_file}.def -s=${CMAKE_CURRENT_BINARY_DIR}/${_file}_stubs.c ${__with_relay_arg} ${__version_arg} ${CMAKE_CURRENT_SOURCE_DIR}/${_spec_file} DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/${_spec_file} native-spec2def) + # Do not use precompiled headers for the stub file + set_source_files_properties(${CMAKE_CURRENT_BINARY_DIR}/${_file}_stubs.c PROPERTIES SKIP_PRECOMPILE_HEADERS ON) + if(__spec2def_ADD_IMPORTLIB) generate_import_lib(lib${_file} ${_dllname} ${_spec_file} "${__version_arg}") if(__spec2def_NO_PRIVATE_WARNINGS)