1
0
mirror of https://github.com/cookiengineer/audacity synced 2025-04-29 23:29:41 +02:00

CMake: fix handling of use_pch option

Having ccache or sccache installed should only set the default,
not prevent from selecting one option or the other.

Signed-off-by: Be <be@mixxx.org>
This commit is contained in:
Be 2021-08-09 16:04:33 -05:00
parent 74ccbb87b7
commit e9a3742de9
No known key found for this signature in database
GPG Key ID: F4D83691462F656E

View File

@ -1048,7 +1048,7 @@ list( APPEND DEFINES
# If we have cmake 3.16 or higher, we can use precompiled headers, but
# only use them if ccache is not available and the user hasn't disabled
# it.
if( CMAKE_VERSION VERSION_GREATER_EQUAL "3.16" AND NOT CCACHE_PROGRAM )
if( CMAKE_VERSION VERSION_GREATER_EQUAL "3.16" AND NOT CCACHE_PROGRAM AND NOT SCCACHE_PROGRAM )
cmd_option(
${_OPT}use_pch
"Use precompiled headers [yes, no]"
@ -1351,7 +1351,7 @@ list(REMOVE_ITEM LIBRARIES version)
target_link_libraries( ${TARGET} ${LIBRARIES} )
target_link_libraries( ${TARGET} PUBLIC ${AUDACITY_LIBRARIES} )
if( CMAKE_VERSION VERSION_GREATER_EQUAL "3.16" AND NOT CCACHE_PROGRAM AND NOT SCCACHE_PROGRAM )
if( CMAKE_VERSION VERSION_GREATER_EQUAL "3.16" )
if( ${_OPT}use_pch )
message( STATUS "Using precompiled headers" )
target_precompile_headers( ${TARGET} PRIVATE