MCPcopy Create free account
hub / github.com/celer-pkg/celer / expandOptions

Method expandOptions

buildsystems/buildconfig.go:857–881  ·  view source on GitHub ↗

expandOptions Replace placeholders with real paths and values.

()

Source from the content-addressed store, hash-verified

855
856// expandOptions Replace placeholders with real paths and values.
857func (b *BuildConfig) expandOptions() {
858 // Remove cross compile args when build in dev mode.
859 if b.DevDep {
860 crossArgs := []string{
861 "${HOST}",
862 "${SYSTEM_NAME}",
863 "${SYSTEM_PROCESSOR}",
864 "${SYSROOT}",
865 "${CROSSTOOL_PREFIX}",
866 }
867 b.Options = slices.DeleteFunc(b.Options, func(argument string) bool {
868 for _, item := range crossArgs {
869 if strings.Contains(argument, item) {
870 return true
871 }
872 }
873 return false
874 })
875 }
876
877 // Expand placeholders.
878 for index, argument := range b.Options {
879 b.Options[index] = b.ExprVars.Expand(argument)
880 }
881}
882
883// expandVariables expands placeholder variables in the given string and returns the result.
884// Placeholders like ${CC}, ${CXX}, ${SYSROOT}, etc. are replaced with actual values.

Callers 1

InstallMethod · 0.95

Calls 1

ExpandMethod · 0.80

Tested by

no test coverage detected