Skip to content

Commit

Permalink
Add cppgir ignore files to dependencies
Browse files Browse the repository at this point in the history
  • Loading branch information
ilya-fedin authored and john-preston committed Nov 29, 2023
1 parent 6b5f4bc commit 92f27ad
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion external/glib/generate_cppgir.cmake
Expand Up @@ -5,12 +5,19 @@
# https://github.com/desktop-app/legal/blob/master/LEGAL

function(generate_cppgir target_name gir)
set(cppgir_loc ${cmake_helpers_loc}/external/glib/cppgir)

# cppgir generates all the dependent headers everytime, better to have a global folder
set(gen_dst ${CMAKE_BINARY_DIR}/gen)
file(MAKE_DIRECTORY ${gen_dst})

set(gen_timestamp ${gen_dst}/${target_name}_cppgir.timestamp)

set(ignore_files
${cppgir_loc}/data/cppgir.ignore
${cppgir_loc}/data/cppgir_unix.ignore
)

set(gir_path)
if (IS_ABSOLUTE "${gir}")
set(gir_path ${gir})
Expand All @@ -28,7 +35,7 @@ function(generate_cppgir target_name gir)
--expected
--optional
--ignore
${cmake_helpers_loc}/external/glib/cppgir/data/cppgir.ignore:${cmake_helpers_loc}/external/glib/cppgir/data/cppgir_unix.ignore
"$<JOIN:${ignore_files},:>"
--output
${gen_dst}
${gir}
Expand All @@ -37,6 +44,7 @@ function(generate_cppgir target_name gir)
COMMENT "Generating C++ wrapper for ${gir} (${target_name})"
DEPENDS
CppGir::cppgir
${ignore_files}
${gir_path}
)
generate_target(${target_name} cppgir ${gen_timestamp} "" ${gen_dst})
Expand Down

0 comments on commit 92f27ad

Please sign in to comment.