forked from b-com-software-basis/builddefs-qmake
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathpopulateSubDependencies.pri
134 lines (131 loc) · 7.52 KB
/
populateSubDependencies.pri
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
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
# Author(s) : Loic Touraine, Stephane Leduc
# Detect build toolchain and define REMAKEN_TARGET_ARCH and REMAKEN_TARGET_PLATFORM
include(remaken_arch_define.pri)
defineReplace(populateSubDependencies) {
packageDepsFilesList = $$ARGS
for (depfile, packageDepsFilesList) {
exists($${depfile}) {
baseDepFile = $$basename(depfile)
message("---- Parsing sub-dependencies from " $${depfile} " ----" )
dependencies = $$cat($${depfile})
for (dependency, dependencies) {
dependencyPkgDepFiles=""
dependencyMetaInf = $$split(dependency, |)
pkgInformation = $$member(dependencyMetaInf,0)
pkgInfoList = $$split(pkgInformation, $$LITERAL_HASH)
pkgName = $$member(pkgInfoList,0)
pkgInComment = $$str_member(pkgName, 0, 1)
!equals (pkgInComment, $$PKG_COMMENT) {
pkgChannel = "stable"
pkgInfoListSize = $$size(pkgInfoList)
equals(pkgInfoListSize,2) {
pkgChannel = $$member(pkgInfoList,1)
}
pkgVersion = $$member(dependencyMetaInf,1)
pkgLibInformation = $$member(dependencyMetaInf,2)
pkgLibConditionList = $$split(pkgLibInformation, %)
libName = $$take_first(pkgLibConditionList)
pkgTypeInformation = $$member(dependencyMetaInf,3)
pkgLinkMode = $$member(dependencyMetaInf,5)
pkgTypeInfoList = $$split(pkgTypeInformation, @)
pkgCategory = $$member(pkgTypeInfoList,0)
pkgRepoType = $${pkgCategory}
pkgTypeInfoListSize = $$size(pkgTypeInfoList)
equals(pkgTypeInfoListSize,2) {
pkgRepoType = $$member(pkgTypeInfoList,1)
} else {
equals(pkgCategory,"bcomBuild")|equals(pkgCategory,"remakenBuild")|equals(pkgCategory,"thirdParties") {
pkgRepoType = "artifactory"
} # otherwise pkgRepoType = pkgCategory
}
# check pkgLinkMode not empty and mandatory equals to static|shared, otherwise set to default DEPLINKMODE
equals(pkgLinkMode,"")|equals(pkgLinkMode,"default") {
pkgLinkMode = $${DEPLINKMODE}
} else {
if (!equals(pkgLinkMode,"static"):!equals(pkgLinkMode,"shared"):!equals(pkgLinkMode,"na")){
pkgLinkMode = $${DEPLINKMODE}
}
}
verboseMessage(" ---- Processing dependency $${pkgName}_$${pkgVersion}@$${pkgRepoType} repository")
equals(pkgRepoType,"http")|equals(pkgRepoType,"artifactory") | equals(pkgRepoType,"github") | equals(pkgRepoType,"nexus") {
deployFolder=$${REMAKENDEPSFOLDER}/$${REMAKEN_TARGET_PLATFORM}/$${pkgName}/$${pkgVersion}
!equals(pkgCategory,$${pkgRepoType}) {
deployFolder=$${REMAKENDEPSFOLDER}/$${REMAKEN_TARGET_PLATFORM}/$${pkgCategory}/$${pkgName}/$${pkgVersion}
!exists($${deployFolder}) { #try old structure for backward compatibility
warning("No package found at " $${deployFolder})
warning("--> Try with old structure for backward compatibility")
deployFolder=$${REMAKENDEPSFOLDER}/$${pkgCategory}/$${REMAKEN_TARGET_PLATFORM}/$${pkgName}/$${pkgVersion}
}
}
!exists($${deployFolder}) {
warning("No package found at " $${deployFolder})
warning("--> Dependencies source folder should include the target platform information " $${REMAKEN_TARGET_PLATFORM})
deployFolder=$${REMAKENDEPSFOLDER}/$${pkgName}/$${pkgVersion}
!equals(pkgCategory,$${pkgRepoType}) {
deployFolder=$${REMAKENDEPSFOLDER}/$${pkgCategory}/$${pkgName}/$${pkgVersion}
}
warning("--> Finally try without target platform in $${deployFolder}")
}
!exists($${deployFolder}) {
error(" No package found at " $${deployFolder})
}
contains(pkgLinkMode,static) {
exists($${deployFolder}/packagedependencies-static.txt) {
dependencyPkgDepFiles+=$${deployFolder}/packagedependencies-static.txt
}
else {
dependencyPkgDepFiles+=$${deployFolder}/packagedependencies.txt
}
}
else {
exists($${deployFolder}/packagedependencies.txt) {
dependencyPkgDepFiles+=$${deployFolder}/packagedependencies.txt
}
}
win32:!android {
exists($${deployFolder}/packagedependencies-win.txt) {
dependencyPkgDepFiles += $${deployFolder}/packagedependencies-win.txt
}
}
# Common unix platform (macx, linux...)
unix {
exists($${deployFolder}/packagedependencies-unix.txt) {
dependencyPkgDepFiles += $${deployFolder}/packagedependencies-unix.txt
}
}
macx:!android {
exists($${deployFolder}/packagedependencies-mac.txt) {
dependencyPkgDepFiles += $${deployFolder}/packagedependencies-mac.txt
}
}
linux:!android {
exists($${deployFolder}/packagedependencies-linux.txt) {
dependencyPkgDepFiles += $${deployFolder}/packagedependencies-linux.txt
}
}
android {
exists($${deployFolder}/packagedependencies-android.txt) {
dependencyPkgDepFiles += $${deployFolder}/packagedependencies-android.txt
}
}
currentPackageDeps = $${dependencyPkgDepFiles}
outPackageDeps += $${dependencyPkgDepFiles}
}
isEmpty(currentPackageDeps) {
message(" ---- No sub-dependencies found ----")
} else {
message(" ---- Sub-dependencies found :" )
for(var, currentPackageDeps) {
message(" ==>" $${var} )
}
}
message(" ")
} # comment package
else {
#message(package in comment : $${pkg.name})
}
} # for(var, dependencies)
} #!exists($${depfile})
} # for(depfile, packagedepsfiles)
return($${outPackageDeps})
}