[QBS] Depends and cpp.includePaths

Ruslan Nigmatullin EuroElessar at yandex.ru
Wed Aug 15 16:07:38 CEST 2012



27.02.2012, 23:49, "Oswald Buddenhagen" <oswald.buddenhagen at nokia.com>:
> On Mon, Feb 27, 2012 at 09:00:54PM +0600, ext Ruslan Nigmatullin wrote:
>
>>  Of course, run "qbs -j1" on this project, the issue is that generated
>>  header doesn't belong to current product:
>
> imo, this should never work out of principle.
> if you want to share the generated header across products, you need to
> create a source module out of the header - which is unfortunately not
> possible yet. see QBS-59.
> also, do we even support rules with on input artifacts?

Do I understand idea correctly? Here is a draft of api for module sources, as I understand ModuleSource should provide own artifacts to external products to share build process between them.
Or it should provide only list of files? But how should we handle in this case possibility of creating several Artifacts on one file, won't be there any conflicts?

// mylibSource.qbs
ModuleSource {
	Group {
		files: [ "core.h", … ]
		fileTags: [ "mylib-devel" ]
	}
	Transformer {
		files: [ "version.h.in" ]
		fileTags: [ "mylib-devel" ]
		Artifact {
			fileTags: [ "hpp" ]
			fileName: "include/mylib/version.h"
		}
		prepare: {
			// Generation logic
		}
	}
	Rule {
		inputs: [ "mylib-devel" ]
		Artifact {
			fileTags: [ "hpp" ]
			fileName: "include/mylib/" + input.fileName
		}
		prepare: {
			// installation
		}
	}
}

// mylib.qbs
DynamicLibrary {
	name: "mylib"
	Depends { name: "cpp" }
	// We use generated version.h from cpp files
	Depends { name: "mylib-devel" }
	files: [ "core.cpp", "version.cpp", … ]
	ProductModule {
		Depends { name: "cpp" }
		// We want other products to depend on this headers
		Depends { name: "mylib-devel" }
	}
}



More information about the Qbs mailing list