From 4168cda2363f3d796d0b9922852e249aac3131ba Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Fri, 4 Dec 2020 08:39:35 +0200 Subject: Mark Buildfile functions as pure or impure --- libbuild2/cc/functions.cxx | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) (limited to 'libbuild2/cc') diff --git a/libbuild2/cc/functions.cxx b/libbuild2/cc/functions.cxx index 98f7f97..c8b9d09 100644 --- a/libbuild2/cc/functions.cxx +++ b/libbuild2/cc/functions.cxx @@ -150,8 +150,10 @@ namespace build2 // after all the specified library targets have been matched. Normally // it is used in ad hoc recipes to implement custom compilation. // + // Note that this function is not pure. // - f[".lib_poptions"].insert ( + f.insert (".lib_poptions", false). + insert ( &lib_thunk, lib_data { x, @@ -189,8 +191,10 @@ namespace build2 // after all the specified library targets have been matched. Normally // it is used in ad hoc recipes to implement custom linking. // - f[".lib_libs"].insert, optional> ( + // Note that this function is not pure. + // + f.insert (".lib_libs", false). + insert, optional> ( &lib_thunk, lib_data { x, @@ -237,13 +241,15 @@ namespace build2 // // Note that passing multiple targets at once is not a mere convenience: // this also allows for more effective duplicate suppression. - + // // Note also that this function can only be called during execution // after all the specified library targets have been matched. Normally // it is used in ad hoc recipes to implement custom linking. // - f[".lib_rpaths"].insert, optional> ( + // Note that this function is not pure. + // + f.insert (".lib_rpaths", false). + insert, optional> ( &lib_thunk, lib_data { x, -- cgit v1.1