CMake: Fix using precompiled headers with Objective-C++ files

Compiling .mm files gives error 'Objective C file was disabled in PCH but is currently enabled'.

Enable the OBJCXX language so the Objective-C++ compiler will be detected and used for .mm files instead of the c++ compiler.
Detect if there are .mm files and enable PCH for them too.

Don't set COTIRE_UNITY_SOURCE_EXCLUDE_EXTENSIONS when cotire is not used.
This commit is contained in:
Maarten Bent 2022-04-12 21:01:19 +02:00
parent 0f8b828394
commit 323e6e8320
2 changed files with 22 additions and 10 deletions

View file

@ -88,7 +88,12 @@ set(wxSOVERSION ${wxSOVERSION_MAJOR}.${WX_AGE}.${WX_REVISION})
set(wxVERSION ${wxMAJOR_VERSION}.${wxMINOR_VERSION}.${wxRELEASE_NUMBER})
set(wxCOPYRIGHT "2002-2022 wxWidgets")
project(wxWidgets VERSION ${wxVERSION})
set(wxLANGUAGES C CXX)
if(APPLE AND CMAKE_VERSION GREATER_EQUAL "3.16")
list(APPEND wxLANGUAGES OBJCXX)
endif()
project(wxWidgets VERSION ${wxVERSION} LANGUAGES ${wxLANGUAGES})
include(build/cmake/main.cmake)