Fix an issue that MSVC 2019 cannot compile with CMake

Fix using PCH with MSVC too, which notably fixes using it with vcpkg.

Closes https://github.com/wxWidgets/wxWidgets/pull/2372

Co-Authored-By: Maarten Bent <MaartenBent@users.noreply.github.com>
This commit is contained in:
cnbatch
2021-05-19 04:31:57 +08:00
committed by Vadim Zeitlin
parent 1b76ff4887
commit 94b399418c

View File

@@ -383,7 +383,7 @@ endmacro()
# Enable cotire for target, use optional second argument for prec. header
macro(wx_target_enable_precomp target_name)
target_compile_definitions(${target_name} PRIVATE WX_PRECOMP)
if(NOT ${ARGV1} STREQUAL "")
if(${ARGC} GREATER 1 AND NOT ${ARGV1} STREQUAL "")
set_target_properties(${target_name} PROPERTIES
COTIRE_CXX_PREFIX_HEADER_INIT ${ARGV1})
endif()