CMake: Improve precompiled headers for wxscintilla

The auto-generated header causes undefined members and identifiers in the
standard c++ headers when using clang on macOS or Windows.
Do not disable precompiled headers entirely but use the main Scintilla
header as prefix header so there is at least a small speedup.
This commit is contained in:
Maarten Bent
2018-08-17 19:49:38 +02:00
parent 41d6bc579a
commit 61500907ee
2 changed files with 21 additions and 21 deletions

View File

@@ -164,7 +164,17 @@ target_compile_definitions(wxscintilla PUBLIC
NO_CXX11_REGEX
__WX__
)
wx_target_enable_precomp(wxscintilla)
if(wxBUILD_PRECOMP)
# The auto-generated header causes undefined members and identifiers in the
# standard c++ headers when using clang on macOS or Windows.
# Do not disable precompiled headers entirely but use the main Scintilla
# header as prefix header so there is at least a small speedup.
if ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang" AND (APPLE OR WIN32))
set(wxSCINTILLA_PREC_HEADER "${wxSOURCE_DIR}/src/stc/scintilla/include/Scintilla.h")
endif()
wx_target_enable_precomp(wxscintilla ${wxSCINTILLA_PREC_HEADER})
endif()
wx_add_library(stc ${STC_FILES})
wx_lib_include_directories(stc PRIVATE