CMake: Only set COMPILE_OPTIONS if target ClangCodeModel exists

If Qt Creator is configured without Clang the target ClangCodeModel
might not exist and CMake configuration would fail.

Amends 08cbf13199

Change-Id: I1644d183bdcb4d9a6ae65e1257d9be7b7a0e5ff5
Reviewed-by: Marco Bubke <marco.bubke@qt.io>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
This commit is contained in:
Cristian Adam
2021-12-14 11:57:11 +01:00
parent 1b1527b64f
commit 42d0280360

View File

@@ -68,7 +68,7 @@ elseif(MSVC)
set(big_obj_compile_option "/bigobj")
endif()
if(big_obj_compile_option)
if(big_obj_compile_option AND TARGET ClangCodeModel)
set_property(TARGET ClangCodeModel
APPEND PROPERTY COMPILE_OPTIONS ${big_obj_compile_option})
endif()