HEX
Server: Apache/2.4.46 (Win64) OpenSSL/1.1.1j PHP/8.4.25
System: Windows NT DESKTOP-4TAV2RJ 10.0 build 19045 (Windows 10) AMD64
User: fred (0)
PHP: 8.4.25
Disabled: NONE
Upload Files
File: C:/Users/fred/anaconda3/Library/share/b2/build/config-cache.jam
# Copyright 2012 Steven Watanabe
# Distributed under the Boost Software License, Version 1.0.
# (See accompanying file LICENSE.txt or https://www.bfgroup.xyz/b2/LICENSE.txt)

import modules ;
import errors ;
import regex ;
import path ;
import project ;
import os ;

rule get ( name )
{
    return $(.vars.$(name)) ;
}

rule set ( name : value * )
{
    .all-vars += $(name) ;
    .vars.$(name) = $(value) ;
}

rule save ( )
{
    if $(.cache-file)
    {
        local cache-file-native = [ path.native $(.cache-file) ] ;
        local target = <new-cache-file>$(cache-file-native) ;
        local contents = "# Automatically generated by B2.\n# Do not edit.\n\nmodule config-cache {\n" ;
        for local var in $(.all-vars)
        {
            local transformed ;
            for local value in $(.vars.$(var))
            {
                transformed += [ regex.escape $(value) : \"\\ : \\ ] ;
            }
            local quoted = \"$(transformed)\" ;
            contents += "  set \"$(var)\" : $(quoted:J= ) ;\n" ;
        }
        contents += "}\n" ;
        FILE_CONTENTS on $(target) = $(contents) ;
        ALWAYS $(target) ;
        config-cache.write $(target) ;
        UPDATE_NOW $(target) : [ modules.peek configure : .log-fd ] : ignore-minus-n ;
        import common ;
        common.Clean clean-all : $(target) ;
    }
}

actions write
{
    @($(STDOUT):E=$(FILE_CONTENTS:J=)) > "$(<)"
}

if [ os.name ] = VMS
{
    actions write
    {
        @($(STDOUT):E=$(FILE_CONTENTS:J=)) | TYPE SYS$INPUT /OUT=$(<:W)
    }
}

rule load ( cache-file )
{
    if $(.cache-file)
    {
        errors.error duplicate load of cache file ;
    }
    cache-file = [ path.native $(cache-file) ] ;
    if [ path.exists $(cache-file) ] && ! ( --reconfigure in [ modules.peek : ARGV ] )
    {
        FILE_CONTENTS on <old-cache-file>$(cache-file) = "" ;
        config-cache.write <old-cache-file>$(cache-file) ;
        UPDATE_NOW <old-cache-file>$(cache-file) : [ modules.peek configure : .log-fd ] ;
        include <old-cache-file>$(cache-file) ;
    }
    .cache-file = $(cache-file) ;
}