From b357badc02d09978be8b2d708084da6a6eff6c5b Mon Sep 17 00:00:00 2001 From: Julius Ikkala Date: Fri, 21 Aug 2020 18:44:06 +0300 Subject: [PATCH] Obey ENABLE_PCH CMake option --- CMakeLists.txt | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index fd9335e..18f11f7 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -297,14 +297,16 @@ endfunction() # glslang_pch() adds precompiled header rules to for the pre-compiled # header file . As target_precompile_headers() was added in CMake 3.16, # this is a no-op if called on earlier versions of CMake. -if(NOT CMAKE_VERSION VERSION_LESS "3.16") +if(NOT CMAKE_VERSION VERSION_LESS "3.16" AND ENABLE_PCH) function(glslang_pch target pch) target_precompile_headers(${target} PRIVATE ${pch}) endfunction() else() function(glslang_pch target pch) endfunction() - message("Your CMake version is ${CMAKE_VERSION}. Update to at least 3.16 to enable precompiled headers to speed up incremental builds") + if(ENABLE_PCH) + message("Your CMake version is ${CMAKE_VERSION}. Update to at least 3.16 to enable precompiled headers to speed up incremental builds") + endif() endif() if(BUILD_EXTERNAL AND IS_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/External) -- 2.7.4