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:
@@ -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
|
||||
|
Reference in New Issue
Block a user