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

Method initBuildConfig

configs/port_buildconfig.go:18–134  ·  view source on GitHub ↗
(nameVersion string)

Source from the content-addressed store, hash-verified

16)
17
18func (p *Port) initBuildConfig(nameVersion string) error {
19 buildType := p.ctx.BuildType()
20 hostName := p.ctx.Platform().GetHostName()
21 platformName := p.ctx.Platform().GetName()
22 projectName := p.ctx.Project().GetName()
23
24 // host example: x86_64-linux-dev
25 // target example: aarch64-linux-ubuntu-22.04-gcc-11.5.0-test_project_001-release
26 buildFolder := expr.If(p.DevDep || p.HostDep,
27 filepath.Join(nameVersion, hostName+"-dev"),
28 filepath.Join(nameVersion, fmt.Sprintf("%s-%s-%s", platformName, projectName, buildType)),
29 )
30
31 // host example: x86_64-linux-dev
32 // target example: aarch64-linux-ubuntu-22.04-gcc-11.5.0/test_project_001/release
33 libraryDir := expr.If(p.DevDep || p.HostDep,
34 hostName+"-dev", filepath.Join(platformName, projectName, buildType),
35 )
36
37 // host example: installed/celer/x86_64-linux-dev/x264@stable.trace
38 // target example: installed/celer/aarch64-linux-ubuntu-22.04-gcc-11.5.0/test_project_001/release/x264@stable.trace
39 p.traceFile = filepath.Join(dirs.InstalledDir, "celer", "traces", libraryDir, nameVersion+".trace")
40
41 // host example: installed/celer/x86_64-linux-dev/x264@stable.meta
42 // target example: installed/celer/aarch64-linux-ubuntu-22.04-gcc-11.5.0/test_project_001/release/x264@stable.meta
43 p.metaFile = filepath.Join(dirs.InstalledDir, "celer", "metas", libraryDir, nameVersion+".meta")
44
45 // host example: installed/celer/x86_64-linux-dev/x264@stable
46 // target example: installed/celer/aarch64-linux-ubuntu-22.04-gcc-11.5.0/test_project_001/release/x264@stable
47 p.PackageDir = filepath.Join(dirs.WorkspaceDir, "packages", filepath.Join(libraryDir, nameVersion))
48
49 // host example: installed/celer/x86_64-linux-dev/x264@stable
50 // target example: installed/celer/aarch64-linux-ubuntu-22.04-gcc-11.5.0/test_project_001/release/x264@stable
51 p.InstalledDir = filepath.Join(dirs.InstalledDir, libraryDir)
52
53 // host example: installed/celer/x86_64-linux-dev/deps/x264@stable
54 // target example: installed/celer/aarch64-linux-ubuntu-22.04-gcc-11.5.0/test_project_001/release/deps/x264@stable
55 p.tmpDepsDir = filepath.Join(dirs.TmpDepsDir, libraryDir)
56
57 portConfig := buildsystems.PortConfig{
58 Ctx: p.ctx,
59 LibName: p.Name,
60 LibVersion: p.Version,
61 Archive: p.Package.Archive,
62 Url: p.Package.Url,
63 Checksum: p.Package.Checksum,
64 IgnoreSubmodule: p.Package.IgnoreSubmodule,
65 ProjectName: projectName,
66 HostName: hostName,
67 SrcDir: filepath.Join(dirs.WorkspaceDir, "buildtrees", nameVersion, "src"),
68 BuildDir: filepath.Join(dirs.WorkspaceDir, "buildtrees", buildFolder),
69 PackageDir: p.PackageDir,
70 LibraryDir: libraryDir,
71 DevDep: p.DevDep,
72 HostDev: p.HostDep || p.DevDep,
73 Jobs: p.ctx.Jobs(),
74 RepoDir: filepath.Join(dirs.WorkspaceDir, "buildtrees", nameVersion, "src"),
75 PortFile: p.portFile,

Callers 1

InitMethod · 0.95

Calls 15

mergeFromProjectMethod · 0.95
findMatchedConfigMethod · 0.95
IfFunction · 0.92
GetPortPathFunction · 0.92
PathExistsFunction · 0.92
SprintfMethod · 0.80
InitBuildSystemMethod · 0.80
BuildTypeMethod · 0.65
GetHostNameMethod · 0.65
PlatformMethod · 0.65
GetNameMethod · 0.65
ProjectMethod · 0.65

Tested by

no test coverage detected