@@ -81,6 +81,9 @@ func (in *InsExecutor) InsRun(triple pkg.InsTriple, meta *pkg.PackageMeta) error
8181 return nil
8282}
8383
84+ // InsCMake run cmake config and build command from the triple config.
85+ // Triple Second: cmake config arguments
86+ // Triple Third: cmake build arguments
8487func (in * InsExecutor ) InsCMake (triple pkg.InsTriple , meta * pkg.PackageMeta ) error {
8588 packageCacheDir := pkg .GetCachePath (in .pkgHome , meta .PackageName )
8689 srcPath := meta .VendorSrcPath (in .pkgHome )
@@ -96,10 +99,16 @@ func (in *InsExecutor) InsCMake(triple pkg.InsTriple, meta *pkg.PackageMeta) err
9699 }
97100 }
98101
99- // prepare cmake config and building command arguments
102+ // prepare cmake config from "features" in pkg.yaml
103+ if meta .Features != nil && len (meta .Features ) != 0 {
104+ triple .Second = triple .Second + " " + featuresToOptions (meta .Features )
105+ }
106+ // prepare cmake config from cli
100107 if in .cmakeConfigArg != "" {
101108 triple .Second = triple .Second + " " + in .cmakeConfigArg
102109 }
110+
111+ // prepare cmake building command arguments
103112 if in .cmakeBuildArg != "" {
104113 triple .Third = triple .Third + " " + in .cmakeBuildArg
105114 }
@@ -131,7 +140,7 @@ func (in *InsExecutor) InsAutoPkg(triple pkg.InsTriple, meta *pkg.PackageMeta) e
131140 if pkgEnvInc := os .Getenv ("PKG_INNER_BUILD" ); pkgEnvInc == "" {
132141 // use cmake instruction with features (features as cmake options)
133142 triple .First = pkg .InsCmake
134- triple .Second = featuresToOptions ( meta . Features )
143+ triple .Second = ""
135144 triple .Third = ""
136145 return in .InsCMake (triple , meta )
137146 }
0 commit comments