From 5649b4801cc3e06b8d0edc9ea1b18510594dfd35 Mon Sep 17 00:00:00 2001 From: Gabriel Ferreira Date: Thu, 15 Feb 2024 10:24:27 +0100 Subject: [PATCH] build: evaluate NS3_CCACHE after parsing .ns3rc --- CMakeLists.txt | 30 +++++++++++++++--------------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 3802b9695..8023c3828 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -107,21 +107,6 @@ set(NS3_FILTER_MODULE_EXAMPLES_AND_TESTS "List of modules that should have their examples and tests built (e.g. lte;wifi)" ) -if(${NS3_CCACHE}) - # Use ccache if available - mark_as_advanced(CCACHE) - find_program(CCACHE ccache) - if(NOT ("${CCACHE}" STREQUAL "CCACHE-NOTFOUND")) - message(STATUS "CCache is enabled.") - set(CMAKE_CXX_COMPILER_LAUNCHER ${CCACHE}) - execute_process( - COMMAND - ${CCACHE} --set-config - sloppiness=pch_defines,time_macros,include_file_mtime,include_file_ctime - ) - endif() -endif() - # Include macros used below include(build-support/macros-and-definitions.cmake) @@ -143,6 +128,21 @@ filter_enabled_and_disabled_modules( ns3rc_enabled_modules ns3rc_disabled_modules ) +if(${NS3_CCACHE}) + # Use ccache if available + mark_as_advanced(CCACHE) + find_program(CCACHE ccache) + if(NOT ("${CCACHE}" STREQUAL "CCACHE-NOTFOUND")) + message(STATUS "CCache is enabled.") + set(CMAKE_CXX_COMPILER_LAUNCHER ${CCACHE}) + execute_process( + COMMAND + ${CCACHE} --set-config + sloppiness=pch_defines,time_macros,include_file_mtime,include_file_ctime + ) + endif() +endif() + # ############################################################################## # Process options # # ##############################################################################