Skip to content

Commit 9f9360d

Browse files
authored
Merge pull request KhronosGroup#2375 from juliusikkala/master
Obey ENABLE_PCH CMake option
2 parents f257e0e + b357bad commit 9f9360d

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

CMakeLists.txt

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -297,14 +297,16 @@ endfunction()
297297
# glslang_pch() adds precompiled header rules to <target> for the pre-compiled
298298
# header file <pch>. As target_precompile_headers() was added in CMake 3.16,
299299
# this is a no-op if called on earlier versions of CMake.
300-
if(NOT CMAKE_VERSION VERSION_LESS "3.16")
300+
if(NOT CMAKE_VERSION VERSION_LESS "3.16" AND ENABLE_PCH)
301301
function(glslang_pch target pch)
302302
target_precompile_headers(${target} PRIVATE ${pch})
303303
endfunction()
304304
else()
305305
function(glslang_pch target pch)
306306
endfunction()
307-
message("Your CMake version is ${CMAKE_VERSION}. Update to at least 3.16 to enable precompiled headers to speed up incremental builds")
307+
if(ENABLE_PCH)
308+
message("Your CMake version is ${CMAKE_VERSION}. Update to at least 3.16 to enable precompiled headers to speed up incremental builds")
309+
endif()
308310
endif()
309311

310312
if(BUILD_EXTERNAL AND IS_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/External)

0 commit comments

Comments
 (0)