Skip to main content
aboutsummaryrefslogtreecommitdiffstats
blob: 3299defba706955d87cac806df692b6953366a16 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
plugins {
	id 'cpp'
}

def generator = ':plugins:org.eclipse.etrice.generator.cpp'

task generate(type: JavaExec, group: 'build', dependsOn: "$generator:classes") {
	main = project(generator).mainClassName
	classpath = project(generator).classpath
	inputs.dir 'model'
	outputs.dir 'src-gen'
	args '-lib', '-msc_instr', '-genDir', 'src-gen',
		'model/TimingService.room'
}

model {
	components {
		etrice_modellib_cpp(NativeLibrarySpec) {
			sources.cpp {
				builtBy generate
				source {
					srcDirs = ['src-gen']
					include '**/*.cpp'
				}
				exportedHeaders {
					srcDirs = ['src-gen']
				}
				lib project: ':runtime:org.eclipse.etrice.runtime.c', library: 'etrice_runtime_c', linkage: 'api'
				lib project: ':runtime:org.eclipse.etrice.runtime.cpp', library: 'etrice_runtime_cpp', linkage: 'api'
			}
			binaries {
				withType(SharedLibraryBinarySpec) { buildable = false }
				all { cppCompiler.args '-g3' }
			}
		}
	}
}

clean.delete 'src-gen'

Back to the top