mirror of
https://github.com/PCSX2/pcsx2.git
synced 2026-01-31 01:15:24 +01:00
Compare commits
1671 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
4fe5064b8c | ||
|
|
0ea98d6edb | ||
|
|
92b707db99 | ||
|
|
d765f2e15c | ||
|
|
b512162956 | ||
|
|
e24d97bbe4 | ||
|
|
fb4aaf5236 | ||
|
|
8d0af30e0e | ||
|
|
06efa93070 | ||
|
|
8d3617bb71 | ||
|
|
ef2549edb1 | ||
|
|
c5511d0afa | ||
|
|
68eed55490 | ||
|
|
2d79b89acc | ||
|
|
9242da96f2 | ||
|
|
932474a7d6 | ||
|
|
115d83a02e | ||
|
|
2e882dfabc | ||
|
|
ff7995f0d6 | ||
|
|
f11ef37745 | ||
|
|
9044f54353 | ||
|
|
475bd6ee7d | ||
|
|
086bbf95dc | ||
|
|
4536daa5f8 | ||
|
|
570039f49a | ||
|
|
c6b55e5aa3 | ||
|
|
7683674585 | ||
|
|
81f1102809 | ||
|
|
ebb315ab6f | ||
|
|
f0b8895350 | ||
|
|
4134e7a7e0 | ||
|
|
39a493f7d3 | ||
|
|
70b709a675 | ||
|
|
31e935d831 | ||
|
|
34ae500614 | ||
|
|
2cead675bb | ||
|
|
a6f7159537 | ||
|
|
d099f7afd6 | ||
|
|
7587bb8a07 | ||
|
|
29e9125b15 | ||
|
|
f0ae33d61e | ||
|
|
89c4e2c1a4 | ||
|
|
431b8b0df6 | ||
|
|
e8e84d160b | ||
|
|
3fd1eabdb8 | ||
|
|
21c46b778e | ||
|
|
55ee8242cc | ||
|
|
967a41c035 | ||
|
|
75894501ee | ||
|
|
39b29b3542 | ||
|
|
25bc75a468 | ||
|
|
12a0644315 | ||
|
|
9fac941570 | ||
|
|
81203d9a15 | ||
|
|
5d50cd562f | ||
|
|
49a17b3a2e | ||
|
|
cfecbf53aa | ||
|
|
3a0b26225d | ||
|
|
0628e8cc87 | ||
|
|
6545c62d26 | ||
|
|
c573c00eb0 | ||
|
|
f084e76f36 | ||
|
|
b9d7b63b32 | ||
|
|
4d67f71217 | ||
|
|
4b1a4fdbb9 | ||
|
|
a0bc8e0ff8 | ||
|
|
7166c04ff2 | ||
|
|
1483e4f88e | ||
|
|
454d4c9fa0 | ||
|
|
8887930fd5 | ||
|
|
c8047c1a61 | ||
|
|
566ea8ea9b | ||
|
|
67f1d6e24b | ||
|
|
e520dc2605 | ||
|
|
b9f4a01138 | ||
|
|
aeff832ffc | ||
|
|
3cb12cce84 | ||
|
|
fc2a750f85 | ||
|
|
e3ccb500d8 | ||
|
|
0aea297b73 | ||
|
|
20dbcfd2eb | ||
|
|
ba7096c9fa | ||
|
|
4cc4a6561c | ||
|
|
95843dc84a | ||
|
|
fdb751ed1a | ||
|
|
612c24e0c0 | ||
|
|
da9e3fdc32 | ||
|
|
58defda298 | ||
|
|
8b9b7f7baf | ||
|
|
8ad08706aa | ||
|
|
4035f1c554 | ||
|
|
f0c331e32b | ||
|
|
43fb79d669 | ||
|
|
a4cc42c6ad | ||
|
|
2e89f6ad4d | ||
|
|
9b03b236fe | ||
|
|
052951fbb0 | ||
|
|
e53abb1989 | ||
|
|
dc20521b01 | ||
|
|
4081d07dd8 | ||
|
|
85888a9a81 | ||
|
|
d7101c3be5 | ||
|
|
b3bb40980e | ||
|
|
cf3ad3f855 | ||
|
|
c6e7e15599 | ||
|
|
a0f6036337 | ||
|
|
2fc4d02dd6 | ||
|
|
c6cd6b5eb3 | ||
|
|
5f7e97c27c | ||
|
|
49d5e69e70 | ||
|
|
7bc5427908 | ||
|
|
1881139b0a | ||
|
|
339dc2313b | ||
|
|
9752a037be | ||
|
|
d8cd336674 | ||
|
|
7264e397e2 | ||
|
|
3114332c89 | ||
|
|
f67611cbe6 | ||
|
|
11264e6c08 | ||
|
|
89749f2206 | ||
|
|
6630783686 | ||
|
|
90338ed065 | ||
|
|
89f4ac9b9a | ||
|
|
2ab6a3b873 | ||
|
|
12af031193 | ||
|
|
ddd2018e81 | ||
|
|
8d9c89a871 | ||
|
|
e48c68d80f | ||
|
|
0ccf8a7775 | ||
|
|
63e6248fd3 | ||
|
|
8d678c6c6f | ||
|
|
0f5e7355ff | ||
|
|
ca091eeea9 | ||
|
|
ca8a837614 | ||
|
|
dceac5372a | ||
|
|
7fae0f499f | ||
|
|
964dcfcb0a | ||
|
|
8bfcbdebf3 | ||
|
|
ce734f8a0d | ||
|
|
b67b555617 | ||
|
|
29b886eafb | ||
|
|
fd81349dab | ||
|
|
09ea13df55 | ||
|
|
ff3fc9b362 | ||
|
|
3b63445f07 | ||
|
|
999f0cc84f | ||
|
|
04957b6bda | ||
|
|
df6a33ef7c | ||
|
|
8f57d8afe0 | ||
|
|
4c24d96966 | ||
|
|
8a7d5bc417 | ||
|
|
e46d435d28 | ||
|
|
c03cffb5c2 | ||
|
|
40c7982dcf | ||
|
|
fd0c82c04a | ||
|
|
8e5b84b097 | ||
|
|
e862e68192 | ||
|
|
46f6e691e0 | ||
|
|
5f7c2b7cd8 | ||
|
|
4363255234 | ||
|
|
d1e9a5265d | ||
|
|
a485398029 | ||
|
|
33556c70f2 | ||
|
|
ba16a90290 | ||
|
|
894f2f145c | ||
|
|
56b06a0495 | ||
|
|
fe4693f158 | ||
|
|
f5de7da42f | ||
|
|
107a3fda44 | ||
|
|
e734eb415c | ||
|
|
aa48256010 | ||
|
|
77a03498c1 | ||
|
|
1cf8c7c375 | ||
|
|
f5276f13ae | ||
|
|
d63966b071 | ||
|
|
b01871aea8 | ||
|
|
f5c3cd0f87 | ||
|
|
85a33971e7 | ||
|
|
4e79e85f3f | ||
|
|
a0e323dae5 | ||
|
|
25737a1a46 | ||
|
|
6816f640e2 | ||
|
|
c831f5759f | ||
|
|
9f1483f01b | ||
|
|
ece89051bd | ||
|
|
e768f1c93b | ||
|
|
56cd7f2259 | ||
|
|
a14d699f28 | ||
|
|
d48c3cfce5 | ||
|
|
550da21015 | ||
|
|
98eda97bd2 | ||
|
|
a2439d120e | ||
|
|
0ca816d030 | ||
|
|
b44d479921 | ||
|
|
0acc91403d | ||
|
|
d6a29d483c | ||
|
|
6d25c6b1ef | ||
|
|
c5604472f6 | ||
|
|
59d7a36068 | ||
|
|
500b31eab0 | ||
|
|
cd907584ee | ||
|
|
5af5fe8387 | ||
|
|
346823f7c2 | ||
|
|
fc712a0724 | ||
|
|
e97fc40dec | ||
|
|
e99fc5c3a8 | ||
|
|
a00056599c | ||
|
|
ccd6f91c66 | ||
|
|
3d11057177 | ||
|
|
fe0e71f586 | ||
|
|
d824ae6e0c | ||
|
|
4e06d51a00 | ||
|
|
5a91ecd16a | ||
|
|
7dd7345e08 | ||
|
|
7e1900a8a1 | ||
|
|
cbecda8850 | ||
|
|
b9cc65704e | ||
|
|
49c6f5e866 | ||
|
|
bdd0f7e2f4 | ||
|
|
1e094096c2 | ||
|
|
6d8a906605 | ||
|
|
f75a0df449 | ||
|
|
f16ce3bdbe | ||
|
|
a38dd74d0e | ||
|
|
2a2dad9280 | ||
|
|
0b5a3fa6af | ||
|
|
3fea71731f | ||
|
|
c0b36a482a | ||
|
|
a9311142dc | ||
|
|
3c901543bd | ||
|
|
410e950da6 | ||
|
|
815e5d952d | ||
|
|
8723513528 | ||
|
|
6eab82ecc0 | ||
|
|
f09e99fb05 | ||
|
|
ed8e1aa6db | ||
|
|
8e8581cb15 | ||
|
|
b5472c1b51 | ||
|
|
14b2335c54 | ||
|
|
b94a232b31 | ||
|
|
79a882d18b | ||
|
|
d98b7d9505 | ||
|
|
5351a6a64a | ||
|
|
850845ea44 | ||
|
|
55907bf310 | ||
|
|
83bf215ead | ||
|
|
070068366f | ||
|
|
ee07b71a62 | ||
|
|
5219f52130 | ||
|
|
2157a7ed0b | ||
|
|
888f3d8499 | ||
|
|
e027874468 | ||
|
|
a1ec590bf8 | ||
|
|
35525d5304 | ||
|
|
9fdd609add | ||
|
|
9fa409a1a9 | ||
|
|
ece20b1307 | ||
|
|
ff0b748d58 | ||
|
|
c746a3c4e6 | ||
|
|
b1aa82db18 | ||
|
|
f6e08f3cc2 | ||
|
|
fbfdf1200d | ||
|
|
1cd4ba2698 | ||
|
|
17e0d9fcbe | ||
|
|
91b0b16b35 | ||
|
|
b86c72732f | ||
|
|
91f16ae45a | ||
|
|
272c0369f1 | ||
|
|
c0a6e21599 | ||
|
|
6d478021f9 | ||
|
|
5e1009b4fb | ||
|
|
c3c602b5a4 | ||
|
|
18e484f766 | ||
|
|
82bd9bbd6c | ||
|
|
5271e83824 | ||
|
|
52ddb0efd9 | ||
|
|
7903c7c17e | ||
|
|
8a14552e56 | ||
|
|
569b93da51 | ||
|
|
889af7cf17 | ||
|
|
d685a7f2fe | ||
|
|
9849992cfd | ||
|
|
30f4e77b31 | ||
|
|
b1f4f67130 | ||
|
|
dcdb39026c | ||
|
|
14a1d7a608 | ||
|
|
eafdd8bc76 | ||
|
|
72e8ba2203 | ||
|
|
fdb29a3a09 | ||
|
|
c8698dac79 | ||
|
|
25726d2aef | ||
|
|
ec3f1b2aa4 | ||
|
|
291ce2cbb0 | ||
|
|
49c199e7e8 | ||
|
|
e6ff49eb60 | ||
|
|
8890e5948b | ||
|
|
651e9a7f9c | ||
|
|
caf0ade6f3 | ||
|
|
431b2c5b83 | ||
|
|
ebf0cf91b6 | ||
|
|
590b81a782 | ||
|
|
6808db1cde | ||
|
|
dfa5fccec9 | ||
|
|
d5290e93a8 | ||
|
|
056a8d0274 | ||
|
|
da7284f185 | ||
|
|
434001d4a3 | ||
|
|
14ad8014e2 | ||
|
|
dd82ee532c | ||
|
|
29a961a407 | ||
|
|
7066369887 | ||
|
|
efa8f058d4 | ||
|
|
f8b18d406f | ||
|
|
332be6c771 | ||
|
|
81502e6c7d | ||
|
|
b06da6607b | ||
|
|
f3d6249cc1 | ||
|
|
c16ac2034c | ||
|
|
c5dfc5d5da | ||
|
|
2693bbff95 | ||
|
|
8e008288b6 | ||
|
|
effdfd5a22 | ||
|
|
8a73f98b1f | ||
|
|
553ad0a372 | ||
|
|
088ba4e2ea | ||
|
|
1cd69977e4 | ||
|
|
69349e9d38 | ||
|
|
aeb3cb0945 | ||
|
|
c729a6f91c | ||
|
|
f3a75f55e7 | ||
|
|
8dce187746 | ||
|
|
fce8317da7 | ||
|
|
64a471b5a2 | ||
|
|
c9fdd0197f | ||
|
|
c650b4b00f | ||
|
|
64b6dec56f | ||
|
|
4d531384e9 | ||
|
|
085699f9de | ||
|
|
9de38e50e2 | ||
|
|
545fbdeed1 | ||
|
|
a959d33f85 | ||
|
|
00b2ad49d5 | ||
|
|
872f5c677d | ||
|
|
ad81318854 | ||
|
|
907ae642d0 | ||
|
|
299fd3d5ad | ||
|
|
4dca6c3bb2 | ||
|
|
615e30fa52 | ||
|
|
8679755d18 | ||
|
|
11ee0a8613 | ||
|
|
7ddf6386f1 | ||
|
|
253e02b4c1 | ||
|
|
b2b7fa36bb | ||
|
|
cf1f2d6919 | ||
|
|
9c320a90db | ||
|
|
5be4326626 | ||
|
|
0384d9c29f | ||
|
|
aa82789132 | ||
|
|
2eab0f9757 | ||
|
|
a317e9c038 | ||
|
|
b644f85f51 | ||
|
|
ee3b6e59eb | ||
|
|
0917d49a01 | ||
|
|
0d61f154d7 | ||
|
|
d6e3eccf45 | ||
|
|
e9ac262cd3 | ||
|
|
68a71d2e12 | ||
|
|
478033037f | ||
|
|
059ec49389 | ||
|
|
d0f070bf97 | ||
|
|
452f9e4b50 | ||
|
|
2a6d71cd5a | ||
|
|
4ba43b8496 | ||
|
|
9e42bf7385 | ||
|
|
4ace75151f | ||
|
|
f416fd7a9e | ||
|
|
e20984a5f7 | ||
|
|
18e3a9987e | ||
|
|
fb1a5eab7e | ||
|
|
8ae01f642f | ||
|
|
20fa3b6af9 | ||
|
|
a462c914fc | ||
|
|
60cb78577f | ||
|
|
e8ad355a90 | ||
|
|
0a161f9591 | ||
|
|
234acf5ca2 | ||
|
|
7689729d9b | ||
|
|
6177825939 | ||
|
|
a74a236654 | ||
|
|
93a1ae9f2f | ||
|
|
3f4d9fd23c | ||
|
|
23d98e9352 | ||
|
|
8f381a4e16 | ||
|
|
7e43448110 | ||
|
|
3ca9680c88 | ||
|
|
6f1048d6fd | ||
|
|
6d92cee5bb | ||
|
|
d1bff18e0c | ||
|
|
4d2b2e5803 | ||
|
|
bfef8397d6 | ||
|
|
886a368297 | ||
|
|
73d617fb72 | ||
|
|
3a2888a5d5 | ||
|
|
97237c963f | ||
|
|
f2b3db9cbc | ||
|
|
7a547e64c4 | ||
|
|
6a5ac4fe54 | ||
|
|
500e86c43c | ||
|
|
0900c2fd8b | ||
|
|
58628b8dd3 | ||
|
|
71376ff4e6 | ||
|
|
fff4aea076 | ||
|
|
6c9f132093 | ||
|
|
3b7ad788bf | ||
|
|
867afd7da0 | ||
|
|
c4bfdc4506 | ||
|
|
a7c5eebf99 | ||
|
|
a2a6a98635 | ||
|
|
d309e24e60 | ||
|
|
7abbdf89af | ||
|
|
4720f69b76 | ||
|
|
515cbc7b29 | ||
|
|
b4992856f7 | ||
|
|
74df63ff94 | ||
|
|
52ac8f0d7b | ||
|
|
760ea91cc1 | ||
|
|
2324922111 | ||
|
|
1cfc2780d0 | ||
|
|
c0e47767b7 | ||
|
|
65649b3cbb | ||
|
|
d28ba0e53c | ||
|
|
4fef86a635 | ||
|
|
b16bb14c58 | ||
|
|
36278b6aae | ||
|
|
88165ab072 | ||
|
|
5337e46f43 | ||
|
|
7ed6801101 | ||
|
|
162354decf | ||
|
|
483c7f41de | ||
|
|
46e039dab2 | ||
|
|
4d23410b99 | ||
|
|
88192adfd0 | ||
|
|
e3c745cf9b | ||
|
|
e5de4c8f10 | ||
|
|
511cb0c322 | ||
|
|
688306dd9c | ||
|
|
d39e655fa2 | ||
|
|
812a3c1123 | ||
|
|
244a8775dd | ||
|
|
5e28c2608a | ||
|
|
bd032bbcb8 | ||
|
|
875fdc40a5 | ||
|
|
0ae3cbf4d6 | ||
|
|
b9a7143dee | ||
|
|
ef9cbf6be8 | ||
|
|
a903387182 | ||
|
|
4919f9b18c | ||
|
|
b07b56fce6 | ||
|
|
3a8845dc6f | ||
|
|
de64f784e8 | ||
|
|
f2a614913d | ||
|
|
6b54094e26 | ||
|
|
4442ff7221 | ||
|
|
19c3dd8419 | ||
|
|
9c9d2b7c9c | ||
|
|
f00f0cc846 | ||
|
|
78b6323272 | ||
|
|
a272d99335 | ||
|
|
ce5e66a2d5 | ||
|
|
1f584736f1 | ||
|
|
645dc3fa9d | ||
|
|
96a72286b7 | ||
|
|
d3c97bedb9 | ||
|
|
e6303cef9e | ||
|
|
5b5e11828f | ||
|
|
84972d2548 | ||
|
|
76be30f5c8 | ||
|
|
689a512f5d | ||
|
|
f81d555f7e | ||
|
|
83376d3f3b | ||
|
|
ea00a89cff | ||
|
|
418a97a02a | ||
|
|
d2830b77ec | ||
|
|
dcb60c785f | ||
|
|
987dd805c2 | ||
|
|
45421a9f96 | ||
|
|
71c8ad605f | ||
|
|
e1fc414691 | ||
|
|
dc68da4236 | ||
|
|
8dc16827ea | ||
|
|
6e7c6c205c | ||
|
|
734cfb8966 | ||
|
|
43c85f22c3 | ||
|
|
85e899b92c | ||
|
|
941a8832bf | ||
|
|
8ae111add3 | ||
|
|
88672dc38f | ||
|
|
dccba86dde | ||
|
|
a7bced02da | ||
|
|
a654e2ac43 | ||
|
|
56b54e0e17 | ||
|
|
8ffd920700 | ||
|
|
b6f67a7a6e | ||
|
|
9308410e12 | ||
|
|
65882ae14d | ||
|
|
0f533ec16c | ||
|
|
0c708e8c1e | ||
|
|
2693544faa | ||
|
|
2e95e59f40 | ||
|
|
72bc826907 | ||
|
|
21440c31f4 | ||
|
|
3e225d78fa | ||
|
|
5464463ab0 | ||
|
|
9c9bae7443 | ||
|
|
9d69a0ad54 | ||
|
|
4b88256df2 | ||
|
|
bc7b0e53f0 | ||
|
|
3695862368 | ||
|
|
18ae23b99d | ||
|
|
bb60058fa0 | ||
|
|
1ad25605d1 | ||
|
|
9809265be4 | ||
|
|
63872e6b28 | ||
|
|
fb3a9eae9b | ||
|
|
f53c3050df | ||
|
|
67bd0dfcdb | ||
|
|
12196359f7 | ||
|
|
609165e412 | ||
|
|
41f14a8cf8 | ||
|
|
a8bdd3fbfc | ||
|
|
993ec82a9e | ||
|
|
c5a2844367 | ||
|
|
e5bb405b47 | ||
|
|
8c9a65d094 | ||
|
|
047b8593ac | ||
|
|
4fc4eb8a66 | ||
|
|
1f95a86f0a | ||
|
|
2b90451c4a | ||
|
|
77a6525556 | ||
|
|
5eacab387d | ||
|
|
ddaf57d5b0 | ||
|
|
1144c46109 | ||
|
|
850b839fc3 | ||
|
|
22037e75ba | ||
|
|
303ab163ab | ||
|
|
2833537167 | ||
|
|
1aa7b591b6 | ||
|
|
2f0463d936 | ||
|
|
82a1ec0c3a | ||
|
|
d65133451d | ||
|
|
36e81949e0 | ||
|
|
6b62945632 | ||
|
|
fa2f578900 | ||
|
|
e1c9987059 | ||
|
|
325e219bb1 | ||
|
|
be208df11b | ||
|
|
49df804d1b | ||
|
|
122fde79bd | ||
|
|
2099e68c41 | ||
|
|
52ccc609cd | ||
|
|
b402f6a404 | ||
|
|
3576a1824d | ||
|
|
c3afaae169 | ||
|
|
c5a9ce6b56 | ||
|
|
4f0d944bb9 | ||
|
|
5684bcb6f4 | ||
|
|
5087fcea88 | ||
|
|
28f984e87f | ||
|
|
e0233daeb0 | ||
|
|
49922ebe32 | ||
|
|
8fe0c3441c | ||
|
|
ba55caa404 | ||
|
|
e50e651078 | ||
|
|
39b4fd47c7 | ||
|
|
56b83e5cfa | ||
|
|
ed57355948 | ||
|
|
b4b2f3a0b6 | ||
|
|
1946882952 | ||
|
|
dbe4930c17 | ||
|
|
3b25fa3065 | ||
|
|
01849565aa | ||
|
|
e3ca5833d0 | ||
|
|
dfac1f034b | ||
|
|
a8d07df81d | ||
|
|
609cb44b01 | ||
|
|
feb4d605d0 | ||
|
|
276d887917 | ||
|
|
61aef9c96f | ||
|
|
b4005682f2 | ||
|
|
7d98461fc6 | ||
|
|
862d03b78e | ||
|
|
0ecf46240f | ||
|
|
a2755e212b | ||
|
|
2ec5559dd6 | ||
|
|
6f904759ee | ||
|
|
507fafd601 | ||
|
|
9c463f1338 | ||
|
|
8818cd0285 | ||
|
|
23b72d08d2 | ||
|
|
227049b6f2 | ||
|
|
97abd3e1f9 | ||
|
|
6f34b7ba99 | ||
|
|
c0d86c3852 | ||
|
|
bf743ff467 | ||
|
|
306f994464 | ||
|
|
f56676942b | ||
|
|
bfd0a05289 | ||
|
|
3999c08f00 | ||
|
|
febb8ec1a6 | ||
|
|
cdd38ef7aa | ||
|
|
54c620a5df | ||
|
|
089b7fa73e | ||
|
|
d9d0e84ca1 | ||
|
|
badede2e2d | ||
|
|
e2ae28741d | ||
|
|
ff34150b15 | ||
|
|
4a93ceac58 | ||
|
|
5a724bf49e | ||
|
|
c23bcf6322 | ||
|
|
c863149ad9 | ||
|
|
5fb6e22bed | ||
|
|
d634088282 | ||
|
|
c99a935831 | ||
|
|
165da677ed | ||
|
|
0bbde2ca52 | ||
|
|
3d13c5d13c | ||
|
|
9d978c67ec | ||
|
|
8766e1fa57 | ||
|
|
c0e4883987 | ||
|
|
57f2cd5f9e | ||
|
|
50d8d06a94 | ||
|
|
2e07328878 | ||
|
|
ad8294e521 | ||
|
|
14426a7b45 | ||
|
|
6697e76be1 | ||
|
|
73cd876f6d | ||
|
|
e626754000 | ||
|
|
1fedd31229 | ||
|
|
bfe1746ddb | ||
|
|
4800c32db4 | ||
|
|
140fc28b3e | ||
|
|
f9833bb8af | ||
|
|
4b6ddaf09e | ||
|
|
d427db4a15 | ||
|
|
deb39cc20f | ||
|
|
3a4c25e916 | ||
|
|
f416eb3d4f | ||
|
|
87cbb1f90c | ||
|
|
68f43121fb | ||
|
|
51ceab1f3c | ||
|
|
2257992a3f | ||
|
|
40ead584d7 | ||
|
|
6f2be7bd17 | ||
|
|
af9ca4cf7d | ||
|
|
ea98203ac5 | ||
|
|
e908bbfae6 | ||
|
|
fa00069068 | ||
|
|
efae58de52 | ||
|
|
39c7f703cb | ||
|
|
96220e509c | ||
|
|
4de495ad59 | ||
|
|
56a950a074 | ||
|
|
2b47254bdd | ||
|
|
da28e2cc37 | ||
|
|
3d64f4a548 | ||
|
|
abf03b0c79 | ||
|
|
8381742422 | ||
|
|
724bb09aec | ||
|
|
ad5de248b4 | ||
|
|
1a1fdf6a5a | ||
|
|
c469b17350 | ||
|
|
01842a3c6b | ||
|
|
4cd385dbff | ||
|
|
72787d103f | ||
|
|
59072272a9 | ||
|
|
ef76666e5a | ||
|
|
0a0994b19c | ||
|
|
ab68c570a9 | ||
|
|
dcdf3b39a3 | ||
|
|
476cb2db34 | ||
|
|
34a7e00413 | ||
|
|
413ba09ee0 | ||
|
|
33eefefffb | ||
|
|
b3c822e31b | ||
|
|
14a458a275 | ||
|
|
6c49f9cf52 | ||
|
|
803ea4dda5 | ||
|
|
c9b23e6e4e | ||
|
|
509c9318af | ||
|
|
46e1e3d904 | ||
|
|
7a045d837b | ||
|
|
574ea820f7 | ||
|
|
7061d48dde | ||
|
|
53633b7279 | ||
|
|
05bb126af9 | ||
|
|
436fba77ac | ||
|
|
91c0e64159 | ||
|
|
7207681485 | ||
|
|
eef53f1b54 | ||
|
|
150d8d3214 | ||
|
|
a14376abb6 | ||
|
|
dfb45a8ebc | ||
|
|
00137c3031 | ||
|
|
b9c7dacbd1 | ||
|
|
3a03b579d2 | ||
|
|
e2bbe5cd8b | ||
|
|
c7347a3a16 | ||
|
|
8749b3c782 | ||
|
|
10389dc3f1 | ||
|
|
5e191a6cd8 | ||
|
|
a247625095 | ||
|
|
0fb234f3e4 | ||
|
|
e3e35d3bc6 | ||
|
|
6b12ca5b39 | ||
|
|
44e2837efb | ||
|
|
27dcd1bba2 | ||
|
|
ebf8cba6a4 | ||
|
|
e06cf23a03 | ||
|
|
dd55887f4b | ||
|
|
39b7b29af8 | ||
|
|
6f0aef3344 | ||
|
|
85c3a413fa | ||
|
|
b6c365b89d | ||
|
|
9eedf3901a | ||
|
|
2a6ecaeb09 | ||
|
|
027db2480a | ||
|
|
f4cabca62d | ||
|
|
0b3edc5fd4 | ||
|
|
b05152da0f | ||
|
|
2e0988ff03 | ||
|
|
ec12d9b657 | ||
|
|
f388de26ab | ||
|
|
68df8bf8ea | ||
|
|
4a960bba5e | ||
|
|
3a72b3fe3f | ||
|
|
47f372f215 | ||
|
|
7dc93bee7e | ||
|
|
69ff64149a | ||
|
|
4795f0a7dd | ||
|
|
e9411a3db5 | ||
|
|
6a064a4fa5 | ||
|
|
f036cdaaad | ||
|
|
46a68e2118 | ||
|
|
d020ea8f63 | ||
|
|
a4b40ab9e1 | ||
|
|
7c62b86ed9 | ||
|
|
96fb49e35c | ||
|
|
8e5fc236ca | ||
|
|
0784b5930b | ||
|
|
6de792c465 | ||
|
|
e9a2c89930 | ||
|
|
9d9f3acbe6 | ||
|
|
b67126e917 | ||
|
|
bcbf390334 | ||
|
|
714e355c87 | ||
|
|
f258ea2906 | ||
|
|
9445018586 | ||
|
|
97310b8912 | ||
|
|
47073040d4 | ||
|
|
a93663af0b | ||
|
|
ecd3b87cc0 | ||
|
|
5c34f208bd | ||
|
|
47f8d8c71c | ||
|
|
b2a0dba3bb | ||
|
|
fc1304dff5 | ||
|
|
0e15de7103 | ||
|
|
182375314e | ||
|
|
69ac4ddedc | ||
|
|
68b31347f4 | ||
|
|
6be2d1cbc0 | ||
|
|
5fac15c449 | ||
|
|
ecb86b01c8 | ||
|
|
1744a6ffeb | ||
|
|
fb393c22b6 | ||
|
|
fe2ed74020 | ||
|
|
5f51050b2f | ||
|
|
913253d861 | ||
|
|
8172b2e5ed | ||
|
|
0a7fc06510 | ||
|
|
a81b20d9d5 | ||
|
|
90a09eb520 | ||
|
|
4ffbe0bbf9 | ||
|
|
8f991c311f | ||
|
|
367f839934 | ||
|
|
6c15359137 | ||
|
|
fa05d656ad | ||
|
|
76e32f55de | ||
|
|
30ca79a23a | ||
|
|
0ce6961972 | ||
|
|
b0ae2caef8 | ||
|
|
3eb4a64517 | ||
|
|
61a80b59d1 | ||
|
|
71eaef35e3 | ||
|
|
b7ae453d84 | ||
|
|
33958fed96 | ||
|
|
59d29b3648 | ||
|
|
911d7f6533 | ||
|
|
9d49015c0c | ||
|
|
d585712b40 | ||
|
|
fb15893521 | ||
|
|
308f8c5112 | ||
|
|
86edc0dbe2 | ||
|
|
f461bc9176 | ||
|
|
b121e5af25 | ||
|
|
d292835941 | ||
|
|
88aee00a02 | ||
|
|
2fa806bbee | ||
|
|
ae3faa1540 | ||
|
|
e1e9c428f1 | ||
|
|
443ca9da56 | ||
|
|
ef05da1860 | ||
|
|
e5a87c7463 | ||
|
|
da2f419b86 | ||
|
|
4586a12859 | ||
|
|
9c416bdbc1 | ||
|
|
f43255a1fb | ||
|
|
59949c50d3 | ||
|
|
4608579c31 | ||
|
|
8b7c69c4b0 | ||
|
|
0d519a5f28 | ||
|
|
47ae3ff8d3 | ||
|
|
97b7d7c7b9 | ||
|
|
c552d717ff | ||
|
|
3230287a5f | ||
|
|
0bc9c7ffa1 | ||
|
|
d9abe10308 | ||
|
|
3f62e7d36f | ||
|
|
47a65ce01e | ||
|
|
cd6590e15c | ||
|
|
87d392adb5 | ||
|
|
1dac754ca3 | ||
|
|
b844bb1268 | ||
|
|
dc859ca0a6 | ||
|
|
20e75b4057 | ||
|
|
a69977c62b | ||
|
|
3b0513a57c | ||
|
|
a5c2ea679d | ||
|
|
0dd5e7c081 | ||
|
|
31e9206fc0 | ||
|
|
4bf7d2b2fe | ||
|
|
c8b051628f | ||
|
|
76f36b780c | ||
|
|
d73d698fd5 | ||
|
|
9967d5ca9e | ||
|
|
fdc0370cdf | ||
|
|
a51a46f61a | ||
|
|
3edd508fc8 | ||
|
|
18fea6440e | ||
|
|
3a242b513c | ||
|
|
ade6a6c3ab | ||
|
|
9740ebe2a4 | ||
|
|
0a2e137613 | ||
|
|
56056c4846 | ||
|
|
b32d96636d | ||
|
|
9a4094e997 | ||
|
|
6a0bbea9c5 | ||
|
|
fea213ee2c | ||
|
|
669cadf1ee | ||
|
|
c3bafa2a40 | ||
|
|
2611a93af2 | ||
|
|
651e7e5963 | ||
|
|
7bf18a4464 | ||
|
|
14fd42ad91 | ||
|
|
33a61558e1 | ||
|
|
05ed785af1 | ||
|
|
158193a6c4 | ||
|
|
2671da5c2f | ||
|
|
a99a819e75 | ||
|
|
94664c24d8 | ||
|
|
466e96e79a | ||
|
|
fd2cd0b904 | ||
|
|
4afe14dff7 | ||
|
|
9436a823ba | ||
|
|
1346c98a58 | ||
|
|
93992ee1c1 | ||
|
|
e29bc933fe | ||
|
|
6df5cd8222 | ||
|
|
2dfc75c341 | ||
|
|
e75a1edea8 | ||
|
|
8c94efd61a | ||
|
|
20c3178dfe | ||
|
|
a7271697a2 | ||
|
|
c2bd21922f | ||
|
|
96831b0970 | ||
|
|
0fd5db9f78 | ||
|
|
918328e5b0 | ||
|
|
6bb6322bde | ||
|
|
00e255ee3c | ||
|
|
c662dd8b04 | ||
|
|
a85a246ab8 | ||
|
|
9132a7c8d4 | ||
|
|
44367f24f9 | ||
|
|
5d6a9a68fe | ||
|
|
476d15f0fc | ||
|
|
cce7f465f2 | ||
|
|
0e289d2d3b | ||
|
|
efc9321cec | ||
|
|
4154784f09 | ||
|
|
feb9d7b2a9 | ||
|
|
da22df5f5d | ||
|
|
78f751959d | ||
|
|
b0c3a1e23f | ||
|
|
cb703a6ce5 | ||
|
|
c1b26b87a8 | ||
|
|
15f752f002 | ||
|
|
af1a4ab07a | ||
|
|
5413765a23 | ||
|
|
da63afa758 | ||
|
|
1d86d674e5 | ||
|
|
5718c3d14d | ||
|
|
2bfefaf296 | ||
|
|
2c00ccca83 | ||
|
|
ade2cc8182 | ||
|
|
f546ea1f8a | ||
|
|
ff499d42a0 | ||
|
|
10e5af2ddf | ||
|
|
724f92562c | ||
|
|
2b68c5e383 | ||
|
|
47545e511d | ||
|
|
b7aea5b726 | ||
|
|
5338a4f17c | ||
|
|
e2dcabcbea | ||
|
|
971929777d | ||
|
|
0f4a95e31b | ||
|
|
b453787670 | ||
|
|
c555dbc3e8 | ||
|
|
1561e07ddf | ||
|
|
ec9bc59962 | ||
|
|
7fd82fffab | ||
|
|
0652b218db | ||
|
|
59217b9af3 | ||
|
|
46c9bcbc4f | ||
|
|
f6154032c7 | ||
|
|
6c2d2e8455 | ||
|
|
4d61f26dfa | ||
|
|
86c42a00a3 | ||
|
|
2443e06745 | ||
|
|
eb1d93d4e5 | ||
|
|
f0bf525cf4 | ||
|
|
45758add5d | ||
|
|
57465b2892 | ||
|
|
8a95eecf60 | ||
|
|
766b0ba9c8 | ||
|
|
a6796fe80a | ||
|
|
5e450388f9 | ||
|
|
cc62825081 | ||
|
|
7b5d640f35 | ||
|
|
96a9e8a090 | ||
|
|
d572765f09 | ||
|
|
ce539f30a5 | ||
|
|
103cf9c3bf | ||
|
|
e9fca78c13 | ||
|
|
19431ef675 | ||
|
|
8d6c5ea406 | ||
|
|
0dfc35ee5f | ||
|
|
b8a1d07cdc | ||
|
|
574f95a35b | ||
|
|
cefcd843fc | ||
|
|
279c84f8e1 | ||
|
|
b69cfad8ef | ||
|
|
0bdc4394aa | ||
|
|
9e720d1e2b | ||
|
|
9a932e7dd5 | ||
|
|
62c0148472 | ||
|
|
97cedb311a | ||
|
|
776cdd60fa | ||
|
|
234b3df332 | ||
|
|
fa0744fb8e | ||
|
|
376216a2c0 | ||
|
|
88989bfbfd | ||
|
|
acb45459f5 | ||
|
|
8a93c5696f | ||
|
|
33a6948e68 | ||
|
|
cdd5bd538a | ||
|
|
15082d7777 | ||
|
|
5d2177d929 | ||
|
|
31642ceca9 | ||
|
|
e84335742d | ||
|
|
6d31ef8849 | ||
|
|
2fd24277c1 | ||
|
|
a60c30155e | ||
|
|
041d26670f | ||
|
|
0891a27f75 | ||
|
|
d25246a212 | ||
|
|
7853843b0b | ||
|
|
7cc6af8f85 | ||
|
|
7fcc47dd86 | ||
|
|
bca4f15f9d | ||
|
|
b644957cee | ||
|
|
2806b3a3c3 | ||
|
|
b166615067 | ||
|
|
ae2860d03d | ||
|
|
21b3464212 | ||
|
|
5c1f280988 | ||
|
|
7ec57692b1 | ||
|
|
d096fed8db | ||
|
|
15091cea54 | ||
|
|
7715d122c7 | ||
|
|
f18964ad44 | ||
|
|
b79edf1cb5 | ||
|
|
67c5509524 | ||
|
|
0770249da1 | ||
|
|
0ebc1ce7b2 | ||
|
|
90e9b60287 | ||
|
|
9a6e5458c9 | ||
|
|
3333553b24 | ||
|
|
1565c59714 | ||
|
|
92a1eda82a | ||
|
|
84e24a0142 | ||
|
|
d235c2d899 | ||
|
|
a26d7f615b | ||
|
|
3411729ca5 | ||
|
|
62c35753aa | ||
|
|
6967e66f74 | ||
|
|
9d96e23cb3 | ||
|
|
91fa8426f1 | ||
|
|
4af89576aa | ||
|
|
b5f8ef0106 | ||
|
|
3ca7d2d626 | ||
|
|
d37cd2e26d | ||
|
|
46527cab53 | ||
|
|
09d15c4bce | ||
|
|
68f7df6a52 | ||
|
|
4714a2fccb | ||
|
|
72145f4914 | ||
|
|
7247a1e5a4 | ||
|
|
343315c587 | ||
|
|
c557ea1b6f | ||
|
|
e9a4d9702c | ||
|
|
5e48e0d8c0 | ||
|
|
fa5aedc906 | ||
|
|
a3eb1655c6 | ||
|
|
8e9fd91cee | ||
|
|
e3d4b0e56a | ||
|
|
8d7227b1f9 | ||
|
|
d07b190322 | ||
|
|
e2d8b9d06b | ||
|
|
fecee19e1a | ||
|
|
f04efead96 | ||
|
|
b13ecb7cfd | ||
|
|
0fc9fa541f | ||
|
|
b824c2d31a | ||
|
|
65d4baa944 | ||
|
|
cd5a916f99 | ||
|
|
66b779a77d | ||
|
|
c62bd4ce97 | ||
|
|
2f95dc20c6 | ||
|
|
a284d49692 | ||
|
|
68c73c5be1 | ||
|
|
4fcbee9594 | ||
|
|
e9afe396b0 | ||
|
|
927d8ce237 | ||
|
|
461f3bd89f | ||
|
|
ed1791ab02 | ||
|
|
8b9af2c21b | ||
|
|
50872438e9 | ||
|
|
9b9e70e7e8 | ||
|
|
f832a07755 | ||
|
|
c3a632e612 | ||
|
|
bad7a94b6d | ||
|
|
7e9fbabd83 | ||
|
|
f5750628bf | ||
|
|
692ca763a1 | ||
|
|
9eb1731516 | ||
|
|
93776707a9 | ||
|
|
ebe6d3cbee | ||
|
|
46a0c2d5b6 | ||
|
|
85539c7bb9 | ||
|
|
78bc0a52ea | ||
|
|
13784d3576 | ||
|
|
d0371b0ff7 | ||
|
|
ae490125e9 | ||
|
|
bb9e1c5dbc | ||
|
|
f350f9905a | ||
|
|
040cf41468 | ||
|
|
e016e3280d | ||
|
|
3850227605 | ||
|
|
06e80f0c31 | ||
|
|
bb7e08cdce | ||
|
|
3b3fb28412 | ||
|
|
ba27d3ff79 | ||
|
|
6ac8ac6ae6 | ||
|
|
802081c3f8 | ||
|
|
2a2cd0dbca | ||
|
|
75a824e164 | ||
|
|
27d71f530a | ||
|
|
b53ffb65af | ||
|
|
e9ead0d33d | ||
|
|
be405eb705 | ||
|
|
95d1dcc521 | ||
|
|
96895a80c1 | ||
|
|
132726bc45 | ||
|
|
593f977621 | ||
|
|
582c23bae8 | ||
|
|
e1bfd95f63 | ||
|
|
715bc94bd9 | ||
|
|
e19c9a967d | ||
|
|
83c18d0cb6 | ||
|
|
bfd1a4c341 | ||
|
|
3878e94253 | ||
|
|
af07ee9abb | ||
|
|
22590754fd | ||
|
|
7205f10ec2 | ||
|
|
f7750f04a6 | ||
|
|
d58d84dbcf | ||
|
|
f025261ddf | ||
|
|
dcf57093f8 | ||
|
|
3c8591d371 | ||
|
|
d27ad8e23a | ||
|
|
3ecfb5b073 | ||
|
|
e9777cf325 | ||
|
|
7aa46e7eeb | ||
|
|
775f1a042d | ||
|
|
82f09bdb81 | ||
|
|
489fdc5566 | ||
|
|
3e4be2c800 | ||
|
|
f61bb99d3a | ||
|
|
0a8f71e76e | ||
|
|
833cb48050 | ||
|
|
09574b3937 | ||
|
|
e2d4e384e3 | ||
|
|
6bff6016ff | ||
|
|
09cb84f617 | ||
|
|
d920fe6c5e | ||
|
|
676402854b | ||
|
|
5eacc7c327 | ||
|
|
f29346f0b7 | ||
|
|
facada5d04 | ||
|
|
d945477369 | ||
|
|
f96e7a9156 | ||
|
|
fc22268fc2 | ||
|
|
7dbb9931ec | ||
|
|
b14145f3dc | ||
|
|
5a414d5711 | ||
|
|
7cc6f635fc | ||
|
|
a90695ef1f | ||
|
|
0e99c9b9a4 | ||
|
|
93becd5629 | ||
|
|
b13b398204 | ||
|
|
f531c0a405 | ||
|
|
3e8e1ed596 | ||
|
|
b90c2ec385 | ||
|
|
9ad85288a9 | ||
|
|
54858dffdb | ||
|
|
86597ab2da | ||
|
|
92e246a574 | ||
|
|
2a596bc2cc | ||
|
|
b28c11cb54 | ||
|
|
4ed9ade4fc | ||
|
|
2d474b3d3a | ||
|
|
ee4d0bf4b5 | ||
|
|
f8e8bd03cd | ||
|
|
509613d2e5 | ||
|
|
cf3395b9ce | ||
|
|
16a11b75a8 | ||
|
|
07d4a65a45 | ||
|
|
7bf8f6115f | ||
|
|
43e700036d | ||
|
|
ad1f5fc18d | ||
|
|
51f9ab8498 | ||
|
|
592e356932 | ||
|
|
e6f1f6eeb1 | ||
|
|
86782e7f3e | ||
|
|
4136545b6b | ||
|
|
c9099f3a2f | ||
|
|
a28328dd96 | ||
|
|
485f8a6d3a | ||
|
|
3c05d000f5 | ||
|
|
4850615327 | ||
|
|
5702b525d1 | ||
|
|
b2e57e1bde | ||
|
|
c987c62819 | ||
|
|
4aa8c756c2 | ||
|
|
37aa481dd0 | ||
|
|
0b5c070ad1 | ||
|
|
7b1412004f | ||
|
|
3270a38d69 | ||
|
|
1bc77620d9 | ||
|
|
2ef5490297 | ||
|
|
19b3bd151e | ||
|
|
d8774d2f5a | ||
|
|
e5cb313d92 | ||
|
|
ac0138a7e1 | ||
|
|
6e5fbe8991 | ||
|
|
56ec842c00 | ||
|
|
c3420a0a6e | ||
|
|
8d13877002 | ||
|
|
065f7d6cc7 | ||
|
|
03a7c745c9 | ||
|
|
4269f16bcd | ||
|
|
55c9cb45ac | ||
|
|
4f825641ce | ||
|
|
ade2b4baea | ||
|
|
1e1091b365 | ||
|
|
93e1a7047c | ||
|
|
99554f5622 | ||
|
|
b09240702e | ||
|
|
fbf7f91e4f | ||
|
|
9a0d655788 | ||
|
|
aa77d156a9 | ||
|
|
493e95d9d6 | ||
|
|
4aaf6ba69e | ||
|
|
88f8ef0244 | ||
|
|
312a583092 | ||
|
|
c8e0390aaf | ||
|
|
8e2af39c06 | ||
|
|
606cbb3883 | ||
|
|
377746f155 | ||
|
|
5f11ba0445 | ||
|
|
be7d4c3c93 | ||
|
|
ec53e8949a | ||
|
|
f04cc7aa08 | ||
|
|
b994d0ad70 | ||
|
|
68b2fee9be | ||
|
|
82b9c9781c | ||
|
|
6d15eac2c6 | ||
|
|
faa740a8dd | ||
|
|
872faf2abe | ||
|
|
bc85d6518b | ||
|
|
15e7a94640 | ||
|
|
810295aafa | ||
|
|
ffd45d58fe | ||
|
|
852923ea34 | ||
|
|
979b34d717 | ||
|
|
34f92fe4e5 | ||
|
|
10b217e0c2 | ||
|
|
2b0593e5ff | ||
|
|
2b329e6899 | ||
|
|
5b0bf40508 | ||
|
|
210a936483 | ||
|
|
813e2d5b2c | ||
|
|
a18c940503 | ||
|
|
329d8acca7 | ||
|
|
bf2cdc3c9b | ||
|
|
61ce0d1117 | ||
|
|
e8201b115f | ||
|
|
5690742937 | ||
|
|
9f29f41288 | ||
|
|
828c0bcb99 | ||
|
|
fe0d31ae94 | ||
|
|
175d10c5d1 | ||
|
|
02b5349db2 | ||
|
|
a64d69560c | ||
|
|
e18205e6c7 | ||
|
|
0f542809a4 | ||
|
|
d171fb1570 | ||
|
|
b913523066 | ||
|
|
16588ab0bf | ||
|
|
5dc27ed275 | ||
|
|
63826f5567 | ||
|
|
0d3d115d67 | ||
|
|
a9959bcd62 | ||
|
|
93a4e67813 | ||
|
|
0e79db6cf7 | ||
|
|
7b1f6d7ce3 | ||
|
|
8c452288f4 | ||
|
|
bf5137ed6b | ||
|
|
c8e4f9160c | ||
|
|
fae4f7c8b4 | ||
|
|
2148d3d3ab | ||
|
|
8ccd442647 | ||
|
|
d44a7fc23a | ||
|
|
5c63d75c86 | ||
|
|
fef282fcd5 | ||
|
|
ec9e5402c0 | ||
|
|
a45378cadf | ||
|
|
a5127c7c07 | ||
|
|
0197aeeb4b | ||
|
|
8b84b0403b | ||
|
|
6a671a5cd1 | ||
|
|
1be4eee674 | ||
|
|
1eed8a2a86 | ||
|
|
e782ddc143 | ||
|
|
d91e3f568b | ||
|
|
98eb006cdd | ||
|
|
60154b7c26 | ||
|
|
dab9e7aaa2 | ||
|
|
0f8dceed89 | ||
|
|
affa091ccb | ||
|
|
8a022f877e | ||
|
|
579a542815 | ||
|
|
080d021fb3 | ||
|
|
10ec91065e | ||
|
|
25a3ea98bc | ||
|
|
5555e334af | ||
|
|
3c41c286c7 | ||
|
|
bf9fbc46fd | ||
|
|
824ef9a9d3 | ||
|
|
8a84d4812f | ||
|
|
ffe456ea7c | ||
|
|
a997845604 | ||
|
|
f887eae0f7 | ||
|
|
508c209270 | ||
|
|
4027304ece | ||
|
|
0ac59b4152 | ||
|
|
2272134442 | ||
|
|
1c828bd680 | ||
|
|
499867255b | ||
|
|
dc142a5531 | ||
|
|
2115e92520 | ||
|
|
c3d31f11e4 | ||
|
|
bf4d908eab | ||
|
|
2a3ba03226 | ||
|
|
5c6f72ac57 | ||
|
|
bfcf2d98b5 | ||
|
|
0b01e7edea | ||
|
|
84a4d114c4 | ||
|
|
44b47f4d88 | ||
|
|
1175a22d53 | ||
|
|
5aa8761c7e | ||
|
|
1668ec2fc6 | ||
|
|
eaf3b7943c | ||
|
|
1551b413fb | ||
|
|
05a1b0203b | ||
|
|
c83667e432 | ||
|
|
9203ae20cd | ||
|
|
43f658a82b | ||
|
|
3dcc6dc299 | ||
|
|
fe79c0d294 | ||
|
|
1f0a91c313 | ||
|
|
ae5cd7b3c3 | ||
|
|
2947e11b9b | ||
|
|
85670dd4a1 | ||
|
|
5d88c1a19e | ||
|
|
3004007f96 | ||
|
|
58244d5a3d | ||
|
|
ac97e0c6e9 | ||
|
|
d9bdb0d7e1 | ||
|
|
83da1773b5 | ||
|
|
44e4e0a2b3 | ||
|
|
9dad1d79d7 | ||
|
|
3a3a9af284 | ||
|
|
c2a7fbaadc | ||
|
|
b2789bea6b | ||
|
|
807e8642fa | ||
|
|
c9008bf78b | ||
|
|
a641d2a2de | ||
|
|
6186f39068 | ||
|
|
6bd1209146 | ||
|
|
2a9c379a1c | ||
|
|
1b983111f6 | ||
|
|
cf5dd8b822 | ||
|
|
069d2b275a | ||
|
|
368e35abb6 | ||
|
|
81a51d750c | ||
|
|
d93b137b85 | ||
|
|
d15f2a0cbe | ||
|
|
bd54729257 | ||
|
|
6123ef12bd | ||
|
|
14cf008a19 | ||
|
|
da8db72328 | ||
|
|
30e3a3a958 | ||
|
|
b384a2fff6 | ||
|
|
8dd866a35e | ||
|
|
b36e2eb5f4 | ||
|
|
9c4fdc18b8 | ||
|
|
357a90db71 | ||
|
|
8c65d4e131 | ||
|
|
07971d25a6 | ||
|
|
ce538a804d | ||
|
|
d480f19b24 | ||
|
|
5deb1d35e3 | ||
|
|
140514b408 | ||
|
|
34d40364a3 | ||
|
|
a4d7f5e7d1 | ||
|
|
b3aa3d3b83 | ||
|
|
3f9e4731b8 | ||
|
|
3e79a86008 | ||
|
|
126c6e1b6c | ||
|
|
90c6e4cd1b | ||
|
|
e1616af98c | ||
|
|
388e488bc1 | ||
|
|
b601c49f6c | ||
|
|
d9587e20c0 | ||
|
|
f5684c43dd | ||
|
|
d25700e241 | ||
|
|
9dde599e00 | ||
|
|
96f0d65f7d | ||
|
|
abe64ae8fb | ||
|
|
5df6fc4c1b | ||
|
|
a4a6929ca4 | ||
|
|
cc221f590c | ||
|
|
ec1b782f2c | ||
|
|
48549ff790 | ||
|
|
5633053655 | ||
|
|
92acbd006b | ||
|
|
8552a89838 | ||
|
|
ce90d81a2f | ||
|
|
f250b006b1 | ||
|
|
f46c3b36cc | ||
|
|
217999912a | ||
|
|
82e6192c05 | ||
|
|
03abfa9c59 | ||
|
|
97155c50c4 | ||
|
|
7b45e9296a | ||
|
|
c16836e7c0 | ||
|
|
1f88072eae | ||
|
|
858ea9c3de | ||
|
|
1248858303 | ||
|
|
a472a95945 | ||
|
|
c8af57c65d | ||
|
|
d00eb38bbc | ||
|
|
f8e1b9b11b | ||
|
|
bbb807d860 | ||
|
|
355c68f687 | ||
|
|
b74ae9fabf | ||
|
|
17d2fb1858 | ||
|
|
222fad315d | ||
|
|
124ba2a124 | ||
|
|
9b8dc448f6 | ||
|
|
0a44a81d18 | ||
|
|
c4ec841c0f | ||
|
|
6fe5d9a9e9 | ||
|
|
18c74a245d | ||
|
|
2fb311e090 | ||
|
|
d6822b85b3 | ||
|
|
d08461bd4c | ||
|
|
f4d63877e4 | ||
|
|
43335cd729 | ||
|
|
0678bb03d7 | ||
|
|
b15102d45a | ||
|
|
fb26842046 | ||
|
|
e703baf295 | ||
|
|
94670baa64 | ||
|
|
62c67435e6 | ||
|
|
1e492721ba | ||
|
|
2fe635a958 | ||
|
|
c1bdbffc87 | ||
|
|
a654f5bf13 | ||
|
|
7a8d99304a | ||
|
|
7e0ce1fa48 | ||
|
|
b84d3a5612 | ||
|
|
81b110feb6 | ||
|
|
4556f7b8a4 | ||
|
|
a9b6f8976e | ||
|
|
dfa6165662 | ||
|
|
ee3ee63ff5 | ||
|
|
3567d8913f | ||
|
|
8276054671 | ||
|
|
220117f07c | ||
|
|
728ca8aa9d | ||
|
|
e3a1125e84 | ||
|
|
02b64f4027 | ||
|
|
2ae44ca493 | ||
|
|
afdd63521f | ||
|
|
bced0b91a0 | ||
|
|
2a6f2939be | ||
|
|
13880354cf | ||
|
|
5df0c95e51 | ||
|
|
447054a14f | ||
|
|
5f348a8ea3 | ||
|
|
1d69411eba | ||
|
|
fb24a8fdb1 | ||
|
|
827fb7fa82 | ||
|
|
c6365bebac | ||
|
|
c7b94d0a42 | ||
|
|
86f82951d5 | ||
|
|
72b865b50e | ||
|
|
b2f7e4b16b | ||
|
|
2f01299472 | ||
|
|
5cc851e175 | ||
|
|
66986e66e3 | ||
|
|
9292bbcd1b | ||
|
|
dfba3c51fb | ||
|
|
da7e501e3a | ||
|
|
42ae23f279 | ||
|
|
c43775f7b2 | ||
|
|
86ee1270e2 | ||
|
|
b8cfd83d33 | ||
|
|
bfd56bf904 | ||
|
|
df2311cdaf | ||
|
|
d609c2b0ff | ||
|
|
70e1d2bf3d | ||
|
|
1697c2160c | ||
|
|
c28301bb7e | ||
|
|
b5eadb158c | ||
|
|
e94912cdb9 | ||
|
|
dfb967834f | ||
|
|
98f7c29683 | ||
|
|
0998c5539a | ||
|
|
1a79e23b12 | ||
|
|
d49323c7c4 | ||
|
|
98eb3cb7f0 | ||
|
|
c75ae73814 | ||
|
|
07519b7c28 | ||
|
|
4c62c82dab | ||
|
|
92a9554240 | ||
|
|
324a700fb7 | ||
|
|
a6b934758b | ||
|
|
cd5ec59f6a | ||
|
|
80fe813116 | ||
|
|
1262afef63 | ||
|
|
987489b34a | ||
|
|
9310861cc2 | ||
|
|
53f0db99ca | ||
|
|
2eb125f6e2 | ||
|
|
f805d9432e | ||
|
|
054cb9e9fa | ||
|
|
1f77e7d90a | ||
|
|
7ed33832b8 | ||
|
|
d19e9cc662 | ||
|
|
846c9cec6a | ||
|
|
460e4b8bb3 | ||
|
|
2e6bd23f22 | ||
|
|
7763948fe4 | ||
|
|
2a0f001902 | ||
|
|
14df69e180 | ||
|
|
28b6389b36 | ||
|
|
905c0b8c7a | ||
|
|
b674cc95ac | ||
|
|
bccb2509b5 | ||
|
|
cd980c6604 | ||
|
|
ddff4ec083 | ||
|
|
5bf97be8ef | ||
|
|
7fadb6ed05 | ||
|
|
89688d67dd | ||
|
|
279007544a | ||
|
|
1c0f0e1423 | ||
|
|
1ab909addc | ||
|
|
99dfd15469 | ||
|
|
be18ecf74e | ||
|
|
713bd132dc | ||
|
|
20f03e237e | ||
|
|
7d3c3911ea | ||
|
|
ccfee2be83 | ||
|
|
1193b0b990 | ||
|
|
5a3ba4e563 | ||
|
|
e9c342ef74 | ||
|
|
8927ffa035 | ||
|
|
fdb0312326 | ||
|
|
2f21caa41c | ||
|
|
51a35d40e5 | ||
|
|
6ec524adec | ||
|
|
7d4a7ec8c7 | ||
|
|
0256c4521d | ||
|
|
be3ed181c1 | ||
|
|
38cf7884fe | ||
|
|
25d426e8b2 | ||
|
|
edff9ae684 | ||
|
|
a622e3bda6 | ||
|
|
4d54e28e63 | ||
|
|
c89d023f91 | ||
|
|
c7cfea1daa | ||
|
|
beb07365a0 | ||
|
|
0787c65e51 | ||
|
|
d48dea7273 | ||
|
|
2432cc6ed2 | ||
|
|
cf523d4215 | ||
|
|
906d87c4b8 | ||
|
|
9c4a92c015 | ||
|
|
0c056ba691 | ||
|
|
424158b28d | ||
|
|
57f118a5b5 | ||
|
|
65e75f3da2 | ||
|
|
41174cde45 | ||
|
|
cb7d01fb36 | ||
|
|
3e78f8e87d | ||
|
|
f2c032ba07 | ||
|
|
2ef1589e76 | ||
|
|
5c394557e3 | ||
|
|
5c4a5b0a61 | ||
|
|
be22b7349d | ||
|
|
023e4774a1 | ||
|
|
56b706f25e | ||
|
|
9d07ee43eb | ||
|
|
147a6c81a1 | ||
|
|
5972f4947d | ||
|
|
9c99a624d7 | ||
|
|
d812d83dda | ||
|
|
f81c5c2455 | ||
|
|
dc8c5e6209 | ||
|
|
14833582b2 | ||
|
|
cca813fd1d | ||
|
|
d4102e75c5 | ||
|
|
76a04efc5c | ||
|
|
a34e139843 | ||
|
|
a1727a2ac7 | ||
|
|
7ac224adf3 | ||
|
|
d5e3d02a98 | ||
|
|
68ad3e8db4 | ||
|
|
31029b2fe4 | ||
|
|
8b0c101768 | ||
|
|
50b66f526b | ||
|
|
f3fcf010fb | ||
|
|
4da53bd00d | ||
|
|
c6cef45f0e | ||
|
|
e36cd7fe5c | ||
|
|
0c24f2db7b | ||
|
|
8866faa8d5 | ||
|
|
b2dc31ba80 | ||
|
|
061ea30199 | ||
|
|
0e9e94d090 | ||
|
|
3321cb37ef | ||
|
|
d60a818791 | ||
|
|
3937a52b4f | ||
|
|
2c3902b1a1 | ||
|
|
f43b5ee76f | ||
|
|
bab16a5251 | ||
|
|
08c734d7fd | ||
|
|
36126a3ad9 | ||
|
|
ce505d33bd | ||
|
|
de0d859502 | ||
|
|
ce96d4bcc5 | ||
|
|
fb242274d5 | ||
|
|
938bc7cdd7 | ||
|
|
36865f2930 | ||
|
|
12e79cccf6 | ||
|
|
6180f12ba3 | ||
|
|
c00b6c6237 | ||
|
|
dbdc74fdef | ||
|
|
5bb0a07164 | ||
|
|
543f09999f | ||
|
|
812f32efdd | ||
|
|
784264eba4 | ||
|
|
ff9ca059c7 | ||
|
|
d4b0c39485 | ||
|
|
87c42aeaf4 | ||
|
|
5ba6e57c71 | ||
|
|
6d2ba5c2d0 | ||
|
|
0d42b81285 | ||
|
|
9ce2ae613b | ||
|
|
13c9e0e666 | ||
|
|
784118e9c1 | ||
|
|
df32a32d99 | ||
|
|
655241aed3 | ||
|
|
60a2b246e2 | ||
|
|
ebd60d93f3 | ||
|
|
cc4ba935b5 | ||
|
|
824147fd7d | ||
|
|
c3446a16cc | ||
|
|
82135d1892 | ||
|
|
1cff63bc01 | ||
|
|
e488e74313 | ||
|
|
1a17c9da86 | ||
|
|
20e1f773fc | ||
|
|
56d80ff293 | ||
|
|
80e176136a | ||
|
|
0ae66d3e24 | ||
|
|
802ab8238e | ||
|
|
ec9c07a646 | ||
|
|
b75ad663f2 | ||
|
|
e4a017fc00 | ||
|
|
5b486ca6b8 | ||
|
|
1c39ed6130 | ||
|
|
a47563b12f | ||
|
|
84491ff655 | ||
|
|
e5991a4379 | ||
|
|
0b3d4615b8 | ||
|
|
a8f6336b47 | ||
|
|
0b33df3341 | ||
|
|
744cc4b705 | ||
|
|
9d3cd5784f | ||
|
|
06ea58198a | ||
|
|
3692d7d090 | ||
|
|
460a2dbbd3 | ||
|
|
228f4f1010 | ||
|
|
2703b91e41 | ||
|
|
24171787f8 | ||
|
|
49d3338d4a | ||
|
|
a9d693e1c3 | ||
|
|
4ef69248d0 | ||
|
|
247b3ed740 | ||
|
|
1edca6235c | ||
|
|
ab5c03b1d9 | ||
|
|
d4cb35469d | ||
|
|
fd1b1d0c24 | ||
|
|
bf96ceeacc | ||
|
|
2c08b385e5 | ||
|
|
051d13ec7a | ||
|
|
a2a9643123 | ||
|
|
1286bfe75b |
10
.github/CONTRIBUTING.md
vendored
10
.github/CONTRIBUTING.md
vendored
@@ -10,9 +10,9 @@ As a first step, please review these links as they'll help you understand how th
|
||||
|
||||
## Just Starting Out
|
||||
|
||||
* If you're unfamilar with git, check out this [brief introduction to Git](https://github.com/PCSX2/pcsx2/wiki/Git-survival-guide)
|
||||
* [How to build PCSX2 for Windows](https://github.com/PCSX2/pcsx2/wiki/Setting-up-the-PCSX2-repository-on-Windows-\(WIP---maybe-more-useful-as-a-manpage-instead%3F\))
|
||||
* [How to build PCSX2 for Linux](https://github.com/PCSX2/pcsx2/wiki/Installing-on-Linux)
|
||||
* If you're unfamilar with git, check out this [brief introduction to Git](https://github.com/PCSX2/pcsx2/wiki/07-Git-survival-guide)
|
||||
* [How to build PCSX2 for Windows](https://github.com/PCSX2/pcsx2/wiki/12-Building-on-Windows)
|
||||
* [How to build PCSX2 for Linux](https://github.com/PCSX2/pcsx2/wiki/10-Building-on-Linux)
|
||||
|
||||
## Issue Reporting
|
||||
|
||||
@@ -44,13 +44,11 @@ The following is a list of *general* style recommendations that will make review
|
||||
|
||||
## General Documentation And Coding Strategies
|
||||
|
||||
* [Commenting Etiquette](https://github.com/PCSX2/pcsx2/wiki/Commenting-Etiquette)
|
||||
* [Commenting Etiquette](https://github.com/PCSX2/pcsx2/wiki/06-Commenting-Etiquette)
|
||||
|
||||
* [Coding style](https://github.com/PCSX2/pcsx2/wiki/Code-Formatting-Guidelines)
|
||||
* [More comprehensive style-guide (Currently in Draft)](https://github.com/tadanokojin/pcsx2/blob/coding-guide/pcsx2/Docs/Coding_Guidelines.md)
|
||||
|
||||
## Tasks
|
||||
|
||||
* [Todo List](https://github.com/PCSX2/pcsx2/wiki/Contributing-\(TODO-List\))
|
||||
* [Issues](https://github.com/PCSX2/pcsx2/issues)
|
||||
* [A collection of ideas to improve GS OGL](https://github.com/PCSX2/pcsx2/wiki/Todo-List)
|
||||
|
||||
8
.github/ISSUE_TEMPLATE/app_bug_report.yaml
vendored
8
.github/ISSUE_TEMPLATE/app_bug_report.yaml
vendored
@@ -18,6 +18,8 @@ body:
|
||||
|
||||
Please make an effort to make sure your issue isn't already reported.
|
||||
|
||||
Do not create issues involving software piracy of BIOS or ISO files, our rules specifically prohibit this and your issue will be closed.
|
||||
|
||||
### Please Avoid Issues Pertaining to the Following:
|
||||
- We are **not** accepting bug reports for **PSX mode** at this time.
|
||||
- If you are interested in helping contribute to PSX mode please do so on the forums. Otherwise our recommendation is that you use [Duckstation](https://github.com/stenzek/duckstation/releases/tag/latest).
|
||||
@@ -27,6 +29,9 @@ body:
|
||||
- If your bug is the result of upscaling please use the forums or discord for assistance with various upscaling workarounds. Additionally, the unofficial PCSX2 [Wiki](https://wiki.pcsx2.net/Main_Page) often lists various fixes for upscaling issues.
|
||||
- We do **not** accept issues relating to Widescreen/no-interlace patches at this time.
|
||||
- Any issues pertaining to Widescreen/no-interlace patches please forward them to the [patches repository](https://github.com/PCSX2/pcsx2_patches).
|
||||
- We do **not** accept issues pertaining to Linux builds other than the official AppImage and Flatpak.
|
||||
- Please contact your packager for support. We have no control over other builds, nor can we investigate any issues, and historically they have been known to be broken.
|
||||
- This includes pre-configured "distributions" such as EmuDeck, the "AUR", etc.
|
||||
|
||||
- type: textarea
|
||||
id: desc
|
||||
@@ -65,11 +70,10 @@ body:
|
||||
- Windows 11
|
||||
- Windows 10 (64bit)
|
||||
- Linux (64bit) - Specify distro below
|
||||
- macOS 14 (Sonoma)
|
||||
- macOS 13 (Ventura)
|
||||
- macOS 12 (Monterey)
|
||||
- macOS 11 (Big Sur)
|
||||
- macOS 10.15 (Catalina)
|
||||
- macOS 10.14 (Mojave)
|
||||
validations:
|
||||
required: true
|
||||
- type: input
|
||||
|
||||
12
.github/ISSUE_TEMPLATE/emu_bug_report.yaml
vendored
12
.github/ISSUE_TEMPLATE/emu_bug_report.yaml
vendored
@@ -18,6 +18,8 @@ body:
|
||||
|
||||
Please make an effort to make sure your issue isn't already reported.
|
||||
|
||||
Do not create issues involving software piracy of BIOS or ISO files, our rules specifically prohibit this and your issue will be closed.
|
||||
|
||||
### Please Avoid Issues Pertaining to the Following:
|
||||
- We are **not** accepting bug reports for **PSX mode** at this time.
|
||||
- If you are interested in helping contribute to PSX mode please do so on the forums. Otherwise our recommendation is that you use [Duckstation](https://github.com/stenzek/duckstation/releases/tag/latest).
|
||||
@@ -27,6 +29,9 @@ body:
|
||||
- If your bug is the result of upscaling please use the forums or discord for assistance with various upscaling workarounds. Additionally, the unofficial PCSX2 [Wiki](https://wiki.pcsx2.net/Main_Page) often lists various fixes for upscaling issues.
|
||||
- We do **not** accept issues relating to Widescreen/no-interlace patches at this time.
|
||||
- Any issues pertaining to Widescreen/no-interlace patches please forward them to the [patches repository](https://github.com/PCSX2/pcsx2_patches).
|
||||
- We do **not** accept issues pertaining to Linux builds other than the official AppImage and Flatpak.
|
||||
- Please contact your packager for support. We have no control over other builds, nor can we investigate any issues, and historically they have been known to be broken.
|
||||
- This includes pre-configured "distributions" such as EmuDeck, the "AUR", etc.
|
||||
|
||||
- type: textarea
|
||||
id: desc
|
||||
@@ -80,11 +85,10 @@ body:
|
||||
- Windows 11
|
||||
- Windows 10 (64bit)
|
||||
- Linux (64bit) - Specify distro below
|
||||
- macOS 14 (Sonoma)
|
||||
- macOS 13 (Ventura)
|
||||
- macOS 12 (Monterey)
|
||||
- macOS 11 (Big Sur)
|
||||
- macOS 10.15 (Catalina)
|
||||
- macOS 10.14 (Mojave)
|
||||
validations:
|
||||
required: true
|
||||
- type: input
|
||||
@@ -122,9 +126,9 @@ body:
|
||||
description: |
|
||||
Any non-default core settings. If you don't want to list them out, please provide screenshots of your configuration window.
|
||||
|
||||
Please note that the safe preset works for most games. MTVU can have some compatibility issues so please disable it before making a report.
|
||||
Please note that defaults tend to work best.
|
||||
|
||||
If you need to modify the settings manually because a game requires you to do so to work, please state that explicitly.
|
||||
If you need to modify the settings manually to fix an issue , please state that explicitly.
|
||||
validations:
|
||||
required: false
|
||||
- type: textarea
|
||||
|
||||
9
.github/ISSUE_TEMPLATE/feature_request.yaml
vendored
9
.github/ISSUE_TEMPLATE/feature_request.yaml
vendored
@@ -6,6 +6,15 @@ labels: ["Enhancement / Feature Request"]
|
||||
# assignees:
|
||||
# - octocat
|
||||
body:
|
||||
- type: markdown
|
||||
attributes:
|
||||
value: |
|
||||
## Important: Read First
|
||||
|
||||
Please make an effort to make sure your issue isn't already reported.
|
||||
|
||||
Do not create issues involving software piracy of BIOS or ISO files, our rules specifically prohibit this and your issue will be closed.
|
||||
|
||||
- type: textarea
|
||||
id: desc
|
||||
attributes:
|
||||
|
||||
4
.github/dependabot.yml
vendored
4
.github/dependabot.yml
vendored
@@ -6,3 +6,7 @@ updates:
|
||||
schedule:
|
||||
# Check for updates to GitHub Actions every week
|
||||
interval: "weekly"
|
||||
groups:
|
||||
ci-deps:
|
||||
patterns:
|
||||
- "*"
|
||||
|
||||
234
.github/labeler.yml
vendored
234
.github/labeler.yml
vendored
@@ -2,127 +2,187 @@
|
||||
|
||||
# General Labels
|
||||
'Build | Project System':
|
||||
- '.github/*'
|
||||
- '.github/**/*'
|
||||
- '*.sln'
|
||||
- '**/*.sln'
|
||||
- '*.vcxproj*'
|
||||
- '**/*.vcxproj*'
|
||||
- 'cmake/*'
|
||||
- 'cmake/**/*'
|
||||
- 'CMakeLists.txt'
|
||||
- '**/CMakeLists.txt'
|
||||
- 'build.sh'
|
||||
- changed-files:
|
||||
- any-glob-to-any-file:
|
||||
- '.github/*'
|
||||
- '.github/**/*'
|
||||
- '*.sln'
|
||||
- '**/*.sln'
|
||||
- '*.vcxproj*'
|
||||
- '**/*.vcxproj*'
|
||||
- 'cmake/*'
|
||||
- 'cmake/**/*'
|
||||
- 'CMakeLists.txt'
|
||||
- '**/CMakeLists.txt'
|
||||
- 'build.sh'
|
||||
'Dependencies':
|
||||
- '3rdparty/*'
|
||||
- '3rdparty/**/*'
|
||||
- '**/3rdpartyDeps.props'
|
||||
- '.gitmodules'
|
||||
- changed-files:
|
||||
- any-glob-to-any-file:
|
||||
- '3rdparty/*'
|
||||
- '3rdparty/**/*'
|
||||
- '**/3rdpartyDeps.props'
|
||||
- '.gitmodules'
|
||||
'Documentation':
|
||||
- '*.md'
|
||||
- '**/*.md'
|
||||
- '*.pdf'
|
||||
- '**/*.pdf'
|
||||
- changed-files:
|
||||
- any-glob-to-any-file:
|
||||
- '*.md'
|
||||
- '**/*.md'
|
||||
- '*.pdf'
|
||||
- '**/*.pdf'
|
||||
'GUI/Qt':
|
||||
- 'pcsx2-qt/*'
|
||||
- 'pcsx2-qt/**/*'
|
||||
- '3rdparty/Qt/*'
|
||||
- '3rdparty/Qt/**/*'
|
||||
- changed-files:
|
||||
- any-glob-to-any-file:
|
||||
- 'pcsx2-qt/*'
|
||||
- 'pcsx2-qt/**/*'
|
||||
- '3rdparty/Qt/*'
|
||||
- '3rdparty/Qt/**/*'
|
||||
'GameDB':
|
||||
- '**/GameIndex.*'
|
||||
- changed-files:
|
||||
- any-glob-to-any-file:
|
||||
- '**/GameIndex.*'
|
||||
'Installer | Package':
|
||||
- 'build.sh'
|
||||
- changed-files:
|
||||
- any-glob-to-any-file:
|
||||
- 'build.sh'
|
||||
'Translations':
|
||||
- 'pcsx2-qt/Translations/*'
|
||||
- changed-files:
|
||||
- any-glob-to-any-file:
|
||||
- 'pcsx2-qt/Translations/*'
|
||||
|
||||
# Tools / Features
|
||||
'Debugger':
|
||||
- 'pcsx2/DebugTools/*'
|
||||
- 'pcsx2/DebugTools/**/*'
|
||||
- 'pcsx2-qt/Debugger/*'
|
||||
- 'pcsx2-qt/Debugger/**/*'
|
||||
- changed-files:
|
||||
- any-glob-to-any-file:
|
||||
- 'pcsx2/DebugTools/*'
|
||||
- 'pcsx2/DebugTools/**/*'
|
||||
- 'pcsx2-qt/Debugger/*'
|
||||
- 'pcsx2-qt/Debugger/**/*'
|
||||
'IPC':
|
||||
- 'pcsx2/IPC*'
|
||||
- 'pcsx2/**/IPC*'
|
||||
- changed-files:
|
||||
- any-glob-to-any-file:
|
||||
- 'pcsx2/IPC*'
|
||||
- 'pcsx2/**/IPC*'
|
||||
'TAS Functionality':
|
||||
- 'pcsx2/Recording/*'
|
||||
- 'pcsx2/Recording/**/*'
|
||||
- changed-files:
|
||||
- any-glob-to-any-file:
|
||||
- 'pcsx2/Recording/*'
|
||||
- 'pcsx2/Recording/**/*'
|
||||
'RetroAchievements':
|
||||
- 'pcsx2/Frontend/Achievements.*'
|
||||
- 'pcsx2/Achievements.*'
|
||||
- changed-files:
|
||||
- any-glob-to-any-file:
|
||||
- 'pcsx2/Frontend/Achievements.*'
|
||||
- 'pcsx2/Achievements.*'
|
||||
|
||||
# Emulation Components
|
||||
'Counters':
|
||||
- 'pcsx2/Counters.*'
|
||||
- changed-files:
|
||||
- any-glob-to-any-file:
|
||||
- 'pcsx2/Counters.*'
|
||||
'Vector Units':
|
||||
- 'pcsx2/VU*'
|
||||
- 'pcsx2/**/VU*'
|
||||
- 'pcsx2/*VU*'
|
||||
- 'pcsx2/**/*VU*'
|
||||
- changed-files:
|
||||
- any-glob-to-any-file:
|
||||
- 'pcsx2/VU*'
|
||||
- 'pcsx2/**/VU*'
|
||||
- 'pcsx2/*VU*'
|
||||
- 'pcsx2/**/*VU*'
|
||||
'VIF':
|
||||
- 'pcsx2/Vif*'
|
||||
- 'pcsx2/**/Vif*'
|
||||
- 'pcsx2/VIF*'
|
||||
- 'pcsx2/**/VIF*'
|
||||
- changed-files:
|
||||
- any-glob-to-any-file:
|
||||
- 'pcsx2/Vif*'
|
||||
- 'pcsx2/**/Vif*'
|
||||
- 'pcsx2/VIF*'
|
||||
- 'pcsx2/**/VIF*'
|
||||
|
||||
# GS Related Labels
|
||||
'GS':
|
||||
- 'pcsx2/GS/*'
|
||||
- 'pcsx2/GS/**/*'
|
||||
- 'bin/resources/shaders/*'
|
||||
- 'bin/resources/shaders/**/*'
|
||||
- changed-files:
|
||||
- any-glob-to-any-file:
|
||||
- 'pcsx2/GS/*'
|
||||
- 'pcsx2/GS/**/*'
|
||||
- 'bin/resources/shaders/*'
|
||||
- 'bin/resources/shaders/**/*'
|
||||
'GS: Direct3D 11':
|
||||
- 'pcsx2/GS/Renderers/DX11/*'
|
||||
- 'pcsx2/GS/Renderers/DX11/**/*'
|
||||
- 'bin/resources/shaders/dx11/*'
|
||||
- 'bin/resources/shaders/dx11/**/*'
|
||||
- changed-files:
|
||||
- any-glob-to-any-file:
|
||||
- 'pcsx2/GS/Renderers/DX11/*'
|
||||
- 'pcsx2/GS/Renderers/DX11/**/*'
|
||||
- 'bin/resources/shaders/dx11/*'
|
||||
- 'bin/resources/shaders/dx11/**/*'
|
||||
'GS: Direct3D 12':
|
||||
- 'pcsx2/GS/Renderers/DX12/*'
|
||||
- 'pcsx2/GS/Renderers/DX12/**/*'
|
||||
- 'bin/resources/shaders/dx11/*'
|
||||
- 'bin/resources/shaders/dx11/**/*'
|
||||
- changed-files:
|
||||
- any-glob-to-any-file:
|
||||
- 'pcsx2/GS/Renderers/DX12/*'
|
||||
- 'pcsx2/GS/Renderers/DX12/**/*'
|
||||
- 'bin/resources/shaders/dx11/*'
|
||||
- 'bin/resources/shaders/dx11/**/*'
|
||||
'GS: Hardware':
|
||||
- 'pcsx2/GS/Renderers/HW/*'
|
||||
- 'pcsx2/GS/Renderers/HW/**/*'
|
||||
- changed-files:
|
||||
- any-glob-to-any-file:
|
||||
- 'pcsx2/GS/Renderers/HW/*'
|
||||
- 'pcsx2/GS/Renderers/HW/**/*'
|
||||
'GS: OpenGL':
|
||||
- 'pcsx2/GS/Renderers/OpenGL/*'
|
||||
- 'pcsx2/GS/Renderers/OpenGL/**/*'
|
||||
- 'bin/resources/shaders/opengl/*'
|
||||
- 'bin/resources/shaders/opengl/**/*'
|
||||
- changed-files:
|
||||
- any-glob-to-any-file:
|
||||
- 'pcsx2/GS/Renderers/OpenGL/*'
|
||||
- 'pcsx2/GS/Renderers/OpenGL/**/*'
|
||||
- 'bin/resources/shaders/opengl/*'
|
||||
- 'bin/resources/shaders/opengl/**/*'
|
||||
'GS: Vulkan':
|
||||
- 'pcsx2/GS/Renderers/Vulkan/*'
|
||||
- 'pcsx2/GS/Renderers/Vulkan/**/*'
|
||||
- 'bin/resources/shaders/vulkan/*'
|
||||
- 'bin/resources/shaders/vulkan/**/*'
|
||||
- changed-files:
|
||||
- any-glob-to-any-file:
|
||||
- 'pcsx2/GS/Renderers/Vulkan/*'
|
||||
- 'pcsx2/GS/Renderers/Vulkan/**/*'
|
||||
- 'bin/resources/shaders/vulkan/*'
|
||||
- 'bin/resources/shaders/vulkan/**/*'
|
||||
'GS: Metal':
|
||||
- 'pcsx2/GS/Renderers/Metal/*'
|
||||
- 'pcsx2/GS/Renderers/Metal/**/*'
|
||||
- changed-files:
|
||||
- any-glob-to-any-file:
|
||||
- 'pcsx2/GS/Renderers/Metal/*'
|
||||
- 'pcsx2/GS/Renderers/Metal/**/*'
|
||||
'GS: Texture Cache':
|
||||
- 'pcsx2/GS/Renderers/*TextureCache*.*'
|
||||
- 'pcsx2/GS/Renderers/**/*TextureCache*.*'
|
||||
- changed-files:
|
||||
- any-glob-to-any-file:
|
||||
- 'pcsx2/GS/Renderers/*TextureCache*.*'
|
||||
- 'pcsx2/GS/Renderers/**/*TextureCache*.*'
|
||||
'GS: Software':
|
||||
- 'pcsx2/GS/Renderers/SW/*'
|
||||
- 'pcsx2/GS/Renderers/SW/**/*'
|
||||
- changed-files:
|
||||
- any-glob-to-any-file:
|
||||
- 'pcsx2/GS/Renderers/SW/*'
|
||||
- 'pcsx2/GS/Renderers/SW/**/*'
|
||||
|
||||
# Other Core Components
|
||||
'CDVD':
|
||||
- 'pcsx2/CDVD/*'
|
||||
- 'pcsx2/CDVD/**/*'
|
||||
- changed-files:
|
||||
- any-glob-to-any-file:
|
||||
- 'pcsx2/CDVD/*'
|
||||
- 'pcsx2/CDVD/**/*'
|
||||
'DEV9':
|
||||
- 'pcsx2/DEV9/*'
|
||||
- 'pcsx2/DEV9/**/*'
|
||||
- changed-files:
|
||||
- any-glob-to-any-file:
|
||||
- 'pcsx2/DEV9/*'
|
||||
- 'pcsx2/DEV9/**/*'
|
||||
'IPU':
|
||||
- 'pcsx2/IPU/*'
|
||||
- 'pcsx2/IPU/**/*'
|
||||
- changed-files:
|
||||
- any-glob-to-any-file:
|
||||
- 'pcsx2/IPU/*'
|
||||
- 'pcsx2/IPU/**/*'
|
||||
'Memory Card':
|
||||
- 'pcsx2/SIO/Memcard/*'
|
||||
- 'pcsx2/SIO/Memcard/**/*'
|
||||
- changed-files:
|
||||
- any-glob-to-any-file:
|
||||
- 'pcsx2/SIO/Memcard/*'
|
||||
- 'pcsx2/SIO/Memcard/**/*'
|
||||
'PAD':
|
||||
- 'pcsx2/SIO/Pad/*'
|
||||
- 'pcsx2/SIO/Pad/**/*'
|
||||
- changed-files:
|
||||
- any-glob-to-any-file:
|
||||
- 'pcsx2/SIO/Pad/*'
|
||||
- 'pcsx2/SIO/Pad/**/*'
|
||||
'SPU2':
|
||||
- 'pcsx2/SPU2/*'
|
||||
- 'pcsx2/SPU2/**/*'
|
||||
- changed-files:
|
||||
- any-glob-to-any-file:
|
||||
- 'pcsx2/SPU2/*'
|
||||
- 'pcsx2/SPU2/**/*'
|
||||
'USB':
|
||||
- 'pcsx2/USB/*'
|
||||
- 'pcsx2/USB/**/*'
|
||||
- changed-files:
|
||||
- any-glob-to-any-file:
|
||||
- 'pcsx2/USB/*'
|
||||
- 'pcsx2/USB/**/*'
|
||||
|
||||
2
.github/workflows/cron_publish_flatpak.yml
vendored
2
.github/workflows/cron_publish_flatpak.yml
vendored
@@ -33,9 +33,11 @@ jobs:
|
||||
uses: ./.github/workflows/linux_build_flatpak.yml
|
||||
with:
|
||||
jobName: "Qt"
|
||||
artifactPrefixName: "PCSX2-linux-Qt-x64-flatpak"
|
||||
compiler: clang
|
||||
cmakeflags: ""
|
||||
publish: true
|
||||
branch: stable
|
||||
fetchTags: true
|
||||
secrets: inherit
|
||||
|
||||
|
||||
@@ -11,13 +11,13 @@ jobs:
|
||||
name: "Update Base Translation"
|
||||
runs-on: ubuntu-22.04
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
- uses: actions/checkout@v4
|
||||
|
||||
- name: Update Base Translation
|
||||
run: ./.github/workflows/scripts/common/update_base_translation.sh
|
||||
|
||||
- name: Create Pull Request
|
||||
uses: peter-evans/create-pull-request@v5
|
||||
uses: peter-evans/create-pull-request@v6
|
||||
with:
|
||||
title: "Qt: Update Base Translation"
|
||||
commit-message: "Qt: Update Base Translation"
|
||||
|
||||
@@ -9,7 +9,7 @@ jobs:
|
||||
if: github.repository == 'PCSX2/pcsx2'
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
- uses: actions/checkout@v4
|
||||
|
||||
- name: Get Latest DB and Prepare DB File
|
||||
run: |
|
||||
@@ -19,7 +19,7 @@ jobs:
|
||||
mv ./game_controller_db.txt ${{github.workspace}}/bin/resources/game_controller_db.txt
|
||||
|
||||
- name: Create Pull Request
|
||||
uses: peter-evans/create-pull-request@v5
|
||||
uses: peter-evans/create-pull-request@v6
|
||||
with:
|
||||
title: "PAD: Update to latest controller database"
|
||||
commit-message: "PAD: Update to latest controller database."
|
||||
|
||||
20
.github/workflows/lint_gamedb.yml
vendored
20
.github/workflows/lint_gamedb.yml
vendored
@@ -18,14 +18,26 @@ jobs:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout Repository
|
||||
uses: actions/checkout@v3
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Install Packages
|
||||
run: |
|
||||
npm install -g ajv-cli prettier
|
||||
sudo apt-get -y install yamllint
|
||||
|
||||
- name: Validate YAML
|
||||
run: |
|
||||
yamllint -sd "{extends: relaxed, rules: {line-length: disable}}" ./bin/resources/GameIndex.yaml
|
||||
|
||||
- name: Validate Contents
|
||||
run: |
|
||||
npm install -g ajv-cli
|
||||
ajv validate -s ./pcsx2/Docs/gamedb-schema.json --spec=draft2020 -d ./bin/resources/GameIndex.yaml
|
||||
|
||||
- name: Check Formatting
|
||||
run: |
|
||||
npm install -g prettier
|
||||
prettier --check ./bin/resources/GameIndex.yaml
|
||||
if ! prettier --check bin/resources/GameIndex.yaml; then
|
||||
prettier --write bin/resources/GameIndex.yaml
|
||||
echo "Prettier failed, diff:"
|
||||
git diff bin/resources/GameIndex.yaml
|
||||
exit 1
|
||||
fi
|
||||
|
||||
72
.github/workflows/linux_build_flatpak.yml
vendored
72
.github/workflows/linux_build_flatpak.yml
vendored
@@ -6,6 +6,9 @@ on:
|
||||
jobName:
|
||||
required: true
|
||||
type: string
|
||||
artifactPrefixName:
|
||||
required: true
|
||||
type: string
|
||||
os:
|
||||
required: false
|
||||
type: string
|
||||
@@ -36,18 +39,31 @@ on:
|
||||
required: false
|
||||
type: boolean
|
||||
default: false
|
||||
stableBuild:
|
||||
required: false
|
||||
type: boolean
|
||||
default: false
|
||||
|
||||
jobs:
|
||||
build_linux:
|
||||
name: ${{ inputs.jobName }}
|
||||
runs-on: ${{ inputs.os }}
|
||||
container:
|
||||
image: ghcr.io/flathub-infra/flatpak-github-actions:kde-6.7
|
||||
options: --privileged
|
||||
timeout-minutes: 60
|
||||
|
||||
steps:
|
||||
- name: Checkout Repository
|
||||
uses: actions/checkout@v3
|
||||
uses: actions/checkout@v4
|
||||
with:
|
||||
submodules: recursive
|
||||
set-safe-directory: ${{ env.GITHUB_WORKSPACE }}
|
||||
|
||||
# Work around container ownership issue
|
||||
- name: Set Safe Directory
|
||||
shell: bash
|
||||
run: git config --global --add safe.directory "*"
|
||||
|
||||
# Hackity hack. When running the workflow on a schedule, we don't have the tag,
|
||||
# it doesn't fetch tags, therefore we don't get a version. So grab them manually.
|
||||
@@ -56,66 +72,86 @@ jobs:
|
||||
if: ${{ inputs.fetchTags }}
|
||||
run: git fetch --tags --no-recurse-submodules
|
||||
|
||||
- name: Add stable release identifier file
|
||||
if: ${{ inputs.stableBuild == true || inputs.stableBuild == 'true' }}
|
||||
shell: bash
|
||||
run: |
|
||||
echo "#define DEFAULT_UPDATER_CHANNEL \"stable\"" > ./pcsx2-qt/DefaultUpdaterChannel.h
|
||||
cat ./pcsx2-qt/DefaultUpdaterChannel.h
|
||||
|
||||
- name: Prepare Artifact Metadata
|
||||
id: artifact-metadata
|
||||
shell: bash
|
||||
env:
|
||||
OS: linux
|
||||
BUILD_SYSTEM: flatpak
|
||||
ARCH: ${{ inputs.platform }}
|
||||
PREFIX: ${{ inputs.artifactPrefixName }}
|
||||
EVENT_NAME: ${{ github.event_name }}
|
||||
PR_TITLE: ${{ github.event.pull_request.title }}
|
||||
PR_NUM: ${{ github.event.pull_request.number }}
|
||||
PR_SHA: ${{ github.event.pull_request.head.sha }}
|
||||
run: ./.github/workflows/scripts/common/name-artifacts.sh
|
||||
|
||||
- name: Install Packages
|
||||
env:
|
||||
COMPILER: ${{ inputs.compiler }}
|
||||
run: .github/workflows/scripts/linux/install-packages-flatpak.sh
|
||||
|
||||
- name: Download patches
|
||||
run: |
|
||||
cd bin/resources
|
||||
aria2c -Z "${{ inputs.patchesUrl }}/patches.zip"
|
||||
wget "${{ inputs.patchesUrl }}/patches.zip"
|
||||
|
||||
- name: Generate AppStream XML
|
||||
run: |
|
||||
./.github/workflows/scripts/linux/generate-metainfo.sh .github/workflows/scripts/linux/flatpak/net.pcsx2.PCSX2.metainfo.xml
|
||||
cat .github/workflows/scripts/linux/flatpak/net.pcsx2.PCSX2.metainfo.xml
|
||||
flatpak run org.freedesktop.appstream-glib validate .github/workflows/scripts/linux/flatpak/net.pcsx2.PCSX2.metainfo.xml
|
||||
# flatpak-builder-lint appstream .github/workflows/scripts/linux/flatpak/net.pcsx2.PCSX2.metainfo.xml
|
||||
|
||||
- name: Validate manifest
|
||||
run: |
|
||||
flatpak-builder-lint manifest .github/workflows/scripts/linux/flatpak/net.pcsx2.PCSX2.json
|
||||
|
||||
- name: Build Flatpak
|
||||
uses: flatpak/flatpak-github-actions/flatpak-builder@v6.1
|
||||
uses: flathub-infra/flatpak-github-actions/flatpak-builder@23796715b3dfa4c86ddf50cf29c3cc8b3c82dca8
|
||||
with:
|
||||
bundle: ${{ steps.artifact-metadata.outputs.artifact-name }}.flatpak
|
||||
upload-artifact: false
|
||||
manifest-path: .github/workflows/scripts/linux/flatpak/net.pcsx2.PCSX2.json
|
||||
arch: x86_64
|
||||
build-bundle: true
|
||||
verbose: true
|
||||
mirror-screenshots-url: https://dl.flathub.org/repo/screenshots
|
||||
mirror-screenshots-url: https://dl.flathub.org/media
|
||||
branch: ${{ inputs.branch }}
|
||||
cache: true
|
||||
restore-cache: true
|
||||
cache-key: ${{ inputs.os }} ${{ inputs.platform }} ${{ inputs.compiler }} flatpak ${{ hashFiles('.github/workflows/scripts/linux/flatpak/**/*.json') }}
|
||||
|
||||
- name: Commit screenshots to OSTree
|
||||
run: |
|
||||
ostree commit --repo=repo --canonical-permissions --branch=screenshots/x86_64 flatpak_app/screenshots
|
||||
#- name: Validate build
|
||||
# run: |
|
||||
# flatpak-builder-lint repo repo
|
||||
|
||||
- name: Push to Flathub beta
|
||||
if: inputs.publish == true && inputs.branch == 'beta'
|
||||
uses: flatpak/flatpak-github-actions/flat-manager@v6.1
|
||||
uses: flathub-infra/flatpak-github-actions/flat-manager@23796715b3dfa4c86ddf50cf29c3cc8b3c82dca8
|
||||
with:
|
||||
flat-manager-url: https://hub.flathub.org/
|
||||
repository: beta
|
||||
token: ${{ secrets.FLATHUB_BETA_TOKEN }}
|
||||
build-log-url: ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}
|
||||
|
||||
- name: Push to Flathub stable
|
||||
if: inputs.publish == true && inputs.branch == 'stable'
|
||||
uses: flatpak/flatpak-github-actions/flat-manager@v6.1
|
||||
uses: flathub-infra/flatpak-github-actions/flat-manager@23796715b3dfa4c86ddf50cf29c3cc8b3c82dca8
|
||||
with:
|
||||
flat-manager-url: https://hub.flathub.org/
|
||||
repository: stable
|
||||
token: ${{ secrets.FLATHUB_TOKEN }}
|
||||
build-log-url: ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}
|
||||
|
||||
# NOTE - this is done after on purpose so the flatpak file is wherever it needs to be for the previous pushes
|
||||
- name: Prepare artifacts folder
|
||||
# NOTE - 'flatpak-builder' dumps the artifact out into the current directory
|
||||
run: |
|
||||
mkdir -p "$GITHUB_WORKSPACE"/ci-artifacts/
|
||||
mv "./${{ steps.artifact-metadata.outputs.artifact-name }}.flatpak" "$GITHUB_WORKSPACE"/ci-artifacts/
|
||||
|
||||
- name: Upload artifact
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: ${{ steps.artifact-metadata.outputs.artifact-name }}
|
||||
path: ci-artifacts
|
||||
|
||||
|
||||
2
.github/workflows/linux_build_matrix.yml
vendored
2
.github/workflows/linux_build_matrix.yml
vendored
@@ -15,6 +15,7 @@ jobs:
|
||||
uses: ./.github/workflows/linux_build_qt.yml
|
||||
with:
|
||||
jobName: "AppImage Build"
|
||||
artifactPrefixName: "PCSX2-linux-Qt-x64-appimage-sse4"
|
||||
compiler: clang
|
||||
cmakeflags: ""
|
||||
buildAppImage: true
|
||||
@@ -25,6 +26,7 @@ jobs:
|
||||
uses: ./.github/workflows/linux_build_flatpak.yml
|
||||
with:
|
||||
jobName: "Flatpak Build"
|
||||
artifactPrefixName: "PCSX2-linux-Qt-x64-flatpak-sse4"
|
||||
compiler: clang
|
||||
cmakeflags: ""
|
||||
publish: false
|
||||
|
||||
77
.github/workflows/linux_build_qt.yml
vendored
77
.github/workflows/linux_build_qt.yml
vendored
@@ -6,6 +6,9 @@ on:
|
||||
jobName:
|
||||
required: true
|
||||
type: string
|
||||
artifactPrefixName:
|
||||
required: true
|
||||
type: string
|
||||
os:
|
||||
required: false
|
||||
type: string
|
||||
@@ -36,13 +39,17 @@ on:
|
||||
required: false
|
||||
type: boolean
|
||||
default: false
|
||||
stableBuild:
|
||||
required: false
|
||||
type: boolean
|
||||
default: false
|
||||
|
||||
jobs:
|
||||
build_linux:
|
||||
name: ${{ inputs.jobName }}
|
||||
runs-on: ${{ inputs.os }}
|
||||
# Set some sort of timeout in the event of run-away builds. We are limited on concurrent jobs so, get rid of them.
|
||||
timeout-minutes: 60
|
||||
timeout-minutes: 90
|
||||
env:
|
||||
CCACHE_BASEDIR: ${{ github.workspace }}
|
||||
CCACHE_DIR: ${{ github.workspace }}/.ccache
|
||||
@@ -51,8 +58,16 @@ jobs:
|
||||
CCACHE_MAXSIZE: 100M
|
||||
|
||||
steps:
|
||||
# Work around https://github.com/actions/runner-images/issues/8659
|
||||
- name: Remove GCC 13 from runner image
|
||||
shell: bash
|
||||
run: |
|
||||
sudo rm -f /etc/apt/sources.list.d/ubuntu-toolchain-r-ubuntu-test-jammy.list
|
||||
sudo apt-get update
|
||||
sudo apt-get install -y --allow-downgrades 'libc6=2.35-0ubuntu*' 'libc6-dev=2.35-0ubuntu*' libstdc++6=12.3.0-1ubuntu1~22.04 libgcc-s1=12.3.0-1ubuntu1~22.04
|
||||
|
||||
- name: Checkout Repository
|
||||
uses: actions/checkout@v3
|
||||
uses: actions/checkout@v4
|
||||
with:
|
||||
submodules: recursive
|
||||
|
||||
@@ -61,12 +76,18 @@ jobs:
|
||||
if: ${{ inputs.fetchTags }}
|
||||
run: git fetch --tags --no-recurse-submodules
|
||||
|
||||
- name: Add stable release identifier file
|
||||
if: ${{ inputs.stableBuild == true || inputs.stableBuild == 'true' }}
|
||||
shell: bash
|
||||
run: |
|
||||
echo "#define DEFAULT_UPDATER_CHANNEL \"stable\"" > ./pcsx2-qt/DefaultUpdaterChannel.h
|
||||
cat ./pcsx2-qt/DefaultUpdaterChannel.h
|
||||
|
||||
- name: Prepare Artifact Metadata
|
||||
id: artifact-metadata
|
||||
shell: bash
|
||||
env:
|
||||
OS: linux
|
||||
ARCH: ${{ inputs.platform }}
|
||||
PREFIX: ${{ inputs.artifactPrefixName }}
|
||||
EVENT_NAME: ${{ github.event_name }}
|
||||
PR_TITLE: ${{ github.event.pull_request.title }}
|
||||
PR_NUM: ${{ github.event.pull_request.number }}
|
||||
@@ -79,27 +100,36 @@ jobs:
|
||||
run: echo "timestamp=$(date -u "+%Y-%m-%d-%H;%M;%S")" >> $GITHUB_OUTPUT
|
||||
|
||||
- name: ccache cache files
|
||||
uses: actions/cache@v3
|
||||
uses: actions/cache@v4
|
||||
with:
|
||||
path: .ccache
|
||||
key: ${{ inputs.os }} ${{ inputs.platform }} ${{ inputs.compiler }} ${{ inputs.detail }} ccache ${{ steps.ccache_cache_timestamp.outputs.timestamp }}
|
||||
restore-keys: ${{ inputs.os }} ${{ inputs.platform }} ${{ inputs.compiler }} ${{ inputs.detail }} ccache
|
||||
|
||||
- name: Install Packages
|
||||
env:
|
||||
COMPILER: ${{ inputs.compiler }}
|
||||
run: .github/workflows/scripts/linux/install-packages-qt.sh
|
||||
run: |
|
||||
tools/retry.sh wget -qO- https://apt.llvm.org/llvm-snapshot.gpg.key | sudo tee /etc/apt/trusted.gpg.d/apt.llvm.org.asc
|
||||
sudo tools/retry.sh apt-add-repository -n 'deb http://apt.llvm.org/jammy/ llvm-toolchain-jammy-17 main'
|
||||
sudo tools/retry.sh apt-get update
|
||||
sudo tools/retry.sh apt-get -y install \
|
||||
build-essential ccache clang-17 cmake curl extra-cmake-modules git libasound2-dev libaio-dev libavcodec-dev libavformat-dev libavutil-dev \
|
||||
libcurl4-openssl-dev libdbus-1-dev libdecor-0-dev libegl-dev libevdev-dev libfontconfig-dev libfreetype-dev libfuse2 libgtk-3-dev libgudev-1.0-dev \
|
||||
libharfbuzz-dev libinput-dev libopengl-dev libpcap-dev libpipewire-0.3-dev libpulse-dev libssl-dev libswresample-dev libswscale-dev libudev-dev \
|
||||
libwayland-dev libx11-dev libx11-xcb-dev libxcb1-dev libxcb-composite0-dev libxcb-cursor-dev libxcb-damage0-dev libxcb-glx0-dev libxcb-icccm4-dev \
|
||||
libxcb-image0-dev libxcb-keysyms1-dev libxcb-present-dev libxcb-randr0-dev libxcb-render0-dev libxcb-render-util0-dev libxcb-shape0-dev \
|
||||
libxcb-shm0-dev libxcb-sync-dev libxcb-util-dev libxcb-xfixes0-dev libxcb-xinput-dev libxcb-xkb-dev libxext-dev libxkbcommon-x11-dev libxrandr-dev \
|
||||
lld-17 llvm-17 ninja-build patchelf pkg-config zlib1g-dev
|
||||
|
||||
- name: Cache Dependencies
|
||||
id: cache-deps
|
||||
uses: actions/cache@v3
|
||||
uses: actions/cache@v4
|
||||
with:
|
||||
path: ~/deps
|
||||
key: ${{ inputs.os }} ${{ inputs.platform }} deps ${{ hashFiles('.github/workflows/scripts/linux/build-dependencies-qt.sh') }}
|
||||
|
||||
- name: Build Dependencies
|
||||
if: steps.cache-deps.outputs.cache-hit != 'true'
|
||||
run: .github/workflows/scripts/linux/build-dependencies-qt.sh
|
||||
run: .github/workflows/scripts/linux/build-dependencies-qt.sh "$HOME/deps"
|
||||
|
||||
- name: Download patches
|
||||
run: |
|
||||
@@ -108,16 +138,31 @@ jobs:
|
||||
|
||||
- name: Generate CMake
|
||||
env:
|
||||
COMPILER: ${{ inputs.compiler }}
|
||||
ADDITIONAL_CMAKE_ARGS: ${{ inputs.cmakeflags }}
|
||||
CLANG_PATH: /usr/bin/clang-16
|
||||
CLANGXX_PATH: /usr/bin/clang++-16
|
||||
run: |
|
||||
DEPS_PREFIX="$HOME/deps" .github/workflows/scripts/linux/generate-cmake-qt.sh
|
||||
cmake -B build -G Ninja \
|
||||
-DCMAKE_BUILD_TYPE=Release \
|
||||
-DCMAKE_INTERPROCEDURAL_OPTIMIZATION=ON \
|
||||
-DCMAKE_PREFIX_PATH="$HOME/deps" \
|
||||
-DCMAKE_C_COMPILER=clang-17 \
|
||||
-DCMAKE_CXX_COMPILER=clang++-17 \
|
||||
-DCMAKE_EXE_LINKER_FLAGS_INIT="-fuse-ld=lld" \
|
||||
-DCMAKE_MODULE_LINKER_FLAGS_INIT="-fuse-ld=lld" \
|
||||
-DCMAKE_CXX_COMPILER_LAUNCHER=ccache \
|
||||
-DENABLE_SETCAP=OFF \
|
||||
-DDISABLE_ADVANCE_SIMD=TRUE \
|
||||
$ADDITIONAL_CMAKE_ARGS
|
||||
|
||||
- name: Build PCSX2
|
||||
working-directory: build
|
||||
run: ../.github/workflows/scripts/linux/compile.sh
|
||||
run: |
|
||||
# Prepare the Cache
|
||||
ccache -p
|
||||
ccache -z
|
||||
# Build
|
||||
ninja
|
||||
# Save the Cache
|
||||
ccache -s
|
||||
|
||||
- name: Run Tests
|
||||
working-directory: ./build
|
||||
@@ -134,7 +179,7 @@ jobs:
|
||||
|
||||
- name: Upload artifact
|
||||
if: inputs.buildAppImage == true
|
||||
uses: actions/upload-artifact@v3
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: ${{ steps.artifact-metadata.outputs.artifact-name }}
|
||||
path: ci-artifacts
|
||||
|
||||
46
.github/workflows/macos_build.yml
vendored
46
.github/workflows/macos_build.yml
vendored
@@ -6,10 +6,13 @@ on:
|
||||
jobName:
|
||||
required: true
|
||||
type: string
|
||||
artifactPrefixName:
|
||||
required: true
|
||||
type: string
|
||||
os:
|
||||
required: false
|
||||
type: string
|
||||
default: macos-13
|
||||
default: macos-14
|
||||
patchesUrl:
|
||||
required: false
|
||||
type: string
|
||||
@@ -18,6 +21,10 @@ on:
|
||||
required: false
|
||||
type: boolean
|
||||
default: false
|
||||
stableBuild:
|
||||
required: false
|
||||
type: boolean
|
||||
default: false
|
||||
|
||||
jobs:
|
||||
build_macos:
|
||||
@@ -35,7 +42,7 @@ jobs:
|
||||
|
||||
steps:
|
||||
- name: Checkout Repository
|
||||
uses: actions/checkout@v3
|
||||
uses: actions/checkout@v4
|
||||
with:
|
||||
submodules: recursive
|
||||
|
||||
@@ -44,14 +51,21 @@ jobs:
|
||||
if: ${{ inputs.fetchTags }}
|
||||
run: git fetch --tags --no-recurse-submodules
|
||||
|
||||
- name: Use Xcode 14.3.1
|
||||
run: sudo xcode-select -s /Applications/Xcode_14.3.1.app
|
||||
- name: Add stable release identifier file
|
||||
if: ${{ inputs.stableBuild == true || inputs.stableBuild == 'true' }}
|
||||
shell: bash
|
||||
run: |
|
||||
echo "#define DEFAULT_UPDATER_CHANNEL \"stable\"" > ./pcsx2-qt/DefaultUpdaterChannel.h
|
||||
cat ./pcsx2-qt/DefaultUpdaterChannel.h
|
||||
|
||||
- name: Use Xcode 15.2
|
||||
run: sudo xcode-select -s /Applications/Xcode_15.2.app
|
||||
|
||||
- name: Prepare Artifact Metadata
|
||||
id: artifact-metadata
|
||||
shell: bash
|
||||
env:
|
||||
OS: macos
|
||||
PREFIX: ${{ inputs.artifactPrefixName }}
|
||||
EVENT_NAME: ${{ github.event_name }}
|
||||
PR_TITLE: ${{ github.event.pull_request.title }}
|
||||
PR_NUM: ${{ github.event.pull_request.number }}
|
||||
@@ -60,28 +74,25 @@ jobs:
|
||||
|
||||
- name: Install Packages
|
||||
env:
|
||||
PLATFORM: "x64"
|
||||
HOMEBREW_NO_INSTALL_CLEANUP: 1
|
||||
HOMEBREW_NO_ANALYTICS: 1
|
||||
run: |
|
||||
brew unlink libjpeg || true # Conflicts with our self-built dependencies
|
||||
brew unlink libpng || true
|
||||
# Unlike other packages, brew's MoltenVK build uses MoltenVK's minimum macOS version of 10.13 so we can use it
|
||||
if ! brew install molten-vk ccache nasm; then
|
||||
if ! brew install ccache nasm; then
|
||||
brew update
|
||||
brew install molten-vk ccache nasm
|
||||
brew install ccache nasm
|
||||
fi
|
||||
|
||||
- name: Cache Dependencies
|
||||
id: cache-deps
|
||||
uses: actions/cache@v3
|
||||
uses: actions/cache@v4
|
||||
with:
|
||||
path: ~/deps
|
||||
key: ${{ inputs.os }} deps ${{ hashFiles('.github/workflows/scripts/macos/build-dependencies.sh') }}
|
||||
|
||||
- name: Build Dependencies
|
||||
if: steps.cache-deps.outputs.cache-hit != 'true'
|
||||
run: .github/workflows/scripts/macos/build-dependencies.sh
|
||||
run: |
|
||||
.github/workflows/scripts/macos/build-dependencies.sh "$HOME/deps"
|
||||
|
||||
- name: Download patches
|
||||
run: |
|
||||
@@ -94,7 +105,7 @@ jobs:
|
||||
run: echo "timestamp=$(date -u "+%Y-%m-%d-%H;%M;%S")" >> $GITHUB_OUTPUT
|
||||
|
||||
- name: Cache ccache cache
|
||||
uses: actions/cache@v3
|
||||
uses: actions/cache@v4
|
||||
with:
|
||||
path: .ccache
|
||||
key: ${{ inputs.os }} ccache ${{ steps.ccache_cache_timestamp.outputs.timestamp }}
|
||||
@@ -104,11 +115,9 @@ jobs:
|
||||
run: |
|
||||
cmake -DCMAKE_PREFIX_PATH="$HOME/deps" \
|
||||
-DCMAKE_BUILD_TYPE=Release \
|
||||
-DUSE_OPENGL=OFF \
|
||||
-DCMAKE_OSX_ARCHITECTURES="x86_64" \
|
||||
-DDISABLE_ADVANCE_SIMD=ON \
|
||||
-DCMAKE_INTERPROCEDURAL_OPTIMIZATION=ON \
|
||||
-DUSE_SYSTEM_LIBS=OFF \
|
||||
-DUSE_SYSTEM_SDL2=ON \
|
||||
-DUSE_LINKED_FFMPEG=ON \
|
||||
-DCMAKE_C_COMPILER_LAUNCHER=ccache \
|
||||
-DCMAKE_CXX_COMPILER_LAUNCHER=ccache \
|
||||
@@ -137,7 +146,6 @@ jobs:
|
||||
|
||||
- name: Prepare Build Artifacts
|
||||
run: |
|
||||
cp /usr/local/lib/libMoltenVK.dylib build/pcsx2*/PCSX2.app/Contents/Frameworks/
|
||||
TAG="$(git tag --points-at HEAD)"
|
||||
if [ -z "$TAG" ]; then
|
||||
APPNAME="${{ steps.artifact-metadata.outputs.artifact-name }}"
|
||||
@@ -150,7 +158,7 @@ jobs:
|
||||
cp "${{ steps.artifact-metadata.outputs.artifact-name }}.tar.xz" ci-artifacts/macOS.tar.xz
|
||||
|
||||
- name: Upload Artifact
|
||||
uses: actions/upload-artifact@v3
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: ${{ steps.artifact-metadata.outputs.artifact-name }}
|
||||
path: "*.tar.xz"
|
||||
|
||||
1
.github/workflows/macos_build_matrix.yml
vendored
1
.github/workflows/macos_build_matrix.yml
vendored
@@ -15,4 +15,5 @@ jobs:
|
||||
uses: ./.github/workflows/macos_build.yml
|
||||
with:
|
||||
jobName: "MacOS Build"
|
||||
artifactPrefixName: "PCSX2-macos-Qt"
|
||||
secrets: inherit
|
||||
|
||||
24
.github/workflows/release_announce.yml
vendored
24
.github/workflows/release_announce.yml
vendored
@@ -1,24 +0,0 @@
|
||||
name: 📢 Announce Release
|
||||
|
||||
on:
|
||||
release:
|
||||
types: [published]
|
||||
|
||||
jobs:
|
||||
announce:
|
||||
if: github.repository == 'PCSX2/pcsx2'
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
|
||||
- uses: actions/setup-node@v3
|
||||
with:
|
||||
node-version: 16
|
||||
|
||||
- name: Announce Release
|
||||
env:
|
||||
DISCORD_BUILD_WEBHOOK: ${{ secrets.DISCORD_BUILD_WEBHOOK }}
|
||||
run: |
|
||||
cd ./.github/workflows/scripts/releases/announce-release
|
||||
npm ci
|
||||
node index.js
|
||||
88
.github/workflows/release_cut_new.yml
vendored
88
.github/workflows/release_cut_new.yml
vendored
@@ -10,16 +10,19 @@ on:
|
||||
push:
|
||||
branches:
|
||||
- master
|
||||
# TODO - future work
|
||||
# workflow_dispatch:
|
||||
# inputs:
|
||||
# isStable:
|
||||
# description: 'Should it be a stable release?'
|
||||
# required: true
|
||||
# default: 'false'
|
||||
# versionTag:
|
||||
# description: 'The version to tag with'
|
||||
# required: true
|
||||
workflow_dispatch:
|
||||
inputs:
|
||||
is_prelease:
|
||||
description: 'Should be a pre-release?'
|
||||
required: true
|
||||
default: 'true'
|
||||
type: choice
|
||||
options:
|
||||
- 'true'
|
||||
- 'false'
|
||||
tag_value:
|
||||
description: 'Create a new release from latest master with the given tag, if this is left blank it will bump the patch version. You dont need to include the "v" prefix'
|
||||
required: false
|
||||
|
||||
permissions:
|
||||
contents: write
|
||||
@@ -27,19 +30,23 @@ permissions:
|
||||
jobs:
|
||||
cut-release:
|
||||
if: github.repository == 'PCSX2/pcsx2'
|
||||
runs-on: ubuntu-latest
|
||||
name: "Create Tag and Release"
|
||||
runs-on: ubuntu-latest
|
||||
outputs:
|
||||
new_tag: ${{ steps.tag_version.outputs.new_tag }}
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
- uses: actions/checkout@v4
|
||||
|
||||
# Docs - https://github.com/mathieudutour/github-tag-action
|
||||
- name: Bump Version and Push Tag
|
||||
id: tag_version
|
||||
uses: mathieudutour/github-tag-action@v6.1
|
||||
uses: mathieudutour/github-tag-action@v6.2
|
||||
with:
|
||||
github_token: ${{ github.token }}
|
||||
tag_prefix: v
|
||||
default_bump: patch
|
||||
# if set, it will overwrite the bump settings
|
||||
custom_tag: ${{ github.event.inputs.tag_value == '' && null || github.event.inputs.tag_value }}
|
||||
|
||||
# TODO - we could do this and remove the node.js script, but auto-generated notes only work
|
||||
# with PRs -- not commits (determine how much we care).
|
||||
@@ -60,9 +67,18 @@ jobs:
|
||||
node index.js
|
||||
mv ./release-notes.md ${GITHUB_WORKSPACE}/release-notes.md
|
||||
|
||||
- name: Create a GitHub Release
|
||||
uses: softprops/action-gh-release@v1
|
||||
if: steps.tag_version.outputs.new_tag
|
||||
- name: Create a GitHub Release (Manual)
|
||||
uses: softprops/action-gh-release@v2
|
||||
if: steps.tag_version.outputs.new_tag && github.event_name == 'workflow_dispatch'
|
||||
with:
|
||||
body_path: ./release-notes.md
|
||||
draft: true
|
||||
prerelease: ${{ github.event_name != 'workflow_dispatch' || inputs.is_prelease == 'true' }}
|
||||
tag_name: ${{ steps.tag_version.outputs.new_tag }}
|
||||
|
||||
- name: Create a GitHub Release (Push)
|
||||
uses: softprops/action-gh-release@v2
|
||||
if: steps.tag_version.outputs.new_tag && github.event_name != 'workflow_dispatch'
|
||||
with:
|
||||
body_path: ./release-notes.md
|
||||
draft: true
|
||||
@@ -79,10 +95,12 @@ jobs:
|
||||
uses: ./.github/workflows/linux_build_qt.yml
|
||||
with:
|
||||
jobName: "AppImage Build"
|
||||
artifactPrefixName: "PCSX2-linux-Qt-x64-appimage"
|
||||
compiler: clang
|
||||
cmakeflags: ""
|
||||
buildAppImage: true
|
||||
fetchTags: true
|
||||
stableBuild: ${{ github.event_name == 'workflow_dispatch' && inputs.is_prelease == 'false' }}
|
||||
secrets: inherit
|
||||
|
||||
build_linux_flatpak:
|
||||
@@ -93,11 +111,13 @@ jobs:
|
||||
uses: ./.github/workflows/linux_build_flatpak.yml
|
||||
with:
|
||||
jobName: "Flatpak Build"
|
||||
artifactPrefixName: "PCSX2-linux-Qt-x64-flatpak"
|
||||
compiler: clang
|
||||
cmakeflags: ""
|
||||
branch: "stable"
|
||||
publish: false
|
||||
fetchTags: true
|
||||
stableBuild: ${{ github.event_name == 'workflow_dispatch' && inputs.is_prelease == 'false' }}
|
||||
secrets: inherit
|
||||
|
||||
# Windows
|
||||
@@ -109,10 +129,12 @@ jobs:
|
||||
uses: ./.github/workflows/windows_build_qt.yml
|
||||
with:
|
||||
jobName: "Windows Build"
|
||||
artifactPrefixName: "PCSX2-windows-Qt-x64"
|
||||
configuration: CMake
|
||||
buildSystem: cmake
|
||||
cmakeFlags: -DCMAKE_C_COMPILER=clang-cl -DCMAKE_CXX_COMPILER=clang-cl
|
||||
fetchTags: true
|
||||
stableBuild: ${{ github.event_name == 'workflow_dispatch' && inputs.is_prelease == 'false' }}
|
||||
secrets: inherit
|
||||
|
||||
# MacOS
|
||||
@@ -124,13 +146,16 @@ jobs:
|
||||
uses: ./.github/workflows/macos_build.yml
|
||||
with:
|
||||
jobName: "MacOS Build"
|
||||
artifactPrefixName: "PCSX2-macos-Qt"
|
||||
fetchTags: true
|
||||
stableBuild: ${{ github.event_name == 'workflow_dispatch' && inputs.is_prelease == 'false' }}
|
||||
secrets: inherit
|
||||
|
||||
# Upload the Artifacts
|
||||
upload_artifacts:
|
||||
if: github.repository == 'PCSX2/pcsx2'
|
||||
needs:
|
||||
- cut-release
|
||||
- build_linux_flatpak
|
||||
- build_linux_qt
|
||||
- build_windows_qt
|
||||
@@ -138,16 +163,12 @@ jobs:
|
||||
name: "Upload Artifacts"
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
|
||||
# actions/checkout elides tags, fetch them primarily for releases
|
||||
- name: Fetch Tags
|
||||
run: git fetch --tags --no-recurse-submodules
|
||||
- uses: actions/checkout@v4
|
||||
|
||||
- name: Prepare Artifact Folder
|
||||
run: mkdir ./ci-artifacts/
|
||||
|
||||
- uses: actions/download-artifact@v3
|
||||
- uses: actions/download-artifact@v4
|
||||
name: Download all Artifacts
|
||||
with:
|
||||
path: ./ci-artifacts/
|
||||
@@ -160,16 +181,13 @@ jobs:
|
||||
working-directory: ./ci-artifacts/
|
||||
run: for d in *windows*/; do 7z a "${d}asset.7z" ./$d/*; done
|
||||
|
||||
# Artifact Naming:
|
||||
# MacOS: PCSX2-<tag>-macOS-[additional hyphen seperated tags]
|
||||
# Windows|Linux: PCSX2-<tag>-<windows|linux>-<32bit|64bit>--[additional hyphen seperated tags]
|
||||
- name: Name and Upload the Release Assets
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ github.token }}
|
||||
SCAN_DIR: ${{ github.WORKSPACE }}/ci-artifacts
|
||||
OUT_DIR: ${{ github.WORKSPACE }}/ci-artifacts/out
|
||||
run: |
|
||||
TAG_VAL=$(git tag --points-at HEAD)
|
||||
TAG_VAL=${{needs.cut-release.outputs.new_tag}}
|
||||
echo "TAG_VAL=${TAG_VAL}"
|
||||
gh release list --repo PCSX2/pcsx2
|
||||
mkdir -p ${{ github.WORKSPACE }}/ci-artifacts/out
|
||||
@@ -181,6 +199,22 @@ jobs:
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ github.token }}
|
||||
run: |
|
||||
TAG_VAL=$(git tag --points-at HEAD)
|
||||
TAG_VAL=${{needs.cut-release.outputs.new_tag}}
|
||||
echo "TAG_VAL=${TAG_VAL}"
|
||||
gh release edit ${TAG_VAL} --draft=false --repo PCSX2/pcsx2
|
||||
|
||||
- uses: actions/setup-node@v4
|
||||
with:
|
||||
node-version: 16
|
||||
|
||||
- name: Announce Release
|
||||
env:
|
||||
OWNER: PCSX2
|
||||
REPO: pcsx2
|
||||
DISCORD_BUILD_WEBHOOK: ${{ secrets.DISCORD_BUILD_WEBHOOK }}
|
||||
GITHUB_TOKEN: ${{ github.token }}
|
||||
run: |
|
||||
TAG_VAL=${{needs.cut-release.outputs.new_tag}}
|
||||
cd ./.github/workflows/scripts/releases/announce-release
|
||||
npm ci
|
||||
TAG_VAL=${TAG_VAL} node index.js
|
||||
|
||||
@@ -1,39 +1,26 @@
|
||||
#!/bin/bash
|
||||
|
||||
# Artifact Naming Scheme:
|
||||
# PCSX2-<OS>-Qt-[ARCH]-[SIMD]-[pr\[PR_NUM\]]-[title|sha\[SHA|PR_TITLE\]
|
||||
# PCSX2-<OS>-Qt-[BUILD_SYSTEM]-[ARCH]-[SIMD]-[pr\[PR_NUM\]]-[title|sha\[SHA|PR_TITLE\]
|
||||
# -- limited to 200 chars
|
||||
# Outputs:
|
||||
# - artifact-name
|
||||
|
||||
# Example - PCSX2-linux-Qt-x64-flatpak-sse4-sha[e880a2749]
|
||||
|
||||
# Inputs as env-vars
|
||||
# OS
|
||||
# BUILD_SYSTEM
|
||||
# ARCH
|
||||
# SIMD
|
||||
# PREFIX
|
||||
# EVENT_NAME
|
||||
# PR_TITLE
|
||||
# PR_NUM
|
||||
# PR_SHA
|
||||
|
||||
NAME=""
|
||||
|
||||
if [ "${OS}" == "macos" ]; then
|
||||
# MacOS has combined binaries for x64 and ARM64.
|
||||
NAME="PCSX2-${OS}-Qt"
|
||||
elif [[ ("${OS}" == "windows" && "$BUILD_SYSTEM" != "cmake") ]]; then
|
||||
NAME="PCSX2-${OS}-Qt-${ARCH}-${SIMD}"
|
||||
else
|
||||
NAME="PCSX2-${OS}-Qt-${ARCH}"
|
||||
if [[ -z "${PREFIX}" ]]; then
|
||||
echo "PREFIX is not set, can't name artifact without it!"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# Add cmake if used to differentate it from msbuild builds
|
||||
# Else the two artifacts will have the same name and the files will be merged
|
||||
if [[ ! -z "${BUILD_SYSTEM}" ]]; then
|
||||
if [[ "${BUILD_SYSTEM}" == "cmake" ]] || [[ "${BUILD_SYSTEM}" == "flatpak" ]]; then
|
||||
NAME="${NAME}-${BUILD_SYSTEM}"
|
||||
fi
|
||||
fi
|
||||
NAME="${PREFIX}"
|
||||
|
||||
# Add PR / Commit Metadata
|
||||
if [ "$EVENT_NAME" == "pull_request" ]; then
|
||||
|
||||
577
.github/workflows/scripts/common/shaderc-changes.patch
vendored
Normal file
577
.github/workflows/scripts/common/shaderc-changes.patch
vendored
Normal file
@@ -0,0 +1,577 @@
|
||||
diff --git a/CHANGES b/CHANGES
|
||||
index 5d3dd16..587b612 100644
|
||||
--- a/CHANGES
|
||||
+++ b/CHANGES
|
||||
@@ -4,7 +4,7 @@ v2024.1
|
||||
- Update dependencies
|
||||
- Propagate test/install options to Glslang
|
||||
|
||||
-v2024.0
|
||||
+v2024.0 2024-03-09
|
||||
- Update dependencies
|
||||
- Utilities:
|
||||
- Use Python3 explicitly in utility scripts
|
||||
diff --git a/CMakeLists.txt b/CMakeLists.txt
|
||||
index ffcb54b..7c1a6d8 100644
|
||||
--- a/CMakeLists.txt
|
||||
+++ b/CMakeLists.txt
|
||||
@@ -117,6 +117,9 @@ if(MSVC)
|
||||
endif()
|
||||
endif(MSVC)
|
||||
|
||||
+if(NOT WIN32)
|
||||
+ add_definitions("-fvisibility=hidden")
|
||||
+endif()
|
||||
|
||||
# Configure subdirectories.
|
||||
# We depend on these for later projects, so they should come first.
|
||||
@@ -124,7 +127,6 @@ add_subdirectory(third_party)
|
||||
|
||||
add_subdirectory(libshaderc_util)
|
||||
add_subdirectory(libshaderc)
|
||||
-add_subdirectory(glslc)
|
||||
if(${SHADERC_ENABLE_EXAMPLES})
|
||||
add_subdirectory(examples)
|
||||
endif()
|
||||
@@ -158,5 +160,3 @@ function(define_pkg_config_file NAME LIBS)
|
||||
endfunction()
|
||||
|
||||
define_pkg_config_file(shaderc -lshaderc_shared)
|
||||
-define_pkg_config_file(shaderc_static "-lshaderc ${EXTRA_STATIC_PKGCONFIG_LIBS} -lshaderc_util")
|
||||
-define_pkg_config_file(shaderc_combined -lshaderc_combined)
|
||||
diff --git a/libshaderc/CMakeLists.txt b/libshaderc/CMakeLists.txt
|
||||
index df9a88d..b15e5d7 100644
|
||||
--- a/libshaderc/CMakeLists.txt
|
||||
+++ b/libshaderc/CMakeLists.txt
|
||||
@@ -24,13 +24,6 @@ set(SHADERC_SOURCES
|
||||
src/shaderc_private.h
|
||||
)
|
||||
|
||||
-add_library(shaderc STATIC ${SHADERC_SOURCES})
|
||||
-shaderc_default_compile_options(shaderc)
|
||||
-target_include_directories(shaderc
|
||||
- PUBLIC include
|
||||
- PRIVATE ${glslang_SOURCE_DIR}
|
||||
- ${SPIRV-Headers_SOURCE_DIR}/include)
|
||||
-
|
||||
add_library(shaderc_shared SHARED ${SHADERC_SOURCES})
|
||||
shaderc_default_compile_options(shaderc_shared)
|
||||
target_include_directories(shaderc_shared
|
||||
@@ -54,7 +47,7 @@ if(SHADERC_ENABLE_INSTALL)
|
||||
DESTINATION
|
||||
${CMAKE_INSTALL_INCLUDEDIR}/shaderc)
|
||||
|
||||
- install(TARGETS shaderc shaderc_shared
|
||||
+ install(TARGETS shaderc_shared
|
||||
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
|
||||
RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
|
||||
BUNDLE DESTINATION ${CMAKE_INSTALL_BINDIR}
|
||||
@@ -69,20 +62,8 @@ set(SHADERC_LIBS
|
||||
SPIRV-Tools
|
||||
)
|
||||
|
||||
-target_link_libraries(shaderc PRIVATE ${SHADERC_LIBS})
|
||||
target_link_libraries(shaderc_shared PRIVATE ${SHADERC_LIBS})
|
||||
|
||||
-shaderc_add_tests(
|
||||
- TEST_PREFIX shaderc
|
||||
- LINK_LIBS shaderc
|
||||
- INCLUDE_DIRS include ${shaderc_SOURCE_DIR}/libshaderc_util/include ${glslang_SOURCE_DIR}
|
||||
- ${spirv-tools_SOURCE_DIR}/include
|
||||
- ${SPIRV-Headers_SOURCE_DIR}/include
|
||||
- TEST_NAMES
|
||||
- shaderc
|
||||
- shaderc_cpp
|
||||
- shaderc_private)
|
||||
-
|
||||
shaderc_add_tests(
|
||||
TEST_PREFIX shaderc_shared
|
||||
LINK_LIBS shaderc_shared SPIRV-Tools
|
||||
@@ -94,22 +75,6 @@ shaderc_add_tests(
|
||||
shaderc_cpp
|
||||
shaderc_private)
|
||||
|
||||
-shaderc_combine_static_lib(shaderc_combined shaderc)
|
||||
-
|
||||
-if(SHADERC_ENABLE_INSTALL)
|
||||
- install(TARGETS shaderc_combined DESTINATION ${CMAKE_INSTALL_LIBDIR})
|
||||
-endif(SHADERC_ENABLE_INSTALL)
|
||||
-
|
||||
-shaderc_add_tests(
|
||||
- TEST_PREFIX shaderc_combined
|
||||
- LINK_LIBS shaderc_combined ${CMAKE_THREAD_LIBS_INIT}
|
||||
- INCLUDE_DIRS include ${shaderc_SOURCE_DIR}/libshaderc_util/include ${glslang_SOURCE_DIR}
|
||||
- ${spirv-tools_SOURCE_DIR}/include
|
||||
- ${SPIRV-Headers_SOURCE_DIR}/include
|
||||
- TEST_NAMES
|
||||
- shaderc
|
||||
- shaderc_cpp)
|
||||
-
|
||||
if(${SHADERC_ENABLE_TESTS})
|
||||
add_executable(shaderc_c_smoke_test ./src/shaderc_c_smoke_test.c)
|
||||
shaderc_default_c_compile_options(shaderc_c_smoke_test)
|
||||
diff --git a/libshaderc/include/shaderc/shaderc.h b/libshaderc/include/shaderc/shaderc.h
|
||||
index 3a3e97d..65d5b77 100644
|
||||
--- a/libshaderc/include/shaderc/shaderc.h
|
||||
+++ b/libshaderc/include/shaderc/shaderc.h
|
||||
@@ -317,7 +317,7 @@ SHADERC_EXPORT void shaderc_compile_options_set_source_language(
|
||||
|
||||
// Sets the compiler mode to generate debug information in the output.
|
||||
SHADERC_EXPORT void shaderc_compile_options_set_generate_debug_info(
|
||||
- shaderc_compile_options_t options);
|
||||
+ shaderc_compile_options_t options, bool enabled, bool enable_non_semantic);
|
||||
|
||||
// Sets the compiler optimization level to the given level. Only the last one
|
||||
// takes effect if multiple calls of this function exist.
|
||||
@@ -506,6 +506,10 @@ SHADERC_EXPORT void shaderc_compile_options_set_invert_y(
|
||||
SHADERC_EXPORT void shaderc_compile_options_set_nan_clamp(
|
||||
shaderc_compile_options_t options, bool enable);
|
||||
|
||||
+// Returns a string representation of the specified compilation status.
|
||||
+SHADERC_EXPORT const char* shaderc_compilation_status_to_string(
|
||||
+ shaderc_compilation_status status);
|
||||
+
|
||||
// An opaque handle to the results of a call to any shaderc_compile_into_*()
|
||||
// function.
|
||||
typedef struct shaderc_compilation_result* shaderc_compilation_result_t;
|
||||
@@ -529,28 +533,31 @@ typedef struct shaderc_compilation_result* shaderc_compilation_result_t;
|
||||
// present. May be safely called from multiple threads without explicit
|
||||
// synchronization. If there was failure in allocating the compiler object,
|
||||
// null will be returned.
|
||||
-SHADERC_EXPORT shaderc_compilation_result_t shaderc_compile_into_spv(
|
||||
+SHADERC_EXPORT shaderc_compilation_status shaderc_compile_into_spv(
|
||||
const shaderc_compiler_t compiler, const char* source_text,
|
||||
size_t source_text_size, shaderc_shader_kind shader_kind,
|
||||
const char* input_file_name, const char* entry_point_name,
|
||||
- const shaderc_compile_options_t additional_options);
|
||||
+ const shaderc_compile_options_t additional_options,
|
||||
+ shaderc_compilation_result_t* result);
|
||||
|
||||
// Like shaderc_compile_into_spv, but the result contains SPIR-V assembly text
|
||||
// instead of a SPIR-V binary module. The SPIR-V assembly syntax is as defined
|
||||
// by the SPIRV-Tools open source project.
|
||||
-SHADERC_EXPORT shaderc_compilation_result_t shaderc_compile_into_spv_assembly(
|
||||
+SHADERC_EXPORT shaderc_compilation_status shaderc_compile_into_spv_assembly(
|
||||
const shaderc_compiler_t compiler, const char* source_text,
|
||||
size_t source_text_size, shaderc_shader_kind shader_kind,
|
||||
const char* input_file_name, const char* entry_point_name,
|
||||
- const shaderc_compile_options_t additional_options);
|
||||
+ const shaderc_compile_options_t additional_options,
|
||||
+ shaderc_compilation_result_t* result);
|
||||
|
||||
// Like shaderc_compile_into_spv, but the result contains preprocessed source
|
||||
// code instead of a SPIR-V binary module
|
||||
-SHADERC_EXPORT shaderc_compilation_result_t shaderc_compile_into_preprocessed_text(
|
||||
+SHADERC_EXPORT shaderc_compilation_status shaderc_compile_into_preprocessed_text(
|
||||
const shaderc_compiler_t compiler, const char* source_text,
|
||||
size_t source_text_size, shaderc_shader_kind shader_kind,
|
||||
const char* input_file_name, const char* entry_point_name,
|
||||
- const shaderc_compile_options_t additional_options);
|
||||
+ const shaderc_compile_options_t additional_options,
|
||||
+ shaderc_compilation_result_t* result);
|
||||
|
||||
// Takes an assembly string of the format defined in the SPIRV-Tools project
|
||||
// (https://github.com/KhronosGroup/SPIRV-Tools/blob/master/syntax.md),
|
||||
@@ -561,10 +568,11 @@ SHADERC_EXPORT shaderc_compilation_result_t shaderc_compile_into_preprocessed_te
|
||||
// May be safely called from multiple threads without explicit synchronization.
|
||||
// If there was failure in allocating the compiler object, null will be
|
||||
// returned.
|
||||
-SHADERC_EXPORT shaderc_compilation_result_t shaderc_assemble_into_spv(
|
||||
+SHADERC_EXPORT shaderc_compilation_status shaderc_assemble_into_spv(
|
||||
const shaderc_compiler_t compiler, const char* source_assembly,
|
||||
size_t source_assembly_size,
|
||||
- const shaderc_compile_options_t additional_options);
|
||||
+ const shaderc_compile_options_t additional_options,
|
||||
+ shaderc_compilation_result_t* result);
|
||||
|
||||
// The following functions, operating on shaderc_compilation_result_t objects,
|
||||
// offer only the basic thread-safety guarantee.
|
||||
diff --git a/libshaderc/include/shaderc/shaderc.hpp b/libshaderc/include/shaderc/shaderc.hpp
|
||||
index 3817af8..5592b49 100644
|
||||
--- a/libshaderc/include/shaderc/shaderc.hpp
|
||||
+++ b/libshaderc/include/shaderc/shaderc.hpp
|
||||
@@ -168,8 +168,9 @@ class CompileOptions {
|
||||
}
|
||||
|
||||
// Sets the compiler mode to generate debug information in the output.
|
||||
- void SetGenerateDebugInfo() {
|
||||
- shaderc_compile_options_set_generate_debug_info(options_);
|
||||
+ void SetGenerateDebugInfo(bool enabled, bool non_semantic_debug_info) {
|
||||
+ shaderc_compile_options_set_generate_debug_info(options_, enabled,
|
||||
+ non_sematic_debug_info);
|
||||
}
|
||||
|
||||
// Sets the compiler optimization level to the given level. Only the last one
|
||||
@@ -425,9 +426,10 @@ class Compiler {
|
||||
const char* input_file_name,
|
||||
const char* entry_point_name,
|
||||
const CompileOptions& options) const {
|
||||
- shaderc_compilation_result_t compilation_result = shaderc_compile_into_spv(
|
||||
+ shaderc_compilation_result_t compilation_result = nullptr;
|
||||
+ shaderc_compile_into_spv(
|
||||
compiler_, source_text, source_text_size, shader_kind, input_file_name,
|
||||
- entry_point_name, options.options_);
|
||||
+ entry_point_name, options.options_, &compilation_result);
|
||||
return SpvCompilationResult(compilation_result);
|
||||
}
|
||||
|
||||
@@ -451,9 +453,10 @@ class Compiler {
|
||||
size_t source_text_size,
|
||||
shaderc_shader_kind shader_kind,
|
||||
const char* input_file_name) const {
|
||||
- shaderc_compilation_result_t compilation_result =
|
||||
- shaderc_compile_into_spv(compiler_, source_text, source_text_size,
|
||||
- shader_kind, input_file_name, "main", nullptr);
|
||||
+ shaderc_compilation_result_t compilation_result = nullptr;
|
||||
+ shaderc_compile_into_spv(compiler_, source_text, source_text_size,
|
||||
+ shader_kind, input_file_name, "main", nullptr,
|
||||
+ &compilation_result);
|
||||
return SpvCompilationResult(compilation_result);
|
||||
}
|
||||
|
||||
@@ -504,8 +507,11 @@ class Compiler {
|
||||
SpvCompilationResult AssembleToSpv(const char* source_assembly,
|
||||
size_t source_assembly_size,
|
||||
const CompileOptions& options) const {
|
||||
- return SpvCompilationResult(shaderc_assemble_into_spv(
|
||||
- compiler_, source_assembly, source_assembly_size, options.options_));
|
||||
+ shaderc_compilation_result_t compilation_result = nullptr;
|
||||
+ shaderc_assemble_into_spv(
|
||||
+ compiler_, source_assembly, source_assembly_size, options.options_,
|
||||
+ &compilation_result);
|
||||
+ return SpvCompilationResult(compilation_result);
|
||||
}
|
||||
|
||||
// Assembles the given SPIR-V assembly and returns a SPIR-V binary module
|
||||
@@ -513,8 +519,11 @@ class Compiler {
|
||||
// Like the first AssembleToSpv method but uses the default compiler options.
|
||||
SpvCompilationResult AssembleToSpv(const char* source_assembly,
|
||||
size_t source_assembly_size) const {
|
||||
- return SpvCompilationResult(shaderc_assemble_into_spv(
|
||||
- compiler_, source_assembly, source_assembly_size, nullptr));
|
||||
+ shaderc_compilation_result_t compilation_result = nullptr;
|
||||
+ shaderc_assemble_into_spv(
|
||||
+ compiler_, source_assembly, source_assembly_size, nullptr,
|
||||
+ &compilation_result);
|
||||
+ return SpvCompilationResult(compilation_result);
|
||||
}
|
||||
|
||||
// Assembles the given SPIR-V assembly and returns a SPIR-V binary module
|
||||
@@ -523,9 +532,11 @@ class Compiler {
|
||||
// std::string.
|
||||
SpvCompilationResult AssembleToSpv(const std::string& source_assembly,
|
||||
const CompileOptions& options) const {
|
||||
- return SpvCompilationResult(
|
||||
- shaderc_assemble_into_spv(compiler_, source_assembly.data(),
|
||||
- source_assembly.size(), options.options_));
|
||||
+ shaderc_compilation_result_t compilation_result = nullptr;
|
||||
+ shaderc_assemble_into_spv(
|
||||
+ compiler_, source_assembly.data(), source_assembly.size(),
|
||||
+ options.options_, &compilation_result);
|
||||
+ return SpvCompilationResult(compilation_result);
|
||||
}
|
||||
|
||||
// Assembles the given SPIR-V assembly and returns a SPIR-V binary module
|
||||
@@ -533,8 +544,10 @@ class Compiler {
|
||||
// Like the first AssembleToSpv method but the source is provided as a
|
||||
// std::string and also uses default compiler options.
|
||||
SpvCompilationResult AssembleToSpv(const std::string& source_assembly) const {
|
||||
- return SpvCompilationResult(shaderc_assemble_into_spv(
|
||||
- compiler_, source_assembly.data(), source_assembly.size(), nullptr));
|
||||
+ shaderc_compilation_result_t compilation_result = nullptr;
|
||||
+ shaderc_assemble_into_spv(compiler_, source_assembly.data(),
|
||||
+ source_assembly.size(), nullptr, &compilation_result);
|
||||
+ return SpvCompilationResult(compilation_result);
|
||||
}
|
||||
|
||||
// Compiles the given source GLSL and returns the SPIR-V assembly text
|
||||
@@ -544,10 +557,11 @@ class Compiler {
|
||||
const char* source_text, size_t source_text_size,
|
||||
shaderc_shader_kind shader_kind, const char* input_file_name,
|
||||
const char* entry_point_name, const CompileOptions& options) const {
|
||||
- shaderc_compilation_result_t compilation_result =
|
||||
- shaderc_compile_into_spv_assembly(
|
||||
- compiler_, source_text, source_text_size, shader_kind,
|
||||
- input_file_name, entry_point_name, options.options_);
|
||||
+ shaderc_compilation_result_t compilation_result = nullptr;
|
||||
+ shaderc_compile_into_spv_assembly(
|
||||
+ compiler_, source_text, source_text_size, shader_kind,
|
||||
+ input_file_name, entry_point_name, options.options_,
|
||||
+ &compilation_result);
|
||||
return AssemblyCompilationResult(compilation_result);
|
||||
}
|
||||
|
||||
@@ -592,10 +606,10 @@ class Compiler {
|
||||
const char* source_text, size_t source_text_size,
|
||||
shaderc_shader_kind shader_kind, const char* input_file_name,
|
||||
const CompileOptions& options) const {
|
||||
- shaderc_compilation_result_t compilation_result =
|
||||
- shaderc_compile_into_preprocessed_text(
|
||||
+ shaderc_compilation_result_t compilation_result;
|
||||
+ shaderc_compile_into_preprocessed_text(
|
||||
compiler_, source_text, source_text_size, shader_kind,
|
||||
- input_file_name, "main", options.options_);
|
||||
+ input_file_name, "main", options.options_, &compilation_result);
|
||||
return PreprocessedSourceCompilationResult(compilation_result);
|
||||
}
|
||||
|
||||
diff --git a/libshaderc/src/shaderc.cc b/libshaderc/src/shaderc.cc
|
||||
index 63f1bbc..c1a9b12 100644
|
||||
--- a/libshaderc/src/shaderc.cc
|
||||
+++ b/libshaderc/src/shaderc.cc
|
||||
@@ -418,8 +418,12 @@ void shaderc_compile_options_set_source_language(
|
||||
}
|
||||
|
||||
void shaderc_compile_options_set_generate_debug_info(
|
||||
- shaderc_compile_options_t options) {
|
||||
- options->compiler.SetGenerateDebugInfo();
|
||||
+ shaderc_compile_options_t options, bool enabled, bool enable_non_semantic) {
|
||||
+ if (enabled) {
|
||||
+ options->compiler.SetGenerateDebugInfo();
|
||||
+ if (enable_non_semantic)
|
||||
+ options->compiler.SetEmitNonSemanticDebugInfo();
|
||||
+ }
|
||||
}
|
||||
|
||||
void shaderc_compile_options_set_optimization_level(
|
||||
@@ -591,8 +595,31 @@ void shaderc_compiler_release(shaderc_compiler_t compiler) {
|
||||
delete compiler;
|
||||
}
|
||||
|
||||
+const char* shaderc_compilation_status_to_string(shaderc_compilation_status status)
|
||||
+{
|
||||
+ static constexpr const std::pair<shaderc_compilation_status, const char*> status_names[] = {
|
||||
+ {shaderc_compilation_status_success, "shaderc_compilation_status_success"},
|
||||
+ {shaderc_compilation_status_invalid_stage, "shaderc_compilation_status_invalid_stage"},
|
||||
+ {shaderc_compilation_status_compilation_error, "shaderc_compilation_status_compilation_error"},
|
||||
+ {shaderc_compilation_status_internal_error, "shaderc_compilation_status_internal_error"},
|
||||
+ {shaderc_compilation_status_null_result_object, "shaderc_compilation_status_null_result_object"},
|
||||
+ {shaderc_compilation_status_invalid_assembly, "shaderc_compilation_status_invalid_assembly"},
|
||||
+ {shaderc_compilation_status_validation_error, "shaderc_compilation_status_validation_error"},
|
||||
+ {shaderc_compilation_status_transformation_error, "shaderc_compilation_status_transformation_error"},
|
||||
+ {shaderc_compilation_status_configuration_error, "shaderc_compilation_status_configuration_error"},
|
||||
+ };
|
||||
+
|
||||
+ for (const auto& it : status_names)
|
||||
+ {
|
||||
+ if (status == it.first)
|
||||
+ return it.second;
|
||||
+ }
|
||||
+
|
||||
+ return "shaderc_compilation_status_unknown";
|
||||
+}
|
||||
+
|
||||
namespace {
|
||||
-shaderc_compilation_result_t CompileToSpecifiedOutputType(
|
||||
+shaderc_compilation_result_vector* CompileToSpecifiedOutputType(
|
||||
const shaderc_compiler_t compiler, const char* source_text,
|
||||
size_t source_text_size, shaderc_shader_kind shader_kind,
|
||||
const char* input_file_name, const char* entry_point_name,
|
||||
@@ -669,48 +696,59 @@ shaderc_compilation_result_t CompileToSpecifiedOutputType(
|
||||
}
|
||||
} // anonymous namespace
|
||||
|
||||
-shaderc_compilation_result_t shaderc_compile_into_spv(
|
||||
+shaderc_compilation_status shaderc_compile_into_spv(
|
||||
const shaderc_compiler_t compiler, const char* source_text,
|
||||
size_t source_text_size, shaderc_shader_kind shader_kind,
|
||||
const char* input_file_name, const char* entry_point_name,
|
||||
- const shaderc_compile_options_t additional_options) {
|
||||
- return CompileToSpecifiedOutputType(
|
||||
+ const shaderc_compile_options_t additional_options,
|
||||
+ shaderc_compilation_result_t* result) {
|
||||
+ shaderc_compilation_result_vector* resultv = CompileToSpecifiedOutputType(
|
||||
compiler, source_text, source_text_size, shader_kind, input_file_name,
|
||||
entry_point_name, additional_options,
|
||||
shaderc_util::Compiler::OutputType::SpirvBinary);
|
||||
+ *result = resultv;
|
||||
+ return resultv ? resultv->compilation_status : shaderc_compilation_status_internal_error;
|
||||
}
|
||||
|
||||
-shaderc_compilation_result_t shaderc_compile_into_spv_assembly(
|
||||
+shaderc_compilation_status shaderc_compile_into_spv_assembly(
|
||||
const shaderc_compiler_t compiler, const char* source_text,
|
||||
size_t source_text_size, shaderc_shader_kind shader_kind,
|
||||
const char* input_file_name, const char* entry_point_name,
|
||||
- const shaderc_compile_options_t additional_options) {
|
||||
- return CompileToSpecifiedOutputType(
|
||||
+ const shaderc_compile_options_t additional_options,
|
||||
+ shaderc_compilation_result_t* result) {
|
||||
+ shaderc_compilation_result_vector* resultv = CompileToSpecifiedOutputType(
|
||||
compiler, source_text, source_text_size, shader_kind, input_file_name,
|
||||
entry_point_name, additional_options,
|
||||
shaderc_util::Compiler::OutputType::SpirvAssemblyText);
|
||||
+ *result = resultv;
|
||||
+ return resultv ? resultv->compilation_status : shaderc_compilation_status_internal_error;
|
||||
}
|
||||
|
||||
-shaderc_compilation_result_t shaderc_compile_into_preprocessed_text(
|
||||
+shaderc_compilation_status shaderc_compile_into_preprocessed_text(
|
||||
const shaderc_compiler_t compiler, const char* source_text,
|
||||
size_t source_text_size, shaderc_shader_kind shader_kind,
|
||||
const char* input_file_name, const char* entry_point_name,
|
||||
- const shaderc_compile_options_t additional_options) {
|
||||
- return CompileToSpecifiedOutputType(
|
||||
+ const shaderc_compile_options_t additional_options,
|
||||
+ shaderc_compilation_result_t* result) {
|
||||
+ shaderc_compilation_result_vector* resultv = CompileToSpecifiedOutputType(
|
||||
compiler, source_text, source_text_size, shader_kind, input_file_name,
|
||||
entry_point_name, additional_options,
|
||||
shaderc_util::Compiler::OutputType::PreprocessedText);
|
||||
+ *result = resultv;
|
||||
+ return resultv ? resultv->compilation_status : shaderc_compilation_status_internal_error;
|
||||
}
|
||||
|
||||
-shaderc_compilation_result_t shaderc_assemble_into_spv(
|
||||
+shaderc_compilation_status shaderc_assemble_into_spv(
|
||||
const shaderc_compiler_t compiler, const char* source_assembly,
|
||||
size_t source_assembly_size,
|
||||
- const shaderc_compile_options_t additional_options) {
|
||||
- auto* result = new (std::nothrow) shaderc_compilation_result_spv_binary;
|
||||
- if (!result) return nullptr;
|
||||
- result->compilation_status = shaderc_compilation_status_invalid_assembly;
|
||||
- if (!compiler->initializer) return result;
|
||||
- if (source_assembly == nullptr) return result;
|
||||
+ const shaderc_compile_options_t additional_options,
|
||||
+ shaderc_compilation_result_t* result) {
|
||||
+ auto* bresult = new (std::nothrow) shaderc_compilation_result_spv_binary;
|
||||
+ if (!bresult) return shaderc_compilation_status_internal_error;
|
||||
+ bresult->compilation_status = shaderc_compilation_status_invalid_assembly;
|
||||
+ *result = bresult;
|
||||
+ if (!compiler->initializer) return bresult->compilation_status;
|
||||
+ if (source_assembly == nullptr) return bresult->compilation_status;
|
||||
|
||||
TRY_IF_EXCEPTIONS_ENABLED {
|
||||
spv_binary assembling_output_data = nullptr;
|
||||
@@ -724,22 +762,22 @@ shaderc_compilation_result_t shaderc_assemble_into_spv(
|
||||
GetCompilerTargetEnvVersion(target_env_version),
|
||||
{source_assembly, source_assembly + source_assembly_size},
|
||||
&assembling_output_data, &errors);
|
||||
- result->num_errors = !assembling_succeeded;
|
||||
+ bresult->num_errors = !assembling_succeeded;
|
||||
if (assembling_succeeded) {
|
||||
- result->SetOutputData(assembling_output_data);
|
||||
- result->output_data_size =
|
||||
+ bresult->SetOutputData(assembling_output_data);
|
||||
+ bresult->output_data_size =
|
||||
assembling_output_data->wordCount * sizeof(uint32_t);
|
||||
- result->compilation_status = shaderc_compilation_status_success;
|
||||
+ bresult->compilation_status = shaderc_compilation_status_success;
|
||||
} else {
|
||||
- result->messages = std::move(errors);
|
||||
- result->compilation_status = shaderc_compilation_status_invalid_assembly;
|
||||
+ bresult->messages = std::move(errors);
|
||||
+ bresult->compilation_status = shaderc_compilation_status_invalid_assembly;
|
||||
}
|
||||
}
|
||||
CATCH_IF_EXCEPTIONS_ENABLED(...) {
|
||||
- result->compilation_status = shaderc_compilation_status_internal_error;
|
||||
+ bresult->compilation_status = shaderc_compilation_status_internal_error;
|
||||
}
|
||||
|
||||
- return result;
|
||||
+ return bresult->compilation_status;
|
||||
}
|
||||
|
||||
size_t shaderc_result_get_length(const shaderc_compilation_result_t result) {
|
||||
diff --git a/libshaderc_util/include/libshaderc_util/compiler.h b/libshaderc_util/include/libshaderc_util/compiler.h
|
||||
index d9d02b9..b076ec8 100644
|
||||
--- a/libshaderc_util/include/libshaderc_util/compiler.h
|
||||
+++ b/libshaderc_util/include/libshaderc_util/compiler.h
|
||||
@@ -195,6 +195,7 @@ class Compiler {
|
||||
warnings_as_errors_(false),
|
||||
suppress_warnings_(false),
|
||||
generate_debug_info_(false),
|
||||
+ emit_non_semantic_debug_info_(false),
|
||||
enabled_opt_passes_(),
|
||||
target_env_(TargetEnv::Vulkan),
|
||||
target_env_version_(TargetEnvVersion::Default),
|
||||
@@ -220,6 +221,10 @@ class Compiler {
|
||||
// such as identifier names and line numbers.
|
||||
void SetGenerateDebugInfo();
|
||||
|
||||
+ // Requests that the compiler emit non-semantic debug information.
|
||||
+ // Requires VK_KHR_shader_non_semantic_info.
|
||||
+ void SetEmitNonSemanticDebugInfo();
|
||||
+
|
||||
// Sets the optimization level to the given level. Only the last one takes
|
||||
// effect if multiple calls of this method exist.
|
||||
void SetOptimizationLevel(OptimizationLevel level);
|
||||
@@ -486,6 +491,10 @@ class Compiler {
|
||||
// output.
|
||||
bool generate_debug_info_;
|
||||
|
||||
+ // When true and generate_debug_info_ is also set, generate non-semantic debug
|
||||
+ // information.
|
||||
+ bool emit_non_semantic_debug_info_;
|
||||
+
|
||||
// Optimization passes to be applied.
|
||||
std::vector<PassId> enabled_opt_passes_;
|
||||
|
||||
diff --git a/libshaderc_util/src/compiler.cc b/libshaderc_util/src/compiler.cc
|
||||
index e5f5d10..1f9e6a5 100644
|
||||
--- a/libshaderc_util/src/compiler.cc
|
||||
+++ b/libshaderc_util/src/compiler.cc
|
||||
@@ -341,6 +341,11 @@ std::tuple<bool, std::vector<uint32_t>, size_t> Compiler::Compile(
|
||||
options.generateDebugInfo = generate_debug_info_;
|
||||
options.disableOptimizer = true;
|
||||
options.optimizeSize = false;
|
||||
+ options.emitNonSemanticShaderDebugInfo =
|
||||
+ generate_debug_info_ && emit_non_semantic_debug_info_;
|
||||
+ options.emitNonSemanticShaderDebugSource =
|
||||
+ generate_debug_info_ && emit_non_semantic_debug_info_;
|
||||
+
|
||||
// Note the call to GlslangToSpv also populates compilation_output_data.
|
||||
glslang::GlslangToSpv(*program.getIntermediate(used_shader_stage), spirv,
|
||||
&options);
|
||||
@@ -438,6 +443,10 @@ void Compiler::SetGenerateDebugInfo() {
|
||||
}
|
||||
}
|
||||
|
||||
+void Compiler::SetEmitNonSemanticDebugInfo() {
|
||||
+ emit_non_semantic_debug_info_ = true;
|
||||
+}
|
||||
+
|
||||
void Compiler::SetOptimizationLevel(Compiler::OptimizationLevel level) {
|
||||
// Clear previous settings first.
|
||||
enabled_opt_passes_.clear();
|
||||
diff --git a/third_party/CMakeLists.txt b/third_party/CMakeLists.txt
|
||||
index d44f62a..83966b6 100644
|
||||
--- a/third_party/CMakeLists.txt
|
||||
+++ b/third_party/CMakeLists.txt
|
||||
@@ -20,9 +20,9 @@ set(SHADERC_TINT_DIR "${SHADERC_THIRD_PARTY_ROOT_DIR}/tint" CACHE STRING
|
||||
set(SHADERC_ABSL_DIR "${SHADERC_THIRD_PARTY_ROOT_DIR}/abseil_cpp" CACHE STRING
|
||||
"Location of re2 source")
|
||||
|
||||
-set( SKIP_GLSLANG_INSTALL ${SHADERC_SKIP_INSTALL} )
|
||||
-set( SKIP_SPIRV_TOOLS_INSTALL ${SHADERC_SKIP_INSTALL} )
|
||||
-set( SKIP_GOOGLETEST_INSTALL ${SHADERC_SKIP_INSTALL} )
|
||||
+set( SKIP_GLSLANG_INSTALL ON )
|
||||
+set( SKIP_SPIRV_TOOLS_INSTALL ON )
|
||||
+set( SKIP_GOOGLETEST_INSTALL ON )
|
||||
|
||||
# Configure third party projects.
|
||||
if(${SHADERC_ENABLE_TESTS})
|
||||
@@ -64,7 +64,10 @@ if (NOT TARGET SPIRV-Tools)
|
||||
add_subdirectory(${SHADERC_RE2_DIR} re2)
|
||||
add_subdirectory(${SHADERC_EFFCEE_DIR} effcee)
|
||||
endif()
|
||||
- add_subdirectory(${SHADERC_SPIRV_TOOLS_DIR} spirv-tools)
|
||||
+ set(SPIRV_SKIP_EXECUTABLES ON CACHE BOOL "Skip building SPIRV-Tools executables")
|
||||
+ set(SPIRV_TOOLS_BUILD_STATIC OFF CACHE BOOL "Skip building two SPIRV-Tools libs")
|
||||
+ set(SPIRV_TOOLS_LIBRARY_TYPE STATIC CACHE STRING "Build static SPIRV-Tools libs")
|
||||
+ add_subdirectory(${SHADERC_SPIRV_TOOLS_DIR} spirv-tools EXCLUDE_FROM_ALL)
|
||||
if (NOT "${SPIRV_SKIP_TESTS}")
|
||||
if (MSVC)
|
||||
if (${MSVC_VERSION} LESS 1920)
|
||||
@@ -87,8 +90,8 @@ if (NOT TARGET glslang)
|
||||
# Glslang tests are off by default. Turn them on if testing Shaderc.
|
||||
set(GLSLANG_TESTS ON)
|
||||
endif()
|
||||
- set(GLSLANG_ENABLE_INSTALL $<NOT:${SKIP_GLSLANG_INSTALL}>)
|
||||
- add_subdirectory(${SHADERC_GLSLANG_DIR} glslang)
|
||||
+ set(GLSLANG_ENABLE_INSTALL OFF)
|
||||
+ add_subdirectory(${SHADERC_GLSLANG_DIR} glslang EXCLUDE_FROM_ALL)
|
||||
endif()
|
||||
if (NOT TARGET glslang)
|
||||
message(FATAL_ERROR "glslang was not found - required for compilation")
|
||||
@@ -1,12 +1,11 @@
|
||||
#!/bin/bash
|
||||
|
||||
SCRIPTDIR=$(dirname "${BASH_SOURCE[0]}")
|
||||
source "$SCRIPTDIR/../linux/functions.sh"
|
||||
|
||||
set -e
|
||||
|
||||
# While we use custom Qt builds for our releases, the Qt6 package will be good enough
|
||||
# for just updating translations. Saves building it for this action alone.
|
||||
retry_command sudo apt-get -y install qt6-l10n-tools
|
||||
"$SCRIPTDIR/../../../../tools/retry.sh" sudo apt-get -y install qt6-l10n-tools
|
||||
|
||||
PATH=/usr/lib/qt6/bin:$PATH "$SCRIPTDIR/../../../../pcsx2-qt/Translations/update_en_translation.sh"
|
||||
PATH=/usr/lib/qt6/bin:$PATH "$SCRIPTDIR/../../../../pcsx2-qt/Translations/update_base_translation.sh"
|
||||
|
||||
47
.github/workflows/scripts/linux/appimage-qt.sh
vendored
47
.github/workflows/scripts/linux/appimage-qt.sh
vendored
@@ -26,7 +26,6 @@
|
||||
# For more information, please refer to <http://unlicense.org/>
|
||||
|
||||
SCRIPTDIR=$(dirname "${BASH_SOURCE[0]}")
|
||||
source "$SCRIPTDIR/functions.sh"
|
||||
|
||||
if [ "$#" -ne 4 ]; then
|
||||
echo "Syntax: $0 <path to pcsx2 directory> <path to build directory> <deps prefix> <output name>"
|
||||
@@ -42,6 +41,10 @@ BINARY=pcsx2-qt
|
||||
APPDIRNAME=PCSX2.AppDir
|
||||
STRIP=strip
|
||||
|
||||
declare -a MANUAL_LIBS=(
|
||||
"libshaderc_shared.so.1"
|
||||
)
|
||||
|
||||
declare -a MANUAL_QT_LIBS=(
|
||||
"libQt6WaylandEglClientHwIntegration.so.6"
|
||||
)
|
||||
@@ -60,24 +63,41 @@ APPIMAGETOOL=./appimagetool-x86_64.AppImage
|
||||
PATCHELF=patchelf
|
||||
|
||||
if [ ! -f "$LINUXDEPLOY" ]; then
|
||||
retry_command wget -O "$LINUXDEPLOY" https://github.com/linuxdeploy/linuxdeploy/releases/download/continuous/linuxdeploy-x86_64.AppImage
|
||||
"$PCSX2DIR/tools/retry.sh" wget -O "$LINUXDEPLOY" https://github.com/linuxdeploy/linuxdeploy/releases/download/continuous/linuxdeploy-x86_64.AppImage
|
||||
chmod +x "$LINUXDEPLOY"
|
||||
fi
|
||||
|
||||
if [ ! -f "$LINUXDEPLOY_PLUGIN_QT" ]; then
|
||||
retry_command wget -O "$LINUXDEPLOY_PLUGIN_QT" https://github.com/linuxdeploy/linuxdeploy-plugin-qt/releases/download/continuous/linuxdeploy-plugin-qt-x86_64.AppImage
|
||||
"$PCSX2DIR/tools/retry.sh" wget -O "$LINUXDEPLOY_PLUGIN_QT" https://github.com/linuxdeploy/linuxdeploy-plugin-qt/releases/download/continuous/linuxdeploy-plugin-qt-x86_64.AppImage
|
||||
chmod +x "$LINUXDEPLOY_PLUGIN_QT"
|
||||
fi
|
||||
|
||||
if [ ! -f "$APPIMAGETOOL" ]; then
|
||||
retry_command wget -O "$APPIMAGETOOL" https://github.com/AppImage/AppImageKit/releases/download/continuous/appimagetool-x86_64.AppImage
|
||||
"$PCSX2DIR/tools/retry.sh" wget -O "$APPIMAGETOOL" https://github.com/AppImage/AppImageKit/releases/download/continuous/appimagetool-x86_64.AppImage
|
||||
chmod +x "$APPIMAGETOOL"
|
||||
fi
|
||||
|
||||
OUTDIR=$(realpath "./$APPDIRNAME")
|
||||
SCRIPTDIR=$(dirname "${BASH_SOURCE[0]}")
|
||||
rm -fr "$OUTDIR"
|
||||
|
||||
echo "Locating extra libraries..."
|
||||
EXTRA_LIBS_ARGS=""
|
||||
for lib in "${MANUAL_LIBS[@]}"; do
|
||||
srcpath=$(find "$DEPSDIR" -name "$lib")
|
||||
if [ ! -f "$srcpath" ]; then
|
||||
echo "Missinge extra library $lib. Exiting."
|
||||
exit 1
|
||||
fi
|
||||
|
||||
echo "Found $lib at $srcpath."
|
||||
|
||||
if [ "$EXTRA_LIBS_ARGS" == "" ]; then
|
||||
EXTRA_LIBS_ARGS="--library=$srcpath"
|
||||
else
|
||||
EXTRA_LIBS_ARGS="$EXTRA_LIBS_ARGS,$srcpath"
|
||||
fi
|
||||
done
|
||||
|
||||
# Why the nastyness? linuxdeploy strips our main binary, and there's no option to turn it off.
|
||||
# It also doesn't strip the Qt libs. We can't strip them after running linuxdeploy, because
|
||||
# patchelf corrupts the libraries (but they still work), but patchelf+strip makes them crash
|
||||
@@ -101,9 +121,10 @@ cp "$PCSX2DIR/bin/resources/icons/AppIconLarge.png" "PCSX2.png"
|
||||
echo "Running linuxdeploy to create AppDir..."
|
||||
EXTRA_QT_PLUGINS="core;gui;network;svg;waylandclient;widgets;xcbqpa" \
|
||||
EXTRA_PLATFORM_PLUGINS="libqwayland-egl.so;libqwayland-generic.so" \
|
||||
DEPLOY_PLATFORM_THEMES="1" \
|
||||
QMAKE="$DEPSDIR/bin/qmake" \
|
||||
NO_STRIP="1" \
|
||||
$LINUXDEPLOY --plugin qt --appdir="$OUTDIR" --executable="$BUILDDIR/bin/pcsx2-qt" \
|
||||
$LINUXDEPLOY --plugin qt --appdir="$OUTDIR" --executable="$BUILDDIR/bin/pcsx2-qt" $EXTRA_LIBS_ARGS \
|
||||
--desktop-file="net.pcsx2.PCSX2.desktop" --icon-file="PCSX2.png"
|
||||
|
||||
echo "Copying resources into AppDir..."
|
||||
@@ -142,8 +163,7 @@ rm -fr "$DEPSDIR"
|
||||
mv "$DEPSDIR.bak" "$DEPSDIR"
|
||||
|
||||
# Fix up translations.
|
||||
rm -fr "$OUTDIR/usr/bin/translations"
|
||||
mv "$OUTDIR/usr/translations" "$OUTDIR/usr/bin"
|
||||
rm -fr "$OUTDIR/usr/bin/translations" "$OUTDIR/usr/translations"
|
||||
cp -a "$BUILDDIR/bin/translations" "$OUTDIR/usr/bin"
|
||||
|
||||
# Generate AppStream meta-info.
|
||||
@@ -151,6 +171,17 @@ echo "Generating AppStream metainfo..."
|
||||
mkdir -p "$OUTDIR/usr/share/metainfo"
|
||||
"$SCRIPTDIR/generate-metainfo.sh" "$OUTDIR/usr/share/metainfo/net.pcsx2.PCSX2.appdata.xml"
|
||||
|
||||
# Copy in AppRun hooks.
|
||||
# Unfortunately linuxdeploy is a bit lame and doesn't let us provide our own AppRun hooks, instead
|
||||
# they have to come from plugins.. and screw writing one of those just to disable Wayland.
|
||||
echo "Copying AppRun hooks..."
|
||||
mkdir -p "$OUTDIR/apprun-hooks"
|
||||
for hookpath in "$SCRIPTDIR/apprun-hooks"/*; do
|
||||
hookname=$(basename "$hookpath")
|
||||
cp -v "$hookpath" "$OUTDIR/apprun-hooks/$hookname"
|
||||
sed -i -e 's/exec /source "$this_dir"\/apprun-hooks\/"'"$hookname"'"\nexec /' "$OUTDIR/AppRun"
|
||||
done
|
||||
|
||||
echo "Generating AppImage..."
|
||||
rm -f "$NAME.AppImage"
|
||||
$APPIMAGETOOL -v "$OUTDIR" "$NAME.AppImage"
|
||||
|
||||
9
.github/workflows/scripts/linux/apprun-hooks/default-to-x11.sh
vendored
Normal file
9
.github/workflows/scripts/linux/apprun-hooks/default-to-x11.sh
vendored
Normal file
@@ -0,0 +1,9 @@
|
||||
if [[ -z "$I_WANT_A_BROKEN_WAYLAND_UI" ]]; then
|
||||
echo "Forcing X11 instead of Wayland, due to various protocol limitations"
|
||||
echo "and Qt issues. If you want to use Wayland, launch PCSX2 with"
|
||||
echo "I_WANT_A_BROKEN_WAYLAND_UI=YES set."
|
||||
export QT_QPA_PLATFORM=xcb
|
||||
else
|
||||
echo "Wayland is not being disabled. Do not complain when things break."
|
||||
fi
|
||||
|
||||
@@ -2,52 +2,141 @@
|
||||
|
||||
set -e
|
||||
|
||||
INSTALLDIR="$HOME/deps"
|
||||
if [ "$#" -ne 1 ]; then
|
||||
echo "Syntax: $0 <output directory>"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
SCRIPTDIR=$(realpath $(dirname "${BASH_SOURCE[0]}"))
|
||||
NPROCS="$(getconf _NPROCESSORS_ONLN)"
|
||||
SDL=SDL2-2.28.1
|
||||
QT=6.5.2
|
||||
INSTALLDIR="$1"
|
||||
if [ "${INSTALLDIR:0:1}" != "/" ]; then
|
||||
INSTALLDIR="$PWD/$INSTALLDIR"
|
||||
fi
|
||||
|
||||
LIBBACKTRACE=ad106d5fdd5d960bd33fae1c48a351af567fd075
|
||||
LIBJPEG=9f
|
||||
LIBPNG=1.6.43
|
||||
LIBWEBP=1.3.2
|
||||
LZ4=b8fd2d15309dd4e605070bd4486e26b6ef814e29
|
||||
SDL=SDL2-2.30.3
|
||||
QT=6.7.1
|
||||
ZSTD=1.5.5
|
||||
|
||||
SHADERC=2024.1
|
||||
SHADERC_GLSLANG=142052fa30f9eca191aa9dcf65359fcaed09eeec
|
||||
SHADERC_SPIRVHEADERS=5e3ad389ee56fca27c9705d093ae5387ce404df4
|
||||
SHADERC_SPIRVTOOLS=dd4b663e13c07fea4fbb3f70c1c91c86731099f7
|
||||
|
||||
mkdir -p deps-build
|
||||
cd deps-build
|
||||
|
||||
cat > SHASUMS <<EOF
|
||||
4977ceba5c0054dbe6c2f114641aced43ce3bf2b41ea64b6a372d6ba129cb15d $SDL.tar.gz
|
||||
fd6f417fe9e3a071cf1424a5152d926a34c4a3c5070745470be6cf12a404ed79 $LIBBACKTRACE.zip
|
||||
3db4c729b4d80a9d8fda8dd77128406353baff4755ca619177eda4cddae71269 qtbase-everywhere-src-$QT.tar.xz
|
||||
aae0c08924c6a5e47f9d57e031673d611ffff7aab2bee2e1cc460471ecac6743 qtimageformats-everywhere-src-$QT.tar.xz
|
||||
48b4cc1093af2e0ab3bea30f60651bddd877a2335d16e7207879a2e9e81963a3 qtsvg-everywhere-src-$QT.tar.xz
|
||||
551ffb22751d8fd4d88e9ebd55b9131f4ca55341ee497fdbbba4da8d10d94341 qttools-everywhere-src-$QT.tar.xz
|
||||
337c45637e757e754c2f0ea65c20de3e6e53a841dda1253db15baa622515beeb qttranslations-everywhere-src-$QT.tar.xz
|
||||
3020be86fb7fd0abb8509906ca6583cadcaee168159abceaeb5b3e9d42563c9a qtwayland-everywhere-src-$QT.tar.xz
|
||||
04705c110cb2469caa79fb71fba3d7bf834914706e9641a4589485c1f832565b jpegsrc.v$LIBJPEG.tar.gz
|
||||
6a5ca0652392a2d7c9db2ae5b40210843c0bbc081cbd410825ab00cc59f14a6c libpng-$LIBPNG.tar.xz
|
||||
2a499607df669e40258e53d0ade8035ba4ec0175244869d1025d460562aa09b4 libwebp-$LIBWEBP.tar.gz
|
||||
0728800155f3ed0a0c87e03addbd30ecbe374f7b080678bbca1506051d50dec3 $LZ4.tar.gz
|
||||
820440072f8f5b50188c1dae104f2ad25984de268785be40c41a099a510f0aec $SDL.tar.gz
|
||||
9c4396cc829cfae319a6e2615202e82aad41372073482fce286fac78646d3ee4 zstd-$ZSTD.tar.gz
|
||||
b7338da1bdccb4d861e714efffaa83f174dfe37e194916bfd7ec82279a6ace19 qtbase-everywhere-src-$QT.tar.xz
|
||||
a733b98f771064d000476b8861f822143982749448ba8abf9f1813edb8dfe79f qtimageformats-everywhere-src-$QT.tar.xz
|
||||
3ed5b80f7228c41dd463b7a57284ed273d224d1c323c0dd78c5209635807cbce qtsvg-everywhere-src-$QT.tar.xz
|
||||
0953cddf6248f3959279a10904892e8a98eb3e463d729a174b6fc47febd99824 qttools-everywhere-src-$QT.tar.xz
|
||||
03d71565872b0e0e7303349071df031ab0f922f6dbdd3a5ec1ade9e188e4fbf4 qttranslations-everywhere-src-$QT.tar.xz
|
||||
7ef176a8e701c90edd8e591dad36f83c30d623ef94439ff62cafcffd46a83d20 qtwayland-everywhere-src-$QT.tar.xz
|
||||
eb3b5f0c16313d34f208d90c2fa1e588a23283eed63b101edd5422be6165d528 shaderc-$SHADERC.tar.gz
|
||||
aa27e4454ce631c5a17924ce0624eac736da19fc6f5a2ab15a6c58da7b36950f shaderc-glslang-$SHADERC_GLSLANG.tar.gz
|
||||
5d866ce34a4b6908e262e5ebfffc0a5e11dd411640b5f24c85a80ad44c0d4697 shaderc-spirv-headers-$SHADERC_SPIRVHEADERS.tar.gz
|
||||
03ee1a2c06f3b61008478f4abe9423454e53e580b9488b47c8071547c6a9db47 shaderc-spirv-tools-$SHADERC_SPIRVTOOLS.tar.gz
|
||||
EOF
|
||||
|
||||
curl -L \
|
||||
-O "https://libsdl.org/release/$SDL.tar.gz" \
|
||||
curl -C - -L \
|
||||
-O "https://github.com/ianlancetaylor/libbacktrace/archive/$LIBBACKTRACE.zip" \
|
||||
-O "https://ijg.org/files/jpegsrc.v$LIBJPEG.tar.gz" \
|
||||
-O "https://downloads.sourceforge.net/project/libpng/libpng16/$LIBPNG/libpng-$LIBPNG.tar.xz" \
|
||||
-O "https://storage.googleapis.com/downloads.webmproject.org/releases/webp/libwebp-$LIBWEBP.tar.gz" \
|
||||
-O "https://github.com/lz4/lz4/archive/$LZ4.tar.gz" \
|
||||
-O "https://libsdl.org/release/$SDL.tar.gz" \
|
||||
-O "https://github.com/facebook/zstd/releases/download/v$ZSTD/zstd-$ZSTD.tar.gz" \
|
||||
-O "https://download.qt.io/official_releases/qt/${QT%.*}/$QT/submodules/qtbase-everywhere-src-$QT.tar.xz" \
|
||||
-O "https://download.qt.io/official_releases/qt/${QT%.*}/$QT/submodules/qtimageformats-everywhere-src-$QT.tar.xz" \
|
||||
-O "https://download.qt.io/official_releases/qt/${QT%.*}/$QT/submodules/qtsvg-everywhere-src-$QT.tar.xz" \
|
||||
-O "https://download.qt.io/official_releases/qt/${QT%.*}/$QT/submodules/qttools-everywhere-src-$QT.tar.xz" \
|
||||
-O "https://download.qt.io/official_releases/qt/${QT%.*}/$QT/submodules/qttranslations-everywhere-src-$QT.tar.xz" \
|
||||
-O "https://download.qt.io/official_releases/qt/${QT%.*}/$QT/submodules/qtwayland-everywhere-src-$QT.tar.xz"
|
||||
-O "https://download.qt.io/official_releases/qt/${QT%.*}/$QT/submodules/qtwayland-everywhere-src-$QT.tar.xz" \
|
||||
-o "shaderc-$SHADERC.tar.gz" "https://github.com/google/shaderc/archive/refs/tags/v$SHADERC.tar.gz" \
|
||||
-o "shaderc-glslang-$SHADERC_GLSLANG.tar.gz" "https://github.com/KhronosGroup/glslang/archive/$SHADERC_GLSLANG.tar.gz" \
|
||||
-o "shaderc-spirv-headers-$SHADERC_SPIRVHEADERS.tar.gz" "https://github.com/KhronosGroup/SPIRV-Headers/archive/$SHADERC_SPIRVHEADERS.tar.gz" \
|
||||
-o "shaderc-spirv-tools-$SHADERC_SPIRVTOOLS.tar.gz" "https://github.com/KhronosGroup/SPIRV-Tools/archive/$SHADERC_SPIRVTOOLS.tar.gz"
|
||||
|
||||
shasum -a 256 --check SHASUMS
|
||||
|
||||
echo "Building SDL..."
|
||||
tar xf "$SDL.tar.gz"
|
||||
cd "$SDL"
|
||||
./configure --prefix "$INSTALLDIR" --disable-dbus --without-x --disable-video-opengl --disable-video-opengles --disable-video-vulkan --disable-wayland-shared --disable-ime --disable-oss --disable-alsa --disable-jack --disable-esd --disable-pipewire --disable-pulseaudio --disable-arts --disable-nas --disable-sndio --disable-fusionsound --disable-diskaudio
|
||||
make "-j$NPROCS"
|
||||
echo "Building libbacktrace..."
|
||||
rm -fr "libbacktrace-$LIBBACKTRACE"
|
||||
unzip "$LIBBACKTRACE.zip"
|
||||
cd "libbacktrace-$LIBBACKTRACE"
|
||||
./configure --prefix="$INSTALLDIR"
|
||||
make
|
||||
make install
|
||||
cd ..
|
||||
|
||||
echo "Building libbacktrace..."
|
||||
unzip "$LIBBACKTRACE.zip"
|
||||
cd "libbacktrace-$LIBBACKTRACE"
|
||||
./configure --prefix="$HOME/deps"
|
||||
make
|
||||
echo "Building libpng..."
|
||||
rm -fr "libpng-$LIBPNG"
|
||||
tar xf "libpng-$LIBPNG.tar.xz"
|
||||
cd "libpng-$LIBPNG"
|
||||
cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_PREFIX_PATH="$INSTALLDIR" -DCMAKE_INSTALL_PREFIX="$INSTALLDIR" -DBUILD_SHARED_LIBS=ON -DBUILD_SHARED_LIBS=ON -DPNG_TESTS=OFF -DPNG_STATIC=OFF -DPNG_SHARED=ON -DPNG_TOOLS=OFF -B build -G Ninja
|
||||
cmake --build build --parallel
|
||||
ninja -C build install
|
||||
cd ..
|
||||
|
||||
echo "Building libjpeg..."
|
||||
rm -fr "jpeg-$LIBJPEG"
|
||||
tar xf "jpegsrc.v$LIBJPEG.tar.gz"
|
||||
cd "jpeg-$LIBJPEG"
|
||||
mkdir build
|
||||
cd build
|
||||
../configure --prefix="$INSTALLDIR" --disable-static --enable-shared
|
||||
make "-j$NPROCS"
|
||||
make install
|
||||
cd ../..
|
||||
|
||||
echo "Building LZ4..."
|
||||
rm -fr "lz4-$LZ4"
|
||||
tar xf "$LZ4.tar.gz"
|
||||
cd "lz4-$LZ4"
|
||||
cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_PREFIX_PATH="$INSTALLDIR" -DCMAKE_INSTALL_PREFIX="$INSTALLDIR" -DBUILD_SHARED_LIBS=ON -DLZ4_BUILD_CLI=OFF -DLZ4_BUILD_LEGACY_LZ4C=OFF -B build-dir -G Ninja build/cmake
|
||||
cmake --build build-dir --parallel
|
||||
ninja -C build-dir install
|
||||
cd ..
|
||||
|
||||
echo "Building Zstandard..."
|
||||
rm -fr "zstd-$ZSTD"
|
||||
tar xf "zstd-$ZSTD.tar.gz"
|
||||
cd "zstd-$ZSTD"
|
||||
cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_PREFIX_PATH="$INSTALLDIR" -DCMAKE_INSTALL_PREFIX="$INSTALLDIR" -DBUILD_SHARED_LIBS=ON -DZSTD_BUILD_SHARED=ON -DZSTD_BUILD_STATIC=OFF -DZSTD_BUILD_PROGRAMS=OFF -B build -G Ninja build/cmake
|
||||
cmake --build build --parallel
|
||||
ninja -C build install
|
||||
cd ..
|
||||
|
||||
echo "Building WebP..."
|
||||
rm -fr "libwebp-$LIBWEBP"
|
||||
tar xf "libwebp-$LIBWEBP.tar.gz"
|
||||
cd "libwebp-$LIBWEBP"
|
||||
cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_PREFIX_PATH="$INSTALLDIR" -DCMAKE_INSTALL_PREFIX="$INSTALLDIR" -B build -G Ninja \
|
||||
-DWEBP_BUILD_ANIM_UTILS=OFF -DWEBP_BUILD_CWEBP=OFF -DWEBP_BUILD_DWEBP=OFF -DWEBP_BUILD_GIF2WEBP=OFF -DWEBP_BUILD_IMG2WEBP=OFF \
|
||||
-DWEBP_BUILD_VWEBP=OFF -DWEBP_BUILD_WEBPINFO=OFF -DWEBP_BUILD_WEBPMUX=OFF -DWEBP_BUILD_EXTRAS=OFF -DBUILD_SHARED_LIBS=ON
|
||||
cmake --build build --parallel
|
||||
ninja -C build install
|
||||
cd ..
|
||||
|
||||
echo "Building SDL..."
|
||||
rm -fr "$SDL"
|
||||
tar xf "$SDL.tar.gz"
|
||||
cd "$SDL"
|
||||
cmake -B build -DCMAKE_BUILD_TYPE=Release -DCMAKE_PREFIX_PATH="$INSTALLDIR" -DCMAKE_INSTALL_PREFIX="$INSTALLDIR" -DBUILD_SHARED_LIBS=ON -DSDL_SHARED=ON -DSDL_STATIC=OFF -G Ninja
|
||||
cmake --build build --parallel
|
||||
ninja -C build install
|
||||
cd ..
|
||||
|
||||
# Couple notes:
|
||||
@@ -56,46 +145,51 @@ cd ..
|
||||
# ICU avoids pulling in a bunch of large libraries, and hopefully we can get away without it.
|
||||
# OpenGL is needed to render window decorations in Wayland, apparently.
|
||||
echo "Building Qt Base..."
|
||||
rm -fr "qtbase-everywhere-src-$QT"
|
||||
tar xf "qtbase-everywhere-src-$QT.tar.xz"
|
||||
cd "qtbase-everywhere-src-$QT"
|
||||
mkdir build
|
||||
cd build
|
||||
../configure -prefix "$INSTALLDIR" -release -no-dbus -gui -widgets -fontconfig -qt-doubleconversion -ssl -openssl-runtime -opengl desktop -qpa xcb,wayland -xkbcommon -- -DFEATURE_dbus=OFF -DFEATURE_icu=OFF -DFEATURE_printsupport=OFF -DFEATURE_sql=OFF
|
||||
../configure -prefix "$INSTALLDIR" -release -dbus-linked -gui -widgets -fontconfig -qt-doubleconversion -ssl -openssl-runtime -opengl desktop -qpa xcb,wayland -xkbcommon -xcb -gtk -- -DFEATURE_dbus=ON -DFEATURE_icu=OFF -DFEATURE_printsupport=OFF -DFEATURE_sql=OFF -DFEATURE_system_png=ON -DFEATURE_system_jpeg=ON -DFEATURE_system_zlib=ON -DFEATURE_system_freetype=ON -DFEATURE_system_harfbuzz=ON
|
||||
cmake --build . --parallel
|
||||
cmake --install .
|
||||
ninja install
|
||||
cd ../../
|
||||
|
||||
echo "Building Qt SVG..."
|
||||
rm -fr "qtsvg-everywhere-src-$QT"
|
||||
tar xf "qtsvg-everywhere-src-$QT.tar.xz"
|
||||
cd "qtsvg-everywhere-src-$QT"
|
||||
mkdir build
|
||||
cd build
|
||||
cmake -G Ninja -DCMAKE_PREFIX_PATH="$INSTALLDIR" -DCMAKE_INSTALL_PREFIX="$INSTALLDIR" -DCMAKE_BUILD_TYPE=Release ..
|
||||
"$INSTALLDIR/bin/qt-configure-module" .. -- -DCMAKE_PREFIX_PATH="$INSTALLDIR"
|
||||
cmake --build . --parallel
|
||||
cmake --install .
|
||||
ninja install
|
||||
cd ../../
|
||||
|
||||
echo "Building Qt Image Formats..."
|
||||
rm -fr "qtimageformats-everywhere-src-$QT"
|
||||
tar xf "qtimageformats-everywhere-src-$QT.tar.xz"
|
||||
cd "qtimageformats-everywhere-src-$QT"
|
||||
mkdir build
|
||||
cd build
|
||||
cmake -G Ninja -DCMAKE_PREFIX_PATH="$INSTALLDIR" -DCMAKE_INSTALL_PREFIX="$INSTALLDIR" -DCMAKE_BUILD_TYPE=Release ..
|
||||
"$INSTALLDIR/bin/qt-configure-module" .. -- -DCMAKE_PREFIX_PATH="$INSTALLDIR" -DFEATURE_system_webp=ON
|
||||
cmake --build . --parallel
|
||||
cmake --install .
|
||||
ninja install
|
||||
cd ../../
|
||||
|
||||
echo "Building Qt Wayland..."
|
||||
rm -fr "qtwayland-everywhere-src-$QT"
|
||||
tar xf "qtwayland-everywhere-src-$QT.tar.xz"
|
||||
cd "qtwayland-everywhere-src-$QT"
|
||||
mkdir build
|
||||
cd build
|
||||
cmake -G Ninja -DCMAKE_PREFIX_PATH="$INSTALLDIR" -DCMAKE_INSTALL_PREFIX="$INSTALLDIR" -DCMAKE_BUILD_TYPE=Release ..
|
||||
"$INSTALLDIR/bin/qt-configure-module" .. -- -DCMAKE_PREFIX_PATH="$INSTALLDIR"
|
||||
cmake --build . --parallel
|
||||
cmake --install .
|
||||
ninja install
|
||||
cd ../../
|
||||
|
||||
echo "Installing Qt Tools..."
|
||||
rm -fr "qttools-everywhere-src-$QT"
|
||||
tar xf "qttools-everywhere-src-$QT.tar.xz"
|
||||
cd "qttools-everywhere-src-$QT"
|
||||
# From Mac build-dependencies.sh:
|
||||
@@ -139,21 +233,40 @@ EOF
|
||||
|
||||
mkdir build
|
||||
cd build
|
||||
cmake -G Ninja -DCMAKE_PREFIX_PATH="$INSTALLDIR" -DCMAKE_INSTALL_PREFIX="$INSTALLDIR" -DCMAKE_BUILD_TYPE=Release -DFEATURE_assistant=OFF -DFEATURE_clang=OFF -DFEATURE_designer=OFF -DFEATURE_kmap2qmap=OFF -DFEATURE_pixeltool=OFF -DFEATURE_pkg_config=OFF -DFEATURE_qev=OFF -DFEATURE_qtattributionsscanner=OFF -DFEATURE_qtdiag=OFF -DFEATURE_qtplugininfo=OFF ..
|
||||
"$INSTALLDIR/bin/qt-configure-module" .. -- -DCMAKE_PREFIX_PATH="$INSTALLDIR" -DFEATURE_assistant=OFF -DFEATURE_clang=OFF -DFEATURE_designer=OFF -DFEATURE_kmap2qmap=OFF -DFEATURE_pixeltool=OFF -DFEATURE_pkg_config=OFF -DFEATURE_qev=OFF -DFEATURE_qtattributionsscanner=OFF -DFEATURE_qtdiag=OFF -DFEATURE_qtplugininfo=OFF
|
||||
cmake --build . --parallel
|
||||
cmake --install .
|
||||
ninja install
|
||||
cd ../../
|
||||
|
||||
echo "Installing Qt Translations..."
|
||||
rm -fr "qttranslations-everywhere-src-$QT"
|
||||
tar xf "qttranslations-everywhere-src-$QT.tar.xz"
|
||||
cd "qttranslations-everywhere-src-$QT"
|
||||
mkdir build
|
||||
cd build
|
||||
cmake -G Ninja -DCMAKE_PREFIX_PATH="$INSTALLDIR" -DCMAKE_INSTALL_PREFIX="$INSTALLDIR" -DCMAKE_BUILD_TYPE=Release ..
|
||||
"$INSTALLDIR/bin/qt-configure-module" .. -- -DCMAKE_PREFIX_PATH="$INSTALLDIR"
|
||||
cmake --build . --parallel
|
||||
cmake --install .
|
||||
ninja install
|
||||
cd ../../
|
||||
|
||||
echo "Building shaderc..."
|
||||
rm -fr "shaderc-$SHADERC"
|
||||
tar xf "shaderc-$SHADERC.tar.gz"
|
||||
cd "shaderc-$SHADERC"
|
||||
cd third_party
|
||||
tar xf "../../shaderc-glslang-$SHADERC_GLSLANG.tar.gz"
|
||||
mv "glslang-$SHADERC_GLSLANG" "glslang"
|
||||
tar xf "../../shaderc-spirv-headers-$SHADERC_SPIRVHEADERS.tar.gz"
|
||||
mv "SPIRV-Headers-$SHADERC_SPIRVHEADERS" "spirv-headers"
|
||||
tar xf "../../shaderc-spirv-tools-$SHADERC_SPIRVTOOLS.tar.gz"
|
||||
mv "SPIRV-Tools-$SHADERC_SPIRVTOOLS" "spirv-tools"
|
||||
cd ..
|
||||
patch -p1 < "$SCRIPTDIR/../common/shaderc-changes.patch"
|
||||
cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_PREFIX_PATH="$INSTALLDIR" -DCMAKE_INSTALL_PREFIX="$INSTALLDIR" -DSHADERC_SKIP_TESTS=ON -DSHADERC_SKIP_EXAMPLES=ON -DSHADERC_SKIP_COPYRIGHT_CHECK=ON -B build -G Ninja
|
||||
cmake --build build --parallel
|
||||
ninja -C build install
|
||||
cd ..
|
||||
|
||||
echo "Cleaning up..."
|
||||
cd ..
|
||||
rm -r deps-build
|
||||
|
||||
15
.github/workflows/scripts/linux/compile.sh
vendored
15
.github/workflows/scripts/linux/compile.sh
vendored
@@ -1,15 +0,0 @@
|
||||
#!/bin/bash
|
||||
|
||||
set -e
|
||||
|
||||
if [ -n "${GITHUB_ACTIONS}" ]; then
|
||||
echo "Warning: Running this script outside of GitHub Actions isn't recommended."
|
||||
fi
|
||||
|
||||
# Prepare the Cache
|
||||
ccache -p
|
||||
ccache -z
|
||||
# Build
|
||||
ninja
|
||||
# Save the Cache
|
||||
ccache -s
|
||||
@@ -1,24 +0,0 @@
|
||||
{
|
||||
"name": "libaio",
|
||||
"no-autogen": true,
|
||||
"make-install-args": [
|
||||
"prefix=/app"
|
||||
],
|
||||
"build-options": {
|
||||
"strip": true
|
||||
},
|
||||
"sources": [
|
||||
{
|
||||
"type": "git",
|
||||
"url": "https://pagure.io/libaio.git",
|
||||
"tag": "libaio-0.3.113",
|
||||
"commit": "1b18bfafc6a2f7b9fa2c6be77a95afed8b7be448"
|
||||
}
|
||||
],
|
||||
"cleanup": [
|
||||
"/include",
|
||||
"/lib/*.a",
|
||||
"/lib/*.la"
|
||||
]
|
||||
}
|
||||
|
||||
@@ -1,26 +1,12 @@
|
||||
{
|
||||
"name": "sdl2",
|
||||
"buildsystem": "autotools",
|
||||
"no-autogen": true,
|
||||
"buildsystem": "cmake-ninja",
|
||||
"builddir": true,
|
||||
"config-opts": [
|
||||
"--disable-dbus",
|
||||
"--without-x",
|
||||
"--disable-video-opengl",
|
||||
"--disable-video-opengles",
|
||||
"--disable-video-vulkan",
|
||||
"--disable-wayland-shared",
|
||||
"--disable-ime",
|
||||
"--disable-oss",
|
||||
"--disable-alsa",
|
||||
"--disable-jack",
|
||||
"--disable-esd",
|
||||
"--disable-pipewire",
|
||||
"--disable-pulseaudio",
|
||||
"--disable-arts",
|
||||
"--disable-nas",
|
||||
"--disable-sndio",
|
||||
"--disable-fusionsound",
|
||||
"--disable-diskaudio"
|
||||
"-DBUILD_SHARED_LIBS=ON",
|
||||
"-DSDL_SHARED=ON",
|
||||
"-DSDL_STATIC=OFF",
|
||||
"-DSDL_TESTS=OFF"
|
||||
],
|
||||
"build-options": {
|
||||
"strip": true
|
||||
@@ -28,8 +14,8 @@
|
||||
"sources": [
|
||||
{
|
||||
"type": "archive",
|
||||
"url": "https://libsdl.org/release/SDL2-2.28.1.tar.gz",
|
||||
"sha256": "4977ceba5c0054dbe6c2f114641aced43ce3bf2b41ea64b6a372d6ba129cb15d"
|
||||
"url": "https://libsdl.org/release/SDL2-2.30.3.tar.gz",
|
||||
"sha256": "820440072f8f5b50188c1dae104f2ad25984de268785be40c41a099a510f0aec"
|
||||
}
|
||||
],
|
||||
"cleanup": [
|
||||
@@ -42,4 +28,3 @@
|
||||
"/share/aclocal"
|
||||
]
|
||||
}
|
||||
|
||||
|
||||
51
.github/workflows/scripts/linux/flatpak/modules/22-shaderc.json
vendored
Normal file
51
.github/workflows/scripts/linux/flatpak/modules/22-shaderc.json
vendored
Normal file
@@ -0,0 +1,51 @@
|
||||
{
|
||||
"name": "shaderc",
|
||||
"buildsystem": "cmake-ninja",
|
||||
"builddir": true,
|
||||
"config-opts": [
|
||||
"-DCMAKE_BUILD_TYPE=Release",
|
||||
"-DSHADERC_SKIP_TESTS=ON",
|
||||
"-DSHADERC_SKIP_EXAMPLES=ON",
|
||||
"-DSHADERC_SKIP_COPYRIGHT_CHECK=ON"
|
||||
],
|
||||
"build-options": {
|
||||
"strip": true
|
||||
},
|
||||
"sources": [
|
||||
{
|
||||
"type": "git",
|
||||
"url": "https://github.com/google/shaderc.git",
|
||||
"commit": "47a9387ef5b3600d30d84c71ec77a59dc7db46fa"
|
||||
},
|
||||
{
|
||||
"type": "archive",
|
||||
"url": "https://github.com/KhronosGroup/glslang/archive/142052fa30f9eca191aa9dcf65359fcaed09eeec.tar.gz",
|
||||
"sha256": "aa27e4454ce631c5a17924ce0624eac736da19fc6f5a2ab15a6c58da7b36950f",
|
||||
"dest": "third_party/glslang"
|
||||
},
|
||||
{
|
||||
"type": "archive",
|
||||
"url": "https://github.com/KhronosGroup/SPIRV-Headers/archive/5e3ad389ee56fca27c9705d093ae5387ce404df4.tar.gz",
|
||||
"sha256": "5d866ce34a4b6908e262e5ebfffc0a5e11dd411640b5f24c85a80ad44c0d4697",
|
||||
"dest": "third_party/spirv-headers"
|
||||
},
|
||||
{
|
||||
"type": "archive",
|
||||
"url": "https://github.com/KhronosGroup/SPIRV-Tools/archive/dd4b663e13c07fea4fbb3f70c1c91c86731099f7.tar.gz",
|
||||
"sha256": "03ee1a2c06f3b61008478f4abe9423454e53e580b9488b47c8071547c6a9db47",
|
||||
"dest": "third_party/spirv-tools"
|
||||
},
|
||||
{
|
||||
"type": "patch",
|
||||
"path": "../../../common/shaderc-changes.patch"
|
||||
}
|
||||
],
|
||||
"cleanup": [
|
||||
"/bin",
|
||||
"/include",
|
||||
"/lib/*.a",
|
||||
"/lib/*.la",
|
||||
"/lib/cmake",
|
||||
"/lib/pkgconfig"
|
||||
]
|
||||
}
|
||||
@@ -1,10 +1,10 @@
|
||||
{
|
||||
"app-id": "net.pcsx2.PCSX2",
|
||||
"runtime": "org.kde.Platform",
|
||||
"runtime-version": "6.5",
|
||||
"runtime-version": "6.7",
|
||||
"sdk": "org.kde.Sdk",
|
||||
"sdk-extensions": [
|
||||
"org.freedesktop.Sdk.Extension.llvm16"
|
||||
"org.freedesktop.Sdk.Extension.llvm17"
|
||||
],
|
||||
"add-extensions": {
|
||||
"org.freedesktop.Platform.ffmpeg-full": {
|
||||
@@ -19,30 +19,39 @@
|
||||
"--device=all",
|
||||
"--share=network",
|
||||
"--share=ipc",
|
||||
"--socket=fallback-x11",
|
||||
"--socket=wayland",
|
||||
"--socket=x11",
|
||||
"--socket=pulseaudio",
|
||||
"--filesystem=host:ro",
|
||||
"--talk-name=org.freedesktop.ScreenSaver"
|
||||
"--talk-name=org.freedesktop.ScreenSaver",
|
||||
"--env=QT_QPA_PLATFORM=xcb"
|
||||
],
|
||||
"modules": [
|
||||
"modules/10-libpcap.json",
|
||||
"modules/11-libaio.json",
|
||||
"modules/20-sdl2.json",
|
||||
"modules/21-libbacktrace.json",
|
||||
"modules/22-shaderc.json",
|
||||
{
|
||||
"name": "pcsx2",
|
||||
"buildsystem": "simple",
|
||||
"buildsystem": "cmake-ninja",
|
||||
"builddir": true,
|
||||
"no-make-install": true,
|
||||
"build-options": {
|
||||
"strip": false,
|
||||
"no-debuginfo": true,
|
||||
"env": {
|
||||
"DEPS_PREFIX": "/app",
|
||||
"COMPILER": "clang",
|
||||
"CLANG_PATH": "/usr/lib/sdk/llvm16/bin/clang",
|
||||
"CLANGXX_PATH": "/usr/lib/sdk/llvm16/bin/clang++",
|
||||
"ADDITIONAL_CMAKE_ARGS": "-DUSE_LINKED_FFMPEG=ON"
|
||||
}
|
||||
"cflags": "",
|
||||
"cflags-override": true,
|
||||
"cxxflags": "",
|
||||
"cxxflags-override": true,
|
||||
"config-opts": [
|
||||
"-DCMAKE_BUILD_TYPE=Release",
|
||||
"-DCMAKE_INTERPROCEDURAL_OPTIMIZATION=ON",
|
||||
"-DCMAKE_C_COMPILER=/usr/lib/sdk/llvm17/bin/clang",
|
||||
"-DCMAKE_CXX_COMPILER=/usr/lib/sdk/llvm17/bin/clang++",
|
||||
"-DCMAKE_EXE_LINKER_FLAGS_INIT=-fuse-ld=lld",
|
||||
"-DCMAKE_MODULE_LINKER_FLAGS_INIT=-fuse-ld=lld",
|
||||
"-DCMAKE_SHARED_LINKER_FLAGS_INIT=-fuse-ld=lld",
|
||||
"-DUSE_LINKED_FFMPEG=ON",
|
||||
"-DDISABLE_ADVANCE_SIMD=TRUE"
|
||||
]
|
||||
},
|
||||
"sources": [
|
||||
{
|
||||
@@ -50,17 +59,13 @@
|
||||
"path": "../../../../.."
|
||||
}
|
||||
],
|
||||
"build-commands": [
|
||||
".github/workflows/scripts/linux/generate-cmake-qt.sh",
|
||||
"cd build && ../.github/workflows/scripts/linux/compile.sh && cd ..",
|
||||
"cp -a build/bin ${FLATPAK_DEST}",
|
||||
"cd build && ninja unittests && cd .."
|
||||
],
|
||||
"post-install": [
|
||||
"install -Dm644 bin/resources/icons/AppIconLarge.png ${FLATPAK_DEST}/share/icons/hicolor/512x512/apps/net.pcsx2.PCSX2.png",
|
||||
"install -Dm644 .github/workflows/scripts/linux/pcsx2-qt.desktop ${FLATPAK_DEST}/share/applications/net.pcsx2.PCSX2.desktop",
|
||||
"desktop-file-edit --set-key=Icon --set-value=net.pcsx2.PCSX2 ${FLATPAK_DEST}/share/applications/net.pcsx2.PCSX2.desktop",
|
||||
"install -Dm644 .github/workflows/scripts/linux/flatpak/net.pcsx2.PCSX2.metainfo.xml ${FLATPAK_DEST}/share/metainfo/net.pcsx2.PCSX2.metainfo.xml"
|
||||
"cp -a bin \"${FLATPAK_DEST}\"",
|
||||
"install -Dm644 \"${FLATPAK_BUILDER_BUILDDIR}/bin/resources/icons/AppIconLarge.png\" \"${FLATPAK_DEST}/share/icons/hicolor/512x512/apps/net.pcsx2.PCSX2.png\"",
|
||||
"install -Dm644 \"${FLATPAK_BUILDER_BUILDDIR}/.github/workflows/scripts/linux/pcsx2-qt.desktop\" \"${FLATPAK_DEST}/share/applications/net.pcsx2.PCSX2.desktop\"",
|
||||
"desktop-file-edit --set-key=Icon --set-value=net.pcsx2.PCSX2 \"${FLATPAK_DEST}/share/applications/net.pcsx2.PCSX2.desktop\"",
|
||||
"install -Dm644 \"${FLATPAK_BUILDER_BUILDDIR}/.github/workflows/scripts/linux/flatpak/net.pcsx2.PCSX2.metainfo.xml\" \"${FLATPAK_DEST}/share/metainfo/net.pcsx2.PCSX2.metainfo.xml\"",
|
||||
"mkdir -p \"${FLATPAK_DEST}/lib/ffmpeg\""
|
||||
]
|
||||
}
|
||||
]
|
||||
|
||||
16
.github/workflows/scripts/linux/functions.sh
vendored
16
.github/workflows/scripts/linux/functions.sh
vendored
@@ -1,16 +0,0 @@
|
||||
#!/bin/bash
|
||||
|
||||
function retry_command {
|
||||
# Package servers tend to be unreliable at times..
|
||||
# Retry a bunch of times.
|
||||
local RETRIES=10
|
||||
|
||||
for i in $(seq 1 "$RETRIES"); do
|
||||
"$@" && break
|
||||
if [ "$i" == "$RETRIES" ]; then
|
||||
echo "Command \"$@\" failed after ${RETRIES} retries."
|
||||
exit 1
|
||||
fi
|
||||
done
|
||||
}
|
||||
|
||||
@@ -1,50 +0,0 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
set -e
|
||||
|
||||
if [[ -z "${DEPS_PREFIX}" ]]; then
|
||||
echo "DEPS_PREFIX is not set."
|
||||
exit 1
|
||||
fi
|
||||
|
||||
echo "Using build dependencies from: ${DEPS_PREFIX}"
|
||||
|
||||
if [ "${COMPILER}" = "clang" ]; then
|
||||
if [[ -z "${CLANG_PATH}" ]] || [[ -z "${CLANGXX_PATH}" ]]; then
|
||||
echo "CLANG_PATH or CLANGXX_PATH is not set."
|
||||
exit 1
|
||||
fi
|
||||
|
||||
echo "Using clang toolchain"
|
||||
cat > "clang-toolchain.cmake" << EOF
|
||||
set(CMAKE_C_COMPILER "${CLANG_PATH}")
|
||||
set(CMAKE_CXX_COMPILER "${CLANGXX_PATH}")
|
||||
set(CMAKE_EXE_LINKER_FLAGS_INIT "-fuse-ld=lld")
|
||||
set(CMAKE_MODULE_LINKER_FLAGS_INIT "-fuse-ld=lld")
|
||||
set(CMAKE_SHARED_LINKER_FLAGS_INIT "-fuse-ld=lld")
|
||||
EOF
|
||||
ADDITIONAL_CMAKE_ARGS="$ADDITIONAL_CMAKE_ARGS -DCMAKE_INTERPROCEDURAL_OPTIMIZATION=ON -DCMAKE_TOOLCHAIN_FILE=clang-toolchain.cmake"
|
||||
fi
|
||||
|
||||
echo "Additional CMake Args - ${ADDITIONAL_CMAKE_ARGS}"
|
||||
|
||||
# Generate CMake into ./build
|
||||
# DISABLE_ADVANCE_SIMD is needed otherwise we end up doing -march=native.
|
||||
|
||||
# shellcheck disable=SC2086
|
||||
cmake \
|
||||
-B build \
|
||||
-G Ninja \
|
||||
$ADDITIONAL_CMAKE_ARGS \
|
||||
-DCMAKE_CXX_COMPILER_LAUNCHER=ccache \
|
||||
-DCMAKE_BUILD_TYPE=Release \
|
||||
-DQT_BUILD=ON \
|
||||
-DCUBEB_API=ON \
|
||||
-DX11_API=ON \
|
||||
-DWAYLAND_API=ON \
|
||||
-DENABLE_SETCAP=OFF \
|
||||
-DCMAKE_PREFIX_PATH="${DEPS_PREFIX}" \
|
||||
-DUSE_SYSTEM_SDL2=ON \
|
||||
-DUSE_SYSTEM_ZSTD=OFF \
|
||||
-DDISABLE_ADVANCE_SIMD=TRUE
|
||||
|
||||
@@ -8,7 +8,7 @@ if [[ $# -lt 1 ]]; then
|
||||
fi
|
||||
|
||||
OUTFILE=$1
|
||||
GIT_DATE=$(git log -1 --pretty=%cd --date=short)
|
||||
GIT_DATE=$(git log -1 --pretty=%cd --date=iso8601)
|
||||
GIT_VERSION=$(git tag --points-at HEAD)
|
||||
GIT_HASH=$(git rev-parse HEAD)
|
||||
|
||||
|
||||
@@ -1,55 +0,0 @@
|
||||
#!/bin/bash
|
||||
|
||||
SCRIPTDIR=$(dirname "${BASH_SOURCE[0]}")
|
||||
source "$SCRIPTDIR/functions.sh"
|
||||
|
||||
set -e
|
||||
|
||||
ARCH=x86_64
|
||||
KDE_BRANCH=6.5
|
||||
BRANCH=22.08
|
||||
FLAT_MANAGER_CLIENT_DIR="$HOME/.local/bin"
|
||||
|
||||
# Build packages. Mostly needed for flat-manager-client.
|
||||
declare -a BUILD_PACKAGES=(
|
||||
"flatpak"
|
||||
"flatpak-builder"
|
||||
"appstream-util"
|
||||
"python3-aiohttp"
|
||||
"python3-tenacity"
|
||||
"python3-gi"
|
||||
"gobject-introspection"
|
||||
"libappstream-glib8"
|
||||
"libappstream-glib-dev"
|
||||
"libappstream-dev"
|
||||
"gir1.2-ostree-1.0"
|
||||
)
|
||||
|
||||
# Flatpak runtimes and SDKs.
|
||||
declare -a FLATPAK_PACKAGES=(
|
||||
"org.kde.Platform/${ARCH}/${KDE_BRANCH}"
|
||||
"org.kde.Sdk/${ARCH}/${KDE_BRANCH}"
|
||||
"org.freedesktop.Platform.ffmpeg-full/${ARCH}/${BRANCH}"
|
||||
"org.freedesktop.Sdk.Extension.llvm16/${ARCH}/${BRANCH}"
|
||||
"org.freedesktop.appstream-glib/${ARCH}/stable"
|
||||
)
|
||||
|
||||
retry_command sudo apt-get -qq update
|
||||
|
||||
# Install packages needed for building
|
||||
echo "Will install the following packages for building - ${BUILD_PACKAGES[*]}"
|
||||
retry_command sudo apt-get -y install "${BUILD_PACKAGES[@]}"
|
||||
|
||||
sudo flatpak remote-add --if-not-exists flathub https://flathub.org/repo/flathub.flatpakrepo
|
||||
|
||||
# Install packages needed for building
|
||||
echo "Will install the following packages for building - ${FLATPAK_PACKAGES[*]}"
|
||||
retry_command sudo flatpak -y install "${FLATPAK_PACKAGES[@]}"
|
||||
|
||||
echo "Downloading flat-manager-client"
|
||||
mkdir -p "$FLAT_MANAGER_CLIENT_DIR"
|
||||
pushd "$FLAT_MANAGER_CLIENT_DIR"
|
||||
aria2c -Z "https://raw.githubusercontent.com/flatpak/flat-manager/9401efbdc0d6bd489507d8401c567ba219d735d5/flat-manager-client"
|
||||
chmod +x flat-manager-client
|
||||
echo "$FLAT_MANAGER_CLIENT_DIR" >> $GITHUB_PATH
|
||||
popd
|
||||
@@ -1,83 +0,0 @@
|
||||
#!/bin/bash
|
||||
|
||||
SCRIPTDIR=$(dirname "${BASH_SOURCE[0]}")
|
||||
source "$SCRIPTDIR/functions.sh"
|
||||
|
||||
set -e
|
||||
|
||||
# Packages - Build and Qt
|
||||
declare -a BUILD_PACKAGES=(
|
||||
"build-essential"
|
||||
"g++"
|
||||
"git"
|
||||
"cmake"
|
||||
"ccache"
|
||||
"ninja-build"
|
||||
"patchelf"
|
||||
"libfuse2"
|
||||
"libglib2.0-dev"
|
||||
"libfontconfig1-dev"
|
||||
"libharfbuzz-dev"
|
||||
"libjpeg-dev"
|
||||
"libpng-dev"
|
||||
"libfreetype-dev"
|
||||
"libinput-dev"
|
||||
"libxcb-*-dev"
|
||||
"libxkbcommon-dev"
|
||||
"libxkbcommon-x11-dev"
|
||||
"libxrender-dev"
|
||||
"libwayland-dev"
|
||||
"libgl1-mesa-dev"
|
||||
"libegl-dev"
|
||||
"libegl1-mesa-dev"
|
||||
"libgl1-mesa-dev"
|
||||
"libssl-dev"
|
||||
)
|
||||
|
||||
# Packages - PCSX2
|
||||
declare -a PCSX2_PACKAGES=(
|
||||
"extra-cmake-modules"
|
||||
"libaio-dev"
|
||||
"libasound2-dev"
|
||||
"libbz2-dev"
|
||||
"libcurl4-openssl-dev"
|
||||
"libegl1-mesa-dev"
|
||||
"libgl1-mesa-dev"
|
||||
"libgtk-3-dev"
|
||||
"libharfbuzz-dev"
|
||||
"libjpeg-dev"
|
||||
"liblzma-dev"
|
||||
"libpcap0.8-dev"
|
||||
"libpng-dev"
|
||||
"libpulse-dev"
|
||||
"librsvg2-dev"
|
||||
"libsamplerate0-dev"
|
||||
"libudev-dev"
|
||||
"libx11-xcb-dev"
|
||||
"libavcodec-dev"
|
||||
"libavformat-dev"
|
||||
"libavutil-dev"
|
||||
"libswresample-dev"
|
||||
"libswscale-dev"
|
||||
"pkg-config"
|
||||
"zlib1g-dev"
|
||||
)
|
||||
|
||||
if [ "${COMPILER}" = "clang" ]; then
|
||||
BUILD_PACKAGES+=("llvm-16" "lld-16" "clang-16")
|
||||
|
||||
# Ubuntu 22.04 doesn't ship with LLVM 16, so we need to pull it from the llvm.org repos.
|
||||
retry_command wget -O - https://apt.llvm.org/llvm-snapshot.gpg.key | sudo apt-key add -
|
||||
sudo apt-add-repository -n 'deb http://apt.llvm.org/jammy/ llvm-toolchain-jammy-16 main'
|
||||
fi
|
||||
|
||||
retry_command sudo apt-get -qq update && break
|
||||
|
||||
# Install packages needed for building
|
||||
echo "Will install the following packages for building - ${BUILD_PACKAGES[*]}"
|
||||
retry_command sudo apt-get -y install "${BUILD_PACKAGES[@]}"
|
||||
|
||||
# Install packages needed by pcsx2
|
||||
PCSX2_PACKAGES=("${PCSX2_PACKAGES[@]}")
|
||||
echo "Will install the following packages for pcsx2 - ${PCSX2_PACKAGES[*]}"
|
||||
retry_command sudo apt-get -y install "${PCSX2_PACKAGES[@]}"
|
||||
@@ -2,203 +2,290 @@
|
||||
|
||||
set -e
|
||||
|
||||
export MACOSX_DEPLOYMENT_TARGET=10.14
|
||||
if [ "$#" -ne 1 ]; then
|
||||
echo "Syntax: $0 <output directory>"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# The bundled ffmpeg has a lot of things disabled to reduce code size.
|
||||
# Users may want to use system ffmpeg for additional features
|
||||
: ${BUILD_FFMPEG:=1}
|
||||
|
||||
export MACOSX_DEPLOYMENT_TARGET=11.0
|
||||
|
||||
INSTALLDIR="$HOME/deps"
|
||||
NPROCS="$(getconf _NPROCESSORS_ONLN)"
|
||||
SDL=SDL2-2.28.1
|
||||
PNG=1.6.37
|
||||
JPG=9e
|
||||
SOUNDTOUCH=soundtouch-2.3.1
|
||||
FFMPEG=6.0
|
||||
QT=6.4.3 # Currently stuck on Qt 6.4 due to 6.5 requiring macOS 11.0.
|
||||
SCRIPTDIR=$(realpath $(dirname "${BASH_SOURCE[0]}"))
|
||||
INSTALLDIR="$1"
|
||||
if [ "${INSTALLDIR:0:1}" != "/" ]; then
|
||||
INSTALLDIR="$PWD/$INSTALLDIR"
|
||||
fi
|
||||
|
||||
mkdir deps-build
|
||||
FREETYPE=2.13.2
|
||||
HARFBUZZ=8.3.1
|
||||
SDL=SDL2-2.30.3
|
||||
ZSTD=1.5.5
|
||||
LZ4=b8fd2d15309dd4e605070bd4486e26b6ef814e29
|
||||
LIBPNG=1.6.43
|
||||
LIBJPEG=9f
|
||||
LIBWEBP=1.3.2
|
||||
FFMPEG=6.0
|
||||
MOLTENVK=1.2.8
|
||||
QT=6.7.1
|
||||
|
||||
SHADERC=2024.1
|
||||
SHADERC_GLSLANG=142052fa30f9eca191aa9dcf65359fcaed09eeec
|
||||
SHADERC_SPIRVHEADERS=5e3ad389ee56fca27c9705d093ae5387ce404df4
|
||||
SHADERC_SPIRVTOOLS=dd4b663e13c07fea4fbb3f70c1c91c86731099f7
|
||||
|
||||
mkdir -p deps-build
|
||||
cd deps-build
|
||||
|
||||
export PKG_CONFIG_PATH="$INSTALLDIR/lib/pkgconfig:$PKG_CONFIG_PATH"
|
||||
export LDFLAGS="-L$INSTALLDIR/lib -dead_strip $LDFLAGS"
|
||||
export CFLAGS="-I$INSTALLDIR/include -Os $CFLAGS"
|
||||
export CXXFLAGS="-I$INSTALLDIR/include -Os $CXXFLAGS"
|
||||
export LDFLAGS="-L$INSTALLDIR/lib $LDFLAGS"
|
||||
export CFLAGS="-I$INSTALLDIR/include $CFLAGS"
|
||||
export CXXFLAGS="-I$INSTALLDIR/include $CXXFLAGS"
|
||||
CMAKE_COMMON=(
|
||||
-DCMAKE_BUILD_TYPE=Release
|
||||
-DCMAKE_SHARED_LINKER_FLAGS="-dead_strip -dead_strip_dylibs"
|
||||
-DCMAKE_PREFIX_PATH="$INSTALLDIR"
|
||||
-DCMAKE_INSTALL_PREFIX="$INSTALLDIR"
|
||||
-DCMAKE_OSX_ARCHITECTURES="x86_64"
|
||||
-DCMAKE_INSTALL_NAME_DIR='$<INSTALL_PREFIX>/lib'
|
||||
)
|
||||
|
||||
cat > SHASUMS <<EOF
|
||||
4977ceba5c0054dbe6c2f114641aced43ce3bf2b41ea64b6a372d6ba129cb15d $SDL.tar.gz
|
||||
505e70834d35383537b6491e7ae8641f1a4bed1876dbfe361201fc80868d88ca libpng-$PNG.tar.xz
|
||||
4077d6a6a75aeb01884f708919d25934c93305e49f7e3f36db9129320e6f4f3d jpegsrc.v$JPG.tar.gz
|
||||
6900996607258496ce126924a19fe9d598af9d892cf3f33d1e4daaa9b42ae0b1 $SOUNDTOUCH.tar.gz
|
||||
12991c4e55c506dd7f9b765933e62fd2be2e06d421505d7950a132e4f1bb484d freetype-$FREETYPE.tar.xz
|
||||
19a54fe9596f7a47c502549fce8e8a10978c697203774008cc173f8360b19a9a harfbuzz-$HARFBUZZ.tar.gz
|
||||
820440072f8f5b50188c1dae104f2ad25984de268785be40c41a099a510f0aec $SDL.tar.gz
|
||||
9c4396cc829cfae319a6e2615202e82aad41372073482fce286fac78646d3ee4 zstd-$ZSTD.tar.gz
|
||||
0728800155f3ed0a0c87e03addbd30ecbe374f7b080678bbca1506051d50dec3 $LZ4.tar.gz
|
||||
6a5ca0652392a2d7c9db2ae5b40210843c0bbc081cbd410825ab00cc59f14a6c libpng-$LIBPNG.tar.xz
|
||||
2a499607df669e40258e53d0ade8035ba4ec0175244869d1025d460562aa09b4 libwebp-$LIBWEBP.tar.gz
|
||||
04705c110cb2469caa79fb71fba3d7bf834914706e9641a4589485c1f832565b jpegsrc.v$LIBJPEG.tar.gz
|
||||
57be87c22d9b49c112b6d24bc67d42508660e6b718b3db89c44e47e289137082 ffmpeg-$FFMPEG.tar.xz
|
||||
5087c9e5b0165e7bc3c1a4ab176b35d0cd8f52636aea903fa377bdba00891a60 qtbase-everywhere-src-$QT.tar.xz
|
||||
0aff58062e74b84617c5da8325d8cdad5368d8f4d2a11ceafcd58329fe99b798 qtimageformats-everywhere-src-$QT.tar.xz
|
||||
88315f886cf81898705e487cedba6e6160724359d23c518c92c333c098879a4a qtsvg-everywhere-src-$QT.tar.xz
|
||||
867df829cd5cd3ae8efe62e825503123542764b13c96953511e567df70c5a091 qttools-everywhere-src-$QT.tar.xz
|
||||
79e56b7800d49649a8a8010818538c367a829e0b7a09d5f60bd3aecf5abe972c qttranslations-everywhere-src-$QT.tar.xz
|
||||
85beaf8abfcc54d9da0ff0257ae311abd9e7aa96e53da37e1c37d6bc04ac83cd v$MOLTENVK.tar.gz
|
||||
b7338da1bdccb4d861e714efffaa83f174dfe37e194916bfd7ec82279a6ace19 qtbase-everywhere-src-$QT.tar.xz
|
||||
a733b98f771064d000476b8861f822143982749448ba8abf9f1813edb8dfe79f qtimageformats-everywhere-src-$QT.tar.xz
|
||||
3ed5b80f7228c41dd463b7a57284ed273d224d1c323c0dd78c5209635807cbce qtsvg-everywhere-src-$QT.tar.xz
|
||||
0953cddf6248f3959279a10904892e8a98eb3e463d729a174b6fc47febd99824 qttools-everywhere-src-$QT.tar.xz
|
||||
03d71565872b0e0e7303349071df031ab0f922f6dbdd3a5ec1ade9e188e4fbf4 qttranslations-everywhere-src-$QT.tar.xz
|
||||
eb3b5f0c16313d34f208d90c2fa1e588a23283eed63b101edd5422be6165d528 shaderc-$SHADERC.tar.gz
|
||||
aa27e4454ce631c5a17924ce0624eac736da19fc6f5a2ab15a6c58da7b36950f shaderc-glslang-$SHADERC_GLSLANG.tar.gz
|
||||
5d866ce34a4b6908e262e5ebfffc0a5e11dd411640b5f24c85a80ad44c0d4697 shaderc-spirv-headers-$SHADERC_SPIRVHEADERS.tar.gz
|
||||
03ee1a2c06f3b61008478f4abe9423454e53e580b9488b47c8071547c6a9db47 shaderc-spirv-tools-$SHADERC_SPIRVTOOLS.tar.gz
|
||||
EOF
|
||||
|
||||
curl -L \
|
||||
-o "freetype-$FREETYPE.tar.xz" "https://sourceforge.net/projects/freetype/files/freetype2/$FREETYPE/freetype-$FREETYPE.tar.xz/download" \
|
||||
-o "harfbuzz-$HARFBUZZ.tar.gz" "https://github.com/harfbuzz/harfbuzz/archive/refs/tags/$HARFBUZZ.tar.gz" \
|
||||
-O "https://libsdl.org/release/$SDL.tar.gz" \
|
||||
-O "https://downloads.sourceforge.net/project/libpng/libpng16/$PNG/libpng-$PNG.tar.xz" \
|
||||
-O "https://www.ijg.org/files/jpegsrc.v$JPG.tar.gz" \
|
||||
-O "https://www.surina.net/soundtouch/$SOUNDTOUCH.tar.gz" \
|
||||
-O "https://github.com/facebook/zstd/releases/download/v$ZSTD/zstd-$ZSTD.tar.gz" \
|
||||
-O "https://github.com/lz4/lz4/archive/$LZ4.tar.gz" \
|
||||
-O "https://downloads.sourceforge.net/project/libpng/libpng16/$LIBPNG/libpng-$LIBPNG.tar.xz" \
|
||||
-O "https://ijg.org/files/jpegsrc.v$LIBJPEG.tar.gz" \
|
||||
-O "https://storage.googleapis.com/downloads.webmproject.org/releases/webp/libwebp-$LIBWEBP.tar.gz" \
|
||||
-O "https://ffmpeg.org/releases/ffmpeg-$FFMPEG.tar.xz" \
|
||||
-O "https://github.com/KhronosGroup/MoltenVK/archive/refs/tags/v$MOLTENVK.tar.gz" \
|
||||
-O "https://download.qt.io/official_releases/qt/${QT%.*}/$QT/submodules/qtbase-everywhere-src-$QT.tar.xz" \
|
||||
-O "https://download.qt.io/official_releases/qt/${QT%.*}/$QT/submodules/qtimageformats-everywhere-src-$QT.tar.xz" \
|
||||
-O "https://download.qt.io/official_releases/qt/${QT%.*}/$QT/submodules/qtsvg-everywhere-src-$QT.tar.xz" \
|
||||
-O "https://download.qt.io/official_releases/qt/${QT%.*}/$QT/submodules/qttools-everywhere-src-$QT.tar.xz" \
|
||||
-O "https://download.qt.io/official_releases/qt/${QT%.*}/$QT/submodules/qttranslations-everywhere-src-$QT.tar.xz" \
|
||||
-o "shaderc-$SHADERC.tar.gz" "https://github.com/google/shaderc/archive/refs/tags/v$SHADERC.tar.gz" \
|
||||
-o "shaderc-glslang-$SHADERC_GLSLANG.tar.gz" "https://github.com/KhronosGroup/glslang/archive/$SHADERC_GLSLANG.tar.gz" \
|
||||
-o "shaderc-spirv-headers-$SHADERC_SPIRVHEADERS.tar.gz" "https://github.com/KhronosGroup/SPIRV-Headers/archive/$SHADERC_SPIRVHEADERS.tar.gz" \
|
||||
-o "shaderc-spirv-tools-$SHADERC_SPIRVTOOLS.tar.gz" "https://github.com/KhronosGroup/SPIRV-Tools/archive/$SHADERC_SPIRVTOOLS.tar.gz"
|
||||
|
||||
shasum -a 256 --check SHASUMS
|
||||
|
||||
echo "Installing SDL..."
|
||||
rm -fr "$SDL"
|
||||
tar xf "$SDL.tar.gz"
|
||||
cd "$SDL"
|
||||
./configure --prefix "$INSTALLDIR" --without-x
|
||||
make "-j$NPROCS"
|
||||
make install
|
||||
cmake -B build "${CMAKE_COMMON[@]}" -DSDL_X11=OFF -DBUILD_SHARED_LIBS=ON
|
||||
make -C build "-j$NPROCS"
|
||||
make -C build install
|
||||
cd ..
|
||||
|
||||
if [ "$BUILD_FFMPEG" -ne 0 ]; then
|
||||
echo "Installing FFmpeg..."
|
||||
rm -fr "ffmpeg-$FFMPEG"
|
||||
tar xf "ffmpeg-$FFMPEG.tar.xz"
|
||||
cd "ffmpeg-$FFMPEG"
|
||||
LDFLAGS="-dead_strip $LDFLAGS" CFLAGS="-Os $CFLAGS" CXXFLAGS="-Os $CXXFLAGS" \
|
||||
./configure --prefix="$INSTALLDIR" \
|
||||
--enable-cross-compile --arch=x86_64 --cc='clang -arch x86_64' --cxx='clang++ -arch x86_64' \
|
||||
--disable-all --disable-autodetect --disable-static --enable-shared \
|
||||
--enable-avcodec --enable-avformat --enable-avutil --enable-swresample --enable-swscale \
|
||||
--enable-audiotoolbox --enable-videotoolbox \
|
||||
--enable-encoder=ffv1,qtrle,pcm_s16be,pcm_s16le,*_at,*_videotoolbox \
|
||||
--enable-muxer=avi,matroska,mov,mp3,mp4,wav \
|
||||
--enable-protocol=file
|
||||
make "-j$NPROCS"
|
||||
make install
|
||||
cd ..
|
||||
fi
|
||||
|
||||
echo "Installing Zstd..."
|
||||
rm -fr "zstd-$ZSTD"
|
||||
tar xf "zstd-$ZSTD.tar.gz"
|
||||
cd "zstd-$ZSTD"
|
||||
cmake "${CMAKE_COMMON[@]}" -DBUILD_SHARED_LIBS=ON -DZSTD_BUILD_PROGRAMS=OFF -B build-dir build/cmake
|
||||
make -C build-dir "-j$NPROCS"
|
||||
make -C build-dir install
|
||||
cd ..
|
||||
|
||||
echo "Installing LZ4..."
|
||||
rm -fr "lz4-$LZ4"
|
||||
tar xf "$LZ4.tar.gz"
|
||||
cd "lz4-$LZ4"
|
||||
cmake "${CMAKE_COMMON[@]}" -DBUILD_SHARED_LIBS=ON -DLZ4_BUILD_CLI=OFF -DLZ4_BUILD_LEGACY_LZ4C=OFF -B build-dir build/cmake
|
||||
make -C build-dir "-j$NPROCS"
|
||||
make -C build-dir install
|
||||
cd ..
|
||||
|
||||
echo "Installing libpng..."
|
||||
tar xf "libpng-$PNG.tar.xz"
|
||||
cd "libpng-$PNG"
|
||||
./configure --prefix "$INSTALLDIR" --disable-dependency-tracking
|
||||
make "-j$NPROCS"
|
||||
make install
|
||||
rm -fr "libpng-$LIBPNG"
|
||||
tar xf "libpng-$LIBPNG.tar.xz"
|
||||
cd "libpng-$LIBPNG"
|
||||
cmake "${CMAKE_COMMON[@]}" -DBUILD_SHARED_LIBS=ON -DPNG_TESTS=OFF -DPNG_FRAMEWORK=OFF -B build
|
||||
make -C build "-j$NPROCS"
|
||||
make -C build install
|
||||
cd ..
|
||||
|
||||
echo "Installing libjpeg..."
|
||||
tar xf "jpegsrc.v$JPG.tar.gz"
|
||||
cd "jpeg-$JPG"
|
||||
./configure --prefix "$INSTALLDIR" --disable-dependency-tracking
|
||||
rm -fr "jpeg-$LIBJPEG"
|
||||
tar xf "jpegsrc.v$LIBJPEG.tar.gz"
|
||||
cd "jpeg-$LIBJPEG"
|
||||
mkdir build
|
||||
cd build
|
||||
../configure --prefix="$INSTALLDIR" --disable-static --enable-shared --host="x86_64-apple-darwin" CFLAGS="-arch x86_64"
|
||||
make "-j$NPROCS"
|
||||
make install
|
||||
cd ..
|
||||
cd ../..
|
||||
|
||||
echo "Installing soundtouch..."
|
||||
tar xf "$SOUNDTOUCH.tar.gz"
|
||||
cd "$SOUNDTOUCH"
|
||||
cmake -B build -DCMAKE_INSTALL_PREFIX="$INSTALLDIR" -DCMAKE_BUILD_TYPE=MinSizeRel
|
||||
echo "Installing WebP..."
|
||||
rm -fr "libwebp-$LIBWEBP"
|
||||
tar xf "libwebp-$LIBWEBP.tar.gz"
|
||||
cd "libwebp-$LIBWEBP"
|
||||
cmake "${CMAKE_COMMON[@]}" -B build \
|
||||
-DWEBP_BUILD_ANIM_UTILS=OFF -DWEBP_BUILD_CWEBP=OFF -DWEBP_BUILD_DWEBP=OFF -DWEBP_BUILD_GIF2WEBP=OFF -DWEBP_BUILD_IMG2WEBP=OFF \
|
||||
-DWEBP_BUILD_VWEBP=OFF -DWEBP_BUILD_WEBPINFO=OFF -DWEBP_BUILD_WEBPMUX=OFF -DWEBP_BUILD_EXTRAS=OFF -DBUILD_SHARED_LIBS=ON
|
||||
make -C build "-j$NPROCS"
|
||||
make -C build install
|
||||
cd ..
|
||||
|
||||
echo "Installing FFmpeg..."
|
||||
tar xf "ffmpeg-$FFMPEG.tar.xz"
|
||||
cd "ffmpeg-$FFMPEG"
|
||||
./configure --prefix="$INSTALLDIR" --disable-all --disable-autodetect --disable-static --enable-shared \
|
||||
--enable-avcodec --enable-avformat --enable-avutil --enable-swresample --enable-swscale \
|
||||
--enable-audiotoolbox --enable-videotoolbox \
|
||||
--enable-encoder=ffv1,qtrle,pcm_s16be,pcm_s16le,*_at,*_videotoolbox \
|
||||
--enable-muxer=avi,matroska,mov,mp3,mp4,wav \
|
||||
--enable-protocol=file
|
||||
make "-j$NPROCS"
|
||||
make install
|
||||
echo "Building FreeType without HarfBuzz..."
|
||||
rm -fr "freetype-$FREETYPE"
|
||||
tar xf "freetype-$FREETYPE.tar.xz"
|
||||
cd "freetype-$FREETYPE"
|
||||
cmake "${CMAKE_COMMON[@]}" -DBUILD_SHARED_LIBS=ON -DFT_REQUIRE_ZLIB=ON -DFT_REQUIRE_PNG=ON -DFT_DISABLE_BZIP2=TRUE -DFT_DISABLE_BROTLI=TRUE -DFT_DISABLE_HARFBUZZ=TRUE -B build
|
||||
cmake --build build --parallel
|
||||
cmake --install build
|
||||
cd ..
|
||||
|
||||
echo "Building HarfBuzz..."
|
||||
rm -fr "harfbuzz-$HARFBUZZ"
|
||||
tar xf "harfbuzz-$HARFBUZZ.tar.gz"
|
||||
cd "harfbuzz-$HARFBUZZ"
|
||||
cmake "${CMAKE_COMMON[@]}" -DBUILD_SHARED_LIBS=ON -DHB_BUILD_UTILS=OFF -B build
|
||||
cmake --build build --parallel
|
||||
cmake --install build
|
||||
cd ..
|
||||
|
||||
echo "Building FreeType with HarfBuzz..."
|
||||
rm -fr "freetype-$FREETYPE"
|
||||
tar xf "freetype-$FREETYPE.tar.xz"
|
||||
cd "freetype-$FREETYPE"
|
||||
cmake "${CMAKE_COMMON[@]}" -DBUILD_SHARED_LIBS=ON -DFT_REQUIRE_ZLIB=ON -DFT_REQUIRE_PNG=ON -DFT_DISABLE_BZIP2=TRUE -DFT_DISABLE_BROTLI=TRUE -DFT_REQUIRE_HARFBUZZ=TRUE -B build
|
||||
cmake --build build --parallel
|
||||
cmake --install build
|
||||
cd ..
|
||||
|
||||
# MoltenVK already builds universal binaries, nothing special to do here.
|
||||
echo "Installing MoltenVK..."
|
||||
rm -fr "MoltenVK-${MOLTENVK}"
|
||||
tar xf "v$MOLTENVK.tar.gz"
|
||||
cd "MoltenVK-${MOLTENVK}"
|
||||
sed -i '' 's/xcodebuild "$@"/xcodebuild $XCODEBUILD_EXTRA_ARGS "$@"/g' fetchDependencies
|
||||
sed -i '' 's/XCODEBUILD :=/XCODEBUILD ?=/g' Makefile
|
||||
XCODEBUILD_EXTRA_ARGS="VALID_ARCHS=x86_64" ./fetchDependencies --macos
|
||||
XCODEBUILD="set -o pipefail && xcodebuild VALID_ARCHS=x86_64" make macos
|
||||
cp Package/Latest/MoltenVK/dynamic/dylib/macOS/libMoltenVK.dylib "$INSTALLDIR/lib/"
|
||||
cd ..
|
||||
|
||||
echo "Installing Qt Base..."
|
||||
rm -fr "qtbase-everywhere-src-$QT"
|
||||
tar xf "qtbase-everywhere-src-$QT.tar.xz"
|
||||
cd "qtbase-everywhere-src-$QT"
|
||||
# Qt's panel:shouldEnableURL: implementation does a whole bunch of things that activate macOS's sandbox permissions dialog
|
||||
# Since this is called on every file being displayed in the open/save panel, that spams users with permissions dialogs
|
||||
# Simple solution: Hopefully no one needs any filters that aren't simple file extension filters, remove all other handling
|
||||
patch -u src/plugins/platforms/cocoa/qcocoafiledialoghelper.mm <<EOF
|
||||
--- src/plugins/platforms/cocoa/qcocoafiledialoghelper.mm
|
||||
+++ src/plugins/platforms/cocoa/qcocoafiledialoghelper.mm
|
||||
@@ -133,7 +133,5 @@
|
||||
NSURL *url = [NSURL fileURLWithPath:filepath isDirectory:info.isDir()];
|
||||
- bool selectable = (m_options->acceptMode() == QFileDialogOptions::AcceptSave)
|
||||
- || [self panel:m_panel shouldEnableURL:url];
|
||||
|
||||
# since we don't have a direct reference to QtSvg, it doesn't deployed directly from the main binary
|
||||
# (only indirectly from iconengines), and the libqsvg.dylib imageformat plugin does not get deployed.
|
||||
# We could run macdeployqt twice, but that's even more janky than patching it.
|
||||
|
||||
# https://github.com/qt/qtbase/commit/7b018629c3c3ab23665bf1da00c43c1546042035
|
||||
# The QProcess default wait time of 30s may be too short in e.g. CI environments where processes may be blocked
|
||||
# for a longer time waiting for CPU or IO.
|
||||
|
||||
patch -u src/tools/macdeployqt/shared/shared.cpp <<EOF
|
||||
--- shared.cpp
|
||||
+++ shared.cpp
|
||||
@@ -152,7 +152,7 @@
|
||||
LogDebug() << " inspecting" << binaryPath;
|
||||
QProcess otool;
|
||||
otool.start("otool", QStringList() << "-L" << binaryPath);
|
||||
- otool.waitForFinished();
|
||||
+ otool.waitForFinished(-1);
|
||||
|
||||
m_panel.directoryURL = [NSURL fileURLWithPath:m_currentDirectory];
|
||||
- m_panel.nameFieldStringValue = selectable ? info.fileName().toNSString() : @"";
|
||||
+ m_panel.nameFieldStringValue = info.fileName().toNSString();
|
||||
if (otool.exitStatus() != QProcess::NormalExit || otool.exitCode() != 0) {
|
||||
LogError() << otool.readAllStandardError();
|
||||
@@ -1122,14 +1122,8 @@
|
||||
addPlugins(QStringLiteral("networkinformation"));
|
||||
}
|
||||
|
||||
@@ -203,61 +201,2 @@
|
||||
return hidden;
|
||||
-}
|
||||
- // All image formats (svg if QtSvg is used)
|
||||
- const bool usesSvg = deploymentInfo.containsModule("Svg", libInfix);
|
||||
- addPlugins(QStringLiteral("imageformats"), [usesSvg](const QString &lib) {
|
||||
- if (lib.contains(QStringLiteral("qsvg")) && !usesSvg)
|
||||
- return false;
|
||||
- return true;
|
||||
- });
|
||||
-
|
||||
-- (BOOL)panel:(id)sender shouldEnableURL:(NSURL *)url
|
||||
-{
|
||||
- Q_UNUSED(sender);
|
||||
-
|
||||
- NSString *filename = url.path;
|
||||
- if (!filename.length)
|
||||
- return NO;
|
||||
-
|
||||
- // Always accept directories regardless of their names (unless it is a bundle):
|
||||
- NSFileManager *fm = NSFileManager.defaultManager;
|
||||
- NSDictionary *fileAttrs = [fm attributesOfItemAtPath:filename error:nil];
|
||||
- if (!fileAttrs)
|
||||
- return NO; // Error accessing the file means 'no'.
|
||||
- NSString *fileType = fileAttrs.fileType;
|
||||
- bool isDir = [fileType isEqualToString:NSFileTypeDirectory];
|
||||
- if (isDir) {
|
||||
- if (!m_panel.treatsFilePackagesAsDirectories) {
|
||||
- if ([NSWorkspace.sharedWorkspace isFilePackageAtPath:filename] == NO)
|
||||
- return YES;
|
||||
- }
|
||||
- }
|
||||
-
|
||||
- // Treat symbolic links and aliases to directories like directories
|
||||
- QFileInfo fileInfo(QString::fromNSString(filename));
|
||||
- if (fileInfo.isSymLink() && QFileInfo(fileInfo.symLinkTarget()).isDir())
|
||||
- return YES;
|
||||
-
|
||||
- QString qtFileName = fileInfo.fileName();
|
||||
- // No filter means accept everything
|
||||
- bool nameMatches = m_selectedNameFilter->isEmpty();
|
||||
- // Check if the current file name filter accepts the file:
|
||||
- for (int i = 0; !nameMatches && i < m_selectedNameFilter->size(); ++i) {
|
||||
- if (QDir::match(m_selectedNameFilter->at(i), qtFileName))
|
||||
- nameMatches = true;
|
||||
- }
|
||||
- if (!nameMatches)
|
||||
- return NO;
|
||||
-
|
||||
- QDir::Filters filter = m_options->filter();
|
||||
- if ((!(filter & (QDir::Dirs | QDir::AllDirs)) && isDir)
|
||||
- || (!(filter & QDir::Files) && [fileType isEqualToString:NSFileTypeRegular])
|
||||
- || ((filter & QDir::NoSymLinks) && [fileType isEqualToString:NSFileTypeSymbolicLink]))
|
||||
- return NO;
|
||||
-
|
||||
- bool filterPermissions = ((filter & QDir::PermissionMask)
|
||||
- && (filter & QDir::PermissionMask) != QDir::PermissionMask);
|
||||
- if (filterPermissions) {
|
||||
- if ((!(filter & QDir::Readable) && [fm isReadableFileAtPath:filename])
|
||||
- || (!(filter & QDir::Writable) && [fm isWritableFileAtPath:filename])
|
||||
- || (!(filter & QDir::Executable) && [fm isExecutableFileAtPath:filename]))
|
||||
- return NO;
|
||||
- }
|
||||
- if (!(filter & QDir::Hidden)
|
||||
- && (qtFileName.startsWith(u'.') || [self isHiddenFileAtURL:url]))
|
||||
- return NO;
|
||||
-
|
||||
- return YES;
|
||||
}
|
||||
@@ -406,5 +345,2 @@
|
||||
{
|
||||
- if (m_options->acceptMode() != QFileDialogOptions::AcceptSave)
|
||||
- return nil; // panel:shouldEnableURL: does the file filtering for NSOpenPanel
|
||||
-
|
||||
QStringList fileTypes;
|
||||
+ // All image formats
|
||||
+ addPlugins(QStringLiteral("imageformats"));
|
||||
addPlugins(QStringLiteral("iconengines"));
|
||||
|
||||
// Platforminputcontext plugins if QtGui is in use
|
||||
EOF
|
||||
cmake -B build -DCMAKE_PREFIX_PATH="$INSTALLDIR" -DCMAKE_INSTALL_PREFIX="$INSTALLDIR" -DCMAKE_BUILD_TYPE=Release -DFEATURE_optimize_size=ON -DFEATURE_dbus=OFF -DFEATURE_framework=OFF -DFEATURE_icu=OFF -DFEATURE_opengl=OFF -DFEATURE_printsupport=OFF -DFEATURE_sql=OFF -DFEATURE_gssapi=OFF
|
||||
cmake -B build "${CMAKE_COMMON[@]}" -DFEATURE_dbus=OFF -DFEATURE_framework=OFF -DFEATURE_icu=OFF -DFEATURE_opengl=OFF -DFEATURE_printsupport=OFF -DFEATURE_sql=OFF -DFEATURE_gssapi=OFF -DFEATURE_system_png=ON -DFEATURE_system_jpeg=ON -DFEATURE_system_zlib=ON -DFEATURE_system_freetype=ON -DFEATURE_system_harfbuzz=ON
|
||||
make -C build "-j$NPROCS"
|
||||
make -C build install
|
||||
cd ..
|
||||
|
||||
echo "Installing Qt SVG..."
|
||||
rm -fr "qtsvg-everywhere-src-$QT"
|
||||
tar xf "qtsvg-everywhere-src-$QT.tar.xz"
|
||||
cd "qtsvg-everywhere-src-$QT"
|
||||
cmake -B build -DCMAKE_PREFIX_PATH="$INSTALLDIR" -DCMAKE_INSTALL_PREFIX="$INSTALLDIR" -DCMAKE_BUILD_TYPE=MinSizeRel
|
||||
make -C build "-j$NPROCS"
|
||||
make -C build install
|
||||
cd ..
|
||||
mkdir build
|
||||
cd build
|
||||
"$INSTALLDIR/bin/qt-configure-module" .. -- "${CMAKE_COMMON[@]}"
|
||||
make "-j$NPROCS"
|
||||
make install
|
||||
cd ../..
|
||||
|
||||
echo "Installing Qt Image Formats..."
|
||||
rm -fr "qtimageformats-everywhere-src-$QT"
|
||||
tar xf "qtimageformats-everywhere-src-$QT.tar.xz"
|
||||
cd "qtimageformats-everywhere-src-$QT"
|
||||
cmake -B build -DCMAKE_PREFIX_PATH="$INSTALLDIR" -DCMAKE_INSTALL_PREFIX="$INSTALLDIR" -DCMAKE_BUILD_TYPE=MinSizeRel
|
||||
make -C build "-j$NPROCS"
|
||||
make -C build install
|
||||
cd ..
|
||||
mkdir build
|
||||
cd build
|
||||
"$INSTALLDIR/bin/qt-configure-module" .. -- "${CMAKE_COMMON[@]}" -DFEATURE_system_webp=ON
|
||||
make "-j$NPROCS"
|
||||
make install
|
||||
cd ../..
|
||||
|
||||
echo "Installing Qt Tools..."
|
||||
rm -fr "qttools-everywhere-src-$QT"
|
||||
tar xf "qttools-everywhere-src-$QT.tar.xz"
|
||||
cd "qttools-everywhere-src-$QT"
|
||||
# Linguist relies on a library in the Designer target, which takes 5-7 minutes to build on the CI
|
||||
@@ -215,18 +302,42 @@ patch -u src/linguist/CMakeLists.txt <<EOF
|
||||
add_subdirectory(linguist)
|
||||
endif()
|
||||
EOF
|
||||
cmake -B build -DCMAKE_PREFIX_PATH="$INSTALLDIR" -DCMAKE_INSTALL_PREFIX="$INSTALLDIR" -DCMAKE_BUILD_TYPE=Release -DFEATURE_assistant=OFF -DFEATURE_clang=OFF -DFEATURE_designer=OFF -DFEATURE_kmap2qmap=OFF -DFEATURE_pixeltool=OFF -DFEATURE_pkg_config=OFF -DFEATURE_qev=OFF -DFEATURE_qtattributionsscanner=OFF -DFEATURE_qtdiag=OFF -DFEATURE_qtplugininfo=OFF
|
||||
make -C build "-j$NPROCS"
|
||||
make -C build install
|
||||
mkdir build
|
||||
cd build
|
||||
"$INSTALLDIR/bin/qt-configure-module" .. -- "${CMAKE_COMMON[@]}" -DFEATURE_assistant=OFF -DFEATURE_clang=OFF -DFEATURE_designer=OFF -DFEATURE_kmap2qmap=OFF -DFEATURE_pixeltool=OFF -DFEATURE_pkg_config=OFF -DFEATURE_qev=OFF -DFEATURE_qtattributionsscanner=OFF -DFEATURE_qtdiag=OFF -DFEATURE_qtplugininfo=OFF
|
||||
make "-j$NPROCS"
|
||||
make install
|
||||
cd ../..
|
||||
|
||||
echo "Building shaderc..."
|
||||
rm -fr "shaderc-$SHADERC"
|
||||
tar xf "shaderc-$SHADERC.tar.gz"
|
||||
cd "shaderc-$SHADERC"
|
||||
cd third_party
|
||||
tar xf "../../shaderc-glslang-$SHADERC_GLSLANG.tar.gz"
|
||||
mv "glslang-$SHADERC_GLSLANG" "glslang"
|
||||
tar xf "../../shaderc-spirv-headers-$SHADERC_SPIRVHEADERS.tar.gz"
|
||||
mv "SPIRV-Headers-$SHADERC_SPIRVHEADERS" "spirv-headers"
|
||||
tar xf "../../shaderc-spirv-tools-$SHADERC_SPIRVTOOLS.tar.gz"
|
||||
mv "SPIRV-Tools-$SHADERC_SPIRVTOOLS" "spirv-tools"
|
||||
cd ..
|
||||
echo "Installing Qt Translations..."
|
||||
tar xf "qttranslations-everywhere-src-$QT.tar.xz"
|
||||
cd "qttranslations-everywhere-src-$QT"
|
||||
cmake -B build -DCMAKE_PREFIX_PATH="$INSTALLDIR" -DCMAKE_INSTALL_PREFIX="$INSTALLDIR" -DCMAKE_BUILD_TYPE=Release
|
||||
patch -p1 < "$SCRIPTDIR/../common/shaderc-changes.patch"
|
||||
cmake "${CMAKE_COMMON[@]}" "$CMAKE_ARCH_UNIVERSAL" -DSHADERC_SKIP_TESTS=ON -DSHADERC_SKIP_EXAMPLES=ON -DSHADERC_SKIP_COPYRIGHT_CHECK=ON -B build
|
||||
make -C build "-j$NPROCS"
|
||||
make -C build install
|
||||
cd ..
|
||||
|
||||
echo "Installing Qt Translations..."
|
||||
rm -fr "qttranslations-everywhere-src-$QT"
|
||||
tar xf "qttranslations-everywhere-src-$QT.tar.xz"
|
||||
cd "qttranslations-everywhere-src-$QT"
|
||||
mkdir build
|
||||
cd build
|
||||
"$INSTALLDIR/bin/qt-configure-module" .. -- "${CMAKE_COMMON[@]}"
|
||||
make "-j$NPROCS"
|
||||
make install
|
||||
cd ../..
|
||||
|
||||
echo "Cleaning up..."
|
||||
cd ..
|
||||
rm -r deps-build
|
||||
rm -rf deps-build
|
||||
|
||||
@@ -1,7 +1,58 @@
|
||||
import { MessageEmbed, WebhookClient } from "discord.js";
|
||||
import * as github from '@actions/github';
|
||||
import { Octokit } from "@octokit/rest";
|
||||
import { throttling } from "@octokit/plugin-throttling";
|
||||
import { retry } from "@octokit/plugin-retry";
|
||||
|
||||
const releaseInfo = github.context.payload.release;
|
||||
let owner = process.env.OWNER;
|
||||
let repo = process.env.REPO;
|
||||
|
||||
Octokit.plugin(throttling);
|
||||
Octokit.plugin(retry);
|
||||
const octokit = new Octokit({
|
||||
auth: process.env.GITHUB_TOKEN,
|
||||
userAgent: `${owner}/${repo}`,
|
||||
log: {
|
||||
debug: () => { },
|
||||
info: () => { },
|
||||
warn: console.warn,
|
||||
error: console.error
|
||||
},
|
||||
throttle: {
|
||||
onRateLimit: (retryAfter, options) => {
|
||||
octokit.log.warn(
|
||||
`Request quota exhausted for request ${options.method} ${options.url}`
|
||||
);
|
||||
|
||||
// Retry twice after hitting a rate limit error, then give up
|
||||
if (options.request.retryCount <= 2) {
|
||||
console.log(`Retrying after ${retryAfter} seconds!`);
|
||||
return true;
|
||||
}
|
||||
},
|
||||
onAbuseLimit: (retryAfter, options) => {
|
||||
// does not retry, only logs a warning
|
||||
octokit.log.warn(
|
||||
`Abuse detected for request ${options.method} ${options.url}`
|
||||
);
|
||||
},
|
||||
}
|
||||
});
|
||||
|
||||
if (process.env.TAG_VAL === undefined || process.env.TAG_VAL === "") {
|
||||
console.log(`Not announcing - TAG_VAL not defined`);
|
||||
process.exit(1);
|
||||
}
|
||||
|
||||
const { data: releaseInfo } = await octokit.rest.repos.getReleaseByTag({
|
||||
owner: owner,
|
||||
repo: repo,
|
||||
tag: process.env.TAG_VAL,
|
||||
});
|
||||
|
||||
if (releaseInfo === undefined) {
|
||||
console.log(`Not announcing - could not locate release with tag ${process.env.TAG_VAL}`);
|
||||
process.exit(1);
|
||||
}
|
||||
|
||||
if (!releaseInfo.prerelease) {
|
||||
console.log("Not announcing - release was not a pre-release (aka a Nightly)");
|
||||
@@ -18,6 +69,7 @@ const embed = new MessageEmbed()
|
||||
{ name: 'Installation Steps', value: '[See Here](https://github.com/PCSX2/pcsx2/wiki/Nightly-Build-Usage-Guide)', inline: true },
|
||||
{ name: 'Included Changes', value: releaseInfo.body, inline: false }
|
||||
);
|
||||
console.log(embed);
|
||||
|
||||
// Get all webhooks, simple comma-sep string
|
||||
const webhookUrls = process.env.DISCORD_BUILD_WEBHOOK.split(",");
|
||||
|
||||
141
.github/workflows/scripts/releases/announce-release/package-lock.json
generated
vendored
141
.github/workflows/scripts/releases/announce-release/package-lock.json
generated
vendored
@@ -5,32 +5,16 @@
|
||||
"requires": true,
|
||||
"packages": {
|
||||
"": {
|
||||
"name": "announce-release",
|
||||
"version": "1.0.0",
|
||||
"license": "ISC",
|
||||
"dependencies": {
|
||||
"@actions/github": "^5.0.0",
|
||||
"@octokit/plugin-retry": "^3.0.9",
|
||||
"@octokit/plugin-throttling": "^3.5.2",
|
||||
"@octokit/rest": "^18.12.0",
|
||||
"discord.js": "^13.2.0"
|
||||
}
|
||||
},
|
||||
"node_modules/@actions/github": {
|
||||
"version": "5.0.0",
|
||||
"resolved": "https://registry.npmjs.org/@actions/github/-/github-5.0.0.tgz",
|
||||
"integrity": "sha512-QvE9eAAfEsS+yOOk0cylLBIO/d6WyWIOvsxxzdrPFaud39G6BOkUwScXZn1iBzQzHyu9SBkkLSWlohDWdsasAQ==",
|
||||
"dependencies": {
|
||||
"@actions/http-client": "^1.0.11",
|
||||
"@octokit/core": "^3.4.0",
|
||||
"@octokit/plugin-paginate-rest": "^2.13.3",
|
||||
"@octokit/plugin-rest-endpoint-methods": "^5.1.1"
|
||||
}
|
||||
},
|
||||
"node_modules/@actions/http-client": {
|
||||
"version": "1.0.11",
|
||||
"resolved": "https://registry.npmjs.org/@actions/http-client/-/http-client-1.0.11.tgz",
|
||||
"integrity": "sha512-VRYHGQV1rqnROJqdMvGUbY/Kn8vriQe/F9HR2AlYHzmKuM/p3kjNuXhmdBfcVgsvRWTz5C5XW5xvndZrVBuAYg==",
|
||||
"dependencies": {
|
||||
"tunnel": "0.0.6"
|
||||
}
|
||||
},
|
||||
"node_modules/@discordjs/builders": {
|
||||
"version": "0.6.0",
|
||||
"resolved": "https://registry.npmjs.org/@discordjs/builders/-/builders-0.6.0.tgz",
|
||||
@@ -131,6 +115,14 @@
|
||||
"@octokit/types": "^6.33.0"
|
||||
}
|
||||
},
|
||||
"node_modules/@octokit/plugin-request-log": {
|
||||
"version": "1.0.4",
|
||||
"resolved": "https://registry.npmjs.org/@octokit/plugin-request-log/-/plugin-request-log-1.0.4.tgz",
|
||||
"integrity": "sha512-mLUsMkgP7K/cnFEw07kWqXGF5LKrOkD+lhCrKvPHXWDywAwuDUeDwWBpc69XK3pNX0uKiVt8g5z96PJ6z9xCFA==",
|
||||
"peerDependencies": {
|
||||
"@octokit/core": ">=3"
|
||||
}
|
||||
},
|
||||
"node_modules/@octokit/plugin-rest-endpoint-methods": {
|
||||
"version": "5.12.1",
|
||||
"resolved": "https://registry.npmjs.org/@octokit/plugin-rest-endpoint-methods/-/plugin-rest-endpoint-methods-5.12.1.tgz",
|
||||
@@ -140,6 +132,27 @@
|
||||
"deprecation": "^2.3.1"
|
||||
}
|
||||
},
|
||||
"node_modules/@octokit/plugin-retry": {
|
||||
"version": "3.0.9",
|
||||
"resolved": "https://registry.npmjs.org/@octokit/plugin-retry/-/plugin-retry-3.0.9.tgz",
|
||||
"integrity": "sha512-r+fArdP5+TG6l1Rv/C9hVoty6tldw6cE2pRHNGmFPdyfrc696R6JjrQ3d7HdVqGwuzfyrcaLAKD7K8TX8aehUQ==",
|
||||
"dependencies": {
|
||||
"@octokit/types": "^6.0.3",
|
||||
"bottleneck": "^2.15.3"
|
||||
}
|
||||
},
|
||||
"node_modules/@octokit/plugin-throttling": {
|
||||
"version": "3.7.0",
|
||||
"resolved": "https://registry.npmjs.org/@octokit/plugin-throttling/-/plugin-throttling-3.7.0.tgz",
|
||||
"integrity": "sha512-qrKT1Yl/KuwGSC6/oHpLBot3ooC9rq0/ryDYBCpkRtoj+R8T47xTMDT6Tk2CxWopFota/8Pi/2SqArqwC0JPow==",
|
||||
"dependencies": {
|
||||
"@octokit/types": "^6.0.1",
|
||||
"bottleneck": "^2.15.3"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"@octokit/core": "^3.5.0"
|
||||
}
|
||||
},
|
||||
"node_modules/@octokit/request": {
|
||||
"version": "5.6.2",
|
||||
"resolved": "https://registry.npmjs.org/@octokit/request/-/request-5.6.2.tgz",
|
||||
@@ -163,6 +176,17 @@
|
||||
"once": "^1.4.0"
|
||||
}
|
||||
},
|
||||
"node_modules/@octokit/rest": {
|
||||
"version": "18.12.0",
|
||||
"resolved": "https://registry.npmjs.org/@octokit/rest/-/rest-18.12.0.tgz",
|
||||
"integrity": "sha512-gDPiOHlyGavxr72y0guQEhLsemgVjwRePayJ+FcKc2SJqKUbxbkvf5kAZEWA/MKvsfYlQAMVzNJE3ezQcxMJ2Q==",
|
||||
"dependencies": {
|
||||
"@octokit/core": "^3.5.1",
|
||||
"@octokit/plugin-paginate-rest": "^2.16.8",
|
||||
"@octokit/plugin-request-log": "^1.0.4",
|
||||
"@octokit/plugin-rest-endpoint-methods": "^5.12.0"
|
||||
}
|
||||
},
|
||||
"node_modules/@octokit/types": {
|
||||
"version": "6.33.0",
|
||||
"resolved": "https://registry.npmjs.org/@octokit/types/-/types-6.33.0.tgz",
|
||||
@@ -214,6 +238,11 @@
|
||||
"resolved": "https://registry.npmjs.org/before-after-hook/-/before-after-hook-2.2.2.tgz",
|
||||
"integrity": "sha512-3pZEU3NT5BFUo/AD5ERPWOgQOCZITni6iavr5AUw5AUwQjMlI0kzu5btnyD39AF0gUEsDPwJT+oY1ORBJijPjQ=="
|
||||
},
|
||||
"node_modules/bottleneck": {
|
||||
"version": "2.19.5",
|
||||
"resolved": "https://registry.npmjs.org/bottleneck/-/bottleneck-2.19.5.tgz",
|
||||
"integrity": "sha512-VHiNCbI1lKdl44tGrhNfU3lup0Tj/ZBMJB5/2ZbNXRCPuRCO7ed2mgcK4r17y+KB2EfuYuRaVlwNbAeaWGSpbw=="
|
||||
},
|
||||
"node_modules/callsites": {
|
||||
"version": "3.1.0",
|
||||
"resolved": "https://registry.npmjs.org/callsites/-/callsites-3.1.0.tgz",
|
||||
@@ -388,14 +417,6 @@
|
||||
"resolved": "https://registry.npmjs.org/tslib/-/tslib-2.3.1.tgz",
|
||||
"integrity": "sha512-77EbyPPpMz+FRFRuAFlWMtmgUWGe9UOG2Z25NqCwiIjRhOf5iKGuzSe5P2w1laq+FkRy4p+PCuVkJSGkzTEKVw=="
|
||||
},
|
||||
"node_modules/tunnel": {
|
||||
"version": "0.0.6",
|
||||
"resolved": "https://registry.npmjs.org/tunnel/-/tunnel-0.0.6.tgz",
|
||||
"integrity": "sha512-1h/Lnq9yajKY2PEbBadPXj3VxsDDu844OnaAo52UVmIzIvwwtBPIuNvkjuzBlTWpfJyUbG3ez0KSBibQkj4ojg==",
|
||||
"engines": {
|
||||
"node": ">=0.6.11 <=0.7.0 || >=0.7.3"
|
||||
}
|
||||
},
|
||||
"node_modules/type-fest": {
|
||||
"version": "1.4.0",
|
||||
"resolved": "https://registry.npmjs.org/type-fest/-/type-fest-1.4.0.tgz",
|
||||
@@ -461,25 +482,6 @@
|
||||
}
|
||||
},
|
||||
"dependencies": {
|
||||
"@actions/github": {
|
||||
"version": "5.0.0",
|
||||
"resolved": "https://registry.npmjs.org/@actions/github/-/github-5.0.0.tgz",
|
||||
"integrity": "sha512-QvE9eAAfEsS+yOOk0cylLBIO/d6WyWIOvsxxzdrPFaud39G6BOkUwScXZn1iBzQzHyu9SBkkLSWlohDWdsasAQ==",
|
||||
"requires": {
|
||||
"@actions/http-client": "^1.0.11",
|
||||
"@octokit/core": "^3.4.0",
|
||||
"@octokit/plugin-paginate-rest": "^2.13.3",
|
||||
"@octokit/plugin-rest-endpoint-methods": "^5.1.1"
|
||||
}
|
||||
},
|
||||
"@actions/http-client": {
|
||||
"version": "1.0.11",
|
||||
"resolved": "https://registry.npmjs.org/@actions/http-client/-/http-client-1.0.11.tgz",
|
||||
"integrity": "sha512-VRYHGQV1rqnROJqdMvGUbY/Kn8vriQe/F9HR2AlYHzmKuM/p3kjNuXhmdBfcVgsvRWTz5C5XW5xvndZrVBuAYg==",
|
||||
"requires": {
|
||||
"tunnel": "0.0.6"
|
||||
}
|
||||
},
|
||||
"@discordjs/builders": {
|
||||
"version": "0.6.0",
|
||||
"resolved": "https://registry.npmjs.org/@discordjs/builders/-/builders-0.6.0.tgz",
|
||||
@@ -569,6 +571,12 @@
|
||||
"@octokit/types": "^6.33.0"
|
||||
}
|
||||
},
|
||||
"@octokit/plugin-request-log": {
|
||||
"version": "1.0.4",
|
||||
"resolved": "https://registry.npmjs.org/@octokit/plugin-request-log/-/plugin-request-log-1.0.4.tgz",
|
||||
"integrity": "sha512-mLUsMkgP7K/cnFEw07kWqXGF5LKrOkD+lhCrKvPHXWDywAwuDUeDwWBpc69XK3pNX0uKiVt8g5z96PJ6z9xCFA==",
|
||||
"requires": {}
|
||||
},
|
||||
"@octokit/plugin-rest-endpoint-methods": {
|
||||
"version": "5.12.1",
|
||||
"resolved": "https://registry.npmjs.org/@octokit/plugin-rest-endpoint-methods/-/plugin-rest-endpoint-methods-5.12.1.tgz",
|
||||
@@ -578,6 +586,24 @@
|
||||
"deprecation": "^2.3.1"
|
||||
}
|
||||
},
|
||||
"@octokit/plugin-retry": {
|
||||
"version": "3.0.9",
|
||||
"resolved": "https://registry.npmjs.org/@octokit/plugin-retry/-/plugin-retry-3.0.9.tgz",
|
||||
"integrity": "sha512-r+fArdP5+TG6l1Rv/C9hVoty6tldw6cE2pRHNGmFPdyfrc696R6JjrQ3d7HdVqGwuzfyrcaLAKD7K8TX8aehUQ==",
|
||||
"requires": {
|
||||
"@octokit/types": "^6.0.3",
|
||||
"bottleneck": "^2.15.3"
|
||||
}
|
||||
},
|
||||
"@octokit/plugin-throttling": {
|
||||
"version": "3.7.0",
|
||||
"resolved": "https://registry.npmjs.org/@octokit/plugin-throttling/-/plugin-throttling-3.7.0.tgz",
|
||||
"integrity": "sha512-qrKT1Yl/KuwGSC6/oHpLBot3ooC9rq0/ryDYBCpkRtoj+R8T47xTMDT6Tk2CxWopFota/8Pi/2SqArqwC0JPow==",
|
||||
"requires": {
|
||||
"@octokit/types": "^6.0.1",
|
||||
"bottleneck": "^2.15.3"
|
||||
}
|
||||
},
|
||||
"@octokit/request": {
|
||||
"version": "5.6.2",
|
||||
"resolved": "https://registry.npmjs.org/@octokit/request/-/request-5.6.2.tgz",
|
||||
@@ -601,6 +627,17 @@
|
||||
"once": "^1.4.0"
|
||||
}
|
||||
},
|
||||
"@octokit/rest": {
|
||||
"version": "18.12.0",
|
||||
"resolved": "https://registry.npmjs.org/@octokit/rest/-/rest-18.12.0.tgz",
|
||||
"integrity": "sha512-gDPiOHlyGavxr72y0guQEhLsemgVjwRePayJ+FcKc2SJqKUbxbkvf5kAZEWA/MKvsfYlQAMVzNJE3ezQcxMJ2Q==",
|
||||
"requires": {
|
||||
"@octokit/core": "^3.5.1",
|
||||
"@octokit/plugin-paginate-rest": "^2.16.8",
|
||||
"@octokit/plugin-request-log": "^1.0.4",
|
||||
"@octokit/plugin-rest-endpoint-methods": "^5.12.0"
|
||||
}
|
||||
},
|
||||
"@octokit/types": {
|
||||
"version": "6.33.0",
|
||||
"resolved": "https://registry.npmjs.org/@octokit/types/-/types-6.33.0.tgz",
|
||||
@@ -642,6 +679,11 @@
|
||||
"resolved": "https://registry.npmjs.org/before-after-hook/-/before-after-hook-2.2.2.tgz",
|
||||
"integrity": "sha512-3pZEU3NT5BFUo/AD5ERPWOgQOCZITni6iavr5AUw5AUwQjMlI0kzu5btnyD39AF0gUEsDPwJT+oY1ORBJijPjQ=="
|
||||
},
|
||||
"bottleneck": {
|
||||
"version": "2.19.5",
|
||||
"resolved": "https://registry.npmjs.org/bottleneck/-/bottleneck-2.19.5.tgz",
|
||||
"integrity": "sha512-VHiNCbI1lKdl44tGrhNfU3lup0Tj/ZBMJB5/2ZbNXRCPuRCO7ed2mgcK4r17y+KB2EfuYuRaVlwNbAeaWGSpbw=="
|
||||
},
|
||||
"callsites": {
|
||||
"version": "3.1.0",
|
||||
"resolved": "https://registry.npmjs.org/callsites/-/callsites-3.1.0.tgz",
|
||||
@@ -765,11 +807,6 @@
|
||||
"resolved": "https://registry.npmjs.org/tslib/-/tslib-2.3.1.tgz",
|
||||
"integrity": "sha512-77EbyPPpMz+FRFRuAFlWMtmgUWGe9UOG2Z25NqCwiIjRhOf5iKGuzSe5P2w1laq+FkRy4p+PCuVkJSGkzTEKVw=="
|
||||
},
|
||||
"tunnel": {
|
||||
"version": "0.0.6",
|
||||
"resolved": "https://registry.npmjs.org/tunnel/-/tunnel-0.0.6.tgz",
|
||||
"integrity": "sha512-1h/Lnq9yajKY2PEbBadPXj3VxsDDu844OnaAo52UVmIzIvwwtBPIuNvkjuzBlTWpfJyUbG3ez0KSBibQkj4ojg=="
|
||||
},
|
||||
"type-fest": {
|
||||
"version": "1.4.0",
|
||||
"resolved": "https://registry.npmjs.org/type-fest/-/type-fest-1.4.0.tgz",
|
||||
|
||||
@@ -10,7 +10,9 @@
|
||||
"author": "",
|
||||
"license": "ISC",
|
||||
"dependencies": {
|
||||
"@actions/github": "^5.0.0",
|
||||
"@octokit/plugin-retry": "^3.0.9",
|
||||
"@octokit/plugin-throttling": "^3.5.2",
|
||||
"@octokit/rest": "^18.12.0",
|
||||
"discord.js": "^13.2.0"
|
||||
}
|
||||
}
|
||||
|
||||
291
.github/workflows/scripts/windows/build-dependencies.bat
vendored
Normal file
291
.github/workflows/scripts/windows/build-dependencies.bat
vendored
Normal file
@@ -0,0 +1,291 @@
|
||||
@echo off
|
||||
setlocal enabledelayedexpansion
|
||||
|
||||
echo Setting environment...
|
||||
if exist "%ProgramFiles%\Microsoft Visual Studio\2022\Enterprise\VC\Auxiliary\Build\vcvars64.bat" (
|
||||
call "%ProgramFiles%\Microsoft Visual Studio\2022\Enterprise\VC\Auxiliary\Build\vcvars64.bat"
|
||||
) else if exist "%ProgramFiles%\Microsoft Visual Studio\2022\Community\VC\Auxiliary\Build\vcvars64.bat" (
|
||||
call "%ProgramFiles%\Microsoft Visual Studio\2022\Community\VC\Auxiliary\Build\vcvars64.bat"
|
||||
) else (
|
||||
echo Visual Studio 2022 not found.
|
||||
goto error
|
||||
)
|
||||
|
||||
set SEVENZIP="C:\Program Files\7-Zip\7z.exe"
|
||||
set PATCH="C:\Program Files\Git\usr\bin\patch.exe"
|
||||
|
||||
if defined DEBUG (
|
||||
echo DEBUG=%DEBUG%
|
||||
) else (
|
||||
set DEBUG=1
|
||||
)
|
||||
|
||||
pushd %~dp0
|
||||
set "SCRIPTDIR=%CD%"
|
||||
cd ..\..\..\..
|
||||
mkdir deps-build
|
||||
cd deps-build || goto error
|
||||
set "BUILDDIR=%CD%"
|
||||
cd ..
|
||||
mkdir deps
|
||||
cd deps || goto error
|
||||
set "INSTALLDIR=%CD%"
|
||||
popd
|
||||
|
||||
echo SCRIPTDIR=%SCRIPTDIR%
|
||||
echo BUILDDIR=%BUILDDIR%
|
||||
echo INSTALLDIR=%INSTALLDIR%
|
||||
|
||||
set "PATH=%PATH%;%INSTALLDIR%\bin"
|
||||
|
||||
cd "%BUILDDIR%"
|
||||
|
||||
set FREETYPE=2.13.2
|
||||
set HARFBUZZ=8.3.1
|
||||
set LIBJPEG=9f
|
||||
set LIBPNG=1643
|
||||
set LZ4=b8fd2d15309dd4e605070bd4486e26b6ef814e29
|
||||
set QT=6.7.1
|
||||
set QTMINOR=6.7
|
||||
set SDL=SDL2-2.30.3
|
||||
set WEBP=1.3.2
|
||||
set ZLIB=1.3.1
|
||||
set ZLIBSHORT=131
|
||||
set ZSTD=1.5.5
|
||||
|
||||
set SHADERC=2024.1
|
||||
set SHADERC_GLSLANG=142052fa30f9eca191aa9dcf65359fcaed09eeec
|
||||
set SHADERC_SPIRVHEADERS=5e3ad389ee56fca27c9705d093ae5387ce404df4
|
||||
set SHADERC_SPIRVTOOLS=dd4b663e13c07fea4fbb3f70c1c91c86731099f7
|
||||
|
||||
call :downloadfile "freetype-%FREETYPE%.tar.gz" https://sourceforge.net/projects/freetype/files/freetype2/%FREETYPE%/freetype-%FREETYPE%.tar.gz/download 1ac27e16c134a7f2ccea177faba19801131116fd682efc1f5737037c5db224b5 || goto error
|
||||
call :downloadfile "harfbuzz-%HARFBUZZ%.zip" https://github.com/harfbuzz/harfbuzz/archive/refs/tags/%HARFBUZZ%.zip b2bc56184ae37324bc4829fde7d3f9e6916866ad711ee85792e457547c9fd127 || goto error
|
||||
call :downloadfile "lpng%LIBPNG%.zip" https://download.sourceforge.net/libpng/lpng1643.zip fc466a1e638e635d6c66363bdf3f38555b81b0141d0b06ba45b49ccca327436d || goto error
|
||||
call :downloadfile "jpegsr%LIBJPEG%.zip" https://ijg.org/files/jpegsr%LIBJPEG%.zip 6255da8c89e09d694e6800688c76145eb6870a76ac0d36c74fccd61b3940aafa || goto error
|
||||
call :downloadfile "libwebp-%WEBP%.tar.gz" "https://storage.googleapis.com/downloads.webmproject.org/releases/webp/libwebp-%WEBP%.tar.gz" 2a499607df669e40258e53d0ade8035ba4ec0175244869d1025d460562aa09b4 || goto error
|
||||
call :downloadfile "lz4-%LZ4%.zip" "https://github.com/lz4/lz4/archive/%LZ4%.zip" 0c33119688d6b180c7e760b0acd70059222389cfd581632623784bee27e51a31 || goto error
|
||||
call :downloadfile "%SDL%.zip" "https://libsdl.org/release/%SDL%.zip" c5d78a9e0346c6695f03df8ba25e5e111a1e23c8aefa8372a1c5a0dd79acaf10 || goto error
|
||||
call :downloadfile "qtbase-everywhere-src-%QT%.zip" "https://download.qt.io/official_releases/qt/%QTMINOR%/%QT%/submodules/qtbase-everywhere-src-%QT%.zip" 3027fb990cb66436b5476b9dd17cd58f23b55a42eb1c1bcf9c7d78bca3ad7d63 || goto error
|
||||
call :downloadfile "qtimageformats-everywhere-src-%QT%.zip" "https://download.qt.io/official_releases/qt/%QTMINOR%/%QT%/submodules/qtimageformats-everywhere-src-%QT%.zip" f30065289517847d721467827ee446a5f606f6d1c750e166cbfb0ed5bf066c5e || goto error
|
||||
call :downloadfile "qtsvg-everywhere-src-%QT%.zip" "https://download.qt.io/official_releases/qt/%QTMINOR%/%QT%/submodules/qtsvg-everywhere-src-%QT%.zip" 882d1db58d35155bd92e4ed92b485d7d713b6aff0d7cf78655de0b414a980689 || goto error
|
||||
call :downloadfile "qttools-everywhere-src-%QT%.zip" "https://download.qt.io/official_releases/qt/%QTMINOR%/%QT%/submodules/qttools-everywhere-src-%QT%.zip" 93a31892ca8a4f38464e923328788ce3da881d82016fe18fa1ed12dd43ce486c || goto error
|
||||
call :downloadfile "qttranslations-everywhere-src-%QT%.zip" "https://download.qt.io/official_releases/qt/%QTMINOR%/%QT%/submodules/qttranslations-everywhere-src-%QT%.zip" 102ca62fa682c0d3e700ba89069fd3b6663b9f0c2890b058e97998b6e8971fb3 || goto error
|
||||
call :downloadfile "zlib%ZLIBSHORT%.zip" "https://zlib.net/zlib%ZLIBSHORT%.zip" 72af66d44fcc14c22013b46b814d5d2514673dda3d115e64b690c1ad636e7b17 || goto error
|
||||
call :downloadfile "zstd-%ZSTD%.zip" "https://github.com/facebook/zstd/archive/refs/tags/v%ZSTD%.zip" c5c8daa1d40dabc51790c62a5b86af2b36dfc4e1a738ff10dc4a46ea4e68ee51 || goto error
|
||||
|
||||
call :downloadfile "shaderc-%SHADERC%.zip" "https://github.com/google/shaderc/archive/refs/tags/v%SHADERC%.zip" 6c9f42ed6bf42750f5369b089909abfdcf0101488b4a1f41116d5159d00af8e7 || goto error
|
||||
call :downloadfile "shaderc-glslang-%SHADERC_GLSLANG%.zip" "https://github.com/KhronosGroup/glslang/archive/%SHADERC_GLSLANG%.zip" 03ad8a6fa987af4653d0cfe6bdaed41bcf617f1366a151fb1574da75950cd3e8 || goto error
|
||||
call :downloadfile "shaderc-spirv-headers-%SHADERC_SPIRVHEADERS%.zip" "https://github.com/KhronosGroup/SPIRV-Headers/archive/%SHADERC_SPIRVHEADERS%.zip" fa59a54334feaba5702b9c25724c3f4746123865769b36dd5a28d9ef5e9d39ab || goto error
|
||||
call :downloadfile "shaderc-spirv-tools-%SHADERC_SPIRVTOOLS%.zip" "https://github.com/KhronosGroup/SPIRV-Tools/archive/%SHADERC_SPIRVTOOLS%.zip" bf385994c20293485b378c27dfdbd77a31b949deabccd9218a977f173eda9f6f || goto error
|
||||
|
||||
if %DEBUG%==1 (
|
||||
echo Building debug and release libraries...
|
||||
) else (
|
||||
echo Building release libraries...
|
||||
)
|
||||
|
||||
set FORCEPDB=-DCMAKE_SHARED_LINKER_FLAGS_RELEASE="/DEBUG"
|
||||
|
||||
echo Building Zlib...
|
||||
rmdir /S /Q "zlib-%ZLIB%"
|
||||
%SEVENZIP% x "zlib%ZLIBSHORT%.zip" || goto error
|
||||
cd "zlib-%ZLIB%" || goto error
|
||||
cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_PREFIX_PATH="%INSTALLDIR%" -DCMAKE_INSTALL_PREFIX="%INSTALLDIR%" -DBUILD_SHARED_LIBS=ON -DZLIB_BUILD_EXAMPLES=OFF -B build -G Ninja || goto error
|
||||
cmake --build build --parallel || goto error
|
||||
ninja -C build install || goto error
|
||||
cd .. || goto error
|
||||
|
||||
echo Building libpng...
|
||||
rmdir /S /Q "lpng%LIBPNG%"
|
||||
%SEVENZIP% x "lpng%LIBPNG%.zip" || goto error
|
||||
cd "lpng%LIBPNG%" || goto error
|
||||
cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_PREFIX_PATH="%INSTALLDIR%" -DCMAKE_INSTALL_PREFIX="%INSTALLDIR%" -DBUILD_SHARED_LIBS=ON -DBUILD_SHARED_LIBS=ON -DPNG_TESTS=OFF -DPNG_STATIC=OFF -DPNG_SHARED=ON -DPNG_TOOLS=OFF -B build -G Ninja || goto error
|
||||
cmake --build build --parallel || goto error
|
||||
ninja -C build install || goto error
|
||||
cd .. || goto error
|
||||
|
||||
echo Building libjpeg...
|
||||
rmdir /S /Q "jpeg-%LIBJPEG%"
|
||||
%SEVENZIP% x "jpegsr%LIBJPEG%.zip" || goto error
|
||||
cd "jpeg-%LIBJPEG%" || goto error
|
||||
%PATCH% -p1 < "%SCRIPTDIR%\libjpeg-cmake.patch" || goto error
|
||||
cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_PREFIX_PATH="%INSTALLDIR%" -DCMAKE_INSTALL_PREFIX="%INSTALLDIR%" -DBUILD_SHARED_LIBS=ON -DBUILD_STATIC_LIBS=OFF -B build -G Ninja || goto error
|
||||
cmake --build build --parallel || goto error
|
||||
ninja -C build install || goto error
|
||||
cd .. || goto error
|
||||
|
||||
echo Building LZ4...
|
||||
rmdir /S /Q "lz4"
|
||||
%SEVENZIP% x "lz4-%LZ4%.zip" || goto error
|
||||
rename "lz4-%LZ4%" "lz4" || goto error
|
||||
cd "lz4" || goto error
|
||||
cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_PREFIX_PATH="%INSTALLDIR%" -DCMAKE_INSTALL_PREFIX="%INSTALLDIR%" -DBUILD_SHARED_LIBS=ON -DLZ4_BUILD_CLI=OFF -DLZ4_BUILD_LEGACY_LZ4C=OFF -DCMAKE_C_FLAGS="/wd4711 /wd5045" -B build-dir -G Ninja build/cmake || goto error
|
||||
cmake --build build-dir --parallel || goto error
|
||||
ninja -C build-dir install || goto error
|
||||
cd ..
|
||||
|
||||
echo Building FreeType without HarfBuzz...
|
||||
rmdir /S /Q "freetype-%FREETYPE%"
|
||||
tar -xf "freetype-%FREETYPE%.tar.gz" || goto error
|
||||
cd "freetype-%FREETYPE%" || goto error
|
||||
cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_PREFIX_PATH="%INSTALLDIR%" -DCMAKE_INSTALL_PREFIX="%INSTALLDIR%" -DBUILD_SHARED_LIBS=ON -DFT_REQUIRE_ZLIB=TRUE -DFT_REQUIRE_PNG=TRUE -DFT_DISABLE_BZIP2=TRUE -DFT_DISABLE_BROTLI=TRUE -DFT_DISABLE_HARFBUZZ=TRUE -B build -G Ninja || goto error
|
||||
cmake --build build --parallel || goto error
|
||||
ninja -C build install || goto error
|
||||
cd .. || goto error
|
||||
|
||||
echo Building HarfBuzz...
|
||||
rmdir /S /Q "harfbuzz-%HARFBUZZ%"
|
||||
%SEVENZIP% x "-x^!harfbuzz-%HARFBUZZ%\README" "harfbuzz-%HARFBUZZ%.zip" || goto error
|
||||
cd "harfbuzz-%HARFBUZZ%" || goto error
|
||||
cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_PREFIX_PATH="%INSTALLDIR%" -DCMAKE_INSTALL_PREFIX="%INSTALLDIR%" -DBUILD_SHARED_LIBS=ON -DHB_BUILD_UTILS=OFF -B build -G Ninja || goto error
|
||||
cmake --build build --parallel || goto error
|
||||
ninja -C build install || goto error
|
||||
cd .. || goto error
|
||||
|
||||
echo Building FreeType with HarfBuzz...
|
||||
rmdir /S /Q "freetype-%FREETYPE%"
|
||||
tar -xf "freetype-%FREETYPE%.tar.gz" || goto error
|
||||
cd "freetype-%FREETYPE%" || goto error
|
||||
cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_PREFIX_PATH="%INSTALLDIR%" -DCMAKE_INSTALL_PREFIX="%INSTALLDIR%" -DBUILD_SHARED_LIBS=ON -DFT_REQUIRE_ZLIB=TRUE -DFT_REQUIRE_PNG=TRUE -DFT_DISABLE_BZIP2=TRUE -DFT_DISABLE_BROTLI=TRUE -DFT_REQUIRE_HARFBUZZ=TRUE -B build -G Ninja || goto error
|
||||
cmake --build build --parallel || goto error
|
||||
ninja -C build install || goto error
|
||||
cd .. || goto error
|
||||
|
||||
echo Building Zstandard...
|
||||
rmdir /S /Q "zstd-%ZSTD%"
|
||||
%SEVENZIP% x "-x^!zstd-1.5.5\tests\cli-tests\bin" "zstd-%ZSTD%.zip" || goto error
|
||||
cd "zstd-%ZSTD%"
|
||||
cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_PREFIX_PATH="%INSTALLDIR%" -DCMAKE_INSTALL_PREFIX="%INSTALLDIR%" -DBUILD_SHARED_LIBS=ON -DZSTD_BUILD_SHARED=ON -DZSTD_BUILD_STATIC=OFF -DZSTD_BUILD_PROGRAMS=OFF -B build -G Ninja build/cmake
|
||||
cmake --build build --parallel || goto error
|
||||
ninja -C build install || goto error
|
||||
cd .. || goto error
|
||||
|
||||
echo Building WebP...
|
||||
rmdir /S /Q "libwebp-%WEBP%"
|
||||
tar -xf "libwebp-%WEBP%.tar.gz" || goto error
|
||||
cd "libwebp-%WEBP%" || goto error
|
||||
cmake -B build -DCMAKE_BUILD_TYPE=Release -DCMAKE_PREFIX_PATH="%INSTALLDIR%" -DCMAKE_INSTALL_PREFIX="%INSTALLDIR%" -DWEBP_BUILD_ANIM_UTILS=OFF -DWEBP_BUILD_CWEBP=OFF -DWEBP_BUILD_DWEBP=OFF -DWEBP_BUILD_GIF2WEBP=OFF -DWEBP_BUILD_IMG2WEBP=OFF -DWEBP_BUILD_VWEBP=OFF -DWEBP_BUILD_WEBPINFO=OFF -DWEBP_BUILD_WEBPMUX=OFF -DWEBP_BUILD_EXTRAS=OFF -DBUILD_SHARED_LIBS=ON -G Ninja || goto error
|
||||
cmake --build build --parallel || goto error
|
||||
ninja -C build install || goto error
|
||||
cd .. || goto error
|
||||
|
||||
echo Building SDL...
|
||||
rmdir /S /Q "%SDL%"
|
||||
%SEVENZIP% x "%SDL%.zip" || goto error
|
||||
cd "%SDL%" || goto error
|
||||
cmake -B build -DCMAKE_BUILD_TYPE=Release %FORCEPDB% -DCMAKE_INSTALL_PREFIX="%INSTALLDIR%" -DBUILD_SHARED_LIBS=ON -DSDL_SHARED=ON -DSDL_STATIC=OFF -G Ninja || goto error
|
||||
cmake --build build --parallel || goto error
|
||||
ninja -C build install || goto error
|
||||
copy build\SDL2.pdb "%INSTALLDIR%\bin" || goto error
|
||||
cd .. || goto error
|
||||
|
||||
if %DEBUG%==1 (
|
||||
set QTBUILDSPEC=-DCMAKE_CONFIGURATION_TYPES="Release;Debug" -G "Ninja Multi-Config"
|
||||
) else (
|
||||
set QTBUILDSPEC=-DCMAKE_BUILD_TYPE=Release -G Ninja
|
||||
)
|
||||
|
||||
echo Building Qt base...
|
||||
rmdir /S /Q "qtbase-everywhere-src-%QT%"
|
||||
%SEVENZIP% x "qtbase-everywhere-src-%QT%.zip" || goto error
|
||||
cd "qtbase-everywhere-src-%QT%" || goto error
|
||||
cmake -B build -DFEATURE_sql=OFF -DCMAKE_INSTALL_PREFIX="%INSTALLDIR%" %FORCEPDB% -DINPUT_gui=yes -DINPUT_widgets=yes -DINPUT_ssl=yes -DINPUT_openssl=no -DINPUT_schannel=yes -DFEATURE_system_png=ON -DFEATURE_system_jpeg=ON -DFEATURE_system_zlib=ON -DFEATURE_system_freetype=ON -DFEATURE_system_harfbuzz=ON %QTBUILDSPEC% || goto error
|
||||
cmake --build build --parallel || goto error
|
||||
ninja -C build install || goto error
|
||||
cd .. || goto error
|
||||
|
||||
echo Building Qt SVG...
|
||||
rmdir /S /Q "qtsvg-everywhere-src-%QT%"
|
||||
%SEVENZIP% x "qtsvg-everywhere-src-%QT%.zip" || goto error
|
||||
cd "qtsvg-everywhere-src-%QT%" || goto error
|
||||
mkdir build || goto error
|
||||
cd build || goto error
|
||||
call "%INSTALLDIR%\bin\qt-configure-module.bat" .. -- %FORCEPDB% -DCMAKE_PREFIX_PATH="%INSTALLDIR%" || goto error
|
||||
cmake --build . --parallel || goto error
|
||||
ninja install || goto error
|
||||
cd ..\.. || goto error
|
||||
|
||||
echo Building Qt Image Formats...
|
||||
rmdir /S /Q "qtimageformats-everywhere-src-%QT%"
|
||||
%SEVENZIP% x "qtimageformats-everywhere-src-%QT%.zip" || goto error
|
||||
cd "qtimageformats-everywhere-src-%QT%" || goto error
|
||||
mkdir build || goto error
|
||||
cd build || goto error
|
||||
call "%INSTALLDIR%\bin\qt-configure-module.bat" .. -- %FORCEPDB% -DCMAKE_PREFIX_PATH="%INSTALLDIR%" -DFEATURE_system_webp=ON || goto error
|
||||
cmake --build . --parallel || goto error
|
||||
ninja install || goto error
|
||||
cd ..\.. || goto error
|
||||
|
||||
echo Building Qt Tools...
|
||||
rmdir /S /Q "qtimageformats-everywhere-src-%QT%"
|
||||
%SEVENZIP% x "qttools-everywhere-src-%QT%.zip" || goto error
|
||||
cd "qttools-everywhere-src-%QT%" || goto error
|
||||
mkdir build || goto error
|
||||
cd build || goto error
|
||||
call "%INSTALLDIR%\bin\qt-configure-module.bat" .. -- %FORCEPDB% -DFEATURE_assistant=OFF -DFEATURE_clang=OFF -DFEATURE_designer=ON -DFEATURE_kmap2qmap=OFF -DFEATURE_pixeltool=OFF -DFEATURE_pkg_config=OFF -DFEATURE_qev=OFF -DFEATURE_qtattributionsscanner=OFF -DFEATURE_qtdiag=OFF -DFEATURE_qtplugininfo=OFF || goto error
|
||||
cmake --build . --parallel || goto error
|
||||
ninja install || goto error
|
||||
cd ..\.. || goto error
|
||||
|
||||
echo Building Qt Translations...
|
||||
rmdir /S /Q "qttranslations-everywhere-src-%QT%"
|
||||
%SEVENZIP% x "qttranslations-everywhere-src-%QT%.zip" || goto error
|
||||
cd "qttranslations-everywhere-src-%QT%" || goto error
|
||||
mkdir build || goto error
|
||||
cd build || goto error
|
||||
call "%INSTALLDIR%\bin\qt-configure-module.bat" .. -- %FORCEPDB% || goto error
|
||||
cmake --build . --parallel || goto error
|
||||
ninja install || goto error
|
||||
cd ..\.. || goto error
|
||||
|
||||
echo Building shaderc...
|
||||
rmdir /S /Q "shaderc-%SHADERC%"
|
||||
%SEVENZIP% x "shaderc-%SHADERC%.zip" || goto error
|
||||
cd "shaderc-%SHADERC%" || goto error
|
||||
cd third_party || goto error
|
||||
%SEVENZIP% x "..\..\shaderc-glslang-%SHADERC_GLSLANG%.zip" || goto error
|
||||
rename "glslang-%SHADERC_GLSLANG%" "glslang" || goto error
|
||||
%SEVENZIP% x "..\..\shaderc-spirv-headers-%SHADERC_SPIRVHEADERS%.zip" || goto error
|
||||
rename "SPIRV-Headers-%SHADERC_SPIRVHEADERS%" "spirv-headers" || goto error
|
||||
%SEVENZIP% x "..\..\shaderc-spirv-tools-%SHADERC_SPIRVTOOLS%.zip" || goto error
|
||||
rename "SPIRV-Tools-%SHADERC_SPIRVTOOLS%" "spirv-tools" || goto error
|
||||
cd .. || goto error
|
||||
%PATCH% -p1 < "%SCRIPTDIR%\..\common\shaderc-changes.patch" || goto error
|
||||
cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_PREFIX_PATH="%INSTALLDIR%" -DCMAKE_INSTALL_PREFIX="%INSTALLDIR%" -DSHADERC_SKIP_TESTS=ON -DSHADERC_SKIP_EXAMPLES=ON -DSHADERC_SKIP_COPYRIGHT_CHECK=ON -DSHADERC_ENABLE_SHARED_CRT=ON -B build -G Ninja || goto error
|
||||
cmake --build build --parallel || goto error
|
||||
ninja -C build install || goto error
|
||||
cd .. || goto error
|
||||
|
||||
echo Cleaning up...
|
||||
cd ..
|
||||
rd /S /Q deps-build
|
||||
|
||||
echo Exiting with success.
|
||||
exit 0
|
||||
|
||||
:error
|
||||
echo Failed with error #%errorlevel%.
|
||||
pause
|
||||
exit %errorlevel%
|
||||
|
||||
:downloadfile
|
||||
if not exist "%~1" (
|
||||
echo Downloading %~1 from %~2...
|
||||
curl -L -o "%~1" "%~2" || goto error
|
||||
)
|
||||
|
||||
rem based on https://gist.github.com/gsscoder/e22daefaff9b5d8ac16afb070f1a7971
|
||||
set idx=0
|
||||
for /f %%F in ('certutil -hashfile "%~1" SHA256') do (
|
||||
set "out!idx!=%%F"
|
||||
set /a idx += 1
|
||||
)
|
||||
set filechecksum=%out1%
|
||||
|
||||
if /i %~3==%filechecksum% (
|
||||
echo Validated %~1.
|
||||
exit /B 0
|
||||
) else (
|
||||
echo Expected %~3 got %filechecksum%.
|
||||
exit /B 1
|
||||
)
|
||||
422
.github/workflows/scripts/windows/libjpeg-cmake.patch
vendored
Normal file
422
.github/workflows/scripts/windows/libjpeg-cmake.patch
vendored
Normal file
@@ -0,0 +1,422 @@
|
||||
diff -ruN jpeg-9f/CMakeLists.txt jpeg-9f-new/CMakeLists.txt
|
||||
--- jpeg-9f/CMakeLists.txt 1970-01-01 10:00:00.000000000 +1000
|
||||
+++ jpeg-9f-new/CMakeLists.txt 2024-03-23 21:29:37.969221600 +1000
|
||||
@@ -0,0 +1,110 @@
|
||||
+# CMake configuration for IJG libjpeg
|
||||
+# Modified from https://github.com/csparker247/jpeg-cmake/blob/develop/resources/CMakeLists.txt
|
||||
+# To install, copy this file and jconfig.h.in into a libjpeg source directory
|
||||
+# Adapted from LuaDist's CMakeLists
|
||||
+# https://github.com/LuaDist/libjpeg/blob/master/CMakeLists.txt
|
||||
+
|
||||
+cmake_minimum_required(VERSION 3.5)
|
||||
+
|
||||
+### Setup the project ###
|
||||
+file(READ "configure.ac" ac)
|
||||
+string(REGEX MATCH "AC_INIT\\(\\[libjpeg\\],\ \\[([0-9]*\\.[0-9]*\\.[0-9]*)\\]\\)" _ ${ac})
|
||||
+set(version ${CMAKE_MATCH_1})
|
||||
+project(libjpeg VERSION ${version} LANGUAGES C)
|
||||
+set(C_STANDARD 99)
|
||||
+
|
||||
+### Include extra packages ###
|
||||
+include(CMakeDependentOption)
|
||||
+include(GNUInstallDirs)
|
||||
+
|
||||
+### Options ###
|
||||
+option(BUILD_SHARED_LIBS "Build shared libraries" ON)
|
||||
+option(BUILD_STATIC_LIBS "Build static libraries" ON)
|
||||
+
|
||||
+# Make sure we build at least one library
|
||||
+if(NOT(BUILD_SHARED_LIBS OR BUILD_STATIC_LIBS))
|
||||
+ message(FATAL_ERROR "Both static and shared libraries are disabled. Nothing will be built.")
|
||||
+endif()
|
||||
+
|
||||
+### Configure jconfig.h ###
|
||||
+include(ConfigureJConfig.cmake)
|
||||
+
|
||||
+### Build the object library ###
|
||||
+set(PUBLIC_HDRS
|
||||
+ jconfig.h
|
||||
+ jerror.h
|
||||
+ jmorecfg.h
|
||||
+ jpeglib.h
|
||||
+)
|
||||
+
|
||||
+set(SRCS
|
||||
+ jaricom.c jcapimin.c jcapistd.c jcarith.c jccoefct.c jccolor.c
|
||||
+ jcdctmgr.c jchuff.c jcinit.c jcmainct.c jcmarker.c jcmaster.c jcomapi.c
|
||||
+ jcparam.c jcprepct.c jcsample.c jctrans.c jdapimin.c jdapistd.c jdarith.c
|
||||
+ jdatadst.c jdatasrc.c jdcoefct.c jdcolor.c jddctmgr.c jdhuff.c jdinput.c
|
||||
+ jdmainct.c jdmarker.c jdmaster.c jdmerge.c jdpostct.c jdsample.c jdtrans.c
|
||||
+ jerror.c jfdctflt.c jfdctfst.c jfdctint.c jidctflt.c jidctfst.c jidctint.c
|
||||
+ jmemmgr.c jmemnobs.c jquant1.c jquant2.c jutils.c
|
||||
+)
|
||||
+
|
||||
+### Create static and shared libs ###
|
||||
+if(BUILD_SHARED_LIBS)
|
||||
+ add_library(libjpeg SHARED ${SRCS})
|
||||
+ target_compile_definitions(libjpeg PRIVATE COMPILING_LIBJPEG)
|
||||
+ target_include_directories(libjpeg
|
||||
+ PUBLIC
|
||||
+ $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}>
|
||||
+ $<INSTALL_INTERFACE:include>
|
||||
+ )
|
||||
+ set_target_properties(libjpeg
|
||||
+ PROPERTIES
|
||||
+ VERSION ${PROJECT_VERSION_MAJOR}
|
||||
+ POSITION_INDEPENDENT_CODE ON
|
||||
+ CLEAN_DIRECT_OUTPUT ON
|
||||
+ PUBLIC_HEADER "${PUBLIC_HDRS}"
|
||||
+ )
|
||||
+ install(TARGETS libjpeg
|
||||
+ RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
|
||||
+ LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
|
||||
+ ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}
|
||||
+ PUBLIC_HEADER DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}
|
||||
+ )
|
||||
+endif()
|
||||
+
|
||||
+if(BUILD_STATIC_LIBS)
|
||||
+ add_library(libjpeg_static STATIC $<TARGET_OBJECTS:jpeg_objs>)
|
||||
+ target_include_directories(libjpeg_static
|
||||
+ PUBLIC
|
||||
+ $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}>
|
||||
+ $<INSTALL_INTERFACE:include>
|
||||
+ )
|
||||
+ set_target_properties(libjpeg_static
|
||||
+ PROPERTIES
|
||||
+ OUTPUT_NAME jpeg
|
||||
+ VERSION ${PROJECT_VERSION_MAJOR}
|
||||
+ POSITION_INDEPENDENT_CODE ON
|
||||
+ CLEAN_DIRECT_OUTPUT ON
|
||||
+ PUBLIC_HEADER "${PUBLIC_HDRS}"
|
||||
+ )
|
||||
+ install(TARGETS libjpeg_static
|
||||
+ LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
|
||||
+ ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}
|
||||
+ PUBLIC_HEADER DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}
|
||||
+ )
|
||||
+endif()
|
||||
+
|
||||
+# Configure and install pkg-config and libtool files
|
||||
+if(BUILD_STATIC_LIBS OR BUILD_SHARED_LIBS)
|
||||
+ # Compute the la file's weird version number
|
||||
+ math(EXPR JPEG_CONF_VER_MAJOR "${PROJECT_VERSION_MAJOR} + ${PROJECT_VERSION_MINOR}")
|
||||
+ set(JPEG_LIB_VERSION_MAJOR ${PROJECT_VERSION_MAJOR})
|
||||
+ set(JPEG_LIB_VERSION_MINOR ${PROJECT_VERSION_MINOR})
|
||||
+
|
||||
+ # Configure and install
|
||||
+ configure_file(libjpeg.pc.cmakein libjpeg.pc @ONLY)
|
||||
+ install(FILES
|
||||
+ ${CMAKE_CURRENT_BINARY_DIR}/libjpeg.pc
|
||||
+ DESTINATION ${CMAKE_INSTALL_PREFIX}/lib/pkgconfig
|
||||
+ )
|
||||
+endif()
|
||||
+
|
||||
diff -ruN jpeg-9f/ConfigureJConfig.cmake jpeg-9f-new/ConfigureJConfig.cmake
|
||||
--- jpeg-9f/ConfigureJConfig.cmake 1970-01-01 10:00:00.000000000 +1000
|
||||
+++ jpeg-9f-new/ConfigureJConfig.cmake 2024-03-23 21:09:37.223882900 +1000
|
||||
@@ -0,0 +1,95 @@
|
||||
+include(CheckIncludeFile)
|
||||
+include(CheckSymbolExists)
|
||||
+include(CheckTypeSize)
|
||||
+
|
||||
+# Define this if your system has an ANSI-conforming <stddef.h> file.
|
||||
+check_include_file(stddef.h HAVE_STDDEF_H)
|
||||
+
|
||||
+# Define this if your system has an ANSI-conforming <stdlib.h> file.
|
||||
+check_include_file(stdlib.h HAVE_STDLIB_H)
|
||||
+
|
||||
+# Does your compiler support function prototypes?
|
||||
+# (If not, you also need to use ansi2knr, see install.txt)
|
||||
+set(HAVE_PROTOTYPES true CACHE BOOL "Does your compiler support function prototypes?")
|
||||
+
|
||||
+# Does your compiler support the declaration "unsigned char" ?
|
||||
+# How about "unsigned short" ?
|
||||
+check_type_size("unsigned char" UNSIGNED_CHAR LANGUAGE C)
|
||||
+check_type_size("unsigned short" UNSIGNED_SHORT LANGUAGE C)
|
||||
+
|
||||
+# Define "void" as "char" if your compiler doesn't know about type void.
|
||||
+# NOTE: be sure to define void such that "void *" represents the most general
|
||||
+# pointer type, e.g., that returned by malloc().
|
||||
+# NOT IMPLEMENTED: Modify in jconfig.h.in #
|
||||
+
|
||||
+# Define "const" as empty if your compiler doesn't know the "const" keyword.
|
||||
+# NOT IMPLEMENTED: Modify in jconfig.h.in #
|
||||
+
|
||||
+# Define this if an ordinary "char" type is unsigned.
|
||||
+# If you're not sure, leaving it undefined will work at some cost in speed.
|
||||
+# If you defined HAVE_UNSIGNED_CHAR then the speed difference is minimal.
|
||||
+set(CHAR_IS_UNSIGNED false CACHE BOOL "char type is unsigned")
|
||||
+
|
||||
+# Define this if your system does not have an ANSI/SysV <string.h>,
|
||||
+# but does have a BSD-style <strings.h>.
|
||||
+set(NEED_BSD_STRINGS false CACHE BOOL "Use BSD <strings.h>. Use only if system lacks ANSI/SysV <strings.h>")
|
||||
+
|
||||
+# Define this if your system does not provide typedef size_t in any of the
|
||||
+# ANSI-standard places (stddef.h, stdlib.h, or stdio.h), but places it in
|
||||
+# <sys/types.h> instead.
|
||||
+set(NEED_SYS_TYPES_H false CACHE BOOL "size_t defined in <sys/types.h>")
|
||||
+
|
||||
+# For 80x86 machines, you need to define NEED_FAR_POINTERS,
|
||||
+# unless you are using a large-data memory model or 80386 flat-memory mode.
|
||||
+# On less brain-damaged CPUs this symbol must not be defined.
|
||||
+# (Defining this symbol causes large data structures to be referenced through
|
||||
+# "far" pointers and to be allocated with a special version of malloc.)
|
||||
+set(NEED_FAR_POINTERS false CACHE BOOL "Reference large data structures through 'far' pointers allocated with a special version of malloc")
|
||||
+
|
||||
+# Define this if your linker needs global names to be unique in less
|
||||
+# than the first 15 characters.
|
||||
+set(NEED_SHORT_EXTERNAL_NAMES false CACHE BOOL "Global names must be unique in less than the first 15 characters")
|
||||
+
|
||||
+# Although a real ANSI C compiler can deal perfectly well with pointers to
|
||||
+# unspecified structures (see "incomplete types" in the spec), a few pre-ANSI
|
||||
+# and pseudo-ANSI compilers get confused. To keep one of these bozos happy,
|
||||
+# define INCOMPLETE_TYPES_BROKEN. This is not recommended unless you
|
||||
+# actually get "missing structure definition" warnings or errors while
|
||||
+# compiling the JPEG code.
|
||||
+set(INCOMPLETE_TYPES_BROKEN false CACHE BOOL "Disable pointers to unspecified structures")
|
||||
+
|
||||
+# Define "boolean" as unsigned char, not enum, on Windows systems.
|
||||
+# NOT IMPLEMENTED: Modify in jconfig.h.in #
|
||||
+
|
||||
+# The following options affect code selection within the JPEG library,
|
||||
+# but they don't need to be visible to applications using the library.
|
||||
+# To minimize application namespace pollution, the symbols won't be
|
||||
+# defined unless JPEG_INTERNALS has been defined.
|
||||
+#
|
||||
+
|
||||
+# Define this if your compiler implements ">>" on signed values as a logical
|
||||
+# (unsigned) shift; leave it undefined if ">>" is a signed (arithmetic) shift,
|
||||
+# which is the normal and rational definition.
|
||||
+set(RIGHT_SHIFT_IS_UNSIGNED false CACHE BOOL "Compiler implements >> on signed values as a logical (unsigned) shift")
|
||||
+
|
||||
+# The remaining options do not affect the JPEG library proper,
|
||||
+# but only the sample applications cjpeg/djpeg (see cjpeg.c, djpeg.c).
|
||||
+# Other applications can ignore these.
|
||||
+#
|
||||
+
|
||||
+mark_as_advanced(FORCE
|
||||
+ HAVE_PROTOTYPES
|
||||
+ HAVE_UNSIGNED_CHAR
|
||||
+ HAVE_UNSIGNED_SHORT
|
||||
+ CHAR_IS_UNSIGNED
|
||||
+ HAVE_STDDEF_H
|
||||
+ HAVE_STDLIB_H
|
||||
+ NEED_BSD_STRINGS
|
||||
+ NEED_SYS_TYPES_H
|
||||
+ NEED_FAR_POINTERS
|
||||
+ NEED_SHORT_EXTERNAL_NAMES
|
||||
+ INCOMPLETE_TYPES_BROKEN
|
||||
+ RIGHT_SHIFT_IS_UNSIGNED
|
||||
+)
|
||||
+
|
||||
+configure_file(jconfig.h.in ${CMAKE_CURRENT_SOURCE_DIR}/jconfig.h)
|
||||
diff -ruN jpeg-9f/jconfig.h.in jpeg-9f-new/jconfig.h.in
|
||||
--- jpeg-9f/jconfig.h.in 1970-01-01 10:00:00.000000000 +1000
|
||||
+++ jpeg-9f-new/jconfig.h.in 2024-03-23 21:06:05.204994600 +1000
|
||||
@@ -0,0 +1,173 @@
|
||||
+/*
|
||||
+ * jconfig.h.in
|
||||
+ *
|
||||
+ * Copyright (C) 1991-1994, Thomas G. Lane.
|
||||
+ * Modified 2009-2013 by Guido Vollbeding.
|
||||
+ * This file is part of the Independent JPEG Group's software.
|
||||
+ * For conditions of distribution and use, see the accompanying README file.
|
||||
+ *
|
||||
+ * This file is a modification of jconfig.txt from libjpeg. In addition to
|
||||
+ * documenting the configuration options that are required to customize the
|
||||
+ * JPEG software for a particular system, it is used by jpeg-cmake to configure
|
||||
+ * jconfig.h
|
||||
+ */
|
||||
+
|
||||
+
|
||||
+/*
|
||||
+ * These symbols indicate the properties of your machine or compiler.
|
||||
+ * #define the symbol if yes, #undef it if no.
|
||||
+ */
|
||||
+
|
||||
+/* Does your compiler support function prototypes?
|
||||
+ * (If not, you also need to use ansi2knr, see install.txt)
|
||||
+ */
|
||||
+#cmakedefine HAVE_PROTOTYPES
|
||||
+
|
||||
+/* Does your compiler support the declaration "unsigned char" ?
|
||||
+ * How about "unsigned short" ?
|
||||
+ */
|
||||
+#cmakedefine HAVE_UNSIGNED_CHAR
|
||||
+#cmakedefine HAVE_UNSIGNED_SHORT
|
||||
+
|
||||
+/* Define "void" as "char" if your compiler doesn't know about type void.
|
||||
+ * NOTE: be sure to define void such that "void *" represents the most general
|
||||
+ * pointer type, e.g., that returned by malloc().
|
||||
+ */
|
||||
+/* #define void char */
|
||||
+
|
||||
+/* Define "const" as empty if your compiler doesn't know the "const" keyword.
|
||||
+ */
|
||||
+/* #define const */
|
||||
+
|
||||
+/* Define this if an ordinary "char" type is unsigned.
|
||||
+ * If you're not sure, leaving it undefined will work at some cost in speed.
|
||||
+ * If you defined HAVE_UNSIGNED_CHAR then the speed difference is minimal.
|
||||
+ */
|
||||
+#cmakedefine CHAR_IS_UNSIGNED
|
||||
+
|
||||
+/* Define this if your system has an ANSI-conforming <stddef.h> file.
|
||||
+ */
|
||||
+#cmakedefine HAVE_STDDEF_H
|
||||
+
|
||||
+/* Define this if your system has an ANSI-conforming <stdlib.h> file.
|
||||
+ */
|
||||
+#cmakedefine HAVE_STDLIB_H
|
||||
+
|
||||
+/* Define this if your system does not have an ANSI/SysV <string.h>,
|
||||
+ * but does have a BSD-style <strings.h>.
|
||||
+ */
|
||||
+#cmakedefine NEED_BSD_STRINGS
|
||||
+
|
||||
+/* Define this if your system does not provide typedef size_t in any of the
|
||||
+ * ANSI-standard places (stddef.h, stdlib.h, or stdio.h), but places it in
|
||||
+ * <sys/types.h> instead.
|
||||
+ */
|
||||
+#cmakedefine NEED_SYS_TYPES_H
|
||||
+
|
||||
+/* For 80x86 machines, you need to define NEED_FAR_POINTERS,
|
||||
+ * unless you are using a large-data memory model or 80386 flat-memory mode.
|
||||
+ * On less brain-damaged CPUs this symbol must not be defined.
|
||||
+ * (Defining this symbol causes large data structures to be referenced through
|
||||
+ * "far" pointers and to be allocated with a special version of malloc.)
|
||||
+ */
|
||||
+#cmakedefine NEED_FAR_POINTERS
|
||||
+
|
||||
+/* Define this if your linker needs global names to be unique in less
|
||||
+ * than the first 15 characters.
|
||||
+ */
|
||||
+#cmakedefine NEED_SHORT_EXTERNAL_NAMES
|
||||
+
|
||||
+/* Although a real ANSI C compiler can deal perfectly well with pointers to
|
||||
+ * unspecified structures (see "incomplete types" in the spec), a few pre-ANSI
|
||||
+ * and pseudo-ANSI compilers get confused. To keep one of these bozos happy,
|
||||
+ * define INCOMPLETE_TYPES_BROKEN. This is not recommended unless you
|
||||
+ * actually get "missing structure definition" warnings or errors while
|
||||
+ * compiling the JPEG code.
|
||||
+ */
|
||||
+#cmakedefine INCOMPLETE_TYPES_BROKEN
|
||||
+
|
||||
+/* Define "boolean" as unsigned char, not enum, on Windows systems.
|
||||
+ */
|
||||
+#ifdef _WIN32
|
||||
+#ifndef __RPCNDR_H__ /* don't conflict if rpcndr.h already read */
|
||||
+typedef unsigned char boolean;
|
||||
+#endif
|
||||
+#ifndef FALSE /* in case these macros already exist */
|
||||
+#define FALSE 0 /* values of boolean */
|
||||
+#endif
|
||||
+#ifndef TRUE
|
||||
+#define TRUE 1
|
||||
+#endif
|
||||
+#define HAVE_BOOLEAN /* prevent jmorecfg.h from redefining it */
|
||||
+#endif
|
||||
+
|
||||
+
|
||||
+/*
|
||||
+ * The following options affect code selection within the JPEG library,
|
||||
+ * but they don't need to be visible to applications using the library.
|
||||
+ * To minimize application namespace pollution, the symbols won't be
|
||||
+ * defined unless JPEG_INTERNALS has been defined.
|
||||
+ */
|
||||
+
|
||||
+#ifdef JPEG_INTERNALS
|
||||
+
|
||||
+/* Define this if your compiler implements ">>" on signed values as a logical
|
||||
+ * (unsigned) shift; leave it undefined if ">>" is a signed (arithmetic) shift,
|
||||
+ * which is the normal and rational definition.
|
||||
+ */
|
||||
+#cmakedefine RIGHT_SHIFT_IS_UNSIGNED
|
||||
+
|
||||
+
|
||||
+#endif /* JPEG_INTERNALS */
|
||||
+
|
||||
+
|
||||
+/*
|
||||
+ * The remaining options do not affect the JPEG library proper,
|
||||
+ * but only the sample applications cjpeg/djpeg (see cjpeg.c, djpeg.c).
|
||||
+ * Other applications can ignore these.
|
||||
+ */
|
||||
+
|
||||
+#ifdef JPEG_CJPEG_DJPEG
|
||||
+
|
||||
+/* These defines indicate which image (non-JPEG) file formats are allowed. */
|
||||
+
|
||||
+#cmakedefine BMP_SUPPORTED /* BMP image file format */
|
||||
+#cmakedefine GIF_SUPPORTED /* GIF image file format */
|
||||
+#cmakedefine PPM_SUPPORTED /* PBMPLUS PPM/PGM image file format */
|
||||
+#cmakedefine RLE_SUPPORTED /* Utah RLE image file format */
|
||||
+#cmakedefine TARGA_SUPPORTED /* Targa image file format */
|
||||
+
|
||||
+/*
|
||||
+ * This defines the default output format for djpeg. Must be one of the FMT_*
|
||||
+ * enums found in djpeg.c or djpegalt.c
|
||||
+ */
|
||||
+#cmakedefine DEFAULT_FMT @DEFAULT_FMT@
|
||||
+
|
||||
+/* Define this if you want to name both input and output files on the command
|
||||
+ * line, rather than using stdout and optionally stdin. You MUST do this if
|
||||
+ * your system can't cope with binary I/O to stdin/stdout. See comments at
|
||||
+ * head of cjpeg.c or djpeg.c.
|
||||
+ */
|
||||
+#cmakedefine TWO_FILE_COMMANDLINE
|
||||
+
|
||||
+/* Define this if your system needs explicit cleanup of temporary files.
|
||||
+ * This is crucial under MS-DOS, where the temporary "files" may be areas
|
||||
+ * of extended memory; on most other systems it's not as important.
|
||||
+ */
|
||||
+#cmakedefine NEED_SIGNAL_CATCHER
|
||||
+
|
||||
+/* By default, we open image files with fopen(...,"rb") or fopen(...,"wb").
|
||||
+ * This is necessary on systems that distinguish text files from binary files,
|
||||
+ * and is harmless on most systems that don't. If you have one of the rare
|
||||
+ * systems that complains about the "b" spec, define this symbol.
|
||||
+ */
|
||||
+#cmakedefine DONT_USE_B_MODE
|
||||
+
|
||||
+/* Define this if you want percent-done progress reports from cjpeg/djpeg.
|
||||
+ */
|
||||
+#cmakedefine PROGRESS_REPORT
|
||||
+
|
||||
+/* Define this if you *don't* want overwrite confirmation */
|
||||
+#cmakedefine NO_OVERWRITE_CHECK
|
||||
+
|
||||
+#endif /* JPEG_CJPEG_DJPEG */
|
||||
diff -ruN jpeg-9f/jmorecfg.h jpeg-9f-new/jmorecfg.h
|
||||
--- jpeg-9f/jmorecfg.h 2022-03-31 19:41:26.000000000 +1000
|
||||
+++ jpeg-9f-new/jmorecfg.h 2024-03-23 21:20:25.514814400 +1000
|
||||
@@ -244,8 +244,13 @@
|
||||
#define LOCAL(type) static type
|
||||
/* a function referenced thru EXTERNs: */
|
||||
#define GLOBAL(type) type
|
||||
+
|
||||
/* a reference to a GLOBAL function: */
|
||||
-#define EXTERN(type) extern type
|
||||
+#ifdef COMPILING_LIBJPEG
|
||||
+#define EXTERN(type) __declspec(dllexport) extern type
|
||||
+#else
|
||||
+#define EXTERN(type) __declspec(dllimport) extern type
|
||||
+#endif
|
||||
|
||||
|
||||
/* This macro is used to declare a "method", that is, a function pointer.
|
||||
diff -ruN jpeg-9f/libjpeg.pc.cmakein jpeg-9f-new/libjpeg.pc.cmakein
|
||||
--- jpeg-9f/libjpeg.pc.cmakein 1970-01-01 10:00:00.000000000 +1000
|
||||
+++ jpeg-9f-new/libjpeg.pc.cmakein 2024-03-23 21:06:13.922695100 +1000
|
||||
@@ -0,0 +1,10 @@
|
||||
+prefix=@CMAKE_INSTALL_PREFIX@
|
||||
+exec_prefix=${prefix}
|
||||
+libdir=${exec_prefix}/@CMAKE_INSTALL_LIBDIR@
|
||||
+includedir=${prefix}/@CMAKE_INSTALL_INCLUDEDIR@
|
||||
+
|
||||
+Name: libjpeg
|
||||
+Description: Reads and writes JPEG files
|
||||
+Version: @JPEG_LIB_VERSION_MAJOR@.@JPEG_LIB_VERSION_MINOR@.0
|
||||
+Libs: -L${libdir} -ljpeg
|
||||
+Cflags: -I${includedir}
|
||||
2
.github/workflows/triage_pr.yml
vendored
2
.github/workflows/triage_pr.yml
vendored
@@ -8,7 +8,7 @@ jobs:
|
||||
if: github.repository == 'PCSX2/pcsx2'
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/labeler@main
|
||||
- uses: actions/labeler@v5
|
||||
with:
|
||||
repo-token: ${{ secrets.GITHUB_TOKEN }}
|
||||
|
||||
|
||||
8
.github/workflows/windows_build_matrix.yml
vendored
8
.github/workflows/windows_build_matrix.yml
vendored
@@ -16,7 +16,7 @@ jobs:
|
||||
runs-on: windows-2019
|
||||
steps:
|
||||
- name: Checkout Repository
|
||||
uses: actions/checkout@v3
|
||||
uses: actions/checkout@v4
|
||||
- name: Verify VS Project Files
|
||||
run: .github\workflows\scripts\windows\validate-vs-filters.ps1
|
||||
|
||||
@@ -27,6 +27,7 @@ jobs:
|
||||
uses: ./.github/workflows/windows_build_qt.yml
|
||||
with:
|
||||
jobName: "MSVC SSE4"
|
||||
artifactPrefixName: "PCSX2-windows-Qt-x64-sse4-msvc"
|
||||
configuration: Release
|
||||
simd: "SSE4"
|
||||
secrets: inherit
|
||||
@@ -38,6 +39,7 @@ jobs:
|
||||
uses: ./.github/workflows/windows_build_qt.yml
|
||||
with:
|
||||
jobName: "MSVC AVX2"
|
||||
artifactPrefixName: "PCSX2-windows-Qt-x64-avx2-msvc"
|
||||
configuration: Release AVX2
|
||||
secrets: inherit
|
||||
|
||||
@@ -47,6 +49,7 @@ jobs:
|
||||
uses: ./.github/workflows/windows_build_qt.yml
|
||||
with:
|
||||
jobName: "CMake MSVC"
|
||||
artifactPrefixName: "PCSX2-windows-Qt-x64-cmake-msvc"
|
||||
configuration: CMake
|
||||
buildSystem: cmake
|
||||
secrets: inherit
|
||||
@@ -58,6 +61,7 @@ jobs:
|
||||
uses: ./.github/workflows/windows_build_qt.yml
|
||||
with:
|
||||
jobName: "Clang SSE4"
|
||||
artifactPrefixName: "PCSX2-windows-Qt-x64-sse4-clang"
|
||||
configuration: Release Clang
|
||||
simd: "SSE4"
|
||||
secrets: inherit
|
||||
@@ -69,6 +73,7 @@ jobs:
|
||||
uses: ./.github/workflows/windows_build_qt.yml
|
||||
with:
|
||||
jobName: "Clang AVX2"
|
||||
artifactPrefixName: "PCSX2-windows-Qt-x64-avx2-clang"
|
||||
configuration: Release Clang AVX2
|
||||
secrets: inherit
|
||||
|
||||
@@ -78,6 +83,7 @@ jobs:
|
||||
uses: ./.github/workflows/windows_build_qt.yml
|
||||
with:
|
||||
jobName: "CMake Clang"
|
||||
artifactPrefixName: "PCSX2-windows-Qt-x64-cmake-clang"
|
||||
configuration: CMake
|
||||
buildSystem: cmake
|
||||
cmakeFlags: -DCMAKE_C_COMPILER=clang-cl -DCMAKE_CXX_COMPILER=clang-cl -DPCSX2_EXE_NAME=pcsx2-qt-clang
|
||||
|
||||
61
.github/workflows/windows_build_qt.yml
vendored
61
.github/workflows/windows_build_qt.yml
vendored
@@ -6,6 +6,9 @@ on:
|
||||
jobName:
|
||||
required: true
|
||||
type: string
|
||||
artifactPrefixName:
|
||||
required: true
|
||||
type: string
|
||||
os:
|
||||
required: false
|
||||
type: string
|
||||
@@ -29,14 +32,6 @@ on:
|
||||
required: false
|
||||
type: string
|
||||
default: ""
|
||||
qt_binary_url:
|
||||
required: false
|
||||
type: string
|
||||
default: https://github.com/PCSX2/pcsx2-windows-dependencies/releases/download/2023-04-25/qt-6.5.0-x64.7z
|
||||
qt_dir:
|
||||
required: false
|
||||
type: string
|
||||
default: 3rdparty\qt\6.5.0\msvc2022_64
|
||||
patchesUrl:
|
||||
required: false
|
||||
type: string
|
||||
@@ -45,19 +40,23 @@ on:
|
||||
required: false
|
||||
type: boolean
|
||||
default: false
|
||||
stableBuild:
|
||||
required: false
|
||||
type: boolean
|
||||
default: false
|
||||
|
||||
jobs:
|
||||
build_windows_qt:
|
||||
name: ${{ inputs.jobName }}
|
||||
runs-on: ${{ inputs.os }}
|
||||
# Set some sort of timeout in the event of run-away builds. We are limited on concurrent jobs so, get rid of them.
|
||||
timeout-minutes: 60
|
||||
timeout-minutes: 90
|
||||
env:
|
||||
POWERSHELL_TELEMETRY_OPTOUT: 1
|
||||
|
||||
steps:
|
||||
- name: Checkout Repository
|
||||
uses: actions/checkout@v3
|
||||
uses: actions/checkout@v4
|
||||
with:
|
||||
submodules: recursive
|
||||
|
||||
@@ -66,14 +65,18 @@ jobs:
|
||||
if: ${{ inputs.fetchTags }}
|
||||
run: git fetch --tags --no-recurse-submodules
|
||||
|
||||
- name: Add stable release identifier file
|
||||
if: ${{ inputs.stableBuild == true || inputs.stableBuild == 'true' }}
|
||||
shell: bash
|
||||
run: |
|
||||
echo "#define DEFAULT_UPDATER_CHANNEL \"stable\"" > ./pcsx2-qt/DefaultUpdaterChannel.h
|
||||
cat ./pcsx2-qt/DefaultUpdaterChannel.h
|
||||
|
||||
- name: Prepare Artifact Metadata
|
||||
id: artifact-metadata
|
||||
shell: bash
|
||||
env:
|
||||
OS: windows
|
||||
BUILD_SYSTEM: ${{ inputs.buildSystem }}
|
||||
ARCH: ${{ inputs.platform }}
|
||||
SIMD: ${{ inputs.simd }}
|
||||
PREFIX: ${{ inputs.artifactPrefixName }}
|
||||
EVENT_NAME: ${{ github.event_name }}
|
||||
PR_TITLE: ${{ github.event.pull_request.title }}
|
||||
PR_NUM: ${{ github.event.pull_request.number }}
|
||||
@@ -82,15 +85,7 @@ jobs:
|
||||
|
||||
- name: Setup msbuild
|
||||
if: inputs.configuration != 'CMake'
|
||||
uses: microsoft/setup-msbuild@v1
|
||||
|
||||
- name: Download Qt build files
|
||||
shell: cmd
|
||||
run: |
|
||||
cd 3rdparty\qt
|
||||
aria2c ${{ inputs.qt_binary_url }}
|
||||
7z x qt-*-x64.7z
|
||||
del qt-*-x64.7z
|
||||
uses: microsoft/setup-msbuild@v2
|
||||
|
||||
- name: Download patches
|
||||
shell: cmd
|
||||
@@ -98,13 +93,26 @@ jobs:
|
||||
cd bin/resources
|
||||
aria2c -Z "${{ inputs.patchesUrl }}/patches.zip"
|
||||
|
||||
- name: Cache Dependencies
|
||||
id: cache-deps
|
||||
uses: actions/cache@v4
|
||||
with:
|
||||
path: deps
|
||||
key: ${{ inputs.os }} ${{ inputs.platform }} deps ${{ hashFiles('.github/workflows/scripts/windows/build-dependencies.bat') }}
|
||||
|
||||
- name: Build Dependencies
|
||||
if: steps.cache-deps.outputs.cache-hit != 'true'
|
||||
env:
|
||||
DEBUG: 0
|
||||
run: .github/workflows/scripts/windows/build-dependencies.bat
|
||||
|
||||
- name: Generate CMake
|
||||
if: inputs.configuration == 'CMake'
|
||||
id: cmake
|
||||
shell: cmd
|
||||
run: |
|
||||
call "%ProgramFiles%\Microsoft Visual Studio\2022\Enterprise\VC\Auxiliary\Build\vcvars64.bat"
|
||||
cmake . -B build ${{ inputs.cmakeFlags }} "-DCMAKE_PREFIX_PATH=%cd%\${{ inputs.qt_dir }}" -DQT_BUILD=ON -DCMAKE_BUILD_TYPE=Release -DCMAKE_INTERPROCEDURAL_OPTIMIZATION=ON -DDISABLE_ADVANCE_SIMD=ON -G Ninja
|
||||
cmake . -B build ${{ inputs.cmakeFlags }} "-DCMAKE_PREFIX_PATH=%cd%\deps" -DQT_BUILD=ON -DCMAKE_BUILD_TYPE=Release -DCMAKE_INTERPROCEDURAL_OPTIMIZATION=ON -DDISABLE_ADVANCE_SIMD=ON -G Ninja
|
||||
|
||||
- name: Build PCSX2
|
||||
shell: cmd
|
||||
@@ -122,10 +130,11 @@ jobs:
|
||||
shell: cmd
|
||||
run: |
|
||||
call "%ProgramFiles%\Microsoft Visual Studio\2022\Enterprise\VC\Auxiliary\Build\vcvars64.bat"
|
||||
set PATH=%PATH%;%GITHUB_WORKSPACE%\bin
|
||||
cmake --build build --config Release --target unittests
|
||||
|
||||
- name: Upload artifact
|
||||
uses: actions/upload-artifact@v3
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: ${{ steps.artifact-metadata.outputs.artifact-name }}
|
||||
path: |
|
||||
@@ -139,7 +148,7 @@ jobs:
|
||||
!./bin/**/*.lib
|
||||
|
||||
- name: Upload artifact - with symbols
|
||||
uses: actions/upload-artifact@v3
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: ${{ steps.artifact-metadata.outputs.artifact-name }}-symbols
|
||||
path: ./bin/**/*.pdb
|
||||
|
||||
31
.gitignore
vendored
31
.gitignore
vendored
@@ -23,13 +23,6 @@
|
||||
*.VC.db
|
||||
*.VC.VC.opendb
|
||||
|
||||
**/Win32/Release*
|
||||
**/Win32/Debug*
|
||||
**/Win32/Devel*
|
||||
**/x64/Release*
|
||||
**/x64/Debug*
|
||||
**/x64/Devel*
|
||||
|
||||
_ReSharper.*
|
||||
pcsx2.snapshot_*
|
||||
svnrev.h
|
||||
@@ -44,6 +37,7 @@ Thumbs.db
|
||||
Debug.txt
|
||||
install_log.txt
|
||||
bad_shader_*
|
||||
crash-*.txt
|
||||
|
||||
Debug
|
||||
Release
|
||||
@@ -62,6 +56,13 @@ oprofile_data/
|
||||
/UpgradeLog*.htm
|
||||
/.vscode*
|
||||
|
||||
# Jetbrains Rider
|
||||
/.idea*
|
||||
|
||||
# KDevelop 4 Workspace Configuration Files
|
||||
*.kdev4
|
||||
/.kdev4*
|
||||
|
||||
/bin/**/*.dll
|
||||
/bin/**/*.dmp
|
||||
/bin/**/*.exp
|
||||
@@ -73,11 +74,13 @@ oprofile_data/
|
||||
/bin/bios
|
||||
/bin/cache
|
||||
/bin/cheats
|
||||
/bin/patches
|
||||
/bin/covers
|
||||
/bin/dumps
|
||||
/bin/gamesettings
|
||||
/bin/help
|
||||
/bin/inis
|
||||
/bin/inis/debuggersettings
|
||||
/bin/logs
|
||||
/bin/memcards
|
||||
/bin/plugins
|
||||
@@ -86,6 +89,20 @@ oprofile_data/
|
||||
/bin/textures
|
||||
/bin/translations
|
||||
/bin/inputprofiles
|
||||
/bin/videos
|
||||
/bin/portable.ini
|
||||
/bin/portable.txt
|
||||
|
||||
# Manually added by user.
|
||||
/bin/resources/patches.zip
|
||||
|
||||
# Resources that are runtime downloaded.
|
||||
/bin/resources/fonts/NotoSansJP-Regular.ttf
|
||||
/bin/resources/fonts/NotoSansKR-Regular.ttf
|
||||
/bin/resources/fonts/NotoSansSC-Regular.ttf
|
||||
/bin/resources/fonts/NotoSansTC-Regular.ttf
|
||||
|
||||
/deps-build
|
||||
/deps
|
||||
/ipch
|
||||
|
||||
|
||||
21
.gitmodules
vendored
21
.gitmodules
vendored
@@ -1,15 +1,9 @@
|
||||
[submodule "3rdparty/xz/xz"]
|
||||
path = 3rdparty/xz/xz
|
||||
url = https://github.com/PCSX2/xz.git
|
||||
[submodule "3rdparty/gtest"]
|
||||
path = 3rdparty/gtest
|
||||
url = https://github.com/google/googletest.git
|
||||
[submodule "3rdparty/fmt/fmt"]
|
||||
path = 3rdparty/fmt/fmt
|
||||
url = https://github.com/fmtlib/fmt.git
|
||||
[submodule "3rdparty/libchdr/libchdr"]
|
||||
path = 3rdparty/libchdr/libchdr
|
||||
url = https://github.com/rtissera/libchdr.git
|
||||
[submodule "3rdparty/wil"]
|
||||
path = 3rdparty/wil
|
||||
url = https://github.com/microsoft/wil.git
|
||||
@@ -18,21 +12,6 @@
|
||||
path = 3rdparty/rapidyaml/rapidyaml
|
||||
url = https://github.com/biojppm/rapidyaml.git
|
||||
branch = master
|
||||
[submodule "3rdparty/glslang/glslang"]
|
||||
path = 3rdparty/glslang/glslang
|
||||
url = https://github.com/KhronosGroup/glslang.git
|
||||
[submodule "3rdparty/vulkan-headers"]
|
||||
path = 3rdparty/vulkan-headers
|
||||
url = https://github.com/KhronosGroup/Vulkan-Headers.git
|
||||
[submodule "3rdparty/sdl2/SDL"]
|
||||
path = 3rdparty/sdl2/SDL
|
||||
url = https://github.com/libsdl-org/SDL.git
|
||||
[submodule "3rdparty/libzip/libzip"]
|
||||
path = 3rdparty/libzip/libzip
|
||||
url = https://github.com/nih-at/libzip.git
|
||||
[submodule "3rdparty/zstd/zstd"]
|
||||
path = 3rdparty/zstd/zstd
|
||||
url = https://github.com/facebook/zstd.git
|
||||
[submodule "3rdparty/rcheevos/rcheevos"]
|
||||
path = 3rdparty/rcheevos/rcheevos
|
||||
url = https://github.com/RetroAchievements/rcheevos.git
|
||||
|
||||
20
3rdparty/3rdparty.props
vendored
20
3rdparty/3rdparty.props
vendored
@@ -2,8 +2,8 @@
|
||||
<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<PropertyGroup>
|
||||
<_ProjectFileVersion>10.0.30128.1</_ProjectFileVersion>
|
||||
<OutDir>$(SolutionDir)deps\$(PlatformName)\$(Configuration)\</OutDir>
|
||||
<IntDir>$(PlatformName)\$(Configuration)\</IntDir>
|
||||
<OutDir>$(SolutionDir)build\3rdparty\lib-$(PlatformName)-$(Configuration)\</OutDir>
|
||||
<IntDir>$(SolutionDir)build\3rdparty\obj-$(ProjectName)-$(PlatformName)-$(Configuration)\</IntDir>
|
||||
<ExtensionsToDeleteOnClean>*.bsc;*.idb;*.sbr;*.res;*.pch;*.pdb;*.obj;*.tlb;*.tli;*.tlh;*.tmp;*.rsp;*.pgc;*.pgd;*.meta;$(TargetPath);$(ExtensionsToDeleteOnClean)</ExtensionsToDeleteOnClean>
|
||||
</PropertyGroup>
|
||||
<ItemDefinitionGroup>
|
||||
@@ -16,6 +16,22 @@
|
||||
<WarningLevel>TurnOffAllWarnings</WarningLevel>
|
||||
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
|
||||
<CompileAs>Default</CompileAs>
|
||||
<LanguageStandard>stdcpp20</LanguageStandard>
|
||||
<MultiProcessorCompilation>true</MultiProcessorCompilation>
|
||||
<MinimalRebuild>false</MinimalRebuild>
|
||||
<ConformanceMode>true</ConformanceMode>
|
||||
|
||||
<!-- MSVC automatically adds __AVX__ and __AVX2__ appropriately -->
|
||||
<PreprocessorDefinitions>_M_X86;__SSE4_1__;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<EnableEnhancedInstructionSet Condition="!$(Configuration.Contains(AVX2)) Or $(Configuration.Contains(Clang))">NotSet</EnableEnhancedInstructionSet>
|
||||
<EnableEnhancedInstructionSet Condition="$(Configuration.Contains(AVX2)) And !$(Configuration.Contains(Clang))">AdvancedVectorExtensions2</EnableEnhancedInstructionSet>
|
||||
<AdditionalOptions Condition="$(Configuration.Contains(Clang)) And !$(Configuration.Contains(AVX2))"> -march=nehalem %(AdditionalOptions)</AdditionalOptions>
|
||||
<AdditionalOptions Condition="$(Configuration.Contains(Clang)) And $(Configuration.Contains(AVX2))"> -march=haswell %(AdditionalOptions)</AdditionalOptions>
|
||||
<AdditionalOptions Condition="!$(Configuration.Contains(Clang))">%(AdditionalOptions) /Zc:externConstexpr /Zc:__cplusplus /Zo /utf-8</AdditionalOptions>
|
||||
|
||||
<!-- Force ThinLTO for Release builds, MSVC doesn't seem to do it otherwise. -->
|
||||
<!-- Also due to include order, needs to be set here, rather than in CodeGen_Release.props -->
|
||||
<AdditionalOptions Condition="$(Configuration.Contains(Clang)) And $(Configuration.Contains(Release))"> -flto=thin %(AdditionalOptions)</AdditionalOptions>
|
||||
</ClCompile>
|
||||
</ItemDefinitionGroup>
|
||||
</Project>
|
||||
|
||||
770
3rdparty/cpuinfo/CMakeLists.txt
vendored
770
3rdparty/cpuinfo/CMakeLists.txt
vendored
@@ -3,7 +3,7 @@ CMAKE_MINIMUM_REQUIRED(VERSION 3.5 FATAL_ERROR)
|
||||
# ---[ Setup project
|
||||
PROJECT(
|
||||
cpuinfo
|
||||
LANGUAGES C CXX
|
||||
LANGUAGES C
|
||||
)
|
||||
|
||||
# ---[ Options.
|
||||
@@ -13,6 +13,26 @@ SET(CPUINFO_RUNTIME_TYPE "default" CACHE STRING "Type of runtime library (shared
|
||||
SET_PROPERTY(CACHE CPUINFO_RUNTIME_TYPE PROPERTY STRINGS default static shared)
|
||||
SET(CPUINFO_LOG_LEVEL "default" CACHE STRING "Minimum logging level (info with lower severity will be ignored)")
|
||||
SET_PROPERTY(CACHE CPUINFO_LOG_LEVEL PROPERTY STRINGS default debug info warning error fatal none)
|
||||
IF(ANDROID)
|
||||
OPTION(CPUINFO_LOG_TO_STDIO "Log errors, warnings, and information to stdout/stderr" OFF)
|
||||
ELSE()
|
||||
OPTION(CPUINFO_LOG_TO_STDIO "Log errors, warnings, and information to stdout/stderr" ON)
|
||||
ENDIF()
|
||||
OPTION(CPUINFO_BUILD_TOOLS "Build command-line tools" OFF)
|
||||
OPTION(CPUINFO_BUILD_UNIT_TESTS "Build cpuinfo unit tests" OFF)
|
||||
OPTION(CPUINFO_BUILD_MOCK_TESTS "Build cpuinfo mock tests" OFF)
|
||||
OPTION(CPUINFO_BUILD_BENCHMARKS "Build cpuinfo micro-benchmarks" OFF)
|
||||
OPTION(CPUINFO_BUILD_PKG_CONFIG "Build pkg-config manifest" OFF)
|
||||
OPTION(USE_SYSTEM_LIBS "Use system libraries instead of downloading and building them" OFF)
|
||||
OPTION(USE_SYSTEM_GOOGLEBENCHMARK "Use system Google Benchmark library instead of downloading and building it" ${USE_SYSTEM_LIBS})
|
||||
OPTION(USE_SYSTEM_GOOGLETEST "Use system Google Test library instead of downloading and building it" ${USE_SYSTEM_LIBS})
|
||||
|
||||
# ---[ CMake options
|
||||
INCLUDE(GNUInstallDirs)
|
||||
|
||||
IF(CPUINFO_BUILD_UNIT_TESTS OR CPUINFO_BUILD_MOCK_TESTS)
|
||||
ENABLE_TESTING()
|
||||
ENDIF()
|
||||
|
||||
MACRO(CPUINFO_TARGET_ENABLE_C99 target)
|
||||
SET_TARGET_PROPERTIES(${target} PROPERTIES
|
||||
@@ -22,7 +42,7 @@ ENDMACRO()
|
||||
|
||||
MACRO(CPUINFO_TARGET_ENABLE_CXX11 target)
|
||||
SET_TARGET_PROPERTIES(${target} PROPERTIES
|
||||
CXX_STANDARD 11
|
||||
CXX_STANDARD 14
|
||||
CXX_EXTENSIONS NO)
|
||||
ENDMACRO()
|
||||
|
||||
@@ -38,10 +58,29 @@ MACRO(CPUINFO_TARGET_RUNTIME_LIBRARY target)
|
||||
ENDIF()
|
||||
ENDMACRO()
|
||||
|
||||
# -- [ Determine whether building for Apple's desktop or mobile OSes
|
||||
IF(CMAKE_SYSTEM_NAME MATCHES "^(Darwin|iOS|tvOS|watchOS)$")
|
||||
SET(IS_APPLE_OS TRUE)
|
||||
ELSE()
|
||||
SET(IS_APPLE_OS FALSE)
|
||||
ENDIF()
|
||||
|
||||
# -- [ Determine target processor
|
||||
SET(CPUINFO_TARGET_PROCESSOR "${CMAKE_SYSTEM_PROCESSOR}")
|
||||
IF(CMAKE_SYSTEM_NAME STREQUAL "Darwin" AND CMAKE_OSX_ARCHITECTURES MATCHES "^(x86_64|arm64)$")
|
||||
IF(IS_APPLE_OS AND CMAKE_OSX_ARCHITECTURES MATCHES "^(x86_64|arm64.*)$")
|
||||
SET(CPUINFO_TARGET_PROCESSOR "${CMAKE_OSX_ARCHITECTURES}")
|
||||
ELSEIF(CMAKE_GENERATOR MATCHES "^Visual Studio " AND CMAKE_VS_PLATFORM_NAME)
|
||||
IF(CMAKE_VS_PLATFORM_NAME STREQUAL "Win32")
|
||||
SET(CPUINFO_TARGET_PROCESSOR "x86")
|
||||
ELSEIF(CMAKE_VS_PLATFORM_NAME STREQUAL "x64")
|
||||
SET(CPUINFO_TARGET_PROCESSOR "x86_64")
|
||||
ELSEIF(CMAKE_VS_PLATFORM_NAME STREQUAL "ARM64")
|
||||
SET(CPUINFO_TARGET_PROCESSOR "arm64")
|
||||
ELSEIF(CMAKE_VS_PLATFORM_NAME MATCHES "^(ARM64EC|arm64ec|ARM64E|arm64e)")
|
||||
SET(CPUINFO_TARGET_PROCESSOR "arm64")
|
||||
ELSE()
|
||||
MESSAGE(FATAL_ERROR "Unsupported Visual Studio architecture \"${CMAKE_VS_PLATFORM_NAME}\"")
|
||||
ENDIF()
|
||||
ENDIF()
|
||||
|
||||
# ---[ Build flags
|
||||
@@ -53,20 +92,21 @@ IF(NOT CMAKE_SYSTEM_PROCESSOR)
|
||||
"cpuinfo will compile, but cpuinfo_initialize() will always fail.")
|
||||
SET(CPUINFO_SUPPORTED_PLATFORM FALSE)
|
||||
ENDIF()
|
||||
ELSEIF(NOT CPUINFO_TARGET_PROCESSOR MATCHES "^(i[3-6]86|AMD64|x86(_64)?|armv[5-8].*|aarch64|arm64)$")
|
||||
ELSEIF(NOT CPUINFO_TARGET_PROCESSOR MATCHES "^(i[3-6]86|AMD64|x86(_64)?|armv[5-8].*|aarch64|arm64.*|ARM64.*|riscv(32|64))$")
|
||||
MESSAGE(WARNING
|
||||
"Target processor architecture \"${CPUINFO_TARGET_PROCESSOR}\" is not supported in cpuinfo. "
|
||||
"cpuinfo will compile, but cpuinfo_initialize() will always fail.")
|
||||
SET(CPUINFO_SUPPORTED_PLATFORM FALSE)
|
||||
ENDIF()
|
||||
|
||||
|
||||
IF(NOT CMAKE_SYSTEM_NAME)
|
||||
MESSAGE(WARNING
|
||||
"Target operating system is not specified. "
|
||||
"cpuinfo will compile, but cpuinfo_initialize() will always fail.")
|
||||
SET(CPUINFO_SUPPORTED_PLATFORM FALSE)
|
||||
ELSEIF(NOT CMAKE_SYSTEM_NAME MATCHES "^(Windows|CYGWIN|MSYS|Darwin|Linux|Android)$")
|
||||
IF(${CMAKE_VERSION} VERSION_GREATER_EQUAL "3.14" AND NOT CMAKE_SYSTEM_NAME STREQUAL "iOS")
|
||||
ELSEIF(NOT CMAKE_SYSTEM_NAME MATCHES "^(Windows|WindowsStore|CYGWIN|MSYS|Darwin|Linux|Android)$")
|
||||
IF(${CMAKE_VERSION} VERSION_GREATER_EQUAL "3.14" AND NOT IS_APPLE_OS)
|
||||
MESSAGE(WARNING
|
||||
"Target operating system \"${CMAKE_SYSTEM_NAME}\" is not supported in cpuinfo. "
|
||||
"cpuinfo will compile, but cpuinfo_initialize() will always fail.")
|
||||
@@ -74,11 +114,48 @@ ELSEIF(NOT CMAKE_SYSTEM_NAME MATCHES "^(Windows|CYGWIN|MSYS|Darwin|Linux|Android
|
||||
ENDIF()
|
||||
ENDIF()
|
||||
|
||||
IF(CPUINFO_SUPPORTED_PLATFORM)
|
||||
IF(CPUINFO_BUILD_MOCK_TESTS OR CPUINFO_BUILD_UNIT_TESTS OR CPUINFO_BUILD_BENCHMARKS)
|
||||
ENABLE_LANGUAGE(CXX)
|
||||
ENDIF()
|
||||
ENDIF()
|
||||
|
||||
# ---[ Download deps
|
||||
SET(CONFU_DEPENDENCIES_SOURCE_DIR ${CMAKE_SOURCE_DIR}/deps
|
||||
CACHE PATH "Confu-style dependencies source directory")
|
||||
SET(CONFU_DEPENDENCIES_BINARY_DIR ${CMAKE_BINARY_DIR}/deps
|
||||
CACHE PATH "Confu-style dependencies binary directory")
|
||||
|
||||
IF(CPUINFO_SUPPORTED_PLATFORM AND (CPUINFO_BUILD_MOCK_TESTS OR CPUINFO_BUILD_UNIT_TESTS))
|
||||
IF(USE_SYSTEM_GOOGLETEST)
|
||||
FIND_PACKAGE(GTest REQUIRED)
|
||||
ELSEIF(NOT DEFINED GOOGLETEST_SOURCE_DIR)
|
||||
MESSAGE(STATUS "Downloading Google Test to ${CONFU_DEPENDENCIES_SOURCE_DIR}/googletest (define GOOGLETEST_SOURCE_DIR to avoid it)")
|
||||
CONFIGURE_FILE(cmake/DownloadGoogleTest.cmake "${CONFU_DEPENDENCIES_BINARY_DIR}/googletest-download/CMakeLists.txt")
|
||||
EXECUTE_PROCESS(COMMAND "${CMAKE_COMMAND}" -G "${CMAKE_GENERATOR}" .
|
||||
WORKING_DIRECTORY "${CONFU_DEPENDENCIES_BINARY_DIR}/googletest-download")
|
||||
EXECUTE_PROCESS(COMMAND "${CMAKE_COMMAND}" --build .
|
||||
WORKING_DIRECTORY "${CONFU_DEPENDENCIES_BINARY_DIR}/googletest-download")
|
||||
SET(GOOGLETEST_SOURCE_DIR "${CONFU_DEPENDENCIES_SOURCE_DIR}/googletest" CACHE STRING "Google Test source directory")
|
||||
ENDIF()
|
||||
ENDIF()
|
||||
|
||||
IF(CPUINFO_SUPPORTED_PLATFORM AND CPUINFO_BUILD_BENCHMARKS)
|
||||
IF(USE_SYSTEM_GOOGLEBENCHMARK)
|
||||
FIND_PACKAGE(benchmark REQUIRED)
|
||||
ELSEIF(NOT DEFINED GOOGLEBENCHMARK_SOURCE_DIR)
|
||||
MESSAGE(STATUS "Downloading Google Benchmark to ${CONFU_DEPENDENCIES_SOURCE_DIR}/googlebenchmark (define GOOGLEBENCHMARK_SOURCE_DIR to avoid it)")
|
||||
CONFIGURE_FILE(cmake/DownloadGoogleBenchmark.cmake "${CONFU_DEPENDENCIES_BINARY_DIR}/googlebenchmark-download/CMakeLists.txt")
|
||||
EXECUTE_PROCESS(COMMAND "${CMAKE_COMMAND}" -G "${CMAKE_GENERATOR}" .
|
||||
WORKING_DIRECTORY "${CONFU_DEPENDENCIES_BINARY_DIR}/googlebenchmark-download")
|
||||
EXECUTE_PROCESS(COMMAND "${CMAKE_COMMAND}" --build .
|
||||
WORKING_DIRECTORY "${CONFU_DEPENDENCIES_BINARY_DIR}/googlebenchmark-download")
|
||||
SET(GOOGLEBENCHMARK_SOURCE_DIR "${CONFU_DEPENDENCIES_SOURCE_DIR}/googlebenchmark" CACHE STRING "Google Benchmark source directory")
|
||||
ENDIF()
|
||||
ENDIF()
|
||||
|
||||
# ---[ cpuinfo library
|
||||
SET(CPUINFO_SRCS
|
||||
src/init.c
|
||||
src/api.c
|
||||
src/cache.c)
|
||||
SET(CPUINFO_SRCS src/api.c src/cache.c src/init.c src/log.c)
|
||||
|
||||
IF(CPUINFO_SUPPORTED_PLATFORM)
|
||||
IF(NOT CMAKE_SYSTEM_NAME STREQUAL "Emscripten" AND (CPUINFO_TARGET_PROCESSOR MATCHES "^(i[3-6]86|AMD64|x86(_64)?)$" OR IOS_ARCH MATCHES "^(i386|x86_64)$"))
|
||||
@@ -97,12 +174,16 @@ IF(CPUINFO_SUPPORTED_PLATFORM)
|
||||
LIST(APPEND CPUINFO_SRCS
|
||||
src/x86/linux/init.c
|
||||
src/x86/linux/cpuinfo.c)
|
||||
ELSEIF(CMAKE_SYSTEM_NAME STREQUAL "Darwin" OR CMAKE_SYSTEM_NAME STREQUAL "iOS")
|
||||
ELSEIF(IS_APPLE_OS)
|
||||
LIST(APPEND CPUINFO_SRCS src/x86/mach/init.c)
|
||||
ELSEIF(CMAKE_SYSTEM_NAME MATCHES "^(Windows|CYGWIN|MSYS)$")
|
||||
ELSEIF(CMAKE_SYSTEM_NAME MATCHES "^(Windows|WindowsStore|CYGWIN|MSYS)$")
|
||||
LIST(APPEND CPUINFO_SRCS src/x86/windows/init.c)
|
||||
ENDIF()
|
||||
ELSEIF(CPUINFO_TARGET_PROCESSOR MATCHES "^(armv[5-8].*|aarch64|arm64)$" OR IOS_ARCH MATCHES "^(armv7.*|arm64.*)$")
|
||||
ELSEIF(CMAKE_SYSTEM_NAME MATCHES "^Windows" AND CPUINFO_TARGET_PROCESSOR MATCHES "^(ARM64|arm64)$")
|
||||
LIST(APPEND CPUINFO_SRCS
|
||||
src/arm/windows/init-by-logical-sys-info.c
|
||||
src/arm/windows/init.c)
|
||||
ELSEIF(CPUINFO_TARGET_PROCESSOR MATCHES "^(armv[5-8].*|aarch64|arm64.*)$" OR IOS_ARCH MATCHES "^(armv7.*|arm64.*)$")
|
||||
LIST(APPEND CPUINFO_SRCS
|
||||
src/arm/uarch.c
|
||||
src/arm/cache.c)
|
||||
@@ -122,13 +203,22 @@ IF(CPUINFO_SUPPORTED_PLATFORM)
|
||||
ELSEIF(CMAKE_SYSTEM_PROCESSOR MATCHES "^(aarch64|arm64)$")
|
||||
LIST(APPEND CPUINFO_SRCS src/arm/linux/aarch64-isa.c)
|
||||
ENDIF()
|
||||
ELSEIF(IOS OR (CMAKE_SYSTEM_NAME STREQUAL "Darwin" AND CPUINFO_TARGET_PROCESSOR STREQUAL "arm64"))
|
||||
ELSEIF(IS_APPLE_OS AND CPUINFO_TARGET_PROCESSOR MATCHES "arm64.*")
|
||||
LIST(APPEND CPUINFO_SRCS src/arm/mach/init.c)
|
||||
ENDIF()
|
||||
IF(CMAKE_SYSTEM_NAME STREQUAL "Android")
|
||||
LIST(APPEND CPUINFO_SRCS
|
||||
src/arm/android/properties.c)
|
||||
ENDIF()
|
||||
ELSEIF(CPUINFO_TARGET_PROCESSOR MATCHES "^(riscv(32|64))$")
|
||||
LIST(APPEND CPUINFO_SRCS
|
||||
src/riscv/uarch.c)
|
||||
IF(CMAKE_SYSTEM_NAME STREQUAL "Linux")
|
||||
LIST(APPEND CPUINFO_SRCS
|
||||
src/riscv/linux/init.c
|
||||
src/riscv/linux/riscv-hw.c
|
||||
src/riscv/linux/riscv-isa.c)
|
||||
ENDIF()
|
||||
ENDIF()
|
||||
|
||||
IF(CMAKE_SYSTEM_NAME STREQUAL "Emscripten")
|
||||
@@ -142,7 +232,7 @@ IF(CPUINFO_SUPPORTED_PLATFORM)
|
||||
src/linux/multiline.c
|
||||
src/linux/cpulist.c
|
||||
src/linux/processors.c)
|
||||
ELSEIF(CMAKE_SYSTEM_NAME STREQUAL "Darwin" OR CMAKE_SYSTEM_NAME STREQUAL "iOS")
|
||||
ELSEIF(IS_APPLE_OS)
|
||||
LIST(APPEND CPUINFO_SRCS src/mach/topology.c)
|
||||
ENDIF()
|
||||
|
||||
@@ -166,34 +256,43 @@ ADD_LIBRARY(cpuinfo_internals STATIC ${CPUINFO_SRCS})
|
||||
CPUINFO_TARGET_ENABLE_C99(cpuinfo)
|
||||
CPUINFO_TARGET_ENABLE_C99(cpuinfo_internals)
|
||||
CPUINFO_TARGET_RUNTIME_LIBRARY(cpuinfo)
|
||||
IF(CMAKE_SYSTEM_NAME MATCHES "^(Windows|CYGWIN|MSYS)$")
|
||||
IF(CMAKE_SYSTEM_NAME MATCHES "^(Windows|WindowsStore|CYGWIN|MSYS)$")
|
||||
# Target Windows 7+ API
|
||||
TARGET_COMPILE_DEFINITIONS(cpuinfo PRIVATE _WIN32_WINNT=0x0601)
|
||||
TARGET_COMPILE_DEFINITIONS(cpuinfo_internals PRIVATE _WIN32_WINNT=0x0601)
|
||||
TARGET_COMPILE_DEFINITIONS(cpuinfo PRIVATE _WIN32_WINNT=0x0601 _CRT_SECURE_NO_WARNINGS)
|
||||
TARGET_COMPILE_DEFINITIONS(cpuinfo_internals PRIVATE _WIN32_WINNT=0x0601 _CRT_SECURE_NO_WARNINGS)
|
||||
# Explicitly link Kernel32 for UWP build
|
||||
if(CMAKE_SYSTEM_NAME STREQUAL "WindowsStore")
|
||||
TARGET_LINK_LIBRARIES(cpuinfo PUBLIC Kernel32)
|
||||
endif()
|
||||
ENDIF()
|
||||
IF(ANDROID AND NOT CPUINFO_LOG_TO_STDIO)
|
||||
TARGET_LINK_LIBRARIES(cpuinfo PRIVATE "log")
|
||||
ENDIF()
|
||||
SET_TARGET_PROPERTIES(cpuinfo PROPERTIES PUBLIC_HEADER include/cpuinfo.h)
|
||||
TARGET_INCLUDE_DIRECTORIES(cpuinfo BEFORE PUBLIC include)
|
||||
TARGET_INCLUDE_DIRECTORIES(cpuinfo BEFORE PUBLIC $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include> $<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}>)
|
||||
TARGET_INCLUDE_DIRECTORIES(cpuinfo BEFORE PRIVATE src)
|
||||
TARGET_INCLUDE_DIRECTORIES(cpuinfo_internals BEFORE PUBLIC include src)
|
||||
TARGET_COMPILE_DEFINITIONS(cpuinfo PRIVATE "CPUINFO_LOG_TO_STDIO=$<BOOL:${CPUINFO_LOG_TO_STDIO}>")
|
||||
IF(CPUINFO_LOG_LEVEL STREQUAL "default")
|
||||
# default logging level: error (subject to change)
|
||||
TARGET_COMPILE_DEFINITIONS(cpuinfo PRIVATE CPUINFO_LOG_LEVEL=2)
|
||||
TARGET_COMPILE_DEFINITIONS(cpuinfo PRIVATE "CPUINFO_LOG_LEVEL=2")
|
||||
ELSEIF(CPUINFO_LOG_LEVEL STREQUAL "debug")
|
||||
TARGET_COMPILE_DEFINITIONS(cpuinfo PRIVATE CPUINFO_LOG_LEVEL=5)
|
||||
TARGET_COMPILE_DEFINITIONS(cpuinfo PRIVATE "CPUINFO_LOG_LEVEL=5")
|
||||
ELSEIF(CPUINFO_LOG_LEVEL STREQUAL "info")
|
||||
TARGET_COMPILE_DEFINITIONS(cpuinfo PRIVATE CPUINFO_LOG_LEVEL=4)
|
||||
TARGET_COMPILE_DEFINITIONS(cpuinfo PRIVATE "CPUINFO_LOG_LEVEL=4")
|
||||
ELSEIF(CPUINFO_LOG_LEVEL STREQUAL "warning")
|
||||
TARGET_COMPILE_DEFINITIONS(cpuinfo PRIVATE CPUINFO_LOG_LEVEL=3)
|
||||
TARGET_COMPILE_DEFINITIONS(cpuinfo PRIVATE "CPUINFO_LOG_LEVEL=3")
|
||||
ELSEIF(CPUINFO_LOG_LEVEL STREQUAL "error")
|
||||
TARGET_COMPILE_DEFINITIONS(cpuinfo PRIVATE CPUINFO_LOG_LEVEL=2)
|
||||
TARGET_COMPILE_DEFINITIONS(cpuinfo PRIVATE "CPUINFO_LOG_LEVEL=2")
|
||||
ELSEIF(CPUINFO_LOG_LEVEL STREQUAL "fatal")
|
||||
TARGET_COMPILE_DEFINITIONS(cpuinfo PRIVATE CPUINFO_LOG_LEVEL=1)
|
||||
TARGET_COMPILE_DEFINITIONS(cpuinfo PRIVATE "CPUINFO_LOG_LEVEL=1")
|
||||
ELSEIF(CPUINFO_LOG_LEVEL STREQUAL "none")
|
||||
TARGET_COMPILE_DEFINITIONS(cpuinfo PRIVATE CPUINFO_LOG_LEVEL=0)
|
||||
TARGET_COMPILE_DEFINITIONS(cpuinfo PRIVATE "CPUINFO_LOG_LEVEL=0")
|
||||
ELSE()
|
||||
MESSAGE(FATAL_ERROR "Unsupported logging level ${CPUINFO_LOG_LEVEL}")
|
||||
ENDIF()
|
||||
TARGET_COMPILE_DEFINITIONS(cpuinfo_internals PRIVATE CPUINFO_LOG_LEVEL=0)
|
||||
TARGET_COMPILE_DEFINITIONS(cpuinfo_internals PRIVATE "CPUINFO_LOG_LEVEL=0")
|
||||
TARGET_COMPILE_DEFINITIONS(cpuinfo_internals PRIVATE "CPUINFO_LOG_TO_STDIO=1")
|
||||
|
||||
IF(CPUINFO_SUPPORTED_PLATFORM)
|
||||
TARGET_COMPILE_DEFINITIONS(cpuinfo INTERFACE CPUINFO_SUPPORTED_PLATFORM=1)
|
||||
@@ -207,17 +306,610 @@ ELSE()
|
||||
TARGET_COMPILE_DEFINITIONS(cpuinfo INTERFACE CPUINFO_SUPPORTED_PLATFORM=0)
|
||||
ENDIF()
|
||||
|
||||
# ---[ cpuinfo dependencies: clog
|
||||
IF(NOT DEFINED CLOG_SOURCE_DIR)
|
||||
SET(CLOG_SOURCE_DIR "${PROJECT_SOURCE_DIR}/deps/clog")
|
||||
ADD_LIBRARY(${PROJECT_NAME}::cpuinfo ALIAS cpuinfo)
|
||||
|
||||
# support find_package(cpuinfo CONFIG)
|
||||
INCLUDE(CMakePackageConfigHelpers)
|
||||
GET_FILENAME_COMPONENT(CONFIG_FILE_PATH ${CMAKE_CURRENT_BINARY_DIR}/cpuinfo-config.cmake ABSOLUTE)
|
||||
CONFIGURE_PACKAGE_CONFIG_FILE(
|
||||
cmake/cpuinfo-config.cmake.in ${CONFIG_FILE_PATH}
|
||||
INSTALL_DESTINATION ${CMAKE_INSTALL_DATAROOTDIR}/${PROJECT_NAME})
|
||||
INSTALL(FILES ${CONFIG_FILE_PATH}
|
||||
DESTINATION ${CMAKE_INSTALL_DATAROOTDIR}/${PROJECT_NAME}) # cpuinfo_DIR ${prefix}/share/cpuinfo
|
||||
|
||||
INSTALL(TARGETS cpuinfo
|
||||
EXPORT cpuinfo-targets
|
||||
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
|
||||
ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}
|
||||
PUBLIC_HEADER DESTINATION ${CMAKE_INSTALL_INCLUDEDIR})
|
||||
|
||||
INSTALL(EXPORT cpuinfo-targets
|
||||
NAMESPACE ${PROJECT_NAME}:: # IMPORTED cpuinfo::cpuinfo
|
||||
DESTINATION ${CMAKE_INSTALL_DATAROOTDIR}/${PROJECT_NAME})
|
||||
|
||||
# ---[ cpuinfo micro-benchmarks
|
||||
IF(CPUINFO_SUPPORTED_PLATFORM AND CPUINFO_BUILD_BENCHMARKS)
|
||||
# ---[ Build google benchmark
|
||||
IF(NOT TARGET benchmark AND NOT USE_SYSTEM_GOOGLEBENCHMARK)
|
||||
SET(BENCHMARK_ENABLE_TESTING OFF CACHE BOOL "")
|
||||
ADD_SUBDIRECTORY(
|
||||
"${GOOGLEBENCHMARK_SOURCE_DIR}"
|
||||
"${CONFU_DEPENDENCIES_BINARY_DIR}/googlebenchmark")
|
||||
ENDIF()
|
||||
|
||||
IF(CMAKE_SYSTEM_NAME MATCHES "^(Linux|Android)$")
|
||||
ADD_EXECUTABLE(get-current-bench bench/get-current.cc)
|
||||
TARGET_LINK_LIBRARIES(get-current-bench cpuinfo benchmark)
|
||||
ENDIF()
|
||||
|
||||
ADD_EXECUTABLE(init-bench bench/init.cc)
|
||||
TARGET_LINK_LIBRARIES(init-bench cpuinfo benchmark)
|
||||
ENDIF()
|
||||
IF(NOT TARGET clog)
|
||||
SET(CLOG_BUILD_TESTS OFF CACHE BOOL "")
|
||||
SET(CLOG_RUNTIME_TYPE "${CPUINFO_RUNTIME_TYPE}" CACHE STRING "")
|
||||
ADD_SUBDIRECTORY(
|
||||
"${CLOG_SOURCE_DIR}")
|
||||
# We build static version of clog but a dynamic library may indirectly depend on it
|
||||
SET_PROPERTY(TARGET clog PROPERTY POSITION_INDEPENDENT_CODE ON)
|
||||
|
||||
IF(CPUINFO_SUPPORTED_PLATFORM)
|
||||
IF(CPUINFO_BUILD_MOCK_TESTS OR CPUINFO_BUILD_UNIT_TESTS)
|
||||
# ---[ Build google test
|
||||
IF(NOT TARGET gtest AND NOT USE_SYSTEM_GOOGLETEST)
|
||||
IF(MSVC AND NOT CPUINFO_RUNTIME_TYPE STREQUAL "static")
|
||||
SET(gtest_force_shared_crt ON CACHE BOOL "" FORCE)
|
||||
ENDIF()
|
||||
ADD_SUBDIRECTORY(
|
||||
"${GOOGLETEST_SOURCE_DIR}"
|
||||
"${CONFU_DEPENDENCIES_BINARY_DIR}/googletest")
|
||||
ENDIF()
|
||||
ENDIF()
|
||||
ENDIF()
|
||||
|
||||
# ---[ cpuinfo mock library and mock tests
|
||||
IF(CPUINFO_SUPPORTED_PLATFORM AND CPUINFO_BUILD_MOCK_TESTS)
|
||||
SET(CPUINFO_MOCK_SRCS "${CPUINFO_SRCS}")
|
||||
IF(CPUINFO_TARGET_PROCESSOR MATCHES "^(i[3-6]86|AMD64|x86(_64)?)$")
|
||||
LIST(APPEND CPUINFO_MOCK_SRCS src/x86/mockcpuid.c)
|
||||
ENDIF()
|
||||
IF(CMAKE_SYSTEM_NAME STREQUAL "Linux" OR CMAKE_SYSTEM_NAME STREQUAL "Android")
|
||||
LIST(APPEND CPUINFO_MOCK_SRCS src/linux/mockfile.c)
|
||||
ENDIF()
|
||||
|
||||
ADD_LIBRARY(cpuinfo_mock STATIC ${CPUINFO_MOCK_SRCS})
|
||||
CPUINFO_TARGET_ENABLE_C99(cpuinfo_mock)
|
||||
CPUINFO_TARGET_RUNTIME_LIBRARY(cpuinfo_mock)
|
||||
SET_TARGET_PROPERTIES(cpuinfo_mock PROPERTIES PUBLIC_HEADER include/cpuinfo.h)
|
||||
TARGET_INCLUDE_DIRECTORIES(cpuinfo_mock BEFORE PUBLIC include)
|
||||
TARGET_INCLUDE_DIRECTORIES(cpuinfo_mock BEFORE PRIVATE src)
|
||||
TARGET_COMPILE_DEFINITIONS(cpuinfo_mock PUBLIC "CPUINFO_MOCK=1")
|
||||
TARGET_COMPILE_DEFINITIONS(cpuinfo_mock PRIVATE "CPUINFO_LOG_LEVEL=5")
|
||||
TARGET_COMPILE_DEFINITIONS(cpuinfo_mock PRIVATE "CPUINFO_LOG_TO_STDIO=1")
|
||||
IF(CMAKE_SYSTEM_NAME STREQUAL "Linux" OR CMAKE_SYSTEM_NAME STREQUAL "Android")
|
||||
TARGET_LINK_LIBRARIES(cpuinfo_mock PUBLIC ${CMAKE_THREAD_LIBS_INIT})
|
||||
TARGET_COMPILE_DEFINITIONS(cpuinfo_mock PRIVATE _GNU_SOURCE=1)
|
||||
ENDIF()
|
||||
|
||||
IF(CMAKE_SYSTEM_NAME STREQUAL "Android" AND CMAKE_SYSTEM_PROCESSOR MATCHES "^(armv5te|armv7-a)$")
|
||||
ADD_EXECUTABLE(atm7029b-tablet-test test/mock/atm7029b-tablet.cc)
|
||||
TARGET_INCLUDE_DIRECTORIES(atm7029b-tablet-test BEFORE PRIVATE test/mock)
|
||||
TARGET_LINK_LIBRARIES(atm7029b-tablet-test PRIVATE cpuinfo_mock gtest)
|
||||
ADD_TEST(NAME atm7029b-tablet-test COMMAND atm7029b-tablet-test)
|
||||
|
||||
ADD_EXECUTABLE(blu-r1-hd-test test/mock/blu-r1-hd.cc)
|
||||
TARGET_INCLUDE_DIRECTORIES(blu-r1-hd-test BEFORE PRIVATE test/mock)
|
||||
TARGET_LINK_LIBRARIES(blu-r1-hd-test PRIVATE cpuinfo_mock gtest)
|
||||
ADD_TEST(NAME blu-r1-hd-test COMMAND blu-r1-hd-test)
|
||||
|
||||
ADD_EXECUTABLE(galaxy-a3-2016-eu-test test/mock/galaxy-a3-2016-eu.cc)
|
||||
TARGET_INCLUDE_DIRECTORIES(galaxy-a3-2016-eu-test BEFORE PRIVATE test/mock)
|
||||
TARGET_LINK_LIBRARIES(galaxy-a3-2016-eu-test PRIVATE cpuinfo_mock gtest)
|
||||
ADD_TEST(NAME galaxy-a3-2016-eu-test COMMAND galaxy-a3-2016-eu-test)
|
||||
|
||||
ADD_EXECUTABLE(galaxy-a8-2016-duos-test test/mock/galaxy-a8-2016-duos.cc)
|
||||
TARGET_INCLUDE_DIRECTORIES(galaxy-a8-2016-duos-test BEFORE PRIVATE test/mock)
|
||||
TARGET_LINK_LIBRARIES(galaxy-a8-2016-duos-test PRIVATE cpuinfo_mock gtest)
|
||||
ADD_TEST(NAME galaxy-a8-2016-duos-test COMMAND galaxy-a8-2016-duos-test)
|
||||
|
||||
ADD_EXECUTABLE(galaxy-grand-prime-value-edition-test test/mock/galaxy-grand-prime-value-edition.cc)
|
||||
TARGET_INCLUDE_DIRECTORIES(galaxy-grand-prime-value-edition-test BEFORE PRIVATE test/mock)
|
||||
TARGET_LINK_LIBRARIES(galaxy-grand-prime-value-edition-test PRIVATE cpuinfo_mock gtest)
|
||||
ADD_TEST(NAME galaxy-grand-prime-value-edition-test COMMAND galaxy-grand-prime-value-edition-test)
|
||||
|
||||
ADD_EXECUTABLE(galaxy-j1-2016-test test/mock/galaxy-j1-2016.cc)
|
||||
TARGET_INCLUDE_DIRECTORIES(galaxy-j1-2016-test BEFORE PRIVATE test/mock)
|
||||
TARGET_LINK_LIBRARIES(galaxy-j1-2016-test PRIVATE cpuinfo_mock gtest)
|
||||
ADD_TEST(NAME galaxy-j1-2016-test COMMAND galaxy-j1-2016-test)
|
||||
|
||||
ADD_EXECUTABLE(galaxy-j5-test test/mock/galaxy-j5.cc)
|
||||
TARGET_INCLUDE_DIRECTORIES(galaxy-j5-test BEFORE PRIVATE test/mock)
|
||||
TARGET_LINK_LIBRARIES(galaxy-j5-test PRIVATE cpuinfo_mock gtest)
|
||||
ADD_TEST(NAME galaxy-j5-test COMMAND galaxy-j5-test)
|
||||
|
||||
ADD_EXECUTABLE(galaxy-j7-prime-test test/mock/galaxy-j7-prime.cc)
|
||||
TARGET_INCLUDE_DIRECTORIES(galaxy-j7-prime-test BEFORE PRIVATE test/mock)
|
||||
TARGET_LINK_LIBRARIES(galaxy-j7-prime-test PRIVATE cpuinfo_mock gtest)
|
||||
ADD_TEST(NAME galaxy-j7-prime-test COMMAND galaxy-j7-prime-test)
|
||||
|
||||
ADD_EXECUTABLE(galaxy-j7-tmobile-test test/mock/galaxy-j7-tmobile.cc)
|
||||
TARGET_INCLUDE_DIRECTORIES(galaxy-j7-tmobile-test BEFORE PRIVATE test/mock)
|
||||
TARGET_LINK_LIBRARIES(galaxy-j7-tmobile-test PRIVATE cpuinfo_mock gtest)
|
||||
ADD_TEST(NAME galaxy-j7-tmobile-test COMMAND galaxy-j7-tmobile-test)
|
||||
|
||||
ADD_EXECUTABLE(galaxy-j7-uae-test test/mock/galaxy-j7-uae.cc)
|
||||
TARGET_INCLUDE_DIRECTORIES(galaxy-j7-uae-test BEFORE PRIVATE test/mock)
|
||||
TARGET_LINK_LIBRARIES(galaxy-j7-uae-test PRIVATE cpuinfo_mock gtest)
|
||||
ADD_TEST(NAME galaxy-j7-uae-test COMMAND galaxy-j7-uae-test)
|
||||
|
||||
ADD_EXECUTABLE(galaxy-s3-us-test test/mock/galaxy-s3-us.cc)
|
||||
TARGET_INCLUDE_DIRECTORIES(galaxy-s3-us-test BEFORE PRIVATE test/mock)
|
||||
TARGET_LINK_LIBRARIES(galaxy-s3-us-test PRIVATE cpuinfo_mock gtest)
|
||||
ADD_TEST(NAME galaxy-s3-us-test COMMAND galaxy-s3-us-test)
|
||||
|
||||
ADD_EXECUTABLE(galaxy-s4-us-test test/mock/galaxy-s4-us.cc)
|
||||
TARGET_INCLUDE_DIRECTORIES(galaxy-s4-us-test BEFORE PRIVATE test/mock)
|
||||
TARGET_LINK_LIBRARIES(galaxy-s4-us-test PRIVATE cpuinfo_mock gtest)
|
||||
ADD_TEST(NAME galaxy-s4-us-test COMMAND galaxy-s4-us-test)
|
||||
|
||||
ADD_EXECUTABLE(galaxy-s5-global-test test/mock/galaxy-s5-global.cc)
|
||||
TARGET_INCLUDE_DIRECTORIES(galaxy-s5-global-test BEFORE PRIVATE test/mock)
|
||||
TARGET_LINK_LIBRARIES(galaxy-s5-global-test PRIVATE cpuinfo_mock gtest)
|
||||
ADD_TEST(NAME galaxy-s5-global-test COMMAND galaxy-s5-global-test)
|
||||
|
||||
ADD_EXECUTABLE(galaxy-s5-us-test test/mock/galaxy-s5-us.cc)
|
||||
TARGET_INCLUDE_DIRECTORIES(galaxy-s5-us-test BEFORE PRIVATE test/mock)
|
||||
TARGET_LINK_LIBRARIES(galaxy-s5-us-test PRIVATE cpuinfo_mock gtest)
|
||||
ADD_TEST(NAME galaxy-s5-us-test COMMAND galaxy-s5-us-test)
|
||||
|
||||
ADD_EXECUTABLE(galaxy-tab-3-7.0-test test/mock/galaxy-tab-3-7.0.cc)
|
||||
TARGET_INCLUDE_DIRECTORIES(galaxy-tab-3-7.0-test BEFORE PRIVATE test/mock)
|
||||
TARGET_LINK_LIBRARIES(galaxy-tab-3-7.0-test PRIVATE cpuinfo_mock gtest)
|
||||
ADD_TEST(NAME galaxy-tab-3-7.0-test COMMAND galaxy-tab-3-7.0-test)
|
||||
|
||||
ADD_EXECUTABLE(galaxy-tab-3-lite-test test/mock/galaxy-tab-3-lite.cc)
|
||||
TARGET_INCLUDE_DIRECTORIES(galaxy-tab-3-lite-test BEFORE PRIVATE test/mock)
|
||||
TARGET_LINK_LIBRARIES(galaxy-tab-3-lite-test PRIVATE cpuinfo_mock gtest)
|
||||
ADD_TEST(NAME galaxy-tab-3-lite-test COMMAND galaxy-tab-3-lite-test)
|
||||
|
||||
ADD_EXECUTABLE(galaxy-win-duos-test test/mock/galaxy-win-duos.cc)
|
||||
TARGET_INCLUDE_DIRECTORIES(galaxy-win-duos-test BEFORE PRIVATE test/mock)
|
||||
TARGET_LINK_LIBRARIES(galaxy-win-duos-test PRIVATE cpuinfo_mock gtest)
|
||||
ADD_TEST(NAME galaxy-win-duos-test COMMAND galaxy-win-duos-test)
|
||||
|
||||
ADD_EXECUTABLE(huawei-ascend-p7-test test/mock/huawei-ascend-p7.cc)
|
||||
TARGET_INCLUDE_DIRECTORIES(huawei-ascend-p7-test BEFORE PRIVATE test/mock)
|
||||
TARGET_LINK_LIBRARIES(huawei-ascend-p7-test PRIVATE cpuinfo_mock gtest)
|
||||
ADD_TEST(NAME huawei-ascend-p7-test COMMAND huawei-ascend-p7-test)
|
||||
|
||||
ADD_EXECUTABLE(huawei-honor-6-test test/mock/huawei-honor-6.cc)
|
||||
TARGET_INCLUDE_DIRECTORIES(huawei-honor-6-test BEFORE PRIVATE test/mock)
|
||||
TARGET_LINK_LIBRARIES(huawei-honor-6-test PRIVATE cpuinfo_mock gtest)
|
||||
ADD_TEST(NAME huawei-honor-6-test COMMAND huawei-honor-6-test)
|
||||
|
||||
ADD_EXECUTABLE(lenovo-a6600-plus-test test/mock/lenovo-a6600-plus.cc)
|
||||
TARGET_INCLUDE_DIRECTORIES(lenovo-a6600-plus-test BEFORE PRIVATE test/mock)
|
||||
TARGET_LINK_LIBRARIES(lenovo-a6600-plus-test PRIVATE cpuinfo_mock gtest)
|
||||
ADD_TEST(NAME lenovo-a6600-plus-test COMMAND lenovo-a6600-plus-test)
|
||||
|
||||
ADD_EXECUTABLE(lenovo-vibe-x2-test test/mock/lenovo-vibe-x2.cc)
|
||||
TARGET_INCLUDE_DIRECTORIES(lenovo-vibe-x2-test BEFORE PRIVATE test/mock)
|
||||
TARGET_LINK_LIBRARIES(lenovo-vibe-x2-test PRIVATE cpuinfo_mock gtest)
|
||||
ADD_TEST(NAME lenovo-vibe-x2-test COMMAND lenovo-vibe-x2-test)
|
||||
|
||||
ADD_EXECUTABLE(lg-k10-eu-test test/mock/lg-k10-eu.cc)
|
||||
TARGET_INCLUDE_DIRECTORIES(lg-k10-eu-test BEFORE PRIVATE test/mock)
|
||||
TARGET_LINK_LIBRARIES(lg-k10-eu-test PRIVATE cpuinfo_mock gtest)
|
||||
ADD_TEST(NAME lg-k10-eu-test COMMAND lg-k10-eu-test)
|
||||
|
||||
ADD_EXECUTABLE(lg-optimus-g-pro-test test/mock/lg-optimus-g-pro.cc)
|
||||
TARGET_INCLUDE_DIRECTORIES(lg-optimus-g-pro-test BEFORE PRIVATE test/mock)
|
||||
TARGET_LINK_LIBRARIES(lg-optimus-g-pro-test PRIVATE cpuinfo_mock gtest)
|
||||
ADD_TEST(NAME lg-optimus-g-pro-test COMMAND lg-optimus-g-pro-test)
|
||||
|
||||
ADD_EXECUTABLE(moto-e-gen1-test test/mock/moto-e-gen1.cc)
|
||||
TARGET_INCLUDE_DIRECTORIES(moto-e-gen1-test BEFORE PRIVATE test/mock)
|
||||
TARGET_LINK_LIBRARIES(moto-e-gen1-test PRIVATE cpuinfo_mock gtest)
|
||||
ADD_TEST(NAME moto-e-gen1-test COMMAND moto-e-gen1-test)
|
||||
|
||||
ADD_EXECUTABLE(moto-g-gen1-test test/mock/moto-g-gen1.cc)
|
||||
TARGET_INCLUDE_DIRECTORIES(moto-g-gen1-test BEFORE PRIVATE test/mock)
|
||||
TARGET_LINK_LIBRARIES(moto-g-gen1-test PRIVATE cpuinfo_mock gtest)
|
||||
ADD_TEST(NAME moto-g-gen1-test COMMAND moto-g-gen1-test)
|
||||
|
||||
ADD_EXECUTABLE(moto-g-gen2-test test/mock/moto-g-gen2.cc)
|
||||
TARGET_INCLUDE_DIRECTORIES(moto-g-gen2-test BEFORE PRIVATE test/mock)
|
||||
TARGET_LINK_LIBRARIES(moto-g-gen2-test PRIVATE cpuinfo_mock gtest)
|
||||
ADD_TEST(NAME moto-g-gen2-test COMMAND moto-g-gen2-test)
|
||||
|
||||
ADD_EXECUTABLE(moto-g-gen3-test test/mock/moto-g-gen3.cc)
|
||||
TARGET_INCLUDE_DIRECTORIES(moto-g-gen3-test BEFORE PRIVATE test/mock)
|
||||
TARGET_LINK_LIBRARIES(moto-g-gen3-test PRIVATE cpuinfo_mock gtest)
|
||||
ADD_TEST(NAME moto-g-gen3-test COMMAND moto-g-gen3-test)
|
||||
|
||||
ADD_EXECUTABLE(moto-g-gen4-test test/mock/moto-g-gen4.cc)
|
||||
TARGET_INCLUDE_DIRECTORIES(moto-g-gen4-test BEFORE PRIVATE test/mock)
|
||||
TARGET_LINK_LIBRARIES(moto-g-gen4-test PRIVATE cpuinfo_mock gtest)
|
||||
ADD_TEST(NAME moto-g-gen4-test COMMAND moto-g-gen4-test)
|
||||
|
||||
ADD_EXECUTABLE(moto-g-gen5-test test/mock/moto-g-gen5.cc)
|
||||
TARGET_INCLUDE_DIRECTORIES(moto-g-gen5-test BEFORE PRIVATE test/mock)
|
||||
TARGET_LINK_LIBRARIES(moto-g-gen5-test PRIVATE cpuinfo_mock gtest)
|
||||
ADD_TEST(NAME moto-g-gen5-test COMMAND moto-g-gen5-test)
|
||||
|
||||
ADD_EXECUTABLE(nexus-s-test test/mock/nexus-s.cc)
|
||||
TARGET_INCLUDE_DIRECTORIES(nexus-s-test BEFORE PRIVATE test/mock)
|
||||
TARGET_LINK_LIBRARIES(nexus-s-test PRIVATE cpuinfo_mock gtest)
|
||||
ADD_TEST(NAME nexus-s-test COMMAND nexus-s-test)
|
||||
|
||||
ADD_EXECUTABLE(nexus4-test test/mock/nexus4.cc)
|
||||
TARGET_INCLUDE_DIRECTORIES(nexus4-test BEFORE PRIVATE test/mock)
|
||||
TARGET_LINK_LIBRARIES(nexus4-test PRIVATE cpuinfo_mock gtest)
|
||||
ADD_TEST(NAME nexus4-test COMMAND nexus4-test)
|
||||
|
||||
ADD_EXECUTABLE(nexus6-test test/mock/nexus6.cc)
|
||||
TARGET_INCLUDE_DIRECTORIES(nexus6-test BEFORE PRIVATE test/mock)
|
||||
TARGET_LINK_LIBRARIES(nexus6-test PRIVATE cpuinfo_mock gtest)
|
||||
ADD_TEST(NAME nexus6-test COMMAND nexus6-test)
|
||||
|
||||
ADD_EXECUTABLE(nexus10-test test/mock/nexus10.cc)
|
||||
TARGET_INCLUDE_DIRECTORIES(nexus10-test BEFORE PRIVATE test/mock)
|
||||
TARGET_LINK_LIBRARIES(nexus10-test PRIVATE cpuinfo_mock gtest)
|
||||
ADD_TEST(NAME nexus10-test COMMAND nexus10-test)
|
||||
|
||||
ADD_EXECUTABLE(padcod-10.1-test test/mock/padcod-10.1.cc)
|
||||
TARGET_INCLUDE_DIRECTORIES(padcod-10.1-test BEFORE PRIVATE test/mock)
|
||||
TARGET_LINK_LIBRARIES(padcod-10.1-test PRIVATE cpuinfo_mock gtest)
|
||||
ADD_TEST(NAME padcod-10.1-test COMMAND padcod-10.1-test)
|
||||
|
||||
ADD_EXECUTABLE(xiaomi-redmi-2a-test test/mock/xiaomi-redmi-2a.cc)
|
||||
TARGET_INCLUDE_DIRECTORIES(xiaomi-redmi-2a-test BEFORE PRIVATE test/mock)
|
||||
TARGET_LINK_LIBRARIES(xiaomi-redmi-2a-test PRIVATE cpuinfo_mock gtest)
|
||||
ADD_TEST(NAME xiaomi-redmi-2a-test COMMAND xiaomi-redmi-2a-test)
|
||||
|
||||
ADD_EXECUTABLE(xperia-sl-test test/mock/xperia-sl.cc)
|
||||
TARGET_INCLUDE_DIRECTORIES(xperia-sl-test BEFORE PRIVATE test/mock)
|
||||
TARGET_LINK_LIBRARIES(xperia-sl-test PRIVATE cpuinfo_mock gtest)
|
||||
ADD_TEST(NAME xperia-sl-test COMMAND xperia-sl-test)
|
||||
ENDIF()
|
||||
|
||||
IF(CMAKE_SYSTEM_NAME STREQUAL "Android" AND CMAKE_SYSTEM_PROCESSOR MATCHES "^(armv5te|armv7-a|aarch64)$")
|
||||
ADD_EXECUTABLE(alcatel-revvl-test test/mock/alcatel-revvl.cc)
|
||||
TARGET_INCLUDE_DIRECTORIES(alcatel-revvl-test BEFORE PRIVATE test/mock)
|
||||
TARGET_LINK_LIBRARIES(alcatel-revvl-test PRIVATE cpuinfo_mock gtest)
|
||||
ADD_TEST(NAME alcatel-revvl-test COMMAND alcatel-revvl-test)
|
||||
|
||||
ADD_EXECUTABLE(galaxy-a8-2018-test test/mock/galaxy-a8-2018.cc)
|
||||
TARGET_INCLUDE_DIRECTORIES(galaxy-a8-2018-test BEFORE PRIVATE test/mock)
|
||||
TARGET_LINK_LIBRARIES(galaxy-a8-2018-test PRIVATE cpuinfo_mock gtest)
|
||||
ADD_TEST(NAME galaxy-a8-2018-test COMMAND galaxy-a8-2018-test)
|
||||
|
||||
ADD_EXECUTABLE(galaxy-c9-pro-test test/mock/galaxy-c9-pro.cc)
|
||||
TARGET_INCLUDE_DIRECTORIES(galaxy-c9-pro-test BEFORE PRIVATE test/mock)
|
||||
TARGET_LINK_LIBRARIES(galaxy-c9-pro-test PRIVATE cpuinfo_mock gtest)
|
||||
ADD_TEST(NAME galaxy-c9-pro-test COMMAND galaxy-c9-pro-test)
|
||||
|
||||
ADD_EXECUTABLE(galaxy-s6-test test/mock/galaxy-s6.cc)
|
||||
TARGET_INCLUDE_DIRECTORIES(galaxy-s6-test BEFORE PRIVATE test/mock)
|
||||
TARGET_LINK_LIBRARIES(galaxy-s6-test PRIVATE cpuinfo_mock gtest)
|
||||
ADD_TEST(NAME galaxy-s6-test COMMAND galaxy-s6-test)
|
||||
|
||||
ADD_EXECUTABLE(galaxy-s7-us-test test/mock/galaxy-s7-us.cc)
|
||||
TARGET_INCLUDE_DIRECTORIES(galaxy-s7-us-test BEFORE PRIVATE test/mock)
|
||||
TARGET_LINK_LIBRARIES(galaxy-s7-us-test PRIVATE cpuinfo_mock gtest)
|
||||
ADD_TEST(NAME galaxy-s7-us-test COMMAND galaxy-s7-us-test)
|
||||
|
||||
ADD_EXECUTABLE(galaxy-s7-global-test test/mock/galaxy-s7-global.cc)
|
||||
TARGET_INCLUDE_DIRECTORIES(galaxy-s7-global-test BEFORE PRIVATE test/mock)
|
||||
TARGET_LINK_LIBRARIES(galaxy-s7-global-test PRIVATE cpuinfo_mock gtest)
|
||||
ADD_TEST(NAME galaxy-s7-global-test COMMAND galaxy-s7-global-test)
|
||||
|
||||
ADD_EXECUTABLE(galaxy-s8-us-test test/mock/galaxy-s8-us.cc)
|
||||
TARGET_INCLUDE_DIRECTORIES(galaxy-s8-us-test BEFORE PRIVATE test/mock)
|
||||
TARGET_LINK_LIBRARIES(galaxy-s8-us-test PRIVATE cpuinfo_mock gtest)
|
||||
ADD_TEST(NAME galaxy-s8-us-test COMMAND galaxy-s8-us-test)
|
||||
|
||||
ADD_EXECUTABLE(galaxy-s8-global-test test/mock/galaxy-s8-global.cc)
|
||||
TARGET_INCLUDE_DIRECTORIES(galaxy-s8-global-test BEFORE PRIVATE test/mock)
|
||||
TARGET_LINK_LIBRARIES(galaxy-s8-global-test PRIVATE cpuinfo_mock gtest)
|
||||
ADD_TEST(NAME galaxy-s8-global-test COMMAND galaxy-s8-global-test)
|
||||
|
||||
ADD_EXECUTABLE(galaxy-s9-us-test test/mock/galaxy-s9-us.cc)
|
||||
TARGET_INCLUDE_DIRECTORIES(galaxy-s9-us-test BEFORE PRIVATE test/mock)
|
||||
TARGET_LINK_LIBRARIES(galaxy-s9-us-test PRIVATE cpuinfo_mock gtest)
|
||||
ADD_TEST(NAME galaxy-s9-us-test COMMAND galaxy-s9-us-test)
|
||||
|
||||
ADD_EXECUTABLE(galaxy-s9-global-test test/mock/galaxy-s9-global.cc)
|
||||
TARGET_INCLUDE_DIRECTORIES(galaxy-s9-global-test BEFORE PRIVATE test/mock)
|
||||
TARGET_LINK_LIBRARIES(galaxy-s9-global-test PRIVATE cpuinfo_mock gtest)
|
||||
ADD_TEST(NAME galaxy-s9-global-test COMMAND galaxy-s9-global-test)
|
||||
|
||||
ADD_EXECUTABLE(huawei-mate-8-test test/mock/huawei-mate-8.cc)
|
||||
TARGET_INCLUDE_DIRECTORIES(huawei-mate-8-test BEFORE PRIVATE test/mock)
|
||||
TARGET_LINK_LIBRARIES(huawei-mate-8-test PRIVATE cpuinfo_mock gtest)
|
||||
ADD_TEST(NAME huawei-mate-8-test COMMAND huawei-mate-8-test)
|
||||
|
||||
ADD_EXECUTABLE(huawei-mate-9-test test/mock/huawei-mate-9.cc)
|
||||
TARGET_INCLUDE_DIRECTORIES(huawei-mate-9-test BEFORE PRIVATE test/mock)
|
||||
TARGET_LINK_LIBRARIES(huawei-mate-9-test PRIVATE cpuinfo_mock gtest)
|
||||
ADD_TEST(NAME huawei-mate-9-test COMMAND huawei-mate-9-test)
|
||||
|
||||
ADD_EXECUTABLE(huawei-mate-10-test test/mock/huawei-mate-10.cc)
|
||||
TARGET_INCLUDE_DIRECTORIES(huawei-mate-10-test BEFORE PRIVATE test/mock)
|
||||
TARGET_LINK_LIBRARIES(huawei-mate-10-test PRIVATE cpuinfo_mock gtest)
|
||||
ADD_TEST(NAME huawei-mate-10-test COMMAND huawei-mate-10-test)
|
||||
|
||||
ADD_EXECUTABLE(huawei-mate-20-test test/mock/huawei-mate-20.cc)
|
||||
TARGET_INCLUDE_DIRECTORIES(huawei-mate-20-test BEFORE PRIVATE test/mock)
|
||||
TARGET_LINK_LIBRARIES(huawei-mate-20-test PRIVATE cpuinfo_mock gtest)
|
||||
ADD_TEST(NAME huawei-mate-20-test COMMAND huawei-mate-20-test)
|
||||
|
||||
ADD_EXECUTABLE(huawei-p8-lite-test test/mock/huawei-p8-lite.cc)
|
||||
TARGET_INCLUDE_DIRECTORIES(huawei-p8-lite-test BEFORE PRIVATE test/mock)
|
||||
TARGET_LINK_LIBRARIES(huawei-p8-lite-test PRIVATE cpuinfo_mock gtest)
|
||||
ADD_TEST(NAME huawei-p8-lite-test COMMAND huawei-p8-lite-test)
|
||||
|
||||
ADD_EXECUTABLE(huawei-p9-lite-test test/mock/huawei-p9-lite.cc)
|
||||
TARGET_INCLUDE_DIRECTORIES(huawei-p9-lite-test BEFORE PRIVATE test/mock)
|
||||
TARGET_LINK_LIBRARIES(huawei-p9-lite-test PRIVATE cpuinfo_mock gtest)
|
||||
ADD_TEST(NAME huawei-p9-lite-test COMMAND huawei-p9-lite-test)
|
||||
|
||||
ADD_EXECUTABLE(huawei-p20-pro-test test/mock/huawei-p20-pro.cc)
|
||||
TARGET_INCLUDE_DIRECTORIES(huawei-p20-pro-test BEFORE PRIVATE test/mock)
|
||||
TARGET_LINK_LIBRARIES(huawei-p20-pro-test PRIVATE cpuinfo_mock gtest)
|
||||
ADD_TEST(NAME huawei-p20-pro-test COMMAND huawei-p20-pro-test)
|
||||
|
||||
ADD_EXECUTABLE(iconia-one-10-test test/mock/iconia-one-10.cc)
|
||||
TARGET_INCLUDE_DIRECTORIES(iconia-one-10-test BEFORE PRIVATE test/mock)
|
||||
TARGET_LINK_LIBRARIES(iconia-one-10-test PRIVATE cpuinfo_mock gtest)
|
||||
ADD_TEST(NAME iconia-one-10-test COMMAND iconia-one-10-test)
|
||||
|
||||
ADD_EXECUTABLE(meizu-pro-6-test test/mock/meizu-pro-6.cc)
|
||||
TARGET_INCLUDE_DIRECTORIES(meizu-pro-6-test BEFORE PRIVATE test/mock)
|
||||
TARGET_LINK_LIBRARIES(meizu-pro-6-test PRIVATE cpuinfo_mock gtest)
|
||||
ADD_TEST(NAME meizu-pro-6-test COMMAND meizu-pro-6-test)
|
||||
|
||||
ADD_EXECUTABLE(meizu-pro-6s-test test/mock/meizu-pro-6s.cc)
|
||||
TARGET_INCLUDE_DIRECTORIES(meizu-pro-6s-test BEFORE PRIVATE test/mock)
|
||||
TARGET_LINK_LIBRARIES(meizu-pro-6s-test PRIVATE cpuinfo_mock gtest)
|
||||
ADD_TEST(NAME meizu-pro-6s-test COMMAND meizu-pro-6s-test)
|
||||
|
||||
ADD_EXECUTABLE(meizu-pro-7-plus-test test/mock/meizu-pro-7-plus.cc)
|
||||
TARGET_INCLUDE_DIRECTORIES(meizu-pro-7-plus-test BEFORE PRIVATE test/mock)
|
||||
TARGET_LINK_LIBRARIES(meizu-pro-7-plus-test PRIVATE cpuinfo_mock gtest)
|
||||
ADD_TEST(NAME meizu-pro-7-plus-test COMMAND meizu-pro-7-plus-test)
|
||||
|
||||
ADD_EXECUTABLE(nexus5x-test test/mock/nexus5x.cc)
|
||||
TARGET_INCLUDE_DIRECTORIES(nexus5x-test BEFORE PRIVATE test/mock)
|
||||
TARGET_LINK_LIBRARIES(nexus5x-test PRIVATE cpuinfo_mock gtest)
|
||||
ADD_TEST(NAME nexus5x-test COMMAND nexus5x-test)
|
||||
|
||||
ADD_EXECUTABLE(nexus6p-test test/mock/nexus6p.cc)
|
||||
TARGET_INCLUDE_DIRECTORIES(nexus6p-test BEFORE PRIVATE test/mock)
|
||||
TARGET_LINK_LIBRARIES(nexus6p-test PRIVATE cpuinfo_mock gtest)
|
||||
ADD_TEST(NAME nexus6p-test COMMAND nexus6p-test)
|
||||
|
||||
ADD_EXECUTABLE(nexus9-test test/mock/nexus9.cc)
|
||||
TARGET_INCLUDE_DIRECTORIES(nexus9-test BEFORE PRIVATE test/mock)
|
||||
TARGET_LINK_LIBRARIES(nexus9-test PRIVATE cpuinfo_mock gtest)
|
||||
ADD_TEST(NAME nexus9-test COMMAND nexus9-test)
|
||||
|
||||
ADD_EXECUTABLE(oneplus-3t-test test/mock/oneplus-3t.cc)
|
||||
TARGET_INCLUDE_DIRECTORIES(oneplus-3t-test BEFORE PRIVATE test/mock)
|
||||
TARGET_LINK_LIBRARIES(oneplus-3t-test PRIVATE cpuinfo_mock gtest)
|
||||
ADD_TEST(NAME oneplus-3t-test COMMAND oneplus-3t-test)
|
||||
|
||||
ADD_EXECUTABLE(oneplus-5-test test/mock/oneplus-5.cc)
|
||||
TARGET_INCLUDE_DIRECTORIES(oneplus-5-test BEFORE PRIVATE test/mock)
|
||||
TARGET_LINK_LIBRARIES(oneplus-5-test PRIVATE cpuinfo_mock gtest)
|
||||
ADD_TEST(NAME oneplus-5-test COMMAND oneplus-5-test)
|
||||
|
||||
ADD_EXECUTABLE(oneplus-5t-test test/mock/oneplus-5t.cc)
|
||||
TARGET_INCLUDE_DIRECTORIES(oneplus-5t-test BEFORE PRIVATE test/mock)
|
||||
TARGET_LINK_LIBRARIES(oneplus-5t-test PRIVATE cpuinfo_mock gtest)
|
||||
ADD_TEST(NAME oneplus-5t-test COMMAND oneplus-5t-test)
|
||||
|
||||
ADD_EXECUTABLE(oppo-a37-test test/mock/oppo-a37.cc)
|
||||
TARGET_INCLUDE_DIRECTORIES(oppo-a37-test BEFORE PRIVATE test/mock)
|
||||
TARGET_LINK_LIBRARIES(oppo-a37-test PRIVATE cpuinfo_mock gtest)
|
||||
ADD_TEST(NAME oppo-a37-test COMMAND oppo-a37-test)
|
||||
|
||||
ADD_EXECUTABLE(oppo-r9-test test/mock/oppo-r9.cc)
|
||||
TARGET_INCLUDE_DIRECTORIES(oppo-r9-test BEFORE PRIVATE test/mock)
|
||||
TARGET_LINK_LIBRARIES(oppo-r9-test PRIVATE cpuinfo_mock gtest)
|
||||
ADD_TEST(NAME oppo-r9-test COMMAND oppo-r9-test)
|
||||
|
||||
ADD_EXECUTABLE(oppo-r15-test test/mock/oppo-r15.cc)
|
||||
TARGET_INCLUDE_DIRECTORIES(oppo-r15-test BEFORE PRIVATE test/mock)
|
||||
TARGET_LINK_LIBRARIES(oppo-r15-test PRIVATE cpuinfo_mock gtest)
|
||||
ADD_TEST(NAME oppo-r15-test COMMAND oppo-r15-test)
|
||||
|
||||
ADD_EXECUTABLE(pixel-test test/mock/pixel.cc)
|
||||
TARGET_INCLUDE_DIRECTORIES(pixel-test BEFORE PRIVATE test/mock)
|
||||
TARGET_LINK_LIBRARIES(pixel-test PRIVATE cpuinfo_mock gtest)
|
||||
ADD_TEST(NAME pixel-test COMMAND pixel-test)
|
||||
|
||||
ADD_EXECUTABLE(pixel-c-test test/mock/pixel-c.cc)
|
||||
TARGET_INCLUDE_DIRECTORIES(pixel-c-test BEFORE PRIVATE test/mock)
|
||||
TARGET_LINK_LIBRARIES(pixel-c-test PRIVATE cpuinfo_mock gtest)
|
||||
ADD_TEST(NAME pixel-c-test COMMAND pixel-c-test)
|
||||
|
||||
ADD_EXECUTABLE(pixel-xl-test test/mock/pixel-xl.cc)
|
||||
TARGET_INCLUDE_DIRECTORIES(pixel-xl-test BEFORE PRIVATE test/mock)
|
||||
TARGET_LINK_LIBRARIES(pixel-xl-test PRIVATE cpuinfo_mock gtest)
|
||||
ADD_TEST(NAME pixel-xl-test COMMAND pixel-xl-test)
|
||||
|
||||
ADD_EXECUTABLE(pixel-2-xl-test test/mock/pixel-2-xl.cc)
|
||||
TARGET_INCLUDE_DIRECTORIES(pixel-2-xl-test BEFORE PRIVATE test/mock)
|
||||
TARGET_LINK_LIBRARIES(pixel-2-xl-test PRIVATE cpuinfo_mock gtest)
|
||||
ADD_TEST(NAME pixel-2-xl-test COMMAND pixel-2-xl-test)
|
||||
|
||||
ADD_EXECUTABLE(xiaomi-mi-5c-test test/mock/xiaomi-mi-5c.cc)
|
||||
TARGET_INCLUDE_DIRECTORIES(xiaomi-mi-5c-test BEFORE PRIVATE test/mock)
|
||||
TARGET_LINK_LIBRARIES(xiaomi-mi-5c-test PRIVATE cpuinfo_mock gtest)
|
||||
ADD_TEST(NAME xiaomi-mi-5c-test COMMAND xiaomi-mi-5c-test)
|
||||
|
||||
ADD_EXECUTABLE(xiaomi-redmi-note-3-test test/mock/xiaomi-redmi-note-3.cc)
|
||||
TARGET_INCLUDE_DIRECTORIES(xiaomi-redmi-note-3-test BEFORE PRIVATE test/mock)
|
||||
TARGET_LINK_LIBRARIES(xiaomi-redmi-note-3-test PRIVATE cpuinfo_mock gtest)
|
||||
ADD_TEST(NAME xiaomi-redmi-note-3-test COMMAND xiaomi-redmi-note-3-test)
|
||||
|
||||
ADD_EXECUTABLE(xiaomi-redmi-note-4-test test/mock/xiaomi-redmi-note-4.cc)
|
||||
TARGET_INCLUDE_DIRECTORIES(xiaomi-redmi-note-4-test BEFORE PRIVATE test/mock)
|
||||
TARGET_LINK_LIBRARIES(xiaomi-redmi-note-4-test PRIVATE cpuinfo_mock gtest)
|
||||
ADD_TEST(NAME xiaomi-redmi-note-4-test COMMAND xiaomi-redmi-note-4-test)
|
||||
|
||||
ADD_EXECUTABLE(xperia-c4-dual-test test/mock/xperia-c4-dual.cc)
|
||||
TARGET_INCLUDE_DIRECTORIES(xperia-c4-dual-test BEFORE PRIVATE test/mock)
|
||||
TARGET_LINK_LIBRARIES(xperia-c4-dual-test PRIVATE cpuinfo_mock gtest)
|
||||
ADD_TEST(NAME xperia-c4-dual-test COMMAND xperia-c4-dual-test)
|
||||
ENDIF()
|
||||
|
||||
IF(CMAKE_SYSTEM_NAME STREQUAL "Android" AND CMAKE_SYSTEM_PROCESSOR MATCHES "^(i686|x86_64)$")
|
||||
ADD_EXECUTABLE(alldocube-iwork8-test test/mock/alldocube-iwork8.cc)
|
||||
TARGET_INCLUDE_DIRECTORIES(alldocube-iwork8-test BEFORE PRIVATE test/mock)
|
||||
TARGET_LINK_LIBRARIES(alldocube-iwork8-test PRIVATE cpuinfo_mock gtest)
|
||||
ADD_TEST(NAME alldocube-iwork8-test COMMAND alldocube-iwork8-test)
|
||||
|
||||
ADD_EXECUTABLE(leagoo-t5c-test test/mock/leagoo-t5c.cc)
|
||||
TARGET_INCLUDE_DIRECTORIES(leagoo-t5c-test BEFORE PRIVATE test/mock)
|
||||
TARGET_LINK_LIBRARIES(leagoo-t5c-test PRIVATE cpuinfo_mock gtest)
|
||||
ADD_TEST(NAME leagoo-t5c-test COMMAND leagoo-t5c-test)
|
||||
|
||||
ADD_EXECUTABLE(memo-pad-7-test test/mock/memo-pad-7.cc)
|
||||
TARGET_INCLUDE_DIRECTORIES(memo-pad-7-test BEFORE PRIVATE test/mock)
|
||||
TARGET_LINK_LIBRARIES(memo-pad-7-test PRIVATE cpuinfo_mock gtest)
|
||||
ADD_TEST(NAME memo-pad-7-test COMMAND memo-pad-7-test)
|
||||
|
||||
ADD_EXECUTABLE(zenfone-c-test test/mock/zenfone-c.cc)
|
||||
TARGET_INCLUDE_DIRECTORIES(zenfone-c-test BEFORE PRIVATE test/mock)
|
||||
TARGET_LINK_LIBRARIES(zenfone-c-test PRIVATE cpuinfo_mock gtest)
|
||||
ADD_TEST(NAME zenfone-c-test COMMAND zenfone-c-test)
|
||||
|
||||
ADD_EXECUTABLE(zenfone-2-test test/mock/zenfone-2.cc)
|
||||
TARGET_INCLUDE_DIRECTORIES(zenfone-2-test BEFORE PRIVATE test/mock)
|
||||
TARGET_LINK_LIBRARIES(zenfone-2-test PRIVATE cpuinfo_mock gtest)
|
||||
ADD_TEST(NAME zenfone-2-test COMMAND zenfone-2-test)
|
||||
|
||||
ADD_EXECUTABLE(zenfone-2e-test test/mock/zenfone-2e.cc)
|
||||
TARGET_INCLUDE_DIRECTORIES(zenfone-2e-test BEFORE PRIVATE test/mock)
|
||||
TARGET_LINK_LIBRARIES(zenfone-2e-test PRIVATE cpuinfo_mock gtest)
|
||||
ADD_TEST(NAME zenfone-2e-test COMMAND zenfone-2e-test)
|
||||
ENDIF()
|
||||
ENDIF()
|
||||
|
||||
# ---[ cpuinfo unit tests
|
||||
IF(CPUINFO_SUPPORTED_PLATFORM AND CPUINFO_BUILD_UNIT_TESTS)
|
||||
ADD_EXECUTABLE(init-test test/init.cc)
|
||||
CPUINFO_TARGET_ENABLE_CXX11(init-test)
|
||||
CPUINFO_TARGET_RUNTIME_LIBRARY(init-test)
|
||||
TARGET_LINK_LIBRARIES(init-test PRIVATE cpuinfo gtest gtest_main)
|
||||
ADD_TEST(NAME init-test COMMAND init-test)
|
||||
|
||||
IF(CMAKE_SYSTEM_NAME STREQUAL "Linux" OR CMAKE_SYSTEM_NAME STREQUAL "Android")
|
||||
ADD_EXECUTABLE(get-current-test test/get-current.cc)
|
||||
CPUINFO_TARGET_ENABLE_CXX11(get-current-test)
|
||||
CPUINFO_TARGET_RUNTIME_LIBRARY(get-current-test)
|
||||
TARGET_LINK_LIBRARIES(get-current-test PRIVATE cpuinfo gtest gtest_main)
|
||||
ADD_TEST(NAME get-current-test COMMAND get-current-test)
|
||||
ENDIF()
|
||||
|
||||
IF(CPUINFO_TARGET_PROCESSOR MATCHES "^(i[3-6]86|AMD64|x86(_64)?)$")
|
||||
ADD_EXECUTABLE(brand-string-test test/name/brand-string.cc)
|
||||
CPUINFO_TARGET_ENABLE_CXX11(brand-string-test)
|
||||
CPUINFO_TARGET_RUNTIME_LIBRARY(brand-string-test)
|
||||
TARGET_LINK_LIBRARIES(brand-string-test PRIVATE cpuinfo_internals gtest gtest_main)
|
||||
ADD_TEST(NAME brand-string-test COMMAND brand-string-test)
|
||||
ENDIF()
|
||||
|
||||
IF(CMAKE_SYSTEM_NAME STREQUAL "Android" AND CMAKE_SYSTEM_PROCESSOR MATCHES "^(armv[5-8].*|aarch64)$")
|
||||
ADD_LIBRARY(android_properties_interface STATIC test/name/android-properties-interface.c)
|
||||
CPUINFO_TARGET_ENABLE_C99(android_properties_interface)
|
||||
CPUINFO_TARGET_RUNTIME_LIBRARY(android_properties_interface)
|
||||
TARGET_LINK_LIBRARIES(android_properties_interface PRIVATE cpuinfo_internals)
|
||||
|
||||
ADD_EXECUTABLE(chipset-test
|
||||
test/name/proc-cpuinfo-hardware.cc
|
||||
test/name/ro-product-board.cc
|
||||
test/name/ro-board-platform.cc
|
||||
test/name/ro-mediatek-platform.cc
|
||||
test/name/ro-arch.cc
|
||||
test/name/ro-chipname.cc
|
||||
test/name/android-properties.cc)
|
||||
CPUINFO_TARGET_ENABLE_CXX11(chipset-test)
|
||||
CPUINFO_TARGET_RUNTIME_LIBRARY(chipset-test)
|
||||
TARGET_LINK_LIBRARIES(chipset-test PRIVATE android_properties_interface gtest gtest_main)
|
||||
ADD_TEST(NAME chipset-test COMMAND chipset-test)
|
||||
|
||||
ADD_EXECUTABLE(cache-test test/arm-cache.cc)
|
||||
CPUINFO_TARGET_ENABLE_CXX11(cache-test)
|
||||
CPUINFO_TARGET_RUNTIME_LIBRARY(cache-test)
|
||||
TARGET_COMPILE_DEFINITIONS(cache-test PRIVATE __STDC_LIMIT_MACROS=1 __STDC_CONSTANT_MACROS=1)
|
||||
TARGET_LINK_LIBRARIES(cache-test PRIVATE cpuinfo_internals gtest gtest_main)
|
||||
ADD_TEST(NAME cache-test COMMAND cache-test)
|
||||
ENDIF()
|
||||
ENDIF()
|
||||
|
||||
# ---[ Helper and debug tools
|
||||
IF(CPUINFO_SUPPORTED_PLATFORM AND CPUINFO_BUILD_TOOLS)
|
||||
ADD_EXECUTABLE(isa-info tools/isa-info.c)
|
||||
CPUINFO_TARGET_ENABLE_C99(isa-info)
|
||||
CPUINFO_TARGET_RUNTIME_LIBRARY(isa-info)
|
||||
TARGET_LINK_LIBRARIES(isa-info PRIVATE cpuinfo)
|
||||
INSTALL(TARGETS isa-info RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR})
|
||||
|
||||
ADD_EXECUTABLE(cpu-info tools/cpu-info.c)
|
||||
CPUINFO_TARGET_ENABLE_C99(cpu-info)
|
||||
CPUINFO_TARGET_RUNTIME_LIBRARY(cpu-info)
|
||||
TARGET_LINK_LIBRARIES(cpu-info PRIVATE cpuinfo)
|
||||
INSTALL(TARGETS cpu-info RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR})
|
||||
|
||||
ADD_EXECUTABLE(cache-info tools/cache-info.c)
|
||||
CPUINFO_TARGET_ENABLE_C99(cache-info)
|
||||
CPUINFO_TARGET_RUNTIME_LIBRARY(cache-info)
|
||||
TARGET_LINK_LIBRARIES(cache-info PRIVATE cpuinfo)
|
||||
INSTALL(TARGETS cache-info RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR})
|
||||
|
||||
IF(CMAKE_SYSTEM_NAME MATCHES "^(Android|Linux)$" AND CMAKE_SYSTEM_PROCESSOR MATCHES "^(armv[5-8].*|aarch64)$")
|
||||
ADD_EXECUTABLE(auxv-dump tools/auxv-dump.c)
|
||||
CPUINFO_TARGET_ENABLE_C99(auxv-dump)
|
||||
CPUINFO_TARGET_RUNTIME_LIBRARY(auxv-dump)
|
||||
TARGET_LINK_LIBRARIES(auxv-dump PRIVATE ${CMAKE_DL_LIBS} cpuinfo)
|
||||
|
||||
ADD_EXECUTABLE(cpuinfo-dump tools/cpuinfo-dump.c)
|
||||
CPUINFO_TARGET_ENABLE_C99(cpuinfo-dump)
|
||||
CPUINFO_TARGET_RUNTIME_LIBRARY(cpuinfo-dump)
|
||||
ENDIF()
|
||||
|
||||
IF(CPUINFO_TARGET_PROCESSOR MATCHES "^(i[3-6]86|AMD64|x86(_64)?)$")
|
||||
ADD_EXECUTABLE(cpuid-dump tools/cpuid-dump.c)
|
||||
CPUINFO_TARGET_ENABLE_C99(cpuid-dump)
|
||||
CPUINFO_TARGET_RUNTIME_LIBRARY(cpuid-dump)
|
||||
TARGET_INCLUDE_DIRECTORIES(cpuid-dump BEFORE PRIVATE src)
|
||||
TARGET_INCLUDE_DIRECTORIES(cpuid-dump BEFORE PRIVATE include)
|
||||
INSTALL(TARGETS cpuid-dump RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR})
|
||||
ENDIF()
|
||||
ENDIF()
|
||||
|
||||
# ---[ pkg-config manifest. This is mostly from JsonCpp...
|
||||
IF(CPUINFO_BUILD_PKG_CONFIG)
|
||||
|
||||
FUNCTION(JOIN_PATHS joined_path first_path_segment)
|
||||
SET(temp_path "${first_path_segment}")
|
||||
FOREACH(current_segment IN LISTS ARGN)
|
||||
IF(NOT ("${current_segment}" STREQUAL ""))
|
||||
IF(IS_ABSOLUTE "${current_segment}")
|
||||
SET(temp_path "${current_segment}")
|
||||
ELSE()
|
||||
SET(temp_path "${temp_path}/${current_segment}")
|
||||
ENDIF()
|
||||
ENDIF()
|
||||
ENDFOREACH()
|
||||
SET(${joined_path} "${temp_path}" PARENT_SCOPE)
|
||||
ENDFUNCTION()
|
||||
|
||||
JOIN_PATHS(libdir_for_pc_file "\${exec_prefix}" "${CMAKE_INSTALL_LIBDIR}")
|
||||
JOIN_PATHS(includedir_for_pc_file "\${prefix}" "${CMAKE_INSTALL_INCLUDEDIR}")
|
||||
|
||||
CONFIGURE_FILE(
|
||||
"libcpuinfo.pc.in"
|
||||
"libcpuinfo.pc"
|
||||
@ONLY)
|
||||
|
||||
INSTALL(FILES "${CMAKE_CURRENT_BINARY_DIR}/libcpuinfo.pc"
|
||||
DESTINATION "${CMAKE_INSTALL_LIBDIR}/pkgconfig")
|
||||
|
||||
ENDIF()
|
||||
TARGET_LINK_LIBRARIES(cpuinfo PRIVATE clog)
|
||||
TARGET_LINK_LIBRARIES(cpuinfo_internals PRIVATE clog)
|
||||
41
3rdparty/cpuinfo/README.md
vendored
41
3rdparty/cpuinfo/README.md
vendored
@@ -48,7 +48,7 @@ Detect if target is a 32-bit or 64-bit ARM system:
|
||||
#endif
|
||||
```
|
||||
|
||||
Check if the host CPU support ARM NEON
|
||||
Check if the host CPU supports ARM NEON
|
||||
|
||||
```c
|
||||
cpuinfo_initialize();
|
||||
@@ -151,6 +151,36 @@ executable(
|
||||
)
|
||||
```
|
||||
|
||||
### Bazel
|
||||
|
||||
This project can be built using [Bazel](https://bazel.build/install).
|
||||
|
||||
You can also use this library as a dependency to your Bazel project. Add to the `WORKSPACE` file:
|
||||
|
||||
```python
|
||||
load("@bazel_tools//tools/build_defs/repo:git.bzl", "git_repository")
|
||||
|
||||
git_repository(
|
||||
name = "org_pytorch_cpuinfo",
|
||||
branch = "master",
|
||||
remote = "https://github.com/Vertexwahn/cpuinfo.git",
|
||||
)
|
||||
```
|
||||
|
||||
And to your `BUILD` file:
|
||||
|
||||
```python
|
||||
cc_binary(
|
||||
name = "cpuinfo_test",
|
||||
srcs = [
|
||||
# ...
|
||||
],
|
||||
deps = [
|
||||
"@org_pytorch_cpuinfo//:cpuinfo",
|
||||
],
|
||||
)
|
||||
```
|
||||
|
||||
### CMake
|
||||
|
||||
To use with CMake use the [FindPkgConfig](https://cmake.org/cmake/help/latest/module/FindPkgConfig.html) module. Here is an example:
|
||||
@@ -220,12 +250,14 @@ LDFLAGS+= $(pkg-config --libs libcpuinfo)
|
||||
- [x] x86-64 (iPhone simulator)
|
||||
- [x] ARMv7
|
||||
- [x] ARM64
|
||||
- [x] OS X
|
||||
- [x] macOS
|
||||
- [x] x86
|
||||
- [x] x86-64
|
||||
- [x] ARM64 (Apple silicon)
|
||||
- [x] Windows
|
||||
- [x] x86
|
||||
- [x] x86-64
|
||||
- [x] arm64
|
||||
|
||||
## Methods
|
||||
|
||||
@@ -234,12 +266,13 @@ LDFLAGS+= $(pkg-config --libs libcpuinfo)
|
||||
- [x] Using `/proc/cpuinfo` on ARM
|
||||
- [x] Using `ro.chipname`, `ro.board.platform`, `ro.product.board`, `ro.mediatek.platform`, `ro.arch` properties (Android)
|
||||
- [ ] Using kernel log (`dmesg`) on ARM Linux
|
||||
- [x] Using Windows registry on ARM64 Windows
|
||||
- Vendor and microarchitecture detection
|
||||
- [x] Intel-designed x86/x86-64 cores (up to Sunny Cove, Goldmont Plus, and Knights Mill)
|
||||
- [x] AMD-designed x86/x86-64 cores (up to Puma/Jaguar and Zen 2)
|
||||
- [ ] VIA-designed x86/x86-64 cores
|
||||
- [ ] Other x86 cores (DM&P, RDC, Transmeta, Cyrix, Rise)
|
||||
- [x] ARM-designed ARM cores (up to Cortex-A55, Cortex-A77, and Neoverse E1/N1)
|
||||
- [x] ARM-designed ARM cores (up to Cortex-A55, Cortex-A77, and Neoverse E1/V1/N2/V2)
|
||||
- [x] Qualcomm-designed ARM cores (Scorpion, Krait, and Kryo)
|
||||
- [x] Nvidia-designed ARM cores (Denver and Carmel)
|
||||
- [x] Samsung-designed ARM cores (Exynos)
|
||||
@@ -256,6 +289,7 @@ LDFLAGS+= $(pkg-config --libs libcpuinfo)
|
||||
- [x] Using `/proc/self/auxv` (Android/ARM)
|
||||
- [ ] Using instruction probing on ARM (Linux)
|
||||
- [ ] Using CPUID registers on ARM64 (Linux)
|
||||
- [x] Using IsProcessorFeaturePresent on ARM64 Windows
|
||||
- Cache detection
|
||||
- [x] Using CPUID leaf 0x00000002 (x86/x86-64)
|
||||
- [x] Using CPUID leaf 0x00000004 (non-AMD x86/x86-64)
|
||||
@@ -267,6 +301,7 @@ LDFLAGS+= $(pkg-config --libs libcpuinfo)
|
||||
- [x] Using `sysctlbyname` (Mach)
|
||||
- [x] Using sysfs `typology` directories (ARM/Linux)
|
||||
- [ ] Using sysfs `cache` directories (Linux)
|
||||
- [x] Using `GetLogicalProcessorInformationEx` on ARM64 Windows
|
||||
- TLB detection
|
||||
- [x] Using CPUID leaf 0x00000002 (x86/x86-64)
|
||||
- [ ] Using CPUID leaves 0x80000005-0x80000006 and 0x80000019 (AMD x86/x86-64)
|
||||
|
||||
15
3rdparty/cpuinfo/cmake/DownloadGoogleBenchmark.cmake
vendored
Normal file
15
3rdparty/cpuinfo/cmake/DownloadGoogleBenchmark.cmake
vendored
Normal file
@@ -0,0 +1,15 @@
|
||||
CMAKE_MINIMUM_REQUIRED(VERSION 2.8.12 FATAL_ERROR)
|
||||
|
||||
PROJECT(googlebenchmark-download NONE)
|
||||
|
||||
INCLUDE(ExternalProject)
|
||||
ExternalProject_Add(googlebenchmark
|
||||
URL https://github.com/google/benchmark/archive/v1.6.1.zip
|
||||
URL_HASH SHA256=367e963b8620080aff8c831e24751852cffd1f74ea40f25d9cc1b667a9dd5e45
|
||||
SOURCE_DIR "${CONFU_DEPENDENCIES_SOURCE_DIR}/googlebenchmark"
|
||||
BINARY_DIR "${CONFU_DEPENDENCIES_BINARY_DIR}/googlebenchmark"
|
||||
CONFIGURE_COMMAND ""
|
||||
BUILD_COMMAND ""
|
||||
INSTALL_COMMAND ""
|
||||
TEST_COMMAND ""
|
||||
)
|
||||
15
3rdparty/cpuinfo/cmake/DownloadGoogleTest.cmake
vendored
Normal file
15
3rdparty/cpuinfo/cmake/DownloadGoogleTest.cmake
vendored
Normal file
@@ -0,0 +1,15 @@
|
||||
CMAKE_MINIMUM_REQUIRED(VERSION 2.8.12 FATAL_ERROR)
|
||||
|
||||
PROJECT(googletest-download NONE)
|
||||
|
||||
INCLUDE(ExternalProject)
|
||||
ExternalProject_Add(googletest
|
||||
URL https://github.com/google/googletest/archive/release-1.11.0.zip
|
||||
URL_HASH SHA256=353571c2440176ded91c2de6d6cd88ddd41401d14692ec1f99e35d013feda55a
|
||||
SOURCE_DIR "${CONFU_DEPENDENCIES_SOURCE_DIR}/googletest"
|
||||
BINARY_DIR "${CONFU_DEPENDENCIES_BINARY_DIR}/googletest"
|
||||
CONFIGURE_COMMAND ""
|
||||
BUILD_COMMAND ""
|
||||
INSTALL_COMMAND ""
|
||||
TEST_COMMAND ""
|
||||
)
|
||||
12
3rdparty/cpuinfo/cmake/cpuinfo-config.cmake.in
vendored
Normal file
12
3rdparty/cpuinfo/cmake/cpuinfo-config.cmake.in
vendored
Normal file
@@ -0,0 +1,12 @@
|
||||
@PACKAGE_INIT@
|
||||
|
||||
get_filename_component(_DIR "${CMAKE_CURRENT_LIST_FILE}" PATH)
|
||||
file(GLOB CONFIG_FILES "${_DIR}/cpuinfo-config-*.cmake")
|
||||
foreach(f ${CONFIG_FILES})
|
||||
include(${f})
|
||||
endforeach()
|
||||
|
||||
# ${_DIR}/cpuinfo-targets-*.cmake will be included here
|
||||
include("${_DIR}/cpuinfo-targets.cmake")
|
||||
|
||||
check_required_components(@PROJECT_NAME@)
|
||||
2
3rdparty/cpuinfo/cpuinfo.vcxproj
vendored
2
3rdparty/cpuinfo/cpuinfo.vcxproj
vendored
@@ -59,7 +59,7 @@
|
||||
</ItemGroup>
|
||||
<ItemDefinitionGroup>
|
||||
<ClCompile>
|
||||
<PreprocessorDefinitions>%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<PreprocessorDefinitions>CPUINFO_LOG_LEVEL=0;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<WarningLevel>TurnOffAllWarnings</WarningLevel>
|
||||
<AdditionalIncludeDirectories>$(ProjectDir)include;$(ProjectDir)src;$(ProjectDir)deps\clog\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<ObjectFileName>$(IntDir)%(RelativeDir)</ObjectFileName>
|
||||
|
||||
63
3rdparty/cpuinfo/deps/clog/CMakeLists.txt
vendored
63
3rdparty/cpuinfo/deps/clog/CMakeLists.txt
vendored
@@ -1,5 +1,7 @@
|
||||
CMAKE_MINIMUM_REQUIRED(VERSION 3.1 FATAL_ERROR)
|
||||
|
||||
INCLUDE(GNUInstallDirs)
|
||||
|
||||
# ---[ Project and semantic versioning.
|
||||
PROJECT(clog C CXX)
|
||||
|
||||
@@ -11,6 +13,14 @@ IF(ANDROID)
|
||||
ELSE()
|
||||
OPTION(CLOG_LOG_TO_STDIO "Log errors, warnings, and information to stdout/stderr" ON)
|
||||
ENDIF()
|
||||
OPTION(CLOG_BUILD_TESTS "Build clog tests" ON)
|
||||
OPTION(USE_SYSTEM_LIBS "Use system libraries instead of downloading and building them" OFF)
|
||||
OPTION(USE_SYSTEM_GOOGLETEST "Use system Google Test library instead of downloading and building it" ${USE_SYSTEM_LIBS})
|
||||
|
||||
# ---[ CMake options
|
||||
IF(CLOG_BUILD_TESTS)
|
||||
ENABLE_TESTING()
|
||||
ENDIF()
|
||||
|
||||
MACRO(CLOG_TARGET_RUNTIME_LIBRARY target)
|
||||
IF(MSVC AND NOT CLOG_RUNTIME_TYPE STREQUAL "default")
|
||||
@@ -24,6 +34,26 @@ MACRO(CLOG_TARGET_RUNTIME_LIBRARY target)
|
||||
ENDIF()
|
||||
ENDMACRO()
|
||||
|
||||
# ---[ Download deps
|
||||
SET(CONFU_DEPENDENCIES_SOURCE_DIR ${CMAKE_SOURCE_DIR}/deps
|
||||
CACHE PATH "Confu-style dependencies source directory")
|
||||
SET(CONFU_DEPENDENCIES_BINARY_DIR ${CMAKE_BINARY_DIR}/deps
|
||||
CACHE PATH "Confu-style dependencies binary directory")
|
||||
|
||||
IF(CLOG_BUILD_TESTS)
|
||||
IF(USE_SYSTEM_GOOGLETEST)
|
||||
FIND_PACKAGE(GTest REQUIRED)
|
||||
ELSEIF(NOT DEFINED GOOGLETEST_SOURCE_DIR)
|
||||
MESSAGE(STATUS "Downloading Google Test to ${CONFU_DEPENDENCIES_SOURCE_DIR}/googletest (define GOOGLETEST_SOURCE_DIR to avoid it)")
|
||||
CONFIGURE_FILE(cmake/DownloadGoogleTest.cmake "${CONFU_DEPENDENCIES_BINARY_DIR}/googletest-download/CMakeLists.txt")
|
||||
EXECUTE_PROCESS(COMMAND "${CMAKE_COMMAND}" -G "${CMAKE_GENERATOR}" .
|
||||
WORKING_DIRECTORY "${CONFU_DEPENDENCIES_BINARY_DIR}/googletest-download")
|
||||
EXECUTE_PROCESS(COMMAND "${CMAKE_COMMAND}" --build .
|
||||
WORKING_DIRECTORY "${CONFU_DEPENDENCIES_BINARY_DIR}/googletest-download")
|
||||
SET(GOOGLETEST_SOURCE_DIR "${CONFU_DEPENDENCIES_SOURCE_DIR}/googletest" CACHE STRING "Google Test source directory")
|
||||
ENDIF()
|
||||
ENDIF()
|
||||
|
||||
# ---[ clog library
|
||||
ADD_LIBRARY(clog STATIC src/clog.c)
|
||||
SET_TARGET_PROPERTIES(clog PROPERTIES
|
||||
@@ -31,7 +61,7 @@ SET_TARGET_PROPERTIES(clog PROPERTIES
|
||||
C_EXTENSIONS NO)
|
||||
CLOG_TARGET_RUNTIME_LIBRARY(clog)
|
||||
SET_TARGET_PROPERTIES(clog PROPERTIES PUBLIC_HEADER include/clog.h)
|
||||
TARGET_INCLUDE_DIRECTORIES(clog BEFORE PUBLIC include)
|
||||
TARGET_INCLUDE_DIRECTORIES(clog PUBLIC $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include> $<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}>)
|
||||
IF(CLOG_LOG_TO_STDIO)
|
||||
TARGET_COMPILE_DEFINITIONS(clog PRIVATE CLOG_LOG_TO_STDIO=1)
|
||||
ELSE()
|
||||
@@ -39,4 +69,33 @@ ELSE()
|
||||
ENDIF()
|
||||
IF(ANDROID AND NOT CLOG_LOG_TO_STDIO)
|
||||
TARGET_LINK_LIBRARIES(clog PRIVATE log)
|
||||
ENDIF()
|
||||
ENDIF()
|
||||
|
||||
ADD_LIBRARY(cpuinfo::clog ALIAS clog)
|
||||
|
||||
INSTALL(TARGETS clog
|
||||
EXPORT cpuinfo-targets
|
||||
LIBRARY DESTINATION "${CMAKE_INSTALL_LIBDIR}"
|
||||
ARCHIVE DESTINATION "${CMAKE_INSTALL_LIBDIR}"
|
||||
PUBLIC_HEADER DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}")
|
||||
|
||||
# ---[ clog tests
|
||||
IF(CLOG_BUILD_TESTS)
|
||||
# ---[ Build google test
|
||||
IF(NOT TARGET gtest AND NOT USE_SYSTEM_GOOGLETEST)
|
||||
IF(MSVC AND NOT CLOG_RUNTIME_TYPE STREQUAL "static")
|
||||
SET(gtest_force_shared_crt ON CACHE BOOL "" FORCE)
|
||||
ENDIF()
|
||||
ADD_SUBDIRECTORY(
|
||||
"${GOOGLETEST_SOURCE_DIR}"
|
||||
"${CONFU_DEPENDENCIES_BINARY_DIR}/googletest")
|
||||
ENDIF()
|
||||
|
||||
ADD_EXECUTABLE(clog-test test/clog.cc)
|
||||
SET_TARGET_PROPERTIES(clog-test PROPERTIES
|
||||
CXX_STANDARD 11
|
||||
CXX_EXTENSIONS NO)
|
||||
CLOG_TARGET_RUNTIME_LIBRARY(clog-test)
|
||||
TARGET_LINK_LIBRARIES(clog-test PRIVATE clog gtest gtest_main)
|
||||
ADD_TEST(clog-test clog-test)
|
||||
ENDIF()
|
||||
|
||||
23
3rdparty/cpuinfo/deps/clog/src/clog.c
vendored
23
3rdparty/cpuinfo/deps/clog/src/clog.c
vendored
@@ -10,6 +10,9 @@
|
||||
#ifdef __ANDROID__
|
||||
#include <android/log.h>
|
||||
#endif
|
||||
#ifdef __hexagon__
|
||||
#include <qurt_printf.h>
|
||||
#endif
|
||||
|
||||
#ifndef CLOG_LOG_TO_STDIO
|
||||
#ifdef __ANDROID__
|
||||
@@ -102,12 +105,14 @@ void clog_vlog_fatal(const char* module, const char* format, va_list args) {
|
||||
out_buffer = heap_buffer;
|
||||
}
|
||||
out_buffer[prefix_chars + format_chars] = '\n';
|
||||
#ifdef _WIN32
|
||||
#if defined(_WIN32)
|
||||
DWORD bytes_written;
|
||||
WriteFile(
|
||||
GetStdHandle(STD_ERROR_HANDLE),
|
||||
out_buffer, prefix_chars + format_chars + CLOG_SUFFIX_LENGTH,
|
||||
&bytes_written, NULL);
|
||||
#elif defined(__hexagon__)
|
||||
qurt_printf("%s", out_buffer);
|
||||
#else
|
||||
write(STDERR_FILENO, out_buffer, prefix_chars + format_chars + CLOG_SUFFIX_LENGTH);
|
||||
#endif
|
||||
@@ -178,12 +183,14 @@ void clog_vlog_error(const char* module, const char* format, va_list args) {
|
||||
out_buffer = heap_buffer;
|
||||
}
|
||||
out_buffer[prefix_chars + format_chars] = '\n';
|
||||
#ifdef _WIN32
|
||||
#if defined(_WIN32)
|
||||
DWORD bytes_written;
|
||||
WriteFile(
|
||||
GetStdHandle(STD_ERROR_HANDLE),
|
||||
out_buffer, prefix_chars + format_chars + CLOG_SUFFIX_LENGTH,
|
||||
&bytes_written, NULL);
|
||||
#elif defined(__hexagon__)
|
||||
qurt_printf("%s", out_buffer);
|
||||
#else
|
||||
write(STDERR_FILENO, out_buffer, prefix_chars + format_chars + CLOG_SUFFIX_LENGTH);
|
||||
#endif
|
||||
@@ -254,12 +261,14 @@ void clog_vlog_warning(const char* module, const char* format, va_list args) {
|
||||
out_buffer = heap_buffer;
|
||||
}
|
||||
out_buffer[prefix_chars + format_chars] = '\n';
|
||||
#ifdef _WIN32
|
||||
#if defined(_WIN32)
|
||||
DWORD bytes_written;
|
||||
WriteFile(
|
||||
GetStdHandle(STD_ERROR_HANDLE),
|
||||
out_buffer, prefix_chars + format_chars + CLOG_SUFFIX_LENGTH,
|
||||
&bytes_written, NULL);
|
||||
#elif defined(__hexagon__)
|
||||
qurt_printf("%s", out_buffer);
|
||||
#else
|
||||
write(STDERR_FILENO, out_buffer, prefix_chars + format_chars + CLOG_SUFFIX_LENGTH);
|
||||
#endif
|
||||
@@ -330,12 +339,14 @@ void clog_vlog_info(const char* module, const char* format, va_list args) {
|
||||
out_buffer = heap_buffer;
|
||||
}
|
||||
out_buffer[prefix_chars + format_chars] = '\n';
|
||||
#ifdef _WIN32
|
||||
#if defined(_WIN32)
|
||||
DWORD bytes_written;
|
||||
WriteFile(
|
||||
GetStdHandle(STD_OUTPUT_HANDLE),
|
||||
out_buffer, prefix_chars + format_chars + CLOG_SUFFIX_LENGTH,
|
||||
&bytes_written, NULL);
|
||||
#elif defined(__hexagon__)
|
||||
qurt_printf("%s", out_buffer);
|
||||
#else
|
||||
write(STDOUT_FILENO, out_buffer, prefix_chars + format_chars + CLOG_SUFFIX_LENGTH);
|
||||
#endif
|
||||
@@ -406,12 +417,14 @@ void clog_vlog_debug(const char* module, const char* format, va_list args) {
|
||||
out_buffer = heap_buffer;
|
||||
}
|
||||
out_buffer[prefix_chars + format_chars] = '\n';
|
||||
#ifdef _WIN32
|
||||
#if defined(_WIN32)
|
||||
DWORD bytes_written;
|
||||
WriteFile(
|
||||
GetStdHandle(STD_OUTPUT_HANDLE),
|
||||
out_buffer, prefix_chars + format_chars + CLOG_SUFFIX_LENGTH,
|
||||
&bytes_written, NULL);
|
||||
#elif defined(__hexagon__)
|
||||
qurt_printf("%s", out_buffer);
|
||||
#else
|
||||
write(STDOUT_FILENO, out_buffer, prefix_chars + format_chars + CLOG_SUFFIX_LENGTH);
|
||||
#endif
|
||||
|
||||
215
3rdparty/cpuinfo/include/cpuinfo.h
vendored
215
3rdparty/cpuinfo/include/cpuinfo.h
vendored
@@ -46,6 +46,14 @@
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#if defined(__riscv)
|
||||
#if (__riscv_xlen == 32)
|
||||
#define CPUINFO_ARCH_RISCV32 1
|
||||
#elif (__riscv_xlen == 64)
|
||||
#define CPUINFO_ARCH_RISCV64 1
|
||||
#endif
|
||||
#endif
|
||||
|
||||
/* Define other architecture-specific macros as 0 */
|
||||
|
||||
#ifndef CPUINFO_ARCH_X86
|
||||
@@ -80,6 +88,14 @@
|
||||
#define CPUINFO_ARCH_WASMSIMD 0
|
||||
#endif
|
||||
|
||||
#ifndef CPUINFO_ARCH_RISCV32
|
||||
#define CPUINFO_ARCH_RISCV32 0
|
||||
#endif
|
||||
|
||||
#ifndef CPUINFO_ARCH_RISCV64
|
||||
#define CPUINFO_ARCH_RISCV64 0
|
||||
#endif
|
||||
|
||||
#if CPUINFO_ARCH_X86 && defined(_MSC_VER)
|
||||
#define CPUINFO_ABI __cdecl
|
||||
#elif CPUINFO_ARCH_X86 && defined(__GNUC__)
|
||||
@@ -188,6 +204,8 @@ enum cpuinfo_vendor {
|
||||
* Processors are variants of AMD cores.
|
||||
*/
|
||||
cpuinfo_vendor_hygon = 16,
|
||||
/** SiFive, Inc. Vendor of RISC-V processor microarchitectures. */
|
||||
cpuinfo_vendor_sifive = 17,
|
||||
|
||||
/* Active vendors of embedded CPUs */
|
||||
|
||||
@@ -363,6 +381,8 @@ enum cpuinfo_uarch {
|
||||
cpuinfo_uarch_zen2 = 0x0020010A,
|
||||
/** AMD Zen 3 microarchitecture. */
|
||||
cpuinfo_uarch_zen3 = 0x0020010B,
|
||||
/** AMD Zen 4 microarchitecture. */
|
||||
cpuinfo_uarch_zen4 = 0x0020010C,
|
||||
|
||||
/** NSC Geode and AMD Geode GX and LX. */
|
||||
cpuinfo_uarch_geode = 0x00200200,
|
||||
@@ -426,9 +446,26 @@ enum cpuinfo_uarch {
|
||||
cpuinfo_uarch_neoverse_n1 = 0x00300400,
|
||||
/** ARM Neoverse E1. */
|
||||
cpuinfo_uarch_neoverse_e1 = 0x00300401,
|
||||
/** ARM Neoverse V1. */
|
||||
cpuinfo_uarch_neoverse_v1 = 0x00300402,
|
||||
/** ARM Neoverse N2. */
|
||||
cpuinfo_uarch_neoverse_n2 = 0x00300403,
|
||||
/** ARM Neoverse V2. */
|
||||
cpuinfo_uarch_neoverse_v2 = 0x00300404,
|
||||
|
||||
/** ARM Cortex-X1. */
|
||||
cpuinfo_uarch_cortex_x1 = 0x00300500,
|
||||
cpuinfo_uarch_cortex_x1 = 0x00300501,
|
||||
/** ARM Cortex-X2. */
|
||||
cpuinfo_uarch_cortex_x2 = 0x00300502,
|
||||
/** ARM Cortex-X3. */
|
||||
cpuinfo_uarch_cortex_x3 = 0x00300503,
|
||||
|
||||
/** ARM Cortex-A510. */
|
||||
cpuinfo_uarch_cortex_a510 = 0x00300551,
|
||||
/** ARM Cortex-A710. */
|
||||
cpuinfo_uarch_cortex_a710 = 0x00300571,
|
||||
/** ARM Cortex-A715. */
|
||||
cpuinfo_uarch_cortex_a715 = 0x00300572,
|
||||
|
||||
/** Qualcomm Scorpion. */
|
||||
cpuinfo_uarch_scorpion = 0x00400100,
|
||||
@@ -489,10 +526,14 @@ enum cpuinfo_uarch {
|
||||
cpuinfo_uarch_lightning = 0x00700109,
|
||||
/** Apple A13 processor (little cores). */
|
||||
cpuinfo_uarch_thunder = 0x0070010A,
|
||||
/** Apple M1 processor (big cores). */
|
||||
/** Apple A14 / M1 processor (big cores). */
|
||||
cpuinfo_uarch_firestorm = 0x0070010B,
|
||||
/** Apple M1 processor (little cores). */
|
||||
/** Apple A14 / M1 processor (little cores). */
|
||||
cpuinfo_uarch_icestorm = 0x0070010C,
|
||||
/** Apple A15 / M2 processor (big cores). */
|
||||
cpuinfo_uarch_avalanche = 0x0070010D,
|
||||
/** Apple A15 / M2 processor (little cores). */
|
||||
cpuinfo_uarch_blizzard = 0x0070010E,
|
||||
|
||||
/** Cavium ThunderX. */
|
||||
cpuinfo_uarch_thunderx = 0x00800100,
|
||||
@@ -706,6 +747,7 @@ void CPUINFO_ABI cpuinfo_deinitialize(void);
|
||||
bool sse4a;
|
||||
bool misaligned_sse;
|
||||
bool avx;
|
||||
bool avxvnni;
|
||||
bool fma3;
|
||||
bool fma4;
|
||||
bool xop;
|
||||
@@ -725,6 +767,7 @@ void CPUINFO_ABI cpuinfo_deinitialize(void);
|
||||
bool avx512vpopcntdq;
|
||||
bool avx512vnni;
|
||||
bool avx512bf16;
|
||||
bool avx512fp16;
|
||||
bool avx512vp2intersect;
|
||||
bool avx512_4vnniw;
|
||||
bool avx512_4fmaps;
|
||||
@@ -1052,6 +1095,14 @@ static inline bool cpuinfo_has_x86_avx(void) {
|
||||
#endif
|
||||
}
|
||||
|
||||
static inline bool cpuinfo_has_x86_avxvnni(void) {
|
||||
#if CPUINFO_ARCH_X86 || CPUINFO_ARCH_X86_64
|
||||
return cpuinfo_isa.avxvnni;
|
||||
#else
|
||||
return false;
|
||||
#endif
|
||||
}
|
||||
|
||||
static inline bool cpuinfo_has_x86_fma3(void) {
|
||||
#if CPUINFO_ARCH_X86 || CPUINFO_ARCH_X86_64
|
||||
return cpuinfo_isa.fma3;
|
||||
@@ -1204,6 +1255,14 @@ static inline bool cpuinfo_has_x86_avx512bf16(void) {
|
||||
#endif
|
||||
}
|
||||
|
||||
static inline bool cpuinfo_has_x86_avx512fp16(void) {
|
||||
#if CPUINFO_ARCH_X86 || CPUINFO_ARCH_X86_64
|
||||
return cpuinfo_isa.avx512fp16;
|
||||
#else
|
||||
return false;
|
||||
#endif
|
||||
}
|
||||
|
||||
static inline bool cpuinfo_has_x86_avx512vp2intersect(void) {
|
||||
#if CPUINFO_ARCH_X86 || CPUINFO_ARCH_X86_64
|
||||
return cpuinfo_isa.avx512vp2intersect;
|
||||
@@ -1460,14 +1519,17 @@ static inline bool cpuinfo_has_x86_sha(void) {
|
||||
#endif
|
||||
#if CPUINFO_ARCH_ARM64
|
||||
bool atomics;
|
||||
bool bf16;
|
||||
bool sve;
|
||||
bool sve2;
|
||||
bool i8mm;
|
||||
#endif
|
||||
bool rdm;
|
||||
bool fp16arith;
|
||||
bool dot;
|
||||
bool jscvt;
|
||||
bool fcma;
|
||||
bool fhm;
|
||||
|
||||
bool aes;
|
||||
bool sha1;
|
||||
@@ -1623,6 +1685,22 @@ static inline bool cpuinfo_has_arm_vfpv4_d32(void) {
|
||||
#endif
|
||||
}
|
||||
|
||||
static inline bool cpuinfo_has_arm_fp16_arith(void) {
|
||||
#if CPUINFO_ARCH_ARM || CPUINFO_ARCH_ARM64
|
||||
return cpuinfo_isa.fp16arith;
|
||||
#else
|
||||
return false;
|
||||
#endif
|
||||
}
|
||||
|
||||
static inline bool cpuinfo_has_arm_bf16(void) {
|
||||
#if CPUINFO_ARCH_ARM64
|
||||
return cpuinfo_isa.bf16;
|
||||
#else
|
||||
return false;
|
||||
#endif
|
||||
}
|
||||
|
||||
static inline bool cpuinfo_has_arm_wmmx(void) {
|
||||
#if CPUINFO_ARCH_ARM
|
||||
return cpuinfo_isa.wmmx;
|
||||
@@ -1705,9 +1783,9 @@ static inline bool cpuinfo_has_arm_neon_fp16_arith(void) {
|
||||
#endif
|
||||
}
|
||||
|
||||
static inline bool cpuinfo_has_arm_fp16_arith(void) {
|
||||
static inline bool cpuinfo_has_arm_fhm(void) {
|
||||
#if CPUINFO_ARCH_ARM || CPUINFO_ARCH_ARM64
|
||||
return cpuinfo_isa.fp16arith;
|
||||
return cpuinfo_isa.fhm;
|
||||
#else
|
||||
return false;
|
||||
#endif
|
||||
@@ -1721,6 +1799,14 @@ static inline bool cpuinfo_has_arm_neon_dot(void) {
|
||||
#endif
|
||||
}
|
||||
|
||||
static inline bool cpuinfo_has_arm_neon_bf16(void) {
|
||||
#if CPUINFO_ARCH_ARM64
|
||||
return cpuinfo_isa.bf16;
|
||||
#else
|
||||
return false;
|
||||
#endif
|
||||
}
|
||||
|
||||
static inline bool cpuinfo_has_arm_jscvt(void) {
|
||||
#if CPUINFO_ARCH_ARM || CPUINFO_ARCH_ARM64
|
||||
return cpuinfo_isa.jscvt;
|
||||
@@ -1737,6 +1823,14 @@ static inline bool cpuinfo_has_arm_fcma(void) {
|
||||
#endif
|
||||
}
|
||||
|
||||
static inline bool cpuinfo_has_arm_i8mm(void) {
|
||||
#if CPUINFO_ARCH_ARM64
|
||||
return cpuinfo_isa.i8mm;
|
||||
#else
|
||||
return false;
|
||||
#endif
|
||||
}
|
||||
|
||||
static inline bool cpuinfo_has_arm_aes(void) {
|
||||
#if CPUINFO_ARCH_ARM || CPUINFO_ARCH_ARM64
|
||||
return cpuinfo_isa.aes;
|
||||
@@ -1785,6 +1879,14 @@ static inline bool cpuinfo_has_arm_sve(void) {
|
||||
#endif
|
||||
}
|
||||
|
||||
static inline bool cpuinfo_has_arm_sve_bf16(void) {
|
||||
#if CPUINFO_ARCH_ARM64
|
||||
return cpuinfo_isa.sve && cpuinfo_isa.bf16;
|
||||
#else
|
||||
return false;
|
||||
#endif
|
||||
}
|
||||
|
||||
static inline bool cpuinfo_has_arm_sve2(void) {
|
||||
#if CPUINFO_ARCH_ARM64
|
||||
return cpuinfo_isa.sve2;
|
||||
@@ -1793,6 +1895,109 @@ static inline bool cpuinfo_has_arm_sve2(void) {
|
||||
#endif
|
||||
}
|
||||
|
||||
#if CPUINFO_ARCH_RISCV32 || CPUINFO_ARCH_RISCV64
|
||||
/* This structure is not a part of stable API. Use cpuinfo_has_riscv_* functions instead. */
|
||||
struct cpuinfo_riscv_isa {
|
||||
/**
|
||||
* Keep fields in line with the canonical order as defined by
|
||||
* Section 27.11 Subset Naming Convention.
|
||||
*/
|
||||
/* RV32I/64I/128I Base ISA. */
|
||||
bool i;
|
||||
#if CPUINFO_ARCH_RISCV32
|
||||
/* RV32E Base ISA. */
|
||||
bool e;
|
||||
#endif
|
||||
/* Integer Multiply/Divide Extension. */
|
||||
bool m;
|
||||
/* Atomic Extension. */
|
||||
bool a;
|
||||
/* Single-Precision Floating-Point Extension. */
|
||||
bool f;
|
||||
/* Double-Precision Floating-Point Extension. */
|
||||
bool d;
|
||||
/* Compressed Extension. */
|
||||
bool c;
|
||||
/* Vector Extension. */
|
||||
bool v;
|
||||
};
|
||||
|
||||
extern struct cpuinfo_riscv_isa cpuinfo_isa;
|
||||
#endif
|
||||
|
||||
static inline bool cpuinfo_has_riscv_i(void) {
|
||||
#if CPUINFO_ARCH_RISCV32 || CPUINFO_ARCH_RISCV64
|
||||
return cpuinfo_isa.i;
|
||||
#else
|
||||
return false;
|
||||
#endif
|
||||
}
|
||||
|
||||
static inline bool cpuinfo_has_riscv_e(void) {
|
||||
#if CPUINFO_ARCH_RISCV32
|
||||
return cpuinfo_isa.e;
|
||||
#else
|
||||
return false;
|
||||
#endif
|
||||
}
|
||||
|
||||
static inline bool cpuinfo_has_riscv_m(void) {
|
||||
#if CPUINFO_ARCH_RISCV32 || CPUINFO_ARCH_RISCV64
|
||||
return cpuinfo_isa.m;
|
||||
#else
|
||||
return false;
|
||||
#endif
|
||||
}
|
||||
|
||||
static inline bool cpuinfo_has_riscv_a(void) {
|
||||
#if CPUINFO_ARCH_RISCV32 || CPUINFO_ARCH_RISCV64
|
||||
return cpuinfo_isa.a;
|
||||
#else
|
||||
return false;
|
||||
#endif
|
||||
}
|
||||
|
||||
static inline bool cpuinfo_has_riscv_f(void) {
|
||||
#if CPUINFO_ARCH_RISCV32 || CPUINFO_ARCH_RISCV64
|
||||
return cpuinfo_isa.f;
|
||||
#else
|
||||
return false;
|
||||
#endif
|
||||
}
|
||||
|
||||
static inline bool cpuinfo_has_riscv_d(void) {
|
||||
#if CPUINFO_ARCH_RISCV32 || CPUINFO_ARCH_RISCV64
|
||||
return cpuinfo_isa.d;
|
||||
#else
|
||||
return false;
|
||||
#endif
|
||||
}
|
||||
|
||||
static inline bool cpuinfo_has_riscv_g(void) {
|
||||
// The 'G' extension is simply shorthand for 'IMAFD'.
|
||||
return cpuinfo_has_riscv_i()
|
||||
&& cpuinfo_has_riscv_m()
|
||||
&& cpuinfo_has_riscv_a()
|
||||
&& cpuinfo_has_riscv_f()
|
||||
&& cpuinfo_has_riscv_d();
|
||||
}
|
||||
|
||||
static inline bool cpuinfo_has_riscv_c(void) {
|
||||
#if CPUINFO_ARCH_RISCV32 || CPUINFO_ARCH_RISCV64
|
||||
return cpuinfo_isa.c;
|
||||
#else
|
||||
return false;
|
||||
#endif
|
||||
}
|
||||
|
||||
static inline bool cpuinfo_has_riscv_v(void) {
|
||||
#if CPUINFO_ARCH_RISCV32 || CPUINFO_ARCH_RISCV64
|
||||
return cpuinfo_isa.v;
|
||||
#else
|
||||
return false;
|
||||
#endif
|
||||
}
|
||||
|
||||
const struct cpuinfo_processor* CPUINFO_ABI cpuinfo_get_processors(void);
|
||||
const struct cpuinfo_core* CPUINFO_ABI cpuinfo_get_cores(void);
|
||||
const struct cpuinfo_cluster* CPUINFO_ABI cpuinfo_get_clusters(void);
|
||||
|
||||
25
3rdparty/cpuinfo/src/api.c
vendored
25
3rdparty/cpuinfo/src/api.c
vendored
@@ -30,7 +30,8 @@ uint32_t cpuinfo_packages_count = 0;
|
||||
uint32_t cpuinfo_cache_count[cpuinfo_cache_level_max] = { 0 };
|
||||
uint32_t cpuinfo_max_cache_size = 0;
|
||||
|
||||
#if CPUINFO_ARCH_ARM || CPUINFO_ARCH_ARM64
|
||||
#if CPUINFO_ARCH_ARM || CPUINFO_ARCH_ARM64 \
|
||||
|| CPUINFO_ARCH_RISCV32 || CPUINFO_ARCH_RISCV64
|
||||
struct cpuinfo_uarch_info* cpuinfo_uarchs = NULL;
|
||||
uint32_t cpuinfo_uarchs_count = 0;
|
||||
#else
|
||||
@@ -41,7 +42,8 @@ uint32_t cpuinfo_max_cache_size = 0;
|
||||
uint32_t cpuinfo_linux_cpu_max = 0;
|
||||
const struct cpuinfo_processor** cpuinfo_linux_cpu_to_processor_map = NULL;
|
||||
const struct cpuinfo_core** cpuinfo_linux_cpu_to_core_map = NULL;
|
||||
#if CPUINFO_ARCH_ARM || CPUINFO_ARCH_ARM64
|
||||
#if CPUINFO_ARCH_ARM || CPUINFO_ARCH_ARM64 \
|
||||
|| CPUINFO_ARCH_RISCV32 || CPUINFO_ARCH_RISCV64
|
||||
const uint32_t* cpuinfo_linux_cpu_to_uarch_index_map = NULL;
|
||||
#endif
|
||||
#endif
|
||||
@@ -79,7 +81,8 @@ const struct cpuinfo_uarch_info* cpuinfo_get_uarchs() {
|
||||
if (!cpuinfo_is_initialized) {
|
||||
cpuinfo_log_fatal("cpuinfo_get_%s called before cpuinfo is initialized", "uarchs");
|
||||
}
|
||||
#if CPUINFO_ARCH_ARM || CPUINFO_ARCH_ARM64
|
||||
#if CPUINFO_ARCH_ARM || CPUINFO_ARCH_ARM64 \
|
||||
|| CPUINFO_ARCH_RISCV32 || CPUINFO_ARCH_RISCV64
|
||||
return cpuinfo_uarchs;
|
||||
#else
|
||||
return &cpuinfo_global_uarch;
|
||||
@@ -130,7 +133,8 @@ const struct cpuinfo_uarch_info* cpuinfo_get_uarch(uint32_t index) {
|
||||
if (!cpuinfo_is_initialized) {
|
||||
cpuinfo_log_fatal("cpuinfo_get_%s called before cpuinfo is initialized", "uarch");
|
||||
}
|
||||
#if CPUINFO_ARCH_ARM || CPUINFO_ARCH_ARM64
|
||||
#if CPUINFO_ARCH_ARM || CPUINFO_ARCH_ARM64 \
|
||||
|| CPUINFO_ARCH_RISCV32 || CPUINFO_ARCH_RISCV64
|
||||
if CPUINFO_UNLIKELY(index >= cpuinfo_uarchs_count) {
|
||||
return NULL;
|
||||
}
|
||||
@@ -175,7 +179,8 @@ uint32_t cpuinfo_get_uarchs_count(void) {
|
||||
if (!cpuinfo_is_initialized) {
|
||||
cpuinfo_log_fatal("cpuinfo_get_%s called before cpuinfo is initialized", "uarchs_count");
|
||||
}
|
||||
#if CPUINFO_ARCH_ARM || CPUINFO_ARCH_ARM64
|
||||
#if CPUINFO_ARCH_ARM || CPUINFO_ARCH_ARM64 \
|
||||
|| CPUINFO_ARCH_RISCV32 || CPUINFO_ARCH_RISCV64
|
||||
return cpuinfo_uarchs_count;
|
||||
#else
|
||||
return 1;
|
||||
@@ -351,7 +356,8 @@ uint32_t CPUINFO_ABI cpuinfo_get_current_uarch_index(void) {
|
||||
if CPUINFO_UNLIKELY(!cpuinfo_is_initialized) {
|
||||
cpuinfo_log_fatal("cpuinfo_get_%s called before cpuinfo is initialized", "current_uarch_index");
|
||||
}
|
||||
#if CPUINFO_ARCH_ARM || CPUINFO_ARCH_ARM64
|
||||
#if CPUINFO_ARCH_ARM || CPUINFO_ARCH_ARM64 \
|
||||
|| CPUINFO_ARCH_RISCV32 || CPUINFO_ARCH_RISCV64
|
||||
#ifdef __linux__
|
||||
if (cpuinfo_linux_cpu_to_uarch_index_map == NULL) {
|
||||
/* Special case: avoid syscall on systems with only a single type of cores */
|
||||
@@ -373,7 +379,7 @@ uint32_t CPUINFO_ABI cpuinfo_get_current_uarch_index(void) {
|
||||
return 0;
|
||||
#endif
|
||||
#else
|
||||
/* Only ARM/ARM64 processors may include cores of different types in the same package. */
|
||||
/* Only ARM/ARM64/RISCV processors may include cores of different types in the same package. */
|
||||
return 0;
|
||||
#endif
|
||||
}
|
||||
@@ -382,7 +388,8 @@ uint32_t CPUINFO_ABI cpuinfo_get_current_uarch_index_with_default(uint32_t defau
|
||||
if CPUINFO_UNLIKELY(!cpuinfo_is_initialized) {
|
||||
cpuinfo_log_fatal("cpuinfo_get_%s called before cpuinfo is initialized", "current_uarch_index_with_default");
|
||||
}
|
||||
#if CPUINFO_ARCH_ARM || CPUINFO_ARCH_ARM64
|
||||
#if CPUINFO_ARCH_ARM || CPUINFO_ARCH_ARM64 \
|
||||
|| CPUINFO_ARCH_RISCV32 || CPUINFO_ARCH_RISCV64
|
||||
#ifdef __linux__
|
||||
if (cpuinfo_linux_cpu_to_uarch_index_map == NULL) {
|
||||
/* Special case: avoid syscall on systems with only a single type of cores */
|
||||
@@ -404,7 +411,7 @@ uint32_t CPUINFO_ABI cpuinfo_get_current_uarch_index_with_default(uint32_t defau
|
||||
return default_uarch_index;
|
||||
#endif
|
||||
#else
|
||||
/* Only ARM/ARM64 processors may include cores of different types in the same package. */
|
||||
/* Only ARM/ARM64/RISCV processors may include cores of different types in the same package. */
|
||||
return 0;
|
||||
#endif
|
||||
}
|
||||
|
||||
2
3rdparty/cpuinfo/src/arm/api.h
vendored
2
3rdparty/cpuinfo/src/arm/api.h
vendored
@@ -28,6 +28,7 @@ enum cpuinfo_arm_chipset_vendor {
|
||||
cpuinfo_arm_chipset_vendor_spreadtrum,
|
||||
cpuinfo_arm_chipset_vendor_telechips,
|
||||
cpuinfo_arm_chipset_vendor_texas_instruments,
|
||||
cpuinfo_arm_chipset_vendor_unisoc,
|
||||
cpuinfo_arm_chipset_vendor_wondermedia,
|
||||
cpuinfo_arm_chipset_vendor_max,
|
||||
};
|
||||
@@ -62,6 +63,7 @@ enum cpuinfo_arm_chipset_series {
|
||||
cpuinfo_arm_chipset_series_spreadtrum_sc,
|
||||
cpuinfo_arm_chipset_series_telechips_tcc,
|
||||
cpuinfo_arm_chipset_series_texas_instruments_omap,
|
||||
cpuinfo_arm_chipset_series_unisoc_t,
|
||||
cpuinfo_arm_chipset_series_wondermedia_wm,
|
||||
cpuinfo_arm_chipset_series_max,
|
||||
};
|
||||
|
||||
55
3rdparty/cpuinfo/src/arm/cache.c
vendored
55
3rdparty/cpuinfo/src/arm/cache.c
vendored
@@ -1238,6 +1238,57 @@ void cpuinfo_arm_decode_cache(
|
||||
};
|
||||
break;
|
||||
}
|
||||
case cpuinfo_uarch_neoverse_n1:
|
||||
case cpuinfo_uarch_neoverse_v1:
|
||||
case cpuinfo_uarch_neoverse_n2:
|
||||
case cpuinfo_uarch_neoverse_v2:
|
||||
{
|
||||
/*
|
||||
* The specifications here below are taken from the
|
||||
* Arm Core Technical Reference Manuals for
|
||||
* - Neoverse N1: https://developer.arm.com/documentation/100616/0401/?lang=en
|
||||
* - Neoverse N2: https://developer.arm.com/documentation/102099/0003/?lang=en
|
||||
* - Neoverse V1: https://developer.arm.com/documentation/101427/0102/?lang=en
|
||||
* - Neoverse V2: https://developer.arm.com/documentation/102375/0002/?lang=en
|
||||
*
|
||||
* All four Arm architectures have L1 memory system with instruction and data caches,
|
||||
* both of fixed size of 64KB. The instruction side memory system is 4-way set associative
|
||||
* with a cache line length of 64 bytes. The data cache is also 4-way set associative with
|
||||
* a cache line length of 64 bytes.
|
||||
*
|
||||
* The L2 memory system differs across the four Architectures in the minimum
|
||||
* length of the L2 cache. Namely:
|
||||
* - Arm Neoverse N1/N2/V1 have a L2 cache of configurable size of 256KB, 512KB, or 1024KB
|
||||
* - Arm Neoverse V2 has a L2 cache of configurable size of 1MB or 2MB
|
||||
* For all four architectures, the L2 cache is 8-way set associative
|
||||
* For all other information, please refer to the technical manuals linked above
|
||||
*/
|
||||
const uint32_t min_l2_size_KB = uarch == cpuinfo_uarch_neoverse_v2 ? 1024 : 256;
|
||||
const uint32_t min_l3_size_KB = 0;
|
||||
|
||||
*l1i = (struct cpuinfo_cache) {
|
||||
.size = 64 * 1024,
|
||||
.associativity = 4,
|
||||
.line_size = 64,
|
||||
};
|
||||
*l1d = (struct cpuinfo_cache) {
|
||||
.size = 64 * 1024,
|
||||
.associativity = 4,
|
||||
.line_size = 64,
|
||||
};
|
||||
*l2 = (struct cpuinfo_cache) {
|
||||
.size = min_l2_size_KB * 1024,
|
||||
.associativity = 8,
|
||||
.line_size = 64,
|
||||
.flags = CPUINFO_CACHE_INCLUSIVE,
|
||||
};
|
||||
*l3 = (struct cpuinfo_cache) {
|
||||
.size = min_l3_size_KB * 1024,
|
||||
.associativity = 16,
|
||||
.line_size = 64,
|
||||
};
|
||||
break;
|
||||
}
|
||||
#if CPUINFO_ARCH_ARM && !defined(__ARM_ARCH_8A__)
|
||||
case cpuinfo_uarch_scorpion:
|
||||
/*
|
||||
@@ -1655,6 +1706,10 @@ uint32_t cpuinfo_arm_compute_max_cache_size(const struct cpuinfo_processor* proc
|
||||
*/
|
||||
return 8 * 1024 * 1024;
|
||||
case cpuinfo_uarch_cortex_a55:
|
||||
case cpuinfo_uarch_neoverse_n1:
|
||||
case cpuinfo_uarch_neoverse_v1:
|
||||
case cpuinfo_uarch_neoverse_n2:
|
||||
case cpuinfo_uarch_neoverse_v2:
|
||||
case cpuinfo_uarch_cortex_a75:
|
||||
case cpuinfo_uarch_cortex_a76:
|
||||
case cpuinfo_uarch_exynos_m4:
|
||||
|
||||
125
3rdparty/cpuinfo/src/arm/linux/aarch32-isa.c
vendored
125
3rdparty/cpuinfo/src/arm/linux/aarch32-isa.c
vendored
@@ -33,6 +33,13 @@ void cpuinfo_arm_linux_decode_isa_from_proc_cpuinfo(
|
||||
const struct cpuinfo_arm_chipset chipset[restrict static 1],
|
||||
struct cpuinfo_arm_isa isa[restrict static 1])
|
||||
{
|
||||
if (architecture_version < 8) {
|
||||
const uint32_t armv8_features2_mask = CPUINFO_ARM_LINUX_FEATURE2_AES | CPUINFO_ARM_LINUX_FEATURE2_PMULL |
|
||||
CPUINFO_ARM_LINUX_FEATURE2_SHA1 | CPUINFO_ARM_LINUX_FEATURE2_SHA2 | CPUINFO_ARM_LINUX_FEATURE2_CRC32;
|
||||
if (features2 & armv8_features2_mask) {
|
||||
architecture_version = 8;
|
||||
}
|
||||
}
|
||||
if (architecture_version >= 8) {
|
||||
/*
|
||||
* ARMv7 code running on ARMv8: IDIV, VFP, NEON are always supported,
|
||||
@@ -57,13 +64,22 @@ void cpuinfo_arm_linux_decode_isa_from_proc_cpuinfo(
|
||||
* NEON FP16 compute extension and VQRDMLAH/VQRDMLSH instructions are not indicated in /proc/cpuinfo.
|
||||
* Use a MIDR-based heuristic to whitelist processors known to support it:
|
||||
* - Processors with Cortex-A55 cores
|
||||
* - Processors with Cortex-A65 cores
|
||||
* - Processors with Cortex-A75 cores
|
||||
* - Processors with Cortex-A76 cores
|
||||
* - Processors with Cortex-A77 cores
|
||||
* - Processors with Cortex-A78 cores
|
||||
* - Processors with Cortex-A510 cores
|
||||
* - Processors with Cortex-A710 cores
|
||||
* - Processors with Cortex-A715 cores
|
||||
* - Processors with Cortex-X1 cores
|
||||
* - Processors with Cortex-X2 cores
|
||||
* - Processors with Cortex-X3 cores
|
||||
* - Processors with Exynos M4 cores
|
||||
* - Processors with Exynos M5 cores
|
||||
* - Neoverse N1 cores
|
||||
* - Neoverse N2 cores
|
||||
* - Neoverse V1 cores
|
||||
* - Neoverse V2 cores
|
||||
*/
|
||||
if (chipset->series == cpuinfo_arm_chipset_series_samsung_exynos && chipset->model == 9810) {
|
||||
/* Only little cores of Exynos 9810 support FP16 & RDM */
|
||||
@@ -71,11 +87,21 @@ void cpuinfo_arm_linux_decode_isa_from_proc_cpuinfo(
|
||||
} else {
|
||||
switch (midr & (CPUINFO_ARM_MIDR_IMPLEMENTER_MASK | CPUINFO_ARM_MIDR_PART_MASK)) {
|
||||
case UINT32_C(0x4100D050): /* Cortex-A55 */
|
||||
case UINT32_C(0x4100D060): /* Cortex-A65 */
|
||||
case UINT32_C(0x4100D0A0): /* Cortex-A75 */
|
||||
case UINT32_C(0x4100D0B0): /* Cortex-A76 */
|
||||
case UINT32_C(0x4100D0C0): /* Neoverse N1 */
|
||||
case UINT32_C(0x4100D0D0): /* Cortex-A77 */
|
||||
case UINT32_C(0x4100D0E0): /* Cortex-A76AE */
|
||||
case UINT32_C(0x4100D400): /* Neoverse V1 */
|
||||
case UINT32_C(0x4100D410): /* Cortex-A78 */
|
||||
case UINT32_C(0x4100D440): /* Cortex-X1 */
|
||||
case UINT32_C(0x4100D460): /* Cortex-A510 */
|
||||
case UINT32_C(0x4100D470): /* Cortex-A710 */
|
||||
case UINT32_C(0x4100D480): /* Cortex-X2 */
|
||||
case UINT32_C(0x4100D490): /* Neoverse N2 */
|
||||
case UINT32_C(0x4100D4D0): /* Cortex-A715 */
|
||||
case UINT32_C(0x4100D4E0): /* Cortex-X3 */
|
||||
case UINT32_C(0x4100D4F0): /* Neoverse V2 */
|
||||
case UINT32_C(0x4800D400): /* Cortex-A76 (HiSilicon) */
|
||||
case UINT32_C(0x51008020): /* Kryo 385 Gold (Cortex-A75) */
|
||||
case UINT32_C(0x51008030): /* Kryo 385 Silver (Cortex-A55) */
|
||||
@@ -91,25 +117,57 @@ void cpuinfo_arm_linux_decode_isa_from_proc_cpuinfo(
|
||||
|
||||
/*
|
||||
* NEON VDOT instructions are not indicated in /proc/cpuinfo.
|
||||
* Use a MIDR-based heuristic to whitelist processors known to support it.
|
||||
* Use a MIDR-based heuristic to whitelist processors known to support it:
|
||||
* - Processors with Cortex-A76 cores
|
||||
* - Processors with Cortex-A77 cores
|
||||
* - Processors with Cortex-A78 cores
|
||||
* - Processors with Cortex-A510 cores
|
||||
* - Processors with Cortex-A710 cores
|
||||
* - Processors with Cortex-A715 cores
|
||||
* - Processors with Cortex-X1 cores
|
||||
* - Processors with Cortex-X2 cores
|
||||
* - Processors with Cortex-X3 cores
|
||||
* - Processors with Exynos M4 cores
|
||||
* - Processors with Exynos M5 cores
|
||||
* - Neoverse N1 cores
|
||||
* - Neoverse N2 cores
|
||||
* - Neoverse V1 cores
|
||||
* - Neoverse V2 cores
|
||||
*/
|
||||
switch (midr & (CPUINFO_ARM_MIDR_IMPLEMENTER_MASK | CPUINFO_ARM_MIDR_PART_MASK)) {
|
||||
case UINT32_C(0x4100D0B0): /* Cortex-A76 */
|
||||
case UINT32_C(0x4100D0D0): /* Cortex-A77 */
|
||||
case UINT32_C(0x4100D0E0): /* Cortex-A76AE */
|
||||
case UINT32_C(0x4800D400): /* Cortex-A76 (HiSilicon) */
|
||||
case UINT32_C(0x51008040): /* Kryo 485 Gold (Cortex-A76) */
|
||||
case UINT32_C(0x51008050): /* Kryo 485 Silver (Cortex-A55) */
|
||||
case UINT32_C(0x53000030): /* Exynos-M4 */
|
||||
case UINT32_C(0x53000040): /* Exynos-M5 */
|
||||
isa->dot = true;
|
||||
break;
|
||||
case UINT32_C(0x4100D050): /* Cortex A55: revision 1 or later only */
|
||||
isa->dot = !!(midr_get_variant(midr) >= 1);
|
||||
break;
|
||||
case UINT32_C(0x4100D0A0): /* Cortex A75: revision 2 or later only */
|
||||
isa->dot = !!(midr_get_variant(midr) >= 2);
|
||||
break;
|
||||
if (chipset->series == cpuinfo_arm_chipset_series_spreadtrum_sc && chipset->model == 9863) {
|
||||
cpuinfo_log_warning("VDOT instructions disabled: cause occasional SIGILL on Spreadtrum SC9863A");
|
||||
} else if (chipset->series == cpuinfo_arm_chipset_series_unisoc_t && chipset->model == 310) {
|
||||
cpuinfo_log_warning("VDOT instructions disabled: cause occasional SIGILL on Unisoc T310");
|
||||
} else {
|
||||
switch (midr & (CPUINFO_ARM_MIDR_IMPLEMENTER_MASK | CPUINFO_ARM_MIDR_PART_MASK)) {
|
||||
case UINT32_C(0x4100D0B0): /* Cortex-A76 */
|
||||
case UINT32_C(0x4100D0C0): /* Neoverse N1 */
|
||||
case UINT32_C(0x4100D0D0): /* Cortex-A77 */
|
||||
case UINT32_C(0x4100D0E0): /* Cortex-A76AE */
|
||||
case UINT32_C(0x4100D400): /* Neoverse V1 */
|
||||
case UINT32_C(0x4100D410): /* Cortex-A78 */
|
||||
case UINT32_C(0x4100D440): /* Cortex-X1 */
|
||||
case UINT32_C(0x4100D460): /* Cortex-A510 */
|
||||
case UINT32_C(0x4100D470): /* Cortex-A710 */
|
||||
case UINT32_C(0x4100D480): /* Cortex-X2 */
|
||||
case UINT32_C(0x4100D490): /* Neoverse N2 */
|
||||
case UINT32_C(0x4100D4D0): /* Cortex-A715 */
|
||||
case UINT32_C(0x4100D4E0): /* Cortex-X3 */
|
||||
case UINT32_C(0x4100D4F0): /* Neoverse V2 */
|
||||
case UINT32_C(0x4800D400): /* Cortex-A76 (HiSilicon) */
|
||||
case UINT32_C(0x51008040): /* Kryo 485 Gold (Cortex-A76) */
|
||||
case UINT32_C(0x51008050): /* Kryo 485 Silver (Cortex-A55) */
|
||||
case UINT32_C(0x53000030): /* Exynos M4 */
|
||||
case UINT32_C(0x53000040): /* Exynos M5 */
|
||||
isa->dot = true;
|
||||
break;
|
||||
case UINT32_C(0x4100D050): /* Cortex A55: revision 1 or later only */
|
||||
isa->dot = !!(midr_get_variant(midr) >= 1);
|
||||
break;
|
||||
case UINT32_C(0x4100D0A0): /* Cortex A75: revision 2 or later only */
|
||||
isa->dot = !!(midr_get_variant(midr) >= 2);
|
||||
break;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
/* ARMv7 or lower: use feature flags to detect optional features */
|
||||
@@ -167,19 +225,24 @@ void cpuinfo_arm_linux_decode_isa_from_proc_cpuinfo(
|
||||
}
|
||||
|
||||
if (features & CPUINFO_ARM_LINUX_FEATURE_IWMMXT) {
|
||||
const uint32_t wcid = read_wcid();
|
||||
cpuinfo_log_debug("WCID = 0x%08"PRIx32, wcid);
|
||||
const uint32_t coprocessor_type = (wcid >> 8) & UINT32_C(0xFF);
|
||||
if (coprocessor_type >= 0x10) {
|
||||
isa->wmmx = true;
|
||||
if (coprocessor_type >= 0x20) {
|
||||
isa->wmmx2 = true;
|
||||
#if !defined(__ARM_ARCH_8A__) && !(defined(__ARM_ARCH) && (__ARM_ARCH >= 8))
|
||||
const uint32_t wcid = read_wcid();
|
||||
cpuinfo_log_debug("WCID = 0x%08"PRIx32, wcid);
|
||||
const uint32_t coprocessor_type = (wcid >> 8) & UINT32_C(0xFF);
|
||||
if (coprocessor_type >= 0x10) {
|
||||
isa->wmmx = true;
|
||||
if (coprocessor_type >= 0x20) {
|
||||
isa->wmmx2 = true;
|
||||
}
|
||||
} else {
|
||||
cpuinfo_log_warning("WMMX ISA disabled: OS reported iwmmxt feature, "
|
||||
"but WCID coprocessor type 0x%"PRIx32" indicates no WMMX support",
|
||||
coprocessor_type);
|
||||
}
|
||||
} else {
|
||||
#else
|
||||
cpuinfo_log_warning("WMMX ISA disabled: OS reported iwmmxt feature, "
|
||||
"but WCID coprocessor type 0x%"PRIx32" indicates no WMMX support",
|
||||
coprocessor_type);
|
||||
}
|
||||
"but there is no iWMMXt coprocessor");
|
||||
#endif
|
||||
}
|
||||
|
||||
if ((features & CPUINFO_ARM_LINUX_FEATURE_THUMB) || (architecture_flags & CPUINFO_ARM_LINUX_ARCH_T)) {
|
||||
|
||||
22
3rdparty/cpuinfo/src/arm/linux/aarch64-isa.c
vendored
22
3rdparty/cpuinfo/src/arm/linux/aarch64-isa.c
vendored
@@ -41,6 +41,9 @@ void cpuinfo_arm64_linux_decode_isa_from_proc_cpuinfo(
|
||||
* - Processors with Exynos M4 cores
|
||||
* - Processors with Exynos M5 cores
|
||||
* - Neoverse N1 cores
|
||||
* - Neoverse V1 cores
|
||||
* - Neoverse N2 cores
|
||||
* - Neoverse V2 cores
|
||||
*/
|
||||
if (chipset->series == cpuinfo_arm_chipset_series_samsung_exynos && chipset->model == 9810) {
|
||||
/* Exynos 9810 reports that it supports FP16 compute, but in fact only little cores do */
|
||||
@@ -50,10 +53,14 @@ void cpuinfo_arm64_linux_decode_isa_from_proc_cpuinfo(
|
||||
switch (midr & (CPUINFO_ARM_MIDR_IMPLEMENTER_MASK | CPUINFO_ARM_MIDR_PART_MASK)) {
|
||||
case UINT32_C(0x4100D050): /* Cortex-A55 */
|
||||
case UINT32_C(0x4100D060): /* Cortex-A65 */
|
||||
case UINT32_C(0x4100D0A0): /* Cortex-A75 */
|
||||
case UINT32_C(0x4100D0B0): /* Cortex-A76 */
|
||||
case UINT32_C(0x4100D0C0): /* Neoverse N1 */
|
||||
case UINT32_C(0x4100D0D0): /* Cortex-A77 */
|
||||
case UINT32_C(0x4100D0E0): /* Cortex-A76AE */
|
||||
case UINT32_C(0x4100D400): /* Neoverse V1 */
|
||||
case UINT32_C(0x4100D490): /* Neoverse N2 */
|
||||
case UINT32_C(0x4100D4F0): /* Neoverse V2 */
|
||||
case UINT32_C(0x4800D400): /* Cortex-A76 (HiSilicon) */
|
||||
case UINT32_C(0x51008020): /* Kryo 385 Gold (Cortex-A75) */
|
||||
case UINT32_C(0x51008030): /* Kryo 385 Silver (Cortex-A55) */
|
||||
@@ -78,6 +85,9 @@ void cpuinfo_arm64_linux_decode_isa_from_proc_cpuinfo(
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (features2 & CPUINFO_ARM_LINUX_FEATURE2_I8MM) {
|
||||
isa->i8mm = true;
|
||||
}
|
||||
|
||||
/*
|
||||
* Many phones ship with an old kernel configuration that doesn't report UDOT/SDOT instructions.
|
||||
@@ -89,7 +99,10 @@ void cpuinfo_arm64_linux_decode_isa_from_proc_cpuinfo(
|
||||
case UINT32_C(0x4100D0C0): /* Neoverse N1 */
|
||||
case UINT32_C(0x4100D0D0): /* Cortex-A77 */
|
||||
case UINT32_C(0x4100D0E0): /* Cortex-A76AE */
|
||||
case UINT32_C(0x4100D400): /* Neoverse V1 */
|
||||
case UINT32_C(0x4100D490): /* Neoverse N2 */
|
||||
case UINT32_C(0x4100D4A0): /* Neoverse E1 */
|
||||
case UINT32_C(0x4100D4F0): /* Neoverse V2 */
|
||||
case UINT32_C(0x4800D400): /* Cortex-A76 (HiSilicon) */
|
||||
case UINT32_C(0x51008040): /* Kryo 485 Gold (Cortex-A76) */
|
||||
case UINT32_C(0x51008050): /* Kryo 485 Silver (Cortex-A55) */
|
||||
@@ -124,4 +137,13 @@ void cpuinfo_arm64_linux_decode_isa_from_proc_cpuinfo(
|
||||
if (features2 & CPUINFO_ARM_LINUX_FEATURE2_SVE2) {
|
||||
isa->sve2 = true;
|
||||
}
|
||||
// SVEBF16 is set iff SVE and BF16 are both supported, but the SVEBF16 feature flag
|
||||
// was added in Linux kernel before the BF16 feature flag, so we check for either.
|
||||
if (features2 & (CPUINFO_ARM_LINUX_FEATURE2_BF16 | CPUINFO_ARM_LINUX_FEATURE2_SVEBF16)) {
|
||||
isa->bf16 = true;
|
||||
}
|
||||
if (features & CPUINFO_ARM_LINUX_FEATURE_ASIMDFHM) {
|
||||
isa->fhm = true;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
2
3rdparty/cpuinfo/src/arm/linux/api.h
vendored
2
3rdparty/cpuinfo/src/arm/linux/api.h
vendored
@@ -314,7 +314,7 @@ CPUINFO_INTERNAL bool cpuinfo_arm_linux_parse_proc_cpuinfo(
|
||||
struct cpuinfo_arm_isa isa[restrict static 1]);
|
||||
#endif
|
||||
|
||||
#ifdef __ANDROID__
|
||||
#if defined(__ANDROID__)
|
||||
CPUINFO_INTERNAL struct cpuinfo_arm_chipset
|
||||
cpuinfo_arm_android_decode_chipset(
|
||||
const struct cpuinfo_android_properties properties[restrict static 1],
|
||||
|
||||
96
3rdparty/cpuinfo/src/arm/linux/chipset.c
vendored
96
3rdparty/cpuinfo/src/arm/linux/chipset.c
vendored
@@ -37,29 +37,17 @@ static inline bool is_ascii_numeric(char c) {
|
||||
}
|
||||
|
||||
static inline uint16_t load_u16le(const void* ptr) {
|
||||
#if defined(__ARM_ARCH_7A__) || defined(__aarch64__)
|
||||
return *((const uint16_t*) ptr);
|
||||
#else
|
||||
const uint8_t* byte_ptr = (const uint8_t*) ptr;
|
||||
return ((uint16_t) byte_ptr[1] << 8) | (uint16_t) byte_ptr[0];
|
||||
#endif
|
||||
}
|
||||
|
||||
static inline uint32_t load_u24le(const void* ptr) {
|
||||
#if defined(__ARM_ARCH_7A__) || defined(__aarch64__)
|
||||
return ((uint32_t) ((const uint8_t*) ptr)[2] << 16) | ((uint32_t) *((const uint16_t*) ptr));
|
||||
#else
|
||||
const uint8_t* byte_ptr = (const uint8_t*) ptr;
|
||||
return ((uint32_t) byte_ptr[2] << 16) | ((uint32_t) byte_ptr[1] << 8) | (uint32_t) byte_ptr[0];
|
||||
#endif
|
||||
return ((uint32_t) ((const uint8_t*) ptr)[2] << 16) | (uint32_t) load_u16le(ptr);
|
||||
}
|
||||
|
||||
static inline uint32_t load_u32le(const void* ptr) {
|
||||
#if defined(__ARM_ARCH_7A__) || defined(__aarch64__)
|
||||
return *((const uint32_t*) ptr);
|
||||
#else
|
||||
return ((uint32_t) ((const uint8_t*) ptr)[3] << 24) | load_u24le(ptr);
|
||||
#endif
|
||||
const uint8_t* byte_ptr = (const uint8_t*) ptr;
|
||||
return ((uint32_t) byte_ptr[3] << 24) | ((uint32_t) byte_ptr[2] << 16) | ((uint32_t) byte_ptr[1] << 8) | (uint32_t) byte_ptr[0];
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -96,6 +84,7 @@ static enum cpuinfo_arm_chipset_vendor chipset_series_vendor[cpuinfo_arm_chipset
|
||||
[cpuinfo_arm_chipset_series_spreadtrum_sc] = cpuinfo_arm_chipset_vendor_spreadtrum,
|
||||
[cpuinfo_arm_chipset_series_telechips_tcc] = cpuinfo_arm_chipset_vendor_telechips,
|
||||
[cpuinfo_arm_chipset_series_texas_instruments_omap] = cpuinfo_arm_chipset_vendor_texas_instruments,
|
||||
[cpuinfo_arm_chipset_series_unisoc_t] = cpuinfo_arm_chipset_vendor_unisoc,
|
||||
[cpuinfo_arm_chipset_series_wondermedia_wm] = cpuinfo_arm_chipset_vendor_wondermedia,
|
||||
};
|
||||
|
||||
@@ -877,6 +866,63 @@ static bool match_sc(
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Tries to match, case-sentitively, /Unisoc T\d{3,4}/ signature for Unisoc T chipset.
|
||||
* If match successful, extracts model information into \p chipset argument.
|
||||
*
|
||||
* @param start - start of the platform identifier (/proc/cpuinfo Hardware string, ro.product.board,
|
||||
* ro.board.platform, or ro.chipname) to match.
|
||||
* @param end - end of the platform identifier (/proc/cpuinfo Hardware string, ro.product.board,
|
||||
* ro.board.platform, or ro.chipname) to match.
|
||||
* @param[out] chipset - location where chipset information will be stored upon a successful match.
|
||||
*
|
||||
* @returns true if signature matched, false otherwise.
|
||||
*/
|
||||
static bool match_t(
|
||||
const char* start, const char* end,
|
||||
struct cpuinfo_arm_chipset chipset[restrict static 1])
|
||||
{
|
||||
/* Expect 11-12 symbols: "Unisoc T" (8 symbols) + 3-4-digit model number */
|
||||
const size_t length = end - start;
|
||||
switch (length) {
|
||||
case 11:
|
||||
case 12:
|
||||
break;
|
||||
default:
|
||||
return false;
|
||||
}
|
||||
|
||||
/* Check that string starts with "Unisoc T". The first four characters are loaded as 32-bit little endian word */
|
||||
const uint32_t expected_unis = load_u32le(start);
|
||||
if (expected_unis != UINT32_C(0x73696E55) /* "sinU" = reverse("Unis") */) {
|
||||
return false;
|
||||
}
|
||||
|
||||
/* The next four characters are loaded as 32-bit little endian word */
|
||||
const uint32_t expected_oc_t = load_u32le(start + 4);
|
||||
if (expected_oc_t != UINT32_C(0x5420636F) /* "T co" = reverse("oc T") */) {
|
||||
return false;
|
||||
}
|
||||
|
||||
/* Validate and parse 3-4 digit model number */
|
||||
uint32_t model = 0;
|
||||
for (uint32_t i = 8; i < length; i++) {
|
||||
const uint32_t digit = (uint32_t) (uint8_t) start[i] - '0';
|
||||
if (digit >= 10) {
|
||||
/* Not really a digit */
|
||||
return false;
|
||||
}
|
||||
model = model * 10 + digit;
|
||||
}
|
||||
|
||||
*chipset = (struct cpuinfo_arm_chipset) {
|
||||
.vendor = cpuinfo_arm_chipset_vendor_unisoc,
|
||||
.series = cpuinfo_arm_chipset_series_unisoc_t,
|
||||
.model = model,
|
||||
};
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Tries to match /lc\d{4}[a-z]?$/ signature for Leadcore LC chipsets.
|
||||
* If match successful, extracts model information into \p chipset argument.
|
||||
@@ -891,7 +937,7 @@ static bool match_lc(
|
||||
const char* start, const char* end,
|
||||
struct cpuinfo_arm_chipset chipset[restrict static 1])
|
||||
{
|
||||
/* Expect at 6-7 symbols: "lc" (2 symbols) + 4-digit model number + optional 1-letter suffix */
|
||||
/* Expect 6-7 symbols: "lc" (2 symbols) + 4-digit model number + optional 1-letter suffix */
|
||||
const size_t length = end - start;
|
||||
switch (length) {
|
||||
case 6:
|
||||
@@ -1351,7 +1397,7 @@ static bool match_and_parse_sunxi(
|
||||
return false;
|
||||
}
|
||||
|
||||
/* Compare sunXi platform id and number of cores to tabluted values to decode chipset name */
|
||||
/* Compare sunXi platform id and number of cores to tabulated values to decode chipset name */
|
||||
uint32_t model = 0;
|
||||
char suffix = 0;
|
||||
for (size_t i = 0; i < CPUINFO_COUNT_OF(sunxi_map_entries); i++) {
|
||||
@@ -2354,6 +2400,16 @@ struct cpuinfo_arm_chipset cpuinfo_arm_linux_decode_chipset_from_proc_cpuinfo_ha
|
||||
cpuinfo_log_debug(
|
||||
"matched Spreadtrum SC signature in /proc/cpuinfo Hardware string \"%.*s\"",
|
||||
(int) hardware_length, hardware);
|
||||
|
||||
return chipset;
|
||||
}
|
||||
|
||||
/* Check Unisoc T signature */
|
||||
if (match_t(hardware, hardware_end, &chipset)) {
|
||||
cpuinfo_log_debug(
|
||||
"matched Unisoc T signature in /proc/cpuinfo Hardware string \"%.*s\"",
|
||||
(int) hardware_length, hardware);
|
||||
|
||||
return chipset;
|
||||
}
|
||||
|
||||
@@ -3417,6 +3473,7 @@ static const char* chipset_vendor_string[cpuinfo_arm_chipset_vendor_max] = {
|
||||
[cpuinfo_arm_chipset_vendor_spreadtrum] = "Spreadtrum",
|
||||
[cpuinfo_arm_chipset_vendor_telechips] = "Telechips",
|
||||
[cpuinfo_arm_chipset_vendor_texas_instruments] = "Texas Instruments",
|
||||
[cpuinfo_arm_chipset_vendor_unisoc] = "Unisoc",
|
||||
[cpuinfo_arm_chipset_vendor_wondermedia] = "WonderMedia",
|
||||
};
|
||||
|
||||
@@ -3451,6 +3508,7 @@ static const char* chipset_series_string[cpuinfo_arm_chipset_series_max] = {
|
||||
[cpuinfo_arm_chipset_series_spreadtrum_sc] = "SC",
|
||||
[cpuinfo_arm_chipset_series_telechips_tcc] = "TCC",
|
||||
[cpuinfo_arm_chipset_series_texas_instruments_omap] = "OMAP",
|
||||
[cpuinfo_arm_chipset_series_unisoc_t] = "T",
|
||||
[cpuinfo_arm_chipset_series_wondermedia_wm] = "WM",
|
||||
};
|
||||
|
||||
@@ -3484,7 +3542,7 @@ void cpuinfo_arm_chipset_to_string(
|
||||
}
|
||||
}
|
||||
|
||||
#ifdef __ANDROID__
|
||||
#if defined(__ANDROID__)
|
||||
static inline struct cpuinfo_arm_chipset disambiguate_qualcomm_chipset(
|
||||
const struct cpuinfo_arm_chipset proc_cpuinfo_hardware_chipset[restrict static 1],
|
||||
const struct cpuinfo_arm_chipset ro_product_board_chipset[restrict static 1],
|
||||
@@ -3776,7 +3834,7 @@ void cpuinfo_arm_chipset_to_string(
|
||||
*/
|
||||
void cpuinfo_arm_fixup_raspberry_pi_chipset(
|
||||
struct cpuinfo_arm_chipset chipset[restrict static 1],
|
||||
const char revision[restrict static CPUINFO_HARDWARE_VALUE_MAX])
|
||||
const char revision[restrict static CPUINFO_REVISION_VALUE_MAX])
|
||||
{
|
||||
const size_t revision_length = strnlen(revision, CPUINFO_REVISION_VALUE_MAX);
|
||||
|
||||
|
||||
20
3rdparty/cpuinfo/src/arm/linux/clusters.c
vendored
20
3rdparty/cpuinfo/src/arm/linux/clusters.c
vendored
@@ -48,7 +48,7 @@ static inline bool bitmask_all(uint32_t bitfield, uint32_t mask) {
|
||||
* @param usable_processors - number of processors in the @p processors array with CPUINFO_LINUX_FLAG_VALID flags.
|
||||
* @param max_processors - number of elements in the @p processors array.
|
||||
* @param[in,out] processors - processor descriptors with pre-parsed POSSIBLE and PRESENT flags, minimum/maximum
|
||||
* frequency, MIDR infromation, and core cluster (package siblings list) information.
|
||||
* frequency, MIDR information, and core cluster (package siblings list) information.
|
||||
*
|
||||
* @retval true if the heuristic successfully assigned all processors into clusters of cores.
|
||||
* @retval false if known details about processors contradict the heuristic configuration of core clusters.
|
||||
@@ -292,9 +292,9 @@ bool cpuinfo_arm_linux_detect_core_clusters_by_heuristic(
|
||||
* - Processors assigned to these clusters stay assigned to the same clusters
|
||||
* - No new processors are added to these clusters
|
||||
* - Processors without pre-assigned cluster are clustered in one sequential scan:
|
||||
* - If known details (min/max frequency, MIDR components) of a processor are compatible with a preceeding
|
||||
* processor, without pre-assigned cluster, the processor is assigned to the cluster of the preceeding processor.
|
||||
* - If known details (min/max frequency, MIDR components) of a processor are not compatible with a preceeding
|
||||
* - If known details (min/max frequency, MIDR components) of a processor are compatible with a preceding
|
||||
* processor, without pre-assigned cluster, the processor is assigned to the cluster of the preceding processor.
|
||||
* - If known details (min/max frequency, MIDR components) of a processor are not compatible with a preceding
|
||||
* processor, the processor is assigned to a newly created cluster.
|
||||
*
|
||||
* The function must be called after parsing OS-provided information on core clusters, and usually is called only
|
||||
@@ -309,7 +309,7 @@ bool cpuinfo_arm_linux_detect_core_clusters_by_heuristic(
|
||||
*
|
||||
* @param max_processors - number of elements in the @p processors array.
|
||||
* @param[in,out] processors - processor descriptors with pre-parsed POSSIBLE and PRESENT flags, minimum/maximum
|
||||
* frequency, MIDR infromation, and core cluster (package siblings list) information.
|
||||
* frequency, MIDR information, and core cluster (package siblings list) information.
|
||||
*
|
||||
* @retval true if the heuristic successfully assigned all processors into clusters of cores.
|
||||
* @retval false if known details about processors contradict the heuristic configuration of core clusters.
|
||||
@@ -331,7 +331,7 @@ void cpuinfo_arm_linux_detect_core_clusters_by_sequential_scan(
|
||||
if (cluster_flags & CPUINFO_LINUX_FLAG_MIN_FREQUENCY) {
|
||||
if (cluster_min_frequency != processors[i].min_frequency) {
|
||||
cpuinfo_log_info(
|
||||
"minimum frequency of processor %"PRIu32" (%"PRIu32" KHz) is different than of preceeding cluster (%"PRIu32" KHz); "
|
||||
"minimum frequency of processor %"PRIu32" (%"PRIu32" KHz) is different than of preceding cluster (%"PRIu32" KHz); "
|
||||
"processor %"PRIu32" starts to a new cluster",
|
||||
i, processors[i].min_frequency, cluster_min_frequency, i);
|
||||
goto new_cluster;
|
||||
@@ -346,7 +346,7 @@ void cpuinfo_arm_linux_detect_core_clusters_by_sequential_scan(
|
||||
if (cluster_flags & CPUINFO_LINUX_FLAG_MAX_FREQUENCY) {
|
||||
if (cluster_max_frequency != processors[i].max_frequency) {
|
||||
cpuinfo_log_debug(
|
||||
"maximum frequency of processor %"PRIu32" (%"PRIu32" KHz) is different than of preceeding cluster (%"PRIu32" KHz); "
|
||||
"maximum frequency of processor %"PRIu32" (%"PRIu32" KHz) is different than of preceding cluster (%"PRIu32" KHz); "
|
||||
"processor %"PRIu32" starts a new cluster",
|
||||
i, processors[i].max_frequency, cluster_max_frequency, i);
|
||||
goto new_cluster;
|
||||
@@ -361,7 +361,7 @@ void cpuinfo_arm_linux_detect_core_clusters_by_sequential_scan(
|
||||
if (cluster_flags & CPUINFO_ARM_LINUX_VALID_IMPLEMENTER) {
|
||||
if ((cluster_midr & CPUINFO_ARM_MIDR_IMPLEMENTER_MASK) != (processors[i].midr & CPUINFO_ARM_MIDR_IMPLEMENTER_MASK)) {
|
||||
cpuinfo_log_debug(
|
||||
"CPU Implementer of processor %"PRIu32" (0x%02"PRIx32") is different than of preceeding cluster (0x%02"PRIx32"); "
|
||||
"CPU Implementer of processor %"PRIu32" (0x%02"PRIx32") is different than of preceding cluster (0x%02"PRIx32"); "
|
||||
"processor %"PRIu32" starts to a new cluster",
|
||||
i, midr_get_implementer(processors[i].midr), midr_get_implementer(cluster_midr), i);
|
||||
goto new_cluster;
|
||||
@@ -417,11 +417,11 @@ void cpuinfo_arm_linux_detect_core_clusters_by_sequential_scan(
|
||||
}
|
||||
}
|
||||
|
||||
/* All checks passed, attach processor to the preceeding cluster */
|
||||
/* All checks passed, attach processor to the preceding cluster */
|
||||
cluster_processors++;
|
||||
processors[i].package_leader_id = cluster_start;
|
||||
processors[i].flags |= CPUINFO_LINUX_FLAG_PACKAGE_CLUSTER;
|
||||
cpuinfo_log_debug("assigned processor %"PRIu32" to preceeding cluster of processor %"PRIu32, i, cluster_start);
|
||||
cpuinfo_log_debug("assigned processor %"PRIu32" to preceding cluster of processor %"PRIu32, i, cluster_start);
|
||||
continue;
|
||||
|
||||
new_cluster:
|
||||
|
||||
18
3rdparty/cpuinfo/src/arm/linux/cp.h
vendored
18
3rdparty/cpuinfo/src/arm/linux/cp.h
vendored
@@ -35,10 +35,16 @@
|
||||
return mvfr0;
|
||||
}
|
||||
#endif
|
||||
|
||||
static inline uint32_t read_wcid(void) {
|
||||
uint32_t wcid;
|
||||
__asm__ __volatile__("MRC p1, 0, %[wcid], c0, c0" : [wcid] "=r" (wcid));
|
||||
return wcid;
|
||||
}
|
||||
#if !defined(__ARM_ARCH_8A__) && !(defined(__ARM_ARCH) && (__ARM_ARCH >= 8))
|
||||
/*
|
||||
* In ARMv8, AArch32 state supports only conceptual coprocessors CP10, CP11, CP14, and CP15.
|
||||
* AArch64 does not support the concept of coprocessors.
|
||||
* and clang refuses to compile inline assembly when targeting ARMv8+
|
||||
*/
|
||||
static inline uint32_t read_wcid(void) {
|
||||
uint32_t wcid;
|
||||
__asm__ __volatile__("MRC p1, 0, %[wcid], c0, c0" : [wcid] "=r" (wcid));
|
||||
return wcid;
|
||||
}
|
||||
#endif
|
||||
#endif
|
||||
|
||||
9
3rdparty/cpuinfo/src/arm/linux/cpuinfo.c
vendored
9
3rdparty/cpuinfo/src/arm/linux/cpuinfo.c
vendored
@@ -177,6 +177,10 @@ static void parse_features(
|
||||
#if CPUINFO_ARCH_ARM64
|
||||
processor->features |= CPUINFO_ARM_LINUX_FEATURE_FCMA;
|
||||
#endif
|
||||
} else if (memcmp(feature_start, "i8mm", feature_length) == 0) {
|
||||
#if CPUINFO_ARCH_ARM64
|
||||
processor->features2 |= CPUINFO_ARM_LINUX_FEATURE2_I8MM;
|
||||
#endif
|
||||
#if CPUINFO_ARCH_ARM
|
||||
} else if (memcmp(feature_start, "half", feature_length) == 0) {
|
||||
processor->features |= CPUINFO_ARM_LINUX_FEATURE_HALF;
|
||||
@@ -283,6 +287,10 @@ static void parse_features(
|
||||
#if CPUINFO_ARCH_ARM64
|
||||
processor->features |= CPUINFO_ARM_LINUX_FEATURE_ASIMDRDM;
|
||||
#endif
|
||||
} else if (memcmp(feature_start, "asimdfhm", feature_length) == 0) {
|
||||
#if CPUINFO_ARCH_ARM64
|
||||
processor->features |= CPUINFO_ARM_LINUX_FEATURE_ASIMDFHM;
|
||||
#endif
|
||||
#if CPUINFO_ARCH_ARM
|
||||
} else if (memcmp(feature_start, "fastmult", feature_length) == 0) {
|
||||
processor->features |= CPUINFO_ARM_LINUX_FEATURE_FASTMULT;
|
||||
@@ -896,6 +904,7 @@ bool cpuinfo_arm_linux_parse_proc_cpuinfo(
|
||||
uint32_t max_processors_count,
|
||||
struct cpuinfo_arm_linux_processor processors[restrict static max_processors_count])
|
||||
{
|
||||
hardware[0] = '\0';
|
||||
struct proc_cpuinfo_parser_state state = {
|
||||
.hardware = hardware,
|
||||
.revision = revision,
|
||||
|
||||
10
3rdparty/cpuinfo/src/arm/linux/hwcap.c
vendored
10
3rdparty/cpuinfo/src/arm/linux/hwcap.c
vendored
@@ -1,3 +1,4 @@
|
||||
#include <limits.h>
|
||||
#include <string.h>
|
||||
|
||||
#include <unistd.h>
|
||||
@@ -15,7 +16,8 @@
|
||||
#include <arm/linux/api.h>
|
||||
#include <cpuinfo/log.h>
|
||||
|
||||
#if CPUINFO_ARCH_ARM64 || CPUINFO_ARCH_ARM && !defined(__ANDROID__)
|
||||
#if CPUINFO_ARCH_ARM64 || CPUINFO_ARCH_ARM && \
|
||||
defined(__GLIBC__) && defined(__GLIBC_MINOR__) && (__GLIBC__ > 2 || __GLIBC__ == 2 && __GLIBC_MINOR__ >= 16)
|
||||
#include <sys/auxv.h>
|
||||
#else
|
||||
#define AT_HWCAP 16
|
||||
@@ -74,11 +76,13 @@
|
||||
libc = NULL;
|
||||
}
|
||||
return getauxval != NULL;
|
||||
#else
|
||||
/* GNU/Linux: getauxval is always supported */
|
||||
#elif defined(__GLIBC__) && defined(__GLIBC_MINOR__) && (__GLIBC__ > 2 || __GLIBC__ == 2 && __GLIBC_MINOR__ >= 16)
|
||||
/* GNU/Linux: getauxval is supported since glibc-2.16 */
|
||||
*hwcap = getauxval(AT_HWCAP);
|
||||
*hwcap2 = getauxval(AT_HWCAP2);
|
||||
return true;
|
||||
#else
|
||||
return false;
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
12
3rdparty/cpuinfo/src/arm/linux/init.c
vendored
12
3rdparty/cpuinfo/src/arm/linux/init.c
vendored
@@ -199,9 +199,13 @@ void cpuinfo_arm_linux_init(void) {
|
||||
for (uint32_t i = 0; i < arm_linux_processors_count; i++) {
|
||||
arm_linux_processors[i].system_processor_id = i;
|
||||
if (bitmask_all(arm_linux_processors[i].flags, CPUINFO_LINUX_FLAG_VALID)) {
|
||||
valid_processors += 1;
|
||||
|
||||
if (!(arm_linux_processors[i].flags & CPUINFO_ARM_LINUX_VALID_PROCESSOR)) {
|
||||
if (arm_linux_processors[i].flags & CPUINFO_ARM_LINUX_VALID_PROCESSOR) {
|
||||
/*
|
||||
* Processor is in possible and present lists, and also reported in /proc/cpuinfo.
|
||||
* This processor is availble for compute.
|
||||
*/
|
||||
valid_processors += 1;
|
||||
} else {
|
||||
/*
|
||||
* Processor is in possible and present lists, but not reported in /proc/cpuinfo.
|
||||
* This is fairly common: high-index processors can be not reported if they are offline.
|
||||
@@ -510,7 +514,7 @@ void cpuinfo_arm_linux_init(void) {
|
||||
uint32_t l2_count = 0, l3_count = 0, big_l3_size = 0, cluster_id = UINT32_MAX;
|
||||
/* Indication whether L3 (if it exists) is shared between all cores */
|
||||
bool shared_l3 = true;
|
||||
/* Populate cache infromation structures in l1i, l1d */
|
||||
/* Populate cache information structures in l1i, l1d */
|
||||
for (uint32_t i = 0; i < valid_processors; i++) {
|
||||
if (arm_linux_processors[i].package_leader_id == arm_linux_processors[i].system_processor_id) {
|
||||
cluster_id += 1;
|
||||
|
||||
6
3rdparty/cpuinfo/src/arm/linux/midr.c
vendored
6
3rdparty/cpuinfo/src/arm/linux/midr.c
vendored
@@ -675,10 +675,10 @@ static bool cpuinfo_arm_linux_detect_cluster_midr_by_big_little_heuristic(
|
||||
|
||||
/*
|
||||
* Initializes MIDR for leaders of core clusters in a single sequential scan:
|
||||
* - Clusters preceeding the first reported MIDR value are assumed to have default MIDR value.
|
||||
* - Clusters preceding the first reported MIDR value are assumed to have default MIDR value.
|
||||
* - Clusters following any reported MIDR value to have that MIDR value.
|
||||
*
|
||||
* @param default_midr - MIDR value that will be assigned to cluster leaders preceeding any reported MIDR value.
|
||||
* @param default_midr - MIDR value that will be assigned to cluster leaders preceding any reported MIDR value.
|
||||
* @param processors_count - number of logical processor descriptions in the @p processors array.
|
||||
* @param[in,out] processors - array of logical processor descriptions with pre-parsed MIDR, maximum frequency,
|
||||
* and decoded core cluster (package_leader_id) information.
|
||||
@@ -833,7 +833,7 @@ uint32_t cpuinfo_arm_linux_detect_cluster_midr(
|
||||
* 2. For systems with 2 clusters and MIDR known for one cluster, assume big.LITTLE configuration,
|
||||
* and estimate MIDR for the other cluster under assumption that MIDR for the big cluster is known.
|
||||
* 3. Initialize MIDRs for core clusters in a single sequential scan:
|
||||
* - Clusters preceeding the first reported MIDR value are assumed to have the last reported MIDR value.
|
||||
* - Clusters preceding the first reported MIDR value are assumed to have the last reported MIDR value.
|
||||
* - Clusters following any reported MIDR value to have that MIDR value.
|
||||
*/
|
||||
|
||||
|
||||
223
3rdparty/cpuinfo/src/arm/mach/init.c
vendored
223
3rdparty/cpuinfo/src/arm/mach/init.c
vendored
@@ -15,43 +15,25 @@
|
||||
#include <cpuinfo/log.h>
|
||||
|
||||
/* Polyfill recent CPUFAMILY_ARM_* values for older SDKs */
|
||||
#ifndef CPUFAMILY_ARM_MONSOON_MISTRAL
|
||||
#define CPUFAMILY_ARM_MONSOON_MISTRAL 0xE81E7EF6
|
||||
#endif
|
||||
#ifndef CPUFAMILY_ARM_VORTEX_TEMPEST
|
||||
#define CPUFAMILY_ARM_VORTEX_TEMPEST 0x07D34B9F
|
||||
#define CPUFAMILY_ARM_VORTEX_TEMPEST 0x07D34B9F
|
||||
#endif
|
||||
#ifndef CPUFAMILY_ARM_LIGHTNING_THUNDER
|
||||
#define CPUFAMILY_ARM_LIGHTNING_THUNDER 0x462504D2
|
||||
#define CPUFAMILY_ARM_LIGHTNING_THUNDER 0x462504D2
|
||||
#endif
|
||||
#ifndef CPUFAMILY_ARM_FIRESTORM_ICESTORM
|
||||
#define CPUFAMILY_ARM_FIRESTORM_ICESTORM 0x1B588BB3
|
||||
#endif
|
||||
#ifndef CPUFAMILY_ARM_AVALANCHE_BLIZZARD
|
||||
#define CPUFAMILY_ARM_AVALANCHE_BLIZZARD 0xDA33D83D
|
||||
#endif
|
||||
|
||||
struct cpuinfo_arm_isa cpuinfo_isa = {
|
||||
#if CPUINFO_ARCH_ARM
|
||||
.thumb = true,
|
||||
.thumb2 = true,
|
||||
.thumbee = false,
|
||||
.jazelle = false,
|
||||
.armv5e = true,
|
||||
.armv6 = true,
|
||||
.armv6k = true,
|
||||
.armv7 = true,
|
||||
.vfpv2 = false,
|
||||
.vfpv3 = true,
|
||||
.d32 = true,
|
||||
.wmmx = false,
|
||||
.wmmx2 = false,
|
||||
.neon = true,
|
||||
#endif
|
||||
#if CPUINFO_ARCH_ARM64
|
||||
.aes = true,
|
||||
.sha1 = true,
|
||||
.sha2 = true,
|
||||
.pmull = true,
|
||||
.crc32 = true,
|
||||
#endif
|
||||
};
|
||||
|
||||
static uint32_t get_sys_info(int type_specifier, const char* name) {
|
||||
@@ -83,10 +65,8 @@ static uint32_t get_sys_info_by_name(const char* type_specifier) {
|
||||
return result;
|
||||
}
|
||||
|
||||
static enum cpuinfo_uarch decode_uarch(uint32_t cpu_family, uint32_t cpu_subtype, uint32_t core_index, uint32_t core_count) {
|
||||
static enum cpuinfo_uarch decode_uarch(uint32_t cpu_family, uint32_t core_index, uint32_t core_count) {
|
||||
switch (cpu_family) {
|
||||
case CPUFAMILY_ARM_SWIFT:
|
||||
return cpuinfo_uarch_swift;
|
||||
case CPUFAMILY_ARM_CYCLONE:
|
||||
return cpuinfo_uarch_cyclone;
|
||||
case CPUFAMILY_ARM_TYPHOON:
|
||||
@@ -107,25 +87,15 @@ static enum cpuinfo_uarch decode_uarch(uint32_t cpu_family, uint32_t cpu_subtype
|
||||
case CPUFAMILY_ARM_FIRESTORM_ICESTORM:
|
||||
/* Hexa-core: 2x Firestorm + 4x Icestorm; Octa-core: 4x Firestorm + 4x Icestorm */
|
||||
return core_index + 4 < core_count ? cpuinfo_uarch_firestorm : cpuinfo_uarch_icestorm;
|
||||
case CPUFAMILY_ARM_AVALANCHE_BLIZZARD:
|
||||
/* Hexa-core: 2x Avalanche + 4x Blizzard */
|
||||
return core_index + 4 < core_count ? cpuinfo_uarch_avalanche : cpuinfo_uarch_blizzard;
|
||||
default:
|
||||
/* Use hw.cpusubtype for detection */
|
||||
break;
|
||||
}
|
||||
|
||||
#if CPUINFO_ARCH_ARM
|
||||
switch (cpu_subtype) {
|
||||
case CPU_SUBTYPE_ARM_V7:
|
||||
return cpuinfo_uarch_cortex_a8;
|
||||
case CPU_SUBTYPE_ARM_V7F:
|
||||
return cpuinfo_uarch_cortex_a9;
|
||||
case CPU_SUBTYPE_ARM_V7K:
|
||||
return cpuinfo_uarch_cortex_a7;
|
||||
default:
|
||||
return cpuinfo_uarch_unknown;
|
||||
}
|
||||
#else
|
||||
return cpuinfo_uarch_unknown;
|
||||
#endif
|
||||
return cpuinfo_uarch_unknown;
|
||||
}
|
||||
|
||||
static void decode_package_name(char* package_name) {
|
||||
@@ -299,71 +269,118 @@ void cpuinfo_arm_mach_init(void) {
|
||||
|
||||
|
||||
const uint32_t cpu_family = get_sys_info_by_name("hw.cpufamily");
|
||||
const uint32_t cpu_type = get_sys_info_by_name("hw.cputype");
|
||||
const uint32_t cpu_subtype = get_sys_info_by_name("hw.cpusubtype");
|
||||
switch (cpu_type) {
|
||||
case CPU_TYPE_ARM64:
|
||||
cpuinfo_isa.aes = true;
|
||||
cpuinfo_isa.sha1 = true;
|
||||
cpuinfo_isa.sha2 = true;
|
||||
cpuinfo_isa.pmull = true;
|
||||
cpuinfo_isa.crc32 = true;
|
||||
break;
|
||||
#if CPUINFO_ARCH_ARM
|
||||
case CPU_TYPE_ARM:
|
||||
switch (cpu_subtype) {
|
||||
case CPU_SUBTYPE_ARM_V8:
|
||||
cpuinfo_isa.armv8 = true;
|
||||
cpuinfo_isa.aes = true;
|
||||
cpuinfo_isa.sha1 = true;
|
||||
cpuinfo_isa.sha2 = true;
|
||||
cpuinfo_isa.pmull = true;
|
||||
cpuinfo_isa.crc32 = true;
|
||||
/* Fall-through to add ARMv7S features */
|
||||
case CPU_SUBTYPE_ARM_V7S:
|
||||
case CPU_SUBTYPE_ARM_V7K:
|
||||
cpuinfo_isa.fma = true;
|
||||
/* Fall-through to add ARMv7F features */
|
||||
case CPU_SUBTYPE_ARM_V7F:
|
||||
cpuinfo_isa.armv7mp = true;
|
||||
cpuinfo_isa.fp16 = true;
|
||||
/* Fall-through to add ARMv7 features */
|
||||
case CPU_SUBTYPE_ARM_V7:
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
break;
|
||||
#endif
|
||||
}
|
||||
/*
|
||||
* Support for ARMv8.1 Atomics & FP16 arithmetic instructions is supposed to be detected via
|
||||
* sysctlbyname calls with "hw.optional.armv8_1_atomics" and "hw.optional.neon_fp16" arguments
|
||||
* (see https://devstreaming-cdn.apple.com/videos/wwdc/2018/409t8zw7rumablsh/409/409_whats_new_in_llvm.pdf),
|
||||
* but on new iOS versions these calls just fail with EPERM.
|
||||
*
|
||||
* Thus, we whitelist CPUs known to support these instructions.
|
||||
*/
|
||||
switch (cpu_family) {
|
||||
case CPUFAMILY_ARM_MONSOON_MISTRAL:
|
||||
case CPUFAMILY_ARM_VORTEX_TEMPEST:
|
||||
case CPUFAMILY_ARM_LIGHTNING_THUNDER:
|
||||
case CPUFAMILY_ARM_FIRESTORM_ICESTORM:
|
||||
#if CPUINFO_ARCH_ARM64
|
||||
cpuinfo_isa.atomics = true;
|
||||
#endif
|
||||
cpuinfo_isa.fp16arith = true;
|
||||
}
|
||||
|
||||
/*
|
||||
* There does not yet seem to exist an OS mechanism to detect support for
|
||||
* ARMv8.2 optional dot-product instructions, so we currently whitelist CPUs
|
||||
* known to support these instruction.
|
||||
* iOS 15 and macOS 12 added sysctls for ARM features, use them where possible.
|
||||
* Otherwise, fallback to hardcoded set of CPUs with known support.
|
||||
*/
|
||||
switch (cpu_family) {
|
||||
case CPUFAMILY_ARM_LIGHTNING_THUNDER:
|
||||
case CPUFAMILY_ARM_FIRESTORM_ICESTORM:
|
||||
cpuinfo_isa.dot = true;
|
||||
const uint32_t has_feat_lse = get_sys_info_by_name("hw.optional.arm.FEAT_LSE");
|
||||
if (has_feat_lse != 0) {
|
||||
cpuinfo_isa.atomics = true;
|
||||
} else {
|
||||
// Mandatory in ARMv8.1-A, list only cores released before iOS 15 / macOS 12
|
||||
switch (cpu_family) {
|
||||
case CPUFAMILY_ARM_MONSOON_MISTRAL:
|
||||
case CPUFAMILY_ARM_VORTEX_TEMPEST:
|
||||
case CPUFAMILY_ARM_LIGHTNING_THUNDER:
|
||||
case CPUFAMILY_ARM_FIRESTORM_ICESTORM:
|
||||
cpuinfo_isa.atomics = true;
|
||||
}
|
||||
}
|
||||
|
||||
const uint32_t has_feat_rdm = get_sys_info_by_name("hw.optional.arm.FEAT_RDM");
|
||||
if (has_feat_rdm != 0) {
|
||||
cpuinfo_isa.rdm = true;
|
||||
} else {
|
||||
// Optional in ARMv8.2-A (implemented in Apple cores),
|
||||
// list only cores released before iOS 15 / macOS 12
|
||||
switch (cpu_family) {
|
||||
case CPUFAMILY_ARM_MONSOON_MISTRAL:
|
||||
case CPUFAMILY_ARM_VORTEX_TEMPEST:
|
||||
case CPUFAMILY_ARM_LIGHTNING_THUNDER:
|
||||
case CPUFAMILY_ARM_FIRESTORM_ICESTORM:
|
||||
cpuinfo_isa.rdm = true;
|
||||
}
|
||||
}
|
||||
|
||||
const uint32_t has_feat_fp16 = get_sys_info_by_name("hw.optional.arm.FEAT_FP16");
|
||||
if (has_feat_fp16 != 0) {
|
||||
cpuinfo_isa.fp16arith = true;
|
||||
} else {
|
||||
// Optional in ARMv8.2-A (implemented in Apple cores),
|
||||
// list only cores released before iOS 15 / macOS 12
|
||||
switch (cpu_family) {
|
||||
case CPUFAMILY_ARM_MONSOON_MISTRAL:
|
||||
case CPUFAMILY_ARM_VORTEX_TEMPEST:
|
||||
case CPUFAMILY_ARM_LIGHTNING_THUNDER:
|
||||
case CPUFAMILY_ARM_FIRESTORM_ICESTORM:
|
||||
cpuinfo_isa.fp16arith = true;
|
||||
}
|
||||
}
|
||||
|
||||
const uint32_t has_feat_fhm = get_sys_info_by_name("hw.optional.arm.FEAT_FHM");
|
||||
if (has_feat_fhm != 0) {
|
||||
cpuinfo_isa.fhm = true;
|
||||
} else {
|
||||
// Prior to iOS 15, use 'hw.optional.armv8_2_fhm'
|
||||
const uint32_t has_feat_fhm_legacy = get_sys_info_by_name("hw.optional.armv8_2_fhm");
|
||||
if (has_feat_fhm_legacy != 0) {
|
||||
cpuinfo_isa.fhm = true;
|
||||
} else {
|
||||
// Mandatory in ARMv8.4-A when FP16 arithmetics is implemented,
|
||||
// list only cores released before iOS 15 / macOS 12
|
||||
switch (cpu_family) {
|
||||
case CPUFAMILY_ARM_LIGHTNING_THUNDER:
|
||||
case CPUFAMILY_ARM_FIRESTORM_ICESTORM:
|
||||
cpuinfo_isa.fhm = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
const uint32_t has_feat_bf16 = get_sys_info_by_name("hw.optional.arm.FEAT_BF16");
|
||||
if (has_feat_bf16 != 0) {
|
||||
cpuinfo_isa.bf16 = true;
|
||||
}
|
||||
|
||||
const uint32_t has_feat_fcma = get_sys_info_by_name("hw.optional.arm.FEAT_FCMA");
|
||||
if (has_feat_fcma != 0) {
|
||||
cpuinfo_isa.fcma = true;
|
||||
} else {
|
||||
// Mandatory in ARMv8.3-A, list only cores released before iOS 15 / macOS 12
|
||||
switch (cpu_family) {
|
||||
case CPUFAMILY_ARM_LIGHTNING_THUNDER:
|
||||
case CPUFAMILY_ARM_FIRESTORM_ICESTORM:
|
||||
cpuinfo_isa.fcma = true;
|
||||
}
|
||||
}
|
||||
|
||||
const uint32_t has_feat_jscvt = get_sys_info_by_name("hw.optional.arm.FEAT_JSCVT");
|
||||
if (has_feat_jscvt != 0) {
|
||||
cpuinfo_isa.jscvt = true;
|
||||
} else {
|
||||
// Mandatory in ARMv8.3-A, list only cores released before iOS 15 / macOS 12
|
||||
switch (cpu_family) {
|
||||
case CPUFAMILY_ARM_LIGHTNING_THUNDER:
|
||||
case CPUFAMILY_ARM_FIRESTORM_ICESTORM:
|
||||
cpuinfo_isa.jscvt = true;
|
||||
}
|
||||
}
|
||||
|
||||
const uint32_t has_feat_dotprod = get_sys_info_by_name("hw.optional.arm.FEAT_DotProd");
|
||||
if (has_feat_dotprod != 0) {
|
||||
cpuinfo_isa.dot = true;
|
||||
} else {
|
||||
// Mandatory in ARMv8.4-A, list only cores released before iOS 15 / macOS 12
|
||||
switch (cpu_family) {
|
||||
case CPUFAMILY_ARM_LIGHTNING_THUNDER:
|
||||
case CPUFAMILY_ARM_FIRESTORM_ICESTORM:
|
||||
cpuinfo_isa.dot = true;
|
||||
}
|
||||
}
|
||||
|
||||
const uint32_t has_feat_i8mm = get_sys_info_by_name("hw.optional.arm.FEAT_I8MM");
|
||||
if (has_feat_i8mm != 0) {
|
||||
cpuinfo_isa.i8mm = true;
|
||||
}
|
||||
|
||||
uint32_t num_clusters = 1;
|
||||
@@ -374,7 +391,7 @@ void cpuinfo_arm_mach_init(void) {
|
||||
.core_id = i % cores_per_package,
|
||||
.package = packages + i / cores_per_package,
|
||||
.vendor = cpuinfo_vendor_apple,
|
||||
.uarch = decode_uarch(cpu_family, cpu_subtype, i, mach_topology.cores),
|
||||
.uarch = decode_uarch(cpu_family, i, mach_topology.cores),
|
||||
};
|
||||
if (i != 0 && cores[i].uarch != cores[i - 1].uarch) {
|
||||
num_clusters++;
|
||||
|
||||
35
3rdparty/cpuinfo/src/arm/midr.h
vendored
35
3rdparty/cpuinfo/src/arm/midr.h
vendored
@@ -174,23 +174,27 @@ inline static uint32_t midr_score_core(uint32_t midr) {
|
||||
case UINT32_C(0x53000030): /* Exynos M4 */
|
||||
case UINT32_C(0x53000040): /* Exynos M5 */
|
||||
case UINT32_C(0x4100D440): /* Cortex-X1 */
|
||||
/* These cores are in big role w.r.t Cortex-A75/-A76/-A77/-A78 */
|
||||
case UINT32_C(0x4100D480): /* Cortex-X2 */
|
||||
case UINT32_C(0x4100D4E0): /* Cortex-X3 */
|
||||
/* These cores are in big role w.r.t Cortex-A75/-A76/-A77/-A78/-A710/-A715 */
|
||||
return 6;
|
||||
case UINT32_C(0x4E000030): /* Denver 2 */
|
||||
case UINT32_C(0x53000010): /* Exynos M1 and Exynos M2 */
|
||||
case UINT32_C(0x53000020): /* Exynos M3 */
|
||||
case UINT32_C(0x51008040): /* Kryo 485 Gold / Gold Prime */
|
||||
case UINT32_C(0x51008020): /* Kryo 385 Gold */
|
||||
case UINT32_C(0x51008000): /* Kryo 260 / 280 Gold */
|
||||
case UINT32_C(0x51002050): /* Kryo Gold */
|
||||
case UINT32_C(0x4800D400): /* Cortex-A76 (HiSilicon) */
|
||||
case UINT32_C(0x4100D410): /* Cortex-A78 */
|
||||
case UINT32_C(0x4100D080): /* Cortex-A72 */
|
||||
case UINT32_C(0x4100D090): /* Cortex-A73 */
|
||||
case UINT32_C(0x4100D0A0): /* Cortex-A75 */
|
||||
case UINT32_C(0x4100D0B0): /* Cortex-A76 */
|
||||
case UINT32_C(0x4100D0D0): /* Cortex-A77 */
|
||||
case UINT32_C(0x4100D0E0): /* Cortex-A76AE */
|
||||
case UINT32_C(0x4100D0B0): /* Cortex-A76 */
|
||||
case UINT32_C(0x4100D0A0): /* Cortex-A75 */
|
||||
case UINT32_C(0x4100D090): /* Cortex-A73 */
|
||||
case UINT32_C(0x4100D080): /* Cortex-A72 */
|
||||
case UINT32_C(0x4100D410): /* Cortex-A78 */
|
||||
case UINT32_C(0x4100D470): /* Cortex-A710 */
|
||||
case UINT32_C(0x4100D4D0): /* Cortex-A715 */
|
||||
case UINT32_C(0x4800D400): /* Cortex-A76 (HiSilicon) */
|
||||
case UINT32_C(0x4E000030): /* Denver 2 */
|
||||
case UINT32_C(0x51002050): /* Kryo Gold */
|
||||
case UINT32_C(0x51008000): /* Kryo 260 / 280 Gold */
|
||||
case UINT32_C(0x51008020): /* Kryo 385 Gold */
|
||||
case UINT32_C(0x51008040): /* Kryo 485 Gold / Gold Prime */
|
||||
case UINT32_C(0x53000010): /* Exynos M1 and Exynos M2 */
|
||||
case UINT32_C(0x53000020): /* Exynos M3 */
|
||||
#if CPUINFO_ARCH_ARM
|
||||
case UINT32_C(0x4100C0F0): /* Cortex-A15 */
|
||||
case UINT32_C(0x4100C0E0): /* Cortex-A17 */
|
||||
@@ -205,8 +209,9 @@ inline static uint32_t midr_score_core(uint32_t midr) {
|
||||
#if CPUINFO_ARCH_ARM64
|
||||
case UINT32_C(0x4100D060): /* Cortex-A65 */
|
||||
#endif /* CPUINFO_ARCH_ARM64 */
|
||||
case UINT32_C(0x4100D050): /* Cortex-A55 */
|
||||
case UINT32_C(0x4100D030): /* Cortex-A53 */
|
||||
case UINT32_C(0x4100D050): /* Cortex-A55 */
|
||||
case UINT32_C(0x4100D460): /* Cortex-A510 */
|
||||
/* Cortex-A53 is usually in LITTLE role, but can be in big role w.r.t. Cortex-A35 */
|
||||
return 2;
|
||||
case UINT32_C(0x4100D040): /* Cortex-A35 */
|
||||
|
||||
48
3rdparty/cpuinfo/src/arm/uarch.c
vendored
48
3rdparty/cpuinfo/src/arm/uarch.c
vendored
@@ -80,28 +80,50 @@ void cpuinfo_arm_decode_vendor_uarch(
|
||||
case 0xD0B:
|
||||
*uarch = cpuinfo_uarch_cortex_a76;
|
||||
break;
|
||||
#if CPUINFO_ARCH_ARM64 && !defined(__ANDROID__)
|
||||
case 0xD0C:
|
||||
*uarch = cpuinfo_uarch_neoverse_n1;
|
||||
break;
|
||||
#endif /* CPUINFO_ARCH_ARM64 && !defined(__ANDROID__) */
|
||||
case 0xD0D:
|
||||
*uarch = cpuinfo_uarch_cortex_a77;
|
||||
break;
|
||||
case 0xD0E: /* Cortex-A76AE */
|
||||
*uarch = cpuinfo_uarch_cortex_a76;
|
||||
break;
|
||||
case 0xD40: /* Neoverse V1 */
|
||||
*uarch = cpuinfo_uarch_neoverse_v1;
|
||||
break;
|
||||
case 0xD41: /* Cortex-A78 */
|
||||
*uarch = cpuinfo_uarch_cortex_a78;
|
||||
break;
|
||||
case 0xD44: /* Cortex-X1 */
|
||||
*uarch = cpuinfo_uarch_cortex_x1;
|
||||
break;
|
||||
#if CPUINFO_ARCH_ARM64 && !defined(__ANDROID__)
|
||||
case 0xD46: /* Cortex-A510 */
|
||||
*uarch = cpuinfo_uarch_cortex_a510;
|
||||
break;
|
||||
case 0xD47: /* Cortex-A710 */
|
||||
*uarch = cpuinfo_uarch_cortex_a710;
|
||||
break;
|
||||
case 0xD48: /* Cortex-X2 */
|
||||
*uarch = cpuinfo_uarch_cortex_x2;
|
||||
break;
|
||||
case 0xD49: /* Neoverse N2 */
|
||||
*uarch = cpuinfo_uarch_neoverse_n2;
|
||||
break;
|
||||
#if CPUINFO_ARCH_ARM64
|
||||
case 0xD4A:
|
||||
*uarch = cpuinfo_uarch_neoverse_e1;
|
||||
break;
|
||||
#endif /* CPUINFO_ARCH_ARM64 && !defined(__ANDROID__) */
|
||||
#endif /* CPUINFO_ARCH_ARM64 */
|
||||
case 0xD4D: /* Cortex-A715 */
|
||||
*uarch = cpuinfo_uarch_cortex_a715;
|
||||
break;
|
||||
case 0xD4E: /* Cortex-X3 */
|
||||
*uarch = cpuinfo_uarch_cortex_x3;
|
||||
break;
|
||||
case 0xD4F: /* Neoverse V2 */
|
||||
*uarch = cpuinfo_uarch_neoverse_v2;
|
||||
break;
|
||||
default:
|
||||
switch (midr_get_part(midr) >> 8) {
|
||||
#if CPUINFO_ARCH_ARM
|
||||
@@ -129,18 +151,18 @@ void cpuinfo_arm_decode_vendor_uarch(
|
||||
case 0x100:
|
||||
*uarch = cpuinfo_uarch_brahma_b53;
|
||||
break;
|
||||
#if CPUINFO_ARCH_ARM64 && !defined(__ANDROID__)
|
||||
#if CPUINFO_ARCH_ARM64
|
||||
case 0x516:
|
||||
/* Broadcom Vulkan was sold to Cavium before it reached the market, so we identify it as Cavium ThunderX2 */
|
||||
*vendor = cpuinfo_vendor_cavium;
|
||||
*uarch = cpuinfo_uarch_thunderx2;
|
||||
break;
|
||||
#endif
|
||||
#endif /* CPUINFO_ARCH_ARM64 */
|
||||
default:
|
||||
cpuinfo_log_warning("unknown Broadcom CPU part 0x%03"PRIx32" ignored", midr_get_part(midr));
|
||||
}
|
||||
break;
|
||||
#if CPUINFO_ARCH_ARM64 && !defined(__ANDROID__)
|
||||
#if CPUINFO_ARCH_ARM64
|
||||
case 'C':
|
||||
*vendor = cpuinfo_vendor_cavium;
|
||||
switch (midr_get_part(midr)) {
|
||||
@@ -157,15 +179,15 @@ void cpuinfo_arm_decode_vendor_uarch(
|
||||
cpuinfo_log_warning("unknown Cavium CPU part 0x%03"PRIx32" ignored", midr_get_part(midr));
|
||||
}
|
||||
break;
|
||||
#endif
|
||||
#endif /* CPUINFO_ARCH_ARM64 */
|
||||
case 'H':
|
||||
*vendor = cpuinfo_vendor_huawei;
|
||||
switch (midr_get_part(midr)) {
|
||||
#if CPUINFO_ARCH_ARM64 && !defined(__ANDROID__)
|
||||
#if CPUINFO_ARCH_ARM64
|
||||
case 0xD01: /* Kunpeng 920 series */
|
||||
*uarch = cpuinfo_uarch_taishan_v110;
|
||||
break;
|
||||
#endif
|
||||
#endif /* CPUINFO_ARCH_ARM64 */
|
||||
case 0xD40: /* Kirin 980 Big/Medium cores -> Cortex-A76 */
|
||||
*vendor = cpuinfo_vendor_arm;
|
||||
*uarch = cpuinfo_uarch_cortex_a76;
|
||||
@@ -204,7 +226,6 @@ void cpuinfo_arm_decode_vendor_uarch(
|
||||
cpuinfo_log_warning("unknown Nvidia CPU part 0x%03"PRIx32" ignored", midr_get_part(midr));
|
||||
}
|
||||
break;
|
||||
#if !defined(__ANDROID__)
|
||||
case 'P':
|
||||
*vendor = cpuinfo_vendor_apm;
|
||||
switch (midr_get_part(midr)) {
|
||||
@@ -215,7 +236,6 @@ void cpuinfo_arm_decode_vendor_uarch(
|
||||
cpuinfo_log_warning("unknown Applied Micro CPU part 0x%03"PRIx32" ignored", midr_get_part(midr));
|
||||
}
|
||||
break;
|
||||
#endif
|
||||
case 'Q':
|
||||
*vendor = cpuinfo_vendor_qualcomm;
|
||||
switch (midr_get_part(midr)) {
|
||||
@@ -282,14 +302,14 @@ void cpuinfo_arm_decode_vendor_uarch(
|
||||
*vendor = cpuinfo_vendor_arm;
|
||||
*uarch = cpuinfo_uarch_cortex_a55;
|
||||
break;
|
||||
#if CPUINFO_ARCH_ARM64 && !defined(__ANDROID__)
|
||||
#if CPUINFO_ARCH_ARM64
|
||||
case 0xC00:
|
||||
*uarch = cpuinfo_uarch_falkor;
|
||||
break;
|
||||
case 0xC01:
|
||||
*uarch = cpuinfo_uarch_saphira;
|
||||
break;
|
||||
#endif /* CPUINFO_ARCH_ARM64 && !defined(__ANDROID__) */
|
||||
#endif /* CPUINFO_ARCH_ARM64 */
|
||||
default:
|
||||
cpuinfo_log_warning("unknown Qualcomm CPU part 0x%03"PRIx32" ignored", midr_get_part(midr));
|
||||
}
|
||||
|
||||
901
3rdparty/cpuinfo/src/arm/windows/init-by-logical-sys-info.c
vendored
Normal file
901
3rdparty/cpuinfo/src/arm/windows/init-by-logical-sys-info.c
vendored
Normal file
@@ -0,0 +1,901 @@
|
||||
#include <stdio.h>
|
||||
#include <stdint.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <malloc.h>
|
||||
#include <errno.h>
|
||||
#include <sys/types.h>
|
||||
|
||||
#include <cpuinfo.h>
|
||||
#include <cpuinfo/internal-api.h>
|
||||
#include <cpuinfo/log.h>
|
||||
|
||||
#include "windows-arm-init.h"
|
||||
|
||||
#define MAX_NR_OF_CACHES (cpuinfo_cache_level_max - 1)
|
||||
|
||||
/* Call chain:
|
||||
* cpu_info_init_by_logical_sys_info
|
||||
* read_packages_for_processors
|
||||
* read_cores_for_processors
|
||||
* read_caches_for_processors
|
||||
* read_all_logical_processor_info_of_relation
|
||||
* parse_relation_processor_info
|
||||
* store_package_info_per_processor
|
||||
* store_core_info_per_processor
|
||||
* parse_relation_cache_info
|
||||
* store_cache_info_per_processor
|
||||
*/
|
||||
|
||||
static uint32_t count_logical_processors(
|
||||
const uint32_t max_group_count,
|
||||
uint32_t* global_proc_index_per_group);
|
||||
|
||||
static uint32_t read_packages_for_processors(
|
||||
struct cpuinfo_processor* processors,
|
||||
const uint32_t number_of_processors,
|
||||
const uint32_t* global_proc_index_per_group,
|
||||
const struct woa_chip_info *chip_info);
|
||||
|
||||
static uint32_t read_cores_for_processors(
|
||||
struct cpuinfo_processor* processors,
|
||||
const uint32_t number_of_processors,
|
||||
const uint32_t* global_proc_index_per_group,
|
||||
struct cpuinfo_core* cores,
|
||||
const struct woa_chip_info *chip_info);
|
||||
|
||||
static uint32_t read_caches_for_processors(
|
||||
struct cpuinfo_processor *processors,
|
||||
const uint32_t number_of_processors,
|
||||
struct cpuinfo_cache *caches,
|
||||
uint32_t* numbers_of_caches,
|
||||
const uint32_t* global_proc_index_per_group,
|
||||
const struct woa_chip_info *chip_info);
|
||||
|
||||
static uint32_t read_all_logical_processor_info_of_relation(
|
||||
LOGICAL_PROCESSOR_RELATIONSHIP info_type,
|
||||
struct cpuinfo_processor* processors,
|
||||
const uint32_t number_of_processors,
|
||||
struct cpuinfo_cache* caches,
|
||||
uint32_t* numbers_of_caches,
|
||||
struct cpuinfo_core* cores,
|
||||
const uint32_t* global_proc_index_per_group,
|
||||
const struct woa_chip_info *chip_info);
|
||||
|
||||
static bool parse_relation_processor_info(
|
||||
struct cpuinfo_processor* processors,
|
||||
uint32_t nr_of_processors,
|
||||
const uint32_t* global_proc_index_per_group,
|
||||
PSYSTEM_LOGICAL_PROCESSOR_INFORMATION_EX info,
|
||||
const uint32_t info_id,
|
||||
struct cpuinfo_core* cores,
|
||||
const struct woa_chip_info *chip_info);
|
||||
|
||||
static bool parse_relation_cache_info(
|
||||
struct cpuinfo_processor* processors,
|
||||
struct cpuinfo_cache* caches,
|
||||
uint32_t* numbers_of_caches,
|
||||
const uint32_t* global_proc_index_per_group,
|
||||
PSYSTEM_LOGICAL_PROCESSOR_INFORMATION_EX info);
|
||||
|
||||
static void store_package_info_per_processor(
|
||||
struct cpuinfo_processor* processors,
|
||||
const uint32_t processor_global_index,
|
||||
const uint32_t package_id,
|
||||
const uint32_t group_id,
|
||||
const uint32_t processor_id_in_group);
|
||||
|
||||
static void store_core_info_per_processor(
|
||||
struct cpuinfo_processor* processors,
|
||||
const uint32_t processor_global_index,
|
||||
const uint32_t core_id,
|
||||
PSYSTEM_LOGICAL_PROCESSOR_INFORMATION_EX core_info,
|
||||
struct cpuinfo_core* cores,
|
||||
const struct woa_chip_info *chip_info);
|
||||
|
||||
static void store_cache_info_per_processor(
|
||||
struct cpuinfo_processor* processors,
|
||||
const uint32_t processor_global_index,
|
||||
PSYSTEM_LOGICAL_PROCESSOR_INFORMATION_EX info,
|
||||
struct cpuinfo_cache* current_cache);
|
||||
|
||||
static bool connect_packages_cores_clusters_by_processors(
|
||||
struct cpuinfo_processor* processors,
|
||||
const uint32_t nr_of_processors,
|
||||
struct cpuinfo_package* packages,
|
||||
const uint32_t nr_of_packages,
|
||||
struct cpuinfo_cluster* clusters,
|
||||
struct cpuinfo_core* cores,
|
||||
const uint32_t nr_of_cores,
|
||||
const struct woa_chip_info* chip_info,
|
||||
enum cpuinfo_vendor vendor);
|
||||
|
||||
static inline uint32_t low_index_from_kaffinity(KAFFINITY kaffinity);
|
||||
|
||||
|
||||
bool cpu_info_init_by_logical_sys_info(
|
||||
const struct woa_chip_info *chip_info,
|
||||
const enum cpuinfo_vendor vendor)
|
||||
{
|
||||
struct cpuinfo_processor* processors = NULL;
|
||||
struct cpuinfo_package* packages = NULL;
|
||||
struct cpuinfo_cluster* clusters = NULL;
|
||||
struct cpuinfo_core* cores = NULL;
|
||||
struct cpuinfo_cache* caches = NULL;
|
||||
struct cpuinfo_uarch_info* uarchs = NULL;
|
||||
|
||||
uint32_t nr_of_packages = 0;
|
||||
uint32_t nr_of_cores = 0;
|
||||
uint32_t nr_of_all_caches = 0;
|
||||
uint32_t numbers_of_caches[MAX_NR_OF_CACHES] = {0};
|
||||
|
||||
uint32_t nr_of_uarchs = 0;
|
||||
bool result = false;
|
||||
|
||||
HANDLE heap = GetProcessHeap();
|
||||
|
||||
/* 1. Count available logical processor groups and processors */
|
||||
const uint32_t max_group_count = (uint32_t) GetMaximumProcessorGroupCount();
|
||||
cpuinfo_log_debug("detected %"PRIu32" processor group(s)", max_group_count);
|
||||
/* We need to store the absolute processor ID offsets for every groups, because
|
||||
* 1. We can't assume every processor groups include the same number of
|
||||
* logical processors.
|
||||
* 2. Every processor groups know its group number and processor IDs within
|
||||
* the group, but not the global processor IDs.
|
||||
* 3. We need to list every logical processors by global IDs.
|
||||
*/
|
||||
uint32_t* global_proc_index_per_group =
|
||||
(uint32_t*) HeapAlloc(heap, 0, max_group_count * sizeof(uint32_t));
|
||||
if (global_proc_index_per_group == NULL) {
|
||||
cpuinfo_log_error(
|
||||
"failed to allocate %zu bytes for descriptions of %"PRIu32" processor groups",
|
||||
max_group_count * sizeof(struct cpuinfo_processor), max_group_count);
|
||||
goto clean_up;
|
||||
}
|
||||
|
||||
uint32_t nr_of_processors =
|
||||
count_logical_processors(max_group_count, global_proc_index_per_group);
|
||||
processors = HeapAlloc(heap, HEAP_ZERO_MEMORY, nr_of_processors * sizeof(struct cpuinfo_processor));
|
||||
if (processors == NULL) {
|
||||
cpuinfo_log_error(
|
||||
"failed to allocate %zu bytes for descriptions of %"PRIu32" logical processors",
|
||||
nr_of_processors * sizeof(struct cpuinfo_processor), nr_of_processors);
|
||||
goto clean_up;
|
||||
}
|
||||
|
||||
/* 2. Read topology information via MSDN API: packages, cores and caches*/
|
||||
nr_of_packages = read_packages_for_processors(
|
||||
processors, nr_of_processors,
|
||||
global_proc_index_per_group,
|
||||
chip_info);
|
||||
if (!nr_of_packages) {
|
||||
cpuinfo_log_error("error in reading package information");
|
||||
goto clean_up;
|
||||
}
|
||||
cpuinfo_log_debug("detected %"PRIu32" processor package(s)", nr_of_packages);
|
||||
|
||||
/* We need the EfficiencyClass to parse uarch from the core information,
|
||||
* but we need to iterate first to count cores and allocate memory then
|
||||
* we will iterate again to read and store data to cpuinfo_core structures.
|
||||
*/
|
||||
nr_of_cores = read_cores_for_processors(
|
||||
processors, nr_of_processors,
|
||||
global_proc_index_per_group, NULL,
|
||||
chip_info);
|
||||
if (!nr_of_cores) {
|
||||
cpuinfo_log_error("error in reading core information");
|
||||
goto clean_up;
|
||||
}
|
||||
cpuinfo_log_debug("detected %"PRIu32" processor core(s)", nr_of_cores);
|
||||
|
||||
/* There is no API to read number of caches, so we need to iterate twice on caches:
|
||||
1. Count all type of caches -> allocate memory
|
||||
2. Read out cache data and store to allocated memory
|
||||
*/
|
||||
nr_of_all_caches = read_caches_for_processors(
|
||||
processors, nr_of_processors,
|
||||
caches, numbers_of_caches,
|
||||
global_proc_index_per_group, chip_info);
|
||||
if (!nr_of_all_caches) {
|
||||
cpuinfo_log_error("error in reading cache information");
|
||||
goto clean_up;
|
||||
}
|
||||
cpuinfo_log_debug("detected %"PRIu32" processor cache(s)", nr_of_all_caches);
|
||||
|
||||
/* 3. Allocate memory for package, cluster, core and cache structures */
|
||||
packages = HeapAlloc(heap, HEAP_ZERO_MEMORY, nr_of_packages * sizeof(struct cpuinfo_package));
|
||||
if (packages == NULL) {
|
||||
cpuinfo_log_error("failed to allocate %zu bytes for descriptions of %"PRIu32" physical packages",
|
||||
nr_of_packages * sizeof(struct cpuinfo_package), nr_of_packages);
|
||||
goto clean_up;
|
||||
}
|
||||
|
||||
/* We don't have cluster information so we explicitly set clusters to equal to cores. */
|
||||
clusters = HeapAlloc(heap, HEAP_ZERO_MEMORY, nr_of_cores * sizeof(struct cpuinfo_cluster));
|
||||
if (clusters == NULL) {
|
||||
cpuinfo_log_error("failed to allocate %zu bytes for descriptions of %"PRIu32" core clusters",
|
||||
nr_of_cores * sizeof(struct cpuinfo_cluster), nr_of_cores);
|
||||
goto clean_up;
|
||||
}
|
||||
|
||||
cores = HeapAlloc(heap, HEAP_ZERO_MEMORY, nr_of_cores * sizeof(struct cpuinfo_core));
|
||||
if (cores == NULL) {
|
||||
cpuinfo_log_error("failed to allocate %zu bytes for descriptions of %"PRIu32" cores",
|
||||
nr_of_cores * sizeof(struct cpuinfo_core), nr_of_cores);
|
||||
goto clean_up;
|
||||
}
|
||||
|
||||
/* We allocate one contiguous cache array for all caches, then use offsets per cache type. */
|
||||
caches = HeapAlloc(heap, HEAP_ZERO_MEMORY, nr_of_all_caches * sizeof(struct cpuinfo_cache));
|
||||
if (caches == NULL) {
|
||||
cpuinfo_log_error("failed to allocate %zu bytes for descriptions of %"PRIu32" caches",
|
||||
nr_of_all_caches * sizeof(struct cpuinfo_cache), nr_of_all_caches);
|
||||
goto clean_up;
|
||||
}
|
||||
|
||||
/* 4.Read missing topology information that can't be saved without counted
|
||||
* allocate structures in the first round.
|
||||
*/
|
||||
nr_of_all_caches = read_caches_for_processors(
|
||||
processors, nr_of_processors,
|
||||
caches, numbers_of_caches, global_proc_index_per_group, chip_info);
|
||||
if (!nr_of_all_caches) {
|
||||
cpuinfo_log_error("error in reading cache information");
|
||||
goto clean_up;
|
||||
}
|
||||
|
||||
nr_of_cores = read_cores_for_processors(
|
||||
processors, nr_of_processors,
|
||||
global_proc_index_per_group, cores,
|
||||
chip_info);
|
||||
if (!nr_of_cores) {
|
||||
cpuinfo_log_error("error in reading core information");
|
||||
goto clean_up;
|
||||
}
|
||||
|
||||
/* 5. Now that we read out everything from the system we can, fill the package, cluster
|
||||
* and core structures respectively.
|
||||
*/
|
||||
result = connect_packages_cores_clusters_by_processors(
|
||||
processors, nr_of_processors,
|
||||
packages, nr_of_packages,
|
||||
clusters,
|
||||
cores, nr_of_cores,
|
||||
chip_info,
|
||||
vendor);
|
||||
if(!result) {
|
||||
cpuinfo_log_error("error in connecting information");
|
||||
goto clean_up;
|
||||
}
|
||||
|
||||
/* 6. Count and store uarchs of cores, assuming same uarchs are neighbors */
|
||||
enum cpuinfo_uarch prev_uarch = cpuinfo_uarch_unknown;
|
||||
for (uint32_t i = 0; i < nr_of_cores; i++) {
|
||||
if (prev_uarch != cores[i].uarch) {
|
||||
nr_of_uarchs++;
|
||||
prev_uarch = cores[i].uarch;
|
||||
}
|
||||
}
|
||||
uarchs = HeapAlloc(heap, HEAP_ZERO_MEMORY, nr_of_uarchs * sizeof(struct cpuinfo_uarch_info));
|
||||
if (uarchs == NULL) {
|
||||
cpuinfo_log_error("failed to allocate %zu bytes for descriptions of %"PRIu32" uarchs",
|
||||
nr_of_uarchs * sizeof(struct cpuinfo_uarch_info), nr_of_uarchs);
|
||||
goto clean_up;
|
||||
}
|
||||
prev_uarch = cpuinfo_uarch_unknown;
|
||||
for (uint32_t i = 0, uarch_index = 0; i < nr_of_cores; i++) {
|
||||
if (prev_uarch != cores[i].uarch) {
|
||||
if (i != 0) {
|
||||
uarch_index++;
|
||||
}
|
||||
if (uarch_index >= nr_of_uarchs) {
|
||||
cpuinfo_log_error("more uarchs detected than reported");
|
||||
}
|
||||
prev_uarch = cores[i].uarch;
|
||||
uarchs[uarch_index].uarch = cores[i].uarch;
|
||||
uarchs[uarch_index].core_count = 1;
|
||||
uarchs[uarch_index].processor_count = cores[i].processor_count;
|
||||
} else if (prev_uarch != cpuinfo_uarch_unknown) {
|
||||
uarchs[uarch_index].core_count++;
|
||||
uarchs[uarch_index].processor_count += cores[i].processor_count;
|
||||
}
|
||||
}
|
||||
|
||||
/* 7. Commit changes */
|
||||
cpuinfo_processors = processors;
|
||||
cpuinfo_packages = packages;
|
||||
cpuinfo_clusters = clusters;
|
||||
cpuinfo_cores = cores;
|
||||
cpuinfo_uarchs = uarchs;
|
||||
|
||||
cpuinfo_processors_count = nr_of_processors;
|
||||
cpuinfo_packages_count = nr_of_packages;
|
||||
cpuinfo_clusters_count = nr_of_cores;
|
||||
cpuinfo_cores_count = nr_of_cores;
|
||||
cpuinfo_uarchs_count = nr_of_uarchs;
|
||||
|
||||
for (uint32_t i = 0; i < MAX_NR_OF_CACHES; i++) {
|
||||
cpuinfo_cache_count[i] = numbers_of_caches[i];
|
||||
}
|
||||
cpuinfo_cache[cpuinfo_cache_level_1i] = caches;
|
||||
cpuinfo_cache[cpuinfo_cache_level_1d] = cpuinfo_cache[cpuinfo_cache_level_1i] + cpuinfo_cache_count[cpuinfo_cache_level_1i];
|
||||
cpuinfo_cache[cpuinfo_cache_level_2] = cpuinfo_cache[cpuinfo_cache_level_1d] + cpuinfo_cache_count[cpuinfo_cache_level_1d];
|
||||
cpuinfo_cache[cpuinfo_cache_level_3] = cpuinfo_cache[cpuinfo_cache_level_2] + cpuinfo_cache_count[cpuinfo_cache_level_2];
|
||||
cpuinfo_cache[cpuinfo_cache_level_4] = cpuinfo_cache[cpuinfo_cache_level_3] + cpuinfo_cache_count[cpuinfo_cache_level_3];
|
||||
cpuinfo_max_cache_size = cpuinfo_compute_max_cache_size(&processors[0]);
|
||||
|
||||
result = true;
|
||||
MemoryBarrier();
|
||||
|
||||
processors = NULL;
|
||||
packages = NULL;
|
||||
clusters = NULL;
|
||||
cores = NULL;
|
||||
caches = NULL;
|
||||
uarchs = NULL;
|
||||
|
||||
clean_up:
|
||||
/* The propagated pointers, shouldn't be freed, only in case of error
|
||||
* and unfinished init.
|
||||
*/
|
||||
if (processors != NULL) {
|
||||
HeapFree(heap, 0, processors);
|
||||
}
|
||||
if (packages != NULL) {
|
||||
HeapFree(heap, 0, packages);
|
||||
}
|
||||
if (clusters != NULL) {
|
||||
HeapFree(heap, 0, clusters);
|
||||
}
|
||||
if (cores != NULL) {
|
||||
HeapFree(heap, 0, cores);
|
||||
}
|
||||
if (caches != NULL) {
|
||||
HeapFree(heap, 0, caches);
|
||||
}
|
||||
if (uarchs != NULL) {
|
||||
HeapFree(heap, 0, uarchs);
|
||||
}
|
||||
|
||||
/* Free the locally used temporary pointers */
|
||||
HeapFree(heap, 0, global_proc_index_per_group);
|
||||
global_proc_index_per_group = NULL;
|
||||
return result;
|
||||
}
|
||||
|
||||
static uint32_t count_logical_processors(
|
||||
const uint32_t max_group_count,
|
||||
uint32_t* global_proc_index_per_group)
|
||||
{
|
||||
uint32_t nr_of_processors = 0;
|
||||
|
||||
for (uint32_t i = 0; i < max_group_count; i++) {
|
||||
uint32_t nr_of_processors_per_group = GetMaximumProcessorCount((WORD) i);
|
||||
cpuinfo_log_debug("detected %"PRIu32" processor(s) in group %"PRIu32"",
|
||||
nr_of_processors_per_group, i);
|
||||
global_proc_index_per_group[i] = nr_of_processors;
|
||||
nr_of_processors += nr_of_processors_per_group;
|
||||
}
|
||||
return nr_of_processors;
|
||||
}
|
||||
|
||||
static uint32_t read_packages_for_processors(
|
||||
struct cpuinfo_processor* processors,
|
||||
const uint32_t number_of_processors,
|
||||
const uint32_t* global_proc_index_per_group,
|
||||
const struct woa_chip_info *chip_info)
|
||||
{
|
||||
return read_all_logical_processor_info_of_relation(
|
||||
RelationProcessorPackage,
|
||||
processors,
|
||||
number_of_processors,
|
||||
NULL,
|
||||
NULL,
|
||||
NULL,
|
||||
global_proc_index_per_group,
|
||||
chip_info);
|
||||
}
|
||||
|
||||
uint32_t read_cores_for_processors(
|
||||
struct cpuinfo_processor* processors,
|
||||
const uint32_t number_of_processors,
|
||||
const uint32_t* global_proc_index_per_group,
|
||||
struct cpuinfo_core* cores,
|
||||
const struct woa_chip_info *chip_info)
|
||||
{
|
||||
return read_all_logical_processor_info_of_relation(
|
||||
RelationProcessorCore,
|
||||
processors,
|
||||
number_of_processors,
|
||||
NULL,
|
||||
NULL,
|
||||
cores,
|
||||
global_proc_index_per_group,
|
||||
chip_info);
|
||||
}
|
||||
|
||||
static uint32_t read_caches_for_processors(
|
||||
struct cpuinfo_processor* processors,
|
||||
const uint32_t number_of_processors,
|
||||
struct cpuinfo_cache* caches,
|
||||
uint32_t* numbers_of_caches,
|
||||
const uint32_t* global_proc_index_per_group,
|
||||
const struct woa_chip_info *chip_info)
|
||||
{
|
||||
/* Reset processor start indexes */
|
||||
if (caches) {
|
||||
uint32_t cache_offset = 0;
|
||||
for (uint32_t i = 0; i < MAX_NR_OF_CACHES; i++) {
|
||||
for (uint32_t j = 0; j < numbers_of_caches[i]; j++) {
|
||||
caches[cache_offset + j].processor_start = UINT32_MAX;
|
||||
}
|
||||
cache_offset += numbers_of_caches[i];
|
||||
}
|
||||
}
|
||||
|
||||
return read_all_logical_processor_info_of_relation(
|
||||
RelationCache,
|
||||
processors,
|
||||
number_of_processors,
|
||||
caches,
|
||||
numbers_of_caches,
|
||||
NULL,
|
||||
global_proc_index_per_group,
|
||||
chip_info);
|
||||
}
|
||||
|
||||
static uint32_t read_all_logical_processor_info_of_relation(
|
||||
LOGICAL_PROCESSOR_RELATIONSHIP info_type,
|
||||
struct cpuinfo_processor* processors,
|
||||
const uint32_t number_of_processors,
|
||||
struct cpuinfo_cache* caches,
|
||||
uint32_t* numbers_of_caches,
|
||||
struct cpuinfo_core* cores,
|
||||
const uint32_t* global_proc_index_per_group,
|
||||
const struct woa_chip_info* chip_info)
|
||||
{
|
||||
PSYSTEM_LOGICAL_PROCESSOR_INFORMATION_EX infos = NULL;
|
||||
uint32_t nr_of_structs = 0;
|
||||
DWORD info_size = 0;
|
||||
bool result = false;
|
||||
HANDLE heap = GetProcessHeap();
|
||||
|
||||
/* 1. Query the size of the information structure first */
|
||||
if (GetLogicalProcessorInformationEx(info_type, NULL, &info_size) == FALSE) {
|
||||
const DWORD last_error = GetLastError();
|
||||
if (last_error != ERROR_INSUFFICIENT_BUFFER) {
|
||||
cpuinfo_log_error(
|
||||
"failed to query size of processor %"PRIu32" information information: error %"PRIu32"",
|
||||
(uint32_t)info_type, (uint32_t) last_error);
|
||||
goto clean_up;
|
||||
}
|
||||
}
|
||||
/* 2. Allocate memory for the information structure */
|
||||
infos = HeapAlloc(heap, 0, info_size);
|
||||
if (infos == NULL) {
|
||||
cpuinfo_log_error("failed to allocate %"PRIu32" bytes for logical processor information",
|
||||
(uint32_t) info_size);
|
||||
goto clean_up;
|
||||
}
|
||||
/* 3. Read the information structure */
|
||||
if (GetLogicalProcessorInformationEx(info_type, infos, &info_size) == FALSE) {
|
||||
cpuinfo_log_error("failed to query processor %"PRIu32" information: error %"PRIu32"",
|
||||
(uint32_t)info_type, (uint32_t) GetLastError());
|
||||
goto clean_up;
|
||||
}
|
||||
|
||||
/* 4. Parse the structure and store relevant data */
|
||||
PSYSTEM_LOGICAL_PROCESSOR_INFORMATION_EX info_end =
|
||||
(PSYSTEM_LOGICAL_PROCESSOR_INFORMATION_EX) ((uintptr_t) infos + info_size);
|
||||
for (PSYSTEM_LOGICAL_PROCESSOR_INFORMATION_EX info = infos;
|
||||
info < info_end;
|
||||
info = (PSYSTEM_LOGICAL_PROCESSOR_INFORMATION_EX) ((uintptr_t) info + info->Size))
|
||||
{
|
||||
if (info->Relationship != info_type) {
|
||||
cpuinfo_log_warning(
|
||||
"unexpected processor info type (%"PRIu32") for processor information",
|
||||
(uint32_t) info->Relationship);
|
||||
continue;
|
||||
}
|
||||
|
||||
const uint32_t info_id = nr_of_structs++;
|
||||
|
||||
switch(info_type) {
|
||||
case RelationProcessorPackage:
|
||||
result = parse_relation_processor_info(
|
||||
processors,
|
||||
number_of_processors,
|
||||
global_proc_index_per_group,
|
||||
info,
|
||||
info_id,
|
||||
cores,
|
||||
chip_info);
|
||||
break;
|
||||
case RelationProcessorCore:
|
||||
result = parse_relation_processor_info(
|
||||
processors,
|
||||
number_of_processors,
|
||||
global_proc_index_per_group,
|
||||
info,
|
||||
info_id,
|
||||
cores,
|
||||
chip_info);
|
||||
break;
|
||||
case RelationCache:
|
||||
result = parse_relation_cache_info(
|
||||
processors,
|
||||
caches,
|
||||
numbers_of_caches,
|
||||
global_proc_index_per_group,
|
||||
info);
|
||||
break;
|
||||
default:
|
||||
cpuinfo_log_error(
|
||||
"unexpected processor info type (%"PRIu32") for processor information",
|
||||
(uint32_t) info->Relationship);
|
||||
result = false;
|
||||
break;
|
||||
}
|
||||
if (!result) {
|
||||
nr_of_structs = 0;
|
||||
goto clean_up;
|
||||
}
|
||||
}
|
||||
clean_up:
|
||||
/* 5. Release dynamically allocated info structure. */
|
||||
HeapFree(heap, 0, infos);
|
||||
infos = NULL;
|
||||
return nr_of_structs;
|
||||
}
|
||||
|
||||
static bool parse_relation_processor_info(
|
||||
struct cpuinfo_processor* processors,
|
||||
uint32_t nr_of_processors,
|
||||
const uint32_t* global_proc_index_per_group,
|
||||
PSYSTEM_LOGICAL_PROCESSOR_INFORMATION_EX info,
|
||||
const uint32_t info_id,
|
||||
struct cpuinfo_core* cores,
|
||||
const struct woa_chip_info *chip_info)
|
||||
{
|
||||
for (uint32_t i = 0; i < info->Processor.GroupCount; i++) {
|
||||
const uint32_t group_id = info->Processor.GroupMask[i].Group;
|
||||
/* Bitmask representing processors in this group belonging to this package */
|
||||
KAFFINITY group_processors_mask = info->Processor.GroupMask[i].Mask;
|
||||
while (group_processors_mask != 0) {
|
||||
const uint32_t processor_id_in_group =
|
||||
low_index_from_kaffinity(group_processors_mask);
|
||||
const uint32_t processor_global_index =
|
||||
global_proc_index_per_group[group_id] + processor_id_in_group;
|
||||
|
||||
if(processor_global_index >= nr_of_processors) {
|
||||
cpuinfo_log_error("unexpected processor index %"PRIu32"",
|
||||
processor_global_index);
|
||||
return false;
|
||||
}
|
||||
|
||||
switch(info->Relationship) {
|
||||
case RelationProcessorPackage:
|
||||
store_package_info_per_processor(
|
||||
processors, processor_global_index, info_id,
|
||||
group_id, processor_id_in_group);
|
||||
break;
|
||||
case RelationProcessorCore:
|
||||
store_core_info_per_processor(
|
||||
processors, processor_global_index,
|
||||
info_id, info,
|
||||
cores, chip_info);
|
||||
break;
|
||||
default:
|
||||
cpuinfo_log_error(
|
||||
"unexpected processor info type (%"PRIu32") for processor information",
|
||||
(uint32_t) info->Relationship);
|
||||
break;
|
||||
}
|
||||
/* Clear the bits in affinity mask, lower the least set bit. */
|
||||
group_processors_mask &= (group_processors_mask - 1);
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
static bool parse_relation_cache_info(
|
||||
struct cpuinfo_processor* processors,
|
||||
struct cpuinfo_cache* caches,
|
||||
uint32_t* numbers_of_caches,
|
||||
const uint32_t* global_proc_index_per_group,
|
||||
PSYSTEM_LOGICAL_PROCESSOR_INFORMATION_EX info)
|
||||
{
|
||||
static uint32_t l1i_counter = 0;
|
||||
static uint32_t l1d_counter = 0;
|
||||
static uint32_t l2_counter = 0;
|
||||
static uint32_t l3_counter = 0;
|
||||
|
||||
/* Count cache types for allocation at first. */
|
||||
if (caches == NULL) {
|
||||
switch(info->Cache.Level) {
|
||||
case 1:
|
||||
switch (info->Cache.Type) {
|
||||
case CacheInstruction:
|
||||
numbers_of_caches[cpuinfo_cache_level_1i]++;
|
||||
break;
|
||||
case CacheData:
|
||||
numbers_of_caches[cpuinfo_cache_level_1d]++;
|
||||
break;
|
||||
case CacheUnified:
|
||||
break;
|
||||
case CacheTrace:
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
break;
|
||||
case 2:
|
||||
numbers_of_caches[cpuinfo_cache_level_2]++;
|
||||
break;
|
||||
case 3:
|
||||
numbers_of_caches[cpuinfo_cache_level_3]++;
|
||||
break;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
struct cpuinfo_cache* l1i_base = caches;
|
||||
struct cpuinfo_cache* l1d_base = l1i_base + numbers_of_caches[cpuinfo_cache_level_1i];
|
||||
struct cpuinfo_cache* l2_base = l1d_base + numbers_of_caches[cpuinfo_cache_level_1d];
|
||||
struct cpuinfo_cache* l3_base = l2_base + numbers_of_caches[cpuinfo_cache_level_2];
|
||||
|
||||
cpuinfo_log_debug(
|
||||
"info->Cache.GroupCount:%"PRIu32", info->Cache.GroupMask:%"PRIu32","
|
||||
"info->Cache.Level:%"PRIu32", info->Cache.Associativity:%"PRIu32","
|
||||
"info->Cache.LineSize:%"PRIu32","
|
||||
"info->Cache.CacheSize:%"PRIu32", info->Cache.Type:%"PRIu32"",
|
||||
info->Cache.GroupCount, (unsigned int)info->Cache.GroupMask.Mask,
|
||||
info->Cache.Level, info->Cache.Associativity, info->Cache.LineSize,
|
||||
info->Cache.CacheSize, info->Cache.Type);
|
||||
|
||||
struct cpuinfo_cache* current_cache = NULL;
|
||||
switch (info->Cache.Level) {
|
||||
case 1:
|
||||
switch (info->Cache.Type) {
|
||||
case CacheInstruction:
|
||||
current_cache = l1i_base + l1i_counter;
|
||||
l1i_counter++;
|
||||
break;
|
||||
case CacheData:
|
||||
current_cache = l1d_base + l1d_counter;
|
||||
l1d_counter++;
|
||||
break;
|
||||
case CacheUnified:
|
||||
break;
|
||||
case CacheTrace:
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
break;
|
||||
case 2:
|
||||
current_cache = l2_base + l2_counter;
|
||||
l2_counter++;
|
||||
break;
|
||||
case 3:
|
||||
current_cache = l3_base + l3_counter;
|
||||
l3_counter++;
|
||||
break;
|
||||
}
|
||||
current_cache->size = info->Cache.CacheSize;
|
||||
current_cache->line_size = info->Cache.LineSize;
|
||||
current_cache->associativity = info->Cache.Associativity;
|
||||
/* We don't have partition and set information of caches on Windows,
|
||||
* so we set partitions to 1 and calculate the expected sets.
|
||||
*/
|
||||
current_cache->partitions = 1;
|
||||
current_cache->sets =
|
||||
current_cache->size / current_cache->line_size / current_cache->associativity;
|
||||
if (info->Cache.Type == CacheUnified) {
|
||||
current_cache->flags = CPUINFO_CACHE_UNIFIED;
|
||||
}
|
||||
|
||||
for (uint32_t i = 0; i < info->Cache.GroupCount; i++) {
|
||||
/* Zero GroupCount is valid, GroupMask still can store bits set. */
|
||||
const uint32_t group_id = info->Cache.GroupMasks[i].Group;
|
||||
/* Bitmask representing processors in this group belonging to this package */
|
||||
KAFFINITY group_processors_mask = info->Cache.GroupMasks[i].Mask;
|
||||
while (group_processors_mask != 0) {
|
||||
const uint32_t processor_id_in_group =
|
||||
low_index_from_kaffinity(group_processors_mask);
|
||||
const uint32_t processor_global_index =
|
||||
global_proc_index_per_group[group_id] + processor_id_in_group;
|
||||
|
||||
store_cache_info_per_processor(
|
||||
processors, processor_global_index,
|
||||
info, current_cache);
|
||||
|
||||
/* Clear the bits in affinity mask, lower the least set bit. */
|
||||
group_processors_mask &= (group_processors_mask - 1);
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
static void store_package_info_per_processor(
|
||||
struct cpuinfo_processor* processors,
|
||||
const uint32_t processor_global_index,
|
||||
const uint32_t package_id,
|
||||
const uint32_t group_id,
|
||||
const uint32_t processor_id_in_group)
|
||||
{
|
||||
processors[processor_global_index].windows_group_id =
|
||||
(uint16_t) group_id;
|
||||
processors[processor_global_index].windows_processor_id =
|
||||
(uint16_t) processor_id_in_group;
|
||||
|
||||
/* As we're counting the number of packages now, we haven't allocated memory for
|
||||
* cpuinfo_packages yet, so we only set the package pointer's offset now.
|
||||
*/
|
||||
processors[processor_global_index].package =
|
||||
(const struct cpuinfo_package*) NULL + package_id;
|
||||
}
|
||||
|
||||
void store_core_info_per_processor(
|
||||
struct cpuinfo_processor* processors,
|
||||
const uint32_t processor_global_index,
|
||||
const uint32_t core_id,
|
||||
PSYSTEM_LOGICAL_PROCESSOR_INFORMATION_EX core_info,
|
||||
struct cpuinfo_core* cores,
|
||||
const struct woa_chip_info *chip_info)
|
||||
{
|
||||
if (cores) {
|
||||
processors[processor_global_index].core = cores + core_id;
|
||||
cores[core_id].core_id = core_id;
|
||||
get_core_uarch_for_efficiency(
|
||||
chip_info->chip_name, core_info->Processor.EfficiencyClass,
|
||||
&(cores[core_id].uarch), &(cores[core_id].frequency));
|
||||
|
||||
/* We don't have cluster information, so we handle it as
|
||||
* fixed 1 to (cluster / cores).
|
||||
* Set the cluster offset ID now, as soon as we have the
|
||||
* cluster base address, we'll set the absolute address.
|
||||
*/
|
||||
processors[processor_global_index].cluster =
|
||||
(const struct cpuinfo_cluster*) NULL + core_id;
|
||||
}
|
||||
}
|
||||
|
||||
static void store_cache_info_per_processor(
|
||||
struct cpuinfo_processor* processors,
|
||||
const uint32_t processor_global_index,
|
||||
PSYSTEM_LOGICAL_PROCESSOR_INFORMATION_EX info,
|
||||
struct cpuinfo_cache* current_cache)
|
||||
{
|
||||
if (current_cache->processor_start > processor_global_index) {
|
||||
current_cache->processor_start = processor_global_index;
|
||||
}
|
||||
current_cache->processor_count++;
|
||||
|
||||
switch(info->Cache.Level) {
|
||||
case 1:
|
||||
switch (info->Cache.Type) {
|
||||
case CacheInstruction:
|
||||
processors[processor_global_index].cache.l1i = current_cache;
|
||||
break;
|
||||
case CacheData:
|
||||
processors[processor_global_index].cache.l1d = current_cache;
|
||||
break;
|
||||
case CacheUnified:
|
||||
break;
|
||||
case CacheTrace:
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
break;
|
||||
case 2:
|
||||
processors[processor_global_index].cache.l2 = current_cache;
|
||||
break;
|
||||
case 3:
|
||||
processors[processor_global_index].cache.l3 = current_cache;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
static bool connect_packages_cores_clusters_by_processors(
|
||||
struct cpuinfo_processor* processors,
|
||||
const uint32_t nr_of_processors,
|
||||
struct cpuinfo_package* packages,
|
||||
const uint32_t nr_of_packages,
|
||||
struct cpuinfo_cluster* clusters,
|
||||
struct cpuinfo_core* cores,
|
||||
const uint32_t nr_of_cores,
|
||||
const struct woa_chip_info* chip_info,
|
||||
enum cpuinfo_vendor vendor)
|
||||
{
|
||||
/* Adjust core and package pointers for all logical processors. */
|
||||
for (uint32_t i = nr_of_processors; i != 0; i--) {
|
||||
const uint32_t processor_id = i - 1;
|
||||
struct cpuinfo_processor* processor = processors + processor_id;
|
||||
|
||||
struct cpuinfo_core* core = (struct cpuinfo_core*)processor->core;
|
||||
|
||||
/* We stored the offset of pointers when we haven't allocated memory
|
||||
* for packages and clusters, so now add offsets to base addresses.
|
||||
*/
|
||||
struct cpuinfo_package* package =
|
||||
(struct cpuinfo_package*) ((uintptr_t) packages + (uintptr_t) processor->package);
|
||||
if (package < packages ||
|
||||
package >= (packages + nr_of_packages)) {
|
||||
cpuinfo_log_error("invalid package indexing");
|
||||
return false;
|
||||
}
|
||||
processor->package = package;
|
||||
|
||||
struct cpuinfo_cluster* cluster =
|
||||
(struct cpuinfo_cluster*) ((uintptr_t) clusters + (uintptr_t) processor->cluster);
|
||||
if (cluster < clusters ||
|
||||
cluster >= (clusters + nr_of_cores)) {
|
||||
cpuinfo_log_error("invalid cluster indexing");
|
||||
return false;
|
||||
}
|
||||
processor->cluster = cluster;
|
||||
|
||||
if (chip_info) {
|
||||
size_t converted_chars = 0;
|
||||
if (!WideCharToMultiByte(
|
||||
CP_UTF8,
|
||||
WC_ERR_INVALID_CHARS,
|
||||
chip_info->chip_name_string,
|
||||
-1,
|
||||
package->name,
|
||||
CPUINFO_PACKAGE_NAME_MAX,
|
||||
NULL,
|
||||
NULL)) {
|
||||
cpuinfo_log_error("cpu name character conversion error");
|
||||
return false;
|
||||
};
|
||||
}
|
||||
|
||||
/* Set start indexes and counts per packages / clusters / cores - going backwards */
|
||||
|
||||
/* This can be overwritten by lower-index processors on the same package. */
|
||||
package->processor_start = processor_id;
|
||||
package->processor_count++;
|
||||
|
||||
/* This can be overwritten by lower-index processors on the same cluster. */
|
||||
cluster->processor_start = processor_id;
|
||||
cluster->processor_count++;
|
||||
|
||||
/* This can be overwritten by lower-index processors on the same core. */
|
||||
core->processor_start = processor_id;
|
||||
core->processor_count++;
|
||||
}
|
||||
/* Fill cores */
|
||||
for (uint32_t i = nr_of_cores; i != 0; i--) {
|
||||
const uint32_t global_core_id = i - 1;
|
||||
struct cpuinfo_core* core = cores + global_core_id;
|
||||
const struct cpuinfo_processor* processor = processors + core->processor_start;
|
||||
struct cpuinfo_package* package = (struct cpuinfo_package*) processor->package;
|
||||
struct cpuinfo_cluster* cluster = (struct cpuinfo_cluster*) processor->cluster;
|
||||
|
||||
core->package = package;
|
||||
core->cluster = cluster;
|
||||
core->vendor = vendor;
|
||||
|
||||
/* This can be overwritten by lower-index cores on the same cluster/package. */
|
||||
cluster->core_start = global_core_id;
|
||||
cluster->core_count++;
|
||||
package->core_start = global_core_id;
|
||||
package->core_count++;
|
||||
package->cluster_start = global_core_id;
|
||||
package->cluster_count = package->core_count;
|
||||
|
||||
cluster->package = package;
|
||||
cluster->vendor = cores[cluster->core_start].vendor;
|
||||
cluster->uarch = cores[cluster->core_start].uarch;
|
||||
cluster->frequency = cores[cluster->core_start].frequency;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
static inline uint32_t low_index_from_kaffinity(KAFFINITY kaffinity) {
|
||||
unsigned long index;
|
||||
_BitScanForward64(&index, (unsigned __int64) kaffinity);
|
||||
return (uint32_t) index;
|
||||
}
|
||||
243
3rdparty/cpuinfo/src/arm/windows/init.c
vendored
Normal file
243
3rdparty/cpuinfo/src/arm/windows/init.c
vendored
Normal file
@@ -0,0 +1,243 @@
|
||||
#include <stdio.h>
|
||||
#include <stdint.h>
|
||||
#include <stdlib.h>
|
||||
#include <errno.h>
|
||||
|
||||
#include <cpuinfo.h>
|
||||
#include <cpuinfo/internal-api.h>
|
||||
#include <cpuinfo/log.h>
|
||||
|
||||
#include "windows-arm-init.h"
|
||||
|
||||
struct cpuinfo_arm_isa cpuinfo_isa;
|
||||
|
||||
static void set_cpuinfo_isa_fields(void);
|
||||
static struct woa_chip_info* get_system_info_from_registry(void);
|
||||
|
||||
static struct woa_chip_info woa_chip_unknown = {
|
||||
L"Unknown",
|
||||
woa_chip_name_unknown,
|
||||
{
|
||||
{
|
||||
cpuinfo_vendor_unknown,
|
||||
cpuinfo_uarch_unknown,
|
||||
0
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
/* Please add new SoC/chip info here! */
|
||||
static struct woa_chip_info woa_chips[] = {
|
||||
/* Microsoft SQ1 Kryo 495 4 + 4 cores (3 GHz + 1.80 GHz) */
|
||||
{
|
||||
L"Microsoft SQ1",
|
||||
woa_chip_name_microsoft_sq_1,
|
||||
{
|
||||
{
|
||||
cpuinfo_vendor_arm,
|
||||
cpuinfo_uarch_cortex_a55,
|
||||
1800000000,
|
||||
},
|
||||
{
|
||||
cpuinfo_vendor_arm,
|
||||
cpuinfo_uarch_cortex_a76,
|
||||
3000000000,
|
||||
}
|
||||
}
|
||||
},
|
||||
/* Microsoft SQ2 Kryo 495 4 + 4 cores (3.15 GHz + 2.42 GHz) */
|
||||
{
|
||||
L"Microsoft SQ2",
|
||||
woa_chip_name_microsoft_sq_2,
|
||||
{
|
||||
{
|
||||
cpuinfo_vendor_arm,
|
||||
cpuinfo_uarch_cortex_a55,
|
||||
2420000000,
|
||||
},
|
||||
{
|
||||
cpuinfo_vendor_arm,
|
||||
cpuinfo_uarch_cortex_a76,
|
||||
3150000000
|
||||
}
|
||||
}
|
||||
},
|
||||
/* Microsoft Windows Dev Kit 2023 */
|
||||
{
|
||||
L"Snapdragon Compute Platform",
|
||||
woa_chip_name_microsoft_sq_3,
|
||||
{
|
||||
{
|
||||
cpuinfo_vendor_arm,
|
||||
cpuinfo_uarch_cortex_a78,
|
||||
2420000000,
|
||||
},
|
||||
{
|
||||
cpuinfo_vendor_arm,
|
||||
cpuinfo_uarch_cortex_x1,
|
||||
3000000000
|
||||
}
|
||||
}
|
||||
},
|
||||
/* Ampere Altra */
|
||||
{
|
||||
L"Ampere(R) Altra(R) Processor",
|
||||
woa_chip_name_ampere_altra,
|
||||
{
|
||||
{
|
||||
cpuinfo_vendor_arm,
|
||||
cpuinfo_uarch_neoverse_n1,
|
||||
3000000000
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
BOOL CALLBACK cpuinfo_arm_windows_init(
|
||||
PINIT_ONCE init_once, PVOID parameter, PVOID* context)
|
||||
{
|
||||
struct woa_chip_info *chip_info = NULL;
|
||||
enum cpuinfo_vendor vendor = cpuinfo_vendor_unknown;
|
||||
|
||||
set_cpuinfo_isa_fields();
|
||||
|
||||
chip_info = get_system_info_from_registry();
|
||||
if (chip_info == NULL) {
|
||||
chip_info = &woa_chip_unknown;
|
||||
}
|
||||
|
||||
cpuinfo_is_initialized = cpu_info_init_by_logical_sys_info(chip_info, chip_info->uarchs[0].vendor);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
bool get_core_uarch_for_efficiency(
|
||||
enum woa_chip_name chip, BYTE EfficiencyClass,
|
||||
enum cpuinfo_uarch* uarch, uint64_t* frequency)
|
||||
{
|
||||
/* For currently supported WoA chips, the Efficiency class selects
|
||||
* the pre-defined little and big core.
|
||||
* Any further supported SoC's logic should be implemented here.
|
||||
*/
|
||||
if (uarch && frequency && chip < woa_chip_name_last &&
|
||||
EfficiencyClass < MAX_WOA_VALID_EFFICIENCY_CLASSES) {
|
||||
*uarch = woa_chips[chip].uarchs[EfficiencyClass].uarch;
|
||||
*frequency = woa_chips[chip].uarchs[EfficiencyClass].frequency;
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
/* Static helper functions */
|
||||
|
||||
static wchar_t* read_registry(
|
||||
LPCWSTR subkey,
|
||||
LPCWSTR value)
|
||||
{
|
||||
DWORD key_type = 0;
|
||||
DWORD data_size = 0;
|
||||
const DWORD flags = RRF_RT_REG_SZ; /* Only read strings (REG_SZ) */
|
||||
wchar_t *text_buffer = NULL;
|
||||
LSTATUS result = 0;
|
||||
HANDLE heap = GetProcessHeap();
|
||||
|
||||
result = RegGetValueW(
|
||||
HKEY_LOCAL_MACHINE,
|
||||
subkey,
|
||||
value,
|
||||
flags,
|
||||
&key_type,
|
||||
NULL, /* Request buffer size */
|
||||
&data_size);
|
||||
if (result != 0 || data_size == 0) {
|
||||
cpuinfo_log_error("Registry entry size read error");
|
||||
return NULL;
|
||||
}
|
||||
|
||||
text_buffer = HeapAlloc(heap, HEAP_ZERO_MEMORY, data_size);
|
||||
if (text_buffer == NULL) {
|
||||
cpuinfo_log_error("Registry textbuffer allocation error");
|
||||
return NULL;
|
||||
}
|
||||
|
||||
result = RegGetValueW(
|
||||
HKEY_LOCAL_MACHINE,
|
||||
subkey,
|
||||
value,
|
||||
flags,
|
||||
NULL,
|
||||
text_buffer, /* Write string in this destination buffer */
|
||||
&data_size);
|
||||
if (result != 0) {
|
||||
cpuinfo_log_error("Registry read error");
|
||||
HeapFree(heap, 0, text_buffer);
|
||||
return NULL;
|
||||
}
|
||||
return text_buffer;
|
||||
}
|
||||
|
||||
static struct woa_chip_info* get_system_info_from_registry(void)
|
||||
{
|
||||
wchar_t* text_buffer = NULL;
|
||||
LPCWSTR cpu0_subkey = L"HARDWARE\\DESCRIPTION\\System\\CentralProcessor\\0";
|
||||
LPCWSTR chip_name_value = L"ProcessorNameString";
|
||||
struct woa_chip_info* chip_info = NULL;
|
||||
|
||||
HANDLE heap = GetProcessHeap();
|
||||
|
||||
/* Read processor model name from registry and find in the hard-coded list. */
|
||||
text_buffer = read_registry(cpu0_subkey, chip_name_value);
|
||||
if (text_buffer == NULL) {
|
||||
cpuinfo_log_error("Registry read error");
|
||||
return NULL;
|
||||
}
|
||||
for (uint32_t i = 0; i < (uint32_t) woa_chip_name_last; i++) {
|
||||
size_t compare_length = wcsnlen(woa_chips[i].chip_name_string, CPUINFO_PACKAGE_NAME_MAX);
|
||||
int compare_result = wcsncmp(text_buffer, woa_chips[i].chip_name_string, compare_length);
|
||||
if (compare_result == 0) {
|
||||
chip_info = woa_chips+i;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (chip_info == NULL) {
|
||||
/* No match was found, so print a warning and assign the unknown case. */
|
||||
cpuinfo_log_error("Unknown chip model name '%ls'.\nPlease add new Windows on Arm SoC/chip support to arm/windows/init.c!", text_buffer);
|
||||
} else {
|
||||
cpuinfo_log_debug("detected chip model name: %s", chip_info->chip_name_string);
|
||||
}
|
||||
|
||||
HeapFree(heap, 0, text_buffer);
|
||||
return chip_info;
|
||||
}
|
||||
|
||||
static void set_cpuinfo_isa_fields(void)
|
||||
{
|
||||
cpuinfo_isa.atomics = IsProcessorFeaturePresent(PF_ARM_V81_ATOMIC_INSTRUCTIONS_AVAILABLE) != 0;
|
||||
|
||||
const bool dotprod = IsProcessorFeaturePresent(PF_ARM_V82_DP_INSTRUCTIONS_AVAILABLE) != 0;
|
||||
cpuinfo_isa.dot = dotprod;
|
||||
|
||||
SYSTEM_INFO system_info;
|
||||
GetSystemInfo(&system_info);
|
||||
switch (system_info.wProcessorLevel) {
|
||||
case 0x803: // Kryo 385 Silver (Snapdragon 850)
|
||||
cpuinfo_isa.fp16arith = dotprod;
|
||||
cpuinfo_isa.rdm = dotprod;
|
||||
break;
|
||||
default:
|
||||
// Assume that Dot Product support implies FP16 arithmetics and RDM support.
|
||||
// ARM manuals don't guarantee that, but it holds in practice.
|
||||
cpuinfo_isa.fp16arith = dotprod;
|
||||
cpuinfo_isa.rdm = dotprod;
|
||||
break;
|
||||
}
|
||||
|
||||
/* Windows API reports all or nothing for cryptographic instructions. */
|
||||
const bool crypto = IsProcessorFeaturePresent(PF_ARM_V8_CRYPTO_INSTRUCTIONS_AVAILABLE) != 0;
|
||||
cpuinfo_isa.aes = crypto;
|
||||
cpuinfo_isa.sha1 = crypto;
|
||||
cpuinfo_isa.sha2 = crypto;
|
||||
cpuinfo_isa.pmull = crypto;
|
||||
|
||||
cpuinfo_isa.crc32 = IsProcessorFeaturePresent(PF_ARM_V8_CRC32_INSTRUCTIONS_AVAILABLE) != 0;
|
||||
}
|
||||
38
3rdparty/cpuinfo/src/arm/windows/windows-arm-init.h
vendored
Normal file
38
3rdparty/cpuinfo/src/arm/windows/windows-arm-init.h
vendored
Normal file
@@ -0,0 +1,38 @@
|
||||
#pragma once
|
||||
|
||||
/* Efficiency class = 0 means little core, while 1 means big core for now. */
|
||||
#define MAX_WOA_VALID_EFFICIENCY_CLASSES 2
|
||||
|
||||
/* List of known and supported Windows on Arm SoCs/chips. */
|
||||
enum woa_chip_name {
|
||||
woa_chip_name_microsoft_sq_1 = 0,
|
||||
woa_chip_name_microsoft_sq_2 = 1,
|
||||
woa_chip_name_microsoft_sq_3 = 2,
|
||||
woa_chip_name_ampere_altra = 3,
|
||||
woa_chip_name_unknown = 4,
|
||||
woa_chip_name_last = woa_chip_name_unknown
|
||||
};
|
||||
|
||||
/* Topology information hard-coded by SoC/chip name */
|
||||
struct core_info_by_chip_name {
|
||||
enum cpuinfo_vendor vendor;
|
||||
enum cpuinfo_uarch uarch;
|
||||
uint64_t frequency; /* Hz */
|
||||
};
|
||||
|
||||
/* SoC/chip info that's currently not readable by logical system information,
|
||||
* but can be read from registry.
|
||||
*/
|
||||
struct woa_chip_info {
|
||||
wchar_t* chip_name_string;
|
||||
enum woa_chip_name chip_name;
|
||||
struct core_info_by_chip_name uarchs[MAX_WOA_VALID_EFFICIENCY_CLASSES];
|
||||
};
|
||||
|
||||
bool get_core_uarch_for_efficiency(
|
||||
enum woa_chip_name chip, BYTE EfficiencyClass,
|
||||
enum cpuinfo_uarch* uarch, uint64_t* frequency);
|
||||
|
||||
bool cpu_info_init_by_logical_sys_info(
|
||||
const struct woa_chip_info *chip_info,
|
||||
enum cpuinfo_vendor vendor);
|
||||
9
3rdparty/cpuinfo/src/cpuinfo/internal-api.h
vendored
9
3rdparty/cpuinfo/src/cpuinfo/internal-api.h
vendored
@@ -35,7 +35,7 @@ extern CPUINFO_INTERNAL uint32_t cpuinfo_packages_count;
|
||||
extern CPUINFO_INTERNAL uint32_t cpuinfo_cache_count[cpuinfo_cache_level_max];
|
||||
extern CPUINFO_INTERNAL uint32_t cpuinfo_max_cache_size;
|
||||
|
||||
#if CPUINFO_ARCH_ARM || CPUINFO_ARCH_ARM64
|
||||
#if CPUINFO_ARCH_ARM || CPUINFO_ARCH_ARM64 || CPUINFO_ARCH_RISCV32 || CPUINFO_ARCH_RISCV64
|
||||
extern CPUINFO_INTERNAL struct cpuinfo_uarch_info* cpuinfo_uarchs;
|
||||
extern CPUINFO_INTERNAL uint32_t cpuinfo_uarchs_count;
|
||||
#else
|
||||
@@ -51,10 +51,15 @@ extern CPUINFO_INTERNAL uint32_t cpuinfo_max_cache_size;
|
||||
CPUINFO_PRIVATE void cpuinfo_x86_mach_init(void);
|
||||
CPUINFO_PRIVATE void cpuinfo_x86_linux_init(void);
|
||||
#if defined(_WIN32) || defined(__CYGWIN__)
|
||||
CPUINFO_PRIVATE BOOL CALLBACK cpuinfo_x86_windows_init(PINIT_ONCE init_once, PVOID parameter, PVOID* context);
|
||||
#if CPUINFO_ARCH_ARM64
|
||||
CPUINFO_PRIVATE BOOL CALLBACK cpuinfo_arm_windows_init(PINIT_ONCE init_once, PVOID parameter, PVOID* context);
|
||||
#else
|
||||
CPUINFO_PRIVATE BOOL CALLBACK cpuinfo_x86_windows_init(PINIT_ONCE init_once, PVOID parameter, PVOID* context);
|
||||
#endif
|
||||
#endif
|
||||
CPUINFO_PRIVATE void cpuinfo_arm_mach_init(void);
|
||||
CPUINFO_PRIVATE void cpuinfo_arm_linux_init(void);
|
||||
CPUINFO_PRIVATE void cpuinfo_riscv_linux_init(void);
|
||||
CPUINFO_PRIVATE void cpuinfo_emscripten_init(void);
|
||||
|
||||
CPUINFO_PRIVATE uint32_t cpuinfo_compute_max_cache_size(const struct cpuinfo_processor* processor);
|
||||
|
||||
106
3rdparty/cpuinfo/src/cpuinfo/log.h
vendored
106
3rdparty/cpuinfo/src/cpuinfo/log.h
vendored
@@ -1,17 +1,103 @@
|
||||
#pragma once
|
||||
|
||||
#include <inttypes.h>
|
||||
|
||||
#include <clog.h>
|
||||
|
||||
#define CPUINFO_LOG_DEBUG_PARSERS 0
|
||||
#include <stdarg.h>
|
||||
#include <stdlib.h>
|
||||
|
||||
#ifndef CPUINFO_LOG_LEVEL
|
||||
#define CPUINFO_LOG_LEVEL CLOG_ERROR
|
||||
#error "Undefined CPUINFO_LOG_LEVEL"
|
||||
#endif
|
||||
|
||||
CLOG_DEFINE_LOG_DEBUG(cpuinfo_log_debug, "cpuinfo", CPUINFO_LOG_LEVEL);
|
||||
CLOG_DEFINE_LOG_INFO(cpuinfo_log_info, "cpuinfo", CPUINFO_LOG_LEVEL);
|
||||
CLOG_DEFINE_LOG_WARNING(cpuinfo_log_warning, "cpuinfo", CPUINFO_LOG_LEVEL);
|
||||
CLOG_DEFINE_LOG_ERROR(cpuinfo_log_error, "cpuinfo", CPUINFO_LOG_LEVEL);
|
||||
CLOG_DEFINE_LOG_FATAL(cpuinfo_log_fatal, "cpuinfo", CPUINFO_LOG_LEVEL);
|
||||
#define CPUINFO_LOG_NONE 0
|
||||
#define CPUINFO_LOG_FATAL 1
|
||||
#define CPUINFO_LOG_ERROR 2
|
||||
#define CPUINFO_LOG_WARNING 3
|
||||
#define CPUINFO_LOG_INFO 4
|
||||
#define CPUINFO_LOG_DEBUG 5
|
||||
|
||||
#ifndef CPUINFO_LOG_DEBUG_PARSERS
|
||||
#define CPUINFO_LOG_DEBUG_PARSERS 0
|
||||
#endif
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#if CPUINFO_LOG_LEVEL >= CPUINFO_LOG_DEBUG
|
||||
void cpuinfo_vlog_debug(const char* format, va_list args);
|
||||
#endif
|
||||
|
||||
#if CPUINFO_LOG_LEVEL >= CPUINFO_LOG_INFO
|
||||
void cpuinfo_vlog_info(const char* format, va_list args);
|
||||
#endif
|
||||
|
||||
#if CPUINFO_LOG_LEVEL >= CPUINFO_LOG_WARNING
|
||||
void cpuinfo_vlog_warning(const char* format, va_list args);
|
||||
#endif
|
||||
|
||||
#if CPUINFO_LOG_LEVEL >= CPUINFO_LOG_ERROR
|
||||
void cpuinfo_vlog_error(const char* format, va_list args);
|
||||
#endif
|
||||
|
||||
#if CPUINFO_LOG_LEVEL >= CPUINFO_LOG_FATAL
|
||||
void cpuinfo_vlog_fatal(const char* format, va_list args);
|
||||
#endif
|
||||
|
||||
#ifdef __cplusplus
|
||||
} // extern "C"
|
||||
#endif
|
||||
|
||||
#ifndef CPUINFO_LOG_ARGUMENTS_FORMAT
|
||||
#ifdef __GNUC__
|
||||
#define CPUINFO_LOG_ARGUMENTS_FORMAT __attribute__((__format__(__printf__, 1, 2)))
|
||||
#else
|
||||
#define CPUINFO_LOG_ARGUMENTS_FORMAT
|
||||
#endif
|
||||
#endif
|
||||
|
||||
CPUINFO_LOG_ARGUMENTS_FORMAT inline static void cpuinfo_log_debug(const char* format, ...) {
|
||||
#if CPUINFO_LOG_LEVEL >= CPUINFO_LOG_DEBUG
|
||||
va_list args;
|
||||
va_start(args, format);
|
||||
cpuinfo_vlog_debug(format, args);
|
||||
va_end(args);
|
||||
#endif
|
||||
}
|
||||
|
||||
CPUINFO_LOG_ARGUMENTS_FORMAT inline static void cpuinfo_log_info(const char* format, ...) {
|
||||
#if CPUINFO_LOG_LEVEL >= CPUINFO_LOG_INFO
|
||||
va_list args;
|
||||
va_start(args, format);
|
||||
cpuinfo_vlog_info(format, args);
|
||||
va_end(args);
|
||||
#endif
|
||||
}
|
||||
|
||||
CPUINFO_LOG_ARGUMENTS_FORMAT inline static void cpuinfo_log_warning(const char* format, ...) {
|
||||
#if CPUINFO_LOG_LEVEL >= CPUINFO_LOG_WARNING
|
||||
va_list args;
|
||||
va_start(args, format);
|
||||
cpuinfo_vlog_warning(format, args);
|
||||
va_end(args);
|
||||
#endif
|
||||
}
|
||||
|
||||
CPUINFO_LOG_ARGUMENTS_FORMAT inline static void cpuinfo_log_error(const char* format, ...) {
|
||||
#if CPUINFO_LOG_LEVEL >= CPUINFO_LOG_ERROR
|
||||
va_list args;
|
||||
va_start(args, format);
|
||||
cpuinfo_vlog_error(format, args);
|
||||
va_end(args);
|
||||
#endif
|
||||
}
|
||||
|
||||
CPUINFO_LOG_ARGUMENTS_FORMAT inline static void cpuinfo_log_fatal(const char* format, ...) {
|
||||
#if CPUINFO_LOG_LEVEL >= CPUINFO_LOG_FATAL
|
||||
va_list args;
|
||||
va_start(args, format);
|
||||
cpuinfo_vlog_fatal(format, args);
|
||||
va_end(args);
|
||||
#endif
|
||||
abort();
|
||||
}
|
||||
3
3rdparty/cpuinfo/src/cpuinfo/utils.h
vendored
3
3rdparty/cpuinfo/src/cpuinfo/utils.h
vendored
@@ -1,5 +1,8 @@
|
||||
#pragma once
|
||||
|
||||
#ifdef _MSC_VER
|
||||
#include <intrin.h>
|
||||
#endif
|
||||
#include <stdint.h>
|
||||
|
||||
|
||||
|
||||
8
3rdparty/cpuinfo/src/init.c
vendored
8
3rdparty/cpuinfo/src/init.c
vendored
@@ -37,6 +37,14 @@ bool CPUINFO_ABI cpuinfo_initialize(void) {
|
||||
pthread_once(&init_guard, &cpuinfo_arm_linux_init);
|
||||
#elif defined(__MACH__) && defined(__APPLE__)
|
||||
pthread_once(&init_guard, &cpuinfo_arm_mach_init);
|
||||
#elif defined(_WIN32)
|
||||
InitOnceExecuteOnce(&init_guard, &cpuinfo_arm_windows_init, NULL, NULL);
|
||||
#else
|
||||
cpuinfo_log_error("operating system is not supported in cpuinfo");
|
||||
#endif
|
||||
#elif CPUINFO_ARCH_RISCV32 || CPUINFO_ARCH_RISCV64
|
||||
#if defined(__linux__)
|
||||
pthread_once(&init_guard, &cpuinfo_riscv_linux_init);
|
||||
#else
|
||||
cpuinfo_log_error("operating system is not supported in cpuinfo");
|
||||
#endif
|
||||
|
||||
19
3rdparty/cpuinfo/src/linux/api.h
vendored
19
3rdparty/cpuinfo/src/linux/api.h
vendored
@@ -21,7 +21,8 @@
|
||||
#define CPUINFO_LINUX_FLAG_PACKAGE_CLUSTER UINT32_C(0x00000400)
|
||||
#define CPUINFO_LINUX_FLAG_PROC_CPUINFO UINT32_C(0x00000800)
|
||||
#define CPUINFO_LINUX_FLAG_VALID UINT32_C(0x00001000)
|
||||
|
||||
#define CPUINFO_LINUX_FLAG_CUR_FREQUENCY UINT32_C(0x00002000)
|
||||
#define CPUINFO_LINUX_FLAG_CLUSTER_CLUSTER UINT32_C(0x00004000)
|
||||
|
||||
typedef bool (*cpuinfo_cpulist_callback)(uint32_t, uint32_t, void*);
|
||||
CPUINFO_INTERNAL bool cpuinfo_linux_parse_cpulist(const char* filename, cpuinfo_cpulist_callback callback, void* context);
|
||||
@@ -33,6 +34,7 @@ CPUINFO_INTERNAL bool cpuinfo_linux_parse_multiline_file(const char* filename, s
|
||||
CPUINFO_INTERNAL uint32_t cpuinfo_linux_get_max_processors_count(void);
|
||||
CPUINFO_INTERNAL uint32_t cpuinfo_linux_get_max_possible_processor(uint32_t max_processors_count);
|
||||
CPUINFO_INTERNAL uint32_t cpuinfo_linux_get_max_present_processor(uint32_t max_processors_count);
|
||||
CPUINFO_INTERNAL uint32_t cpuinfo_linux_get_processor_cur_frequency(uint32_t processor);
|
||||
CPUINFO_INTERNAL uint32_t cpuinfo_linux_get_processor_min_frequency(uint32_t processor);
|
||||
CPUINFO_INTERNAL uint32_t cpuinfo_linux_get_processor_max_frequency(uint32_t processor);
|
||||
CPUINFO_INTERNAL bool cpuinfo_linux_get_processor_package_id(uint32_t processor, uint32_t package_id[restrict static 1]);
|
||||
@@ -54,6 +56,21 @@ CPUINFO_INTERNAL bool cpuinfo_linux_detect_thread_siblings(
|
||||
uint32_t processor,
|
||||
cpuinfo_siblings_callback callback,
|
||||
void* context);
|
||||
CPUINFO_INTERNAL bool cpuinfo_linux_detect_cluster_cpus(
|
||||
uint32_t max_processors_count,
|
||||
uint32_t processor,
|
||||
cpuinfo_siblings_callback callback,
|
||||
void* context);
|
||||
CPUINFO_INTERNAL bool cpuinfo_linux_detect_core_cpus(
|
||||
uint32_t max_processors_count,
|
||||
uint32_t processor,
|
||||
cpuinfo_siblings_callback callback,
|
||||
void* context);
|
||||
CPUINFO_INTERNAL bool cpuinfo_linux_detect_package_cpus(
|
||||
uint32_t max_processors_count,
|
||||
uint32_t processor,
|
||||
cpuinfo_siblings_callback callback,
|
||||
void* context);
|
||||
|
||||
extern CPUINFO_INTERNAL const struct cpuinfo_processor** cpuinfo_linux_cpu_to_processor_map;
|
||||
extern CPUINFO_INTERNAL const struct cpuinfo_core** cpuinfo_linux_cpu_to_core_map;
|
||||
|
||||
135
3rdparty/cpuinfo/src/linux/processors.c
vendored
135
3rdparty/cpuinfo/src/linux/processors.c
vendored
@@ -21,6 +21,7 @@
|
||||
#define KERNEL_MAX_FILENAME "/sys/devices/system/cpu/kernel_max"
|
||||
#define KERNEL_MAX_FILESIZE 32
|
||||
#define FREQUENCY_FILENAME_SIZE (sizeof("/sys/devices/system/cpu/cpu" STRINGIFY(UINT32_MAX) "/cpufreq/cpuinfo_max_freq"))
|
||||
#define CUR_FREQUENCY_FILENAME_FORMAT "/sys/devices/system/cpu/cpu%" PRIu32 "/cpufreq/cpuinfo_cur_freq"
|
||||
#define MAX_FREQUENCY_FILENAME_FORMAT "/sys/devices/system/cpu/cpu%" PRIu32 "/cpufreq/cpuinfo_max_freq"
|
||||
#define MIN_FREQUENCY_FILENAME_FORMAT "/sys/devices/system/cpu/cpu%" PRIu32 "/cpufreq/cpuinfo_min_freq"
|
||||
#define FREQUENCY_FILESIZE 32
|
||||
@@ -31,8 +32,14 @@
|
||||
#define CORE_ID_FILENAME_FORMAT "/sys/devices/system/cpu/cpu%" PRIu32 "/topology/core_id"
|
||||
#define CORE_ID_FILESIZE 32
|
||||
|
||||
#define CORE_CPUS_FILENAME_SIZE (sizeof("/sys/devices/system/cpu/cpu" STRINGIFY(UINT32_MAX) "/topology/core_cpus_list"))
|
||||
#define CORE_CPUS_FILENAME_FORMAT "/sys/devices/system/cpu/cpu%" PRIu32 "/topology/core_cpus_list"
|
||||
#define CORE_SIBLINGS_FILENAME_SIZE (sizeof("/sys/devices/system/cpu/cpu" STRINGIFY(UINT32_MAX) "/topology/core_siblings_list"))
|
||||
#define CORE_SIBLINGS_FILENAME_FORMAT "/sys/devices/system/cpu/cpu%" PRIu32 "/topology/core_siblings_list"
|
||||
#define CLUSTER_CPUS_FILENAME_SIZE (sizeof("/sys/devices/system/cpu/cpu" STRINGIFY(UINT32_MAX) "/topology/cluster_cpus_list"))
|
||||
#define CLUSTER_CPUS_FILENAME_FORMAT "/sys/devices/system/cpu/cpu%" PRIu32 "/topology/cluster_cpus_list"
|
||||
#define PACKAGE_CPUS_FILENAME_SIZE (sizeof("/sys/devices/system/cpu/cpu" STRINGIFY(UINT32_MAX) "/topology/package_cpus_list"))
|
||||
#define PACKAGE_CPUS_FILENAME_FORMAT "/sys/devices/system/cpu/cpu%" PRIu32 "/topology/package_cpus_list"
|
||||
#define THREAD_SIBLINGS_FILENAME_SIZE (sizeof("/sys/devices/system/cpu/cpu" STRINGIFY(UINT32_MAX) "/topology/thread_siblings_list"))
|
||||
#define THREAD_SIBLINGS_FILENAME_FORMAT "/sys/devices/system/cpu/cpu%" PRIu32 "/topology/thread_siblings_list"
|
||||
|
||||
@@ -125,6 +132,27 @@ uint32_t cpuinfo_linux_get_max_processors_count(void) {
|
||||
}
|
||||
}
|
||||
|
||||
uint32_t cpuinfo_linux_get_processor_cur_frequency(uint32_t processor) {
|
||||
char cur_frequency_filename[FREQUENCY_FILENAME_SIZE];
|
||||
const int chars_formatted = snprintf(
|
||||
cur_frequency_filename, FREQUENCY_FILENAME_SIZE, CUR_FREQUENCY_FILENAME_FORMAT, processor);
|
||||
if ((unsigned int) chars_formatted >= FREQUENCY_FILENAME_SIZE) {
|
||||
cpuinfo_log_warning("failed to format filename for current frequency of processor %"PRIu32, processor);
|
||||
return 0;
|
||||
}
|
||||
|
||||
uint32_t cur_frequency;
|
||||
if (cpuinfo_linux_parse_small_file(cur_frequency_filename, FREQUENCY_FILESIZE, uint32_parser, &cur_frequency)) {
|
||||
cpuinfo_log_debug("parsed currrent frequency value of %"PRIu32" KHz for logical processor %"PRIu32" from %s",
|
||||
cur_frequency, processor, cur_frequency_filename);
|
||||
return cur_frequency;
|
||||
} else {
|
||||
cpuinfo_log_warning("failed to parse current frequency for processor %"PRIu32" from %s",
|
||||
processor, cur_frequency_filename);
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
uint32_t cpuinfo_linux_get_processor_max_frequency(uint32_t processor) {
|
||||
char max_frequency_filename[FREQUENCY_FILENAME_SIZE];
|
||||
const int chars_formatted = snprintf(
|
||||
@@ -285,8 +313,7 @@ static bool detect_processor_parser(uint32_t processor_list_start, uint32_t proc
|
||||
}
|
||||
|
||||
bool cpuinfo_linux_detect_possible_processors(uint32_t max_processors_count,
|
||||
uint32_t* processor0_flags, uint32_t processor_struct_size, uint32_t possible_flag)
|
||||
{
|
||||
uint32_t* processor0_flags, uint32_t processor_struct_size, uint32_t possible_flag) {
|
||||
struct detect_processors_context context = {
|
||||
.max_processors_count = max_processors_count,
|
||||
.processor0_flags = processor0_flags,
|
||||
@@ -302,8 +329,7 @@ bool cpuinfo_linux_detect_possible_processors(uint32_t max_processors_count,
|
||||
}
|
||||
|
||||
bool cpuinfo_linux_detect_present_processors(uint32_t max_processors_count,
|
||||
uint32_t* processor0_flags, uint32_t processor_struct_size, uint32_t present_flag)
|
||||
{
|
||||
uint32_t* processor0_flags, uint32_t processor_struct_size, uint32_t present_flag) {
|
||||
struct detect_processors_context context = {
|
||||
.max_processors_count = max_processors_count,
|
||||
.processor0_flags = processor0_flags,
|
||||
@@ -340,12 +366,41 @@ static bool siblings_parser(uint32_t sibling_list_start, uint32_t sibling_list_e
|
||||
return context->callback(processor, sibling_list_start, sibling_list_end, context->callback_context);
|
||||
}
|
||||
|
||||
bool cpuinfo_linux_detect_core_cpus(
|
||||
uint32_t max_processors_count,
|
||||
uint32_t processor,
|
||||
cpuinfo_siblings_callback callback,
|
||||
void* context) {
|
||||
char core_cpus_filename[CORE_CPUS_FILENAME_SIZE];
|
||||
const int chars_formatted = snprintf(
|
||||
core_cpus_filename, CORE_CPUS_FILENAME_SIZE, CORE_CPUS_FILENAME_FORMAT, processor);
|
||||
if ((unsigned int) chars_formatted >= CORE_CPUS_FILENAME_SIZE) {
|
||||
cpuinfo_log_warning("failed to format filename for core cpus of processor %"PRIu32, processor);
|
||||
return false;
|
||||
}
|
||||
|
||||
struct siblings_context siblings_context = {
|
||||
.group_name = "cpus",
|
||||
.max_processors_count = max_processors_count,
|
||||
.processor = processor,
|
||||
.callback = callback,
|
||||
.callback_context = context,
|
||||
};
|
||||
if (cpuinfo_linux_parse_cpulist(core_cpus_filename,
|
||||
(cpuinfo_cpulist_callback) siblings_parser, &siblings_context)) {
|
||||
return true;
|
||||
} else {
|
||||
cpuinfo_log_info("failed to parse the list of core cpus for processor %"PRIu32" from %s",
|
||||
processor, core_cpus_filename);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
bool cpuinfo_linux_detect_core_siblings(
|
||||
uint32_t max_processors_count,
|
||||
uint32_t processor,
|
||||
cpuinfo_siblings_callback callback,
|
||||
void* context)
|
||||
{
|
||||
void* context) {
|
||||
char core_siblings_filename[CORE_SIBLINGS_FILENAME_SIZE];
|
||||
const int chars_formatted = snprintf(
|
||||
core_siblings_filename, CORE_SIBLINGS_FILENAME_SIZE, CORE_SIBLINGS_FILENAME_FORMAT, processor);
|
||||
@@ -362,8 +417,7 @@ bool cpuinfo_linux_detect_core_siblings(
|
||||
.callback_context = context,
|
||||
};
|
||||
if (cpuinfo_linux_parse_cpulist(core_siblings_filename,
|
||||
(cpuinfo_cpulist_callback) siblings_parser, &siblings_context))
|
||||
{
|
||||
(cpuinfo_cpulist_callback) siblings_parser, &siblings_context)) {
|
||||
return true;
|
||||
} else {
|
||||
cpuinfo_log_info("failed to parse the list of core siblings for processor %"PRIu32" from %s",
|
||||
@@ -376,8 +430,7 @@ bool cpuinfo_linux_detect_thread_siblings(
|
||||
uint32_t max_processors_count,
|
||||
uint32_t processor,
|
||||
cpuinfo_siblings_callback callback,
|
||||
void* context)
|
||||
{
|
||||
void* context) {
|
||||
char thread_siblings_filename[THREAD_SIBLINGS_FILENAME_SIZE];
|
||||
const int chars_formatted = snprintf(
|
||||
thread_siblings_filename, THREAD_SIBLINGS_FILENAME_SIZE, THREAD_SIBLINGS_FILENAME_FORMAT, processor);
|
||||
@@ -394,8 +447,7 @@ bool cpuinfo_linux_detect_thread_siblings(
|
||||
.callback_context = context,
|
||||
};
|
||||
if (cpuinfo_linux_parse_cpulist(thread_siblings_filename,
|
||||
(cpuinfo_cpulist_callback) siblings_parser, &siblings_context))
|
||||
{
|
||||
(cpuinfo_cpulist_callback) siblings_parser, &siblings_context)) {
|
||||
return true;
|
||||
} else {
|
||||
cpuinfo_log_info("failed to parse the list of thread siblings for processor %"PRIu32" from %s",
|
||||
@@ -404,3 +456,62 @@ bool cpuinfo_linux_detect_thread_siblings(
|
||||
}
|
||||
}
|
||||
|
||||
bool cpuinfo_linux_detect_cluster_cpus(
|
||||
uint32_t max_processors_count,
|
||||
uint32_t processor,
|
||||
cpuinfo_siblings_callback callback,
|
||||
void* context) {
|
||||
char cluster_cpus_filename[CLUSTER_CPUS_FILENAME_SIZE];
|
||||
const int chars_formatted = snprintf(
|
||||
cluster_cpus_filename, CLUSTER_CPUS_FILENAME_SIZE, CLUSTER_CPUS_FILENAME_FORMAT, processor);
|
||||
if ((unsigned int) chars_formatted >= CLUSTER_CPUS_FILENAME_SIZE) {
|
||||
cpuinfo_log_warning("failed to format filename for cluster cpus of processor %"PRIu32, processor);
|
||||
return false;
|
||||
}
|
||||
|
||||
struct siblings_context siblings_context = {
|
||||
.group_name = "cluster",
|
||||
.max_processors_count = max_processors_count,
|
||||
.processor = processor,
|
||||
.callback = callback,
|
||||
.callback_context = context,
|
||||
};
|
||||
if (cpuinfo_linux_parse_cpulist(cluster_cpus_filename,
|
||||
(cpuinfo_cpulist_callback) siblings_parser, &siblings_context)) {
|
||||
return true;
|
||||
} else {
|
||||
cpuinfo_log_info("failed to parse the list of cluster cpus for processor %"PRIu32" from %s",
|
||||
processor, cluster_cpus_filename);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
bool cpuinfo_linux_detect_package_cpus(
|
||||
uint32_t max_processors_count,
|
||||
uint32_t processor,
|
||||
cpuinfo_siblings_callback callback,
|
||||
void* context) {
|
||||
char package_cpus_filename[PACKAGE_CPUS_FILENAME_SIZE];
|
||||
const int chars_formatted = snprintf(
|
||||
package_cpus_filename, PACKAGE_CPUS_FILENAME_SIZE, PACKAGE_CPUS_FILENAME_FORMAT, processor);
|
||||
if ((unsigned int) chars_formatted >= PACKAGE_CPUS_FILENAME_SIZE) {
|
||||
cpuinfo_log_warning("failed to format filename for package cpus of processor %"PRIu32, processor);
|
||||
return false;
|
||||
}
|
||||
|
||||
struct siblings_context siblings_context = {
|
||||
.group_name = "package",
|
||||
.max_processors_count = max_processors_count,
|
||||
.processor = processor,
|
||||
.callback = callback,
|
||||
.callback_context = context,
|
||||
};
|
||||
if (cpuinfo_linux_parse_cpulist(package_cpus_filename,
|
||||
(cpuinfo_cpulist_callback) siblings_parser, &siblings_context)) {
|
||||
return true;
|
||||
} else {
|
||||
cpuinfo_log_info("failed to parse the list of package cpus for processor %"PRIu32" from %s",
|
||||
processor, package_cpus_filename);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
192
3rdparty/cpuinfo/src/log.c
vendored
Normal file
192
3rdparty/cpuinfo/src/log.c
vendored
Normal file
@@ -0,0 +1,192 @@
|
||||
#include <assert.h>
|
||||
#include <stdarg.h>
|
||||
#include <string.h>
|
||||
#include <stdlib.h>
|
||||
#include <stdio.h>
|
||||
#ifdef _WIN32
|
||||
#include <windows.h>
|
||||
#else
|
||||
#include <unistd.h>
|
||||
#endif
|
||||
#if defined(__ANDROID__)
|
||||
#include <android/log.h>
|
||||
#endif
|
||||
#if defined(__hexagon__)
|
||||
#include <qurt_printf.h>
|
||||
#endif
|
||||
|
||||
#ifndef CPUINFO_LOG_TO_STDIO
|
||||
#if defined(__ANDROID__)
|
||||
#define CPUINFO_LOG_TO_STDIO 0
|
||||
#else
|
||||
#define CPUINFO_LOG_TO_STDIO 1
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#include <cpuinfo/log.h>
|
||||
|
||||
|
||||
/* Messages up to this size are formatted entirely on-stack, and don't allocate heap memory */
|
||||
#define CPUINFO_LOG_STACK_BUFFER_SIZE 1024
|
||||
|
||||
#ifdef _WIN32
|
||||
#define CPUINFO_LOG_NEWLINE_LENGTH 2
|
||||
|
||||
#define CPUINFO_LOG_STDERR STD_ERROR_HANDLE
|
||||
#define CPUINFO_LOG_STDOUT STD_OUTPUT_HANDLE
|
||||
#elif defined(__hexagon__)
|
||||
#define CPUINFO_LOG_NEWLINE_LENGTH 1
|
||||
|
||||
#define CPUINFO_LOG_STDERR 0
|
||||
#define CPUINFO_LOG_STDOUT 0
|
||||
#else
|
||||
#define CPUINFO_LOG_NEWLINE_LENGTH 1
|
||||
|
||||
#define CPUINFO_LOG_STDERR STDERR_FILENO
|
||||
#define CPUINFO_LOG_STDOUT STDOUT_FILENO
|
||||
#endif
|
||||
|
||||
#if CPUINFO_LOG_TO_STDIO
|
||||
static void cpuinfo_vlog(int output_handle, const char* prefix, size_t prefix_length, const char* format, va_list args) {
|
||||
char stack_buffer[CPUINFO_LOG_STACK_BUFFER_SIZE];
|
||||
char* heap_buffer = NULL;
|
||||
char* out_buffer = &stack_buffer[0];
|
||||
|
||||
/* The first call to vsnprintf will clobber args, thus need a copy in case a second vsnprintf call is needed */
|
||||
va_list args_copy;
|
||||
va_copy(args_copy, args);
|
||||
|
||||
memcpy(stack_buffer, prefix, prefix_length * sizeof(char));
|
||||
assert((prefix_length + CPUINFO_LOG_NEWLINE_LENGTH) * sizeof(char) <= CPUINFO_LOG_STACK_BUFFER_SIZE);
|
||||
|
||||
const int format_chars = vsnprintf(
|
||||
&stack_buffer[prefix_length],
|
||||
CPUINFO_LOG_STACK_BUFFER_SIZE - (prefix_length + CPUINFO_LOG_NEWLINE_LENGTH) * sizeof(char),
|
||||
format,
|
||||
args);
|
||||
if (format_chars < 0) {
|
||||
/* Format error in the message: silently ignore this particular message. */
|
||||
goto cleanup;
|
||||
}
|
||||
const size_t format_length = (size_t) format_chars;
|
||||
if ((prefix_length + format_length + CPUINFO_LOG_NEWLINE_LENGTH) * sizeof(char) > CPUINFO_LOG_STACK_BUFFER_SIZE) {
|
||||
/* Allocate a buffer on heap, and vsnprintf to this buffer */
|
||||
const size_t heap_buffer_size = (prefix_length + format_length + CPUINFO_LOG_NEWLINE_LENGTH) * sizeof(char);
|
||||
#if _WIN32
|
||||
heap_buffer = HeapAlloc(GetProcessHeap(), 0, heap_buffer_size);
|
||||
#else
|
||||
heap_buffer = malloc(heap_buffer_size);
|
||||
#endif
|
||||
if (heap_buffer == NULL) {
|
||||
goto cleanup;
|
||||
}
|
||||
|
||||
/* Copy pre-formatted prefix into the on-heap buffer */
|
||||
memcpy(heap_buffer, prefix, prefix_length * sizeof(char));
|
||||
vsnprintf(&heap_buffer[prefix_length], (format_length + CPUINFO_LOG_NEWLINE_LENGTH) * sizeof(char), format, args_copy);
|
||||
out_buffer = heap_buffer;
|
||||
}
|
||||
#ifdef _WIN32
|
||||
out_buffer[prefix_length + format_length] = '\r';
|
||||
out_buffer[prefix_length + format_length + 1] = '\n';
|
||||
|
||||
DWORD bytes_written;
|
||||
WriteFile(
|
||||
GetStdHandle((DWORD) output_handle),
|
||||
out_buffer, (prefix_length + format_length + CPUINFO_LOG_NEWLINE_LENGTH) * sizeof(char),
|
||||
&bytes_written, NULL);
|
||||
#elif defined(__hexagon__)
|
||||
qurt_printf("%s", out_buffer);
|
||||
#else
|
||||
out_buffer[prefix_length + format_length] = '\n';
|
||||
|
||||
ssize_t bytes_written = write(output_handle, out_buffer, (prefix_length + format_length + CPUINFO_LOG_NEWLINE_LENGTH) * sizeof(char));
|
||||
(void) bytes_written;
|
||||
#endif
|
||||
|
||||
cleanup:
|
||||
#ifdef _WIN32
|
||||
HeapFree(GetProcessHeap(), 0, heap_buffer);
|
||||
#else
|
||||
free(heap_buffer);
|
||||
#endif
|
||||
va_end(args_copy);
|
||||
}
|
||||
#elif defined(__ANDROID__) && CPUINFO_LOG_LEVEL > CPUINFO_LOG_NONE
|
||||
static const char cpuinfo_module[] = "XNNPACK";
|
||||
#endif
|
||||
|
||||
#if CPUINFO_LOG_LEVEL >= CPUINFO_LOG_DEBUG
|
||||
void cpuinfo_vlog_debug(const char* format, va_list args) {
|
||||
#if CPUINFO_LOG_TO_STDIO
|
||||
static const char debug_prefix[17] = {
|
||||
'D', 'e', 'b', 'u', 'g', ' ', '(', 'c', 'p', 'u', 'i', 'n', 'f', 'o', ')', ':', ' '
|
||||
};
|
||||
cpuinfo_vlog(CPUINFO_LOG_STDOUT, debug_prefix, 17, format, args);
|
||||
#elif defined(__ANDROID__)
|
||||
__android_log_vprint(ANDROID_LOG_DEBUG, cpuinfo_module, format, args);
|
||||
#else
|
||||
#error "Platform-specific implementation required"
|
||||
#endif
|
||||
}
|
||||
#endif
|
||||
|
||||
#if CPUINFO_LOG_LEVEL >= CPUINFO_LOG_INFO
|
||||
void cpuinfo_vlog_info(const char* format, va_list args) {
|
||||
#if CPUINFO_LOG_TO_STDIO
|
||||
static const char info_prefix[16] = {
|
||||
'N', 'o', 't', 'e', ' ', '(', 'c', 'p', 'u', 'i', 'n', 'f', 'o', ')', ':', ' '
|
||||
};
|
||||
cpuinfo_vlog(CPUINFO_LOG_STDOUT, info_prefix, 16, format, args);
|
||||
#elif defined(__ANDROID__)
|
||||
__android_log_vprint(ANDROID_LOG_INFO, cpuinfo_module, format, args);
|
||||
#else
|
||||
#error "Platform-specific implementation required"
|
||||
#endif
|
||||
}
|
||||
#endif
|
||||
|
||||
#if CPUINFO_LOG_LEVEL >= CPUINFO_LOG_WARNING
|
||||
void cpuinfo_vlog_warning(const char* format, va_list args) {
|
||||
#if CPUINFO_LOG_TO_STDIO
|
||||
static const char warning_prefix[20] = {
|
||||
'W', 'a', 'r', 'n', 'i', 'n', 'g', ' ', 'i', 'n', ' ', 'c', 'p', 'u', 'i', 'n', 'f', 'o', ':', ' '
|
||||
};
|
||||
cpuinfo_vlog(CPUINFO_LOG_STDERR, warning_prefix, 20, format, args);
|
||||
#elif defined(__ANDROID__)
|
||||
__android_log_vprint(ANDROID_LOG_WARN, cpuinfo_module, format, args);
|
||||
#else
|
||||
#error "Platform-specific implementation required"
|
||||
#endif
|
||||
}
|
||||
#endif
|
||||
|
||||
#if CPUINFO_LOG_LEVEL >= CPUINFO_LOG_ERROR
|
||||
void cpuinfo_vlog_error(const char* format, va_list args) {
|
||||
#if CPUINFO_LOG_TO_STDIO
|
||||
static const char error_prefix[18] = {
|
||||
'E', 'r', 'r', 'o', 'r', ' ', 'i', 'n', ' ', 'c', 'p', 'u', 'i', 'n', 'f', 'o', ':', ' '
|
||||
};
|
||||
cpuinfo_vlog(CPUINFO_LOG_STDERR, error_prefix, 18, format, args);
|
||||
#elif defined(__ANDROID__)
|
||||
__android_log_vprint(ANDROID_LOG_ERROR, cpuinfo_module, format, args);
|
||||
#else
|
||||
#error "Platform-specific implementation required"
|
||||
#endif
|
||||
}
|
||||
#endif
|
||||
|
||||
#if CPUINFO_LOG_LEVEL >= CPUINFO_LOG_FATAL
|
||||
void cpuinfo_vlog_fatal(const char* format, va_list args) {
|
||||
#if CPUINFO_LOG_TO_STDIO
|
||||
static const char fatal_prefix[24] = {
|
||||
'F', 'a', 't', 'a', 'l', ' ', 'e', 'r', 'r', 'o', 'r', ' ', 'i', 'n', ' ', 'c', 'p', 'u', 'i', 'n', 'f', 'o', ':', ' '
|
||||
};
|
||||
cpuinfo_vlog(CPUINFO_LOG_STDERR, fatal_prefix, 24, format, args);
|
||||
#elif defined(__ANDROID__)
|
||||
__android_log_vprint(ANDROID_LOG_FATAL, cpuinfo_module, format, args);
|
||||
#else
|
||||
#error "Platform-specific implementation required"
|
||||
#endif
|
||||
}
|
||||
#endif
|
||||
42
3rdparty/cpuinfo/src/riscv/api.h
vendored
Normal file
42
3rdparty/cpuinfo/src/riscv/api.h
vendored
Normal file
@@ -0,0 +1,42 @@
|
||||
#pragma once
|
||||
|
||||
#include <stdint.h>
|
||||
|
||||
#include <cpuinfo.h>
|
||||
#include <cpuinfo/common.h>
|
||||
|
||||
/* RISC-V Vendor IDs. */
|
||||
enum cpuinfo_riscv_chipset_vendor {
|
||||
cpuinfo_riscv_chipset_vendor_unknown = 0,
|
||||
cpuinfo_riscv_chipset_sifive = 0x489,
|
||||
cpuinfo_riscv_chipset_vendor_max,
|
||||
};
|
||||
|
||||
/* RISC-V Architecture IDs. */
|
||||
enum cpuinfo_riscv_chipset_arch {
|
||||
cpuinfo_riscv_chipset_arch_unknown = 0,
|
||||
cpuinfo_riscv_chipset_arch_max,
|
||||
};
|
||||
|
||||
/* RISC-V Implementation IDs. */
|
||||
enum cpuinfo_riscv_chipset_impl {
|
||||
cpuinfo_riscv_chipset_impl_unknown = 0,
|
||||
cpuinfo_riscv_chipset_impl_max,
|
||||
};
|
||||
|
||||
/**
|
||||
* Decodes the vendor and micro-architecture based on the provided input
|
||||
* parameters, regardless of underlying operating system.
|
||||
*
|
||||
* @param[vendor_id]: The 'mvendorid' as described by the RISC-V Manual.
|
||||
* @param[arch_id]: The 'marchid' as described by the RISC-V Manual.
|
||||
* @param[imp_id]: The 'mimplid' as described by the RISC-V Manual.
|
||||
* @param[vendor] - Reference to the cpuinfo_vendor to populate.
|
||||
* @param[uarch] - Reference to the cpuinfo_uarch to populate.
|
||||
*/
|
||||
CPUINFO_INTERNAL void cpuinfo_riscv_decode_vendor_uarch(
|
||||
uint32_t vendor_id,
|
||||
uint32_t arch_id,
|
||||
uint32_t imp_id,
|
||||
enum cpuinfo_vendor vendor[restrict static 1],
|
||||
enum cpuinfo_uarch uarch[restrict static 1]);
|
||||
69
3rdparty/cpuinfo/src/riscv/linux/api.h
vendored
Normal file
69
3rdparty/cpuinfo/src/riscv/linux/api.h
vendored
Normal file
@@ -0,0 +1,69 @@
|
||||
#pragma once
|
||||
|
||||
#include <cpuinfo.h>
|
||||
#include <cpuinfo/common.h>
|
||||
|
||||
/**
|
||||
* Definition of a RISC-V Linux processor. It is composed of the base processor
|
||||
* definition in "include/cpuinfo.h" and flags specific to RISC-V Linux
|
||||
* implementations.
|
||||
*/
|
||||
struct cpuinfo_riscv_linux_processor {
|
||||
/* Public ABI cpuinfo structures. */
|
||||
struct cpuinfo_processor processor;
|
||||
struct cpuinfo_core core;
|
||||
struct cpuinfo_cluster cluster;
|
||||
struct cpuinfo_package package;
|
||||
|
||||
/**
|
||||
* Linux-specific flags for the logical processor:
|
||||
* - Bit field that can be masked with CPUINFO_LINUX_FLAG_*.
|
||||
*/
|
||||
uint32_t flags;
|
||||
|
||||
/**
|
||||
* Minimum processor ID on the cluster which includes this logical processor.
|
||||
* This value can serve as an ID for the cluster of logical processors: it is the
|
||||
* same for all logical processors on the same package.
|
||||
*/
|
||||
uint32_t cluster_leader_id;
|
||||
|
||||
/**
|
||||
* Minimum processor ID on the core which includes this logical processor.
|
||||
* This value can serve as an ID for the core of logical processors: it
|
||||
* is the same for all logical processors on the same core.
|
||||
*/
|
||||
uint32_t core_leader_id;
|
||||
|
||||
/**
|
||||
* Minimum processor ID on the package which includes this logical processor.
|
||||
* This value can serve as an ID for the package of logical processors: it
|
||||
* is the same for all logical processors on the same package.
|
||||
*/
|
||||
uint32_t package_leader_id;
|
||||
};
|
||||
|
||||
/**
|
||||
* Reads AT_HWCAP from `getauxval` and populates the cpuinfo_riscv_isa
|
||||
* structure.
|
||||
*
|
||||
* @param[isa] - Reference to cpuinfo_riscv_isa structure to populate.
|
||||
*/
|
||||
CPUINFO_INTERNAL void cpuinfo_riscv_linux_decode_isa_from_hwcap(
|
||||
struct cpuinfo_riscv_isa isa[restrict static 1]);
|
||||
|
||||
/**
|
||||
* Reads `sys_riscv_hwprobe` and determines the processor vendor and
|
||||
* micro-architecture.
|
||||
*
|
||||
* @param[processor] - The Linux ID of the target processor.
|
||||
* @param[vendor] - Reference to the cpuinfo_vendor to populate.
|
||||
* @param[uarch] - Reference to the cpuinfo_uarch to populate.
|
||||
*/
|
||||
CPUINFO_INTERNAL void cpuinfo_riscv_linux_decode_vendor_uarch_from_hwprobe(
|
||||
uint32_t processor,
|
||||
enum cpuinfo_vendor vendor[restrict static 1],
|
||||
enum cpuinfo_uarch uarch[restrict static 1]);
|
||||
|
||||
/* Used to determine which uarch is associated with the current thread. */
|
||||
extern CPUINFO_INTERNAL const uint32_t* cpuinfo_linux_cpu_to_uarch_index_map;
|
||||
620
3rdparty/cpuinfo/src/riscv/linux/init.c
vendored
Normal file
620
3rdparty/cpuinfo/src/riscv/linux/init.c
vendored
Normal file
@@ -0,0 +1,620 @@
|
||||
#include <string.h>
|
||||
|
||||
#include <cpuinfo/internal-api.h>
|
||||
#include <cpuinfo/log.h>
|
||||
#include <linux/api.h>
|
||||
#include <riscv/linux/api.h>
|
||||
|
||||
/* ISA structure to hold supported extensions. */
|
||||
struct cpuinfo_riscv_isa cpuinfo_isa;
|
||||
|
||||
/* Helper function to bitmask flags and ensure operator precedence. */
|
||||
static inline bool bitmask_all(uint32_t flags, uint32_t mask) {
|
||||
return (flags & mask) == mask;
|
||||
}
|
||||
|
||||
static int compare_riscv_linux_processors(const void* a, const void* b) {
|
||||
/**
|
||||
* For our purposes, it is only relevant that the list is sorted by
|
||||
* micro-architecture, so the nature of ordering is irrelevant.
|
||||
*/
|
||||
return ((const struct cpuinfo_riscv_linux_processor*)a)->core.uarch
|
||||
- ((const struct cpuinfo_riscv_linux_processor*)b)->core.uarch;
|
||||
}
|
||||
|
||||
/**
|
||||
* Parses the core cpus list for each processor. This function is called once
|
||||
* per-processor, with the IDs of all other processors in the core list.
|
||||
*
|
||||
* The 'processor_[start|count]' are populated in the processor's 'core'
|
||||
* attribute, with 'start' being the smallest ID in the core list.
|
||||
*
|
||||
* The 'core_leader_id' of each processor is set to the smallest ID in it's
|
||||
* cluster CPU list.
|
||||
*
|
||||
* Precondition: The element in the 'processors' list must be initialized with
|
||||
* their 'core_leader_id' to their index in the list.
|
||||
|
||||
* E.g. processors[0].core_leader_id = 0.
|
||||
*/
|
||||
static bool core_cpus_parser(uint32_t processor,
|
||||
uint32_t core_cpus_start,
|
||||
uint32_t core_cpus_end,
|
||||
struct cpuinfo_riscv_linux_processor* processors) {
|
||||
uint32_t processor_start = UINT32_MAX;
|
||||
uint32_t processor_count = 0;
|
||||
|
||||
/* If the processor already has a leader, use it. */
|
||||
if (bitmask_all(processors[processor].flags, CPUINFO_LINUX_FLAG_CORE_CLUSTER)) {
|
||||
processor_start = processors[processor].core_leader_id;
|
||||
}
|
||||
|
||||
for (size_t core_cpu = core_cpus_start; core_cpu < core_cpus_end; core_cpu++) {
|
||||
if (!bitmask_all(processors[core_cpu].flags, CPUINFO_LINUX_FLAG_VALID)) {
|
||||
continue;
|
||||
}
|
||||
/**
|
||||
* The first valid processor observed is the smallest ID in the
|
||||
* list that attaches to this core.
|
||||
*/
|
||||
if (processor_start == UINT32_MAX) {
|
||||
processor_start = core_cpu;
|
||||
}
|
||||
processors[core_cpu].core_leader_id = processor_start;
|
||||
processor_count++;
|
||||
}
|
||||
/**
|
||||
* If the cluster flag has not been set, assign the processor start. If
|
||||
* it has been set, only apply the processor start if it's less than the
|
||||
* held value. This can happen if the callback is invoked twice:
|
||||
*
|
||||
* e.g. core_cpu_list=1,10-12
|
||||
*/
|
||||
if (!bitmask_all(processors[processor].flags, CPUINFO_LINUX_FLAG_CORE_CLUSTER)
|
||||
|| processors[processor].core.processor_start > processor_start) {
|
||||
processors[processor].core.processor_start = processor_start;
|
||||
processors[processor].core_leader_id = processor_start;
|
||||
}
|
||||
processors[processor].core.processor_count += processor_count;
|
||||
processors[processor].flags |= CPUINFO_LINUX_FLAG_CORE_CLUSTER;
|
||||
/* The parser has failed only if no processors were found. */
|
||||
return processor_count != 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* Parses the cluster cpu list for each processor. This function is called once
|
||||
* per-processor, with the IDs of all other processors in the cluster.
|
||||
*
|
||||
* The 'cluster_leader_id' of each processor is set to the smallest ID in it's
|
||||
* cluster CPU list.
|
||||
*
|
||||
* Precondition: The element in the 'processors' list must be initialized with
|
||||
* their 'cluster_leader_id' to their index in the list.
|
||||
* E.g. processors[0].cluster_leader_id = 0.
|
||||
*/
|
||||
static bool cluster_cpus_parser(uint32_t processor,
|
||||
uint32_t cluster_cpus_start,
|
||||
uint32_t cluster_cpus_end,
|
||||
struct cpuinfo_riscv_linux_processor* processors) {
|
||||
uint32_t processor_start = UINT32_MAX;
|
||||
uint32_t processor_count = 0;
|
||||
uint32_t core_count = 0;
|
||||
|
||||
/* If the processor already has a leader, use it. */
|
||||
if (bitmask_all(processors[processor].flags, CPUINFO_LINUX_FLAG_CLUSTER_CLUSTER)) {
|
||||
processor_start = processors[processor].cluster_leader_id;
|
||||
}
|
||||
|
||||
for (size_t cluster_cpu = cluster_cpus_start; cluster_cpu < cluster_cpus_end; cluster_cpu++) {
|
||||
if (!bitmask_all(processors[cluster_cpu].flags, CPUINFO_LINUX_FLAG_VALID)) {
|
||||
continue;
|
||||
}
|
||||
/**
|
||||
* The first valid processor observed is the smallest ID in the
|
||||
* list that attaches to this core.
|
||||
*/
|
||||
if (processor_start == UINT32_MAX) {
|
||||
processor_start = cluster_cpu;
|
||||
}
|
||||
processors[cluster_cpu].cluster_leader_id = processor_start;
|
||||
processor_count++;
|
||||
/**
|
||||
* A processor should only represent it's core if it is the
|
||||
* assigned leader of that core.
|
||||
*/
|
||||
if (processors[cluster_cpu].core_leader_id == cluster_cpu) {
|
||||
core_count++;
|
||||
}
|
||||
}
|
||||
/**
|
||||
* If the cluster flag has not been set, assign the processor start. If
|
||||
* it has been set, only apply the processor start if it's less than the
|
||||
* held value. This can happen if the callback is invoked twice:
|
||||
*
|
||||
* e.g. cluster_cpus_list=1,10-12
|
||||
*/
|
||||
if (!bitmask_all(processors[processor].flags, CPUINFO_LINUX_FLAG_CLUSTER_CLUSTER)
|
||||
|| processors[processor].cluster.processor_start > processor_start) {
|
||||
processors[processor].cluster.processor_start = processor_start;
|
||||
processors[processor].cluster.core_start = processor_start;
|
||||
processors[processor].cluster.cluster_id = processor_start;
|
||||
processors[processor].cluster_leader_id = processor_start;
|
||||
}
|
||||
processors[processor].cluster.processor_count += processor_count;
|
||||
processors[processor].cluster.core_count += core_count;
|
||||
processors[processor].flags |= CPUINFO_LINUX_FLAG_CLUSTER_CLUSTER;
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Parses the package cpus list for each processor. This function is called once
|
||||
* per-processor, with the IDs of all other processors in the package list.
|
||||
*
|
||||
* The 'processor_[start|count]' are populated in the processor's 'package'
|
||||
* attribute, with 'start' being the smallest ID in the package list.
|
||||
*
|
||||
* The 'package_leader_id' of each processor is set to the smallest ID in it's
|
||||
* cluster CPU list.
|
||||
*
|
||||
* Precondition: The element in the 'processors' list must be initialized with
|
||||
* their 'package_leader_id' to their index in the list.
|
||||
* E.g. processors[0].package_leader_id = 0.
|
||||
*/
|
||||
static bool package_cpus_parser(uint32_t processor,
|
||||
uint32_t package_cpus_start,
|
||||
uint32_t package_cpus_end,
|
||||
struct cpuinfo_riscv_linux_processor* processors) {
|
||||
uint32_t processor_start = UINT32_MAX;
|
||||
uint32_t processor_count = 0;
|
||||
uint32_t cluster_count = 0;
|
||||
uint32_t core_count = 0;
|
||||
|
||||
/* If the processor already has a leader, use it. */
|
||||
if (bitmask_all(processors[processor].flags, CPUINFO_LINUX_FLAG_PACKAGE_CLUSTER)) {
|
||||
processor_start = processors[processor].package_leader_id;
|
||||
}
|
||||
|
||||
for (size_t package_cpu = package_cpus_start; package_cpu < package_cpus_end; package_cpu++) {
|
||||
if (!bitmask_all(processors[package_cpu].flags, CPUINFO_LINUX_FLAG_VALID)) {
|
||||
continue;
|
||||
}
|
||||
/**
|
||||
* The first valid processor observed is the smallest ID in the
|
||||
* list that attaches to this package.
|
||||
*/
|
||||
if (processor_start == UINT32_MAX) {
|
||||
processor_start = package_cpu;
|
||||
}
|
||||
processors[package_cpu].package_leader_id = processor_start;
|
||||
processor_count++;
|
||||
/**
|
||||
* A processor should only represent it's core if it is the
|
||||
* assigned leader of that core, and similarly for it's cluster.
|
||||
*/
|
||||
if (processors[package_cpu].cluster_leader_id == package_cpu) {
|
||||
cluster_count++;
|
||||
}
|
||||
if (processors[package_cpu].core_leader_id == package_cpu) {
|
||||
core_count++;
|
||||
}
|
||||
}
|
||||
/**
|
||||
* If the cluster flag has not been set, assign the processor start. If
|
||||
* it has been set, only apply the processor start if it's less than the
|
||||
* held value. This can happen if the callback is invoked twice:
|
||||
*
|
||||
* e.g. package_cpus_list=1,10-12
|
||||
*/
|
||||
if (!bitmask_all(processors[processor].flags, CPUINFO_LINUX_FLAG_PACKAGE_CLUSTER)
|
||||
|| processors[processor].package.processor_start > processor_start) {
|
||||
processors[processor].package.processor_start = processor_start;
|
||||
processors[processor].package.cluster_start = processor_start;
|
||||
processors[processor].package.core_start = processor_start;
|
||||
processors[processor].package_leader_id = processor_start;
|
||||
}
|
||||
processors[processor].package.processor_count += processor_count;
|
||||
processors[processor].package.cluster_count += cluster_count;
|
||||
processors[processor].package.core_count += core_count;
|
||||
processors[processor].flags |= CPUINFO_LINUX_FLAG_PACKAGE_CLUSTER;
|
||||
return true;
|
||||
}
|
||||
|
||||
/* Initialization for the RISC-V Linux system. */
|
||||
void cpuinfo_riscv_linux_init(void) {
|
||||
struct cpuinfo_riscv_linux_processor* riscv_linux_processors = NULL;
|
||||
struct cpuinfo_processor* processors = NULL;
|
||||
struct cpuinfo_package* packages = NULL;
|
||||
struct cpuinfo_cluster* clusters = NULL;
|
||||
struct cpuinfo_core* cores = NULL;
|
||||
struct cpuinfo_uarch_info* uarchs = NULL;
|
||||
const struct cpuinfo_processor** linux_cpu_to_processor_map = NULL;
|
||||
const struct cpuinfo_core** linux_cpu_to_core_map = NULL;
|
||||
uint32_t* linux_cpu_to_uarch_index_map = NULL;
|
||||
|
||||
/**
|
||||
* The interesting set of processors are the number of 'present'
|
||||
* processors on the system. There may be more 'possible' processors, but
|
||||
* processor information cannot be gathered on non-present processors.
|
||||
*
|
||||
* Note: For SoCs, it is largely the case that all processors are known
|
||||
* at boot and no processors are hotplugged at runtime, so the
|
||||
* 'present' and 'possible' list is often the same.
|
||||
*
|
||||
* Note: This computes the maximum processor ID of the 'present'
|
||||
* processors. It is not a count of the number of processors on the
|
||||
* system.
|
||||
*/
|
||||
const uint32_t max_processor_id = 1 +
|
||||
cpuinfo_linux_get_max_present_processor(
|
||||
cpuinfo_linux_get_max_processors_count());
|
||||
if (max_processor_id == 0) {
|
||||
cpuinfo_log_error("failed to discover any processors");
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
* Allocate space to store all processor information. This array is
|
||||
* sized to the max processor ID as opposed to the number of 'present'
|
||||
* processors, to leverage pointer math in the common utility functions.
|
||||
*/
|
||||
riscv_linux_processors = calloc(max_processor_id,
|
||||
sizeof(struct cpuinfo_riscv_linux_processor));
|
||||
if (riscv_linux_processors == NULL) {
|
||||
cpuinfo_log_error("failed to allocate %zu bytes for %"PRIu32" processors.",
|
||||
max_processor_id * sizeof(struct cpuinfo_riscv_linux_processor),
|
||||
max_processor_id);
|
||||
goto cleanup;
|
||||
}
|
||||
|
||||
/**
|
||||
* Attempt to detect all processors and apply the corresponding flag to
|
||||
* each processor struct that we find.
|
||||
*/
|
||||
if (!cpuinfo_linux_detect_present_processors(max_processor_id,
|
||||
&riscv_linux_processors->flags,
|
||||
sizeof(struct cpuinfo_riscv_linux_processor),
|
||||
CPUINFO_LINUX_FLAG_PRESENT | CPUINFO_LINUX_FLAG_VALID)) {
|
||||
cpuinfo_log_error("failed to detect present processors");
|
||||
goto cleanup;
|
||||
}
|
||||
|
||||
/* Populate processor information. */
|
||||
for (size_t processor = 0; processor < max_processor_id; processor++) {
|
||||
if (!bitmask_all(riscv_linux_processors[processor].flags, CPUINFO_LINUX_FLAG_VALID)) {
|
||||
continue;
|
||||
}
|
||||
/* TODO: Determine if an 'smt_id' is available. */
|
||||
riscv_linux_processors[processor].processor.linux_id = processor;
|
||||
}
|
||||
|
||||
/* Populate core information. */
|
||||
for (size_t processor = 0; processor < max_processor_id; processor++) {
|
||||
if (!bitmask_all(riscv_linux_processors[processor].flags, CPUINFO_LINUX_FLAG_VALID)) {
|
||||
continue;
|
||||
}
|
||||
|
||||
/* Populate processor start and count information. */
|
||||
if (!cpuinfo_linux_detect_core_cpus(
|
||||
max_processor_id,
|
||||
processor,
|
||||
(cpuinfo_siblings_callback) core_cpus_parser,
|
||||
riscv_linux_processors)) {
|
||||
cpuinfo_log_error("failed to detect core cpus for processor %zu.", processor);
|
||||
goto cleanup;
|
||||
}
|
||||
|
||||
/* Populate core ID information. */
|
||||
if (cpuinfo_linux_get_processor_core_id(
|
||||
processor,
|
||||
&riscv_linux_processors[processor].core.core_id)) {
|
||||
riscv_linux_processors[processor].flags |= CPUINFO_LINUX_FLAG_CORE_ID;
|
||||
}
|
||||
|
||||
/**
|
||||
* Populate the vendor and uarch of this core from this
|
||||
* processor. When the final 'cores' list is constructed, only
|
||||
* the values from the core leader will be honored.
|
||||
*/
|
||||
cpuinfo_riscv_linux_decode_vendor_uarch_from_hwprobe(
|
||||
processor,
|
||||
&riscv_linux_processors[processor].core.vendor,
|
||||
&riscv_linux_processors[processor].core.uarch);
|
||||
|
||||
/* Populate frequency information of this core. */
|
||||
uint32_t frequency = cpuinfo_linux_get_processor_cur_frequency(processor);
|
||||
if (frequency != 0) {
|
||||
riscv_linux_processors[processor].core.frequency = frequency;
|
||||
riscv_linux_processors[processor].flags |= CPUINFO_LINUX_FLAG_CUR_FREQUENCY;
|
||||
}
|
||||
}
|
||||
|
||||
/* Populate cluster information. */
|
||||
for (size_t processor = 0; processor < max_processor_id; processor++) {
|
||||
if (!bitmask_all(riscv_linux_processors[processor].flags, CPUINFO_LINUX_FLAG_VALID)) {
|
||||
continue;
|
||||
}
|
||||
if (!cpuinfo_linux_detect_cluster_cpus(
|
||||
max_processor_id,
|
||||
processor,
|
||||
(cpuinfo_siblings_callback) cluster_cpus_parser,
|
||||
riscv_linux_processors)) {
|
||||
cpuinfo_log_warning("failed to detect cluster cpus for processor %zu.", processor);
|
||||
goto cleanup;
|
||||
}
|
||||
|
||||
/**
|
||||
* Populate the vendor, uarch and frequency of this cluster from
|
||||
* this logical processor. When the 'clusters' list is constructed,
|
||||
* only the values from the cluster leader will be honored.
|
||||
*/
|
||||
riscv_linux_processors[processor].cluster.vendor =
|
||||
riscv_linux_processors[processor].core.vendor;
|
||||
riscv_linux_processors[processor].cluster.uarch =
|
||||
riscv_linux_processors[processor].core.uarch;
|
||||
riscv_linux_processors[processor].cluster.frequency =
|
||||
riscv_linux_processors[processor].core.frequency;
|
||||
}
|
||||
|
||||
/* Populate package information. */
|
||||
for (size_t processor = 0; processor < max_processor_id; processor++) {
|
||||
if (!bitmask_all(riscv_linux_processors[processor].flags, CPUINFO_LINUX_FLAG_VALID)) {
|
||||
continue;
|
||||
}
|
||||
if (!cpuinfo_linux_detect_package_cpus(
|
||||
max_processor_id,
|
||||
processor,
|
||||
(cpuinfo_siblings_callback) package_cpus_parser,
|
||||
riscv_linux_processors)) {
|
||||
cpuinfo_log_warning("failed to detect package cpus for processor %zu.", processor);
|
||||
goto cleanup;
|
||||
}
|
||||
}
|
||||
|
||||
/* Populate ISA structure with hwcap information. */
|
||||
cpuinfo_riscv_linux_decode_isa_from_hwcap(&cpuinfo_isa);
|
||||
|
||||
/**
|
||||
* To efficiently compute the number of unique micro-architectures
|
||||
* present on the system, sort the processor list by micro-architecture
|
||||
* and then scan through the list to count the differences.
|
||||
*
|
||||
* Ensure this is done at the end of composing the processor list - the
|
||||
* parsing functions assume that the position of the processor in the
|
||||
* list matches it's Linux ID, which this sorting operation breaks.
|
||||
*/
|
||||
qsort(riscv_linux_processors,
|
||||
max_processor_id,
|
||||
sizeof(struct cpuinfo_riscv_linux_processor),
|
||||
compare_riscv_linux_processors);
|
||||
|
||||
/**
|
||||
* Determine the number of *valid* detected processors, cores,
|
||||
* clusters, packages and uarchs in the list.
|
||||
*/
|
||||
size_t valid_processors_count = 0;
|
||||
size_t valid_cores_count = 0;
|
||||
size_t valid_clusters_count = 0;
|
||||
size_t valid_packages_count = 0;
|
||||
size_t valid_uarchs_count = 0;
|
||||
enum cpuinfo_uarch last_uarch = cpuinfo_uarch_unknown;
|
||||
for (size_t processor = 0; processor < max_processor_id; processor++) {
|
||||
if (!bitmask_all(riscv_linux_processors[processor].flags, CPUINFO_LINUX_FLAG_VALID)) {
|
||||
continue;
|
||||
}
|
||||
|
||||
/**
|
||||
* All comparisons to the leader id values MUST be done against
|
||||
* the 'linux_id' as opposed to 'processor'. The sort function
|
||||
* above no longer allows us to make the assumption that these
|
||||
* two values are the same.
|
||||
*/
|
||||
uint32_t linux_id = riscv_linux_processors[processor].processor.linux_id;
|
||||
|
||||
valid_processors_count++;
|
||||
if (riscv_linux_processors[processor].core_leader_id == linux_id) {
|
||||
valid_cores_count++;
|
||||
}
|
||||
if (riscv_linux_processors[processor].cluster_leader_id == linux_id) {
|
||||
valid_clusters_count++;
|
||||
}
|
||||
if (riscv_linux_processors[processor].package_leader_id == linux_id) {
|
||||
valid_packages_count++;
|
||||
}
|
||||
/**
|
||||
* As we've sorted by micro-architecture, when the uarch differs
|
||||
* between two entries, a unique uarch has been observed.
|
||||
*/
|
||||
if (last_uarch != riscv_linux_processors[processor].core.uarch
|
||||
|| valid_uarchs_count == 0) {
|
||||
valid_uarchs_count++;
|
||||
last_uarch = riscv_linux_processors[processor].core.uarch;
|
||||
}
|
||||
}
|
||||
|
||||
/* Allocate and populate final public ABI structures. */
|
||||
processors = calloc(valid_processors_count,
|
||||
sizeof(struct cpuinfo_processor));
|
||||
if (processors == NULL) {
|
||||
cpuinfo_log_error("failed to allocate %zu bytes for %zu processors.",
|
||||
valid_processors_count * sizeof(struct cpuinfo_processor),
|
||||
valid_processors_count);
|
||||
goto cleanup;
|
||||
}
|
||||
|
||||
cores = calloc(valid_cores_count,
|
||||
sizeof(struct cpuinfo_core));
|
||||
if (cores == NULL) {
|
||||
cpuinfo_log_error("failed to allocate %zu bytes for %zu cores.",
|
||||
valid_cores_count * sizeof(struct cpuinfo_core),
|
||||
valid_cores_count);
|
||||
goto cleanup;
|
||||
}
|
||||
|
||||
clusters = calloc(valid_clusters_count,
|
||||
sizeof(struct cpuinfo_cluster));
|
||||
if (clusters == NULL) {
|
||||
cpuinfo_log_error("failed to allocate %zu bytes for %zu clusters.",
|
||||
valid_clusters_count * sizeof(struct cpuinfo_cluster),
|
||||
valid_clusters_count);
|
||||
goto cleanup;
|
||||
}
|
||||
|
||||
packages = calloc(valid_packages_count,
|
||||
sizeof(struct cpuinfo_package));
|
||||
if (packages == NULL) {
|
||||
cpuinfo_log_error("failed to allocate %zu bytes for %zu packages.",
|
||||
valid_packages_count * sizeof(struct cpuinfo_package),
|
||||
valid_packages_count);
|
||||
goto cleanup;
|
||||
}
|
||||
|
||||
uarchs = calloc(valid_uarchs_count, sizeof(struct cpuinfo_uarch_info));
|
||||
if (uarchs == NULL) {
|
||||
cpuinfo_log_error("failed to allocate %zu bytes for %zu packages.",
|
||||
valid_uarchs_count * sizeof(struct cpuinfo_uarch_info),
|
||||
valid_uarchs_count);
|
||||
goto cleanup;
|
||||
}
|
||||
|
||||
linux_cpu_to_processor_map = calloc(max_processor_id,
|
||||
sizeof(struct cpuinfo_processor*));
|
||||
if (linux_cpu_to_processor_map == NULL) {
|
||||
cpuinfo_log_error("failed to allocate %zu bytes for %"PRIu32" processor map.",
|
||||
max_processor_id * sizeof(struct cpuinfo_processor*),
|
||||
max_processor_id);
|
||||
goto cleanup;
|
||||
}
|
||||
|
||||
linux_cpu_to_core_map = calloc(max_processor_id,
|
||||
sizeof(struct cpuinfo_core*));
|
||||
if (linux_cpu_to_core_map == NULL) {
|
||||
cpuinfo_log_error("failed to allocate %zu bytes for %"PRIu32" core map.",
|
||||
max_processor_id * sizeof(struct cpuinfo_core*),
|
||||
max_processor_id);
|
||||
goto cleanup;
|
||||
}
|
||||
|
||||
linux_cpu_to_uarch_index_map = calloc(max_processor_id,
|
||||
sizeof(struct cpuinfo_uarch_info*));
|
||||
if (linux_cpu_to_uarch_index_map == NULL) {
|
||||
cpuinfo_log_error("failed to allocate %zu bytes for %"PRIu32" uarch map.",
|
||||
max_processor_id * sizeof(struct cpuinfo_uarch_info*),
|
||||
max_processor_id);
|
||||
goto cleanup;
|
||||
}
|
||||
|
||||
/* Transfer contents of processor list to ABI structures. */
|
||||
size_t valid_processors_index = 0;
|
||||
size_t valid_cores_index = 0;
|
||||
size_t valid_clusters_index = 0;
|
||||
size_t valid_packages_index = 0;
|
||||
size_t valid_uarchs_index = 0;
|
||||
last_uarch = cpuinfo_uarch_unknown;
|
||||
for (size_t processor = 0; processor < max_processor_id; processor++) {
|
||||
if (!bitmask_all(riscv_linux_processors[processor].flags, CPUINFO_LINUX_FLAG_VALID)) {
|
||||
continue;
|
||||
}
|
||||
|
||||
/**
|
||||
* All comparisons to the leader id values MUST be done against
|
||||
* the 'linux_id' as opposed to 'processor'. The sort function
|
||||
* above no longer allows us to make the assumption that these
|
||||
* two values are the same.
|
||||
*/
|
||||
uint32_t linux_id = riscv_linux_processors[processor].processor.linux_id;
|
||||
|
||||
/* Create uarch entry if this uarch has not been seen before. */
|
||||
if (last_uarch != riscv_linux_processors[processor].core.uarch
|
||||
|| valid_uarchs_index == 0) {
|
||||
uarchs[valid_uarchs_index++].uarch =
|
||||
riscv_linux_processors[processor].core.uarch;
|
||||
last_uarch = riscv_linux_processors[processor].core.uarch;
|
||||
}
|
||||
|
||||
/* Copy cpuinfo_processor information. */
|
||||
memcpy(&processors[valid_processors_index++],
|
||||
&riscv_linux_processors[processor].processor,
|
||||
sizeof(struct cpuinfo_processor));
|
||||
|
||||
/* Update uarch processor count. */
|
||||
uarchs[valid_uarchs_index - 1].processor_count++;
|
||||
|
||||
/* Copy cpuinfo_core information, if this is the leader. */
|
||||
if (riscv_linux_processors[processor].core_leader_id == linux_id) {
|
||||
memcpy(&cores[valid_cores_index++],
|
||||
&riscv_linux_processors[processor].core,
|
||||
sizeof(struct cpuinfo_core));
|
||||
/* Update uarch core count. */
|
||||
uarchs[valid_uarchs_index - 1].core_count++;
|
||||
}
|
||||
|
||||
/* Copy cpuinfo_cluster information, if this is the leader. */
|
||||
if (riscv_linux_processors[processor].cluster_leader_id == linux_id) {
|
||||
memcpy(&clusters[valid_clusters_index++],
|
||||
&riscv_linux_processors[processor].cluster,
|
||||
sizeof(struct cpuinfo_cluster));
|
||||
}
|
||||
|
||||
/* Copy cpuinfo_package information, if this is the leader. */
|
||||
if (riscv_linux_processors[processor].package_leader_id == linux_id) {
|
||||
memcpy(&packages[valid_packages_index++],
|
||||
&riscv_linux_processors[processor].package,
|
||||
sizeof(struct cpuinfo_package));
|
||||
}
|
||||
|
||||
/* Commit pointers on the final structures. */
|
||||
processors[valid_processors_index - 1].core = &cores[valid_cores_index - 1];
|
||||
processors[valid_processors_index - 1].cluster = &clusters[valid_clusters_index - 1];
|
||||
processors[valid_processors_index - 1].package = &packages[valid_packages_index - 1];
|
||||
|
||||
cores[valid_cores_index - 1].cluster = &clusters[valid_clusters_index - 1];
|
||||
cores[valid_cores_index - 1].package = &packages[valid_packages_index - 1];
|
||||
|
||||
clusters[valid_clusters_index - 1].package = &packages[valid_packages_index - 1];
|
||||
|
||||
linux_cpu_to_processor_map[linux_id] = &processors[valid_processors_index - 1];
|
||||
linux_cpu_to_core_map[linux_id] = &cores[valid_cores_index - 1];
|
||||
linux_cpu_to_uarch_index_map[linux_id] = valid_uarchs_index - 1;
|
||||
}
|
||||
|
||||
/* Commit */
|
||||
cpuinfo_processors = processors;
|
||||
cpuinfo_processors_count = valid_processors_count;
|
||||
cpuinfo_cores = cores;
|
||||
cpuinfo_cores_count = valid_cores_count;
|
||||
cpuinfo_clusters = clusters;
|
||||
cpuinfo_clusters_count = valid_clusters_count;
|
||||
cpuinfo_packages = packages;
|
||||
cpuinfo_packages_count = valid_packages_count;
|
||||
cpuinfo_uarchs = uarchs;
|
||||
cpuinfo_uarchs_count = valid_uarchs_count;
|
||||
|
||||
cpuinfo_linux_cpu_max = max_processor_id;
|
||||
cpuinfo_linux_cpu_to_processor_map = linux_cpu_to_processor_map;
|
||||
cpuinfo_linux_cpu_to_core_map = linux_cpu_to_core_map;
|
||||
cpuinfo_linux_cpu_to_uarch_index_map = linux_cpu_to_uarch_index_map;
|
||||
|
||||
__sync_synchronize();
|
||||
|
||||
cpuinfo_is_initialized = true;
|
||||
|
||||
/* Mark all public structures NULL to prevent cleanup from erasing them. */
|
||||
processors = NULL;
|
||||
cores = NULL;
|
||||
clusters = NULL;
|
||||
packages = NULL;
|
||||
uarchs = NULL;
|
||||
linux_cpu_to_processor_map = NULL;
|
||||
linux_cpu_to_core_map = NULL;
|
||||
linux_cpu_to_uarch_index_map = NULL;
|
||||
cleanup:
|
||||
free(riscv_linux_processors);
|
||||
free(processors);
|
||||
free(cores);
|
||||
free(clusters);
|
||||
free(packages);
|
||||
free(uarchs);
|
||||
free(linux_cpu_to_processor_map);
|
||||
free(linux_cpu_to_core_map);
|
||||
free(linux_cpu_to_uarch_index_map);
|
||||
}
|
||||
62
3rdparty/cpuinfo/src/riscv/linux/riscv-hw.c
vendored
Normal file
62
3rdparty/cpuinfo/src/riscv/linux/riscv-hw.c
vendored
Normal file
@@ -0,0 +1,62 @@
|
||||
#include <sys/hwprobe.h>
|
||||
#include <sched.h>
|
||||
|
||||
#include <cpuinfo/log.h>
|
||||
#include <riscv/api.h>
|
||||
#include <riscv/linux/api.h>
|
||||
|
||||
void cpuinfo_riscv_linux_decode_vendor_uarch_from_hwprobe(
|
||||
uint32_t processor,
|
||||
enum cpuinfo_vendor vendor[restrict static 1],
|
||||
enum cpuinfo_uarch uarch[restrict static 1]) {
|
||||
struct riscv_hwprobe pairs[] = {
|
||||
{ .key = RISCV_HWPROBE_KEY_MVENDORID, },
|
||||
{ .key = RISCV_HWPROBE_KEY_MARCHID, },
|
||||
{ .key = RISCV_HWPROBE_KEY_MIMPID, },
|
||||
};
|
||||
const size_t pairs_count = sizeof(pairs) / sizeof(struct riscv_hwprobe);
|
||||
|
||||
/* In case of failure, report unknown. */
|
||||
*vendor = cpuinfo_vendor_unknown;
|
||||
*uarch = cpuinfo_uarch_unknown;
|
||||
|
||||
/* Create a CPU set with this processor flagged. */
|
||||
const size_t cpu_set_size = processor + 1;
|
||||
cpu_set_t* cpu_set = CPU_ALLOC(cpu_set_size);
|
||||
CPU_SET(processor, cpu_set);
|
||||
|
||||
/* Request all available information from hwprobe. */
|
||||
int ret = __riscv_hwprobe(pairs, pairs_count,
|
||||
cpu_set_size, (unsigned long*)cpu_set,
|
||||
0 /* flags */);
|
||||
if (ret < 0) {
|
||||
cpuinfo_log_warning("failed to get hwprobe information, err: %d", ret);
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
* The syscall may not have populated all requested keys, loop through
|
||||
* the list and store the values that were discovered.
|
||||
*/
|
||||
uint32_t vendor_id = 0;
|
||||
uint32_t arch_id = 0;
|
||||
uint32_t imp_id = 0;
|
||||
for (size_t pair = 0; pair < pairs_count; pair++) {
|
||||
switch (pairs[pair].key) {
|
||||
case RISCV_HWPROBE_KEY_MVENDORID:
|
||||
vendor_id = pairs[pair].value;
|
||||
break;
|
||||
case RISCV_HWPROBE_KEY_MARCHID:
|
||||
arch_id = pairs[pair].value;
|
||||
break;
|
||||
case RISCV_HWPROBE_KEY_MIMPID:
|
||||
imp_id = pairs[pair].value;
|
||||
break;
|
||||
default:
|
||||
/* The key value may be -1 if unsupported. */
|
||||
break;
|
||||
}
|
||||
}
|
||||
cpuinfo_riscv_decode_vendor_uarch(vendor_id, arch_id, imp_id,
|
||||
vendor, uarch);
|
||||
}
|
||||
44
3rdparty/cpuinfo/src/riscv/linux/riscv-isa.c
vendored
Normal file
44
3rdparty/cpuinfo/src/riscv/linux/riscv-isa.c
vendored
Normal file
@@ -0,0 +1,44 @@
|
||||
#include <string.h>
|
||||
#include <sys/auxv.h>
|
||||
|
||||
#include <riscv/linux/api.h>
|
||||
|
||||
/**
|
||||
* arch/riscv/include/uapi/asm/hwcap.h
|
||||
*
|
||||
* This must be kept in sync with the upstream kernel header.
|
||||
*/
|
||||
#define COMPAT_HWCAP_ISA_I (1 << ('I' - 'A'))
|
||||
#define COMPAT_HWCAP_ISA_M (1 << ('M' - 'A'))
|
||||
#define COMPAT_HWCAP_ISA_A (1 << ('A' - 'A'))
|
||||
#define COMPAT_HWCAP_ISA_F (1 << ('F' - 'A'))
|
||||
#define COMPAT_HWCAP_ISA_D (1 << ('D' - 'A'))
|
||||
#define COMPAT_HWCAP_ISA_C (1 << ('C' - 'A'))
|
||||
#define COMPAT_HWCAP_ISA_V (1 << ('V' - 'A'))
|
||||
|
||||
void cpuinfo_riscv_linux_decode_isa_from_hwcap(
|
||||
struct cpuinfo_riscv_isa isa[restrict static 1]) {
|
||||
const unsigned long hwcap = getauxval(AT_HWCAP);
|
||||
|
||||
if (hwcap & COMPAT_HWCAP_ISA_I) {
|
||||
isa->i = true;
|
||||
}
|
||||
if (hwcap & COMPAT_HWCAP_ISA_M) {
|
||||
isa->m = true;
|
||||
}
|
||||
if (hwcap & COMPAT_HWCAP_ISA_A) {
|
||||
isa->a = true;
|
||||
}
|
||||
if (hwcap & COMPAT_HWCAP_ISA_F) {
|
||||
isa->f = true;
|
||||
}
|
||||
if (hwcap & COMPAT_HWCAP_ISA_D) {
|
||||
isa->d = true;
|
||||
}
|
||||
if (hwcap & COMPAT_HWCAP_ISA_C) {
|
||||
isa->c = true;
|
||||
}
|
||||
if (hwcap & COMPAT_HWCAP_ISA_V) {
|
||||
isa->v = true;
|
||||
}
|
||||
}
|
||||
27
3rdparty/cpuinfo/src/riscv/uarch.c
vendored
Normal file
27
3rdparty/cpuinfo/src/riscv/uarch.c
vendored
Normal file
@@ -0,0 +1,27 @@
|
||||
#include <stdint.h>
|
||||
|
||||
#include <cpuinfo/log.h>
|
||||
#include <riscv/api.h>
|
||||
|
||||
void cpuinfo_riscv_decode_vendor_uarch(
|
||||
uint32_t vendor_id,
|
||||
uint32_t arch_id,
|
||||
uint32_t imp_id,
|
||||
enum cpuinfo_vendor vendor[restrict static 1],
|
||||
enum cpuinfo_uarch uarch[restrict static 1]) {
|
||||
/* The vendor ID is sufficient to determine the cpuinfo_vendor. */
|
||||
switch(vendor_id) {
|
||||
case cpuinfo_riscv_chipset_sifive:
|
||||
*vendor = cpuinfo_vendor_sifive;
|
||||
break;
|
||||
default:
|
||||
*vendor = cpuinfo_vendor_unknown;
|
||||
cpuinfo_log_warning("unknown vendor ID: %"PRIu32, vendor_id);
|
||||
break;
|
||||
}
|
||||
/**
|
||||
* TODO: Add support for parsing chipset architecture and implementation
|
||||
* IDs here, when a chipset of interest comes along.
|
||||
*/
|
||||
*uarch = cpuinfo_uarch_unknown;
|
||||
}
|
||||
12
3rdparty/cpuinfo/src/x86/isa.c
vendored
12
3rdparty/cpuinfo/src/x86/isa.c
vendored
@@ -490,6 +490,18 @@ struct cpuinfo_x86_isa cpuinfo_x86_detect_isa(
|
||||
*/
|
||||
isa.avx512vp2intersect = avx512_regs && !!(structured_feature_info0.edx & UINT32_C(0x00000100));
|
||||
|
||||
/*
|
||||
* AVX512_FP16 instructions:
|
||||
* - Intel: edx[bit 23] in structured feature info (ecx = 0).
|
||||
*/
|
||||
isa.avx512fp16 = avx512_regs && !!(structured_feature_info0.edx & UINT32_C(0x00800000));
|
||||
|
||||
/*
|
||||
* AVX_VNNI instructions:
|
||||
* - Intel: eax[bit 4] in structured feature info (ecx = 1).
|
||||
*/
|
||||
isa.avxvnni = avx_regs && !!(structured_feature_info1.eax & UINT32_C(0x00000010));
|
||||
|
||||
/*
|
||||
* AVX512_BF16 instructions:
|
||||
* - Intel: eax[bit 5] in structured feature info (ecx = 1).
|
||||
|
||||
6
3rdparty/cpuinfo/src/x86/name.c
vendored
6
3rdparty/cpuinfo/src/x86/name.c
vendored
@@ -234,7 +234,7 @@ static bool transform_token(char* token_start, char* token_end, struct parser_st
|
||||
return true;
|
||||
}
|
||||
/*
|
||||
* Erase everywhing after "SOC" on AMD System-on-Chips, e.g.
|
||||
* Erase everything after "SOC" on AMD System-on-Chips, e.g.
|
||||
* "AMD GX-212JC SOC with Radeon(TM) R2E Graphics \0"
|
||||
*/
|
||||
if (erase_matching(token_start, token_length, "SOC")) {
|
||||
@@ -581,7 +581,7 @@ uint32_t cpuinfo_x86_normalize_brand_string(
|
||||
/* Iterate through all tokens and erase redundant parts */
|
||||
{
|
||||
bool is_token = false;
|
||||
char* token_start;
|
||||
char* token_start = NULL;
|
||||
for (char* char_ptr = name; char_ptr != name_end; char_ptr++) {
|
||||
if (*char_ptr == ' ') {
|
||||
if (is_token) {
|
||||
@@ -619,7 +619,7 @@ uint32_t cpuinfo_x86_normalize_brand_string(
|
||||
/* Compact tokens: collapse multiple spacing into one */
|
||||
{
|
||||
char* output_ptr = normalized_name;
|
||||
char* token_start;
|
||||
char* token_start = NULL;
|
||||
bool is_token = false;
|
||||
bool previous_token_ends_with_dash = true;
|
||||
bool current_token_starts_with_dash = false;
|
||||
|
||||
38
3rdparty/cpuinfo/src/x86/uarch.c
vendored
38
3rdparty/cpuinfo/src/x86/uarch.c
vendored
@@ -195,35 +195,37 @@ enum cpuinfo_uarch cpuinfo_x86_decode_uarch(
|
||||
}
|
||||
break;
|
||||
case 0x16:
|
||||
if (model_info->model >= 0x03) {
|
||||
if (model_info->extended_model >= 0x03) {
|
||||
return cpuinfo_uarch_puma;
|
||||
} else {
|
||||
return cpuinfo_uarch_jaguar;
|
||||
}
|
||||
case 0x17:
|
||||
switch (model_info->model) {
|
||||
case 0x01: // 14 nm Naples, Whitehaven, Summit Ridge, Snowy Owl
|
||||
case 0x08: // 12 nm Pinnacle Ridge
|
||||
case 0x11: // 14 nm Raven Ridge, Great Horned Owl
|
||||
case 0x18: // 12 nm Picasso
|
||||
switch (model_info->extended_model) {
|
||||
case 0x0: // model 01h -> 14 nm Naples/Whitehaven/Summit Ridge/Snowy Owl, model 08h -> 12 nm Colfax/Pinnacle Ridge
|
||||
case 0x1: // model 11h -> 14 nm Raven Ridge/Great Horned Owl, model 18h -> 14 nm Banded Kestrel / 12 nm Picasso
|
||||
return cpuinfo_uarch_zen;
|
||||
case 0x31: // Rome, Castle Peak
|
||||
case 0x60: // Renoir
|
||||
case 0x68: // Lucienne
|
||||
case 0x71: // Matisse
|
||||
case 0x90: // Van Gogh
|
||||
case 0x98: // Mero
|
||||
case 0x3: // model 31h -> Rome/Castle Peak
|
||||
case 0x4: // model 47h -> Xbox Series X
|
||||
case 0x6: // model 60h -> Renoir/Grey Hawk, model 68h -> Lucienne
|
||||
case 0x7: // model 71h -> Matisse
|
||||
case 0x9: // model 90h -> Van Gogh, model 98h -> Mero
|
||||
return cpuinfo_uarch_zen2;
|
||||
}
|
||||
break;
|
||||
case 0x19:
|
||||
switch (model_info->model) {
|
||||
case 0x01: // Genesis
|
||||
case 0x21: // Vermeer
|
||||
case 0x30: // Badami, Trento
|
||||
case 0x40: // Rembrandt
|
||||
case 0x50: // Cezanne
|
||||
switch (model_info->extended_model) {
|
||||
case 0x0: // model 00h -> Genesis, model 01h -> Milan, model 08h -> Chagall
|
||||
case 0x2: // model 21h -> Vermeer
|
||||
case 0x3: // model 30h -> Badami, Trento
|
||||
case 0x4: // model 40h -> Rembrandt
|
||||
case 0x5: // model 50h -> Cezanne
|
||||
return cpuinfo_uarch_zen3;
|
||||
case 0x1: // model 10h..1Fh -> Stones
|
||||
case 0x6: // model 60h..6Fh -> Raphael
|
||||
case 0x7: // model 70h..77h -> Phoenix/Hawkpoint1, model 78h..7Fh -> Phoenix 2/Hawkpoint2
|
||||
case 0xA: // model A0h..AFh -> Stones-Dense
|
||||
return cpuinfo_uarch_zen4;
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
174
3rdparty/cubeb/CMakeLists.txt
vendored
174
3rdparty/cubeb/CMakeLists.txt
vendored
@@ -2,10 +2,8 @@
|
||||
# - backend selection via command line, rather than simply detecting headers.
|
||||
|
||||
cmake_minimum_required(VERSION 3.14 FATAL_ERROR)
|
||||
project(cubeb
|
||||
VERSION 0.0.0)
|
||||
project(cubeb C CXX)
|
||||
|
||||
option(BUILD_RUST_LIBS "Build rust backends" OFF)
|
||||
option(LAZY_LOAD_LIBS "Lazily load shared libraries" ON)
|
||||
|
||||
if(NOT CMAKE_BUILD_TYPE)
|
||||
@@ -14,25 +12,17 @@ if(NOT CMAKE_BUILD_TYPE)
|
||||
endif()
|
||||
|
||||
set(CMAKE_C_STANDARD 99)
|
||||
set(CMAKE_CXX_STANDARD 11)
|
||||
set(CMAKE_CXX_STANDARD 17)
|
||||
set(CMAKE_CXX_STANDARD_REQUIRED ON)
|
||||
|
||||
if (BUILD_RUST_LIBS)
|
||||
if(EXISTS "${PROJECT_SOURCE_DIR}/src/cubeb-pulse-rs")
|
||||
set(USE_PULSE_RUST 1)
|
||||
endif()
|
||||
if(EXISTS "${PROJECT_SOURCE_DIR}/src/cubeb-coreaudio-rs")
|
||||
set(USE_AUDIOUNIT_RUST 1)
|
||||
endif()
|
||||
endif()
|
||||
set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
|
||||
|
||||
set(CMAKE_CXX_WARNING_LEVEL 4)
|
||||
if(NOT MSVC)
|
||||
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall -Wextra -Wno-unused-parameter")
|
||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Wextra -Wno-unused-parameter -fno-exceptions -fno-rtti")
|
||||
else()
|
||||
string(REPLACE "/GR" "" CMAKE_CXX_FLAGS ${CMAKE_CXX_FLAGS}) # Disable RTTI
|
||||
string(REPLACE "/EHsc" "" CMAKE_CXX_FLAGS ${CMAKE_CXX_FLAGS}) # Disable Exceptions
|
||||
string(REPLACE "/GR" "" CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}") # Disable RTTI
|
||||
string(REPLACE "/EHsc" "" CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}") # Disable Exceptions
|
||||
endif()
|
||||
|
||||
add_library(cubeb
|
||||
@@ -46,44 +36,16 @@ add_library(cubeb
|
||||
target_include_directories(cubeb
|
||||
PUBLIC $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include> $<INSTALL_INTERFACE:include>
|
||||
)
|
||||
set_target_properties(cubeb PROPERTIES
|
||||
VERSION ${cubeb_VERSION}
|
||||
SOVERSION ${cubeb_VERSION_MAJOR}
|
||||
)
|
||||
|
||||
include(CMakePackageConfigHelpers)
|
||||
write_basic_package_version_file(
|
||||
"${PROJECT_BINARY_DIR}/${PROJECT_NAME}ConfigVersion.cmake"
|
||||
COMPATIBILITY SameMajorVersion
|
||||
)
|
||||
|
||||
configure_package_config_file(
|
||||
"Config.cmake.in"
|
||||
"${PROJECT_BINARY_DIR}/${PROJECT_NAME}Config.cmake"
|
||||
INSTALL_DESTINATION "${CMAKE_INSTALL_LIBDIR}/cmake/${PROJECT_NAME}"
|
||||
)
|
||||
|
||||
install(
|
||||
FILES "${PROJECT_BINARY_DIR}/${PROJECT_NAME}Config.cmake" "${PROJECT_BINARY_DIR}/${PROJECT_NAME}ConfigVersion.cmake"
|
||||
DESTINATION "${CMAKE_INSTALL_LIBDIR}/cmake/${PROJECT_NAME}"
|
||||
)
|
||||
|
||||
install(TARGETS cubeb EXPORT "${PROJECT_NAME}Targets")
|
||||
install(
|
||||
EXPORT "${PROJECT_NAME}Targets"
|
||||
NAMESPACE "${PROJECT_NAME}::"
|
||||
DESTINATION "${CMAKE_INSTALL_LIBDIR}/cmake/${PROJECT_NAME}"
|
||||
)
|
||||
|
||||
add_library(speex OBJECT subprojects/speex/resample.c)
|
||||
set_target_properties(speex PROPERTIES POSITION_INDEPENDENT_CODE TRUE)
|
||||
target_include_directories(speex INTERFACE subprojects)
|
||||
target_compile_definitions(speex PUBLIC
|
||||
OUTSIDE_SPEEX
|
||||
FLOATING_POINT
|
||||
EXPORT=
|
||||
RANDOM_PREFIX=speex
|
||||
)
|
||||
add_library(speex OBJECT subprojects/speex/resample.c)
|
||||
set_target_properties(speex PROPERTIES POSITION_INDEPENDENT_CODE TRUE)
|
||||
target_include_directories(speex INTERFACE subprojects)
|
||||
target_compile_definitions(speex PUBLIC
|
||||
OUTSIDE_SPEEX
|
||||
FLOATING_POINT
|
||||
EXPORT=
|
||||
RANDOM_PREFIX=speex
|
||||
)
|
||||
|
||||
# $<BUILD_INTERFACE:> required because of https://gitlab.kitware.com/cmake/cmake/-/issues/15415
|
||||
target_link_libraries(cubeb PRIVATE $<BUILD_INTERFACE:speex>)
|
||||
@@ -96,17 +58,22 @@ find_package(Threads)
|
||||
target_link_libraries(cubeb PRIVATE Threads::Threads)
|
||||
|
||||
if(LAZY_LOAD_LIBS)
|
||||
if(NOT APPLE AND NOT WIN32) # Skip checks on MacOS because it takes ages in XCode.
|
||||
check_include_files(pulse/pulseaudio.h USE_PULSE)
|
||||
check_include_files(alsa/asoundlib.h USE_ALSA)
|
||||
check_include_files(jack/jack.h USE_JACK)
|
||||
check_include_files(sndio.h USE_SNDIO)
|
||||
check_include_files(aaudio/AAudio.h USE_AAUDIO)
|
||||
|
||||
if(USE_PULSE OR USE_ALSA OR USE_JACK OR USE_SNDIO OR USE_AAUDIO)
|
||||
target_link_libraries(cubeb PRIVATE ${CMAKE_DL_LIBS})
|
||||
|
||||
if(ANDROID)
|
||||
target_compile_definitions(cubeb PRIVATE __ANDROID_UNAVAILABLE_SYMBOLS_ARE_WEAK__)
|
||||
endif()
|
||||
endif()
|
||||
endif()
|
||||
|
||||
else()
|
||||
elseif(NOT APPLE AND NOT WIN32)
|
||||
|
||||
find_package(PkgConfig REQUIRED)
|
||||
|
||||
@@ -136,12 +103,6 @@ else()
|
||||
target_compile_definitions(cubeb PRIVATE DISABLE_LIBSNDIO_DLOPEN)
|
||||
target_link_libraries(cubeb PRIVATE sndio)
|
||||
endif()
|
||||
|
||||
check_include_files(aaudio/AAudio.h USE_AAUDIO)
|
||||
if(USE_AAUDIO)
|
||||
target_compile_definitions(cubeb PRIVATE DISABLE_LIBAAUDIO_DLOPEN)
|
||||
target_link_libraries(cubeb PRIVATE aaudio)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
if(USE_PULSE)
|
||||
@@ -164,22 +125,7 @@ if(USE_SNDIO)
|
||||
target_compile_definitions(cubeb PRIVATE USE_SNDIO)
|
||||
endif()
|
||||
|
||||
if(USE_AAUDIO)
|
||||
target_sources(cubeb PRIVATE src/cubeb_aaudio.cpp)
|
||||
target_compile_definitions(cubeb PRIVATE USE_AAUDIO)
|
||||
|
||||
# set this definition to enable low latency mode. Possibly bad for battery
|
||||
target_compile_definitions(cubeb PRIVATE CUBEB_AAUDIO_LOW_LATENCY)
|
||||
|
||||
# set this definition to enable power saving mode. Possibly resulting
|
||||
# in high latency
|
||||
# target_compile_definitions(cubeb PRIVATE CUBEB_AAUDIO_LOW_POWER_SAVING)
|
||||
|
||||
# set this mode to make the backend use an exclusive stream.
|
||||
# will decrease latency.
|
||||
# target_compile_definitions(cubeb PRIVATE CUBEB_AAUDIO_EXCLUSIVE_STREAM)
|
||||
endif()
|
||||
|
||||
if(APPLE)
|
||||
check_include_files(AudioUnit/AudioUnit.h USE_AUDIOUNIT)
|
||||
if(USE_AUDIOUNIT)
|
||||
target_sources(cubeb PRIVATE
|
||||
@@ -188,13 +134,15 @@ if(USE_AUDIOUNIT)
|
||||
target_compile_definitions(cubeb PRIVATE USE_AUDIOUNIT)
|
||||
target_link_libraries(cubeb PRIVATE "-framework AudioUnit" "-framework CoreAudio" "-framework CoreServices")
|
||||
endif()
|
||||
endif()
|
||||
|
||||
if(WIN32)
|
||||
check_include_files(audioclient.h USE_WASAPI)
|
||||
if(USE_WASAPI)
|
||||
target_sources(cubeb PRIVATE
|
||||
src/cubeb_wasapi.cpp)
|
||||
target_compile_definitions(cubeb PRIVATE USE_WASAPI)
|
||||
target_link_libraries(cubeb PRIVATE avrt ole32 ksuser)
|
||||
target_link_libraries(cubeb PRIVATE ole32 ksuser)
|
||||
endif()
|
||||
|
||||
check_include_files("windows.h;mmsystem.h" USE_WINMM)
|
||||
@@ -204,16 +152,9 @@ if(USE_WINMM)
|
||||
target_compile_definitions(cubeb PRIVATE USE_WINMM)
|
||||
target_link_libraries(cubeb PRIVATE winmm)
|
||||
endif()
|
||||
|
||||
check_include_files(SLES/OpenSLES.h USE_OPENSL)
|
||||
if(USE_OPENSL)
|
||||
target_sources(cubeb PRIVATE
|
||||
src/cubeb_opensl.c
|
||||
src/cubeb-jni.cpp)
|
||||
target_compile_definitions(cubeb PRIVATE USE_OPENSL)
|
||||
target_link_libraries(cubeb PRIVATE OpenSLES)
|
||||
endif()
|
||||
|
||||
if(NOT WIN32 AND NOT APPLE)
|
||||
check_include_files(sys/soundcard.h HAVE_SYS_SOUNDCARD_H)
|
||||
if(HAVE_SYS_SOUNDCARD_H)
|
||||
try_compile(USE_OSS "${PROJECT_BINARY_DIR}/compile_tests"
|
||||
@@ -237,65 +178,4 @@ if(HAVE_SYS_SOUNDCARD_H)
|
||||
endif()
|
||||
endif()
|
||||
endif()
|
||||
|
||||
check_include_files(android/log.h USE_AUDIOTRACK)
|
||||
if(USE_AUDIOTRACK)
|
||||
target_sources(cubeb PRIVATE
|
||||
src/cubeb_audiotrack.c)
|
||||
target_compile_definitions(cubeb PRIVATE USE_AUDIOTRACK)
|
||||
target_link_libraries(cubeb PRIVATE log)
|
||||
endif()
|
||||
|
||||
check_include_files(sys/audioio.h USE_SUN)
|
||||
if(USE_SUN)
|
||||
target_sources(cubeb PRIVATE
|
||||
src/cubeb_sun.c)
|
||||
target_compile_definitions(cubeb PRIVATE USE_SUN)
|
||||
endif()
|
||||
|
||||
check_include_files(kai.h USE_KAI)
|
||||
if(USE_KAI)
|
||||
target_sources(cubeb PRIVATE
|
||||
src/cubeb_kai.c)
|
||||
target_compile_definitions(cubeb PRIVATE USE_KAI)
|
||||
target_link_libraries(cubeb PRIVATE kai)
|
||||
endif()
|
||||
|
||||
if(USE_PULSE AND USE_PULSE_RUST)
|
||||
include(ExternalProject)
|
||||
set_directory_properties(PROPERTIES EP_PREFIX ${CMAKE_BINARY_DIR}/rust)
|
||||
ExternalProject_Add(
|
||||
cubeb_pulse_rs
|
||||
DOWNLOAD_COMMAND ""
|
||||
CONFIGURE_COMMAND ""
|
||||
BUILD_COMMAND cargo build COMMAND cargo build --release
|
||||
BUILD_ALWAYS ON
|
||||
BINARY_DIR "${PROJECT_SOURCE_DIR}/src/cubeb-pulse-rs"
|
||||
INSTALL_COMMAND ""
|
||||
LOG_BUILD ON)
|
||||
add_dependencies(cubeb cubeb_pulse_rs)
|
||||
target_compile_definitions(cubeb PRIVATE USE_PULSE_RUST)
|
||||
target_link_libraries(cubeb PRIVATE
|
||||
debug "${PROJECT_SOURCE_DIR}/src/cubeb-pulse-rs/target/debug/libcubeb_pulse.a"
|
||||
optimized "${PROJECT_SOURCE_DIR}/src/cubeb-pulse-rs/target/release/libcubeb_pulse.a" pulse)
|
||||
endif()
|
||||
|
||||
if(USE_AUDIOUNIT AND USE_AUDIOUNIT_RUST)
|
||||
include(ExternalProject)
|
||||
set_directory_properties(PROPERTIES EP_PREFIX ${CMAKE_BINARY_DIR}/rust)
|
||||
ExternalProject_Add(
|
||||
cubeb_coreaudio_rs
|
||||
DOWNLOAD_COMMAND ""
|
||||
CONFIGURE_COMMAND ""
|
||||
BUILD_COMMAND cargo build COMMAND cargo build --release
|
||||
BUILD_ALWAYS ON
|
||||
BINARY_DIR "${PROJECT_SOURCE_DIR}/src/cubeb-coreaudio-rs"
|
||||
INSTALL_COMMAND ""
|
||||
LOG_BUILD ON)
|
||||
add_dependencies(cubeb cubeb_coreaudio_rs)
|
||||
target_compile_definitions(cubeb PRIVATE USE_AUDIOUNIT_RUST)
|
||||
target_link_libraries(cubeb PRIVATE
|
||||
debug "${PROJECT_SOURCE_DIR}/src/cubeb-coreaudio-rs/target/debug/libcubeb_coreaudio.a"
|
||||
optimized "${PROJECT_SOURCE_DIR}/src/cubeb-coreaudio-rs/target/release/libcubeb_coreaudio.a")
|
||||
endif()
|
||||
|
||||
endif()
|
||||
4
3rdparty/cubeb/Config.cmake.in
vendored
4
3rdparty/cubeb/Config.cmake.in
vendored
@@ -1,4 +0,0 @@
|
||||
@PACKAGE_INIT@
|
||||
|
||||
include("${CMAKE_CURRENT_LIST_DIR}/cubebTargets.cmake")
|
||||
check_required_components(cubeb)
|
||||
14
3rdparty/cubeb/cmake/toolchain-cross-mingw.cmake
vendored
14
3rdparty/cubeb/cmake/toolchain-cross-mingw.cmake
vendored
@@ -1,14 +0,0 @@
|
||||
SET(CMAKE_SYSTEM_NAME Windows)
|
||||
|
||||
set(COMPILER_PREFIX "i686-w64-mingw32")
|
||||
|
||||
find_program(CMAKE_RC_COMPILER NAMES ${COMPILER_PREFIX}-windres)
|
||||
find_program(CMAKE_C_COMPILER NAMES ${COMPILER_PREFIX}-gcc-posix)
|
||||
find_program(CMAKE_CXX_COMPILER NAMES ${COMPILER_PREFIX}-g++-posix)
|
||||
|
||||
SET(CMAKE_FIND_ROOT_PATH /usr/${COMPILER_PREFIX})
|
||||
|
||||
set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER)
|
||||
set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY)
|
||||
set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY)
|
||||
|
||||
36
3rdparty/cubeb/cubeb.supp
vendored
36
3rdparty/cubeb/cubeb.supp
vendored
@@ -1,36 +0,0 @@
|
||||
{
|
||||
snd_config_update-malloc
|
||||
Memcheck:Leak
|
||||
fun:malloc
|
||||
...
|
||||
fun:snd_config_update_r
|
||||
}
|
||||
{
|
||||
snd1_dlobj_cache_get-malloc
|
||||
Memcheck:Leak
|
||||
fun:malloc
|
||||
...
|
||||
fun:snd1_dlobj_cache_get
|
||||
}
|
||||
{
|
||||
parse_defs-malloc
|
||||
Memcheck:Leak
|
||||
fun:malloc
|
||||
...
|
||||
fun:parse_defs
|
||||
}
|
||||
{
|
||||
parse_defs-calloc
|
||||
Memcheck:Leak
|
||||
fun:calloc
|
||||
...
|
||||
fun:parse_defs
|
||||
}
|
||||
{
|
||||
pa_client_conf_from_x11-malloc
|
||||
Memcheck:Leak
|
||||
fun:malloc
|
||||
...
|
||||
fun:pa_client_conf_from_x11
|
||||
}
|
||||
|
||||
6
3rdparty/cubeb/cubeb.vcxproj
vendored
6
3rdparty/cubeb/cubeb.vcxproj
vendored
@@ -49,7 +49,6 @@
|
||||
<ClInclude Include="subprojects\speex\stack_alloc.h" />
|
||||
<ClInclude Include="src\cubeb-internal.h" />
|
||||
<ClInclude Include="src\cubeb-speex-resampler.h" />
|
||||
<ClInclude Include="src\cubeb_array_queue.h" />
|
||||
<ClInclude Include="src\cubeb_assert.h" />
|
||||
<ClInclude Include="src\cubeb_log.h" />
|
||||
<ClInclude Include="src\cubeb_mixer.h" />
|
||||
@@ -73,6 +72,11 @@
|
||||
<ClCompile Include="src\cubeb_winmm.c" />
|
||||
<ClCompile Include="subprojects\speex\resample.c" />
|
||||
</ItemGroup>
|
||||
<ItemDefinitionGroup>
|
||||
<Lib>
|
||||
<AdditionalDependencies Condition="'$(Platform)'!='ARM64'">ksuser.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||
</Lib>
|
||||
</ItemDefinitionGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
|
||||
<ImportGroup Label="ExtensionTargets" />
|
||||
</Project>
|
||||
1
3rdparty/cubeb/cubeb.vcxproj.filters
vendored
1
3rdparty/cubeb/cubeb.vcxproj.filters
vendored
@@ -3,7 +3,6 @@
|
||||
<ItemGroup>
|
||||
<ClInclude Include="src\cubeb-internal.h" />
|
||||
<ClInclude Include="src\cubeb-speex-resampler.h" />
|
||||
<ClInclude Include="src\cubeb_array_queue.h" />
|
||||
<ClInclude Include="src\cubeb_assert.h" />
|
||||
<ClInclude Include="src\cubeb_log.h" />
|
||||
<ClInclude Include="src\cubeb_mixer.h" />
|
||||
|
||||
120
3rdparty/cubeb/include/cubeb/cubeb.h
vendored
120
3rdparty/cubeb/include/cubeb/cubeb.h
vendored
@@ -163,6 +163,7 @@ typedef enum {
|
||||
implications. */
|
||||
} cubeb_log_level;
|
||||
|
||||
/// A single channel position, to be used in a bitmask.
|
||||
typedef enum {
|
||||
CHANNEL_UNKNOWN = 0,
|
||||
CHANNEL_FRONT_LEFT = 1 << 0,
|
||||
@@ -185,43 +186,46 @@ typedef enum {
|
||||
CHANNEL_TOP_BACK_RIGHT = 1 << 17
|
||||
} cubeb_channel;
|
||||
|
||||
/// A bitmask representing the channel layout of a cubeb stream. This is
|
||||
/// bit-compatible with WAVEFORMATEXENSIBLE and in the same order as the SMPTE
|
||||
/// ordering.
|
||||
typedef uint32_t cubeb_channel_layout;
|
||||
// Some common layout definitions.
|
||||
enum {
|
||||
CUBEB_LAYOUT_UNDEFINED = 0, // Indicate the speaker's layout is undefined.
|
||||
CUBEB_LAYOUT_MONO = CHANNEL_FRONT_CENTER,
|
||||
CUBEB_LAYOUT_MONO_LFE = CUBEB_LAYOUT_MONO | CHANNEL_LOW_FREQUENCY,
|
||||
CUBEB_LAYOUT_STEREO = CHANNEL_FRONT_LEFT | CHANNEL_FRONT_RIGHT,
|
||||
CUBEB_LAYOUT_STEREO_LFE = CUBEB_LAYOUT_STEREO | CHANNEL_LOW_FREQUENCY,
|
||||
CUBEB_LAYOUT_MONO = (uint32_t)CHANNEL_FRONT_CENTER,
|
||||
CUBEB_LAYOUT_MONO_LFE = (uint32_t)CUBEB_LAYOUT_MONO | (uint32_t)CHANNEL_LOW_FREQUENCY,
|
||||
CUBEB_LAYOUT_STEREO = (uint32_t)CHANNEL_FRONT_LEFT | (uint32_t)CHANNEL_FRONT_RIGHT,
|
||||
CUBEB_LAYOUT_STEREO_LFE = (uint32_t)CUBEB_LAYOUT_STEREO | (uint32_t)CHANNEL_LOW_FREQUENCY,
|
||||
CUBEB_LAYOUT_3F =
|
||||
CHANNEL_FRONT_LEFT | CHANNEL_FRONT_RIGHT | CHANNEL_FRONT_CENTER,
|
||||
CUBEB_LAYOUT_3F_LFE = CUBEB_LAYOUT_3F | CHANNEL_LOW_FREQUENCY,
|
||||
(uint32_t)CHANNEL_FRONT_LEFT | (uint32_t)CHANNEL_FRONT_RIGHT | (uint32_t)CHANNEL_FRONT_CENTER,
|
||||
CUBEB_LAYOUT_3F_LFE = (uint32_t)CUBEB_LAYOUT_3F | (uint32_t)CHANNEL_LOW_FREQUENCY,
|
||||
CUBEB_LAYOUT_2F1 =
|
||||
CHANNEL_FRONT_LEFT | CHANNEL_FRONT_RIGHT | CHANNEL_BACK_CENTER,
|
||||
CUBEB_LAYOUT_2F1_LFE = CUBEB_LAYOUT_2F1 | CHANNEL_LOW_FREQUENCY,
|
||||
CUBEB_LAYOUT_3F1 = CHANNEL_FRONT_LEFT | CHANNEL_FRONT_RIGHT |
|
||||
CHANNEL_FRONT_CENTER | CHANNEL_BACK_CENTER,
|
||||
CUBEB_LAYOUT_3F1_LFE = CUBEB_LAYOUT_3F1 | CHANNEL_LOW_FREQUENCY,
|
||||
CUBEB_LAYOUT_2F2 = CHANNEL_FRONT_LEFT | CHANNEL_FRONT_RIGHT |
|
||||
CHANNEL_SIDE_LEFT | CHANNEL_SIDE_RIGHT,
|
||||
CUBEB_LAYOUT_2F2_LFE = CUBEB_LAYOUT_2F2 | CHANNEL_LOW_FREQUENCY,
|
||||
CUBEB_LAYOUT_QUAD = CHANNEL_FRONT_LEFT | CHANNEL_FRONT_RIGHT |
|
||||
CHANNEL_BACK_LEFT | CHANNEL_BACK_RIGHT,
|
||||
CUBEB_LAYOUT_QUAD_LFE = CUBEB_LAYOUT_QUAD | CHANNEL_LOW_FREQUENCY,
|
||||
CUBEB_LAYOUT_3F2 = CHANNEL_FRONT_LEFT | CHANNEL_FRONT_RIGHT |
|
||||
CHANNEL_FRONT_CENTER | CHANNEL_SIDE_LEFT |
|
||||
CHANNEL_SIDE_RIGHT,
|
||||
CUBEB_LAYOUT_3F2_LFE = CUBEB_LAYOUT_3F2 | CHANNEL_LOW_FREQUENCY,
|
||||
CUBEB_LAYOUT_3F2_BACK = CUBEB_LAYOUT_QUAD | CHANNEL_FRONT_CENTER,
|
||||
CUBEB_LAYOUT_3F2_LFE_BACK = CUBEB_LAYOUT_3F2_BACK | CHANNEL_LOW_FREQUENCY,
|
||||
CUBEB_LAYOUT_3F3R_LFE = CHANNEL_FRONT_LEFT | CHANNEL_FRONT_RIGHT |
|
||||
CHANNEL_FRONT_CENTER | CHANNEL_LOW_FREQUENCY |
|
||||
CHANNEL_BACK_CENTER | CHANNEL_SIDE_LEFT |
|
||||
CHANNEL_SIDE_RIGHT,
|
||||
CUBEB_LAYOUT_3F4_LFE = CHANNEL_FRONT_LEFT | CHANNEL_FRONT_RIGHT |
|
||||
CHANNEL_FRONT_CENTER | CHANNEL_LOW_FREQUENCY |
|
||||
CHANNEL_BACK_LEFT | CHANNEL_BACK_RIGHT |
|
||||
CHANNEL_SIDE_LEFT | CHANNEL_SIDE_RIGHT,
|
||||
(uint32_t)CHANNEL_FRONT_LEFT | (uint32_t)CHANNEL_FRONT_RIGHT | (uint32_t)CHANNEL_BACK_CENTER,
|
||||
CUBEB_LAYOUT_2F1_LFE = (uint32_t)CUBEB_LAYOUT_2F1 | (uint32_t)CHANNEL_LOW_FREQUENCY,
|
||||
CUBEB_LAYOUT_3F1 = (uint32_t)CHANNEL_FRONT_LEFT | (uint32_t)CHANNEL_FRONT_RIGHT |
|
||||
(uint32_t)CHANNEL_FRONT_CENTER | (uint32_t)CHANNEL_BACK_CENTER,
|
||||
CUBEB_LAYOUT_3F1_LFE = (uint32_t)CUBEB_LAYOUT_3F1 | (uint32_t)CHANNEL_LOW_FREQUENCY,
|
||||
CUBEB_LAYOUT_2F2 = (uint32_t)CHANNEL_FRONT_LEFT | (uint32_t)CHANNEL_FRONT_RIGHT |
|
||||
(uint32_t)CHANNEL_SIDE_LEFT | (uint32_t)CHANNEL_SIDE_RIGHT,
|
||||
CUBEB_LAYOUT_2F2_LFE = (uint32_t)CUBEB_LAYOUT_2F2 | (uint32_t)CHANNEL_LOW_FREQUENCY,
|
||||
CUBEB_LAYOUT_QUAD = (uint32_t)CHANNEL_FRONT_LEFT | (uint32_t)CHANNEL_FRONT_RIGHT |
|
||||
(uint32_t)CHANNEL_BACK_LEFT | (uint32_t)CHANNEL_BACK_RIGHT,
|
||||
CUBEB_LAYOUT_QUAD_LFE = (uint32_t)CUBEB_LAYOUT_QUAD | (uint32_t)CHANNEL_LOW_FREQUENCY,
|
||||
CUBEB_LAYOUT_3F2 = (uint32_t)CHANNEL_FRONT_LEFT | (uint32_t)CHANNEL_FRONT_RIGHT |
|
||||
(uint32_t)CHANNEL_FRONT_CENTER | (uint32_t)CHANNEL_SIDE_LEFT |
|
||||
(uint32_t)CHANNEL_SIDE_RIGHT,
|
||||
CUBEB_LAYOUT_3F2_LFE = (uint32_t)CUBEB_LAYOUT_3F2 | (uint32_t)CHANNEL_LOW_FREQUENCY,
|
||||
CUBEB_LAYOUT_3F2_BACK = (uint32_t)CUBEB_LAYOUT_QUAD | (uint32_t)CHANNEL_FRONT_CENTER,
|
||||
CUBEB_LAYOUT_3F2_LFE_BACK = (uint32_t)CUBEB_LAYOUT_3F2_BACK | (uint32_t)CHANNEL_LOW_FREQUENCY,
|
||||
CUBEB_LAYOUT_3F3R_LFE = (uint32_t)CHANNEL_FRONT_LEFT | (uint32_t)CHANNEL_FRONT_RIGHT |
|
||||
(uint32_t)CHANNEL_FRONT_CENTER | (uint32_t)CHANNEL_LOW_FREQUENCY |
|
||||
(uint32_t)CHANNEL_BACK_CENTER | (uint32_t)CHANNEL_SIDE_LEFT |
|
||||
(uint32_t)CHANNEL_SIDE_RIGHT,
|
||||
CUBEB_LAYOUT_3F4_LFE = (uint32_t)CHANNEL_FRONT_LEFT | (uint32_t)CHANNEL_FRONT_RIGHT |
|
||||
(uint32_t)CHANNEL_FRONT_CENTER | (uint32_t)CHANNEL_LOW_FREQUENCY |
|
||||
(uint32_t)CHANNEL_BACK_LEFT | (uint32_t)CHANNEL_BACK_RIGHT |
|
||||
(uint32_t)CHANNEL_SIDE_LEFT | (uint32_t)CHANNEL_SIDE_RIGHT,
|
||||
};
|
||||
|
||||
/** Miscellaneous stream preferences. */
|
||||
@@ -254,11 +258,23 @@ typedef enum {
|
||||
the jack backend. */
|
||||
} cubeb_stream_prefs;
|
||||
|
||||
/**
|
||||
* Input stream audio processing parameters. Only applicable with
|
||||
* CUBEB_STREAM_PREF_VOICE.
|
||||
*/
|
||||
typedef enum {
|
||||
CUBEB_INPUT_PROCESSING_PARAM_NONE = 0x00,
|
||||
CUBEB_INPUT_PROCESSING_PARAM_ECHO_CANCELLATION = 0x01,
|
||||
CUBEB_INPUT_PROCESSING_PARAM_NOISE_SUPPRESSION = 0x02,
|
||||
CUBEB_INPUT_PROCESSING_PARAM_AUTOMATIC_GAIN_CONTROL = 0x04,
|
||||
CUBEB_INPUT_PROCESSING_PARAM_VOICE_ISOLATION = 0x08,
|
||||
} cubeb_input_processing_params;
|
||||
|
||||
/** Stream format initialization parameters. */
|
||||
typedef struct {
|
||||
cubeb_sample_format format; /**< Requested sample format. One of
|
||||
#cubeb_sample_format. */
|
||||
uint32_t rate; /**< Requested sample rate. Valid range is [1000, 192000]. */
|
||||
uint32_t rate; /**< Requested sample rate. Valid range is [1000, 384000]. */
|
||||
uint32_t channels; /**< Requested channel count. Valid range is [1, 8]. */
|
||||
cubeb_channel_layout
|
||||
layout; /**< Requested channel layout. This must be consistent with the
|
||||
@@ -433,7 +449,7 @@ typedef void (*cubeb_state_callback)(cubeb_stream * stream, void * user_ptr,
|
||||
|
||||
/**
|
||||
* User supplied callback called when the underlying device changed.
|
||||
* @param user The pointer passed to cubeb_stream_init. */
|
||||
* @param user_ptr The pointer passed to cubeb_stream_init. */
|
||||
typedef void (*cubeb_device_changed_callback)(void * user_ptr);
|
||||
|
||||
/**
|
||||
@@ -471,7 +487,7 @@ cubeb_init(cubeb ** context, char const * context_name,
|
||||
|
||||
/** Returns a list of backend names which can be supplid to cubeb_init().
|
||||
Array is null-terminated. */
|
||||
CUBEB_EXPORT const char* const*
|
||||
CUBEB_EXPORT const char**
|
||||
cubeb_get_backend_names();
|
||||
|
||||
/** Get a read-only string identifying this context's current backend.
|
||||
@@ -515,6 +531,18 @@ cubeb_get_min_latency(cubeb * context, cubeb_stream_params * params,
|
||||
CUBEB_EXPORT int
|
||||
cubeb_get_preferred_sample_rate(cubeb * context, uint32_t * rate);
|
||||
|
||||
/** Get the supported input processing features for this backend. See
|
||||
cubeb_stream_set_input_processing for how to set them for a particular input
|
||||
stream.
|
||||
@param context A pointer to the cubeb context.
|
||||
@param params Out parameter for the input processing params supported by
|
||||
this backend.
|
||||
@retval CUBEB_OK
|
||||
@retval CUBEB_ERROR_NOT_SUPPORTED */
|
||||
CUBEB_EXPORT int
|
||||
cubeb_get_supported_input_processing_params(
|
||||
cubeb * context, cubeb_input_processing_params * params);
|
||||
|
||||
/** Destroy an application context. This must be called after all stream have
|
||||
* been destroyed.
|
||||
@param context A pointer to the cubeb context.*/
|
||||
@@ -642,6 +670,30 @@ CUBEB_EXPORT int
|
||||
cubeb_stream_get_current_device(cubeb_stream * stm,
|
||||
cubeb_device ** const device);
|
||||
|
||||
/** Set input mute state for this stream. Some platforms notify the user when an
|
||||
application is accessing audio input. When all inputs are muted they can
|
||||
prove to the user that the application is not actively capturing any input.
|
||||
@param stream the stream for which to set input mute state
|
||||
@param muted whether the input should mute or not
|
||||
@retval CUBEB_OK
|
||||
@retval CUBEB_ERROR_INVALID_PARAMETER if this stream does not have an input
|
||||
device
|
||||
@retval CUBEB_ERROR_NOT_SUPPORTED */
|
||||
CUBEB_EXPORT int
|
||||
cubeb_stream_set_input_mute(cubeb_stream * stream, int mute);
|
||||
|
||||
/** Set what input processing features to enable for this stream.
|
||||
@param stream the stream for which to set input processing features.
|
||||
@param params what input processing features to use
|
||||
@retval CUBEB_OK
|
||||
@retval CUBEB_ERROR if params could not be applied
|
||||
@retval CUBEB_ERROR_INVALID_PARAMETER if a given param is not supported by
|
||||
this backend, or if this stream does not have an input device
|
||||
@retval CUBEB_ERROR_NOT_SUPPORTED */
|
||||
CUBEB_EXPORT int
|
||||
cubeb_stream_set_input_processing_params(cubeb_stream * stream,
|
||||
cubeb_input_processing_params params);
|
||||
|
||||
/** Destroy a cubeb_device structure.
|
||||
@param stream the stream passed in cubeb_stream_get_current_device
|
||||
@param devices the devices to destroy
|
||||
|
||||
12
3rdparty/cubeb/include/cubeb/cubeb_export.h
vendored
Normal file
12
3rdparty/cubeb/include/cubeb/cubeb_export.h
vendored
Normal file
@@ -0,0 +1,12 @@
|
||||
#ifndef CUBEB_EXPORT_H
|
||||
#define CUBEB_EXPORT_H
|
||||
|
||||
#define CUBEB_EXPORT
|
||||
#define CUBEB_NO_EXPORT
|
||||
|
||||
#ifdef WIN32
|
||||
#pragma comment(lib, "winmm.lib")
|
||||
#pragma comment(lib, "avrt.lib")
|
||||
#endif
|
||||
|
||||
#endif
|
||||
25
3rdparty/cubeb/include/cubeb_export.h
vendored
25
3rdparty/cubeb/include/cubeb_export.h
vendored
@@ -1,25 +0,0 @@
|
||||
/* PCSX2 - PS2 Emulator for PCs
|
||||
* Copyright (C) 2002-2021 PCSX2 Dev Team
|
||||
*
|
||||
* PCSX2 is free software: you can redistribute it and/or modify it under the terms
|
||||
* of the GNU Lesser General Public License as published by the Free Software Found-
|
||||
* ation, either version 3 of the License, or (at your option) any later version.
|
||||
*
|
||||
* PCSX2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
|
||||
* without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
|
||||
* PURPOSE. See the GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License along with PCSX2.
|
||||
* If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#define CUBEB_EXPORT
|
||||
#define CUBEB_NO_EXPORT
|
||||
|
||||
#ifdef WIN32
|
||||
#pragma comment(lib, "winmm.lib")
|
||||
#pragma comment(lib, "avrt.lib")
|
||||
#pragma comment(lib, "ksuser.lib")
|
||||
#endif
|
||||
@@ -1,85 +0,0 @@
|
||||
/*
|
||||
* Copyright (C) 2008 The Android Open Source Project
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
#include <stdint.h>
|
||||
|
||||
/*
|
||||
* The following definitions are copied from the android sources. Only the
|
||||
* relevant enum member and values needed are copied.
|
||||
*/
|
||||
|
||||
/*
|
||||
* From
|
||||
* https://android.googlesource.com/platform/frameworks/base/+/android-2.2.3_r2.1/include/utils/Errors.h
|
||||
*/
|
||||
typedef int32_t status_t;
|
||||
|
||||
/*
|
||||
* From
|
||||
* https://android.googlesource.com/platform/frameworks/base/+/android-2.2.3_r2.1/include/media/AudioTrack.h
|
||||
*/
|
||||
struct Buffer {
|
||||
uint32_t flags;
|
||||
int channelCount;
|
||||
int format;
|
||||
size_t frameCount;
|
||||
size_t size;
|
||||
union {
|
||||
void * raw;
|
||||
short * i16;
|
||||
int8_t * i8;
|
||||
};
|
||||
};
|
||||
|
||||
enum event_type {
|
||||
EVENT_MORE_DATA = 0,
|
||||
EVENT_UNDERRUN = 1,
|
||||
EVENT_LOOP_END = 2,
|
||||
EVENT_MARKER = 3,
|
||||
EVENT_NEW_POS = 4,
|
||||
EVENT_BUFFER_END = 5
|
||||
};
|
||||
|
||||
/**
|
||||
* From
|
||||
* https://android.googlesource.com/platform/frameworks/base/+/android-2.2.3_r2.1/include/media/AudioSystem.h
|
||||
* and
|
||||
* https://android.googlesource.com/platform/system/core/+/android-4.2.2_r1/include/system/audio.h
|
||||
*/
|
||||
|
||||
#define AUDIO_STREAM_TYPE_MUSIC 3
|
||||
|
||||
enum {
|
||||
AUDIO_CHANNEL_OUT_FRONT_LEFT_ICS = 0x1,
|
||||
AUDIO_CHANNEL_OUT_FRONT_RIGHT_ICS = 0x2,
|
||||
AUDIO_CHANNEL_OUT_MONO_ICS = AUDIO_CHANNEL_OUT_FRONT_LEFT_ICS,
|
||||
AUDIO_CHANNEL_OUT_STEREO_ICS =
|
||||
(AUDIO_CHANNEL_OUT_FRONT_LEFT_ICS | AUDIO_CHANNEL_OUT_FRONT_RIGHT_ICS)
|
||||
} AudioTrack_ChannelMapping_ICS;
|
||||
|
||||
enum {
|
||||
AUDIO_CHANNEL_OUT_FRONT_LEFT_Legacy = 0x4,
|
||||
AUDIO_CHANNEL_OUT_FRONT_RIGHT_Legacy = 0x8,
|
||||
AUDIO_CHANNEL_OUT_MONO_Legacy = AUDIO_CHANNEL_OUT_FRONT_LEFT_Legacy,
|
||||
AUDIO_CHANNEL_OUT_STEREO_Legacy = (AUDIO_CHANNEL_OUT_FRONT_LEFT_Legacy |
|
||||
AUDIO_CHANNEL_OUT_FRONT_RIGHT_Legacy)
|
||||
} AudioTrack_ChannelMapping_Legacy;
|
||||
|
||||
typedef enum {
|
||||
AUDIO_FORMAT_PCM = 0x00000000,
|
||||
AUDIO_FORMAT_PCM_SUB_16_BIT = 0x1,
|
||||
AUDIO_FORMAT_PCM_16_BIT = (AUDIO_FORMAT_PCM | AUDIO_FORMAT_PCM_SUB_16_BIT),
|
||||
} AudioTrack_SampleType;
|
||||
@@ -1,76 +0,0 @@
|
||||
#ifndef _CUBEB_OUTPUT_LATENCY_H_
|
||||
#define _CUBEB_OUTPUT_LATENCY_H_
|
||||
|
||||
#include "../cubeb-jni.h"
|
||||
#include "cubeb_media_library.h"
|
||||
#include <stdbool.h>
|
||||
|
||||
struct output_latency_function {
|
||||
media_lib * from_lib;
|
||||
cubeb_jni * from_jni;
|
||||
int version;
|
||||
};
|
||||
|
||||
typedef struct output_latency_function output_latency_function;
|
||||
|
||||
const int ANDROID_JELLY_BEAN_MR1_4_2 = 17;
|
||||
|
||||
output_latency_function *
|
||||
cubeb_output_latency_load_method(int version)
|
||||
{
|
||||
output_latency_function * ol = NULL;
|
||||
ol = calloc(1, sizeof(output_latency_function));
|
||||
|
||||
ol->version = version;
|
||||
|
||||
if (ol->version > ANDROID_JELLY_BEAN_MR1_4_2) {
|
||||
ol->from_jni = cubeb_jni_init();
|
||||
return ol;
|
||||
}
|
||||
|
||||
ol->from_lib = cubeb_load_media_library();
|
||||
return ol;
|
||||
}
|
||||
|
||||
bool
|
||||
cubeb_output_latency_method_is_loaded(output_latency_function * ol)
|
||||
{
|
||||
assert(ol);
|
||||
if (ol->version > ANDROID_JELLY_BEAN_MR1_4_2) {
|
||||
return !!ol->from_jni;
|
||||
}
|
||||
|
||||
return !!ol->from_lib;
|
||||
}
|
||||
|
||||
void
|
||||
cubeb_output_latency_unload_method(output_latency_function * ol)
|
||||
{
|
||||
if (!ol) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (ol->version > ANDROID_JELLY_BEAN_MR1_4_2 && ol->from_jni) {
|
||||
cubeb_jni_destroy(ol->from_jni);
|
||||
}
|
||||
|
||||
if (ol->version <= ANDROID_JELLY_BEAN_MR1_4_2 && ol->from_lib) {
|
||||
cubeb_close_media_library(ol->from_lib);
|
||||
}
|
||||
|
||||
free(ol);
|
||||
}
|
||||
|
||||
uint32_t
|
||||
cubeb_get_output_latency(output_latency_function * ol)
|
||||
{
|
||||
assert(cubeb_output_latency_method_is_loaded(ol));
|
||||
|
||||
if (ol->version > ANDROID_JELLY_BEAN_MR1_4_2) {
|
||||
return cubeb_get_output_latency_from_jni(ol->from_jni);
|
||||
}
|
||||
|
||||
return cubeb_get_output_latency_from_media_library(ol->from_lib);
|
||||
}
|
||||
|
||||
#endif // _CUBEB_OUTPUT_LATENCY_H_
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user