From c963597525b240e96461501ae47c54c6d0d6884b Mon Sep 17 00:00:00 2001 From: "L. E. Segovia" Date: Wed, 12 Feb 2025 17:10:30 +0000 Subject: [PATCH] cmake: Memoize include checks Part-of: --- subprojects/gstreamer/cmake/FindGStreamer.cmake | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/subprojects/gstreamer/cmake/FindGStreamer.cmake b/subprojects/gstreamer/cmake/FindGStreamer.cmake index 3b25e3207e..8d858bed82 100644 --- a/subprojects/gstreamer/cmake/FindGStreamer.cmake +++ b/subprojects/gstreamer/cmake/FindGStreamer.cmake @@ -178,10 +178,17 @@ endmacro() macro(_gst_filter_missing_directories GST_INCLUDE_DIRS) set(_gst_include_dirs) foreach(DIR IN LISTS ${GST_INCLUDE_DIRS}) - if ((IS_DIRECTORY "${DIR}") AND (EXISTS "${DIR}")) + string(MAKE_C_IDENTIFIER "${DIR}" _gst_dir_id) + if (DEFINED _gst_exists_${_gst_dir_id}) + if (_gst_exists_${_gst_dir_id}) + list(APPEND _gst_include_dirs "${DIR}") + endif() + elseif (EXISTS "${DIR}") list(APPEND _gst_include_dirs "${DIR}") + set(_gst_exists_${_gst_dir_id} TRUE) else() message(WARNING "Skipping missing include folder ${DIR}.") + set(_gst_exists_${_gst_dir_id} FALSE) endif() endforeach() set(${GST_INCLUDE_DIRS} "${_gst_include_dirs}")