mirror of
https://github.com/visualboyadvance-m/visualboyadvance-m
synced 2025-10-05 23:52:49 +02:00
Compare commits
895 Commits
travis_win
...
game-contr
Author | SHA1 | Date | |
---|---|---|---|
|
d3f345208d | ||
|
8183a005af | ||
|
75a34cd098 | ||
|
23e1573442 | ||
|
98b51910eb | ||
|
c3f0aa2edf | ||
|
ea596e4cb0 | ||
|
68adb14b07 | ||
|
a565cea8e9 | ||
|
6ac95d373f | ||
|
d4430ca440 | ||
|
000c7f854c | ||
|
047bd935ea | ||
|
33cb9a66d4 | ||
|
f8374b52a8 | ||
|
2f10e71f1d | ||
|
8f92d99968 | ||
|
ce12db1e06 | ||
|
d8a1886ccb | ||
|
1d051d0e6e | ||
|
f96e42fe04 | ||
|
aa59d94490 | ||
|
07e490254c | ||
|
18b97b4342 | ||
|
b45a4066b1 | ||
|
1fff5cb1f7 | ||
|
13a16eb79c | ||
|
69769c1bef | ||
|
e998a4016a | ||
|
f17a9855f3 | ||
|
85b7cf7aec | ||
|
f46da1c525 | ||
|
404e9a1a55 | ||
|
3ec8960f1a | ||
|
613bd4038a | ||
|
ecb69a240a | ||
|
215e3c5ae9 | ||
|
e5aa685f70 | ||
|
53e1f44a69 | ||
|
9e4c8e1753 | ||
|
5f853b99ad | ||
|
e7d135dbf1 | ||
|
60fc096f1a | ||
|
32bc9c9dc7 | ||
|
84b0a3e366 | ||
|
418b7b64dc | ||
|
2ad7dd1a79 | ||
|
f915ec5972 | ||
|
37acfc8d50 | ||
|
9202bfd55e | ||
|
23ef8ef0f9 | ||
|
390482a719 | ||
|
d1aa4eb23d | ||
|
7dc95076e5 | ||
|
92d9230e2c | ||
|
6e2f1f1103 | ||
|
fa720aea07 | ||
|
e70e57a5c0 | ||
|
9e2a9b479a | ||
|
3ab048bebf | ||
|
a045270164 | ||
|
3c5348983b | ||
|
db355126d3 | ||
|
eea649ae16 | ||
|
9e9fe812d2 | ||
|
c0e71b0cb4 | ||
|
ddc6fd7080 | ||
|
8184522c6d | ||
|
e955501f61 | ||
|
ef09fca4d1 | ||
|
78b99d8b23 | ||
|
717ac7ed74 | ||
|
59d67fe703 | ||
|
de1f4dffba | ||
|
491f104b89 | ||
|
244ee8ebfa | ||
|
3683938ec7 | ||
|
64d8cfffc2 | ||
|
18f3449c31 | ||
|
8db618625d | ||
|
a262a2facf | ||
|
beab088139 | ||
|
215e9b1ac2 | ||
|
0e68a2340c | ||
|
0eb65a0eb3 | ||
|
1af7aa2333 | ||
|
e9162a0d28 | ||
|
99923dd126 | ||
|
3a1b577d0a | ||
|
bf2452aab9 | ||
|
71ca0fb270 | ||
|
e19e13fa0a | ||
|
1c76e3b0f4 | ||
|
c36c3e0250 | ||
|
6c38eaa2a5 | ||
|
7e1afcd37c | ||
|
d8d3ee2b48 | ||
|
df83b4ba80 | ||
|
32581966ae | ||
|
67af67278e | ||
|
e17d2cbaf5 | ||
|
7e46939826 | ||
|
0501f985a3 | ||
|
cee1789259 | ||
|
aca206a721 | ||
|
93a24bee3c | ||
|
ea5cbba016 | ||
|
f6e3daf9d8 | ||
|
0f4ec57557 | ||
|
7a7778c644 | ||
|
803ab35269 | ||
|
24b6ac5a28 | ||
|
0e5d63cd9a | ||
|
cd8d65bddd | ||
|
2407923fc0 | ||
|
37f4affe55 | ||
|
76cb71464d | ||
|
0cd79a96f5 | ||
|
3745eea419 | ||
|
a2378f05f6 | ||
|
f7d4370789 | ||
|
46de99a0da | ||
|
5583175559 | ||
|
14a4b6f820 | ||
|
5f421b53c0 | ||
|
32d273ad78 | ||
|
774fbab7cc | ||
|
00645906a5 | ||
|
bde372bc72 | ||
|
d0194d9a75 | ||
|
7561ca97c1 | ||
|
24b92462f9 | ||
|
ffec5aba5e | ||
|
882957a2d3 | ||
|
5b65066bf8 | ||
|
790618102d | ||
|
9331dbf9c8 | ||
|
6f68bfcf71 | ||
|
7b8c4242fb | ||
|
df84f2b005 | ||
|
d08c9137c1 | ||
|
7aafce0665 | ||
|
e26f807355 | ||
|
4c8b54de89 | ||
|
bad388e0aa | ||
|
d1f6500098 | ||
|
fda429fc64 | ||
|
b139572424 | ||
|
b9694e1900 | ||
|
5aa3ea92b9 | ||
|
7b5d4a82d7 | ||
|
1f57d5f797 | ||
|
0e29be8735 | ||
|
75b79d91f1 | ||
|
52c05c7147 | ||
|
d8d6991c4b | ||
|
36e88fafb6 | ||
|
93fbb5618d | ||
|
6a1be5d4ad | ||
|
23aa083cd4 | ||
|
40711fa5c9 | ||
|
86bef62faf | ||
|
928a61704f | ||
|
019fcda9c1 | ||
|
7005b92840 | ||
|
e91e4dcf17 | ||
|
88b07df394 | ||
|
3cef52b72d | ||
|
d3f8cc1714 | ||
|
df81959825 | ||
|
0132c76100 | ||
|
e505236ec4 | ||
|
785af394f6 | ||
|
f15b09f8e5 | ||
|
1ab46f704f | ||
|
9889ef4fa8 | ||
|
1d7e8ae4ed | ||
|
892527e53b | ||
|
bd7eac6c4b | ||
|
efffe7c333 | ||
|
a529ddfe49 | ||
|
9a8a077443 | ||
|
a9284b3d66 | ||
|
166299cda6 | ||
|
1a63a27c62 | ||
|
640ce45325 | ||
|
83d24828df | ||
|
f1d3f631d2 | ||
|
d1733c4505 | ||
|
d37a3a32e1 | ||
|
3f507b6c6a | ||
|
e560efb08f | ||
|
ca841e9bae | ||
|
4b605b4b1a | ||
|
d756f6716f | ||
|
49140fe5dd | ||
|
5d4f1bd0d9 | ||
|
91873254d3 | ||
|
ae09ae7d59 | ||
|
950a4070c1 | ||
|
216bf4d7e4 | ||
|
f0fd9208b7 | ||
|
31e17c1ba4 | ||
|
2b950e282f | ||
|
f84a164072 | ||
|
60568d26e0 | ||
|
64921c6535 | ||
|
257150f46b | ||
|
61046c76bf | ||
|
fad2e7a310 | ||
|
2cec46f825 | ||
|
dc6659857c | ||
|
1c2a62f055 | ||
|
7d9cb2b5f0 | ||
|
5385b477da | ||
|
aabb70cb85 | ||
|
266512fbbc | ||
|
be1e5ca18c | ||
|
1fb18b320f | ||
|
561d6e1ab0 | ||
|
78724bc893 | ||
|
addd53b69d | ||
|
2e3ce863c7 | ||
|
4c4ce3cf37 | ||
|
ca7ae3363e | ||
|
25bcf2e42d | ||
|
b34448c9eb | ||
|
3989146fa5 | ||
|
0a96d84581 | ||
|
6a4115ca45 | ||
|
6307348cbc | ||
|
77f1235a95 | ||
|
9963b81506 | ||
|
7a45c16539 | ||
|
87bdc93e15 | ||
|
ab4ae96e05 | ||
|
8e4acfc91d | ||
|
3c41b68d51 | ||
|
e10bf7bc4b | ||
|
8329ba9646 | ||
|
7aa1f59128 | ||
|
a16dd2c9f7 | ||
|
26818177e8 | ||
|
22578d02eb | ||
|
f8c1d31294 | ||
|
fd2df853b6 | ||
|
cf600890bf | ||
|
0ca1771a49 | ||
|
1ac7ac999b | ||
|
77e9ea6a2f | ||
|
ccb9af2c64 | ||
|
dcc5ae07d0 | ||
|
ea10306daa | ||
|
a42e166e94 | ||
|
2a65e92da2 | ||
|
6d8ca723d0 | ||
|
5807376fba | ||
|
1a687e564b | ||
|
8f1b5dae90 | ||
|
0483524870 | ||
|
61b503ada4 | ||
|
d6aa168718 | ||
|
364dad84a9 | ||
|
02f516f646 | ||
|
f138b44a50 | ||
|
080be1a325 | ||
|
0a104a9a9d | ||
|
0bfb88d0e3 | ||
|
873de5f667 | ||
|
9bf6a25048 | ||
|
ea2a929f5e | ||
|
0ca5184dda | ||
|
d2d070b52f | ||
|
c40a141792 | ||
|
5d2dd01e85 | ||
|
00344ca8f1 | ||
|
af4951511e | ||
|
da686a4827 | ||
|
ec27885c36 | ||
|
c27d384a53 | ||
|
75e46b7117 | ||
|
c249115b7a | ||
|
d23b374fbf | ||
|
2985b46926 | ||
|
54b8192d30 | ||
|
927ccf0bc8 | ||
|
8c1bd84f40 | ||
|
297d7c06c4 | ||
|
0d86432a31 | ||
|
95337da558 | ||
|
d6331ff92e | ||
|
69a4061ab9 | ||
|
8f27869715 | ||
|
7e30b03889 | ||
|
09bb3c3acf | ||
|
655cfb929d | ||
|
e2f3a64143 | ||
|
1c95df1212 | ||
|
3158b73d69 | ||
|
62671753a9 | ||
|
cb3fc44789 | ||
|
ac2a56be7f | ||
|
ba2513b511 | ||
|
0594fa2a2c | ||
|
9864dc2853 | ||
|
12f39b86b1 | ||
|
eed171aac0 | ||
|
603d6a3872 | ||
|
f8974d8870 | ||
|
6be626d4c7 | ||
|
8771172d19 | ||
|
85a95dcde0 | ||
|
343eafc477 | ||
|
1425248072 | ||
|
4bdd3798f1 | ||
|
7c25d64d69 | ||
|
69d24fb53e | ||
|
b027e64753 | ||
|
1d4eb48a68 | ||
|
1e1451c57f | ||
|
b2ec1544be | ||
|
239b244640 | ||
|
9cc45c355b | ||
|
4a056c7720 | ||
|
c4d46a713f | ||
|
dd6071e5cb | ||
|
c10338a854 | ||
|
a92c448405 | ||
|
90fc3e12e2 | ||
|
a57d81e1af | ||
|
97c24ec2d2 | ||
|
2d3610b5c6 | ||
|
adb9f62080 | ||
|
67e7cfc200 | ||
|
bad9538ed4 | ||
|
8e83209121 | ||
|
13c558ac9f | ||
|
3eb9fbdb7e | ||
|
e140ba816c | ||
|
355c8efeb4 | ||
|
7d606f7065 | ||
|
ec90072c28 | ||
|
0fd1daae54 | ||
|
913db72d12 | ||
|
2da9696a50 | ||
|
b1c7476f2c | ||
|
cf57af4a83 | ||
|
e0ae114f2e | ||
|
6b8b6b6450 | ||
|
7f1d49d3d0 | ||
|
9bda107d3c | ||
|
dd10b8075f | ||
|
2d5fdf8e79 | ||
|
f68492cbbf | ||
|
639003a8b6 | ||
|
a3b2a35395 | ||
|
60caad8666 | ||
|
a87a6a2cc1 | ||
|
236cffb42b | ||
|
643ec0f7b6 | ||
|
395ed0eb2a | ||
|
50a1391232 | ||
|
a56ea0225a | ||
|
60d7ead565 | ||
|
d2fee771fd | ||
|
5008ffbacf | ||
|
e29032d48a | ||
|
fb99a07625 | ||
|
51473a7c53 | ||
|
3f2d3c139d | ||
|
1cfe275012 | ||
|
4aebd0b802 | ||
|
d7abc27438 | ||
|
76bf554161 | ||
|
f132e15511 | ||
|
37dc95b930 | ||
|
941eef918b | ||
|
94627c1e8e | ||
|
3e224bab40 | ||
|
72d772189a | ||
|
a413eb048c | ||
|
fed8c3697e | ||
|
3abf084f2f | ||
|
05e58ba0a7 | ||
|
c9994c284a | ||
|
595a9e49c0 | ||
|
732524a77b | ||
|
f7ce25f496 | ||
|
61d494af4e | ||
|
17038c27d1 | ||
|
75f0a061be | ||
|
27a0d41ad8 | ||
|
4f9d161c02 | ||
|
571d42d2fa | ||
|
1bd2f049cb | ||
|
b28982a89a | ||
|
d91e5db524 | ||
|
cbd7d7d2d1 | ||
|
570596266f | ||
|
cf39d9bbd1 | ||
|
d014ebd2b2 | ||
|
8483fde365 | ||
|
ad7dbf253c | ||
|
461c4a7bd4 | ||
|
1fc449b2c7 | ||
|
1a6f40a79c | ||
|
1e0eea3c08 | ||
|
9a325f086e | ||
|
2810f4b228 | ||
|
8caea3ae6c | ||
|
8c1ebf4d59 | ||
|
715c66b52c | ||
|
dedfb615d5 | ||
|
ec434a7c2f | ||
|
a6affd3807 | ||
|
7f4b5b6f93 | ||
|
287bb5f3a2 | ||
|
50f64b0e8b | ||
|
e7924caca0 | ||
|
f16d1d0725 | ||
|
8ea020d373 | ||
|
7726d26f9c | ||
|
252b65b13c | ||
|
56ffb12758 | ||
|
66c224e122 | ||
|
dc4d431d7a | ||
|
09eb6628e8 | ||
|
9b84396adb | ||
|
bb1d44ae0a | ||
|
df991bae0a | ||
|
a00e4345d0 | ||
|
be7b1ef1d2 | ||
|
f7633ca274 | ||
|
03d962dfea | ||
|
c1c4daf5e3 | ||
|
a9e594a38a | ||
|
18a84e5cad | ||
|
bd1adc87e0 | ||
|
2d6457c0f4 | ||
|
85e991a0e8 | ||
|
265342135d | ||
|
d729ac3ff2 | ||
|
8688d9f8e7 | ||
|
256008dffc | ||
|
a1f2ac8caf | ||
|
32503fd03a | ||
|
fd3029c858 | ||
|
27213d9626 | ||
|
b198c6b549 | ||
|
5961c1480b | ||
|
961b27f21d | ||
|
738b6406b8 | ||
|
5583effa89 | ||
|
ef8efd3187 | ||
|
6c9c53a119 | ||
|
12ec072b25 | ||
|
cdeb1027cc | ||
|
796dfe78f9 | ||
|
87e41300f1 | ||
|
7853718627 | ||
|
a7eeb17645 | ||
|
347df44497 | ||
|
8bd09c9012 | ||
|
55a0a52a39 | ||
|
4af78f6482 | ||
|
7d454e054a | ||
|
5ed544aad3 | ||
|
9ba5645964 | ||
|
fa56242669 | ||
|
65b5affe7d | ||
|
c4733bcf03 | ||
|
73223445d6 | ||
|
2eb45cd967 | ||
|
a5b2d070dc | ||
|
ea9d95dfa0 | ||
|
21ccbcb120 | ||
|
a33695cd55 | ||
|
94b4a7982c | ||
|
972f151310 | ||
|
89028de852 | ||
|
b9fb76043e | ||
|
35d4d44a9b | ||
|
b3cc663344 | ||
|
b6837cea05 | ||
|
414cacbf28 | ||
|
a45d8214c1 | ||
|
173512f65a | ||
|
c37c472996 | ||
|
3f571fb930 | ||
|
b3153dcf35 | ||
|
2ecfe09c6a | ||
|
4223c39c4c | ||
|
459de4ba78 | ||
|
9a5406f824 | ||
|
859359e5ef | ||
|
ab1ff4191d | ||
|
e8383447a8 | ||
|
bdc79bbe20 | ||
|
227c1d69b3 | ||
|
2011a5cc9c | ||
|
24ecb82fb1 | ||
|
dd2e837310 | ||
|
0db7eab66c | ||
|
dc24eac896 | ||
|
1741fa32db | ||
|
c503c9adb8 | ||
|
7a550f4348 | ||
|
3529826bcc | ||
|
0ea8ce8dd9 | ||
|
59fd820e7a | ||
|
1426358da4 | ||
|
41d8ab5d26 | ||
|
a31a7a3086 | ||
|
157277e028 | ||
|
93e15f5b34 | ||
|
276689edda | ||
|
96ce316bcd | ||
|
f23fae6559 | ||
|
254f6effeb | ||
|
983ea451d0 | ||
|
18e387d165 | ||
|
c08bb6bdb0 | ||
|
9b6740c0e5 | ||
|
26cfbee696 | ||
|
eb6c434e29 | ||
|
c05056ab91 | ||
|
6dca6fe8df | ||
|
93084990b2 | ||
|
5187d70e30 | ||
|
ab7f7baab0 | ||
|
05a046e7ed | ||
|
685a495d5c | ||
|
fcc8b273c3 | ||
|
501909c57b | ||
|
bdb65596ce | ||
|
70477dcd9b | ||
|
15bcad1351 | ||
|
e38b4c40c9 | ||
|
a9f35645b7 | ||
|
025f3079b1 | ||
|
4e5b61f220 | ||
|
19aae231c0 | ||
|
21c08e9d9f | ||
|
11bd3e0eee | ||
|
6afbc9a09c | ||
|
25fefc1b3d | ||
|
e91b5e1eac | ||
|
109573dea6 | ||
|
210e79bb74 | ||
|
f355646fb8 | ||
|
e55ed5c0f4 | ||
|
544715ddaa | ||
|
31789aafba | ||
|
8a3456f823 | ||
|
1b6d9557a2 | ||
|
ab68794361 | ||
|
eaf4785915 | ||
|
c13de4518c | ||
|
b50ff8584c | ||
|
b0c029a389 | ||
|
524c594a73 | ||
|
d464bc4dfe | ||
|
2a237aea6b | ||
|
d412711465 | ||
|
fd445481a0 | ||
|
1fb37d3370 | ||
|
1f99ed712d | ||
|
e1a728b7ac | ||
|
ab9f756bf8 | ||
|
619a5cce68 | ||
|
ea2c9363f1 | ||
|
331ba35aeb | ||
|
064fa7b067 | ||
|
7db3c817eb | ||
|
bb903e5e08 | ||
|
81d3b71cd7 | ||
|
8455e7add0 | ||
|
2cdd1fafb6 | ||
|
e6da5ee86c | ||
|
c9595c3668 | ||
|
c18653d27e | ||
|
960e8d4bc0 | ||
|
aaa61676f4 | ||
|
7aa0509e0e | ||
|
dfa97d8a91 | ||
|
ecdaf6df23 | ||
|
4fc3b4297d | ||
|
edc34942a8 | ||
|
a00f258588 | ||
|
e1fd75629f | ||
|
a078dd2487 | ||
|
3a6e4b3c27 | ||
|
26e9a6e3d9 | ||
|
dc9422c479 | ||
|
7b3c721f64 | ||
|
0ddd50273c | ||
|
13854135a9 | ||
|
65a67f219a | ||
|
890f560553 | ||
|
cb0933bf44 | ||
|
98b2fb6ebb | ||
|
80634683b1 | ||
|
87fac44fdb | ||
|
6a7142813d | ||
|
11693d8381 | ||
|
2727f683f1 | ||
|
020daad85f | ||
|
def5d3e486 | ||
|
9dd2932436 | ||
|
12193dcbae | ||
|
e59cedaed6 | ||
|
546c9d3a11 | ||
|
891b1c35e4 | ||
|
e0816b0e10 | ||
|
cc5ddd1bb7 | ||
|
790628961d | ||
|
7031c1d155 | ||
|
84f3e8ce67 | ||
|
bce91d1722 | ||
|
4074158061 | ||
|
a305f550e1 | ||
|
22a3524c66 | ||
|
e2634df5cc | ||
|
5081ae44e5 | ||
|
3ee26c0de6 | ||
|
9c8604c58c | ||
|
ff03bcc1e0 | ||
|
f07a838883 | ||
|
c169420fbc | ||
|
5114c1dc87 | ||
|
8603c879a9 | ||
|
4148080eb5 | ||
|
84d406ac0e | ||
|
378c9493e9 | ||
|
61a726a828 | ||
|
dcaa18aae4 | ||
|
3052eb33a5 | ||
|
36b011c72e | ||
|
95213a6d55 | ||
|
fb9e7e2059 | ||
|
375daf99cb | ||
|
dfec0b3d99 | ||
|
b23d463652 | ||
|
86fcffefd0 | ||
|
08b5685049 | ||
|
6b70aa5de5 | ||
|
2f1439c5bd | ||
|
640e93cd97 | ||
|
2f9933ae49 | ||
|
5d5dc1b39b | ||
|
e58332c03a | ||
|
54399dffea | ||
|
364a182968 | ||
|
97637f16d6 | ||
|
d9732f68db | ||
|
c07d5b658b | ||
|
f4891b6504 | ||
|
18c2ea61c6 | ||
|
1e5693009c | ||
|
9c314a155d | ||
|
7c8ba1e7c5 | ||
|
9495dc84f8 | ||
|
299362b3cf | ||
|
2fe1c5711b | ||
|
81c88227fa | ||
|
3ba0529585 | ||
|
6f2e320d59 | ||
|
9e537a8fe3 | ||
|
7fbb017cd5 | ||
|
a5f863f390 | ||
|
36e61d765a | ||
|
306f92f5d7 | ||
|
8e88363163 | ||
|
f51e1ee4ec | ||
|
047cc29787 | ||
|
3a2b97fd08 | ||
|
121013c534 | ||
|
91a6b53e02 | ||
|
de93330125 | ||
|
baa0341bd5 | ||
|
6b257d52f2 | ||
|
bd2483cae7 | ||
|
d379a076df | ||
|
0b7f11018d | ||
|
0c5ee9941b | ||
|
3d83590774 | ||
|
d8da93897a | ||
|
7c0c53a332 | ||
|
c294b86635 | ||
|
bfab4321cb | ||
|
0436797080 | ||
|
a5e776eea3 | ||
|
7d15117536 | ||
|
1347026d40 | ||
|
51b66714c5 | ||
|
b4aeab689a | ||
|
44202abdb5 | ||
|
710d356084 | ||
|
4f0f942e31 | ||
|
1bced474a2 | ||
|
07064c8714 | ||
|
8024c87832 | ||
|
43b749fe0b | ||
|
6bf107f75d | ||
|
09e8da43db | ||
|
ad3327d437 | ||
|
504ca08b6b | ||
|
2868c1b753 | ||
|
0f55b5d1c8 | ||
|
3041e3262b | ||
|
045e95ab4e | ||
|
a972da8ddb | ||
|
eecde424ae | ||
|
0b14e9f885 | ||
|
ed438d6e52 | ||
|
b7f5754338 | ||
|
a36b147411 | ||
|
9e03af83c4 | ||
|
3869b08c9a | ||
|
8e3978b314 | ||
|
d6cc14ef10 | ||
|
f24e8aae2f | ||
|
83b6efa6cd | ||
|
b21880ea15 | ||
|
166cf446f7 | ||
|
060010699d | ||
|
cd029ae696 | ||
|
008aecde67 | ||
|
834d153725 | ||
|
994726dd8d | ||
|
54335dc67c | ||
|
7bac34eda4 | ||
|
8d62a790e3 | ||
|
99b66e1326 | ||
|
c789020e93 | ||
|
dcaa1b9abc | ||
|
d05e8fc141 | ||
|
60f05cedc2 | ||
|
abb8234174 | ||
|
4f49c89a98 | ||
|
a462904c58 | ||
|
7ab7bc3a9d | ||
|
57bc8f9e40 | ||
|
571025da66 | ||
|
7b04c4ceec | ||
|
8ede756fb0 | ||
|
6c64db0794 | ||
|
7a4a7d148c | ||
|
4f1a351d4a | ||
|
ed8a9af250 | ||
|
29dffc0120 | ||
|
6092082e04 | ||
|
2ba0d316cd | ||
|
2fe84053e1 | ||
|
f1099a213a | ||
|
410ede543c | ||
|
9d1d707c01 | ||
|
fd319d2184 | ||
|
2f23467245 | ||
|
20f57587e2 | ||
|
e220c9bc91 | ||
|
c258f6c1c8 | ||
|
995c2cb706 | ||
|
05bd2a95cd | ||
|
f2e81b8e4b | ||
|
513af13ddc | ||
|
8f48c1f01d | ||
|
7f1a3a932c | ||
|
4da422d02b | ||
|
3ca35d9ca6 | ||
|
0a451d11d3 | ||
|
229bf815e0 | ||
|
5c0903d651 | ||
|
32e7c69726 | ||
|
2f0653824e | ||
|
ba14cadba1 | ||
|
0e8e46f0b7 | ||
|
89d378eb71 | ||
|
2504596140 | ||
|
06b3affeef | ||
|
4b4b770495 | ||
|
d93f6350d0 | ||
|
a320377040 | ||
|
951e8e0ebe | ||
|
9475474ee6 | ||
|
19dff6c911 | ||
|
0b419ee849 | ||
|
00cd19f640 | ||
|
83614290be | ||
|
f1abbc5f83 | ||
|
4aab08c47b | ||
|
136c094f0c | ||
|
98f3948ea8 | ||
|
1d6342d6cb | ||
|
789cd2d0f0 | ||
|
7bbbf04716 | ||
|
bb23357d47 | ||
|
ca3b63d64c | ||
|
213f47ec96 | ||
|
3ca67b9d5d | ||
|
3edd9ba756 | ||
|
ba9c10d566 | ||
|
ed4d1b9827 | ||
|
8ce60e1745 | ||
|
5de47935cf | ||
|
f69febfd71 | ||
|
93f906e2db | ||
|
588e82f03c | ||
|
4e607da067 | ||
|
5cc1fd28b4 | ||
|
47880ff9c6 | ||
|
6a8a9e6244 | ||
|
77c299c13f | ||
|
0c0a35fd04 | ||
|
920f5ac704 | ||
|
7d88e045a2 | ||
|
b27d853d48 | ||
|
b50d48458f | ||
|
9e1a63af0b | ||
|
7a7c86d315 | ||
|
ff0dbf8fe6 | ||
|
ac8ada553c | ||
|
1fa66c1f32 | ||
|
d785cd4e6c | ||
|
e9dc6dfd64 | ||
|
d58d4ee1d2 | ||
|
312b541625 | ||
|
065e700fc8 | ||
|
f3e4b05fa8 | ||
|
f26480bb07 | ||
|
d3397e6a1a | ||
|
f7f424ea1b | ||
|
fb068e55c4 | ||
|
7a8aeb9842 | ||
|
e98d89310e | ||
|
bbbe9fe73f | ||
|
99cdbb8860 | ||
|
54072f9711 | ||
|
0577f8afc2 | ||
|
f306cc63b0 | ||
|
9e4fd8fb2e | ||
|
17d2fbc5cc | ||
|
b57bd76e3a | ||
|
939a88ab4a | ||
|
4e00fa605b | ||
|
49ca52ba03 | ||
|
b3932e4e3d | ||
|
3aefcf64c9 | ||
|
d0d087511f | ||
|
cf9a88dfc3 | ||
|
d183245bdd | ||
|
2b34983b9f | ||
|
1ccc377978 | ||
|
d395e05d97 | ||
|
6c2850cd59 | ||
|
212e45cc8d | ||
|
498e4e858d | ||
|
198e2467dd | ||
|
2622db116c | ||
|
72d0725bac | ||
|
b917933013 | ||
|
b8310538a3 | ||
|
24f13ef00f | ||
|
5d28c5ad39 | ||
|
95b9e413f7 | ||
|
e04efa76b3 | ||
|
85abf97a21 | ||
|
02520fb63e | ||
|
d458e75ca6 | ||
|
ae7349b06f | ||
|
1e56cbfcb3 | ||
|
ed14c7bc76 | ||
|
f3282ef0a9 | ||
|
bd7f38ece7 | ||
|
e35d46254b | ||
|
76803caf5f | ||
|
3f39bcd04f | ||
|
225e4dc954 | ||
|
4352504385 | ||
|
74dc86f77e | ||
|
3fe383c2b5 | ||
|
d999544a3d | ||
|
e113508593 | ||
|
b757048203 | ||
|
8c14138782 | ||
|
d0d22b3068 | ||
|
c06e3bf3fc | ||
|
0535d5c797 | ||
|
a90f4663a5 | ||
|
b8f2c8977e | ||
|
252d3f65ab | ||
|
7f6337b1c7 | ||
|
73a2450247 | ||
|
36790074c3 | ||
|
a01a2d4dd0 |
47
.appveyor.yml
Normal file
47
.appveyor.yml
Normal file
@@ -0,0 +1,47 @@
|
||||
version: '{build}'
|
||||
|
||||
image:
|
||||
- Visual Studio 2017
|
||||
|
||||
build:
|
||||
verbosity: detailed
|
||||
|
||||
configuration:
|
||||
- Debug
|
||||
- Release
|
||||
|
||||
platform:
|
||||
- x64
|
||||
- x86
|
||||
|
||||
environment:
|
||||
matrix:
|
||||
- STATIC: " "
|
||||
- STATIC: "-static"
|
||||
|
||||
matrix:
|
||||
fast_finish: true
|
||||
|
||||
install:
|
||||
- set NINJA_URL="https://github.com/ninja-build/ninja/releases/download/v1.9.0/ninja-win.zip"
|
||||
- appveyor DownloadFile %NINJA_URL% -FileName ninja.zip
|
||||
- 7z x ninja.zip -oc:\projects\ninja > nul
|
||||
- set PATH=c:\projects\ninja;%PATH%
|
||||
- ninja --version
|
||||
|
||||
before_build:
|
||||
- call "C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Auxiliary\Build\vcvarsall.bat" %PLATFORM%
|
||||
|
||||
build_script:
|
||||
- mkdir build
|
||||
- cd build
|
||||
- cmake .. -DVCPKG_TARGET_TRIPLET=%PLATFORM%-windows%STATIC% -DCMAKE_BUILD_TYPE=%CONFIGURATION% -DENABLE_SDL=TRUE -G Ninja
|
||||
- ninja
|
||||
|
||||
# only debug builds are console mode apps, in them test --help
|
||||
test_script:
|
||||
- if not %CONFIGURATION%==Release .\visualboyadvance-m.exe --help
|
||||
- ctest -V
|
||||
|
||||
cache:
|
||||
- c:\vcpkg\installed
|
49
.github/ISSUE_TEMPLATE.md
vendored
49
.github/ISSUE_TEMPLATE.md
vendored
@@ -1,49 +0,0 @@
|
||||
### Please fill out this form:
|
||||
|
||||
### Expected behavior
|
||||
|
||||
### Actual behavior
|
||||
|
||||
### Steps to reproduce the behavior
|
||||
|
||||
### Crash bugs
|
||||
|
||||
If this is a crash bug, and you have the time and inclination, please provide a
|
||||
symblic backtrace.
|
||||
|
||||
Instructions for doing so are
|
||||
[here](https://github.com/visualboyadvance-m/visualboyadvance-m/blob/master/README.md#reporting-crash-bugs).
|
||||
|
||||
### ROM details
|
||||
|
||||
Which games are affected by the issue (please state if GBA or GB game):
|
||||
|
||||
Which games, if any, are NOT affected by the issue (please state if GBA or GB game):
|
||||
|
||||
Include screenshots of ROM Information (File > ROM Information):
|
||||
|
||||
If you are using a BIOS file, please say which one.
|
||||
|
||||
### Option details
|
||||
|
||||
Video driver (simple, opengl):
|
||||
|
||||
Sound driver (directsound, xaudio, openal, SDL):
|
||||
|
||||
### Build details
|
||||
|
||||
Operating System (Windows, Mac, Linux (state distribution), etc.):
|
||||
|
||||
If using Linux, specify if using xorg or Wayland:
|
||||
|
||||
Version of code (pre-built binary version, or commit ref, or just "master"):
|
||||
|
||||
### Hardware details:
|
||||
|
||||
If your joystick or gamepad isn't working in Linux, please try to troubleshoot
|
||||
using the information on this page:
|
||||
https://wiki.archlinux.org/index.php/Gamepad **BEFORE** filing an issue. We use
|
||||
SDL for joystick support, any problems will generally be an issue with SDL and
|
||||
**NOT** the emulator.
|
||||
|
||||
If relevant, the joystick you are using and the drivers you are using for it:
|
116
.github/ISSUE_TEMPLATE/bug_report.yml
vendored
Normal file
116
.github/ISSUE_TEMPLATE/bug_report.yml
vendored
Normal file
@@ -0,0 +1,116 @@
|
||||
name: Bug Report
|
||||
description: If you experience a bug in the Emulator, please open an issue here and fill out the template.
|
||||
title: "[Bug]: "
|
||||
labels: ["bug", "triage"]
|
||||
assignees:
|
||||
-
|
||||
body:
|
||||
- type: markdown
|
||||
attributes:
|
||||
value: "## BEFORE REPORTING AN ISSUE"
|
||||
- type: markdown
|
||||
attributes:
|
||||
value: |
|
||||
Please try the nightly build from: https://nightly.vba-m.com and factory resetting the emulator from the Help menu.
|
||||
On Linux build master from source or use the edge snap.
|
||||
And last but not least, search for existing reports via the filters bar on the issues page.
|
||||
- type: markdown
|
||||
attributes:
|
||||
value: "## If your joystick or gamepad isn't working in Linux"
|
||||
- type: markdown
|
||||
attributes:
|
||||
value: |
|
||||
Please try to troubleshoot using the information on this page:h ttps://wiki.archlinux.org/index.php/Gamepad **BEFORE** filing an issue.
|
||||
We use SDL for joystick support, any problems will generally be an issue with SDL and **NOT** the emulator.
|
||||
If relevant, the joystick you are using and the drivers you are using for it:
|
||||
- type: textarea
|
||||
id: what-should-happen
|
||||
attributes:
|
||||
label: Expected behavior?
|
||||
description: How was the emulator supposed to behave
|
||||
placeholder: Tell us what you expect to see!; use screenshots if necessary.
|
||||
value:
|
||||
validations:
|
||||
required: true
|
||||
- type: textarea
|
||||
id: what-happened
|
||||
attributes:
|
||||
label: Actual behavior?
|
||||
description: Describe the issue you encountered.
|
||||
placeholder: Tell us what you see!; use screenshots if necessary.
|
||||
value:
|
||||
validations:
|
||||
required: true
|
||||
- type: textarea
|
||||
id: repro
|
||||
attributes:
|
||||
label: Steps to reproduce the problem
|
||||
description: "How do you trigger this bug? Please walk us through it step by step."
|
||||
value: |
|
||||
1.
|
||||
2.
|
||||
3.
|
||||
4.
|
||||
5.
|
||||
...
|
||||
validations:
|
||||
required: true
|
||||
- type: textarea
|
||||
id: error-messages
|
||||
attributes:
|
||||
label: Error messages?
|
||||
description: Was there an error message?
|
||||
placeholder: List any exception messages here!; use screenshots if necessary.
|
||||
value: |
|
||||
If this is a crash bug, and you have the time and inclination, please provide a symbolic backtrace.
|
||||
Instructions for doing so are [here](https://github.com/visualboyadvance-m/visualboyadvance-m/blob/master/README.md#reporting-crash-bugs).
|
||||
validations:
|
||||
required: false
|
||||
- type: textarea
|
||||
id: Rom_Details
|
||||
attributes:
|
||||
label: What game were you playing
|
||||
description: "What is the specific rom that you encountered an issue with"
|
||||
value: |
|
||||
<Some of this information can be provided with a screenshot of Rom Information, SAVE TYPE for GBA titles can be obtained from Options > Game Boy Advance > Config>
|
||||
Title:
|
||||
GB, GBC or GBA:
|
||||
ROM CODE:
|
||||
BIOS Used?: (Share crc hash)
|
||||
SAVE TYPE: (Attach Battery or Savestate here)
|
||||
Clean, Intro'd or Hacked?:(Attach Patch here)
|
||||
validations:
|
||||
required: false
|
||||
- type: textarea
|
||||
id: Settings
|
||||
attributes:
|
||||
label: What settings are you using?
|
||||
description: "Please list them"
|
||||
value: |
|
||||
Video driver (simple, opengl):
|
||||
Sound driver (directsound, xaudio, openal, SDL):
|
||||
Scale Filter Used?:
|
||||
validations:
|
||||
required: true
|
||||
- type: textarea
|
||||
id: SysInfo
|
||||
attributes:
|
||||
label: Specifications and Build details
|
||||
description: "List your system information, you can obtain this from MSINFO32 and the emulators Titlebar."
|
||||
value: |
|
||||
VBA-M: (include commit version number and whether you are using the 32-bit or 64-bit version)
|
||||
OS: (include version and OS build number using WinVer if on Windows):
|
||||
If using Linux, specify if using xorg or Wayland:
|
||||
CPU:
|
||||
GPU:
|
||||
RAM:
|
||||
validations:
|
||||
required: true
|
||||
- type: checkboxes
|
||||
id: Copyright_Compliance
|
||||
attributes:
|
||||
label: Copyright Compliance
|
||||
description: Please do not attach any files that infringe on the copyright of Nintendo or its partners.
|
||||
options:
|
||||
- label: There are no infringing files attached to this bug report.
|
||||
required: true
|
9
.github/ISSUE_TEMPLATE/config.yml
vendored
Normal file
9
.github/ISSUE_TEMPLATE/config.yml
vendored
Normal file
@@ -0,0 +1,9 @@
|
||||
blank_issues_enabled: false
|
||||
contact_links:
|
||||
- name: VBA-M Forum
|
||||
url: https://board.vba-m.com/
|
||||
about: For general questions and support please join our forum or our
|
||||
- name: VBA-M IRC Channel
|
||||
url: https://web.libera.chat/#vba-m
|
||||
about: For realtime discussion and support
|
||||
|
46
.github/ISSUE_TEMPLATE/feature.yml
vendored
Normal file
46
.github/ISSUE_TEMPLATE/feature.yml
vendored
Normal file
@@ -0,0 +1,46 @@
|
||||
name: Feature request
|
||||
description: >-
|
||||
If you would like a new feature in Visual Boy Advance - M, please
|
||||
open an issue here and fill out the template.
|
||||
title: '[Feature request]: '
|
||||
labels:
|
||||
- enhancement
|
||||
assignees:
|
||||
- null
|
||||
body:
|
||||
- type: markdown
|
||||
attributes:
|
||||
value: "## BEFORE CREATING A FEATURE REQUEST"
|
||||
- type: markdown
|
||||
attributes:
|
||||
value: |
|
||||
Please try a nightly build from: https://nightly.vba-m.com to see if your idea has already been implemented.
|
||||
On Linux build master from source or use the edge snap.
|
||||
And last but not least, search for existing requests via the filters bar on the issues page.
|
||||
- type: textarea
|
||||
id: feature-request
|
||||
attributes:
|
||||
label: Request box
|
||||
description: What feature would you like to see added?
|
||||
placeholder: Tell us what you would like to see added to Visual Boy Advance - M!
|
||||
value: null
|
||||
validations:
|
||||
required: true
|
||||
- type: textarea
|
||||
id: reason-why
|
||||
attributes:
|
||||
label: Reason box
|
||||
description: Provide reasoning for the new feature
|
||||
placeholder: Tell us why you'd like to see this feature added
|
||||
value: null
|
||||
validations:
|
||||
required: true
|
||||
- type: textarea
|
||||
id: Examples
|
||||
attributes:
|
||||
label: Examples
|
||||
description: Provide examples of this feature
|
||||
placeholder: Provide examples or screenshots of this feature in other software
|
||||
value: null
|
||||
validations:
|
||||
required: true
|
27
.github/workflows/macos-build.yml
vendored
Normal file
27
.github/workflows/macos-build.yml
vendored
Normal file
@@ -0,0 +1,27 @@
|
||||
name: macOS Latest Build
|
||||
on: [push, pull_request]
|
||||
#on: workflow_dispatch
|
||||
|
||||
jobs:
|
||||
build:
|
||||
strategy:
|
||||
matrix:
|
||||
cmake_build: ['-DCMAKE_BUILD_TYPE=Release', '-DCMAKE_BUILD_TYPE=Debug']
|
||||
cmake_options: ['', '-DENABLE_LINK=OFF', '-DENABLE_SDL=ON']
|
||||
runs-on: macos-latest
|
||||
|
||||
steps:
|
||||
- name: Checkout the code
|
||||
uses: actions/checkout@v2
|
||||
with:
|
||||
submodules: recursive
|
||||
- name: Install nix
|
||||
uses: cachix/install-nix-action@v22
|
||||
with:
|
||||
nix_path: nixpkgs=channel:nixos-unstable
|
||||
- name: Configure
|
||||
run: >-
|
||||
nix-shell --command 'cmake -B build -G Ninja ${{ matrix.cmake_build }} -DENABLE_LTO=OFF ${{ matrix.cmake_options }}'
|
||||
- name: Build
|
||||
run: >-
|
||||
nix-shell --command 'ninja -C build'
|
37
.github/workflows/msys2-build.yml
vendored
Normal file
37
.github/workflows/msys2-build.yml
vendored
Normal file
@@ -0,0 +1,37 @@
|
||||
name: MSYS2 Build
|
||||
on: [push, pull_request]
|
||||
|
||||
jobs:
|
||||
build:
|
||||
strategy:
|
||||
matrix:
|
||||
cmake_build: ['-DCMAKE_BUILD_TYPE=Release', '-DCMAKE_BUILD_TYPE=Debug']
|
||||
cmake_options: ['', '-DENABLE_LINK=OFF', '-DENABLE_SDL=ON']
|
||||
runs-on: windows-latest
|
||||
env:
|
||||
MSYSTEM: CLANG64
|
||||
defaults:
|
||||
run:
|
||||
shell: msys2 {0}
|
||||
|
||||
steps:
|
||||
- name: Checkout the code
|
||||
uses: actions/checkout@v2
|
||||
with:
|
||||
submodules: recursive
|
||||
- name: Setup msys2
|
||||
uses: msys2/setup-msys2@v2
|
||||
with:
|
||||
msystem: CLANG64
|
||||
update: true
|
||||
- name: Install deps
|
||||
run: >-
|
||||
bash installdeps
|
||||
- name: Configure
|
||||
run: >-
|
||||
cmake -B build -G Ninja -DCMAKE_BUILD_TYPE=Debug ${{ matrix.cmake_build }} ${{ matrix.cmake_options }}
|
||||
- name: Build
|
||||
run: ninja -C build
|
||||
|
||||
- name: Install
|
||||
run: ninja -C build install
|
30
.github/workflows/ubuntu-build.yml
vendored
Normal file
30
.github/workflows/ubuntu-build.yml
vendored
Normal file
@@ -0,0 +1,30 @@
|
||||
name: Ubuntu Latest Build
|
||||
on: [push, pull_request]
|
||||
|
||||
jobs:
|
||||
build:
|
||||
strategy:
|
||||
matrix:
|
||||
cmake_compiler: ['-DCMAKE_C_COMPILER=gcc -DCMAKE_CXX_COMPILER=g++', '-DCMAKE_C_COMPILER=clang -DCMAKE_CXX_COMPILER=clang++']
|
||||
cmake_build: ['-DCMAKE_BUILD_TYPE=Release', '-DCMAKE_BUILD_TYPE=Debug']
|
||||
cmake_options: ['', '-DENABLE_LINK=OFF', '-DENABLE_SDL=ON']
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout the code
|
||||
uses: actions/checkout@v2
|
||||
with:
|
||||
submodules: recursive
|
||||
|
||||
- name: Install Dependencies
|
||||
run: >-
|
||||
bash installdeps; if [ "${{ matrix.compiler }}" = clang ]; then sudo apt -y install clang; fi
|
||||
|
||||
- name: Configure
|
||||
run: >-
|
||||
cmake -B build -G Ninja ${{ matrix.cmake_compiler }} ${{ matrix.cmake_build }} ${{ matrix.cmake_options }}
|
||||
|
||||
- name: Build
|
||||
run: ninja -C build
|
||||
|
||||
- name: Install
|
||||
run: sudo ninja -C build install
|
36
.github/workflows/visual-studio-build.yml
vendored
Normal file
36
.github/workflows/visual-studio-build.yml
vendored
Normal file
@@ -0,0 +1,36 @@
|
||||
name: Visual Studio Build
|
||||
on: [push, pull_request]
|
||||
|
||||
jobs:
|
||||
build:
|
||||
strategy:
|
||||
matrix:
|
||||
msvc_arch: ['x64', 'x64_x86']
|
||||
cmake_generator: ['Ninja']
|
||||
# cmake_generator: ['Ninja', '"Visual Studio 17 2022"']
|
||||
cmake_build: ['-DCMAKE_BUILD_TYPE=Release', '-DCMAKE_BUILD_TYPE=Debug']
|
||||
cmake_options: ['', '-DENABLE_LINK=OFF', '-DENABLE_SDL=ON']
|
||||
runs-on: windows-latest
|
||||
steps:
|
||||
- name: Checkout the code
|
||||
uses: actions/checkout@v2
|
||||
with:
|
||||
submodules: recursive
|
||||
|
||||
- name: Prepare Visual Studio environment
|
||||
uses: ilammy/msvc-dev-cmd@v1.12.0
|
||||
with:
|
||||
arch: ${{ matrix.msvc_arch }}
|
||||
|
||||
- name: Configure (x64)
|
||||
if: matrix.msvc_arch == 'x64'
|
||||
run: >-
|
||||
cmake -B build -G ${{ matrix.cmake_generator }} -DVCPKG_TARGET_TRIPLET=x64-windows-static ${{ matrix.cmake_build }} ${{ matrix.cmake_options }}
|
||||
|
||||
- name: Configure (x86)
|
||||
if: matrix.msvc_arch == 'x64_x86'
|
||||
run: >-
|
||||
cmake -B build -G ${{ matrix.cmake_generator }} -DVCPKG_TARGET_TRIPLET=x86-windows-static ${{ matrix.cmake_build }} ${{ matrix.cmake_options }}
|
||||
|
||||
- name: Build
|
||||
run: cmake --build build
|
18
.gitignore
vendored
18
.gitignore
vendored
@@ -1,21 +1,15 @@
|
||||
src/wx/builtin-over.h
|
||||
src/wx/builtin-xrc.h
|
||||
src/wx/cmd-evtable.h
|
||||
src/wx/cmdhandlers.h
|
||||
src/wx/cmdtab.cpp
|
||||
src/wx/wxvbam.xrs
|
||||
build/*
|
||||
build32/*
|
||||
vsbuild/*
|
||||
cmake-build*
|
||||
dependencies/*
|
||||
vcpkg/*
|
||||
/*build*/*
|
||||
.vs/*
|
||||
.idea
|
||||
*.o
|
||||
*.so
|
||||
*.dll
|
||||
*.exe
|
||||
.vscode/
|
||||
|
||||
# clangd files
|
||||
compile_commands.json
|
||||
.cache/
|
||||
|
||||
# vim swap files
|
||||
*.sw?
|
||||
|
201
.gitlab-ci.yml
Normal file
201
.gitlab-ci.yml
Normal file
@@ -0,0 +1,201 @@
|
||||
# DESCRIPTION: GitLab CI/CD for libRetro (NOT FOR GitLab-proper)
|
||||
|
||||
##############################################################################
|
||||
################################# BOILERPLATE ################################
|
||||
##############################################################################
|
||||
|
||||
# Core definitions
|
||||
.core-defs:
|
||||
variables:
|
||||
GIT_SUBMODULE_STRATEGY: recursive
|
||||
JNI_PATH: src/libretro
|
||||
MAKEFILE_PATH: src/libretro
|
||||
CORENAME: vbam
|
||||
|
||||
# Inclusion templates, required for the build to work
|
||||
include:
|
||||
################################## DESKTOPS ################################
|
||||
# Windows 64-bit
|
||||
- project: 'libretro-infrastructure/ci-templates'
|
||||
file: '/windows-x64-mingw.yml'
|
||||
|
||||
# Windows 32-bit
|
||||
- project: 'libretro-infrastructure/ci-templates'
|
||||
file: '/windows-i686-mingw.yml'
|
||||
|
||||
# Linux 64-bit
|
||||
- project: 'libretro-infrastructure/ci-templates'
|
||||
file: '/linux-x64.yml'
|
||||
|
||||
# Linux 32-bit
|
||||
- project: 'libretro-infrastructure/ci-templates'
|
||||
file: '/linux-i686.yml'
|
||||
|
||||
# MacOS 64-bit
|
||||
- project: 'libretro-infrastructure/ci-templates'
|
||||
file: '/osx-x64.yml'
|
||||
|
||||
# MacOS ARM 64-bit
|
||||
- project: 'libretro-infrastructure/ci-templates'
|
||||
file: '/osx-arm64.yml'
|
||||
|
||||
################################## CELLULAR ################################
|
||||
# Android
|
||||
- project: 'libretro-infrastructure/ci-templates'
|
||||
file: '/android-jni.yml'
|
||||
|
||||
# iOS
|
||||
- project: 'libretro-infrastructure/ci-templates'
|
||||
file: '/ios-arm64.yml'
|
||||
|
||||
# iOS (armv7)
|
||||
- project: 'libretro-infrastructure/ci-templates'
|
||||
file: '/ios9.yml'
|
||||
|
||||
################################## CONSOLES ################################
|
||||
# PlayStation Vita
|
||||
- project: 'libretro-infrastructure/ci-templates'
|
||||
file: '/vita-static.yml'
|
||||
|
||||
# Nintendo GameCube
|
||||
- project: 'libretro-infrastructure/ci-templates'
|
||||
file: '/ngc-static.yml'
|
||||
|
||||
# Nintendo Wii
|
||||
- project: 'libretro-infrastructure/ci-templates'
|
||||
file: '/wii-static.yml'
|
||||
|
||||
# Nintendo WiiU
|
||||
- project: 'libretro-infrastructure/ci-templates'
|
||||
file: '/wiiu-static.yml'
|
||||
|
||||
# Nintendo Switch
|
||||
- project: 'libretro-infrastructure/ci-templates'
|
||||
file: '/libnx-static.yml'
|
||||
|
||||
# tvOS (AppleTV)
|
||||
- project: 'libretro-infrastructure/ci-templates'
|
||||
file: '/tvos-arm64.yml'
|
||||
|
||||
#################################### MISC ##################################
|
||||
|
||||
# Stages for building
|
||||
stages:
|
||||
- build-prepare
|
||||
- build-shared
|
||||
- build-static
|
||||
|
||||
##############################################################################
|
||||
#################################### STAGES ##################################
|
||||
##############################################################################
|
||||
#
|
||||
################################### DESKTOPS #################################
|
||||
# Windows 64-bit
|
||||
libretro-build-windows-x64:
|
||||
extends:
|
||||
- .libretro-windows-x64-mingw-make-default
|
||||
- .core-defs
|
||||
|
||||
# Windows 32-bit
|
||||
libretro-build-windows-i686:
|
||||
extends:
|
||||
- .libretro-windows-i686-mingw-make-default
|
||||
- .core-defs
|
||||
|
||||
# Linux 64-bit
|
||||
libretro-build-linux-x64:
|
||||
extends:
|
||||
- .libretro-linux-x64-make-default
|
||||
- .core-defs
|
||||
|
||||
# Linux 32-bit
|
||||
libretro-build-linux-i686:
|
||||
extends:
|
||||
- .libretro-linux-i686-make-default
|
||||
- .core-defs
|
||||
|
||||
# MacOS 64-bit
|
||||
libretro-build-osx-x64:
|
||||
extends:
|
||||
- .libretro-osx-x64-make-default
|
||||
- .core-defs
|
||||
|
||||
# MacOS ARM 64-bit
|
||||
libretro-build-osx-arm64:
|
||||
extends:
|
||||
- .libretro-osx-arm64-make-default
|
||||
- .core-defs
|
||||
|
||||
################################### CELLULAR #################################
|
||||
# Android ARMv7a
|
||||
android-armeabi-v7a:
|
||||
extends:
|
||||
- .libretro-android-jni-armeabi-v7a
|
||||
- .core-defs
|
||||
|
||||
# Android ARMv8a
|
||||
android-arm64-v8a:
|
||||
extends:
|
||||
- .libretro-android-jni-arm64-v8a
|
||||
- .core-defs
|
||||
|
||||
# Android 64-bit x86
|
||||
android-x86_64:
|
||||
extends:
|
||||
- .libretro-android-jni-x86_64
|
||||
- .core-defs
|
||||
|
||||
# Android 32-bit x86
|
||||
android-x86:
|
||||
extends:
|
||||
- .libretro-android-jni-x86
|
||||
- .core-defs
|
||||
|
||||
# iOS
|
||||
libretro-build-ios-arm64:
|
||||
extends:
|
||||
- .libretro-ios-arm64-make-default
|
||||
- .core-defs
|
||||
|
||||
# iOS (armv7) [iOS 9 and up]
|
||||
libretro-build-ios9:
|
||||
extends:
|
||||
- .libretro-ios9-make-default
|
||||
- .core-defs
|
||||
|
||||
# tvOS
|
||||
libretro-build-tvos-arm64:
|
||||
extends:
|
||||
- .libretro-tvos-arm64-make-default
|
||||
- .core-defs
|
||||
|
||||
################################### CONSOLES #################################
|
||||
# PlayStation Vita
|
||||
libretro-build-vita:
|
||||
extends:
|
||||
- .libretro-vita-static-retroarch-master
|
||||
- .core-defs
|
||||
|
||||
# Nintendo GameCube
|
||||
libretro-build-ngc:
|
||||
extends:
|
||||
- .libretro-ngc-static-retroarch-master
|
||||
- .core-defs
|
||||
|
||||
# Nintendo Wii
|
||||
libretro-build-wii:
|
||||
extends:
|
||||
- .libretro-wii-static-retroarch-master
|
||||
- .core-defs
|
||||
|
||||
# Nintendo WiiU
|
||||
libretro-build-wiiu:
|
||||
extends:
|
||||
- .libretro-wiiu-static-retroarch-master
|
||||
- .core-defs
|
||||
|
||||
# Nintendo Switch
|
||||
libretro-build-libnx-aarch64:
|
||||
extends:
|
||||
- .libretro-libnx-static-retroarch-master
|
||||
- .core-defs
|
1
.gitmodules
vendored
1
.gitmodules
vendored
@@ -1,3 +1,4 @@
|
||||
[submodule "dependencies"]
|
||||
path = dependencies
|
||||
url = https://github.com/visualboyadvance-m/dependencies.git
|
||||
branch = master
|
||||
|
45
.travis.yml
45
.travis.yml
@@ -1,6 +1,6 @@
|
||||
---
|
||||
cache: ccache
|
||||
dist: trusty
|
||||
dist: xenial
|
||||
language: cpp
|
||||
services: xvfb
|
||||
sudo: required
|
||||
@@ -10,17 +10,20 @@ matrix:
|
||||
include:
|
||||
- env: BUILD_ENV=ubuntu-bionic XVFB_RUN=1
|
||||
dist: bionic
|
||||
# - env: BUILD_ENV=utf8 XVFB_RUN=1
|
||||
# dist: bionic
|
||||
# - env: BUILD_ENV=nostl XVFB_RUN=1
|
||||
# dist: bionic
|
||||
- env: BUILD_ENV=ubuntu-xenial XVFB_RUN=1
|
||||
dist: xenial
|
||||
- env: BUILD_ENV=ubuntu-trusty XVFB_RUN=1
|
||||
- env: BUILD_ENV=ubuntu-trusty XVFB_RUN=1 CC=clang CXX=clang++
|
||||
- env: BUILD_ENV=ubuntu-xenial-minimal INSTALLDEPS_ARGS="--no-openal --no-ffmpeg" XVFB_RUN=1
|
||||
- env: BUILD_ENV=ubuntu-xenial XVFB_RUN=1 CC=clang CXX=clang++
|
||||
- env: BUILD_ENV=mingw-w64
|
||||
- env: BUILD_ENV=mingw-w32
|
||||
- env: BUILD_ENV=libretro
|
||||
- env: BUILD_ENV=libretro CC=clang CXX=clang++
|
||||
- env: BUILD_ENV=mac
|
||||
os: osx
|
||||
osx_image: xcode10.2
|
||||
osx_image: xcode12
|
||||
install: export PATH="/usr/local/opt/ccache/libexec:$PATH"
|
||||
|
||||
before_install:
|
||||
@@ -29,10 +32,12 @@ before_install:
|
||||
mingw-w64 )
|
||||
ARG=MinGW-w64-x86_64
|
||||
CMAKE=/usr/lib/mxe/usr/bin/x86_64-w64-mingw32.static-cmake
|
||||
PATH="$PATH:/usr/lib/mxe/usr/bin"
|
||||
;;
|
||||
mingw-w32 )
|
||||
ARG=MinGW-w64-i686
|
||||
CMAKE=/usr/lib/mxe/usr/bin/i686-w64-mingw32.static-cmake
|
||||
PATH="$PATH:/usr/lib/mxe/usr/bin"
|
||||
;;
|
||||
* )
|
||||
CMAKE=cmake
|
||||
@@ -40,7 +45,7 @@ before_install:
|
||||
esac
|
||||
- |
|
||||
if [ "$BUILD_ENV" != libretro ]; then
|
||||
./installdeps $ARG
|
||||
./installdeps $INSTALLDEPS_ARGS $ARG
|
||||
DIR=build
|
||||
else
|
||||
DIR=src/libretro
|
||||
@@ -51,24 +56,38 @@ before_script:
|
||||
if [ -n "$ENABLE_SDL" ]; then
|
||||
CMAKE_ARGS="$CMAKE_ARGS -DENABLE_SDL=ON"
|
||||
fi
|
||||
case "$BUILD_ENV" in
|
||||
utf8|nostl)
|
||||
sudo apt-get -y install stow libwxgtk3.0-gtk3-dev
|
||||
(
|
||||
cd /
|
||||
sudo curl -LO 'http://cachemiss.com/files/wxWidgets-gtk3-'"$BUILD_ENV"'-3.0.5.tar.gz'
|
||||
sudo tar zxvf wxWidgets-gtk3-"$BUILD_ENV"-3.0.5.tar.gz
|
||||
cd /usr/local/stow
|
||||
sudo stow wxWidgets-gtk3-"$BUILD_ENV"-3.0.5
|
||||
)
|
||||
export LD_LIBRARY_PATH=/usr/local/lib
|
||||
CMAKE_ARGS="$CMAKE_ARGS -DwxWidgets_CONFIG_EXECUTABLE=/usr/local/bin/wx-config -DWXRC=/usr/local/bin/wxrc"
|
||||
;;
|
||||
esac
|
||||
|
||||
script:
|
||||
- mkdir -p -- "$DIR"
|
||||
- cd -- "$DIR"
|
||||
- if [ "$BUILD_ENV" != libretro ]; then $CMAKE $CMAKE_ARGS ..; fi
|
||||
- make
|
||||
- if [ "$BUILD_ENV" != libretro ]; then make install DESTDIR=/tmp/VBAM; fi
|
||||
- if [ "$BUILD_ENV" != libretro ]; then ninja; else make; fi
|
||||
- if [ "$BUILD_ENV" != libretro ]; then DESTDIR=/tmp/VBAM ninja install; fi
|
||||
- |
|
||||
if [ -n "$XVFB_RUN" ]; then
|
||||
if [ "$BUILD_ENV" = mac ]; then
|
||||
./$PRGNAM.app/Contents/MacOS/$PRGNAM --help
|
||||
elif [ -n "$XVFB_RUN" ]; then
|
||||
xvfb-run -a ./$PRGNAM --help
|
||||
# TODO: --help crashes on OSX sometimes.
|
||||
#elif [ "$BUILD_ENV" = mac ]; then
|
||||
# ./$PRGNAM.app/Contents/MacOS/$PRGNAM --help
|
||||
fi
|
||||
ctest -V
|
||||
|
||||
env:
|
||||
global:
|
||||
- CMAKE_ARGS=""
|
||||
- CMAKE_ARGS="-G Ninja"
|
||||
- ENABLE_SDL=1
|
||||
- MAKEFLAGS="-j2"
|
||||
- PRGNAM=visualboyadvance-m
|
||||
|
11
.tx/config
Normal file → Executable file
11
.tx/config
Normal file → Executable file
@@ -1,9 +1,10 @@
|
||||
[main]
|
||||
host = https://www.transifex.com
|
||||
|
||||
[vba-m.wxvbam]
|
||||
file_filter = po/wxvbam/<lang>.po
|
||||
source_file = po/wxvbam/wxvbam.pot
|
||||
source_lang = en
|
||||
type = PO
|
||||
[o:bgk:p:vba-m:r:wxvbam]
|
||||
file_filter = po/wxvbam/<lang>.po
|
||||
source_file = po/wxvbam/wxvbam.pot
|
||||
type = PO
|
||||
source_lang = en
|
||||
minimum_perc = 0
|
||||
|
||||
|
179
CHANGELOG.md
179
CHANGELOG.md
@@ -4,6 +4,185 @@ All notable changes to this project will be documented in this file.
|
||||
The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/)
|
||||
and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html).
|
||||
|
||||
## [2.1.9] - 2024-02-03
|
||||
=======================
|
||||
* 84b0a3e3 - Remove SDL sound driver [rkitover]
|
||||
* 2ad7dd1a - Fix wav audio recording [40356555+Aikku93]
|
||||
* 23ef8ef0 - Dialog appearance improvements + link warning [zachbacon]
|
||||
* a0452701 - build: don't fseeko64()/ftello64() on musl libc [rkitover]
|
||||
* 9e9fe812 - visualboyadvance-m.metainfo.xml: add screenshots to the metainfo [zachbacon]
|
||||
|
||||
## [2.1.8] - 2023-12-13
|
||||
|
||||
========================
|
||||
* beab0881 - Store the PC register at the appropriate offset [steelskin]
|
||||
* bf2452aa - Resize GameArea after MainFrame initialization [steelskin]
|
||||
* 71ca0fb2 - Properly hide the status bar at startup [steelskin]
|
||||
* 7e1afcd3 - Fix reading joystick hat config values [rkitover]
|
||||
* 32581966 - Link: Fix menu not refreshing correctly [74248064+nuive]
|
||||
|
||||
## [2.1.7] - 11.09.2023
|
||||
|
||||
=========================
|
||||
* aca206a7 - Launch on xwayland under Wayland if no EGL [rkitover]
|
||||
* 93a24bee - Disable mirroring for ROMs > 32MB [rkitover]
|
||||
* 0f4ec575 - [Build] Fix the NO_LINK build [steelskin]
|
||||
* 803ab352 - [GB] Save MBC7 EEPROM data to `gbRam` [steelskin]
|
||||
* 24b6ac5a - [GBA] Implement missing Thumb instruction [steelskin]
|
||||
* 14a4b6f8 - [dialogs] Move JoypadConfig to its own class. [steelskin]
|
||||
|
||||
## [2.1.6] - 09.07.2023
|
||||
|
||||
=========================
|
||||
* 7561ca97 - Fix Discord streaming for OpenGL [danialhorton]
|
||||
* e26f8073 - [bios] Fix lz77 and add BIOS_SndDriverVsyncOn [steelskin]
|
||||
* d1f65000 - Refactor accelerator / global shortcuts handling [steelskin]
|
||||
* fda429fc - [GBA] Do not draw BG tiles from outside of BG VRAM [steelskin]
|
||||
* 5aa3ea92 - Properly initialize wxAcceleratorTable [steelskin]
|
||||
* 0e29be87 - Support multiple RAM sizes for MBC7 [steelskin]
|
||||
* 75b79d91 - Change MBC7 reported RAM size to 512 bytes [steelskin]
|
||||
* 36e88faf - Fix dsound looping when moving/resizing window [rkitover]
|
||||
* 019fcda9 - Sanitize and improve the GB header parsing (#1109) [Steelskin]
|
||||
* 7005b928 - Sanitize allocations in the Game Boy emulator (#1105) [Steelskin]
|
||||
* 3cef52b7 - Fix pause/next-frame [rkitover]
|
||||
* d3f8cc17 - Option to suspend the X11 screensaver when running [2306079+multiSnow]
|
||||
* df819598 - builder: update macOS build to 10.10, Wx 3.2.2.1 [rkitover]
|
||||
* 1ab46f70 - Update SIOCNT when the link driver is disconnected [steelskin]
|
||||
* 1d7e8ae4 - build: fix build with new OpenAL [rkitover]
|
||||
* a9284b3d - workaround for Stuart Little 2 crashing when set to none [danialhorton]
|
||||
* 166299cd - Implements Read/Writes for HUC3 [danialhorton]
|
||||
* 640ce453 - Change SOUND_CLOCK_TICKS to 280896 cycles - ~1074 samples per frame [reallibretroretroarch]
|
||||
* f1d3f631 - Fix automatic dynamic frame skipping [steelskin]
|
||||
* d756f671 - translations: fix some source strings [stanley.udr.kid]
|
||||
* 91873254 - Add INI file versioning [steelskin]
|
||||
* 7d9cb2b5 - Default GBA LCD filter to off. [rkitover]
|
||||
* be1e5ca1 - Check for wx < 3.2.2 for EGL move fix backport [rkitover]
|
||||
* 1fb18b32 - Rename appdata to metainfo [polynomial-c]
|
||||
* ca7ae336 - Fix regression in bios, port DMA fix from libretro [danialhorton]
|
||||
* b34448c9 - Fix record/play dialogs for native recordings [danialhorton]
|
||||
* 6307348c - build: support MSVC arm64 cross build on x86 [rkitover]
|
||||
* 87bdc93e - Revert "translations: use %% instead of percent" [rkitover]
|
||||
* ab4ae96e - Clarify/set condition: wayland && !wayland_egl [rkitover]
|
||||
* 8e4acfc9 - Fix build w/wxUSE_GLCANVAS_EGL=0, on Fedora [rkitover]
|
||||
* 3c41b68d - Fix the Windows ARM64 build [steelskin]
|
||||
* 22578d02 - Increase MAX_CART_SIZE from 32MiB to 128MiB [rkitover]
|
||||
|
||||
## [2.1.5] - 2022-12-15
|
||||
=======================
|
||||
* ea2a929f - Backport 800d6ed69b from wx to fix Wayland EGL pos [rkitover]
|
||||
* c40a1417 - Write vsync toggle msg to debug log not OSD [rkitover]
|
||||
* 5d2dd01e - Call Layout() after DrawingPanel OnSize event [rkitover]
|
||||
* da686a48 - Reinit panel on vsync toggle. [rkitover]
|
||||
* ec27885c - Support EGL VSync on Wayland. [rkitover]
|
||||
* c27d384a - Enable GL on Wayland for wx 3.2+, no vsync. [rkitover]
|
||||
* c249115b - build: set -mtune=generic [rkitover]
|
||||
* 297d7c06 - [hidpi] Use wxWidgets 3.2 on Windows [steelskin]
|
||||
* 0d86432a - [hidpi] Implement full HiDPI support [steelskin]
|
||||
* 69d24fb5 - [build][msvc] Fix debug information and set hidpi support [steelskin]
|
||||
* 90fc3e12 - Default CTRL+I to change interframe blender [rkitover]
|
||||
* a57d81e1 - Show name of interframe blender not num in OSD [rkitover]
|
||||
* 13c558ac - Disable wireless link type [rkitover]
|
||||
* 639003a8 - Show pixel filter name not number on cycle [rkitover]
|
||||
* 236cffb4 - Make another adjustment to glXQueryExtensions [rkitover]
|
||||
* 643ec0f7 - Pass DefaultScreen(display) to glXQueryExtensions [rkitover]
|
||||
* 60d7ead5 - Fix menu state after playing a movie [laqieer]
|
||||
* d2fee771 - Add VBA Movie Version 2 [laqieer]
|
||||
* 3f2d3c13 - Remove manual joystick polling [steelskin]
|
||||
* 7726d26f - Enable full optimizations and fix x86 builds [danialhorton]
|
||||
* 73223445 - MSVC opt /fp:fast /Oi, intrinsic sqrt() w/ XBRZ. [rkitover]
|
||||
* 972f1513 - Enable GB colorization hack support in GUI. [danialhorton]
|
||||
* 1741fa32 - Fix autosaveloadcheat and rename pref [danialhorton]
|
||||
* a31a7a30 - in Wx, the Option is Enable MMX, make the variable also enableMMX and set its default to on. [danialhorton]
|
||||
* 983ea451 - Flash : Erased memory is FFh-filled [negativeExponent]
|
||||
* 18e387d1 - Fix Flash chip's erase operation: erased memory is FFh-filled, not zero-filled. [laqieer]
|
||||
* c05056ab - HuC3: Update [negativeExponent]
|
||||
* 93084990 - HuC3: Refactoring to avoid breaking savestates [negativeExponent]
|
||||
* 05a046e7 - HuC3: Enable battery save, update RTC support [negativeExponent]
|
||||
* 70477dcd - GBA:Fix serial emulation if compiled with NO_LINK [negativeExponent]
|
||||
* 15bcad13 - GB:Fix serial emulation when compiled with NO_LINK [negativeExponent]
|
||||
* 025f3079 - GBA:Fix a few memory read/write issues [negativeExponent]
|
||||
* 210e79bb - Add descriptions for the 'Interframe Blending' and 'LCD Color Filter' options [jrb22x]
|
||||
* 8a3456f8 - Default to not change battery on state load. [rkitover]
|
||||
* b50ff858 - add a missing break in half word reads [danialhorton]
|
||||
* 064fa7b0 - Fix SDL audio delay [Clownacy]
|
||||
* 7db3c817 - Fixed SDL audio using the wrong audio specification [Clownacy]
|
||||
* cb0933bf - Stop changing plane ptrs in rec. audio frames. [rkitover]
|
||||
* 80634683 - Force a panel update when configuring bilinear. [briansrls]
|
||||
* 6a714281 - Differentiate between SDL joy index/instance_id. [rkitover]
|
||||
* 11693d83 - Clean up GB MBC30 check. [rkitover]
|
||||
* 020daad8 - Fix joy accels when emulation is paused. [rkitover]
|
||||
* def5d3e4 - Stop timer when game is loaded again. [rkitover]
|
||||
* e0816b0e - Fix weird input/buttons memory leak. [edenisfa]
|
||||
* 7031c1d1 - [LINUX,WINDOWS] Key/Joy background input. [edenisfa]
|
||||
* 84f3e8ce - Allow joystick background input. [edenisfa]
|
||||
* 40741580 - Add GUI cmd line option for config file. (#724) [Steelskin]
|
||||
* c169420f - Turbo/throttle config and DirectSound fixes. [rkitover]
|
||||
* 378c9493 - Fix joystick config when game is loaded. [rkitover]
|
||||
* 95213a6d - GB: Only use mapperLastTime to see if RTC data was loaded [negativeExponent]
|
||||
* 86fcffef - GB: Add support for 4MB MBC30 [negativeExponent]
|
||||
* 2f9933ae - GBA BIOS: ArcTan/ArcTan2 fixes for HLE bios [negativeExponent]
|
||||
* d9732f68 - Fix clock cycle count for MUL, MLA instructions... (https://github.com/libretro/vba-next/commit/b91f39c787cc99ace97546cb94985f3b658c8b57) - backport Fix clock cycle count for some arm/thumb instructions (https://github.com/libretro/vba-next/commit/5243b2d8064dd2145888ced7cbfe127594ecf6db) - backport Fix base cycle count for MUL, MLA series (https://github.com/libretro/vba-next/commit/b91f39c787cc99ace97546cb94985f3b658c8b57) [negativeExponent]
|
||||
* c07d5b65 - Fix vram 16/32 bit unaligned reads(backport https://github.com/libretro/vba-next/commit/7f18771165dd4a6d71a598c51d91668920572eaa) [negativeExponent]
|
||||
* 18c2ea61 - Further fixing Multi Buffer formatting. [briansrls]
|
||||
* 1e569300 - Addressing audio plugin crash [briansrls]
|
||||
* 9c314a15 - Use proper string `"wglGetExtensionsStringEXT"`. [edenisfa]
|
||||
* 3ba05295 - Improve BIOS Math tests score from 425 to 625. [edenisfa]
|
||||
* 6f2e320d - Improve clock cycle count for THUMB operations. [edenisfa]
|
||||
* 9e537a8f - Improve cycle count for MUL, MLA. [edenisfa]
|
||||
* 306f92f5 - Check game kbd input with wxGetKeyState() again. [rkitover]
|
||||
* 6b257d52 - Avoid override of variable `throttle` for turbo. [edenisfa]
|
||||
* bd2483ca - Allow changing connection type without restart. [edenisfa]
|
||||
* d379a076 - Decrease mouse sensitivity for menu hiding. [rkitover]
|
||||
* 0c5ee994 - Fix PNG capture screen. [edenisfa]
|
||||
* 1347026d - Turbo config refactor followup. [rkitover]
|
||||
* 1bced474 - Codesign fix for mac. [rkitover]
|
||||
* 07064c87 - [Windows,MacOS] Auto-updater refactoring. (#639) [denisfa]
|
||||
* 09e8da43 - Joystick refactor pt. Deux: Support Joysticks. [rkitover]
|
||||
* 504ca08b - Hide menubar + minor UI refactor. [rkitover]
|
||||
* 2868c1b7 - Fix changing aspect ratio option. [rkitover]
|
||||
* 045e95ab - GB: Support 4MiB MBC30 ROM bank select. [rkitover]
|
||||
* 0b14e9f8 - [WINDOWS] Add function to open unicode files. (#644) [denisfa]
|
||||
* 8e3978b3 - Speedup/Turbo/Throttle fixes. [rkitover]
|
||||
* 166cf446 - Disable menu LCD filter unless playing GB or GBA. [edenisfa]
|
||||
* 06001069 - Init systemColorMaps after output module init. [edenisfa]
|
||||
* cd029ae6 - Fix video recording with frame skip enabled. [edenisfa]
|
||||
* 008aecde - [LINUX] Fix display of `RGB` values on viewers. [edenisfa]
|
||||
* 834d1537 - Fix accel shortcuts when using some menu options. [edenisfa]
|
||||
* 994726dd - Do not pause while opening configuration windows. [edenisfa]
|
||||
* 54335dc6 - [WINDOWS] Fix weird WX errors messages. [edenisfa]
|
||||
* 7bac34ed - Remove duplicate variable `winFlashSize`. [edenisfa]
|
||||
* 8d62a790 - Change default options for GB. [edenisfa]
|
||||
* 99b66e13 - Expose LCD filter for GBA and GB color saturation. [edenisfa]
|
||||
* c789020e - Fix `Save` button on OAM Viewer for GB and GBA. [edenisfa]
|
||||
* dcaa1b9a - Fix `Save` button on Tile Viewer for GB and GBA. [edenisfa]
|
||||
* d05e8fc1 - Make AGBPrint output to our Logging. [edenisfa]
|
||||
* abb82341 - Allow binding specific server IP. (#633) [rkitover]
|
||||
* 6c64db07 - cmake: Windows codesigning refactor. [rkitover]
|
||||
* 4f1a351d - Try to configure vsync for multiple options. [edenisfa]
|
||||
* ed8a9af2 - Use proper functions and checks for OpenGL VSYNC. [edenisfa]
|
||||
* 6092082e - Fix Save Failed error for Super Monkey Ball Jr. [54053706+negativeExponent]
|
||||
* f1099a21 - Check return value of soundInit(). [rkitover]
|
||||
* 410ede54 - Check for null pointer in soundReset(). [alexjnewt]
|
||||
* 9d1d707c - Limit ROM size to 32 MiB. [negativeExponent]
|
||||
* fd319d21 - GB: Check header for a valid ROM file. [negativeExponent]
|
||||
* 513af13d - Replace `libpng` code for `stb_image` one. [edenisfa]
|
||||
* 8f48c1f0 - Fix weird `wxWidgets>=3.0` error message. [edenisfa]
|
||||
* 2f065382 - Enable XAudio2 for Windows vcpkg build. [rkitover]
|
||||
* a3203770 - Fix: a issue with loading e-Reader dot code (#608) [sony.pcv.s520]
|
||||
* 83614290 - Turn on winsparkle update checking support. [rkitover]
|
||||
* 4aab08c4 - Set link timeout default to 500ms, fix prev. dflt. [rkitover]
|
||||
* 136c094f - Add option to set link network port. [rkitover]
|
||||
* f69febfd - Add `.wav` support for sound recording. [edenisfa]
|
||||
* 6a8a9e62 - Fix integer overflow in cheatsImportGSACodeFile length check. [zack.ref]
|
||||
* b50d4845 - GBA: Fix crash when new size is larger than rom size after soft-patching [negativeExponent]
|
||||
* 9e1a63af - support for patches in BPS format [ArtiiP]
|
||||
* 72d0725b - Allow game window to resize on-the-fly when enabling/disabling borders [negativeExponent]
|
||||
* 225e4dc9 - Remove top border black line when using filters. [edenisfa]
|
||||
* 0535d5c7 - Optimize CRC32. [mudlord]
|
||||
* 4bc9bb84 - Implement joystick rumble. #522 [rkitover]
|
||||
* 384f4487 - Fix key accel overriding menus and dialogs. [edenisfa]
|
||||
* af0de1c4 - xbrz: fix inline asm check [rkitover]
|
||||
|
||||
## [2.1.4]
|
||||
=======================
|
||||
* c93e017d - builder: minor changes to support mac 32 bit (4 days ago)
|
||||
|
1149
CMakeLists.txt
1149
CMakeLists.txt
File diff suppressed because it is too large
Load Diff
@@ -1,49 +1,95 @@
|
||||
{
|
||||
"configurations": [
|
||||
{
|
||||
"name": "x64-Debug",
|
||||
"generator": "Visual Studio 15 2017",
|
||||
"configurationType": "Debug",
|
||||
"inheritEnvironments": [
|
||||
"msvc_x64"
|
||||
],
|
||||
"buildRoot": "${env.USERPROFILE}\\CMakeBuilds\\${workspaceHash}\\build\\${name}",
|
||||
"installRoot": "${env.USERPROFILE}\\CMakeBuilds\\${workspaceHash}\\install\\${name}",
|
||||
"cmakeCommandArgs": "-DVCPKG_TARGET_TRIPLET=x64-windows",
|
||||
"ctestCommandArgs": ""
|
||||
}, {
|
||||
"name": "x64-Release",
|
||||
"generator": "Visual Studio 15 2017",
|
||||
"configurationType": "Release",
|
||||
"inheritEnvironments": [
|
||||
"msvc_x64"
|
||||
],
|
||||
"buildRoot": "${env.USERPROFILE}\\CMakeBuilds\\${workspaceHash}\\build\\${name}",
|
||||
"installRoot": "${env.USERPROFILE}\\CMakeBuilds\\${workspaceHash}\\install\\${name}",
|
||||
"cmakeCommandArgs": "-DVCPKG_TARGET_TRIPLET=x64-windows",
|
||||
"ctestCommandArgs": ""
|
||||
}, {
|
||||
"name": "x86-Debug",
|
||||
"generator": "Visual Studio 15 2017",
|
||||
"configurationType": "Debug",
|
||||
"inheritEnvironments": [
|
||||
"msvc_x86"
|
||||
],
|
||||
"buildRoot": "${env.USERPROFILE}\\CMakeBuilds\\${workspaceHash}\\build\\${name}",
|
||||
"installRoot": "${env.USERPROFILE}\\CMakeBuilds\\${workspaceHash}\\install\\${name}",
|
||||
"cmakeCommandArgs": "-DVCPKG_TARGET_TRIPLET=x86-windows",
|
||||
"ctestCommandArgs": ""
|
||||
}, {
|
||||
"name": "x86-Release",
|
||||
"generator": "Visual Studio 15 2017",
|
||||
"configurationType": "Release",
|
||||
"inheritEnvironments": [
|
||||
"msvc_x86"
|
||||
],
|
||||
"buildRoot": "${env.USERPROFILE}\\CMakeBuilds\\${workspaceHash}\\build\\${name}",
|
||||
"installRoot": "${env.USERPROFILE}\\CMakeBuilds\\${workspaceHash}\\install\\${name}",
|
||||
"cmakeCommandArgs": "-DVCPKG_TARGET_TRIPLET=x86-windows",
|
||||
"ctestCommandArgs": ""
|
||||
}
|
||||
]
|
||||
}
|
||||
{
|
||||
"configurations": [
|
||||
{
|
||||
"name": "x64-static-Debug",
|
||||
"generator": "Ninja",
|
||||
"configurationType": "Debug",
|
||||
"inheritEnvironments": [
|
||||
"msvc_x64"
|
||||
],
|
||||
"buildRoot": "${env.USERPROFILE}\\CMakeBuilds\\${workspaceHash}\\build\\${name}",
|
||||
"installRoot": "${env.USERPROFILE}\\CMakeBuilds\\${workspaceHash}\\install\\${name}",
|
||||
"cmakeCommandArgs": "-DVCPKG_TARGET_TRIPLET=x64-windows-static -DENABLE_SDL=TRUE"
|
||||
}, {
|
||||
"name": "x64-static-Release",
|
||||
"generator": "Ninja",
|
||||
"configurationType": "Release",
|
||||
"inheritEnvironments": [
|
||||
"msvc_x64"
|
||||
],
|
||||
"buildRoot": "${env.USERPROFILE}\\CMakeBuilds\\${workspaceHash}\\build\\${name}",
|
||||
"installRoot": "${env.USERPROFILE}\\CMakeBuilds\\${workspaceHash}\\install\\${name}",
|
||||
"cmakeCommandArgs": "-DVCPKG_TARGET_TRIPLET=x64-windows-static -DENABLE_SDL=TRUE"
|
||||
}, {
|
||||
"name": "x64-static-RelWithDebInfo",
|
||||
"generator": "Ninja",
|
||||
"configurationType": "RelWithDebInfo",
|
||||
"inheritEnvironments": [
|
||||
"msvc_x64"
|
||||
],
|
||||
"buildRoot": "${env.USERPROFILE}\\CMakeBuilds\\${workspaceHash}\\build\\${name}",
|
||||
"installRoot": "${env.USERPROFILE}\\CMakeBuilds\\${workspaceHash}\\install\\${name}",
|
||||
"cmakeCommandArgs": "-DVCPKG_TARGET_TRIPLET=x64-windows-static -DENABLE_SDL=TRUE"
|
||||
}, {
|
||||
"name": "x86-static-Debug",
|
||||
"generator": "Ninja",
|
||||
"configurationType": "Debug",
|
||||
"inheritEnvironments": [
|
||||
"msvc_x86"
|
||||
],
|
||||
"buildRoot": "${env.USERPROFILE}\\CMakeBuilds\\${workspaceHash}\\build\\${name}",
|
||||
"installRoot": "${env.USERPROFILE}\\CMakeBuilds\\${workspaceHash}\\install\\${name}",
|
||||
"cmakeCommandArgs": "-DVCPKG_TARGET_TRIPLET=x86-windows-static -DENABLE_SDL=TRUE"
|
||||
}, {
|
||||
"name": "x86-static-Release",
|
||||
"generator": "Ninja",
|
||||
"configurationType": "Release",
|
||||
"inheritEnvironments": [
|
||||
"msvc_x86"
|
||||
],
|
||||
"buildRoot": "${env.USERPROFILE}\\CMakeBuilds\\${workspaceHash}\\build\\${name}",
|
||||
"installRoot": "${env.USERPROFILE}\\CMakeBuilds\\${workspaceHash}\\install\\${name}",
|
||||
"cmakeCommandArgs": "-DVCPKG_TARGET_TRIPLET=x86-windows-static -DENABLE_SDL=TRUE"
|
||||
}, {
|
||||
"name": "x86-static-RelWithDebInfo",
|
||||
"generator": "Ninja",
|
||||
"configurationType": "RelWithDebInfo",
|
||||
"inheritEnvironments": [
|
||||
"msvc_x86"
|
||||
],
|
||||
"buildRoot": "${env.USERPROFILE}\\CMakeBuilds\\${workspaceHash}\\build\\${name}",
|
||||
"installRoot": "${env.USERPROFILE}\\CMakeBuilds\\${workspaceHash}\\install\\${name}",
|
||||
"cmakeCommandArgs": "-DVCPKG_TARGET_TRIPLET=x86-windows-static -DENABLE_SDL=TRUE"
|
||||
}, {
|
||||
"name": "arm64-static-Debug",
|
||||
"generator": "Ninja",
|
||||
"configurationType": "Debug",
|
||||
"inheritEnvironments": [
|
||||
"msvc_arm64"
|
||||
],
|
||||
"buildRoot": "${env.USERPROFILE}\\CMakeBuilds\\${workspaceHash}\\build\\${name}",
|
||||
"installRoot": "${env.USERPROFILE}\\CMakeBuilds\\${workspaceHash}\\install\\${name}",
|
||||
"cmakeCommandArgs": "-DVCPKG_TARGET_TRIPLET=arm64-windows-static -DENABLE_SDL=TRUE"
|
||||
}, {
|
||||
"name": "arm64-static-Release",
|
||||
"generator": "Ninja",
|
||||
"configurationType": "Release",
|
||||
"inheritEnvironments": [
|
||||
"msvc_arm64"
|
||||
],
|
||||
"buildRoot": "${env.USERPROFILE}\\CMakeBuilds\\${workspaceHash}\\build\\${name}",
|
||||
"installRoot": "${env.USERPROFILE}\\CMakeBuilds\\${workspaceHash}\\install\\${name}",
|
||||
"cmakeCommandArgs": "-DVCPKG_TARGET_TRIPLET=arm64-windows-static -DENABLE_SDL=TRUE"
|
||||
}, {
|
||||
"name": "arm64-static-RelWithDebInfo",
|
||||
"generator": "Ninja",
|
||||
"configurationType": "RelWithDebInfo",
|
||||
"inheritEnvironments": [
|
||||
"msvc_arm64"
|
||||
],
|
||||
"buildRoot": "${env.USERPROFILE}\\CMakeBuilds\\${workspaceHash}\\build\\${name}",
|
||||
"installRoot": "${env.USERPROFILE}\\CMakeBuilds\\${workspaceHash}\\install\\${name}",
|
||||
"cmakeCommandArgs": "-DVCPKG_TARGET_TRIPLET=arm64-windows-static -DENABLE_SDL=TRUE"
|
||||
}
|
||||
]
|
||||
}
|
||||
|
407
DEVELOPER-MANUAL.md
Normal file
407
DEVELOPER-MANUAL.md
Normal file
@@ -0,0 +1,407 @@
|
||||
<!-- START doctoc generated TOC please keep comment here to allow auto update -->
|
||||
<!-- DON'T EDIT THIS SECTION, INSTEAD RE-RUN doctoc TO UPDATE -->
|
||||
|
||||
- [visualboyadvance-m Developer Manual](#visualboyadvance-m-developer-manual)
|
||||
- [Issues Policies](#issues-policies)
|
||||
- [Processing New Issues](#processing-new-issues)
|
||||
- [Resolving Issues](#resolving-issues)
|
||||
- [Pull Request and Commit Policies](#pull-request-and-commit-policies)
|
||||
- [Commit Message](#commit-message)
|
||||
- [Collaboration on a Branch](#collaboration-on-a-branch)
|
||||
- [Commits from Maintainers](#commits-from-maintainers)
|
||||
- [Strings, Character Sets and Translations](#strings-character-sets-and-translations)
|
||||
- [Pulling Updated Translations](#pulling-updated-translations)
|
||||
- [Translations Message Catalog](#translations-message-catalog)
|
||||
- [Interaction with non-wxWidgets Code](#interaction-with-non-wxwidgets-code)
|
||||
- [Windows Native Development Environment Setup](#windows-native-development-environment-setup)
|
||||
- [Release Process](#release-process)
|
||||
- [Environment](#environment)
|
||||
- [Release Commit and Tag](#release-commit-and-tag)
|
||||
- [64-bit Windows Binary](#64-bit-windows-binary)
|
||||
- [32-bit Windows Binary](#32-bit-windows-binary)
|
||||
- [64-bit Mac Binary](#64-bit-mac-binary)
|
||||
- [Final steps](#final-steps)
|
||||
|
||||
<!-- END doctoc generated TOC please keep comment here to allow auto update -->
|
||||
|
||||
## visualboyadvance-m Developer Manual
|
||||
|
||||
Here we will keep notes about our development process, policies and environment
|
||||
setup guides.
|
||||
|
||||
### Issues Policies
|
||||
|
||||
#### Processing New Issues
|
||||
|
||||
Follow the following steps to process newly submitted issues:
|
||||
|
||||
- Edit the user's post to remove unused template sections etc.. Rephrase the
|
||||
issue title if it needs to be clarified.
|
||||
|
||||
- Label the issue as a question, bug or enhancement. This label can be changed
|
||||
later upon clarification if necessary.
|
||||
|
||||
- Add any other relevant labels, for example for the code subsystem.
|
||||
|
||||
- If it is strongly related to a work by a developer that you know of, assign
|
||||
them to the issue. If this is not the case, they can be unassigned.
|
||||
|
||||
- Ask the user for clarification of any details if needed.
|
||||
|
||||
#### Resolving Issues
|
||||
|
||||
- An issue is resolved by closing it in github. A commit that fixes the issue
|
||||
should have the following line near the end of the body of the commit message:
|
||||
```
|
||||
- Fix #999.
|
||||
```
|
||||
This will automatically close the issue and assign the closing commit in the
|
||||
github metadata when it is merged to master. The issue can be reopened if
|
||||
needed.
|
||||
- A commit that is work towards resolving an issue, should have the issue number
|
||||
preceded by a pound sign either at the end of a commit message title, if it is
|
||||
of primary relevance to the issue, or the body otherwise.
|
||||
|
||||
### Pull Request and Commit Policies
|
||||
|
||||
#### Commit Message
|
||||
|
||||
Follow these guidelines always:
|
||||
|
||||
https://tbaggery.com/2008/04/19/a-note-about-git-commit-messages.html
|
||||
|
||||
the description of your work should be in the **commit message NOT the pull
|
||||
request description**.
|
||||
|
||||
The title line must be no more than 50 characters and the description must be
|
||||
wrapped at 72 characters. Most commit message editor interfaces will help you
|
||||
with this. The title line must not end with a period.
|
||||
|
||||
Write everything in the imperative mood, e.g. change, fix, **NOT** changes,
|
||||
changed, fixed, fixes etc..
|
||||
|
||||
A commit message must always have a title and a description, the description
|
||||
must be independent of the title line, if necessary repeat the information in
|
||||
the title line in the description.
|
||||
|
||||
Make sure the git history in your branch is clean and logical, edit when
|
||||
necessary with `rebase -i`.
|
||||
|
||||
Use one commit per logical change if necessary, most work can be squashed into
|
||||
one commit when you are done. It is not necessary to have separate commits
|
||||
per-file if they are one logical change. We are less strict about this than
|
||||
other projects, fewer is better.
|
||||
|
||||
The commit title line should be prefixed with an area, unless it involves the
|
||||
wxWidgets GUI app, in which case it should **NOT** have a prefix.
|
||||
|
||||
The text after the area prefix should not be capitalized.
|
||||
|
||||
Please use one of these area prefixes otherwise:
|
||||
|
||||
- doc: documentation, README.md etc.
|
||||
- build: cmake, installdeps, preprocessor compatibility defines, etc.
|
||||
- gb-core: the GameBoy emulator core
|
||||
- gba-core: the GameBoy Advance emulator core
|
||||
- libretro: the libretro core glue and build
|
||||
- sdl-app: anything for the SDL app
|
||||
- translations: anything related to translations
|
||||
|
||||
. Add other areas here if needed.
|
||||
|
||||
If a commit fixes a regression, use a title line such as:
|
||||
|
||||
```console
|
||||
Fix regression <PROBLEM> in <SHORT-SHA>
|
||||
```
|
||||
, you can get the short sha from `git log --oneline -100` or similar.
|
||||
|
||||
The commit description for a regression must refer to the breaking change in
|
||||
reference format, which you can get from e.g. `git log --format=reference -20`.
|
||||
|
||||
You can refer to github issues using `#<ISSUE-NUMBER>` freely in the description
|
||||
text.
|
||||
|
||||
If a commit fixes an issue, add a line at the end of the description such as:
|
||||
|
||||
```console
|
||||
Fix #<ISSUE-NUMBER>.
|
||||
```
|
||||
.
|
||||
|
||||
#### Collaboration on a Branch
|
||||
|
||||
To update when multiple people are working on a git branch, keep a couple of
|
||||
things in mind:
|
||||
|
||||
- Always `push -f` unless you're adding a commit on top. And it's almost always
|
||||
better to edit the history than to add more commits. Never add commits fixing
|
||||
previous commits, only improving or adding to them.
|
||||
|
||||
- To update when someone else (very rudely you might say) did a `push -f`, `pull
|
||||
--rebase` will **USUALLY** work. Verify the log, and if necessary do this
|
||||
instead:
|
||||
|
||||
```bash
|
||||
git status # should be clean, with your work having been already pushed
|
||||
git fetch --all --prune
|
||||
git reset --hard origin/<branch-name>
|
||||
```
|
||||
|
||||
While actively working on a branch, keep it rebased on top of master.
|
||||
|
||||
#### Commits from Maintainers
|
||||
|
||||
Maintainers have the power to commit directly to master. This power must be
|
||||
used responsibly, something I fail to do myself often, and will try to improve
|
||||
upon.
|
||||
|
||||
Make your most earnest attempt to follow these general guidelines to keep our
|
||||
history clean:
|
||||
|
||||
- Things that are a straight fix or improvement that does not require discussion
|
||||
can be committed directly, keeping the following guidelines in mind.
|
||||
|
||||
- Bigger new features, code refactors and changes in architecture should go
|
||||
through the PR process.
|
||||
|
||||
- Push code changes to a branch first, so they can run through the CI.
|
||||
Differences in what different compilers allow is a problem that comes up
|
||||
**VERY** frequently. As well as incompatibilities between different
|
||||
configurations for both the C++ code and any supporting code.
|
||||
|
||||
|
||||
### Strings, Character Sets and Translations
|
||||
|
||||
#### Pulling Updated Translations
|
||||
|
||||
Once in a while it is necessary to pull new and updated translations from
|
||||
transifex.
|
||||
|
||||
For this you need the transifex client, available for Windows as well from
|
||||
chocolatey as `transifex-client`.
|
||||
|
||||
To pull translations run:
|
||||
|
||||
```bash
|
||||
tx pull -af
|
||||
```
|
||||
|
||||
then check `git status` and if any message catalogs were updated, commit the
|
||||
result as:
|
||||
|
||||
```bash
|
||||
git commit -a --signoff -S -m'Transifex pull.'
|
||||
git push
|
||||
```
|
||||
|
||||
#### Translations Message Catalog
|
||||
|
||||
Strings that need to be translated by our wonderful translators on transifex
|
||||
(thank you guys very much) need to be enclosed in `_("...")`, for example:
|
||||
|
||||
```cpp
|
||||
wxLogError(_("error: something very wrong"));
|
||||
```
|
||||
|
||||
The next time you run cmake after adding a string to be translated, the `.pot`
|
||||
message catalog source will be regenerated, and you will see a loud message
|
||||
telling you to push to transifex.
|
||||
|
||||
Strings in the XRC XML GUI definition files are automatically added to the
|
||||
message catalog as well.
|
||||
|
||||
If you are working on a branch or a PR, don't push to transifex until it has
|
||||
been merged to master.
|
||||
|
||||
Once it is, push it with:
|
||||
|
||||
```bash
|
||||
tx push -s
|
||||
```
|
||||
|
||||
#### Interaction with non-wxWidgets Code
|
||||
|
||||
Use our `UTF8(...)` function to force any `wxString` to UTF-8 for use by other
|
||||
libraries, screen output or OS APIs. For example:
|
||||
|
||||
```cpp
|
||||
fprintf(STDERR, "Error: %s\n", UTF8(err_msg));
|
||||
```
|
||||
|
||||
There is one exception to this, when using `wxString::Printf()` and such, you
|
||||
can't pass another `wxString` to the `%s` format directly, use something like
|
||||
this:
|
||||
|
||||
```cpp
|
||||
wxString err;
|
||||
err.Printf("Cannot read file: %s", fname.wc_str());
|
||||
```
|
||||
|
||||
this uses the `wchar_t` UTF-16 representation on Windows and does nothing
|
||||
elsewhere.
|
||||
|
||||
For calling Windows APIs with strings, use the wide char `W` variants and the
|
||||
`wc_str()` method as well.
|
||||
|
||||
### Windows Native Development Environment Setup
|
||||
|
||||
This guide has been moved to:
|
||||
|
||||
https://github.com/rkitover/windows-dev-guide
|
||||
|
||||
### Release Process
|
||||
|
||||
#### Environment
|
||||
|
||||
The variable `VBAM_NO_PAUSE`, if set, will cause cmake to not pause before gpg
|
||||
signing operations, you want to set this if you've disabled your gpg passphrase
|
||||
to not require interaction during release builds.
|
||||
|
||||
gpg set up with your key is helpful for the release process on all environments
|
||||
where a binary is built, but you can also make the detached signature files
|
||||
yourself at the end of the process.
|
||||
|
||||
For codesigning windows binaries, put your certificate into
|
||||
`~/.codesign/windows_comodo.pkcs12`.
|
||||
|
||||
On Mac the 'Developer ID Application' certificate stored in your login keychain
|
||||
is used, `keychain unlock` will prompt you for your login keychain password, to
|
||||
avoid that set the `LOGIN_KEYCHAIN_PASSWORD` environment variable to your
|
||||
password.
|
||||
|
||||
#### Release Commit and Tag
|
||||
|
||||
Once you are sure you're ready to release, and you are in a git clone on master
|
||||
with a clean working tree, use the cmake script to make the release commit and
|
||||
tag:
|
||||
|
||||
```bash
|
||||
mkdir build && cd build
|
||||
cmake .. -DTAG_RELEASE=TRUE
|
||||
```
|
||||
|
||||
then push the release:
|
||||
|
||||
```bash
|
||||
git push
|
||||
git push --tags
|
||||
```
|
||||
|
||||
If you don't want to push the release, to back out the change do:
|
||||
|
||||
```bash
|
||||
cmake .. -DTAG_RELEASE=UNDO
|
||||
```
|
||||
|
||||
#### 64-bit Windows Binary
|
||||
|
||||
For this you will preferably need the powershell environment setup described
|
||||
earlier, however you can use a regular Visual Studio 64 bit native developer
|
||||
command prompt as well.
|
||||
|
||||
```powershell
|
||||
mkdir build
|
||||
cd build
|
||||
cmake .. -DVCPKG_TARGET_TRIPLET=x64-windows-static -DCMAKE_BUILD_TYPE=Release -DUPSTREAM_RELEASE=TRUE -G Ninja
|
||||
ninja
|
||||
```
|
||||
|
||||
Collect the following files for the release:
|
||||
|
||||
- `visualboyadvance-m-Win-64bit.zip`
|
||||
- `visualboyadvance-m-Win-64bit.zip.asc`
|
||||
- `translations.zip`
|
||||
- `translations.zip.asc`
|
||||
|
||||
#### 32-bit Windows Binary
|
||||
|
||||
For this the optimal environment is a linux distribution with the mingw
|
||||
toolchain, I use fedora.
|
||||
|
||||
You can set up a shell on a fedora distribution with docker as described here:
|
||||
|
||||
https://gist.github.com/rkitover/6379764c619c10e829e4b2fa0ae243fd
|
||||
|
||||
If using fedora, the cross script will install all necessary dependencies, if
|
||||
not install the base toolchain (mingw gcc, binutils, winpthreads) using the
|
||||
preferred method for your distribution, you can also use mxe for this.
|
||||
|
||||
https://mxe.cc/
|
||||
|
||||
```bash
|
||||
sh tools/win/linux-cross-builder -32
|
||||
```
|
||||
|
||||
You can also use msys2 on Windows, this is not recommended:
|
||||
|
||||
```bash
|
||||
sh tools/win/msys2-builder -32
|
||||
```
|
||||
|
||||
To set up msys2, see this guide:
|
||||
|
||||
https://gist.github.com/rkitover/d008324309044fc0cc742bdb16064454
|
||||
|
||||
Collect the following files from `~/vbam-build-mingw32/project` if using linux,
|
||||
or `~/vbam-build-msys2-x86_64/project` if using msys2:
|
||||
|
||||
- `visualboyadvance-m-Win-32bit.zip`
|
||||
- `visualboyadvance-m-Win-32bit.zip.asc`
|
||||
|
||||
#### 64-bit Mac Binary
|
||||
|
||||
Install the latest Xcode for your OS.
|
||||
|
||||
You will need bash and (optionally) gpg from homebrew (which you will also need
|
||||
to install):
|
||||
|
||||
```bash
|
||||
brew install bash gnupg
|
||||
```
|
||||
|
||||
You will need a codesigning certificate from Apple, which you will be able to
|
||||
generate once you join their developer program. This is the certificate of the
|
||||
type 'Developer ID Application' stored in your login keychain. `keychain
|
||||
unlock` will prompt you for your login keychain password, to avoid that set the
|
||||
`LOGIN_KEYCHAIN_PASSWORD` environment variable to your password.
|
||||
|
||||
```bash
|
||||
/usr/local/bin/bash tools/osx/builder -64
|
||||
```
|
||||
|
||||
Collect the following files from `~/vbam-build-mac-64bit/project`:
|
||||
|
||||
- `visualboyadvance-m-Mac-64bit.zip`
|
||||
- `visualboyadvance-m-Mac-64bit.zip.asc`
|
||||
|
||||
#### Final steps
|
||||
|
||||
Go to the github releases tab, and make a release for the tag you pushed
|
||||
earlier.
|
||||
|
||||
Put any notes to users and distro maintainers into the description as well as
|
||||
the entries from `CHANGELOG.md` generated earlier from git by the release
|
||||
commit script.
|
||||
|
||||
Upload all files collected during the earlier builds, the complete list is:
|
||||
|
||||
|
||||
- `translations.zip`
|
||||
- `translations.zip.asc`
|
||||
- `visualboyadvance-m-Mac-64bit.zip`
|
||||
- `visualboyadvance-m-Mac-64bit.zip.asc`
|
||||
- `visualboyadvance-m-Win-32bit.zip`
|
||||
- `visualboyadvance-m-Win-32bit.zip.asc`
|
||||
- `visualboyadvance-m-Win-64bit.zip`
|
||||
- `visualboyadvance-m-Win-64bit.zip.asc`
|
||||
|
||||
Update the winsparkle appcast.xml by running this cmake command:
|
||||
|
||||
```bash
|
||||
cmake .. -DUPDATE_APPCAST=TRUE
|
||||
```
|
||||
|
||||
follow the instructions to push the change to the web data repo.
|
||||
|
||||
Announce the release on reddit r/emulation and the forum.
|
142
README.md
142
README.md
@@ -6,6 +6,7 @@
|
||||
- [Building](#building)
|
||||
- [Building a Libretro core](#building-a-libretro-core)
|
||||
- [Visual Studio Support](#visual-studio-support)
|
||||
- [Visual Studio Code Support](#visual-studio-code-support)
|
||||
- [Dependencies](#dependencies)
|
||||
- [Cross compiling for 32 bit on a 64 bit host](#cross-compiling-for-32-bit-on-a-64-bit-host)
|
||||
- [Cross Compiling for Win32](#cross-compiling-for-win32)
|
||||
@@ -18,25 +19,42 @@
|
||||
<!-- END doctoc generated TOC please keep comment here to allow auto update -->
|
||||
|
||||
[](https://gitter.im/visualboyadvance-m/Lobby)
|
||||
[](https://travis-ci.org/visualboyadvance-m/visualboyadvance-m)
|
||||
[](https://ci.appveyor.com/project/ZachBacon65337/visualboyadvance-m-2ys5r)
|
||||
|
||||
Our bridged Discord server is [Here](https://discord.gg/EpfxEuGMKH).
|
||||
|
||||
We are also on *`#vba-m`* on [Libera IRC](https://libera.chat/) which has a [Web
|
||||
Chat](https://web.libera.chat/).
|
||||
|
||||
[](https://flathub.org/apps/com.vba_m.visualboyadvance-m)
|
||||
[](https://snapcraft.io/visualboyadvance-m)
|
||||
|
||||
***Want to know where you can install visualboyadvance-m in your linux distribution?***
|
||||
|
||||
[](https://repology.org/project/visualboyadvance-m/versions)
|
||||
|
||||
# Visual Boy Advance - M
|
||||
|
||||
Game Boy Advance Emulator
|
||||
Game Boy and Game Boy Advance Emulator
|
||||
|
||||
The Forum is here: https://vba-m.com/forums/
|
||||
The forums are [here](https://board.visualboyadvance-m.org/).
|
||||
|
||||
Windows and Mac builds are in the [releases tab](https://github.com/visualboyadvance-m/visualboyadvance-m/releases).
|
||||
|
||||
Your distribution may have packages available as well, search for "vbam" or "visualboyadvance-m".
|
||||
Nightly builds for Windows and macOS are at [https://nightly.visualboyadvance-m.org/](https://nightly.visualboyadvance-m.org/).
|
||||
|
||||
**PLEASE TEST THE NIGHTLY OR MASTER WITH A FACTORY RESET BEFORE REPORTING
|
||||
ISSUES**
|
||||
|
||||
Your distribution may have packages available as well, search for
|
||||
`visualboyadvance-m` or `vbam`.
|
||||
|
||||
It is also generally very easy to build from source, see below.
|
||||
|
||||
If you are using the windows binary release and you need localization, unzip
|
||||
the `translations.zip` to the same directory as the executable.
|
||||
|
||||
If you are having issues, try resetting the config file first, go to `Help -> Factory Reset`.
|
||||
If you are having issues, try resetting the config file first, go to `Help ->
|
||||
Factory Reset`.
|
||||
|
||||
## Building
|
||||
|
||||
@@ -51,34 +69,39 @@ cd visualboyadvance-m
|
||||
# ./installdeps will give you build instructions, which will be similar to:
|
||||
|
||||
mkdir build && cd build
|
||||
cmake ..
|
||||
make -j`nproc`
|
||||
cmake .. -G Ninja
|
||||
ninja
|
||||
```
|
||||
|
||||
`./installdeps` is supported on MSys2, Linux (Debian/Ubuntu, Fedora, Arch,
|
||||
Solus, OpenSUSE, Gentoo and RHEL/CentOS) and Mac OS X (homebrew, macports or
|
||||
fink.)
|
||||
|
||||
The Ninja cmake generator is also now supported (except for Visual Studio.)
|
||||
|
||||
## Building a Libretro core
|
||||
|
||||
```
|
||||
Clone this repo and then,
|
||||
$ cd src
|
||||
$ cd libretro
|
||||
$ make
|
||||
|
||||
```bash
|
||||
cd src/libretro
|
||||
make -j`nproc`
|
||||
```
|
||||
|
||||
Copy vbam_libretro.so to your RetroArch cores directory.
|
||||
```
|
||||
|
||||
## Visual Studio Support
|
||||
|
||||
For visual studio, dependency management is handled automatically with vcpkg,
|
||||
just clone the repository with git and build with cmake. You can do this from
|
||||
the developer command line as well. 2019 will not work yet for building
|
||||
dependencies, but you can build the dependencies in 2017 and then use the
|
||||
project from 2019.
|
||||
From the Visual Studio GUI, just clone the repository with git and build with
|
||||
the cmake configurations provided.
|
||||
|
||||
If the GUI does not detect cmake, go to `File -> Open -> CMake` and open the
|
||||
`CMakeLists.txt`.
|
||||
|
||||
If you are using 2017, make sure you have all the latest updates, some issues
|
||||
with cmake projects in the GUI have been fixed.
|
||||
|
||||
You can also build from the developer command prompt or powershell with the
|
||||
environment loaded.
|
||||
|
||||
Using your own user-wide installation of vcpkg is supported, just make sure the
|
||||
environment variable `VCPKG_ROOT` is set.
|
||||
@@ -88,12 +111,27 @@ To build in the visual studio command prompt, use something like this:
|
||||
```
|
||||
mkdir build
|
||||
cd build
|
||||
cmake .. -DVCPKG_TARGET_TRIPLET=x64-windows
|
||||
msbuild -m -p:BuildInParallel=true -p:Configuration=Release .\ALL_BUILD.vcxproj
|
||||
cmake .. -DVCPKG_TARGET_TRIPLET=x64-windows-static -DCMAKE_BUILD_TYPE=Debug -G Ninja
|
||||
ninja
|
||||
```
|
||||
|
||||
This support is new and we are still working out some issues, including support
|
||||
for static builds.
|
||||
## Visual Studio Code Support
|
||||
|
||||
Make sure the
|
||||
[C/C++](https://marketplace.visualstudio.com/items?itemName=ms-vscode.cpptools)
|
||||
and [CMake
|
||||
Tools](https://marketplace.visualstudio.com/items?itemName=ms-vscode.cmake-tools)
|
||||
extensions are installed.
|
||||
|
||||
Add the following to your `settings.json`:
|
||||
|
||||
```json
|
||||
{
|
||||
"cmake.configureOnOpen": true,
|
||||
"cmake.preferredGenerators": [ "Ninja" ]
|
||||
}
|
||||
```
|
||||
.
|
||||
|
||||
## Dependencies
|
||||
|
||||
@@ -110,12 +148,11 @@ And the following development libraries:
|
||||
- [zlib](https://zlib.net/) (required)
|
||||
- [mesa](https://mesa3d.org/) (if using X11 or any OpenGL otherwise)
|
||||
- [ffmpeg](https://ffmpeg.org/) (optional, at least version `4.0.4`, for game recording)
|
||||
- [gettext](https://www.gnu.org/software/gettext/) and gettext-tools (optional, with ENABLE_NLS)
|
||||
- [libpng](http://www.libpng.org/pub/png/libpng.html) (required)
|
||||
- [gettext](https://www.gnu.org/software/gettext/) and gettext-tools
|
||||
- [SDL2](https://www.libsdl.org/) (required)
|
||||
- [SFML](https://www.sfml-dev.org/) (optional, for link)
|
||||
- [OpenAL](https://www.openal.org/) or [openal-soft](https://kcat.strangesoft.net/openal.html) (optional, a sound interface)
|
||||
- [wxWidgets](https://wxwidgets.org/) (required for GUI, 2.8 is still supported, --enable-stl is supported)
|
||||
- [OpenAL](https://www.openal.org/) or [openal-soft](https://kcat.strangesoft.net/openal.html) (required, a sound interface)
|
||||
- [wxWidgets](https://wxwidgets.org/) (required for GUI, 2.8 and non-stl builds are no longer supported)
|
||||
|
||||
On Linux and similar, you also need the version of GTK your wxWidgets is linked
|
||||
to (usually 2 or 3) and the xorg development libraries.
|
||||
@@ -132,7 +169,7 @@ This is supported on Fedora, Arch, Solus and MSYS2.
|
||||
|
||||
`./installdeps` takes one optional parameter for cross-compiling target, which
|
||||
may be `win32` which is an alias for `mingw-w64-i686` to target 32 bit Windows,
|
||||
or `mingw-gw64-x86_64` for 64 bit Windows targets.
|
||||
or `mingw-w64-x86_64` for 64 bit Windows targets.
|
||||
|
||||
The target is implicit on MSys2 depending on which MINGW shell you started (the
|
||||
value of `$MSYSTEM`.)
|
||||
@@ -151,14 +188,14 @@ The CMake code tries to guess reasonable defaults for options, but you can
|
||||
override them, for example:
|
||||
|
||||
```shell
|
||||
cmake .. -DENABLE_LINK=NO
|
||||
cmake .. -DENABLE_LINK=NO -G Ninja
|
||||
```
|
||||
|
||||
Of particular interest is making **RELEASE** or **DEBUG** builds, the default
|
||||
mode is **RELEASE**, to make a **DEBUG** build use something like:
|
||||
Of particular interest is making **Release** or **Debug** builds, the default
|
||||
mode is **Release**, to make a **Debug** build use something like:
|
||||
|
||||
```shell
|
||||
cmake .. -DCMAKE_BUILD_TYPE=Debug
|
||||
cmake .. -DCMAKE_BUILD_TYPE=Debug -G Ninja
|
||||
```
|
||||
|
||||
Here is the complete list:
|
||||
@@ -168,7 +205,6 @@ Here is the complete list:
|
||||
| ENABLE_SDL | Build the SDL port | OFF |
|
||||
| ENABLE_WX | Build the wxWidgets port | ON |
|
||||
| ENABLE_DEBUGGER | Enable the debugger | ON |
|
||||
| ENABLE_NLS | Enable translations | ON |
|
||||
| ENABLE_ASM_CORE | Enable x86 ASM CPU cores (**BUGGY AND DANGEROUS**) | OFF |
|
||||
| ENABLE_ASM | Enable the following two ASM options | ON for 32 bit builds |
|
||||
| ENABLE_ASM_SCALERS | Enable x86 ASM graphic filters | ON for 32 bit builds |
|
||||
@@ -182,20 +218,24 @@ Here is the complete list:
|
||||
| ENABLE_DIRECT3D | Direct3D rendering for wxWidgets (Windows, **NOT IMPLEMENTED!!!**) | ON |
|
||||
| ENABLE_XAUDIO2 | Enable xaudio2 sound output for wxWidgets (Windows only) | ON |
|
||||
| ENABLE_OPENAL | Enable OpenAL for the wxWidgets port | AUTO |
|
||||
| ENABLE_SSP | Enable gcc stack protector support (gcc only) | OFF |
|
||||
| ENABLE_ASAN | Enable libasan sanitizers (by default address, only in debug mode) | OFF |
|
||||
| UPSTREAM_RELEASE | Do some release tasks, like codesigning, making zip and gpg sigs. | OFF |
|
||||
| BUILD_TESTING | Build the tests and enable ctest support. | ON |
|
||||
| VBAM_STATIC | Try link all libs statically (the following are set to ON if ON) | OFF |
|
||||
| SDL2_STATIC | Try to link static SDL2 libraries | OFF |
|
||||
| SFML_STATIC_LIBRARIES | Try to link static SFML libraries | OFF |
|
||||
| FFMPEG_STATIC | Try to link static ffmpeg libraries | OFF |
|
||||
| SSP_STATIC | Try to link static gcc stack protector library (gcc only) | OFF except Win32 |
|
||||
| OPENAL_STATIC | Try to link static OpenAL libraries | OFF |
|
||||
| SSP_STATIC | Link gcc stack protecter libssp statically (gcc, with ENABLE_SSP) | OFF |
|
||||
| TRANSLATIONS_ONLY | Build only the translations.zip and nothing else | OFF |
|
||||
|
||||
Note for distro packagers, we use the CMake module
|
||||
[GNUInstallDirs](https://cmake.org/cmake/help/v2.8.12/cmake.html#module:GNUInstallDirs)
|
||||
to configure installation directories.
|
||||
|
||||
On Unix to use a different version of wxWidgets, set
|
||||
`wxWidgets_CONFIG_EXECUTABLE` to the path to the `wx-config` script you want to
|
||||
use.
|
||||
|
||||
## MSys2 Notes
|
||||
|
||||
To run the resulting binary, you can simply type:
|
||||
@@ -217,13 +257,12 @@ System -> Advanced system settings -> Environment Variables.)
|
||||
If you want to package the binary, you will need to include the MinGW DLLs it
|
||||
depends on, they can install to the same directory as the binary.
|
||||
|
||||
For our own builds, we use MXE to make static builds.
|
||||
Our own builds are static.
|
||||
|
||||
## Debug Messages
|
||||
|
||||
We have an override for `wxLogDebug()` to make it work even in non-debug builds
|
||||
of wx and on windows, even in mintty. Using this function for console debug
|
||||
messages is recommended.
|
||||
of wx and on windows, even in mintty.
|
||||
|
||||
It works like `printf()`, e.g.:
|
||||
|
||||
@@ -232,6 +271,17 @@ int foo = 42;
|
||||
wxLogDebug(wxT("the value of foo = %d"), foo);
|
||||
```
|
||||
|
||||
From the core etc. the usual:
|
||||
|
||||
```cpp
|
||||
fprintf(stderr, "...", ...);
|
||||
```
|
||||
|
||||
will work fine.
|
||||
|
||||
You need a debug build for this to work or to even have a console on Windows.
|
||||
Pass `-DCMAKE_BUILD_TYPE=Debug` to cmake.
|
||||
|
||||
## Reporting Crash Bugs
|
||||
|
||||
If the emulator crashes and you wish to report the bug, a backtrace made with
|
||||
@@ -274,16 +324,4 @@ This may be a bit of a hassle, but it helps us out immensely.
|
||||
|
||||
## Contributing
|
||||
|
||||
Please keep in mind that this app needs to run on Windows, Linux and macOS at
|
||||
the very least, so code should be portable and/or use the appropriate `#ifdef`s
|
||||
and the like when needed.
|
||||
|
||||
Please try to craft a good commit message, this post by the great tpope explains
|
||||
how to do so:
|
||||
http://tbaggery.com/2008/04/19/a-note-about-git-commit-messages.html
|
||||
|
||||
If you have multiple small commits for a change, please try to use `git rebase
|
||||
-i` (interactive rebase) to squash them into one or a few logical commits (with
|
||||
good commit messages!) See:
|
||||
https://git-scm.com/book/en/v2/Git-Tools-Rewriting-History if you are new to
|
||||
this.
|
||||
See the [Developer Manual](/DEVELOPER-MANUAL.md).
|
||||
|
29
appveyor.yml
29
appveyor.yml
@@ -1,29 +0,0 @@
|
||||
version: '{build}'
|
||||
|
||||
image:
|
||||
- Visual Studio 2017
|
||||
|
||||
configuration:
|
||||
- Release
|
||||
|
||||
platform:
|
||||
- x64
|
||||
|
||||
environment:
|
||||
matrix:
|
||||
- arch: Win64
|
||||
|
||||
matrix:
|
||||
fast_finish: true
|
||||
|
||||
before_build:
|
||||
- cmd: |-
|
||||
mkdir build
|
||||
cd build
|
||||
cmake .. -DVCPKG_TARGET_TRIPLET=x64-windows
|
||||
|
||||
build_script:
|
||||
- msbuild -m -p:BuildInParallel=true -p:Configuration=Release ALL_BUILD.vcxproj
|
||||
|
||||
cache:
|
||||
- c:\projects\vcpkg
|
52
cmake-variants.yaml
Normal file
52
cmake-variants.yaml
Normal file
@@ -0,0 +1,52 @@
|
||||
buildType:
|
||||
default: debug
|
||||
choices:
|
||||
debug:
|
||||
short: Debug
|
||||
long: Emit debug information
|
||||
buildType: Debug
|
||||
release:
|
||||
short: Release
|
||||
long: Optimize generated code
|
||||
buildType: Release
|
||||
|
||||
linkage:
|
||||
default: static
|
||||
choices:
|
||||
static:
|
||||
short: Static
|
||||
long: Create static libraries
|
||||
linkage: static
|
||||
shared:
|
||||
short: Shared
|
||||
long: Create shared libraries/DLLs
|
||||
linkage: shared
|
||||
|
||||
useLink:
|
||||
default: withlink
|
||||
choices:
|
||||
withlink:
|
||||
short: WithLink
|
||||
long: Enable the Link feature
|
||||
settings:
|
||||
ENABLE_LINK: ON
|
||||
nolink:
|
||||
short: NoLink
|
||||
long: Disable the Link feature
|
||||
settings:
|
||||
ENABLE_LINK: OFF
|
||||
|
||||
useDebugger:
|
||||
default: withdebugger
|
||||
choices:
|
||||
withdebugger:
|
||||
short: WithDebugger
|
||||
long: Enable the Debugger feature
|
||||
settings:
|
||||
ENABLE_DEBUGGER: ON
|
||||
nodebugger:
|
||||
short: NoDebugger
|
||||
long: Disable the Debugger feature
|
||||
settings:
|
||||
ENABLE_DEBUGGER: OFF
|
||||
ENABLE_SDL: OFF
|
@@ -7,20 +7,59 @@ if(NOT CMAKE_SYSTEM_PROCESSOR)
|
||||
else()
|
||||
set(CMAKE_SYSTEM_PROCESSOR x86_64)
|
||||
endif()
|
||||
elseif(CROSS_ARCH STREQUAL x86_64)
|
||||
set(CMAKE_SYSTEM_PROCESSOR x86_64)
|
||||
elseif(CROSS_ARCH STREQUAL i686)
|
||||
set(CMAKE_SYSTEM_PROCESSOR i686)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
# turn asm on by default on 32bit x86
|
||||
# and set WINARCH for windows stuff
|
||||
# The processor may not be set, but set BITS regardless.
|
||||
if(CMAKE_C_SIZEOF_DATA_PTR EQUAL 4)
|
||||
set(BITS 32)
|
||||
elseif(CMAKE_C_SIZEOF_DATA_PTR EQUAL 8)
|
||||
set(BITS 64)
|
||||
endif()
|
||||
|
||||
if(VCPKG_TARGET_TRIPLET MATCHES "^[aA][rR][mM]64")
|
||||
set(CMAKE_SYSTEM_PROCESSOR ARM64)
|
||||
elseif(VCPKG_TARGET_TRIPLET MATCHES "^[aA][rR][mM]-")
|
||||
set(CMAKE_SYSTEM_PROCESSOR ARM)
|
||||
endif()
|
||||
|
||||
# Turn asm on by default on 32bit x86 and set WINARCH for windows stuff.
|
||||
if(CMAKE_SYSTEM_PROCESSOR MATCHES "[xX]86|i[3-9]86|[aA][mM][dD]64")
|
||||
if(CMAKE_C_SIZEOF_DATA_PTR EQUAL 4) # 32 bit
|
||||
if(NOT (MSVC AND CMAKE_TOOLCHAIN_FILE MATCHES vcpkg))
|
||||
set(ASM_DEFAULT ON)
|
||||
endif()
|
||||
set(ASM_DEFAULT ON)
|
||||
set(X86_32 ON)
|
||||
set(WINARCH x86)
|
||||
else()
|
||||
set(X86 ON)
|
||||
set(WINARCH x86)
|
||||
set(ARCH_NAME x86_32)
|
||||
elseif(CMAKE_C_SIZEOF_DATA_PTR EQUAL 8)
|
||||
set(AMD64 ON)
|
||||
set(WINARCH x64)
|
||||
set(X64 ON)
|
||||
set(X86_64 ON)
|
||||
set(WINARCH x64)
|
||||
set(ARCH_NAME x86_64)
|
||||
endif()
|
||||
|
||||
if(DEFINED VCPKG_TARGET_TRIPLET)
|
||||
string(REGEX MATCH "^x[86][64]" target_arch ${VCPKG_TARGET_TRIPLET})
|
||||
|
||||
if(NOT WINARCH STREQUAL target_arch)
|
||||
message(FATAL_ERROR "Wrong build environment architecture for VCPKG_TARGET_TRIPLET, you specified ${target_arch} but your compiler is for ${WINARCH}")
|
||||
endif()
|
||||
endif()
|
||||
elseif(CMAKE_SYSTEM_PROCESSOR MATCHES "[aA][aA][rR][cC][hH]|[aA][rR][mM]")
|
||||
if(CMAKE_C_SIZEOF_DATA_PTR EQUAL 4) # 32 bit
|
||||
set(ARCH_NAME arm32)
|
||||
set(WINARCH arm)
|
||||
elseif(CMAKE_C_SIZEOF_DATA_PTR EQUAL 8)
|
||||
set(ARCH_NAME arm64)
|
||||
set(WINARCH arm64)
|
||||
endif()
|
||||
|
||||
if(NOT CMAKE_HOST_SYSTEM_PROCESSOR MATCHES "[aA][aA][rR][cC][hH]|[aA][rR][mM]")
|
||||
set(CMAKE_CROSSCOMPILING TRUE)
|
||||
endif()
|
||||
endif()
|
||||
|
@@ -1,54 +0,0 @@
|
||||
|
||||
#=============================================================================
|
||||
# Copyright 2010 Kitware, Inc.
|
||||
#
|
||||
# Distributed under the OSI-approved BSD License (the "License");
|
||||
# see accompanying file Copyright.txt for details.
|
||||
#
|
||||
# This software is distributed WITHOUT ANY WARRANTY; without even the
|
||||
# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
||||
# See the License for more information.
|
||||
#=============================================================================
|
||||
# (To distribute this file outside of CMake, substitute the full
|
||||
# License text for the above reference.)
|
||||
|
||||
# support for the nasm assembler
|
||||
|
||||
set(CMAKE_ASM_NASM_SOURCE_FILE_EXTENSIONS nasm asm)
|
||||
|
||||
if(NOT CMAKE_ASM_NASM_OBJECT_FORMAT)
|
||||
if(WIN32)
|
||||
if(CMAKE_C_SIZEOF_DATA_PTR EQUAL 8)
|
||||
SET(CMAKE_ASM_NASM_OBJECT_FORMAT win64)
|
||||
else()
|
||||
SET(CMAKE_ASM_NASM_OBJECT_FORMAT win32)
|
||||
endif()
|
||||
elseif(APPLE)
|
||||
EXECUTE_PROCESS(COMMAND ${CMAKE_ASM_NASM_COMPILER} -v COMMAND awk "{print \$3}" OUTPUT_VARIABLE NASM_VERSION)
|
||||
IF(NASM_VERSION VERSION_LESS 2.0)
|
||||
IF(CMAKE_C_SIZEOF_DATA_PTR EQUAL 8)
|
||||
MESSAGE(FATAL_ERROR "Your nasm is too old to support AMD64, please install nasm from Homebrew or MacPorts.")
|
||||
ENDIF()
|
||||
SET(CMAKE_ASM_NAMS_OBJECT_FORMAT macho)
|
||||
ELSE()
|
||||
if(CMAKE_C_SIZEOF_DATA_PTR EQUAL 8)
|
||||
SET(CMAKE_ASM_NASM_OBJECT_FORMAT macho64)
|
||||
else()
|
||||
SET(CMAKE_ASM_NASM_OBJECT_FORMAT macho32)
|
||||
endif()
|
||||
ENDIF()
|
||||
else()
|
||||
if(CMAKE_C_SIZEOF_DATA_PTR EQUAL 8)
|
||||
SET(CMAKE_ASM_NASM_OBJECT_FORMAT elf64)
|
||||
else()
|
||||
SET(CMAKE_ASM_NASM_OBJECT_FORMAT elf32)
|
||||
endif()
|
||||
endif()
|
||||
endif()
|
||||
|
||||
set(CMAKE_ASM_NASM_COMPILE_OBJECT "<CMAKE_ASM_NASM_COMPILER> <DEFINES> <FLAGS> -f ${CMAKE_ASM_NASM_OBJECT_FORMAT} -o <OBJECT> <SOURCE>")
|
||||
|
||||
# Load the generic ASMInformation file:
|
||||
set(ASM_DIALECT "_NASM")
|
||||
include(CMakeASMInformation)
|
||||
set(ASM_DIALECT)
|
@@ -1,27 +0,0 @@
|
||||
|
||||
#=============================================================================
|
||||
# Copyright 2010 Kitware, Inc.
|
||||
#
|
||||
# Distributed under the OSI-approved BSD License (the "License");
|
||||
# see accompanying file Copyright.txt for details.
|
||||
#
|
||||
# This software is distributed WITHOUT ANY WARRANTY; without even the
|
||||
# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
||||
# See the License for more information.
|
||||
#=============================================================================
|
||||
# (To distribute this file outside of CMake, substitute the full
|
||||
# License text for the above reference.)
|
||||
|
||||
# Find the nasm assembler. yasm (http://www.tortall.net/projects/yasm/) is nasm compatible
|
||||
|
||||
SET(CMAKE_ASM_NASM_COMPILER_INIT nasm yasm)
|
||||
|
||||
IF(NOT CMAKE_ASM_NASM_COMPILER)
|
||||
FIND_PROGRAM(CMAKE_ASM_NASM_COMPILER nasm
|
||||
"$ENV{ProgramFiles}/NASM")
|
||||
ENDIF(NOT CMAKE_ASM_NASM_COMPILER)
|
||||
|
||||
# Load the generic DetermineASM compiler file with the DIALECT set properly:
|
||||
SET(ASM_DIALECT "_NASM")
|
||||
INCLUDE(CMakeDetermineASMCompiler)
|
||||
SET(ASM_DIALECT)
|
@@ -1,23 +0,0 @@
|
||||
|
||||
#=============================================================================
|
||||
# Copyright 2010 Kitware, Inc.
|
||||
#
|
||||
# Distributed under the OSI-approved BSD License (the "License");
|
||||
# see accompanying file Copyright.txt for details.
|
||||
#
|
||||
# This software is distributed WITHOUT ANY WARRANTY; without even the
|
||||
# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
||||
# See the License for more information.
|
||||
#=============================================================================
|
||||
# (To distribute this file outside of CMake, substitute the full
|
||||
# License text for the above reference.)
|
||||
|
||||
# This file is used by EnableLanguage in cmGlobalGenerator to
|
||||
# determine that the selected ASM_NASM "compiler" works.
|
||||
# For assembler this can only check whether the compiler has been found,
|
||||
# because otherwise there would have to be a separate assembler source file
|
||||
# for each assembler on every architecture.
|
||||
|
||||
SET(ASM_DIALECT "_NASM")
|
||||
INCLUDE(CMakeTestASMCompiler)
|
||||
SET(ASM_DIALECT)
|
44
cmake/FileIterator.cmake
Normal file
44
cmake/FileIterator.cmake
Normal file
@@ -0,0 +1,44 @@
|
||||
# Interface for iterating over a text file by line.
|
||||
#
|
||||
# Example usage:
|
||||
#
|
||||
# fi_open_file(${some_file})
|
||||
#
|
||||
# while(NOT fi_done)
|
||||
# fi_get_next_line()
|
||||
#
|
||||
# message(STATUS "read line: ${fi_line}")
|
||||
# endwhile()
|
||||
|
||||
macro(fi_check_done)
|
||||
string(LENGTH "${fi_file_contents}" len)
|
||||
|
||||
set(fi_done FALSE PARENT_SCOPE)
|
||||
|
||||
if(len EQUAL 0)
|
||||
set(fi_done TRUE PARENT_SCOPE)
|
||||
endif()
|
||||
endmacro()
|
||||
|
||||
function(fi_open_file file)
|
||||
file(READ "${file}" fi_file_contents)
|
||||
|
||||
set(fi_file_contents "${fi_file_contents}" PARENT_SCOPE)
|
||||
|
||||
fi_check_done()
|
||||
endfunction()
|
||||
|
||||
function(fi_get_next_line)
|
||||
string(FIND "${fi_file_contents}" "\n" pos)
|
||||
|
||||
string(SUBSTRING "${fi_file_contents}" 0 ${pos} fi_line)
|
||||
|
||||
math(EXPR pos "${pos} + 1")
|
||||
|
||||
string(SUBSTRING "${fi_file_contents}" ${pos} -1 fi_file_contents)
|
||||
|
||||
fi_check_done()
|
||||
|
||||
set(fi_line "${fi_line}" PARENT_SCOPE)
|
||||
set(fi_file_contents "${fi_file_contents}" PARENT_SCOPE)
|
||||
endfunction()
|
151
cmake/FindFFmpeg.cmake
Normal file
151
cmake/FindFFmpeg.cmake
Normal file
@@ -0,0 +1,151 @@
|
||||
# vim: ts=2 sw=2
|
||||
# - Try to find the required ffmpeg components(default: AVFORMAT, AVUTIL, AVCODEC)
|
||||
#
|
||||
# Once done this will define
|
||||
# FFMPEG_FOUND - System has the all required components.
|
||||
# FFMPEG_INCLUDE_DIRS - Include directory necessary for using the required components headers.
|
||||
# FFMPEG_LIBRARIES - Link these to use the required ffmpeg components.
|
||||
# FFMPEG_DEFINITIONS - Compiler switches required for using the required ffmpeg components.
|
||||
#
|
||||
# For each of the components it will additionally set.
|
||||
# - AVCODEC
|
||||
# - AVDEVICE
|
||||
# - AVFORMAT
|
||||
# - AVFILTER
|
||||
# - AVUTIL
|
||||
# - POSTPROC
|
||||
# - SWSCALE
|
||||
# the following variables will be defined
|
||||
# <component>_FOUND - System has <component>
|
||||
# <component>_INCLUDE_DIRS - Include directory necessary for using the <component> headers
|
||||
# <component>_LIBRARIES - Link these to use <component>
|
||||
# <component>_DEFINITIONS - Compiler switches required for using <component>
|
||||
# <component>_VERSION - The components version
|
||||
#
|
||||
# Copyright (c) 2006, Matthias Kretz, <kretz@kde.org>
|
||||
# Copyright (c) 2008, Alexander Neundorf, <neundorf@kde.org>
|
||||
# Copyright (c) 2011, Michael Jansen, <kde@michael-jansen.biz>
|
||||
#
|
||||
# Redistribution and use is allowed according to the terms of the BSD license.
|
||||
# For details see the accompanying COPYING-CMAKE-SCRIPTS file.
|
||||
|
||||
include(FindPackageHandleStandardArgs)
|
||||
|
||||
# The default components were taken from a survey over other FindFFMPEG.cmake files
|
||||
if (NOT FFmpeg_FIND_COMPONENTS)
|
||||
set(FFmpeg_FIND_COMPONENTS AVCODEC AVFORMAT AVUTIL)
|
||||
endif ()
|
||||
|
||||
#
|
||||
### Macro: set_component_found
|
||||
#
|
||||
# Marks the given component as found if both *_LIBRARIES AND *_INCLUDE_DIRS is present.
|
||||
#
|
||||
macro(set_component_found _component )
|
||||
if (${_component}_LIBRARIES AND ${_component}_INCLUDE_DIRS)
|
||||
# message(STATUS " - ${_component} found.")
|
||||
set(${_component}_FOUND TRUE)
|
||||
else ()
|
||||
# message(STATUS " - ${_component} not found.")
|
||||
endif ()
|
||||
endmacro()
|
||||
|
||||
#
|
||||
### Macro: find_component
|
||||
#
|
||||
# Checks for the given component by invoking pkgconfig and then looking up the libraries and
|
||||
# include directories.
|
||||
#
|
||||
macro(find_component _component _pkgconfig _library _header)
|
||||
|
||||
if (NOT WIN32)
|
||||
# use pkg-config to get the directories and then use these values
|
||||
# in the FIND_PATH() and FIND_LIBRARY() calls
|
||||
find_package(PkgConfig)
|
||||
if (PKG_CONFIG_FOUND)
|
||||
pkg_check_modules(PC_${_component} ${_pkgconfig})
|
||||
endif ()
|
||||
endif (NOT WIN32)
|
||||
|
||||
find_path(${_component}_INCLUDE_DIRS ${_header}
|
||||
HINTS
|
||||
${PC_${_component}_INCLUDEDIR}
|
||||
${PC_${_component}_INCLUDE_DIRS}
|
||||
PATH_SUFFIXES
|
||||
ffmpeg
|
||||
)
|
||||
|
||||
find_library(${_component}_LIBRARIES NAMES ${_library}
|
||||
HINTS
|
||||
${PC_${_component}_LIBDIR}
|
||||
${PC_${_component}_LIBRARY_DIRS}
|
||||
)
|
||||
|
||||
set(${_component}_DEFINITIONS ${PC_${_component}_CFLAGS_OTHER} CACHE STRING "The ${_component} CFLAGS.")
|
||||
set(${_component}_VERSION ${PC_${_component}_VERSION} CACHE STRING "The ${_component} version number.")
|
||||
|
||||
set_component_found(${_component})
|
||||
|
||||
mark_as_advanced(
|
||||
${_component}_INCLUDE_DIRS
|
||||
${_component}_LIBRARIES
|
||||
${_component}_DEFINITIONS
|
||||
${_component}_VERSION)
|
||||
|
||||
endmacro()
|
||||
|
||||
|
||||
# Check for cached results. If there are skip the costly part.
|
||||
if (NOT FFMPEG_LIBRARIES)
|
||||
|
||||
# Check for all possible component.
|
||||
find_component(AVCODEC libavcodec avcodec libavcodec/avcodec.h)
|
||||
find_component(AVFORMAT libavformat avformat libavformat/avformat.h)
|
||||
find_component(AVDEVICE libavdevice avdevice libavdevice/avdevice.h)
|
||||
find_component(AVUTIL libavutil avutil libavutil/avutil.h)
|
||||
find_component(AVFILTER libavfilter avfilter libavfilter/avfilter.h)
|
||||
find_component(SWSCALE libswscale swscale libswscale/swscale.h)
|
||||
find_component(POSTPROC libpostproc postproc libpostproc/postprocess.h)
|
||||
find_component(SWRESAMPLE libswresample swresample libswresample/swresample.h)
|
||||
|
||||
# Check if the required components were found and add their stuff to the FFMPEG_* vars.
|
||||
foreach (_component ${FFmpeg_FIND_COMPONENTS})
|
||||
if (${_component}_FOUND)
|
||||
# message(STATUS "Required component ${_component} present.")
|
||||
set(FFMPEG_LIBRARIES ${FFMPEG_LIBRARIES} ${${_component}_LIBRARIES})
|
||||
set(FFMPEG_DEFINITIONS ${FFMPEG_DEFINITIONS} ${${_component}_DEFINITIONS})
|
||||
list(APPEND FFMPEG_INCLUDE_DIRS ${${_component}_INCLUDE_DIRS})
|
||||
else ()
|
||||
# message(STATUS "Required component ${_component} missing.")
|
||||
endif ()
|
||||
endforeach ()
|
||||
|
||||
# Build the include path with duplicates removed.
|
||||
if (FFMPEG_INCLUDE_DIRS)
|
||||
list(REMOVE_DUPLICATES FFMPEG_INCLUDE_DIRS)
|
||||
endif ()
|
||||
|
||||
# cache the vars.
|
||||
set(FFMPEG_INCLUDE_DIRS ${FFMPEG_INCLUDE_DIRS} CACHE STRING "The FFmpeg include directories." FORCE)
|
||||
set(FFMPEG_LIBRARIES ${FFMPEG_LIBRARIES} CACHE STRING "The FFmpeg libraries." FORCE)
|
||||
set(FFMPEG_DEFINITIONS ${FFMPEG_DEFINITIONS} CACHE STRING "The FFmpeg cflags." FORCE)
|
||||
|
||||
mark_as_advanced(FFMPEG_INCLUDE_DIRS
|
||||
FFMPEG_LIBRARIES
|
||||
FFMPEG_DEFINITIONS)
|
||||
|
||||
endif ()
|
||||
|
||||
# Now set the noncached _FOUND vars for the components.
|
||||
foreach (_component AVCODEC AVDEVICE AVFORMAT AVUTIL POSTPROCESS SWSCALE)
|
||||
set_component_found(${_component})
|
||||
endforeach ()
|
||||
|
||||
# Compile the list of required vars
|
||||
set(_FFmpeg_REQUIRED_VARS FFMPEG_LIBRARIES FFMPEG_INCLUDE_DIRS)
|
||||
foreach (_component ${FFmpeg_FIND_COMPONENTS})
|
||||
list(APPEND _FFmpeg_REQUIRED_VARS ${_component}_LIBRARIES ${_component}_INCLUDE_DIRS)
|
||||
endforeach ()
|
||||
|
||||
# Give a nice error message if some of the required vars are missing.
|
||||
find_package_handle_standard_args(FFmpeg DEFAULT_MSG ${_FFmpeg_REQUIRED_VARS})
|
@@ -1,226 +0,0 @@
|
||||
# This module defines
|
||||
# SDL2_LIBRARY, the name of the library to link against
|
||||
# SDL2_FOUND, if false, do not try to link to SDL2
|
||||
# SDL2_INCLUDE_DIR, where to find SDL.h
|
||||
#
|
||||
# If you have pkg-config, these extra variables are also defined:
|
||||
# SDL2_DEFINITIONS, extra CFLAGS
|
||||
# SDL2_EXTRA_LIBS, extra link libs
|
||||
# SDL2_LINKER_FLAGS, extra link flags
|
||||
#
|
||||
# The latter two are automatically added to SDL2_LIBRARY
|
||||
#
|
||||
# To use them, add code such as:
|
||||
#
|
||||
# # SET(SDL2_STATIC ON) # if you want to link SDL2 statically
|
||||
# FIND_PACKAGE(SDL2 REQUIRED)
|
||||
# ADD_DEFINITIONS(${SDL2_DEFINITIONS})
|
||||
# TARGET_LINK_LIBRARIES(your-executable-target ${SDL2_LIBRARY} ...)
|
||||
#
|
||||
# This module responds to the the flag:
|
||||
# SDL2_BUILDING_LIBRARY
|
||||
# If this is defined, then no SDL2main will be linked in because
|
||||
# only applications need main().
|
||||
# Otherwise, it is assumed you are building an application and this
|
||||
# module will attempt to locate and set the the proper link flags
|
||||
# as part of the returned SDL2_LIBRARY variable.
|
||||
#
|
||||
# If you want to link SDL2 statically, set SDL2_STATIC to ON.
|
||||
#
|
||||
# Don't forget to include SDLmain.h and SDLmain.m your project for the
|
||||
# OS X framework based version. (Other versions link to -lSDL2main which
|
||||
# this module will try to find on your behalf.) Also for OS X, this
|
||||
# module will automatically add the -framework Cocoa on your behalf.
|
||||
#
|
||||
#
|
||||
# Additional Note: If you see an empty SDL2_LIBRARY_TEMP in your configuration
|
||||
# and no SDL2_LIBRARY, it means CMake did not find your SDL2 library
|
||||
# (SDL2.dll, libsdl2.so, SDL2.framework, etc).
|
||||
# Set SDL2_LIBRARY_TEMP to point to your SDL2 library, and configure again.
|
||||
# Similarly, if you see an empty SDL2MAIN_LIBRARY, you should set this value
|
||||
# as appropriate. These values are used to generate the final SDL2_LIBRARY
|
||||
# variable, but when these values are unset, SDL2_LIBRARY does not get created.
|
||||
#
|
||||
#
|
||||
# $SDL2DIR is an environment variable that would
|
||||
# correspond to the ./configure --prefix=$SDL2DIR
|
||||
# used in building SDL2.
|
||||
# l.e.galup 9-20-02
|
||||
#
|
||||
# Modified by Eric Wing.
|
||||
# Added code to assist with automated building by using environmental variables
|
||||
# and providing a more controlled/consistent search behavior.
|
||||
# Added new modifications to recognize OS X frameworks and
|
||||
# additional Unix paths (FreeBSD, etc).
|
||||
# Also corrected the header search path to follow "proper" SDL guidelines.
|
||||
# Added a search for SDL2main which is needed by some platforms.
|
||||
# Added a search for threads which is needed by some platforms.
|
||||
# Added needed compile switches for MinGW.
|
||||
#
|
||||
# On OSX, this will prefer the Framework version (if found) over others.
|
||||
# People will have to manually change the cache values of
|
||||
# SDL2_LIBRARY to override this selection or set the CMake environment
|
||||
# CMAKE_INCLUDE_PATH to modify the search paths.
|
||||
#
|
||||
# Note that the header path has changed from SDL3/SDL.h to just SDL.h
|
||||
# This needed to change because "proper" SDL convention
|
||||
# is #include "SDL.h", not <SDL2/SDL.h>. This is done for portability
|
||||
# reasons because not all systems place things in SDL2/ (see FreeBSD).
|
||||
|
||||
#=============================================================================
|
||||
# Copyright 2003-2009 Kitware, Inc.
|
||||
#
|
||||
# Distributed under the OSI-approved BSD License (the "License");
|
||||
# see accompanying file Copyright.txt for details.
|
||||
#
|
||||
# This software is distributed WITHOUT ANY WARRANTY; without even the
|
||||
# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
||||
# See the License for more information.
|
||||
#=============================================================================
|
||||
# (To distribute this file outside of CMake, substitute the full
|
||||
# License text for the above reference.)
|
||||
|
||||
SET(SDL2_SEARCH_PATHS
|
||||
~/Library/Frameworks
|
||||
/Library/Frameworks
|
||||
/usr/local # Mac Homebrew and local installs
|
||||
/usr
|
||||
/sw # Fink
|
||||
/opt/local # MacPorts
|
||||
/opt/csw # OpenCSW (Solaris)
|
||||
/opt
|
||||
${SDL2_PATH}/include
|
||||
${SDL2_PATH}/lib
|
||||
)
|
||||
|
||||
FIND_PATH(SDL2_INCLUDE_DIR SDL.h
|
||||
HINTS $ENV{SDL2DIR}
|
||||
PATH_SUFFIXES SDL2
|
||||
PATHS ${SDL2_SEARCH_PATHS}
|
||||
)
|
||||
|
||||
SET(CURRENT_FIND_LIBRARY_SUFFIXES ${CMAKE_FIND_LIBRARY_SUFFIXES})
|
||||
|
||||
IF(SDL2_STATIC)
|
||||
IF(WIN32)
|
||||
SET(CMAKE_FIND_LIBRARY_SUFFIXES .lib .a)
|
||||
ELSE(WIN32)
|
||||
SET(CMAKE_FIND_LIBRARY_SUFFIXES .a)
|
||||
ENDIF(WIN32)
|
||||
ENDIF(SDL2_STATIC)
|
||||
|
||||
FIND_LIBRARY(SDL2_LIBRARY_TEMP
|
||||
NAMES SDL2
|
||||
HINTS $ENV{SDL2DIR}
|
||||
PATH_SUFFIXES lib64 lib lib/x64 lib/x86
|
||||
PATHS ${SDL2_SEARCH_PATHS}
|
||||
)
|
||||
|
||||
IF(NOT SDL2_BUILDING_LIBRARY)
|
||||
IF(NOT ${SDL2_INCLUDE_DIR} MATCHES ".framework")
|
||||
# Non-OS X framework versions expect you to also dynamically link to
|
||||
# SDL2main. This is mainly for Windows and OS X. Other (Unix) platforms
|
||||
# seem to provide SDL2main for compatibility even though they don't
|
||||
# necessarily need it.
|
||||
FIND_LIBRARY(SDL2MAIN_LIBRARY
|
||||
NAMES SDL2main
|
||||
HINTS
|
||||
$ENV{SDL2DIR}
|
||||
PATH_SUFFIXES lib64 lib lib/x64 lib/x86
|
||||
PATHS ${SDL2_SEARCH_PATHS}
|
||||
)
|
||||
ENDIF(NOT ${SDL2_INCLUDE_DIR} MATCHES ".framework")
|
||||
ENDIF(NOT SDL2_BUILDING_LIBRARY)
|
||||
|
||||
SET(CMAKE_FIND_LIBRARY_SUFFIXES ${CURRENT_FIND_LIBRARY_SUFFIXES})
|
||||
UNSET(CURRENT_FIND_LIBRARY_SUFFIXES)
|
||||
|
||||
# SDL2 may require threads on your system.
|
||||
# The Apple build may not need an explicit flag because one of the
|
||||
# frameworks may already provide it.
|
||||
# But for non-OSX systems, I will use the CMake Threads package.
|
||||
IF(NOT APPLE)
|
||||
FIND_PACKAGE(Threads)
|
||||
ENDIF(NOT APPLE)
|
||||
|
||||
# MinGW needs an additional link flag, -mwindows (to make a GUI app)
|
||||
# but we only add it when not making a Debug build.
|
||||
# It's total link flags should look like -lmingw32 -lSDL2main -lSDL2 -mwindows
|
||||
IF(MINGW)
|
||||
SET(MINGW32_LIBRARY -lmingw32 CACHE STRING "MinGW library")
|
||||
|
||||
IF(NOT CMAKE_BUILD_TYPE STREQUAL Debug)
|
||||
SET(MINGW32_LIBRARY ${MINGW32_LIBRARY} -mwindows)
|
||||
ENDIF()
|
||||
ENDIF(MINGW)
|
||||
|
||||
IF(SDL2_LIBRARY_TEMP)
|
||||
# For SDL2main
|
||||
IF(NOT SDL2_BUILDING_LIBRARY)
|
||||
IF(SDL2MAIN_LIBRARY)
|
||||
SET(SDL2_LIBRARY_TEMP ${SDL2MAIN_LIBRARY} ${SDL2_LIBRARY_TEMP})
|
||||
ENDIF(SDL2MAIN_LIBRARY)
|
||||
ENDIF(NOT SDL2_BUILDING_LIBRARY)
|
||||
|
||||
# For OS X, SDL2 uses Cocoa as a backend so it must link to Cocoa.
|
||||
# CMake doesn't display the -framework Cocoa string in the UI even
|
||||
# though it actually is there if I modify a pre-used variable.
|
||||
# I think it has something to do with the CACHE STRING.
|
||||
# So I use a temporary variable until the end so I can set the
|
||||
# "real" variable in one-shot.
|
||||
IF(APPLE)
|
||||
SET(SDL2_LIBRARY_TEMP ${SDL2_LIBRARY_TEMP} "-framework Cocoa")
|
||||
ENDIF(APPLE)
|
||||
|
||||
# For threads, as mentioned Apple doesn't need this.
|
||||
# In fact, there seems to be a problem if I used the Threads package
|
||||
# and try using this line, so I'm just skipping it entirely for OS X.
|
||||
IF(NOT APPLE)
|
||||
SET(SDL2_LIBRARY_TEMP ${SDL2_LIBRARY_TEMP} ${CMAKE_THREAD_LIBS_INIT})
|
||||
ENDIF(NOT APPLE)
|
||||
|
||||
# For MinGW library
|
||||
IF(MINGW)
|
||||
SET(SDL2_LIBRARY_TEMP ${MINGW32_LIBRARY} ${SDL2_LIBRARY_TEMP} -lversion -limm32)
|
||||
ENDIF(MINGW)
|
||||
|
||||
# Add some stuff from pkg-config, if available
|
||||
IF(NOT PKG_CONFIG_EXECUTABLE)
|
||||
FIND_PACKAGE(PkgConfig QUIET)
|
||||
ENDIF(NOT PKG_CONFIG_EXECUTABLE)
|
||||
|
||||
IF(PKG_CONFIG_EXECUTABLE)
|
||||
# get any definitions
|
||||
EXECUTE_PROCESS(COMMAND ${PKG_CONFIG_EXECUTABLE} --cflags-only-other sdl2 OUTPUT_VARIABLE SDL2_DEFINITIONS ERROR_QUIET OUTPUT_STRIP_TRAILING_WHITESPACE)
|
||||
|
||||
SET(SDL2_DEFINITIONS ${SDL2_DEFINITIONS} CACHE STRING "Extra CFLAGS for SDL2 from pkg-config")
|
||||
|
||||
# get any extra stuff needed for linking
|
||||
IF(NOT SDL2_STATIC)
|
||||
EXECUTE_PROCESS(COMMAND ${PKG_CONFIG_EXECUTABLE} --libs-only-other sdl2 OUTPUT_VARIABLE SDL2_LINKER_FLAGS_RAW ERROR_QUIET OUTPUT_STRIP_TRAILING_WHITESPACE)
|
||||
|
||||
EXECUTE_PROCESS(COMMAND ${PKG_CONFIG_EXECUTABLE} --libs-only-l sdl2 OUTPUT_VARIABLE SDL2_EXTRA_LIBS_RAW ERROR_QUIET OUTPUT_STRIP_TRAILING_WHITESPACE)
|
||||
ELSE(NOT SDL2_STATIC)
|
||||
EXECUTE_PROCESS(COMMAND ${PKG_CONFIG_EXECUTABLE} --static --libs-only-other sdl2 OUTPUT_VARIABLE SDL2_LINKER_FLAGS_RAW ERROR_QUIET OUTPUT_STRIP_TRAILING_WHITESPACE)
|
||||
EXECUTE_PROCESS(COMMAND ${PKG_CONFIG_EXECUTABLE} --static --libs-only-l sdl2 OUTPUT_VARIABLE SDL2_EXTRA_LIBS_RAW ERROR_QUIET OUTPUT_STRIP_TRAILING_WHITESPACE)
|
||||
ENDIF(NOT SDL2_STATIC)
|
||||
|
||||
STRING(REGEX REPLACE "[^ ]+SDL2[^ ]*" "" SDL2_EXTRA_LIBS_RAW2 "${SDL2_EXTRA_LIBS_RAW}")
|
||||
STRING(REGEX REPLACE " +" ";" SDL2_EXTRA_LIBS "${SDL2_EXTRA_LIBS_RAW2}")
|
||||
STRING(REGEX REPLACE " +" ";" SDL2_LINKER_FLAGS "${SDL2_LINKER_FLAGS_RAW}")
|
||||
|
||||
SET(SDL2_LINKER_FLAGS ${SDL2_LINKER_FLAGS} CACHE STRING "Linker flags for linking SDL2")
|
||||
SET(SDL2_EXTRA_LIBS ${SDL2_EXTRA_LIBS} CACHE STRING "Extra libraries for linking SDL2")
|
||||
|
||||
SET(SDL2_LIBRARY_TEMP ${SDL2_LIBRARY_TEMP} ${SDL2_EXTRA_LIBS} ${SDL2_LINKER_FLAGS})
|
||||
ENDIF(PKG_CONFIG_EXECUTABLE)
|
||||
|
||||
# Set the final string here so the GUI reflects the final state.
|
||||
SET(SDL2_LIBRARY ${SDL2_LIBRARY_TEMP} CACHE STRING "Where the SDL2 Library can be found")
|
||||
# Set the temp variable to INTERNAL so it is not seen in the CMake GUI
|
||||
SET(SDL2_LIBRARY_TEMP "${SDL2_LIBRARY_TEMP}" CACHE INTERNAL "")
|
||||
ENDIF(SDL2_LIBRARY_TEMP)
|
||||
|
||||
INCLUDE(FindPackageHandleStandardArgs)
|
||||
|
||||
FIND_PACKAGE_HANDLE_STANDARD_ARGS(SDL2 REQUIRED_VARS SDL2_LIBRARY SDL2_INCLUDE_DIR)
|
@@ -57,7 +57,7 @@
|
||||
|
||||
# define the SFML_STATIC macro if static build was chosen
|
||||
if(SFML_STATIC_LIBRARIES)
|
||||
add_definitions(-DSFML_STATIC)
|
||||
add_compile_definitions(SFML_STATIC)
|
||||
endif()
|
||||
|
||||
# define the list of search paths for headers and libraries
|
||||
@@ -89,9 +89,9 @@ if(SFML_FIND_VERSION AND SFML_INCLUDE_DIR)
|
||||
set(SFML_CONFIG_HPP_INPUT "${SFML_INCLUDE_DIR}/SFML/Config.hpp")
|
||||
endif()
|
||||
FILE(READ "${SFML_CONFIG_HPP_INPUT}" SFML_CONFIG_HPP_CONTENTS)
|
||||
STRING(REGEX REPLACE ".*#define SFML_VERSION_MAJOR ([0-9]+).*" "\\1" SFML_VERSION_MAJOR "${SFML_CONFIG_HPP_CONTENTS}")
|
||||
STRING(REGEX REPLACE ".*#define SFML_VERSION_MINOR ([0-9]+).*" "\\1" SFML_VERSION_MINOR "${SFML_CONFIG_HPP_CONTENTS}")
|
||||
STRING(REGEX REPLACE ".*#define SFML_VERSION_PATCH ([0-9]+).*" "\\1" SFML_VERSION_PATCH "${SFML_CONFIG_HPP_CONTENTS}")
|
||||
STRING(REGEX REPLACE ".*#define *SFML_VERSION_MAJOR *([0-9]+).*" "\\1" SFML_VERSION_MAJOR "${SFML_CONFIG_HPP_CONTENTS}")
|
||||
STRING(REGEX REPLACE ".*#define *SFML_VERSION_MINOR *([0-9]+).*" "\\1" SFML_VERSION_MINOR "${SFML_CONFIG_HPP_CONTENTS}")
|
||||
STRING(REGEX REPLACE ".*#define *SFML_VERSION_PATCH *([0-9]+).*" "\\1" SFML_VERSION_PATCH "${SFML_CONFIG_HPP_CONTENTS}")
|
||||
if (NOT "${SFML_VERSION_PATCH}" MATCHES "^[0-9]+$")
|
||||
set(SFML_VERSION_PATCH 0)
|
||||
endif()
|
||||
|
@@ -1,76 +0,0 @@
|
||||
# FindSSP.cmake
|
||||
#
|
||||
# Find libssp necessary when using gcc with e.g. -fstack-protector=strong
|
||||
#
|
||||
# See: http://wiki.osdev.org/Stack_Smashing_Protector
|
||||
#
|
||||
# To use:
|
||||
#
|
||||
# put a copy into your <project_root>/cmake/
|
||||
#
|
||||
# In your main CMakeLists.txt do something like this:
|
||||
#
|
||||
# if(WIN32)
|
||||
# set(SSP_STATIC ON)
|
||||
# endif()
|
||||
#
|
||||
# find_package(SSP)
|
||||
#
|
||||
# if(SSP_LIBRARY)
|
||||
# set(CMAKE_CXX_LINK_EXECUTABLE "${CMAKE_CXX_LINK_EXECUTABLE} ${SSP_LIBRARY}")
|
||||
# set(CMAKE_C_LINK_EXECUTABLE "${CMAKE_C_LINK_EXECUTABLE} ${SSP_LIBRARY}")
|
||||
# endif()
|
||||
|
||||
# only do this when compiling with gcc/g++
|
||||
if(NOT CMAKE_COMPILER_IS_GNUCXX)
|
||||
return()
|
||||
endif()
|
||||
|
||||
function(FindSSP)
|
||||
if(NOT CMAKE_CXX_COMPILER AND CMAKE_C_COMPILER)
|
||||
set(CMAKE_CXX_COMPILER ${CMAKE_C_COMPILER})
|
||||
endif()
|
||||
|
||||
foreach(arg ${CMAKE_CXX_COMPILER_ARG1} ${CMAKE_CXX_COMPILER_ARG2} ${CMAKE_CXX_COMPILER_ARG3} ${CMAKE_CXX_COMPILER_ARG4} ${CMAKE_CXX_COMPILER_ARG5} ${CMAKE_CXX_COMPILER_ARG6} ${CMAKE_CXX_COMPILER_ARG7} ${CMAKE_CXX_COMPILER_ARG8} ${CMAKE_CXX_COMPILER_ARG9})
|
||||
string(STRIP ${arg} arg)
|
||||
set(gcc_args "${gcc_args};${arg}")
|
||||
endforeach()
|
||||
|
||||
execute_process(COMMAND ${CMAKE_CXX_COMPILER} ${gcc_args} --print-prog-name=gcc OUTPUT_VARIABLE GCC_EXECUTABLE OUTPUT_STRIP_TRAILING_WHITESPACE)
|
||||
|
||||
if(WIN32 AND NOT MSYS)
|
||||
execute_process(COMMAND where.exe ${GCC_EXECUTABLE} OUTPUT_VARIABLE GCC_EXECUTABLE OUTPUT_STRIP_TRAILING_WHITESPACE)
|
||||
else()
|
||||
execute_process(COMMAND sh -c "command -v ${GCC_EXECUTABLE}" OUTPUT_VARIABLE GCC_EXECUTABLE OUTPUT_STRIP_TRAILING_WHITESPACE)
|
||||
endif()
|
||||
|
||||
get_filename_component(GCC_DIRNAME "${GCC_EXECUTABLE}" DIRECTORY)
|
||||
|
||||
execute_process(COMMAND ${CMAKE_CXX_COMPILER} ${gcc_args} --print-libgcc-file-name OUTPUT_VARIABLE LIBGCC_FILE OUTPUT_STRIP_TRAILING_WHITESPACE)
|
||||
|
||||
get_filename_component(LIBGCC_DIRNAME "${LIBGCC_FILE}" DIRECTORY)
|
||||
|
||||
set(SSP_SEARCH_PATHS ${GCC_DIRNAME} ${LIBGCC_DIRNAME})
|
||||
|
||||
if(SSP_STATIC)
|
||||
if(WIN32)
|
||||
set(CMAKE_FIND_LIBRARY_SUFFIXES .lib .a)
|
||||
else()
|
||||
set(CMAKE_FIND_LIBRARY_SUFFIXES .a)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
find_library(SSP_LIBRARY
|
||||
NAMES ssp libssp
|
||||
HINTS ${SSP_SEARCH_PATHS}
|
||||
PATH_SUFFIXES lib64 lib lib/x64 lib/x86
|
||||
)
|
||||
|
||||
set(SSP_LIBRARY PARENT_SCOPE)
|
||||
endfunction()
|
||||
|
||||
FindSSP()
|
||||
|
||||
include(FindPackageHandleStandardArgs)
|
||||
|
||||
find_package_handle_standard_args(SSP REQUIRED_VARS SSP_LIBRARY)
|
@@ -7,23 +7,6 @@
|
||||
#
|
||||
# Returns the refspec and sha hash of the current head revision
|
||||
#
|
||||
# git_describe(<var> [<additional arguments to git describe> ...])
|
||||
#
|
||||
# Returns the results of git describe on the source tree, and adjusting
|
||||
# the output so that it tests false if an error occurs.
|
||||
#
|
||||
# git_get_exact_tag(<var> [<additional arguments to git describe> ...])
|
||||
#
|
||||
# Returns the results of git describe --exact-match on the source tree,
|
||||
# and adjusting the output so that it tests false if there was no exact
|
||||
# matching tag.
|
||||
#
|
||||
# git_local_changes(<var>)
|
||||
#
|
||||
# Returns either "CLEAN" or "DIRTY" with respect to uncommitted changes.
|
||||
# Uses the return code of "git diff-index --quiet HEAD --".
|
||||
# Does not regard untracked files.
|
||||
#
|
||||
# Requires CMake 2.6 or newer (uses the 'function' command)
|
||||
#
|
||||
# Original Author:
|
||||
@@ -85,84 +68,3 @@ function(get_git_head_revision _refspecvar _hashvar)
|
||||
set(${_refspecvar} "${HEAD_REF}" PARENT_SCOPE)
|
||||
set(${_hashvar} "${HEAD_HASH}" PARENT_SCOPE)
|
||||
endfunction()
|
||||
|
||||
function(git_describe _var)
|
||||
if(NOT GIT_FOUND)
|
||||
find_package(Git QUIET)
|
||||
endif()
|
||||
get_git_head_revision(refspec hash)
|
||||
if(NOT GIT_FOUND)
|
||||
set(${_var} "GIT-NOTFOUND" PARENT_SCOPE)
|
||||
return()
|
||||
endif()
|
||||
if(NOT hash)
|
||||
set(${_var} "HEAD-HASH-NOTFOUND" PARENT_SCOPE)
|
||||
return()
|
||||
endif()
|
||||
|
||||
# TODO sanitize
|
||||
#if((${ARGN}" MATCHES "&&") OR
|
||||
# (ARGN MATCHES "||") OR
|
||||
# (ARGN MATCHES "\\;"))
|
||||
# message("Please report the following error to the project!")
|
||||
# message(FATAL_ERROR "Looks like someone's doing something nefarious with git_describe! Passed arguments ${ARGN}")
|
||||
#endif()
|
||||
|
||||
#message(STATUS "Arguments to execute_process: ${ARGN}")
|
||||
|
||||
execute_process(COMMAND
|
||||
"${GIT_EXECUTABLE}"
|
||||
describe
|
||||
${hash}
|
||||
${ARGN}
|
||||
WORKING_DIRECTORY
|
||||
"${CMAKE_CURRENT_SOURCE_DIR}"
|
||||
RESULT_VARIABLE
|
||||
res
|
||||
OUTPUT_VARIABLE
|
||||
out
|
||||
ERROR_QUIET
|
||||
OUTPUT_STRIP_TRAILING_WHITESPACE)
|
||||
if(NOT res EQUAL 0)
|
||||
set(out "${out}-${res}-NOTFOUND")
|
||||
endif()
|
||||
|
||||
set(${_var} "${out}" PARENT_SCOPE)
|
||||
endfunction()
|
||||
|
||||
function(git_get_exact_tag _var)
|
||||
git_describe(out --exact-match ${ARGN})
|
||||
set(${_var} "${out}" PARENT_SCOPE)
|
||||
endfunction()
|
||||
|
||||
function(git_local_changes _var)
|
||||
if(NOT GIT_FOUND)
|
||||
find_package(Git QUIET)
|
||||
endif()
|
||||
get_git_head_revision(refspec hash)
|
||||
if(NOT GIT_FOUND)
|
||||
set(${_var} "GIT-NOTFOUND" PARENT_SCOPE)
|
||||
return()
|
||||
endif()
|
||||
if(NOT hash)
|
||||
set(${_var} "HEAD-HASH-NOTFOUND" PARENT_SCOPE)
|
||||
return()
|
||||
endif()
|
||||
|
||||
execute_process(COMMAND
|
||||
"${GIT_EXECUTABLE}"
|
||||
diff-index --quiet HEAD --
|
||||
WORKING_DIRECTORY
|
||||
"${CMAKE_CURRENT_SOURCE_DIR}"
|
||||
RESULT_VARIABLE
|
||||
res
|
||||
OUTPUT_VARIABLE
|
||||
out
|
||||
ERROR_QUIET
|
||||
OUTPUT_STRIP_TRAILING_WHITESPACE)
|
||||
if(res EQUAL 0)
|
||||
set(${_var} "CLEAN" PARENT_SCOPE)
|
||||
else()
|
||||
set(${_var} "DIRTY" PARENT_SCOPE)
|
||||
endif()
|
||||
endfunction()
|
||||
|
@@ -3,10 +3,9 @@ function(git_version version revision version_release)
|
||||
set(${revision} "" CACHE STRING "Latest Git Tag Revision" FORCE)
|
||||
set(${version_release} 0 CACHE STRING "Is this a versioned release without revision" FORCE)
|
||||
|
||||
find_package(Git)
|
||||
if(GIT_FOUND AND EXISTS "${CMAKE_SOURCE_DIR}/.git")
|
||||
# get latest version from tag history
|
||||
execute_process(COMMAND "${GIT_EXECUTABLE}" tag "--format=%(align:width=20)%(refname:short)%(end)%(if)%(*objectname)%(then)%(*objectname)%(else)%(objectname)%(end)" --sort=-creatordate OUTPUT_VARIABLE tags OUTPUT_STRIP_TRAILING_WHITESPACE ERROR_QUIET WORKING_DIRECTORY "${CMAKE_SOURCE_DIR}")
|
||||
execute_process(COMMAND "${GIT_EXECUTABLE}" tag "--format=%(align:width=20)%(refname:short)%(end)%(if)%(*objectname)%(then)%(*objectname)%(else)%(objectname)%(end)" --sort=-v:refname OUTPUT_VARIABLE tags OUTPUT_STRIP_TRAILING_WHITESPACE ERROR_QUIET WORKING_DIRECTORY "${CMAKE_SOURCE_DIR}")
|
||||
|
||||
# if no tags (e.g. shallow clone) do nothing
|
||||
if(tags STREQUAL "")
|
||||
|
@@ -1,25 +1,40 @@
|
||||
function(host_compile src dst_cmd)
|
||||
if(CMAKE_CROSSCOMPILING)
|
||||
unset(link_flags)
|
||||
set(dst "${dst_cmd}")
|
||||
|
||||
if(CMAKE_HOST_WIN32)
|
||||
set(dst "${dst_cmd}.exe")
|
||||
|
||||
if(CMAKE_COMPILER_IS_GNUCXX)
|
||||
set(link_flags -Wl,--subsystem,console)
|
||||
endif()
|
||||
else()
|
||||
set(dst "${dst_cmd}")
|
||||
endif()
|
||||
|
||||
# assume cc foo.c -o foo # will work on most hosts
|
||||
add_custom_command(
|
||||
OUTPUT "${dst}"
|
||||
COMMAND cc ${src} -o ${dst} ${link_flags}
|
||||
DEPENDS "${src}"
|
||||
)
|
||||
if(MSVC)
|
||||
set(msvc_compile_script ${CMAKE_SOURCE_DIR}/cmake/MSVC_x86_Host_Compile.cmake)
|
||||
|
||||
add_custom_command(
|
||||
OUTPUT ${dst}
|
||||
DEPENDS ${src} ${msvc_compile_script}
|
||||
COMMAND ${CMAKE_COMMAND} -D "src=${src}" -D "dst=${dst}" -P ${msvc_compile_script}
|
||||
WORKING_DIRECTORY ${CMAKE_BINARY_DIR}
|
||||
)
|
||||
else()
|
||||
set(dst ${dst_cmd})
|
||||
|
||||
# Assume: cc foo.c -o foo # will work on most hosts
|
||||
add_custom_command(
|
||||
OUTPUT ${dst}
|
||||
DEPENDS ${src}
|
||||
COMMAND cc ${src} -o ${dst} ${link_flags}
|
||||
WORKING_DIRECTORY ${CMAKE_BINARY_DIR}
|
||||
)
|
||||
endif()
|
||||
else()
|
||||
get_filename_component(dst "${dst_cmd}" NAME)
|
||||
add_executable("${dst}" "${src}")
|
||||
get_filename_component(dst ${dst_cmd} NAME)
|
||||
|
||||
add_executable(${dst} ${src})
|
||||
|
||||
# this is necessary because we override main with SDL_main
|
||||
target_compile_definitions(${dst} PRIVATE -Dmain=main)
|
||||
endif()
|
||||
endfunction()
|
||||
|
@@ -1,44 +0,0 @@
|
||||
function(use_llvm_toolchain)
|
||||
if(CMAKE_C_COMPILER_ID STREQUAL Clang)
|
||||
set(compiler "${CMAKE_C_COMPILER}")
|
||||
elseif(CMAKE_CXX_COMPILER_ID STREQUAL Clang)
|
||||
set(compiler "${CMAKE_CXX_COMPILER}")
|
||||
else()
|
||||
return()
|
||||
endif()
|
||||
|
||||
foreach(tool ar ranlib ld nm objdump as)
|
||||
execute_process(
|
||||
COMMAND "${compiler}" -print-prog-name=llvm-${tool}
|
||||
OUTPUT_VARIABLE prog_path
|
||||
OUTPUT_STRIP_TRAILING_WHITESPACE
|
||||
)
|
||||
|
||||
# for FreeBSD
|
||||
if(NOT prog_path MATCHES "^/")
|
||||
get_filename_component(
|
||||
abs_path ${prog_path} ABSOLUTE
|
||||
BASE_DIR /usr/local/llvm-devel/bin
|
||||
)
|
||||
|
||||
if(EXISTS ${abs_path})
|
||||
set(prog_path ${abs_path})
|
||||
endif()
|
||||
endif()
|
||||
|
||||
if(prog_path MATCHES "^/")
|
||||
if(tool STREQUAL ld)
|
||||
set(tool linker)
|
||||
elseif(tool STREQUAL as)
|
||||
set(tool asm_compiler)
|
||||
endif()
|
||||
|
||||
string(TOUPPER ${tool} utool)
|
||||
|
||||
set(CMAKE_${utool} "${prog_path}" PARENT_SCOPE)
|
||||
set(CMAKE_${utool} "${prog_path}" CACHE FILEPATH "${tool}" FORCE)
|
||||
endif()
|
||||
endforeach()
|
||||
endfunction()
|
||||
|
||||
use_llvm_toolchain()
|
24
cmake/MSVC_x86_Host_Compile.cmake
Normal file
24
cmake/MSVC_x86_Host_Compile.cmake
Normal file
@@ -0,0 +1,24 @@
|
||||
# This is a hack to be run with cmake -P to compile a source C program passed
|
||||
# in `src` to the `dst` executable using the host MSVC x86 toolchain.
|
||||
|
||||
find_program(cl_path NAME cl.exe HINTS ENV PATH)
|
||||
|
||||
string(REGEX REPLACE "[^/]+/cl\\.exe$" "x86/cl.exe" cl_path "${cl_path}")
|
||||
|
||||
set(orig_lib "$ENV{LIB}")
|
||||
set(new_lib)
|
||||
|
||||
foreach(lib $ENV{LIB})
|
||||
string(REGEX REPLACE "[^\\]+$" "x86" lib "${lib}")
|
||||
|
||||
list(APPEND new_lib "${lib}")
|
||||
endforeach()
|
||||
|
||||
set(ENV{LIB} "${new_lib}")
|
||||
|
||||
execute_process(
|
||||
COMMAND ${cl_path} /nologo ${src} /Fe:${dst}
|
||||
OUTPUT_QUIET
|
||||
)
|
||||
|
||||
set(ENV{LIB} "${orig_lib}")
|
@@ -62,6 +62,8 @@ IF(EXISTS /usr/local/bin/brew AND $ENV{PATH} MATCHES "(^|:)/usr/local/bin/?(:|$)
|
||||
LINK_DIRECTORIES("/usr/local/lib")
|
||||
|
||||
SET(CMAKE_PROGRAM_PATH /usr/local/bin ${CMAKE_PROGRAM_PATH})
|
||||
|
||||
set(ZLIB_ROOT /usr/local/opt/zlib)
|
||||
ELSEIF(EXISTS /opt/local/bin/port AND $ENV{PATH} MATCHES "(^|:)/opt/local/bin/?(:|$)")
|
||||
MESSAGE("-- Configuring for MacPorts")
|
||||
|
||||
|
256
cmake/MakeReleaseCommitAndTag.cmake
Normal file
256
cmake/MakeReleaseCommitAndTag.cmake
Normal file
@@ -0,0 +1,256 @@
|
||||
# Set TAG_RELEASE to ON/TRUE/1 to increment minor, or to new version, or to
|
||||
# UNDO to undo release.
|
||||
|
||||
# Increment version.
|
||||
# Update CHANGELOG.md with git log.
|
||||
# Make release commit.
|
||||
# Tag release commit.
|
||||
|
||||
if(NOT EXISTS "${CMAKE_SOURCE_DIR}/.git")
|
||||
message(FATAL_ERROR "releases can only be done from a git clone")
|
||||
endif()
|
||||
|
||||
if(NOT GIT_FOUND)
|
||||
message(FATAL_ERROR "git is required to make a release")
|
||||
endif()
|
||||
|
||||
find_program(GPG_EXECUTABLE gpg)
|
||||
|
||||
if(NOT GPG_EXECUTABLE)
|
||||
message(FATAL_ERROR "gpg must be installed and set up with your key to make a release")
|
||||
endif()
|
||||
|
||||
# From: https://gist.github.com/alorence/59d18896aaad5188b7b4.
|
||||
macro(CURRENT_DATE RESULT)
|
||||
if(CMAKE_HOST_SYSTEM MATCHES Windows OR ((NOT DEFINED CMAKE_HOST_SYSTEM) AND WIN32))
|
||||
execute_process(COMMAND "cmd" " /C date /T" OUTPUT_VARIABLE ${RESULT})
|
||||
string(REGEX REPLACE ".*(..)/(..)/(....).*" "\\3-\\1-\\2" ${RESULT} ${${RESULT}})
|
||||
else()
|
||||
execute_process(COMMAND "date" "+%Y-%m-%d" OUTPUT_VARIABLE ${RESULT})
|
||||
endif()
|
||||
endmacro()
|
||||
|
||||
function(make_release_commit_and_tag)
|
||||
|
||||
# First make sure we are on master.
|
||||
|
||||
execute_process(
|
||||
COMMAND ${GIT_EXECUTABLE} rev-parse --short --abbrev-ref=strict HEAD
|
||||
OUTPUT_VARIABLE git_branch
|
||||
OUTPUT_STRIP_TRAILING_WHITESPACE
|
||||
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}
|
||||
)
|
||||
|
||||
if(NOT git_branch STREQUAL master)
|
||||
message(FATAL_ERROR "you must be on the git master branch to release")
|
||||
endif()
|
||||
|
||||
execute_process(
|
||||
COMMAND ${GIT_EXECUTABLE} status --porcelain=2
|
||||
OUTPUT_VARIABLE git_status
|
||||
OUTPUT_STRIP_TRAILING_WHITESPACE
|
||||
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}
|
||||
)
|
||||
|
||||
string(LENGTH "${git_status}" git_status_length)
|
||||
|
||||
if(NOT git_status_length EQUAL 0)
|
||||
message(FATAL_ERROR "working tree must be clean to do a release")
|
||||
endif()
|
||||
|
||||
execute_process(
|
||||
COMMAND ${GIT_EXECUTABLE} tag --sort=-v:refname
|
||||
OUTPUT_VARIABLE git_tags
|
||||
OUTPUT_STRIP_TRAILING_WHITESPACE
|
||||
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}
|
||||
)
|
||||
|
||||
string(REGEX REPLACE ";" "\\\\;" git_tags_lines "${git_tags}")
|
||||
string(REGEX REPLACE "\r?\n" ";" git_tags_lines "${git_tags_lines}")
|
||||
|
||||
foreach(line ${git_tags_lines})
|
||||
if(line MATCHES "^v[0-9]")
|
||||
set(git_last_tag ${line})
|
||||
break()
|
||||
endif()
|
||||
endforeach()
|
||||
|
||||
if(NOT DEFINED git_last_tag)
|
||||
message(FATAL_ERROR "cannot find last release tag")
|
||||
endif()
|
||||
|
||||
execute_process(
|
||||
COMMAND ${GIT_EXECUTABLE} log ${git_last_tag}.. "--pretty=format:* %h - %s [%aL]"
|
||||
OUTPUT_VARIABLE release_log
|
||||
OUTPUT_STRIP_TRAILING_WHITESPACE
|
||||
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}
|
||||
)
|
||||
|
||||
# Calculate new release version, unless it was passed in.
|
||||
|
||||
if(TAG_RELEASE STREQUAL UNDO)
|
||||
execute_process(
|
||||
COMMAND ${GIT_EXECUTABLE} tag -d ${git_last_tag}
|
||||
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}
|
||||
)
|
||||
|
||||
execute_process(
|
||||
COMMAND ${GIT_EXECUTABLE} reset HEAD~1
|
||||
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}
|
||||
)
|
||||
|
||||
execute_process(
|
||||
COMMAND ${GIT_EXECUTABLE} checkout HEAD CHANGELOG.md
|
||||
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}
|
||||
)
|
||||
|
||||
message(FATAL_ERROR [=[
|
||||
**** RELEASE COMMIT AND TAG HAVE BEEN REMOVED ****"
|
||||
|
||||
The git and working tree state have been restored to their state before the
|
||||
TAG_RELEASE operation.
|
||||
|
||||
Ignore the following cmake error.
|
||||
]=])
|
||||
elseif(NOT (TAG_RELEASE STREQUAL TRUE OR TAG_RELEASE STREQUAL ON OR TAG_RELEASE STREQUAL 1))
|
||||
set(new_tag ${TAG_RELEASE})
|
||||
else()
|
||||
string(REGEX MATCH "\\.[0-9]+$" last_tag_minor_part ${git_last_tag})
|
||||
string(REGEX REPLACE "\\.[0-9]+$" "" last_tag_minor_stripped ${git_last_tag})
|
||||
|
||||
string(SUBSTRING ${last_tag_minor_part} 1 -1 last_tag_minor)
|
||||
|
||||
math(EXPR last_minor_incremented "${last_tag_minor} + 1")
|
||||
|
||||
string(CONCAT new_tag ${last_tag_minor_stripped} . ${last_minor_incremented})
|
||||
endif()
|
||||
|
||||
# Make sure tag begins with "v".
|
||||
|
||||
if(NOT new_tag MATCHES "^v")
|
||||
set(new_tag "v${new_tag}")
|
||||
endif()
|
||||
|
||||
# But remove the "v" for the version string.
|
||||
|
||||
string(REGEX REPLACE "^v" "" new_version ${new_tag})
|
||||
|
||||
current_date(current_date)
|
||||
|
||||
# Rewrite CHANGELOG.md
|
||||
|
||||
# First make a copy for backing out.
|
||||
configure_file(
|
||||
${CMAKE_SOURCE_DIR}/CHANGELOG.md
|
||||
${CMAKE_BINARY_DIR}/CHANGELOG.md.orig
|
||||
COPYONLY
|
||||
)
|
||||
|
||||
# Now read it and add the new release.
|
||||
|
||||
include(FileIterator)
|
||||
|
||||
fi_open_file(${CMAKE_SOURCE_DIR}/CHANGELOG.md)
|
||||
|
||||
set(work_file ${CMAKE_BINARY_DIR}/CHANGELOG.md.work)
|
||||
|
||||
file(REMOVE ${work_file})
|
||||
|
||||
set(last_release_found FALSE)
|
||||
|
||||
while(NOT fi_done)
|
||||
fi_get_next_line()
|
||||
|
||||
if(NOT last_release_found AND fi_line MATCHES "^## \\[[0-9]")
|
||||
set(last_release_found TRUE)
|
||||
|
||||
set(tag_line "## [${new_version}] - ${current_date}")
|
||||
|
||||
string(LENGTH "${tag_line}" tag_line_length)
|
||||
|
||||
unset(tag_line_under_bar)
|
||||
|
||||
foreach(i RANGE 1 ${tag_line_length})
|
||||
set(tag_line_under_bar "=${tag_line_under_bar}")
|
||||
endforeach()
|
||||
|
||||
file(APPEND ${work_file} ${tag_line} "\n")
|
||||
file(APPEND ${work_file} ${tag_line_under_bar} "\n")
|
||||
file(APPEND ${work_file} "${release_log}" "\n")
|
||||
file(APPEND ${work_file} "\n")
|
||||
endif()
|
||||
|
||||
file(APPEND ${work_file} "${fi_line}" "\n")
|
||||
endwhile()
|
||||
|
||||
# Convert to UNIX line endings on Windows, just copy the file otherwise.
|
||||
if(CMAKE_HOST_SYSTEM MATCHES Windows OR ((NOT DEFINED CMAKE_HOST_SYSTEM) AND WIN32))
|
||||
if(NOT DEFINED POWERSHELL)
|
||||
message(FATAL_ERROR "Powershell is required to convert line endings on Windows.")
|
||||
endif()
|
||||
execute_process(
|
||||
COMMAND ${POWERSHELL} -NoLogo -NoProfile -ExecutionPolicy Bypass -Command [=[
|
||||
$text = [IO.File]::ReadAllText("CHANGELOG.md.work") -replace "`r`n", "`n"
|
||||
[IO.File]::WriteAllText("CHANGELOG.md", $text)
|
||||
]=]
|
||||
WORKING_DIRECTORY ${CMAKE_BINARY_DIR}
|
||||
)
|
||||
else()
|
||||
configure_file(
|
||||
${CMAKE_BINARY_DIR}/CHANGELOG.md.work
|
||||
${CMAKE_BINARY_DIR}/CHANGELOG.md
|
||||
COPYONLY
|
||||
)
|
||||
endif()
|
||||
|
||||
# Copy the new file and add it to the commit.
|
||||
|
||||
configure_file(
|
||||
${CMAKE_BINARY_DIR}/CHANGELOG.md
|
||||
${CMAKE_SOURCE_DIR}/CHANGELOG.md
|
||||
COPYONLY
|
||||
)
|
||||
|
||||
execute_process(
|
||||
COMMAND ${GIT_EXECUTABLE} add CHANGELOG.md
|
||||
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}
|
||||
)
|
||||
|
||||
# Make the release commit.
|
||||
|
||||
execute_process(
|
||||
COMMAND ${GIT_EXECUTABLE} commit -m "release ${new_tag}" --signoff -S
|
||||
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}
|
||||
)
|
||||
|
||||
# Make release tag.
|
||||
|
||||
execute_process(
|
||||
COMMAND ${GIT_EXECUTABLE} tag -s -m${new_tag} ${new_tag}
|
||||
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}
|
||||
)
|
||||
|
||||
message(FATAL_ERROR [=[
|
||||
|
||||
Release commit and tag generated.
|
||||
|
||||
**** IF YOU ARE SURE YOU WANT TO RELEASE ****
|
||||
|
||||
Run the following commands to push the release commit and tag:
|
||||
|
||||
git push
|
||||
git push --tags
|
||||
|
||||
**** TO UNDO THE RELEASE ****
|
||||
|
||||
To rollback these changes, run this command:
|
||||
|
||||
cmake .. -DTAG_RELEASE=UNDO
|
||||
|
||||
Ignore the "configuration incomplete" message following, this mode does not
|
||||
build anything.
|
||||
|
||||
]=])
|
||||
endfunction()
|
||||
|
||||
make_release_commit_and_tag()
|
141
cmake/Options.cmake
Normal file
141
cmake/Options.cmake
Normal file
@@ -0,0 +1,141 @@
|
||||
option(BUILD_TESTING "Build testing" ON)
|
||||
option(BUILD_SHARED_LIBS "Build dynamic libraries" OFF)
|
||||
|
||||
option(TRANSLATIONS_ONLY "Build only the translations.zip" OFF)
|
||||
if(TRANSLATIONS_ONLY)
|
||||
set(BUILD_DEFAULT OFF)
|
||||
else()
|
||||
set(BUILD_DEFAULT ON)
|
||||
endif()
|
||||
|
||||
option(ENABLE_SDL "Build the SDL port" ${BUILD_DEFAULT})
|
||||
option(ENABLE_WX "Build the wxWidgets port" ${BUILD_DEFAULT})
|
||||
option(ENABLE_DEBUGGER "Enable the debugger" ON)
|
||||
option(ENABLE_ASAN "Enable -fsanitize=address by default. Requires debug build with GCC/Clang" OFF)
|
||||
|
||||
# Static linking
|
||||
set(VBAM_STATIC_DEFAULT OFF)
|
||||
if(VCPKG_TARGET_TRIPLET MATCHES -static OR CMAKE_TOOLCHAIN_FILE MATCHES "mxe|-static")
|
||||
set(VBAM_STATIC_DEFAULT ON)
|
||||
elseif(MINGW OR (NOT "$ENV{MSYSTEM_PREFIX}" STREQUAL ""))
|
||||
# Default to static builds on MinGW and all MSYS2 envs.
|
||||
set(VBAM_STATIC_DEFAULT ON)
|
||||
endif()
|
||||
option(VBAM_STATIC "Try to link all libraries statically" ${VBAM_STATIC_DEFAULT})
|
||||
|
||||
if(VBAM_STATIC)
|
||||
set(SDL2_STATIC ON)
|
||||
set(SFML_STATIC_LIBRARIES ON)
|
||||
set(FFMPEG_STATIC ON)
|
||||
set(OPENAL_STATIC ON)
|
||||
set_property(GLOBAL PROPERTY LINK_SEARCH_START_STATIC ON)
|
||||
set_property(GLOBAL PROPERTY LINK_SEARCH_END_STATIC ON)
|
||||
|
||||
if(MSVC)
|
||||
set(CMAKE_FIND_LIBRARY_SUFFIXES .lib)
|
||||
else()
|
||||
list(INSERT CMAKE_FIND_LIBRARY_SUFFIXES 0 .a)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
option(ENABLE_ASM "Enable x86 ASM related options" OFF)
|
||||
|
||||
# The ARM ASM core seems to be very buggy, see #98 and #54. Default to it being
|
||||
# OFF for the time being, until it is either fixed or replaced.
|
||||
option(ENABLE_ASM_CORE "Enable x86 ASM CPU cores (EXPERIMENTAL)" OFF)
|
||||
|
||||
set(ASM_SCALERS_DEFAULT ${ENABLE_ASM})
|
||||
set(MMX_DEFAULT ${ENABLE_ASM})
|
||||
|
||||
option(ENABLE_ASM_SCALERS "Enable x86 ASM graphic filters" ${ASM_SCALERS_DEFAULT})
|
||||
|
||||
include(CMakeDependentOption)
|
||||
cmake_dependent_option(ENABLE_MMX "Enable MMX" ${MMX_DEFAULT} "ENABLE_ASM_SCALERS" OFF)
|
||||
|
||||
option(ENABLE_LIRC "Enable LIRC support" OFF)
|
||||
|
||||
# Link / SFML
|
||||
find_package(SFML 2.4 COMPONENTS network system)
|
||||
if(CMAKE_BUILD_TYPE STREQUAL "RelWithDebInfo")
|
||||
if(SFML_STATIC_LIBRARIES AND SFML_NETWORK_LIBRARY_STATIC_DEBUG AND SFML_SYSTEM_LIBRARY_STATIC_DEBUG)
|
||||
set(SFML_LIBRARIES ${SFML_NETWORK_LIBRARY_STATIC_DEBUG} ${SFML_SYSTEM_LIBRARY_STATIC_DEBUG})
|
||||
elseif(SFML_NETWORK_LIBRARY_DYNAMIC_DEBUG AND SFML_SYSTEM_LIBRARY_DYNAMIC_DEBUG)
|
||||
set(SFML_LIBRARIES ${SFML_NETWORK_LIBRARY_DYNAMIC_DEBUG} ${SFML_SYSTEM_LIBRARY_DYNAMIC_DEBUG})
|
||||
endif()
|
||||
endif()
|
||||
set(ENABLE_LINK_DEFAULT OFF)
|
||||
if(SFML_FOUND)
|
||||
set(ENABLE_LINK_DEFAULT ON)
|
||||
endif()
|
||||
option(ENABLE_LINK "Enable GBA linking functionality" ${ENABLE_LINK_DEFAULT})
|
||||
|
||||
# FFMpeg
|
||||
set(FFMPEG_DEFAULT OFF)
|
||||
set(FFMPEG_COMPONENTS AVCODEC AVFORMAT SWSCALE AVUTIL SWRESAMPLE)
|
||||
set(FFMPEG_COMPONENT_VERSIONS AVCODEC>=58.18.100 AVFORMAT>=58.12.100 SWSCALE>=5.1.100 AVUTIL>=56.14.100 SWRESAMPLE>=3.1.100)
|
||||
|
||||
if(NOT DEFINED ENABLE_FFMPEG OR ENABLE_FFMPEG)
|
||||
set(FFMPEG_DEFAULT ON)
|
||||
|
||||
find_package(FFmpeg COMPONENTS ${FFMPEG_COMPONENTS})
|
||||
# check versions, but only if pkgconfig is available
|
||||
if(FFMPEG_FOUND AND PKG_CONFIG_FOUND AND NOT CMAKE_TOOLCHAIN_FILE MATCHES vcpkg)
|
||||
foreach(component ${FFMPEG_COMPONENT_VERSIONS})
|
||||
string(REPLACE ">=" ";" parts ${component})
|
||||
list(GET parts 0 name)
|
||||
list(GET parts 1 version)
|
||||
|
||||
if((NOT DEFINED ${name}_VERSION) OR ${name}_VERSION VERSION_LESS ${version})
|
||||
set(FFMPEG_FOUND OFF)
|
||||
endif()
|
||||
endforeach()
|
||||
endif()
|
||||
|
||||
if(NOT FFMPEG_FOUND)
|
||||
set(FFMPEG_DEFAULT OFF)
|
||||
endif()
|
||||
endif()
|
||||
option(ENABLE_FFMPEG "Enable ffmpeg A/V recording" ${FFMPEG_DEFAULT})
|
||||
|
||||
# Online Updates
|
||||
set(ONLINEUPDATES_DEFAULT OFF)
|
||||
if(DEFINED(UPSTREAM_RELEASE) AND UPSTREAM_RELEASE)
|
||||
set(ONLINEUPDATES_DEFAULT ON)
|
||||
endif()
|
||||
option(ENABLE_ONLINEUPDATES "Enable online update checks" ${ONLINEUPDATES_DEFAULT})
|
||||
option(HTTPS "Use https URL for winsparkle" ON)
|
||||
|
||||
# We generally don't want LTO when debugging because it makes linking slow
|
||||
if(CMAKE_BUILD_TYPE STREQUAL "Debug")
|
||||
set(LTO_DEFAULT OFF)
|
||||
else()
|
||||
set(LTO_DEFAULT ON)
|
||||
endif()
|
||||
option(ENABLE_LTO "Compile with Link Time Optimization" ${LTO_DEFAULT})
|
||||
|
||||
option(ENABLE_GBA_LOGGING "Enable extended GBA logging" ON)
|
||||
|
||||
# Add support for Homebrew, MacPorts and Fink on macOS
|
||||
option(DISABLE_MACOS_PACKAGE_MANAGERS "Set to TRUE to disable support for macOS Homebrew, MacPorts and Fink." FALSE)
|
||||
if(APPLE AND NOT DISABLE_MACOS_PACKAGE_MANAGERS)
|
||||
include(MacPackageManagers)
|
||||
endif()
|
||||
|
||||
option(UPSTREAM_RELEASE "do some optimizations and release automation tasks" OFF)
|
||||
|
||||
if(WIN32)
|
||||
# not yet implemented
|
||||
option(ENABLE_DIRECT3D "Enable Direct3D rendering for the wxWidgets port" OFF)
|
||||
|
||||
set(XAUDIO2_DEFAULT ON)
|
||||
if (MSVC AND CMAKE_CXX_COMPILER_ID STREQUAL Clang)
|
||||
# TODO: We should update the XAudio headers to build with clang-cl. See
|
||||
# https://github.com/visualboyadvance-m/visualboyadvance-m/issues/1021
|
||||
set(XAUDIO2_DEFAULT OFF)
|
||||
endif()
|
||||
option(ENABLE_XAUDIO2 "Enable xaudio2 sound output for the wxWidgets port" ${XAUDIO2_DEFAULT})
|
||||
endif()
|
||||
|
||||
option(ENABLE_FAUDIO "Enable FAudio sound output for the wxWidgets port" OFF)
|
||||
|
||||
option(ZIP_SUFFIX [=[suffix for release zip files, e.g. "-somebranch".zip]=] OFF)
|
@@ -1,16 +0,0 @@
|
||||
function(make_path_run_wrapper cmd target)
|
||||
get_filename_component(name "${target}" NAME)
|
||||
get_filename_component(cmd_resolved "${cmd}" REALPATH)
|
||||
get_filename_component(base_name "${cmd_resolved}" NAME)
|
||||
get_filename_component(dir_name "${cmd_resolved}" DIRECTORY)
|
||||
|
||||
set(source "${target}.c")
|
||||
|
||||
configure_file(src/gcc-wrap.c.in "${source}")
|
||||
|
||||
include(HostCompile)
|
||||
host_compile("${source}" "${target}")
|
||||
|
||||
add_custom_target(generate_${name} DEPENDS "${CMAKE_BINARY_DIR}/${name}")
|
||||
add_dependencies(generate generate_${name})
|
||||
endfunction()
|
13
cmake/RemoveStrawberryPerlFromPATH.cmake
Normal file
13
cmake/RemoveStrawberryPerlFromPATH.cmake
Normal file
@@ -0,0 +1,13 @@
|
||||
# Remove StrawberryPerl from the PATH environment variable due to various build
|
||||
# pollution.
|
||||
unset(new_path)
|
||||
|
||||
foreach(p $ENV{PATH})
|
||||
if(NOT p MATCHES "(^|\\\\)[Ss]trawberry\\\\([Pp]erl|[Cc])\\\\(.*\\\\)?[Bb]in$")
|
||||
list(APPEND new_path ${p})
|
||||
endif()
|
||||
endforeach()
|
||||
|
||||
set(ENV{PATH} "${new_path}")
|
||||
|
||||
# vim:sw=4 et sts=4 ts=8:
|
@@ -1,35 +1,435 @@
|
||||
if(VCPKG_TARGET_TRIPLET)
|
||||
if(NOT DEFINED VCPKG_TARGET_TRIPLET)
|
||||
if(NOT WIN32)
|
||||
return()
|
||||
endif()
|
||||
|
||||
# Check if we are in an MSVC environment.
|
||||
find_program(cl_exe_path NAME cl.exe HINTS ENV PATH)
|
||||
|
||||
if($ENV{CXX} MATCHES "cl.exe$" OR cl_exe_path)
|
||||
# Infer the architecture from the LIB folders.
|
||||
foreach(LIB $ENV{LIB})
|
||||
if(${LIB} MATCHES "x64$")
|
||||
set(VBAM_VCPKG_PLATFORM "x64-windows-static")
|
||||
break()
|
||||
endif()
|
||||
if(${LIB} MATCHES "x86$")
|
||||
set(VBAM_VCPKG_PLATFORM "x86-windows-static")
|
||||
break()
|
||||
endif()
|
||||
if(${LIB} MATCHES "ARM64$")
|
||||
set(VBAM_VCPKG_PLATFORM "arm64-windows-static")
|
||||
break()
|
||||
endif()
|
||||
endforeach()
|
||||
|
||||
# If all else fails, try to use a sensible default.
|
||||
if(NOT DEFINED VBAM_VCPKG_PLATFORM)
|
||||
set(VBAM_VCPKG_PLATFORM "x64-windows-static")
|
||||
endif()
|
||||
|
||||
unset(cl_exe_path)
|
||||
elseif (NOT DEFINED CMAKE_CXX_COMPILER)
|
||||
# No way to infer the compiler.
|
||||
return()
|
||||
|
||||
elseif(${CMAKE_CXX_COMPILER} MATCHES "clang-cl.exe$" OR ${CMAKE_CXX_COMPILER} MATCHES "clang-cl$")
|
||||
# For stand-alone clang-cl, assume x64.
|
||||
set(VBAM_VCPKG_PLATFORM "x64-windows-static")
|
||||
endif()
|
||||
|
||||
if (NOT DEFINED VBAM_VCPKG_PLATFORM)
|
||||
# Probably not an MSVC environment.
|
||||
return()
|
||||
endif()
|
||||
|
||||
set(VCPKG_TARGET_TRIPLET ${VBAM_VCPKG_PLATFORM} CACHE STRING "Vcpkg target triplet (ex. x64-windows-static)" FORCE)
|
||||
message(STATUS "Inferred VCPKG_TARGET_TRIPLET=${VCPKG_TARGET_TRIPLET}")
|
||||
endif()
|
||||
|
||||
function(vcpkg_check_git_status git_status)
|
||||
# The VS vcpkg component cannot be written to without elevation.
|
||||
if(NOT git_status EQUAL 0 AND NOT VCPKG_ROOT MATCHES "^C:/Program Files/Microsoft Visual Studio/")
|
||||
message(FATAL_ERROR "Error updating vcpkg from git, please make sure git for windows is installed correctly, it can be installed from Visual Studio components")
|
||||
endif()
|
||||
endfunction()
|
||||
|
||||
function(vcpkg_get_first_upgrade vcpkg_exe)
|
||||
# First get the list of upgraded ports.
|
||||
execute_process(
|
||||
COMMAND ${vcpkg_exe} upgrade
|
||||
OUTPUT_VARIABLE upgradable
|
||||
OUTPUT_STRIP_TRAILING_WHITESPACE
|
||||
ERROR_QUIET
|
||||
WORKING_DIRECTORY ${VCPKG_ROOT}
|
||||
)
|
||||
|
||||
string(REGEX REPLACE "\r?\n" ";" upgrade_lines "${upgradable}")
|
||||
|
||||
unset(first_upgrade)
|
||||
|
||||
foreach(line ${upgrade_lines})
|
||||
if(line MATCHES "^ [* ] [^ ]*:")
|
||||
string(REGEX REPLACE "^ [* ] ([^[]+).*" "\\1" pkg ${line})
|
||||
string(REGEX REPLACE "^[^:]+:(.+)$" "\\1" triplet ${line})
|
||||
|
||||
if(triplet STREQUAL "${VCPKG_TARGET_TRIPLET}")
|
||||
# Prefer upgrading zlib before anything else.
|
||||
if(NOT first_upgrade OR pkg MATCHES zlib)
|
||||
set(first_upgrade ${pkg})
|
||||
endif()
|
||||
endif()
|
||||
endif()
|
||||
endforeach()
|
||||
|
||||
if(DEFINED first_upgrade)
|
||||
set(first_upgrade ${first_upgrade} PARENT_SCOPE)
|
||||
endif()
|
||||
endfunction()
|
||||
|
||||
function(vcpkg_deps_fixup vcpkg_exe)
|
||||
# Get installed list.
|
||||
execute_process(
|
||||
COMMAND ${vcpkg_exe} list
|
||||
OUTPUT_VARIABLE pkg_list
|
||||
OUTPUT_STRIP_TRAILING_WHITESPACE
|
||||
ERROR_QUIET
|
||||
WORKING_DIRECTORY ${VCPKG_ROOT}
|
||||
)
|
||||
|
||||
# If libvorbis is NOT installed but libogg is, remove libvorbis recursively.
|
||||
if(pkg_list MATCHES libogg AND (NOT pkg_list MATCHES libvorbis))
|
||||
execute_process(
|
||||
COMMAND ${vcpkg_exe} remove --recurse libogg:${VCPKG_TARGET_TRIPLET}
|
||||
WORKING_DIRECTORY ${VCPKG_ROOT}
|
||||
)
|
||||
endif()
|
||||
endfunction()
|
||||
|
||||
function(vcpkg_is_installed vcpkg_exe pkg_name pkg_ver pkg_triplet powershell outvar)
|
||||
set(${outvar} FALSE PARENT_SCOPE)
|
||||
|
||||
unset(CMAKE_MATCH_1)
|
||||
string(REGEX REPLACE "-r([0-9]+)\$" "" pkg_ver ${pkg_ver})
|
||||
set(pkg_rev ${CMAKE_MATCH_1})
|
||||
|
||||
string(REPLACE "-" "." pkg_ver ${pkg_ver})
|
||||
|
||||
if(NOT DEFINED VCPKG_INSTALLED_COUNT)
|
||||
if(VCPKG_ROOT MATCHES "^C:/Program Files/Microsoft Visual Studio/")
|
||||
execute_process(
|
||||
COMMAND ${powershell}
|
||||
-executionpolicy bypass -noprofile
|
||||
-command "import-module '${CMAKE_BINARY_DIR}/vcpkg-binpkg/vcpkg-binpkg.psm1'; vcpkg-list"
|
||||
OUTPUT_VARIABLE vcpkg_list_text
|
||||
)
|
||||
else()
|
||||
execute_process(
|
||||
COMMAND ${vcpkg_exe} list
|
||||
OUTPUT_VARIABLE vcpkg_list_text
|
||||
ERROR_QUIET
|
||||
)
|
||||
endif()
|
||||
|
||||
string(REGEX REPLACE "\r?\n" ";" vcpkg_list_raw "${vcpkg_list_text}")
|
||||
|
||||
set(VCPKG_INSTALLED_COUNT 0 PARENT_SCOPE)
|
||||
foreach(pkg ${vcpkg_list_raw})
|
||||
if(NOT pkg MATCHES "^([^:[]+)[^:]*:([^ ]+) +([0-9][^ ]*) +.*\$")
|
||||
continue()
|
||||
endif()
|
||||
set(inst_pkg_name ${CMAKE_MATCH_1})
|
||||
set(inst_pkg_ver ${CMAKE_MATCH_3})
|
||||
set(inst_pkg_triplet ${CMAKE_MATCH_2})
|
||||
|
||||
unset(CMAKE_MATCH_1)
|
||||
string(REGEX REPLACE "#([0-9]+)\$" "" inst_pkg_ver ${inst_pkg_ver})
|
||||
if(CMAKE_MATCH_1)
|
||||
set(inst_pkg_rev ${CMAKE_MATCH_1})
|
||||
else()
|
||||
set(inst_pkg_rev FALSE)
|
||||
endif()
|
||||
|
||||
string(REPLACE "-" "." inst_pkg_ver ${inst_pkg_ver})
|
||||
|
||||
list(APPEND VCPKG_INSTALLED ${inst_pkg_name} ${inst_pkg_ver} ${inst_pkg_rev} ${inst_pkg_triplet})
|
||||
math(EXPR VCPKG_INSTALLED_COUNT "${VCPKG_INSTALLED_COUNT} + 1")
|
||||
endforeach()
|
||||
set(VCPKG_INSTALLED ${VCPKG_INSTALLED} PARENT_SCOPE)
|
||||
set(VCPKG_INSTALLED_COUNT ${VCPKG_INSTALLED_COUNT} PARENT_SCOPE)
|
||||
endif()
|
||||
|
||||
if(NOT VCPKG_INSTALLED_COUNT GREATER 0)
|
||||
return()
|
||||
endif()
|
||||
|
||||
math(EXPR idx_max "(${VCPKG_INSTALLED_COUNT} - 1) * 4")
|
||||
|
||||
foreach(idx RANGE 0 ${idx_max} 4)
|
||||
math(EXPR idx_ver "${idx} + 1")
|
||||
math(EXPR idx_rev "${idx} + 2")
|
||||
math(EXPR idx_triplet "${idx} + 3")
|
||||
list(GET VCPKG_INSTALLED ${idx} inst_pkg_name)
|
||||
list(GET VCPKG_INSTALLED ${idx_ver} inst_pkg_ver)
|
||||
list(GET VCPKG_INSTALLED ${idx_rev} inst_pkg_rev)
|
||||
list(GET VCPKG_INSTALLED ${idx_triplet} inst_pkg_triplet)
|
||||
|
||||
if(NOT inst_pkg_triplet STREQUAL pkg_triplet)
|
||||
continue()
|
||||
endif()
|
||||
|
||||
if(inst_pkg_name STREQUAL pkg_name
|
||||
AND pkg_ver VERSION_LESS inst_pkg_ver
|
||||
OR (pkg_ver VERSION_EQUAL inst_pkg_ver
|
||||
AND ((NOT pkg_rev AND NOT inst_pkg_rev)
|
||||
OR (pkg_rev AND inst_pkg_rev AND (NOT pkg_rev GREATER inst_pkg_rev)))))
|
||||
|
||||
set(${outvar} TRUE PARENT_SCOPE)
|
||||
return()
|
||||
endif()
|
||||
endforeach()
|
||||
endfunction()
|
||||
|
||||
function(get_binary_packages vcpkg_exe)
|
||||
set(binary_packages_installed FALSE PARENT_SCOPE)
|
||||
|
||||
unset(triplets)
|
||||
unset(host_triplet)
|
||||
# Determine host triplet for vcpkg build dependencies
|
||||
if(WIN32)
|
||||
if($ENV{PROCESSOR_ARCHITECTURE} MATCHES "[Aa][Rr][Mm]64")
|
||||
set(host_triplet "arm64-windows")
|
||||
elseif($ENV{PROCESSOR_ARCHITECTURE} MATCHES "[Aa][Mm][Dd]64|[Xx]64")
|
||||
set(host_triplet "x64-windows")
|
||||
else()
|
||||
set(host_triplet "x86-windows")
|
||||
endif()
|
||||
endif()
|
||||
if(DEFINED host_triplet)
|
||||
list(APPEND triplets ${host_triplet})
|
||||
endif()
|
||||
list(APPEND triplets ${VCPKG_TARGET_TRIPLET})
|
||||
|
||||
foreach(triplet ${triplets})
|
||||
file(
|
||||
DOWNLOAD "https://nightly.visualboyadvance-m.org/vcpkg/${triplet}/" "${CMAKE_BINARY_DIR}/binary_package_list_${triplet}.html"
|
||||
STATUS pkg_list_status
|
||||
)
|
||||
list(GET pkg_list_status 1 pkg_list_error)
|
||||
list(GET pkg_list_status 0 pkg_list_status)
|
||||
|
||||
if(NOT pkg_list_status EQUAL 0)
|
||||
message(STATUS "Failed to download vcpkg binary package list: ${pkg_list_status} - ${pkg_list_error}")
|
||||
return()
|
||||
endif()
|
||||
endforeach()
|
||||
|
||||
unset(binary_packages)
|
||||
foreach(triplet ${triplets})
|
||||
file(READ "${CMAKE_BINARY_DIR}/binary_package_list_${triplet}.html" raw_html)
|
||||
string(REGEX MATCHALL "<a href=\"[^\"]+[.]zip\"" links ${raw_html})
|
||||
foreach(link ${links})
|
||||
string(REGEX REPLACE "<a href=\"([^\"]+[.]zip)\"" "\\1" pkg ${link})
|
||||
list(APPEND binary_packages ${pkg})
|
||||
endforeach()
|
||||
endforeach()
|
||||
|
||||
set(vcpkg_binpkg_dir ${CMAKE_BINARY_DIR}/vcpkg-binpkg)
|
||||
include(FetchContent)
|
||||
FetchContent_Declare(
|
||||
vcpkg_binpkg
|
||||
URL "https://github.com/rkitover/vcpkg-binpkg-prototype/archive/refs/heads/master.zip"
|
||||
SOURCE_DIR ${vcpkg_binpkg_dir}
|
||||
)
|
||||
|
||||
FetchContent_GetProperties(vcpkg_binpkg)
|
||||
if(NOT vcpkg_binpkg_POPULATED)
|
||||
FetchContent_Populate(vcpkg_binpkg)
|
||||
endif()
|
||||
|
||||
unset(to_install)
|
||||
foreach(pkg ${binary_packages})
|
||||
if(NOT pkg MATCHES "([^_]+)_([^_]+)_([^.]+)[.]zip")
|
||||
continue()
|
||||
endif()
|
||||
set(pkg_name ${CMAKE_MATCH_1})
|
||||
set(pkg_version ${CMAKE_MATCH_2})
|
||||
set(pkg_triplet ${CMAKE_MATCH_3})
|
||||
|
||||
vcpkg_is_installed(${vcpkg_exe} ${pkg_name} ${pkg_version} ${pkg_triplet} ${POWERSHELL} pkg_installed)
|
||||
|
||||
if(NOT pkg_installed)
|
||||
list(APPEND to_install ${pkg})
|
||||
endif()
|
||||
endforeach()
|
||||
|
||||
if(to_install)
|
||||
set(bin_pkgs_dir ${CMAKE_BINARY_DIR}/vcpkg-binary-packages)
|
||||
file(MAKE_DIRECTORY ${bin_pkgs_dir})
|
||||
|
||||
foreach(pkg ${to_install})
|
||||
string(REGEX REPLACE "^[^_]+_[^_]+_([^.]+)[.]zip\$" "\\1" pkg_triplet ${pkg})
|
||||
|
||||
message(STATUS "Downloading https://nightly.visualboyadvance-m.org/vcpkg/${pkg_triplet}/${pkg} ...")
|
||||
|
||||
file(
|
||||
DOWNLOAD "https://nightly.visualboyadvance-m.org/vcpkg/${pkg_triplet}/${pkg}" "${bin_pkgs_dir}/${pkg}"
|
||||
STATUS pkg_download_status
|
||||
)
|
||||
list(GET pkg_download_status 1 pkg_download_error)
|
||||
list(GET pkg_download_status 0 pkg_download_status)
|
||||
|
||||
if(NOT pkg_download_status EQUAL 0)
|
||||
message(STATUS "Failed to download vcpkg binary package '${pkg}': ${pkg_download_status} - ${pkg_download_error}")
|
||||
return()
|
||||
endif()
|
||||
|
||||
message(STATUS "done.")
|
||||
endforeach()
|
||||
|
||||
# -command "import-module ($env:USERPROFILE + '/source/repos/vcpkg-binpkg-prototype/vcpkg-binpkg.psm1'); vcpkg-instpkg ."
|
||||
execute_process(
|
||||
COMMAND ${POWERSHELL}
|
||||
-executionpolicy bypass -noprofile
|
||||
-command "import-module '${CMAKE_BINARY_DIR}/vcpkg-binpkg/vcpkg-binpkg.psm1'; vcpkg-instpkg ."
|
||||
WORKING_DIRECTORY ${bin_pkgs_dir}
|
||||
)
|
||||
|
||||
file(REMOVE_RECURSE ${bin_pkgs_dir})
|
||||
endif()
|
||||
|
||||
set(binary_packages_installed TRUE PARENT_SCOPE)
|
||||
endfunction()
|
||||
|
||||
function(vcpkg_remove_optional_deps vcpkg_exe)
|
||||
list(LENGTH VCPKG_DEPS_OPTIONAL optionals_list_len)
|
||||
math(EXPR optionals_list_last "${optionals_list_len} - 1")
|
||||
|
||||
unset(deps)
|
||||
|
||||
foreach(i RANGE 0 ${optionals_list_last} 2)
|
||||
list(GET VCPKG_DEPS_OPTIONAL ${i} dep)
|
||||
|
||||
list(APPEND deps ${dep}:${VCPKG_TARGET_TRIPLET})
|
||||
endforeach()
|
||||
|
||||
execute_process(
|
||||
COMMAND ${vcpkg_exe} remove --recurse ${deps}
|
||||
WORKING_DIRECTORY ${VCPKG_ROOT}
|
||||
)
|
||||
endfunction()
|
||||
|
||||
function(vcpkg_set_toolchain)
|
||||
if(NOT DEFINED POWERSHELL)
|
||||
message(FATAL_ERROR "Powershell is required to use vcpkg binaries.")
|
||||
endif()
|
||||
if(NOT DEFINED ENV{VCPKG_ROOT})
|
||||
get_filename_component(VCPKG_ROOT ${CMAKE_SOURCE_DIR}/../vcpkg ABSOLUTE)
|
||||
get_filename_component(preferred_root ${CMAKE_SOURCE_DIR}/../vcpkg ABSOLUTE)
|
||||
|
||||
if(WIN32)
|
||||
if(DEFINED ENV{CI} OR EXISTS /vcpkg)
|
||||
set(VCPKG_ROOT /vcpkg)
|
||||
elseif(EXISTS c:/vcpkg)
|
||||
set(VCPKG_ROOT c:/vcpkg)
|
||||
# Prefer the preferred root to the VS default which is more difficult to deal with, if it exists.
|
||||
elseif(EXISTS ${preferred_root})
|
||||
set(VCPKG_ROOT ${preferred_root})
|
||||
else()
|
||||
find_program(vcpkg_exe_path NAME vcpkg.exe HINTS ENV PATH)
|
||||
|
||||
if(vcpkg_exe_path)
|
||||
get_filename_component(VCPKG_ROOT ${vcpkg_exe_path} DIRECTORY)
|
||||
get_filename_component(VCPKG_ROOT ${VCPKG_ROOT} ABSOLUTE)
|
||||
endif()
|
||||
|
||||
unset(vcpkg_exe_path)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
if(NOT DEFINED VCPKG_ROOT)
|
||||
set(VCPKG_ROOT ${preferred_root})
|
||||
endif()
|
||||
|
||||
set(ENV{VCPKG_ROOT} ${VCPKG_ROOT})
|
||||
else()
|
||||
set(VCPKG_ROOT $ENV{VCPKG_ROOT})
|
||||
endif()
|
||||
|
||||
set(VCPKG_ROOT ${VCPKG_ROOT} CACHE FILEPATH "vcpkg installation root path" FORCE)
|
||||
|
||||
if(NOT EXISTS ${VCPKG_ROOT})
|
||||
get_filename_component(vcpkg_root_parent ${VCPKG_ROOT}/.. ABSOLUTE)
|
||||
get_filename_component(root_parent ${VCPKG_ROOT}/.. ABSOLUTE)
|
||||
|
||||
execute_process(
|
||||
COMMAND git clone https://github.com/microsoft/vcpkg.git
|
||||
RESULT_VARIABLE git_status
|
||||
WORKING_DIRECTORY ${vcpkg_root_parent}
|
||||
WORKING_DIRECTORY ${root_parent}
|
||||
)
|
||||
|
||||
if(NOT git_status EQUAL 0)
|
||||
message(FATAL_ERROR "Error cloning vcpkg, please make sure git for windows is installed correctly, it can be installed from Visual Studio components")
|
||||
vcpkg_check_git_status(${git_status})
|
||||
else()
|
||||
# this is the case when we cache vcpkg/installed with the appveyor build cache
|
||||
if(NOT EXISTS ${VCPKG_ROOT}/.git)
|
||||
set(git_commands
|
||||
"git init"
|
||||
"git remote add origin https://github.com/microsoft/vcpkg.git"
|
||||
"git fetch --all --prune"
|
||||
"git reset --hard origin/master"
|
||||
"git branch --set-upstream-to=origin/master master"
|
||||
)
|
||||
foreach(git_command ${git_commands})
|
||||
separate_arguments(git_command)
|
||||
|
||||
execute_process(
|
||||
COMMAND ${git_command}
|
||||
RESULT_VARIABLE git_status
|
||||
WORKING_DIRECTORY ${VCPKG_ROOT}
|
||||
)
|
||||
|
||||
vcpkg_check_git_status(${git_status})
|
||||
endforeach()
|
||||
else()
|
||||
execute_process(
|
||||
COMMAND git fetch origin
|
||||
RESULT_VARIABLE git_status
|
||||
WORKING_DIRECTORY ${VCPKG_ROOT}
|
||||
)
|
||||
vcpkg_check_git_status(${git_status})
|
||||
|
||||
execute_process(
|
||||
COMMAND git status
|
||||
RESULT_VARIABLE git_status
|
||||
OUTPUT_VARIABLE git_status_text
|
||||
WORKING_DIRECTORY ${VCPKG_ROOT}
|
||||
)
|
||||
vcpkg_check_git_status(${git_status})
|
||||
|
||||
set(git_up_to_date FALSE)
|
||||
|
||||
if(git_status_text MATCHES "Your branch is up to date with")
|
||||
set(git_up_to_date TRUE)
|
||||
endif()
|
||||
|
||||
if(NOT git_up_to_date)
|
||||
execute_process(
|
||||
COMMAND git pull --rebase
|
||||
RESULT_VARIABLE git_status
|
||||
WORKING_DIRECTORY ${VCPKG_ROOT}
|
||||
)
|
||||
|
||||
vcpkg_check_git_status(${git_status})
|
||||
endif()
|
||||
endif()
|
||||
endif()
|
||||
|
||||
# build vcpkg if not built
|
||||
if(WIN32)
|
||||
if(NOT EXISTS ${VCPKG_ROOT}/vcpkg.exe)
|
||||
# build latest vcpkg, if needed
|
||||
if(NOT git_up_to_date)
|
||||
if(WIN32)
|
||||
execute_process(
|
||||
COMMAND bootstrap-vcpkg.bat
|
||||
WORKING_DIRECTORY ${VCPKG_ROOT}
|
||||
)
|
||||
endif()
|
||||
else()
|
||||
if(NOT EXISTS ${VCPKG_ROOT}/vcpkg)
|
||||
else()
|
||||
execute_process(
|
||||
COMMAND ./bootstrap-vcpkg.sh
|
||||
WORKING_DIRECTORY ${VCPKG_ROOT}
|
||||
@@ -41,23 +441,114 @@ if(VCPKG_TARGET_TRIPLET)
|
||||
list(APPEND VCPKG_DEPS_QUALIFIED ${pkg}:${VCPKG_TARGET_TRIPLET})
|
||||
endforeach()
|
||||
|
||||
# build our deps
|
||||
if(WIN32)
|
||||
execute_process(
|
||||
COMMAND vcpkg install ${VCPKG_DEPS_QUALIFIED}
|
||||
WORKING_DIRECTORY ${VCPKG_ROOT}
|
||||
)
|
||||
set(vcpkg_exe "${VCPKG_ROOT}/vcpkg.exe")
|
||||
else()
|
||||
execute_process(
|
||||
COMMAND ./vcpkg install ${VCPKG_DEPS_QUALIFIED}
|
||||
WORKING_DIRECTORY ${VCPKG_ROOT}
|
||||
)
|
||||
set(vcpkg_exe "${VCPKG_ROOT}/vcpkg")
|
||||
endif()
|
||||
|
||||
if(WIN32 AND VCPKG_TARGET_TRIPLET MATCHES x64)
|
||||
# update portfiles
|
||||
execute_process(
|
||||
COMMAND ${vcpkg_exe} update
|
||||
WORKING_DIRECTORY ${VCPKG_ROOT}
|
||||
)
|
||||
|
||||
get_binary_packages(${vcpkg_exe})
|
||||
|
||||
if(NOT binary_packages_installed)
|
||||
# Get number of seconds since midnight (might be wrong if am/pm is in effect on Windows.)
|
||||
vcpkg_seconds()
|
||||
set(began ${seconds})
|
||||
|
||||
# Limit total installation time to 20 minutes to not overrun CI time limit.
|
||||
math(EXPR time_limit "${began} + (20 * 60)")
|
||||
|
||||
vcpkg_deps_fixup("${vcpkg_exe}")
|
||||
|
||||
# Install core deps.
|
||||
execute_process(
|
||||
COMMAND ${vcpkg_exe} install ${VCPKG_DEPS_QUALIFIED}
|
||||
WORKING_DIRECTORY ${VCPKG_ROOT}
|
||||
)
|
||||
|
||||
# If ports have been updated, and there is time, rebuild cache one at a time to not overrun the CI time limit.
|
||||
vcpkg_seconds()
|
||||
|
||||
if(seconds LESS time_limit)
|
||||
vcpkg_get_first_upgrade(${vcpkg_exe})
|
||||
|
||||
if(DEFINED first_upgrade)
|
||||
# If we have to upgrade zlib, remove optional deps first so that
|
||||
# the build doesn't overrun the CI time limit.
|
||||
if(first_upgrade STREQUAL "zlib")
|
||||
vcpkg_remove_optional_deps(${vcpkg_exe})
|
||||
endif()
|
||||
|
||||
execute_process(
|
||||
COMMAND ${vcpkg_exe} upgrade --no-dry-run "${first_upgrade}:${VCPKG_TARGET_TRIPLET}"
|
||||
WORKING_DIRECTORY ${VCPKG_ROOT}
|
||||
)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
# Install optional deps, within time limit.
|
||||
list(LENGTH VCPKG_DEPS_OPTIONAL optionals_list_len)
|
||||
math(EXPR optionals_list_last "${optionals_list_len} - 1")
|
||||
|
||||
foreach(i RANGE 0 ${optionals_list_last} 2)
|
||||
list(GET VCPKG_DEPS_OPTIONAL ${i} dep)
|
||||
|
||||
math(EXPR var_idx "${i} + 1")
|
||||
|
||||
list(GET VCPKG_DEPS_OPTIONAL ${var_idx} var)
|
||||
set(val "${${var}}")
|
||||
|
||||
vcpkg_seconds()
|
||||
|
||||
if("${val}" OR (seconds LESS time_limit AND ("${val}" OR "${val}" STREQUAL "")))
|
||||
set(dep_qualified "${dep}:${VCPKG_TARGET_TRIPLET}")
|
||||
|
||||
execute_process(
|
||||
COMMAND ${vcpkg_exe} install ${dep_qualified}
|
||||
WORKING_DIRECTORY ${VCPKG_ROOT}
|
||||
)
|
||||
|
||||
set(${var} ON)
|
||||
else()
|
||||
set(${var} OFF)
|
||||
endif()
|
||||
endforeach()
|
||||
endif()
|
||||
|
||||
if(WIN32 AND VCPKG_TARGET_TRIPLET MATCHES x64 AND CMAKE_GENERATOR MATCHES "Visual Studio")
|
||||
set(CMAKE_GENERATOR_PLATFORM x64 CACHE STRING "visual studio build architecture" FORCE)
|
||||
endif()
|
||||
|
||||
if(WIN32 AND NOT CMAKE_GENERATOR MATCHES "Visual Studio" AND NOT DEFINED CMAKE_CXX_COMPILER)
|
||||
if(VCPKG_TARGET_TRIPLET MATCHES "^x[68][46]-windows-")
|
||||
# set toolchain to VS for e.g. Ninja or jom
|
||||
set(CMAKE_C_COMPILER cl CACHE STRING "Microsoft C/C++ Compiler" FORCE)
|
||||
set(CMAKE_CXX_COMPILER cl CACHE STRING "Microsoft C/C++ Compiler" FORCE)
|
||||
elseif(VCPKG_TARGET_TRIPLET MATCHES "^x[68][46]-mingw-")
|
||||
# set toolchain to MinGW for e.g. Ninja or jom
|
||||
set(CMAKE_C_COMPILER gcc CACHE STRING "MinGW GCC C Compiler" FORCE)
|
||||
set(CMAKE_CXX_COMPILER g++ CACHE STRING "MinGW G++ C++ Compiler" FORCE)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
set(CMAKE_TOOLCHAIN_FILE ${VCPKG_ROOT}/scripts/buildsystems/vcpkg.cmake CACHE FILEPATH "vcpkg toolchain" FORCE)
|
||||
include(${VCPKG_ROOT}/scripts/buildsystems/vcpkg.cmake)
|
||||
endfunction()
|
||||
|
||||
vcpkg_set_toolchain()
|
||||
|
||||
# Make vcpkg use debug libs for RelWithDebInfo
|
||||
set(orig_build_type ${CMAKE_BUILD_TYPE})
|
||||
|
||||
if(CMAKE_BUILD_TYPE STREQUAL RelWithDebInfo)
|
||||
set(CMAKE_BUILD_TYPE Debug)
|
||||
endif()
|
||||
|
||||
include(${VCPKG_ROOT}/scripts/buildsystems/vcpkg.cmake)
|
||||
|
||||
set(CMAKE_BUILD_TYPE ${orig_build_type})
|
||||
unset(orig_build_type)
|
||||
|
37
cmake/Toolchain-asan.cmake
Normal file
37
cmake/Toolchain-asan.cmake
Normal file
@@ -0,0 +1,37 @@
|
||||
if(NOT ENABLE_ASAN)
|
||||
return()
|
||||
endif()
|
||||
|
||||
if(CMAKE_CXX_COMPILER_ID STREQUAL "MSVC")
|
||||
check_cxx_compiler_flag(/fsanitize=address MSVC_ASAN_SUPPORTED)
|
||||
if(MSVC_ASAN_SUPPORTED)
|
||||
add_compile_options(/fsanitize=address)
|
||||
add_compile_definitions(_DISABLE_VECTOR_ANNOTATION _DISABLE_STRING_ANNOTATION)
|
||||
else()
|
||||
message(WARNING "ASAN not available for the compiler, disabling.")
|
||||
set(ENABLE_ASAN OFF)
|
||||
return()
|
||||
endif()
|
||||
else()
|
||||
# ASAN does not work on non-debug builds for GCC and Clang.
|
||||
if(NOT CMAKE_BUILD_TYPE STREQUAL Debug)
|
||||
message(WARNING "ASAN requires debug build, set -DCMAKE_BUILD_TYPE=Debug, disabling.")
|
||||
set(ENABLE_ASAN OFF)
|
||||
return()
|
||||
endif()
|
||||
|
||||
# It is necessary to modify the linker flagas for the compiler check to work.
|
||||
set(BACKUP_LINKER_FLAGS ${CMAKE_EXE_LINKER_FLAGS})
|
||||
set(CMAKE_EXE_LINKER_FLAGS "-fsanitize=address")
|
||||
check_cxx_compiler_flag(-fsanitize=address ASAN_SUPPORTED)
|
||||
set(CMAKE_EXE_LINKER_FLAGS ${BACKUP_LINKER_FLAGS})
|
||||
|
||||
if(ASAN_SUPPORTED)
|
||||
add_compile_options(-fsanitize=address)
|
||||
add_link_options(-fsanitize=address)
|
||||
else()
|
||||
message(WARNING "ASAN not available for the compiler, disabling.")
|
||||
set(ENABLE_ASAN OFF)
|
||||
return()
|
||||
endif()
|
||||
endif()
|
78
cmake/Toolchain-cross-MinGW-w64-common.cmake
Normal file
78
cmake/Toolchain-cross-MinGW-w64-common.cmake
Normal file
@@ -0,0 +1,78 @@
|
||||
set(CMAKE_SYSTEM_NAME Windows)
|
||||
|
||||
set(CMAKE_SYSTEM_PROCESSOR ${CROSS_ARCH})
|
||||
|
||||
set(COMPILER_PREFIX "${CROSS_ARCH}-w64-mingw32")
|
||||
|
||||
unset(CMAKE_RC_COMPILER CACHE)
|
||||
unset(CMAKE_C_COMPILER CACHE)
|
||||
unset(CMAKE_CXX_COMPILER CACHE)
|
||||
unset(PKG_CONFIG_EXECUTABLE CACHE)
|
||||
|
||||
# Which compilers to use for C and C++.
|
||||
find_program(CMAKE_RC_COMPILER NAMES ${COMPILER_PREFIX}-windres)
|
||||
find_program(CMAKE_C_COMPILER NAMES ${COMPILER_PREFIX}-gcc)
|
||||
find_program(CMAKE_CXX_COMPILER NAMES ${COMPILER_PREFIX}-g++)
|
||||
|
||||
SET(CMAKE_FIND_ROOT_PATH
|
||||
/usr/${COMPILER_PREFIX}
|
||||
/usr/${COMPILER_PREFIX}/usr
|
||||
/usr/${COMPILER_PREFIX}/sys-root/mingw
|
||||
/usr/local/opt/mingw-w64/toolchain-${CROSS_ARCH}/${COMPILER_PREFIX}
|
||||
/home/linuxbrew/.linuxbrew/opt/mingw-w64/toolchain-${CROSS_ARCH}/${COMPILER_PREFIX}
|
||||
$ENV{HOME}/.linuxbrew/opt/mingw-w64/toolchain-${CROSS_ARCH}/${COMPILER_PREFIX}
|
||||
)
|
||||
|
||||
# find wx-config
|
||||
foreach(p ${CMAKE_FIND_ROOT_PATH})
|
||||
file(GLOB paths ${p}/lib/wx/config/${COMPILER_PREFIX}-msw-*)
|
||||
|
||||
list(APPEND wx_confs ${paths})
|
||||
endforeach()
|
||||
|
||||
foreach(p ${wx_confs})
|
||||
if(CMAKE_TOOLCHAIN_FILE MATCHES -static)
|
||||
string(REGEX MATCH "(static-)?([0-9]+\\.?)+$" wx_conf_ver ${p})
|
||||
else()
|
||||
string(REGEX MATCH "([0-9]+\\.?)+$" wx_conf_ver ${p})
|
||||
endif()
|
||||
|
||||
list(APPEND wx_conf_vers ${wx_conf_ver})
|
||||
endforeach()
|
||||
|
||||
list(SORT wx_conf_vers)
|
||||
list(REVERSE wx_conf_vers)
|
||||
list(GET wx_conf_vers 0 wx_conf_ver)
|
||||
|
||||
foreach(p ${wx_confs})
|
||||
if(p MATCHES "${wx_conf_ver}$")
|
||||
set(wx_conf ${p})
|
||||
break()
|
||||
endif()
|
||||
endforeach()
|
||||
|
||||
set(wxWidgets_CONFIG_EXECUTABLE ${wx_conf} CACHE FILEPATH "path to wx-config script for the desired wxWidgets configuration" FORCE)
|
||||
|
||||
if(CMAKE_TOOLCHAIN_FILE MATCHES -static)
|
||||
# find the right static zlib
|
||||
foreach(p ${CMAKE_FIND_ROOT_PATH})
|
||||
if(EXISTS ${p}/lib/libz.a)
|
||||
set(ZLIB_ROOT ${p} CACHE FILEPATH "where to find zlib" FORCE)
|
||||
break()
|
||||
endif()
|
||||
endforeach()
|
||||
endif()
|
||||
|
||||
if(CMAKE_PREFIX_PATH)
|
||||
set(CMAKE_FIND_ROOT_PATH ${CMAKE_FIND_ROOT_PATH} ${CMAKE_PREFIX_PATH})
|
||||
endif()
|
||||
|
||||
# adjust the default behaviour of the FIND_XXX() commands:
|
||||
# search headers and libraries in the target environment, search
|
||||
# programs in the host environment too
|
||||
set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM BOTH)
|
||||
set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY)
|
||||
set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY)
|
||||
|
||||
# pkg-config may be under the prefix
|
||||
find_program(PKG_CONFIG_EXECUTABLE NAMES ${COMPILER_PREFIX}-pkg-config)
|
1
cmake/Toolchain-cross-MinGW-w64-i686-static.cmake
Normal file
1
cmake/Toolchain-cross-MinGW-w64-i686-static.cmake
Normal file
@@ -0,0 +1 @@
|
||||
include(${CMAKE_CURRENT_LIST_DIR}/Toolchain-cross-MinGW-w64-i686.cmake)
|
@@ -1,30 +1,3 @@
|
||||
SET(CMAKE_SYSTEM_NAME Windows)
|
||||
|
||||
set(CROSS_ARCH i686)
|
||||
set(COMPILER_PREFIX "${CROSS_ARCH}-w64-mingw32")
|
||||
|
||||
unset(CMAKE_RC_COMPILER CACHE)
|
||||
unset(CMAKE_C_COMPILER CACHE)
|
||||
unset(CMAKE_CXX_COMPILER CACHE)
|
||||
unset(PKG_CONFIG_EXECUTABLE CACHE)
|
||||
|
||||
# which compilers to use for C and C++
|
||||
find_program(CMAKE_RC_COMPILER NAMES ${COMPILER_PREFIX}-windres)
|
||||
find_program(CMAKE_C_COMPILER NAMES ${COMPILER_PREFIX}-gcc)
|
||||
find_program(CMAKE_CXX_COMPILER NAMES ${COMPILER_PREFIX}-g++)
|
||||
|
||||
SET(CMAKE_FIND_ROOT_PATH /usr/${COMPILER_PREFIX} /usr/${COMPILER_PREFIX}/usr /usr/${COMPILER_PREFIX}/sys-root/mingw /usr/local/opt/mingw-w64/toolchain-${CROSS_ARCH}/${COMPILER_PREFIX} /home/linuxbrew/.linuxbrew/opt/mingw-w64/toolchain-${CROSS_ARCH}/${COMPILER_PREFIX} $ENV{HOME}/.linuxbrew/opt/mingw-w64/toolchain-${CROSS_ARCH}/${COMPILER_PREFIX})
|
||||
|
||||
if(CMAKE_PREFIX_PATH)
|
||||
set(CMAKE_FIND_ROOT_PATH ${CMAKE_FIND_ROOT_PATH} ${CMAKE_PREFIX_PATH})
|
||||
endif()
|
||||
|
||||
# adjust the default behaviour of the FIND_XXX() commands:
|
||||
# search headers and libraries in the target environment, search
|
||||
# programs in the host environment too
|
||||
set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM BOTH)
|
||||
set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY)
|
||||
set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY)
|
||||
|
||||
# pkg-config may be under the prefix
|
||||
find_program(PKG_CONFIG_EXECUTABLE NAMES ${COMPILER_PREFIX}-pkg-config)
|
||||
set(CMAKE_SIZEOF_VOID_P 4)
|
||||
include(${CMAKE_CURRENT_LIST_DIR}/Toolchain-cross-MinGW-w64-common.cmake)
|
||||
|
1
cmake/Toolchain-cross-MinGW-w64-x86_64-static.cmake
Normal file
1
cmake/Toolchain-cross-MinGW-w64-x86_64-static.cmake
Normal file
@@ -0,0 +1 @@
|
||||
include(${CMAKE_CURRENT_LIST_DIR}/Toolchain-cross-MinGW-w64-x86_64.cmake)
|
@@ -1,30 +1,3 @@
|
||||
SET(CMAKE_SYSTEM_NAME Windows)
|
||||
|
||||
set(CROSS_ARCH x86_64)
|
||||
set(COMPILER_PREFIX "${CROSS_ARCH}-w64-mingw32")
|
||||
|
||||
unset(CMAKE_RC_COMPILER CACHE)
|
||||
unset(CMAKE_C_COMPILER CACHE)
|
||||
unset(CMAKE_CXX_COMPILER CACHE)
|
||||
unset(PKG_CONFIG_EXECUTABLE CACHE)
|
||||
|
||||
# which compilers to use for C and C++
|
||||
find_program(CMAKE_RC_COMPILER NAMES ${COMPILER_PREFIX}-windres)
|
||||
find_program(CMAKE_C_COMPILER NAMES ${COMPILER_PREFIX}-gcc)
|
||||
find_program(CMAKE_CXX_COMPILER NAMES ${COMPILER_PREFIX}-g++)
|
||||
|
||||
SET(CMAKE_FIND_ROOT_PATH /usr/${COMPILER_PREFIX} /usr/${COMPILER_PREFIX}/usr /usr/${COMPILER_PREFIX}/sys-root/mingw /usr/local/opt/mingw-w64/toolchain-${CROSS_ARCH}/${COMPILER_PREFIX} /home/linuxbrew/.linuxbrew/opt/mingw-w64/toolchain-${CROSS_ARCH}/${COMPILER_PREFIX} $ENV{HOME}/.linuxbrew/opt/mingw-w64/toolchain-${CROSS_ARCH}/${COMPILER_PREFIX})
|
||||
|
||||
if(CMAKE_PREFIX_PATH)
|
||||
set(CMAKE_FIND_ROOT_PATH ${CMAKE_FIND_ROOT_PATH} ${CMAKE_PREFIX_PATH})
|
||||
endif()
|
||||
|
||||
# adjust the default behaviour of the FIND_XXX() commands:
|
||||
# search headers and libraries in the target environment, search
|
||||
# programs in the host environment too
|
||||
set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM BOTH)
|
||||
set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY)
|
||||
set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY)
|
||||
|
||||
# pkg-config may be under the prefix
|
||||
find_program(PKG_CONFIG_EXECUTABLE NAMES ${COMPILER_PREFIX}-pkg-config)
|
||||
set(CMAKE_SIZEOF_VOID_P 8)
|
||||
include(${CMAKE_CURRENT_LIST_DIR}/Toolchain-cross-MinGW-w64-common.cmake)
|
||||
|
51
cmake/Toolchain-gcc-clang.cmake
Normal file
51
cmake/Toolchain-gcc-clang.cmake
Normal file
@@ -0,0 +1,51 @@
|
||||
if(X86_32 OR X86_64)
|
||||
add_compile_options(-mfpmath=sse -msse2)
|
||||
endif()
|
||||
|
||||
if(X86_64)
|
||||
# Require and optimize for Core2 level support, tune for generic.
|
||||
add_compile_options(-march=core2 -mtune=generic)
|
||||
elseif(X86_32)
|
||||
# Optimize for pentium-mmx and tune for generic for older builds.
|
||||
add_compile_options(-march=pentium-mmx -mtune=generic)
|
||||
endif()
|
||||
|
||||
# Common flags.
|
||||
add_compile_options(
|
||||
-pipe
|
||||
-Wno-unused-command-line-argument
|
||||
-Wno-deprecated-copy
|
||||
-Wformat
|
||||
-Wformat-security
|
||||
-feliminate-unused-debug-types
|
||||
-fdiagnostics-color=always
|
||||
)
|
||||
|
||||
# check if ssp flags are supported.
|
||||
if(CMAKE_BUILD_TYPE STREQUAL Debug)
|
||||
check_cxx_compiler_flag(-fstack-protector-strong STACK_PROTECTOR_SUPPORTED)
|
||||
|
||||
if(STACK_PROTECTOR_SUPPORTED)
|
||||
add_compile_options(-fstack-protector-strong)
|
||||
|
||||
check_cxx_compiler_flag("--param ssp-buffer-size=4" SSP_BUFFER_SIZE_SUPPORTED)
|
||||
if(SSP_BUFFER_SIZE_SUPPORTED)
|
||||
add_compile_options(--param ssp-buffer-size=4)
|
||||
endif()
|
||||
endif()
|
||||
endif()
|
||||
|
||||
if(NOT ENABLE_ASM) # inline asm is not allowed with -fPIC
|
||||
add_compile_options(-fPIC)
|
||||
endif()
|
||||
|
||||
if(CMAKE_BUILD_TYPE STREQUAL Debug)
|
||||
add_compile_options(-ggdb3 -Og -fno-omit-frame-pointer -Wall -Wextra)
|
||||
else()
|
||||
add_compile_options(-Ofast -fomit-frame-pointer)
|
||||
endif()
|
||||
|
||||
# for some reason this is necessary
|
||||
if(CMAKE_SYSTEM_NAME STREQUAL FreeBSD)
|
||||
include_directories(/usr/local/include)
|
||||
endif()
|
28
cmake/Toolchain-mingw.cmake
Normal file
28
cmake/Toolchain-mingw.cmake
Normal file
@@ -0,0 +1,28 @@
|
||||
if (NOT MINGW)
|
||||
return()
|
||||
endif()
|
||||
|
||||
# this has to run after the toolchain is initialized.
|
||||
include_directories("${CMAKE_SOURCE_DIR}/dependencies/mingw-include")
|
||||
include_directories("${CMAKE_SOURCE_DIR}/dependencies/mingw-xaudio/include")
|
||||
|
||||
# link libgcc/libstdc++ statically on GCC/mingw
|
||||
# and adjust link command when making a static binary
|
||||
if(CMAKE_CXX_COMPILER_ID STREQUAL "GNU" AND VBAM_STATIC)
|
||||
# some dists don't have a static libpthread
|
||||
set(CMAKE_CXX_LINK_EXECUTABLE "${CMAKE_CXX_LINK_EXECUTABLE} -static-libgcc -static-libstdc++ -Wl,-Bstatic -lstdc++ -lpthread ")
|
||||
|
||||
if(WIN32)
|
||||
add_custom_command(
|
||||
TARGET visualboyadvance-m PRE_LINK
|
||||
COMMAND ${CMAKE_COMMAND} -P ${CMAKE_CURRENT_SOURCE_DIR}/msys-link-static.cmake
|
||||
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
|
||||
)
|
||||
else()
|
||||
add_custom_command(
|
||||
TARGET visualboyadvance-m PRE_LINK
|
||||
COMMAND ${CMAKE_COMMAND} -P ${CMAKE_CURRENT_SOURCE_DIR}/link-static.cmake
|
||||
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
|
||||
)
|
||||
endif()
|
||||
endif()
|
83
cmake/Toolchain-msvc.cmake
Normal file
83
cmake/Toolchain-msvc.cmake
Normal file
@@ -0,0 +1,83 @@
|
||||
# Set the runtime library properly.
|
||||
set(CMAKE_MSVC_RUNTIME_LIBRARY "MultiThreaded$<$<CONFIG:DEBUG>:Debug>" CACHE INTERNAL "")
|
||||
|
||||
if(CMAKE_CXX_COMPILER_ID STREQUAL "MSVC")
|
||||
# MSVC-specific flags (not supported by clang-cl).
|
||||
add_compile_options(/nologo)
|
||||
if (NOT CMAKE_GENERATOR MATCHES "Ninja")
|
||||
# Multi-processor compilation does not work well with Ninja.
|
||||
add_compile_options(/MP)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
include_directories("${CMAKE_SOURCE_DIR}/dependencies/msvc")
|
||||
|
||||
add_compile_definitions(
|
||||
_FORCENAMELESSUNION
|
||||
WIN32_LEAN_AND_MEAN
|
||||
WIN32
|
||||
_WINDOWS
|
||||
__STDC_LIMIT_MACROS
|
||||
__STDC_CONSTANT_MACROS
|
||||
_CRT_SECURE_NO_WARNINGS
|
||||
_UNICODE
|
||||
UNICODE
|
||||
WINVER=0x0A00
|
||||
NTDDI_VERSION=0x0A000007
|
||||
NOMINMAX
|
||||
)
|
||||
add_compile_options(
|
||||
/W4
|
||||
/GR
|
||||
/EHsc
|
||||
)
|
||||
|
||||
if (CMAKE_BUILD_TYPE STREQUAL "Debug")
|
||||
add_compile_definitions(_DEBUG)
|
||||
add_compile_options(/Ob0 /Od /RTC1)
|
||||
if (CMAKE_CXX_COMPILER_ID STREQUAL "MSVC" AND NOT ENABLE_ASAN)
|
||||
# Use Edit and Continue with MSVC.
|
||||
set(CMAKE_MSVC_DEBUG_INFORMATION_FORMAT "EditAndContinue" CACHE STRING "" FORCE)
|
||||
else()
|
||||
set(CMAKE_MSVC_DEBUG_INFORMATION_FORMAT "ProgramDatabase" CACHE STRING "" FORCE)
|
||||
endif()
|
||||
else()
|
||||
add_compile_options(/MT /Oi /Gy)
|
||||
add_link_options(/OPT:REF /OPT:ICF)
|
||||
set(CMAKE_MSVC_DEBUG_INFORMATION_FORMAT "ProgramDatabase" CACHE STRING "" FORCE)
|
||||
|
||||
if (CMAKE_BUILD_TYPE STREQUAL "MinSizeRel")
|
||||
add_compile_options(/O1 /Ob1)
|
||||
elseif(CMAKE_BUILD_TYPE STREQUAL "RelWithDebInfo")
|
||||
add_compile_options(/O2 /Ob1)
|
||||
else()
|
||||
add_compile_options(/O2)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
if(CMAKE_VERSION VERSION_LESS "3.25")
|
||||
# Backwards-compatible way of setting the /Z option.
|
||||
if(CMAKE_MSVC_DEBUG_INFORMATION_FORMAT STREQUAL "EditAndContinue")
|
||||
add_compile_options(/ZI)
|
||||
elseif(CMAKE_MSVC_DEBUG_INFORMATION_FORMAT STREQUAL "ProgramDatabase")
|
||||
add_compile_options(/Zi)
|
||||
elseif(CMAKE_MSVC_DEBUG_INFORMATION_FORMAT STREQUAL "Embedded")
|
||||
add_compile_options(/Z7)
|
||||
else()
|
||||
message(FATAL_ERROR "Unknown value for CMAKE_MSVC_DEBUG_INFORMATION_FORMAT: ${CMAKE_MSVC_DEBUG_INFORMATION_FORMAT}")
|
||||
endif()
|
||||
endif()
|
||||
|
||||
set(CMAKE_RC_FLAGS "-c65001 /DWIN32" CACHE STRING "" FORCE)
|
||||
|
||||
# We need to explicitly set all of these to override the CMake defaults.
|
||||
set(CMAKE_CXX_FLAGS "" CACHE STRING "" FORCE)
|
||||
set(CMAKE_C_FLAGS "" CACHE STRING "" FORCE)
|
||||
set(CMAKE_CXX_FLAGS_DEBUG "" CACHE STRING "" FORCE)
|
||||
set(CMAKE_C_FLAGS_DEBUG "" CACHE STRING "" FORCE)
|
||||
set(CMAKE_CXX_FLAGS_RELEASE "" CACHE STRING "" FORCE)
|
||||
set(CMAKE_C_FLAGS_RELEASE "" CACHE STRING "" FORCE)
|
||||
set(CMAKE_CXX_FLAGS_RELWITHDEBINFO "" CACHE STRING "" FORCE)
|
||||
set(CMAKE_C_FLAGS_RELWITHDEBINFO "" CACHE STRING "" FORCE)
|
||||
set(CMAKE_CXX_FLAGS_MINSIZEREL "" CACHE STRING "" FORCE)
|
||||
set(CMAKE_C_FLAGS_MINSIZEREL "" CACHE STRING "" FORCE)
|
73
cmake/Toolchain.cmake
Normal file
73
cmake/Toolchain.cmake
Normal file
@@ -0,0 +1,73 @@
|
||||
# Compiler stuff
|
||||
include(CheckCXXCompilerFlag)
|
||||
|
||||
include(ProcessorCount)
|
||||
ProcessorCount(num_cpus)
|
||||
|
||||
if (ENABLE_LTO)
|
||||
include(CheckIPOSupported)
|
||||
check_ipo_supported(RESULT LTO_SUPPORTED)
|
||||
if (LTO_SUPPORTED)
|
||||
set(CMAKE_INTERPROCEDURAL_OPTIMIZATION TRUE)
|
||||
else()
|
||||
message(WARNING "LTO is not supported by the compiler, diasabling LTO")
|
||||
set(ENABLE_LTO OFF)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
# Common compiler settings.
|
||||
if(CMAKE_BUILD_TYPE STREQUAL "Debug")
|
||||
add_compile_definitions(DEBUG)
|
||||
else()
|
||||
add_compile_definitions(NDEBUG)
|
||||
endif()
|
||||
|
||||
if(APPLE)
|
||||
add_compile_definitions(MACHO)
|
||||
elseif("${CMAKE_SYSTEM}" MATCHES "Linux")
|
||||
add_compile_definitions(ELF)
|
||||
endif()
|
||||
|
||||
if(X86_64)
|
||||
add_compile_definitions(__AMD64__ __X86_64__)
|
||||
endif()
|
||||
|
||||
# Enable ASAN if requested and supported.
|
||||
include(Toolchain-asan)
|
||||
|
||||
# MINGW/MSYS-specific settings.
|
||||
include(Toolchain-mingw)
|
||||
|
||||
# Toolchain-specific settings.
|
||||
if(MSVC)
|
||||
# This also includes clang-cl.
|
||||
include(Toolchain-msvc)
|
||||
else()
|
||||
include(Toolchain-gcc-clang)
|
||||
endif()
|
||||
|
||||
# Assembler flags.
|
||||
if(ENABLE_ASM_CORE OR ENABLE_ASM_SCALERS)
|
||||
if(MSVC)
|
||||
if(NOT EXISTS ${CMAKE_BINARY_DIR}/nuget.exe)
|
||||
file(DOWNLOAD "https://dist.nuget.org/win-x86-commandline/latest/nuget.exe" ${CMAKE_BINARY_DIR}/nuget.exe)
|
||||
endif()
|
||||
|
||||
execute_process(
|
||||
COMMAND nuget.exe install nasm2 -OutputDirectory ${CMAKE_BINARY_DIR}/nuget
|
||||
WORKING_DIRECTORY ${CMAKE_BINARY_DIR}
|
||||
)
|
||||
|
||||
file(GLOB pkg ${CMAKE_BINARY_DIR}/nuget/nasm2*)
|
||||
|
||||
list(APPEND CMAKE_PROGRAM_PATH ${pkg}/tools)
|
||||
endif()
|
||||
|
||||
enable_language(ASM_NASM)
|
||||
|
||||
set(ASM_ENABLED ON)
|
||||
endif()
|
||||
|
||||
if(ASM_ENABLED)
|
||||
string(REGEX REPLACE "<FLAGS>" "-I${CMAKE_SOURCE_DIR}/src/filters/hq/asm/ -O1 -w-orphan-labels" CMAKE_ASM_NASM_COMPILE_OBJECT ${CMAKE_ASM_NASM_COMPILE_OBJECT})
|
||||
endif()
|
148
cmake/UpdateAppcast.cmake
Normal file
148
cmake/UpdateAppcast.cmake
Normal file
@@ -0,0 +1,148 @@
|
||||
# Clone web-data.
|
||||
# Update version in appcast.xml to latest tag.
|
||||
# Commit web-data.
|
||||
|
||||
function(update_appcast)
|
||||
if(UPDATE_APPCAST STREQUAL UNDO)
|
||||
file(REMOVE_RECURSE ${CMAKE_BINARY_DIR}/web-data)
|
||||
|
||||
message(FATAL_ERROR [=[
|
||||
**** APPCAST.XML UPDATE HAS BEEN UNDONE ****"
|
||||
|
||||
Ignore the following cmake error.
|
||||
]=])
|
||||
endif()
|
||||
|
||||
# Get last tag.
|
||||
|
||||
execute_process(
|
||||
COMMAND ${GIT_EXECUTABLE} tag --sort=-v:refname
|
||||
OUTPUT_VARIABLE git_tags
|
||||
OUTPUT_STRIP_TRAILING_WHITESPACE
|
||||
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}
|
||||
)
|
||||
|
||||
string(REGEX REPLACE ";" "\\\\;" git_tags_lines "${git_tags}")
|
||||
string(REGEX REPLACE "\r?\n" ";" git_tags_lines "${git_tags_lines}")
|
||||
|
||||
foreach(line ${git_tags_lines})
|
||||
if(line MATCHES "^v[0-9]")
|
||||
set(new_tag ${line})
|
||||
break()
|
||||
endif()
|
||||
endforeach()
|
||||
|
||||
if(NOT DEFINED new_tag)
|
||||
message(FATAL_ERROR "cannot find last release tag")
|
||||
endif()
|
||||
|
||||
# Remove the "v" for the version string.
|
||||
|
||||
string(REGEX REPLACE "^v" "" new_version ${new_tag})
|
||||
|
||||
# Clone repo.
|
||||
|
||||
execute_process(
|
||||
COMMAND ${GIT_EXECUTABLE} clone git@github.com:visualboyadvance-m/visualboyadvance-m.github.io web-data
|
||||
WORKING_DIRECTORY ${CMAKE_BINARY_DIR}
|
||||
)
|
||||
|
||||
# Rewrite appcast.xml.
|
||||
|
||||
# First make a copy for backing out.
|
||||
configure_file(
|
||||
${CMAKE_BINARY_DIR}/web-data/appcast.xml
|
||||
${CMAKE_BINARY_DIR}/appcast.xml.orig
|
||||
COPYONLY
|
||||
)
|
||||
|
||||
# Now read it and replace the versions.
|
||||
|
||||
include(FileIterator)
|
||||
|
||||
fi_open_file(${CMAKE_BINARY_DIR}/web-data/appcast.xml)
|
||||
|
||||
set(work_file ${CMAKE_BINARY_DIR}/appcast.xml.work)
|
||||
|
||||
file(REMOVE ${work_file})
|
||||
|
||||
while(NOT fi_done)
|
||||
fi_get_next_line()
|
||||
|
||||
string(REGEX REPLACE [=[(:version="|v)([0-9.]+)([/"])]=] "\\1${new_version}\\3" fi_line "${fi_line}")
|
||||
|
||||
file(APPEND ${work_file} "${fi_line}" "\n")
|
||||
endwhile()
|
||||
|
||||
# Convert to UNIX line endings on Windows, just copy the file otherwise.
|
||||
if(CMAKE_HOST_SYSTEM MATCHES Windows OR ((NOT DEFINED CMAKE_HOST_SYSTEM) AND WIN32))
|
||||
if(NOT DEFINED POWERSHELL)
|
||||
message(FATAL_ERROR "Powershell is required to convert line endings on Windows.")
|
||||
endif()
|
||||
execute_process(
|
||||
COMMAND ${POWERSHELL} -NoLogo -NoProfile -ExecutionPolicy Bypass -Command [=[
|
||||
$text = [IO.File]::ReadAllText("appcast.xml.work") -replace "`r`n", "`n"
|
||||
[IO.File]::WriteAllText("appcast.xml", $text)
|
||||
]=]
|
||||
WORKING_DIRECTORY ${CMAKE_BINARY_DIR}
|
||||
)
|
||||
else()
|
||||
configure_file(
|
||||
${CMAKE_BINARY_DIR}/appcast.xml.work
|
||||
${CMAKE_BINARY_DIR}/appcast.xml
|
||||
COPYONLY
|
||||
)
|
||||
endif()
|
||||
|
||||
# Copy the new file and add it to the commit.
|
||||
|
||||
configure_file(
|
||||
${CMAKE_BINARY_DIR}/appcast.xml
|
||||
${CMAKE_BINARY_DIR}/web-data/appcast.xml
|
||||
COPYONLY
|
||||
)
|
||||
|
||||
execute_process(
|
||||
COMMAND ${GIT_EXECUTABLE} add appcast.xml
|
||||
WORKING_DIRECTORY ${CMAKE_BINARY_DIR}/web-data
|
||||
)
|
||||
|
||||
# Commit the change.
|
||||
|
||||
execute_process(
|
||||
COMMAND ${GIT_EXECUTABLE} commit -m "release ${new_tag}" --signoff -S
|
||||
WORKING_DIRECTORY ${CMAKE_BINARY_DIR}/web-data
|
||||
)
|
||||
|
||||
# Make release tag.
|
||||
|
||||
execute_process(
|
||||
COMMAND ${GIT_EXECUTABLE} tag -s -m${new_tag} ${new_tag}
|
||||
WORKING_DIRECTORY ${CMAKE_BINARY_DIR}/web-data
|
||||
)
|
||||
|
||||
message(FATAL_ERROR [=[
|
||||
|
||||
appcast.xml updated.
|
||||
|
||||
**** IF YOU ARE SURE YOU WANT TO RELEASE ****
|
||||
|
||||
Run the following commands to push the release commit and tag:
|
||||
|
||||
cd web-data
|
||||
git push
|
||||
git push --tags
|
||||
|
||||
**** TO UNDO THE RELEASE ****
|
||||
|
||||
To rollback these changes, run this command:
|
||||
|
||||
cmake .. -DUPDATE_APPCAST=UNDO
|
||||
|
||||
Ignore the "configuration incomplete" message following, this mode does not
|
||||
build anything.
|
||||
|
||||
]=])
|
||||
endfunction()
|
||||
|
||||
update_appcast()
|
@@ -1,103 +0,0 @@
|
||||
# UseGCCBinUtilsWrappers.cmake
|
||||
#
|
||||
# Use gcc binutils wrappers such as gcc-ar, this may be necessary for LTO.
|
||||
#
|
||||
# To use:
|
||||
#
|
||||
# put a copy into your <project_root>/CMakeScripts/
|
||||
#
|
||||
# In your main CMakeLists.txt add the command:
|
||||
#
|
||||
# INCLUDE(UseGCCBinUtilsWrappers)
|
||||
#
|
||||
# BSD 2-Clause License
|
||||
#
|
||||
# Copyright (c) 2016, Rafael Kitover
|
||||
# All rights reserved.
|
||||
#
|
||||
# Redistribution and use in source and binary forms, with or without
|
||||
# modification, are permitted provided that the following conditions are met:
|
||||
#
|
||||
# * Redistributions of source code must retain the above copyright notice, this
|
||||
# list of conditions and the following disclaimer.
|
||||
#
|
||||
# * Redistributions in binary form must reproduce the above copyright notice,
|
||||
# this list of conditions and the following disclaimer in the documentation
|
||||
# and/or other materials provided with the distribution.
|
||||
#
|
||||
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
||||
# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||
# DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
|
||||
# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||
# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
|
||||
# SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
|
||||
# CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
|
||||
# OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
# only do this when compiling with gcc/g++
|
||||
IF(NOT (CMAKE_COMPILER_IS_GNUCXX OR CMAKE_COMPILER_IS_GNUC))
|
||||
RETURN()
|
||||
ENDIF()
|
||||
|
||||
# first try appending -util to basename of compiler
|
||||
STRING(REGEX MATCH "\\.(exe|EXE)$" GCC_EXE_SUFFIX ${CMAKE_C_COMPILER})
|
||||
STRING(REGEX REPLACE "\\.(exe|EXE)$" "" GCC_BASENAME ${CMAKE_C_COMPILER})
|
||||
|
||||
SET(GCC_AR "${GCC_BASENAME}-ar${GCC_EXE_SUFFIX}")
|
||||
SET(GCC_NM "${GCC_BASENAME}-nm${GCC_EXE_SUFFIX}")
|
||||
SET(GCC_RANLIB "${GCC_BASENAME}-ranlib${GCC_EXE_SUFFIX}")
|
||||
|
||||
# if that does not work, try looking for gcc-util in the compiler directory,
|
||||
# and failing that in the PATH
|
||||
|
||||
GET_FILENAME_COMPONENT(GCC_DIRNAME ${CMAKE_C_COMPILER} DIRECTORY)
|
||||
|
||||
IF(NOT EXISTS ${GCC_AR})
|
||||
UNSET(GCC_AR)
|
||||
|
||||
FIND_PROGRAM(GCC_AR NAMES gcc-ar gcc-ar.exe GCC-AR.EXE HINTS ${GCC_DIRNAME})
|
||||
ENDIF()
|
||||
|
||||
IF(NOT EXISTS ${GCC_NM})
|
||||
UNSET(GCC_NM)
|
||||
|
||||
FIND_PROGRAM(GCC_NM NAMES gcc-nm gcc-nm.exe GCC-NM.EXE HINTS ${GCC_DIRNAME})
|
||||
ENDIF()
|
||||
|
||||
IF(NOT EXISTS ${GCC_RANLIB})
|
||||
UNSET(GCC_RANLIB)
|
||||
|
||||
FIND_PROGRAM(GCC_RANLIB NAMES gcc-ranlib gcc-ranlib.exe GCC-RANLIB.EXE HINTS ${GCC_DIRNAME})
|
||||
ENDIF()
|
||||
|
||||
INCLUDE(PathRun)
|
||||
|
||||
IF(EXISTS ${GCC_AR})
|
||||
MESSAGE("-- Found gcc-ar: ${GCC_AR}")
|
||||
|
||||
SET(target "${CMAKE_BINARY_DIR}/gcc-ar-wrap")
|
||||
MAKE_PATH_RUN_WRAPPER("${GCC_AR}" "${target}")
|
||||
SET(CMAKE_AR "${target}")
|
||||
ENDIF()
|
||||
|
||||
IF(EXISTS ${GCC_NM})
|
||||
MESSAGE("-- Found gcc-nm: ${GCC_NM}")
|
||||
|
||||
SET(target "${CMAKE_BINARY_DIR}/gcc-nm-wrap")
|
||||
MAKE_PATH_RUN_WRAPPER("${GCC_NM}" "${target}")
|
||||
SET(CMAKE_NM "${target}")
|
||||
ENDIF()
|
||||
|
||||
IF(EXISTS ${GCC_RANLIB})
|
||||
MESSAGE("-- Found gcc-ranlib: ${GCC_RANLIB}")
|
||||
|
||||
SET(target "${CMAKE_BINARY_DIR}/gcc-ranlib-wrap")
|
||||
MAKE_PATH_RUN_WRAPPER("${GCC_RANLIB}" "${target}")
|
||||
SET(CMAKE_RANLIB "${target}")
|
||||
ENDIF()
|
||||
|
||||
FOREACH(VAR "GCC_AR" "GCC_NM" "GCC_RANLIB" "GCC_DIRNAME" "GCC_BASENAME" "GCC_EXE_SUFFIX" "target")
|
||||
UNSET(${VAR})
|
||||
ENDFOREACH()
|
@@ -1,33 +1,3 @@
|
||||
# From: https://stackoverflow.com/a/7216542
|
||||
function(JOIN VALUES GLUE OUTPUT)
|
||||
string (REGEX REPLACE "([^\\]|^);" "\\1${GLUE}" _TMP_STR "${VALUES}")
|
||||
string (REGEX REPLACE "[\\](.)" "\\1" _TMP_STR "${_TMP_STR}") #fixes escaping
|
||||
set (${OUTPUT} "${_TMP_STR}" PARENT_SCOPE)
|
||||
endfunction()
|
||||
|
||||
# convert msys paths like /c/foo to windows paths like c:/foo
|
||||
# for variables set by FindWxWidgets
|
||||
function(normalize_wx_paths)
|
||||
if(MSYS)
|
||||
unset(new_paths)
|
||||
foreach(p ${wxWidgets_LIBRARY_DIRS})
|
||||
execute_process(COMMAND cygpath -m "${p}" OUTPUT_VARIABLE p_win OUTPUT_STRIP_TRAILING_WHITESPACE)
|
||||
list(APPEND new_paths "${p_win}")
|
||||
endforeach()
|
||||
|
||||
set(wxWidgets_LIBRARY_DIRS ${new_paths} PARENT_SCOPE)
|
||||
|
||||
string(REGEX REPLACE "((^| )[^/]*)/([a-zA-Z])/" "\\1\\3:/" new_libs "${wxWidgets_LIBRARIES}")
|
||||
|
||||
set(wxWidgets_LIBRARIES ${new_libs} PARENT_SCOPE)
|
||||
endif()
|
||||
endfunction()
|
||||
|
||||
macro(cleanup_wx_vars)
|
||||
if(wxWidgets_CXX_FLAGS)
|
||||
list(REMOVE_ITEM wxWidgets_CXX_FLAGS -fpermissive)
|
||||
endif()
|
||||
endmacro()
|
||||
|
||||
function(cygpath var path)
|
||||
execute_process(
|
||||
@@ -68,15 +38,28 @@ function(check_clean_exit var)
|
||||
endfunction()
|
||||
|
||||
function(find_wx_util var util)
|
||||
# on win32, including cross builds we prefer the plain utility name first from PATH
|
||||
if(WIN32)
|
||||
set(conf_suffixes "" gtk4u gtk4 gtk3u gtk3 gtk2u gtk2)
|
||||
set(major_versions "" 4 3 2)
|
||||
else()
|
||||
set(conf_suffixes gtk4u gtk4 gtk3u gtk3 gtk2u gtk2 "")
|
||||
set(major_versions 4 3 2 "")
|
||||
if(WIN32 OR EXISTS /etc/gentoo-release)
|
||||
# On win32, including cross builds we prefer the plain utility
|
||||
# name first from PATH, with the exception of -static for static
|
||||
# builds.
|
||||
#
|
||||
# On Gentoo /usr/bin/wx-config loads the eselected build, so we
|
||||
# want to try that first.
|
||||
#
|
||||
# This makes a one element of empty string list.
|
||||
|
||||
if(VBAM_STATIC)
|
||||
set(conf_suffixes "static;")
|
||||
else()
|
||||
set(conf_suffixes ";")
|
||||
endif()
|
||||
|
||||
set(major_versions ";")
|
||||
endif()
|
||||
|
||||
list(APPEND conf_suffixes gtk4u gtk4 gtk3u gtk3 gtk2u gtk2 "")
|
||||
list(APPEND major_versions 4 3 2 "")
|
||||
|
||||
foreach(conf_suffix IN LISTS conf_suffixes)
|
||||
foreach(major_version IN LISTS major_versions)
|
||||
foreach(minor_version RANGE 100 -1 -1)
|
||||
|
175
cmake/doctest.cmake
Normal file
175
cmake/doctest.cmake
Normal file
@@ -0,0 +1,175 @@
|
||||
# Distributed under the OSI-approved BSD 3-Clause License. See accompanying
|
||||
# file Copyright.txt or https://cmake.org/licensing for details.
|
||||
|
||||
#[=======================================================================[.rst:
|
||||
doctest
|
||||
-----
|
||||
|
||||
This module defines a function to help use the doctest test framework.
|
||||
|
||||
The :command:`doctest_discover_tests` discovers tests by asking the compiled test
|
||||
executable to enumerate its tests. This does not require CMake to be re-run
|
||||
when tests change. However, it may not work in a cross-compiling environment,
|
||||
and setting test properties is less convenient.
|
||||
|
||||
This command is intended to replace use of :command:`add_test` to register
|
||||
tests, and will create a separate CTest test for each doctest test case. Note
|
||||
that this is in some cases less efficient, as common set-up and tear-down logic
|
||||
cannot be shared by multiple test cases executing in the same instance.
|
||||
However, it provides more fine-grained pass/fail information to CTest, which is
|
||||
usually considered as more beneficial. By default, the CTest test name is the
|
||||
same as the doctest name; see also ``TEST_PREFIX`` and ``TEST_SUFFIX``.
|
||||
|
||||
.. command:: doctest_discover_tests
|
||||
|
||||
Automatically add tests with CTest by querying the compiled test executable
|
||||
for available tests::
|
||||
|
||||
doctest_discover_tests(target
|
||||
[TEST_SPEC arg1...]
|
||||
[EXTRA_ARGS arg1...]
|
||||
[WORKING_DIRECTORY dir]
|
||||
[TEST_PREFIX prefix]
|
||||
[TEST_SUFFIX suffix]
|
||||
[PROPERTIES name1 value1...]
|
||||
[TEST_LIST var]
|
||||
)
|
||||
|
||||
``doctest_discover_tests`` sets up a post-build command on the test executable
|
||||
that generates the list of tests by parsing the output from running the test
|
||||
with the ``--list-test-cases`` argument. This ensures that the full
|
||||
list of tests is obtained. Since test discovery occurs at build time, it is
|
||||
not necessary to re-run CMake when the list of tests changes.
|
||||
However, it requires that :prop_tgt:`CROSSCOMPILING_EMULATOR` is properly set
|
||||
in order to function in a cross-compiling environment.
|
||||
|
||||
Additionally, setting properties on tests is somewhat less convenient, since
|
||||
the tests are not available at CMake time. Additional test properties may be
|
||||
assigned to the set of tests as a whole using the ``PROPERTIES`` option. If
|
||||
more fine-grained test control is needed, custom content may be provided
|
||||
through an external CTest script using the :prop_dir:`TEST_INCLUDE_FILES`
|
||||
directory property. The set of discovered tests is made accessible to such a
|
||||
script via the ``<target>_TESTS`` variable.
|
||||
|
||||
The options are:
|
||||
|
||||
``target``
|
||||
Specifies the doctest executable, which must be a known CMake executable
|
||||
target. CMake will substitute the location of the built executable when
|
||||
running the test.
|
||||
|
||||
``TEST_SPEC arg1...``
|
||||
Specifies test cases, wildcarded test cases, tags and tag expressions to
|
||||
pass to the doctest executable with the ``--list-test-cases`` argument.
|
||||
|
||||
``EXTRA_ARGS arg1...``
|
||||
Any extra arguments to pass on the command line to each test case.
|
||||
|
||||
``WORKING_DIRECTORY dir``
|
||||
Specifies the directory in which to run the discovered test cases. If this
|
||||
option is not provided, the current binary directory is used.
|
||||
|
||||
``TEST_PREFIX prefix``
|
||||
Specifies a ``prefix`` to be prepended to the name of each discovered test
|
||||
case. This can be useful when the same test executable is being used in
|
||||
multiple calls to ``doctest_discover_tests()`` but with different
|
||||
``TEST_SPEC`` or ``EXTRA_ARGS``.
|
||||
|
||||
``TEST_SUFFIX suffix``
|
||||
Similar to ``TEST_PREFIX`` except the ``suffix`` is appended to the name of
|
||||
every discovered test case. Both ``TEST_PREFIX`` and ``TEST_SUFFIX`` may
|
||||
be specified.
|
||||
|
||||
``PROPERTIES name1 value1...``
|
||||
Specifies additional properties to be set on all tests discovered by this
|
||||
invocation of ``doctest_discover_tests``.
|
||||
|
||||
``TEST_LIST var``
|
||||
Make the list of tests available in the variable ``var``, rather than the
|
||||
default ``<target>_TESTS``. This can be useful when the same test
|
||||
executable is being used in multiple calls to ``doctest_discover_tests()``.
|
||||
Note that this variable is only available in CTest.
|
||||
|
||||
#]=======================================================================]
|
||||
|
||||
#------------------------------------------------------------------------------
|
||||
function(doctest_discover_tests TARGET)
|
||||
cmake_parse_arguments(
|
||||
""
|
||||
""
|
||||
"TEST_PREFIX;TEST_SUFFIX;WORKING_DIRECTORY;TEST_LIST"
|
||||
"TEST_SPEC;EXTRA_ARGS;PROPERTIES"
|
||||
${ARGN}
|
||||
)
|
||||
|
||||
if(NOT _WORKING_DIRECTORY)
|
||||
set(_WORKING_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}")
|
||||
endif()
|
||||
if(NOT _TEST_LIST)
|
||||
set(_TEST_LIST ${TARGET}_TESTS)
|
||||
endif()
|
||||
|
||||
## Generate a unique name based on the extra arguments
|
||||
string(SHA1 args_hash "${_TEST_SPEC} ${_EXTRA_ARGS}")
|
||||
string(SUBSTRING ${args_hash} 0 7 args_hash)
|
||||
|
||||
# Define rule to generate test list for aforementioned test executable
|
||||
set(ctest_include_file "${CMAKE_CURRENT_BINARY_DIR}/${TARGET}_include-${args_hash}.cmake")
|
||||
set(ctest_tests_file "${CMAKE_CURRENT_BINARY_DIR}/${TARGET}_tests-${args_hash}.cmake")
|
||||
get_property(crosscompiling_emulator
|
||||
TARGET ${TARGET}
|
||||
PROPERTY CROSSCOMPILING_EMULATOR
|
||||
)
|
||||
add_custom_command(
|
||||
TARGET ${TARGET} POST_BUILD
|
||||
BYPRODUCTS "${ctest_tests_file}"
|
||||
COMMAND "${CMAKE_COMMAND}"
|
||||
-D "TEST_TARGET=${TARGET}"
|
||||
-D "TEST_EXECUTABLE=$<TARGET_FILE:${TARGET}>"
|
||||
-D "TEST_EXECUTOR=${crosscompiling_emulator}"
|
||||
-D "TEST_WORKING_DIR=${_WORKING_DIRECTORY}"
|
||||
-D "TEST_SPEC=${_TEST_SPEC}"
|
||||
-D "TEST_EXTRA_ARGS=${_EXTRA_ARGS}"
|
||||
-D "TEST_PROPERTIES=${_PROPERTIES}"
|
||||
-D "TEST_PREFIX=${_TEST_PREFIX}"
|
||||
-D "TEST_SUFFIX=${_TEST_SUFFIX}"
|
||||
-D "TEST_LIST=${_TEST_LIST}"
|
||||
-D "CTEST_FILE=${ctest_tests_file}"
|
||||
-P "${_DOCTEST_DISCOVER_TESTS_SCRIPT}"
|
||||
VERBATIM
|
||||
)
|
||||
|
||||
file(WRITE "${ctest_include_file}"
|
||||
"if(EXISTS \"${ctest_tests_file}\")\n"
|
||||
" include(\"${ctest_tests_file}\")\n"
|
||||
"else()\n"
|
||||
" add_test(${TARGET}_NOT_BUILT-${args_hash} ${TARGET}_NOT_BUILT-${args_hash})\n"
|
||||
"endif()\n"
|
||||
)
|
||||
|
||||
if(NOT CMAKE_VERSION VERSION_LESS 3.10)
|
||||
# Add discovered tests to directory TEST_INCLUDE_FILES
|
||||
set_property(DIRECTORY
|
||||
APPEND PROPERTY TEST_INCLUDE_FILES "${ctest_include_file}"
|
||||
)
|
||||
else()
|
||||
# Add discovered tests as directory TEST_INCLUDE_FILE if possible
|
||||
get_property(test_include_file_set DIRECTORY PROPERTY TEST_INCLUDE_FILE SET)
|
||||
if(NOT ${test_include_file_set})
|
||||
set_property(DIRECTORY
|
||||
PROPERTY TEST_INCLUDE_FILE "${ctest_include_file}"
|
||||
)
|
||||
else()
|
||||
message(FATAL_ERROR
|
||||
"Cannot set more than one TEST_INCLUDE_FILE"
|
||||
)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
endfunction()
|
||||
|
||||
###############################################################################
|
||||
|
||||
set(_DOCTEST_DISCOVER_TESTS_SCRIPT
|
||||
${CMAKE_CURRENT_LIST_DIR}/doctestAddTests.cmake
|
||||
)
|
81
cmake/doctestAddTests.cmake
Normal file
81
cmake/doctestAddTests.cmake
Normal file
@@ -0,0 +1,81 @@
|
||||
# Distributed under the OSI-approved BSD 3-Clause License. See accompanying
|
||||
# file Copyright.txt or https://cmake.org/licensing for details.
|
||||
|
||||
set(prefix "${TEST_PREFIX}")
|
||||
set(suffix "${TEST_SUFFIX}")
|
||||
set(spec ${TEST_SPEC})
|
||||
set(extra_args ${TEST_EXTRA_ARGS})
|
||||
set(properties ${TEST_PROPERTIES})
|
||||
set(script)
|
||||
set(suite)
|
||||
set(tests)
|
||||
|
||||
function(add_command NAME)
|
||||
set(_args "")
|
||||
foreach(_arg ${ARGN})
|
||||
if(_arg MATCHES "[^-./:a-zA-Z0-9_]")
|
||||
set(_args "${_args} [==[${_arg}]==]") # form a bracket_argument
|
||||
else()
|
||||
set(_args "${_args} ${_arg}")
|
||||
endif()
|
||||
endforeach()
|
||||
set(script "${script}${NAME}(${_args})\n" PARENT_SCOPE)
|
||||
endfunction()
|
||||
|
||||
# Run test executable to get list of available tests
|
||||
if(NOT EXISTS "${TEST_EXECUTABLE}")
|
||||
message(FATAL_ERROR
|
||||
"Specified test executable '${TEST_EXECUTABLE}' does not exist"
|
||||
)
|
||||
endif()
|
||||
|
||||
if("${spec}" MATCHES .)
|
||||
set(spec "--test-case=${spec}")
|
||||
endif()
|
||||
|
||||
execute_process(
|
||||
COMMAND ${TEST_EXECUTOR} "${TEST_EXECUTABLE}" ${spec} --list-test-cases
|
||||
OUTPUT_VARIABLE output
|
||||
RESULT_VARIABLE result
|
||||
)
|
||||
if(NOT ${result} EQUAL 0)
|
||||
message(FATAL_ERROR
|
||||
"Error running test executable '${TEST_EXECUTABLE}':\n"
|
||||
" Result: ${result}\n"
|
||||
" Output: ${output}\n"
|
||||
)
|
||||
endif()
|
||||
|
||||
string(REPLACE "\n" ";" output "${output}")
|
||||
|
||||
# Parse output
|
||||
foreach(line ${output})
|
||||
if("${line}" STREQUAL "===============================================================================" OR "${line}" MATCHES [==[^\[doctest\] ]==])
|
||||
continue()
|
||||
endif()
|
||||
set(test ${line})
|
||||
# use escape commas to handle properly test cases with commas inside the name
|
||||
string(REPLACE "," "\\," test_name ${test})
|
||||
# ...and add to script
|
||||
add_command(add_test
|
||||
"${prefix}${test}${suffix}"
|
||||
${TEST_EXECUTOR}
|
||||
"${TEST_EXECUTABLE}"
|
||||
"--test-case=${test_name}"
|
||||
${extra_args}
|
||||
)
|
||||
add_command(set_tests_properties
|
||||
"${prefix}${test}${suffix}"
|
||||
PROPERTIES
|
||||
WORKING_DIRECTORY "${TEST_WORKING_DIR}"
|
||||
${properties}
|
||||
)
|
||||
list(APPEND tests "${prefix}${test}${suffix}")
|
||||
endforeach()
|
||||
|
||||
# Create a list of all discovered tests, which users may use to e.g. set
|
||||
# properties on the tests
|
||||
add_command(set ${TEST_LIST} ${tests})
|
||||
|
||||
# Write CTest script
|
||||
file(WRITE "${CTEST_FILE}" "${script}")
|
33
data/appcast.xml
Normal file
33
data/appcast.xml
Normal file
@@ -0,0 +1,33 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<rss version="2.0" xmlns:sparkle="http://www.andymatuschak.org/xml-namespaces/sparkle">
|
||||
<channel>
|
||||
<item>
|
||||
<link>https://github.com/visualboyadvance-m/visualboyadvance-m/releases/download/v2.1.4/visualboyadvance-m-Win-64bit.zip</link>
|
||||
<enclosure
|
||||
sparkle:os="windows-x64"
|
||||
sparkle:version="2.1.4"
|
||||
length="0"
|
||||
type="application/octet-stream"
|
||||
/>
|
||||
</item>
|
||||
<item>
|
||||
<link>https://github.com/visualboyadvance-m/visualboyadvance-m/releases/download/v2.1.4/visualboyadvance-m-Win-32bit.zip</link>
|
||||
<enclosure
|
||||
sparkle:os="windows-x86"
|
||||
sparkle:version="2.1.4"
|
||||
length="0"
|
||||
type="application/octet-stream"
|
||||
/>
|
||||
</item>
|
||||
<item>
|
||||
<link>https://github.com/visualboyadvance-m/visualboyadvance-m/releases/download/v2.1.4/visualboyadvance-m-Mac-64bit.zip</link>
|
||||
<enclosure
|
||||
sparkle:os="macos"
|
||||
sparkle:version="2.1.4"
|
||||
length="0"
|
||||
type="application/octet-stream"
|
||||
/>
|
||||
</item>
|
||||
</channel>
|
||||
</rss>
|
||||
|
8
default.nix
Normal file
8
default.nix
Normal file
@@ -0,0 +1,8 @@
|
||||
with import <nixpkgs> {};
|
||||
stdenv.mkDerivation {
|
||||
name = "visualboyadvance-m";
|
||||
buildInputs = if stdenv.isDarwin then
|
||||
[ ninja cmake gcc nasm gettext pkg-config zip sfml zlib openal ffmpeg wxGTK32 SDL2 pcre pcre2 darwin.apple_sdk.frameworks.IOKit darwin.apple_sdk.frameworks.Carbon darwin.apple_sdk.frameworks.Cocoa darwin.apple_sdk.frameworks.QuartzCore darwin.apple_sdk.frameworks.AudioToolbox darwin.apple_sdk.frameworks.OpenGL darwin.apple_sdk.frameworks.OpenAL llvmPackages_latest.clang llvmPackages_latest.bintools ]
|
||||
else
|
||||
[ ninja cmake gcc nasm gettext pkg-config zip sfml zlib openal ffmpeg wxGTK32 mesa glfw SDL2 gtk3-x11 pcre pcre2 util-linuxMinimal libselinux libsepol libthai libdatrie xorg.libXdmcp xorg.libXtst libxkbcommon epoxy dbus at-spi2-core ];
|
||||
}
|
Submodule dependencies updated: fe50718d0e...e8ce758a98
@@ -8,9 +8,8 @@ Known preprocessor switches:
|
||||
- SDL: Defined for the SDL version
|
||||
- GBA_LOGGING: Enables logging for the GBA core
|
||||
- FINAL_VERSION: Defined for release versions, disables additional GBA logging and completely disables GB logging. Increases the amount of CPU cycles being emulated in one go.
|
||||
- BKPT_SUPPORT
|
||||
- VBAM_ENABLE_DEBUGGER: Enable remote debugging support
|
||||
- MMX: Enable MMX instruction set
|
||||
- NO_ASM: Use C++ version of hq3x/4x filters
|
||||
- RGB555: Use 16bit colors with 5bit green instead of 6bit green in hq3x/4x filters (C++ version)
|
||||
- NO_OGL: Exclude OpenGL code
|
||||
- NO_D3D: Exclude Direct3D code
|
||||
|
@@ -9,7 +9,7 @@
|
||||
|
||||
VisualBoyAdvance-M
|
||||
Nintendo Game Boy & Game Boy Advance Emulator
|
||||
Project Homepage: http://vba-m.com
|
||||
Project Homepage: http://visualboyadvance-m.org
|
||||
|
||||
This program is distributed under the GNU General Public License
|
||||
http://www.gnu.org/licenses/gpl.html
|
||||
|
@@ -1,46 +0,0 @@
|
||||
#Do not use this file directly. Always use the top level CMakeLists.txt file
|
||||
#File extractors so the user doesn't have to extract the rom before playing it
|
||||
|
||||
# Source files definition
|
||||
SET(SRC_FEX
|
||||
7z_C/7zAlloc.c
|
||||
7z_C/7zBuf.c
|
||||
7z_C/7zCrc.c
|
||||
7z_C/7zCrcOpt.c
|
||||
7z_C/7zDec.c
|
||||
7z_C/7zIn.c
|
||||
7z_C/7zStream.c
|
||||
7z_C/Bcj2.c
|
||||
7z_C/Bra86.c
|
||||
7z_C/Bra.c
|
||||
7z_C/CpuArch.c
|
||||
7z_C/Lzma2Dec.c
|
||||
7z_C/LzmaDec.c
|
||||
7z_C/Ppmd7.c
|
||||
7z_C/Ppmd7Dec.c
|
||||
fex/Binary_Extractor.cpp
|
||||
fex/blargg_common.cpp
|
||||
fex/blargg_errors.cpp
|
||||
fex/Data_Reader.cpp
|
||||
fex/fex.cpp
|
||||
fex/File_Extractor.cpp
|
||||
fex/Gzip_Extractor.cpp
|
||||
fex/Gzip_Reader.cpp
|
||||
fex/Rar_Extractor.cpp
|
||||
fex/Zip7_Extractor.cpp
|
||||
fex/Zip_Extractor.cpp
|
||||
fex/Zlib_Inflater.cpp
|
||||
)
|
||||
|
||||
INCLUDE_DIRECTORIES(
|
||||
.
|
||||
${ZLIB_INCLUDE_DIRS}
|
||||
)
|
||||
|
||||
ADD_LIBRARY(
|
||||
fex
|
||||
STATIC
|
||||
${SRC_FEX}
|
||||
)
|
||||
|
||||
add_dependencies(fex generate)
|
511
installdeps
511
installdeps
@@ -1,14 +1,14 @@
|
||||
#!/bin/sh
|
||||
|
||||
CMAKE=cmake
|
||||
ENABLE_OPENAL=1
|
||||
ENABLE_FFMPEG=1
|
||||
|
||||
main() {
|
||||
cd "$(dirname $0)"
|
||||
|
||||
check_command_line_args "$@"
|
||||
|
||||
target=$1
|
||||
|
||||
mktmp
|
||||
|
||||
check_os
|
||||
@@ -25,7 +25,16 @@ check_command_line_args() {
|
||||
usage
|
||||
quit 0
|
||||
;;
|
||||
--no-openal)
|
||||
ENABLE_OPENAL=
|
||||
shift
|
||||
;;
|
||||
--no-ffmpeg)
|
||||
ENABLE_FFMPEG=
|
||||
shift
|
||||
;;
|
||||
*)
|
||||
target=$1
|
||||
break
|
||||
;;
|
||||
esac
|
||||
@@ -72,32 +81,28 @@ quit() {
|
||||
usage() {
|
||||
cat <<'EOF'
|
||||
Usage: [32m./installdeps [1;35m[TARGET][0m
|
||||
Try to install the dependencies needed for this project appropriately on the
|
||||
host OS.
|
||||
|
||||
Try to install the dependencies needed for this project appropriately on the host OS.
|
||||
|
||||
This program may require [1;35msudo[0m.
|
||||
|
||||
A cross-compile target may be specified as the only parameter, of either
|
||||
[1;35mm32[0m which targets the host in 32 bit mode (e.g. x86 on an amd64
|
||||
host) or [1;35mwin32[0m, [1;35mMinGW-w64-i686[0m or
|
||||
[1;35mMinGW-w64-x86_64[0m. [1;35mwin32[0m is an alias for
|
||||
[1;35mMinGW-w64-i686[0m to target Windows via MinGW. Cross compiling for
|
||||
Windows is only supported on Debian/Ubuntu, Fedora, Arch Linux and MSYS2.
|
||||
A cross-compile target may be specified as the only parameter, of either [1;35mm32[0m which targets the host in 32 bit mode (e.g. x86 on an amd64 host) or [1;35mwin32[0m, [1;35mMinGW-w64-i686[0m or [1;35mMinGW-w64-x86_64[0m. [1;35mwin32[0m is an alias for [1;35mMinGW-w64-i686[0m to target Windows via MinGW. Cross compiling for Windows is only supported on Debian/Ubuntu, Fedora, Arch Linux and MSYS2.
|
||||
|
||||
On MSYS2 dependencies are installed for 32 or 64 bit native Windows targets
|
||||
based on which shell you started (the value of $MSYSTEM) unless you specify one
|
||||
or the other. You can specify a cross target of [1;35mm32[0m or
|
||||
[1;35mm64[0m as aliases for the 32 bit or 64 bit targets respectively.
|
||||
MSYS2 POSIX layer builds are not supported.
|
||||
On MSYS2 the [1;35mMinGW-w64-clang-x86_64[0m target for CLANG64 and the [1;35mMinGW-w64-clang-i686[0m target for CLANG32 are also supported, as well as [1;35mMinGW-w64-ucrt-x86_64[0m for UCRT64.
|
||||
|
||||
On MSYS2 dependencies are installed for 32 or 64 bit native Windows targets based on which shell you started (the value of $MSYSTEM) unless you specify one or the other. You can specify a cross target of [1;35mm32[0m or [1;35mm64[0m as aliases for the 32 bit or 64 bit MinGW gcc targets respectively. MSYS2 POSIX layer builds are not supported.
|
||||
|
||||
[1m-h, --help, --usage[0m Show this help screen and exit.
|
||||
[1m--no-openal[0m Do not install OpenAL dependencies.
|
||||
[1m--no-ffmpeg[0m Do not install ffmpeg dependencies.
|
||||
|
||||
Examples:
|
||||
[32m./installdeps[0m # install dependencies for a host build
|
||||
[32m./installdeps [1;35mm32[0m # make a 32 bit binary for the host OS
|
||||
[32m./installdeps [1;35mwin32[0m # cross-compile for 32 bit windows (Debian/Ubuntu, Arch Linux or MSYS2)
|
||||
[32m./installdeps [1;35mMinGW-w64-i686[0m # likewise
|
||||
[32m./installdeps [1;35mMinGW-w64-x86_64[0m # cross-compile for 64 bit windows (Debian/Ubuntu, Arch Linux or MSYS2)
|
||||
[32m./installdeps [1;35mwin64[0m # cross-compile for 64 bit windows (Debian/Ubuntu, Arch Linux or MSYS2)
|
||||
[32m./installdeps [1;35mMinGW-w64-x86_64[0m # likewise
|
||||
EOF
|
||||
}
|
||||
|
||||
@@ -160,17 +165,26 @@ linux_installdeps() {
|
||||
fedora_installdeps
|
||||
elif [ -f /etc/redhat-release ] || [ -f /etc/centos-release ]; then
|
||||
rhel_installdeps
|
||||
elif [ -f /etc/arch-release ]; then
|
||||
archlinux_installdeps
|
||||
elif [ -f /etc/solus-release ]; then
|
||||
solus_installdeps
|
||||
elif [ -f /etc/gentoo-release ]; then
|
||||
gentoo_installdeps
|
||||
elif [ -x /usr/bin/pacman ]; then
|
||||
archlinux_installdeps
|
||||
elif [ -f /etc/os-release ]; then
|
||||
case "$(. /etc/os-release; echo "$ID_LIKE")" in
|
||||
case "$(. /etc/os-release; echo "${ID_LIKE:-$ID}")" in
|
||||
*suse*)
|
||||
suse_installdeps
|
||||
;;
|
||||
nixos)
|
||||
nixos_installdeps
|
||||
;;
|
||||
alpine)
|
||||
alpine_installdeps
|
||||
;;
|
||||
*)
|
||||
error "Don't know how to install deps on your version of Linux"
|
||||
;;
|
||||
esac
|
||||
else
|
||||
error "Don't know how to install deps on your version of Linux"
|
||||
@@ -182,8 +196,12 @@ freebsd_installdeps() {
|
||||
|
||||
check sudo pkg update
|
||||
|
||||
pkgs="llvm-devel cmake ccache nasm ffmpeg gettext-tools gettext pkgconf sdl2 sfml wx31-gtk3 iconv zip ninja"
|
||||
|
||||
[ -n "$ENABLE_FFMPEG" ] && pkgs="$pkgs ffmpeg"
|
||||
|
||||
# currently the wx30 and wx31 packages produce GTK errors on CURRENT (as of 04/2019)
|
||||
check sudo pkg install -y llvm-devel cmake ccache nasm ffmpeg gettext-tools gettext png pkgconf sdl2 sfml wx31-gtk3 iconv zip ninja
|
||||
check sudo pkg install -y $pkgs
|
||||
|
||||
build_instructions
|
||||
}
|
||||
@@ -232,6 +250,15 @@ check_cross() {
|
||||
MINGW64)
|
||||
target='mingw-w64-x86_64'
|
||||
;;
|
||||
CLANG32)
|
||||
target='mingw-w64-clang-i686'
|
||||
;;
|
||||
CLANG64)
|
||||
target='mingw-w64-clang-x86_64'
|
||||
;;
|
||||
UCRT64)
|
||||
target='mingw-w64-ucrt-x86_64'
|
||||
;;
|
||||
MSYS)
|
||||
error 'host builds in MSYS mode are not supported, supply a target or start a MINGW shell'
|
||||
;;
|
||||
@@ -245,7 +272,7 @@ check_cross() {
|
||||
fi
|
||||
|
||||
case "$target" in
|
||||
win32|mingw*)
|
||||
win32|win64|mingw*)
|
||||
if [ -z "$arch_linux" -a -z "$msys2" -a -z "$debian" -a -z "$fedora" ]; then
|
||||
error 'win32 cross compiling targets are only supported on Debian/Ubuntu, Fedora, Arch and MSYS2 at the moment'
|
||||
fi
|
||||
@@ -254,17 +281,15 @@ check_cross() {
|
||||
win32)
|
||||
target='mingw-w64-i686'
|
||||
;;
|
||||
mingw-w64-i686)
|
||||
win64)
|
||||
target='mingw-w64-x86_64'
|
||||
;;
|
||||
mingw-w64-x86_64)
|
||||
mingw-w64-x86_64|mingw-w64-i686|mingw-w64-clang-x86_64|mingw-w64-ucrt-x86_64|mingw-w64-clang-i686)
|
||||
;;
|
||||
*)
|
||||
error "target must be one of 'm32', 'win32', 'MinGW-w64-i686' or 'MinGW-w64-x86_64'"
|
||||
error "target must be one of 'm32', 'win32', 'win64', or one of the MinGW/clang/ucrt targets supported by MSYS2: mingw-w64-[clang|ucrt]-(x86_64|i686)."
|
||||
;;
|
||||
esac
|
||||
|
||||
# get the necessary win32 headers
|
||||
check git submodule update --remote --recursive
|
||||
;;
|
||||
m32|-m32)
|
||||
target=m32
|
||||
@@ -298,14 +323,44 @@ debian_installdeps() {
|
||||
if [ -z "$target" ]; then
|
||||
sudo apt-get -qq -y update
|
||||
|
||||
sfml_libs=$(apt-cache search libsfml | grep -E 'graphics|window|network' | sed 's/ - .*//')
|
||||
sfml_libs=
|
||||
|
||||
glew_lib=$(apt-cache search libglew | grep '^libglew[0-9]' | sed 's/ - .*//')
|
||||
for lib in graphics window network; do
|
||||
sfml_libs="$sfml_libs $(apt-cache search "libsfml-$lib" | sed 's/ - .*//' | sort -r | head -1)"
|
||||
done
|
||||
|
||||
glew_lib=$(apt-cache search libglew | grep '^libglew[0-9]' | sed 's/ - .*//' | sort -r | head -1)
|
||||
|
||||
sdl_lib=$(apt-cache search '^libsdl2-2.0' | sed 's/ - .*//' | sort -r | head -1)
|
||||
|
||||
# not present in trusty
|
||||
libswresample_dev=$(apt-cache search libswresample-dev | awk '{print $1}')
|
||||
if [ -n "$ENABLE_FFMPEG" ]; then
|
||||
libswresample_dev=$(apt-cache search libswresample-dev | awk '{print $1}')
|
||||
fi
|
||||
|
||||
check sudo apt-get -qy install build-essential g++ nasm cmake ccache gettext zlib1g-dev libgl1-mesa-dev libavcodec-dev libavformat-dev libswscale-dev libavutil-dev $libswresample_dev libgettextpo-dev libpng-dev libsdl2-dev libsdl2-2.0 libglu1-mesa-dev libglu1-mesa libgles2-mesa-dev libsfml-dev $sfml_libs $glew_lib libopenal-dev libwxgtk3.0-dev libwxgtk3.0 libgtk2.0-dev libgtk-3-dev ccache zip
|
||||
wx_libs=$(apt-cache search 'libwxgtk[0-9]' | sed 's/ - .*//')
|
||||
|
||||
# Use -gtk3 variant on older distros.
|
||||
case "$wx_libs" in
|
||||
*-gtk3*)
|
||||
new_wx_libs=
|
||||
for pkg in $wx_libs; do
|
||||
case "$pkg" in
|
||||
*-gtk3*)
|
||||
new_wx_libs="$new_wx_libs $pkg"
|
||||
;;
|
||||
esac
|
||||
done
|
||||
wx_libs=$new_wx_libs
|
||||
;;
|
||||
esac
|
||||
|
||||
pkgs="build-essential g++ nasm cmake ccache gettext zlib1g-dev libgl1-mesa-dev libgettextpo-dev libsdl2-dev $sdl_lib libglu1-mesa-dev libglu1-mesa libgles2-mesa-dev libsfml-dev $sfml_libs $glew_lib $wx_libs libgtk2.0-dev libgtk-3-dev ccache zip ninja-build"
|
||||
|
||||
[ -n "$ENABLE_OPENAL" ] && pkgs="$pkgs libopenal-dev"
|
||||
[ -n "$ENABLE_FFMPEG" ] && pkgs="$pkgs libavcodec-dev libavformat-dev libswscale-dev libavutil-dev $libswresample_dev"
|
||||
|
||||
check sudo apt-get -qy install $pkgs
|
||||
else
|
||||
case "$target" in
|
||||
mingw-w64-i686)
|
||||
@@ -321,7 +376,24 @@ debian_installdeps() {
|
||||
;;
|
||||
esac
|
||||
|
||||
debian_rel=trusty
|
||||
pre_build='export PATH="$PATH:/usr/lib/mxe/usr/bin"'
|
||||
|
||||
debian_rel=$(lsb_release -a 2>/dev/null | sed -En 's/^Codename:[[:space:]]*//p')
|
||||
|
||||
case "$debian_rel" in
|
||||
bionic|stretch|trusty|xenial)
|
||||
;;
|
||||
yakkety|zesty|artful)
|
||||
debian_rel=xenial
|
||||
;;
|
||||
utopic|vivid|wily)
|
||||
debian_rel=trusty
|
||||
;;
|
||||
*)
|
||||
debian_rel=bionic
|
||||
;;
|
||||
esac
|
||||
|
||||
mxe_apt_sources=/etc/apt/sources.list.d/mxeapt.list
|
||||
|
||||
sudo apt-get -qq -y update
|
||||
@@ -335,13 +407,29 @@ debian_installdeps() {
|
||||
fi
|
||||
fi
|
||||
|
||||
deps="gcc zlib ffmpeg gettext sdl2 sfml openal wxwidgets"
|
||||
[ -n "$ENABLE_OPENAL" ] && deps="$deps openal"
|
||||
[ -n "$ENABLE_FFMPEG" ] && deps="$deps ffmpeg"
|
||||
|
||||
set --
|
||||
for dep in gcc zlib ffmpeg gettext sdl2 sfml openal wxwidgets; do
|
||||
for dep in $deps; do
|
||||
set -- "$@" "mxe-${target}-$dep"
|
||||
done
|
||||
check sudo apt-get --allow-unauthenticated -qq -y update
|
||||
# native wx-common needed for wxrc executable
|
||||
check sudo apt-get --allow-unauthenticated -qy install build-essential cmake ccache wx-common "$@"
|
||||
|
||||
# Native wx-common needed for wxrc executable.
|
||||
check sudo apt-get --allow-unauthenticated -qy install build-essential cmake ninja-build ccache wx-common git "$@"
|
||||
|
||||
# The ccache symlink is broken in some versions of these mxe packages.
|
||||
ccache_link=/usr/lib/mxe/.ccache/bin/ccache
|
||||
|
||||
if [ ! -e "$ccache_link" ]; then
|
||||
sudo mkdir -p ${ccache_link%/*}
|
||||
sudo ln -sf /usr/bin/ccache "$ccache_link"
|
||||
fi
|
||||
|
||||
# get the necessary win32 headers
|
||||
git submodule update --init --remote --recursive
|
||||
fi
|
||||
|
||||
build_instructions
|
||||
@@ -350,7 +438,6 @@ debian_installdeps() {
|
||||
fedora_installdeps() {
|
||||
fedora=1
|
||||
ffmpeg=ffmpeg-devel
|
||||
no_ffmpeg=
|
||||
rpms_installed=
|
||||
|
||||
check_cross
|
||||
@@ -358,41 +445,43 @@ fedora_installdeps() {
|
||||
|
||||
warning=
|
||||
|
||||
# using --nogpgcheck with dnf because keys can be a problem on rawhide
|
||||
if [ -n "$ENABLE_FFMPEG" ]; then
|
||||
# using --nogpgcheck with dnf because keys can be a problem on rawhide
|
||||
|
||||
fedora_release=$(rpm -E %fedora)
|
||||
tries=3
|
||||
curdir=$(pwd)
|
||||
fedora_release=$(rpm -E %fedora)
|
||||
tries=3
|
||||
curdir=$(pwd)
|
||||
|
||||
# make sure rpmfusion is installed for ffmpeg
|
||||
while [ $tries -gt 0 ]; do
|
||||
mkdir -p "${tmp}/fusion"
|
||||
cd "${tmp}/fusion"
|
||||
if ! curl -fLO https://download1.rpmfusion.org/free/fedora/rpmfusion-free-release-${fedora_release}.noarch.rpm; then
|
||||
fedora_release=$((fedora_release - 1))
|
||||
tries=$((tries - 1))
|
||||
continue
|
||||
fi
|
||||
if ! curl -fLO https://download1.rpmfusion.org/nonfree/fedora/rpmfusion-nonfree-release-${fedora_release}.noarch.rpm; then
|
||||
tries=0
|
||||
# make sure rpmfusion is installed for ffmpeg
|
||||
while [ $tries -gt 0 ]; do
|
||||
mkdir -p "${tmp}/fusion"
|
||||
cd "${tmp}/fusion"
|
||||
if ! curl -fLO https://download1.rpmfusion.org/free/fedora/rpmfusion-free-release-${fedora_release}.noarch.rpm; then
|
||||
fedora_release=$((fedora_release - 1))
|
||||
tries=$((tries - 1))
|
||||
continue
|
||||
fi
|
||||
if ! curl -fLO https://download1.rpmfusion.org/nonfree/fedora/rpmfusion-nonfree-release-${fedora_release}.noarch.rpm; then
|
||||
tries=0
|
||||
break
|
||||
fi
|
||||
# check if already installed
|
||||
if rpm -q rpmfusion-free-release-${fedora_release} >/dev/null 2>&1 && rpm -q rpmfusion-nonfree-release-${fedora_release} >/dev/null 2>&1; then
|
||||
info_msg 'rpmfusion already installed, good'
|
||||
break
|
||||
fi
|
||||
# otherwise try to install
|
||||
if ! sudo rpm --nodeps -Uvh ./rpmfusion-*.rpm; then
|
||||
tries=0
|
||||
break
|
||||
fi
|
||||
break
|
||||
done
|
||||
cd "$curdir"
|
||||
if [ $tries -eq 0 ]; then
|
||||
warning 'installing rpmfusion repos failed, continuing without ffmpeg'
|
||||
no_ffmpeg=1
|
||||
fi
|
||||
# check if already installed
|
||||
if rpm -q rpmfusion-free-release-${fedora_release} >/dev/null 2>&1 && rpm -q rpmfusion-nonfree-release-${fedora_release} >/dev/null 2>&1; then
|
||||
info_msg 'rpmfusion already installed, good'
|
||||
break
|
||||
fi
|
||||
# otherwise try to install
|
||||
if ! sudo rpm --nodeps -Uvh ./rpmfusion-*.rpm; then
|
||||
tries=0
|
||||
break
|
||||
fi
|
||||
break
|
||||
done
|
||||
cd "$curdir"
|
||||
if [ $tries -eq 0 ]; then
|
||||
warning 'installing rpmfusion repos failed, continuing without ffmpeg'
|
||||
no_ffmpeg=1
|
||||
fi
|
||||
|
||||
# non-multiarch packages first
|
||||
@@ -416,22 +505,33 @@ fedora_installdeps() {
|
||||
# this is sometimes necessary for rawhide
|
||||
set -- --exclude='glibc32*'
|
||||
fi
|
||||
for pkg in zlib-devel mesa-libGL-devel ffmpeg-devel gettext-devel libpng-devel SDL2-devel SFML-devel openal-soft-devel wxGTK3-devel gtk3-devel; do
|
||||
for pkg in zlib-devel mesa-libGL-devel ffmpeg-devel gettext-devel SDL2-devel SFML-devel openal-soft-devel wxGTK-devel gtk3-devel; do
|
||||
case $pkg in
|
||||
*ffmpeg*)
|
||||
[ -n "$no_ffmpeg" ] && continue
|
||||
[ -z "$ENABLE_FFMPEG" ] && continue
|
||||
;;
|
||||
*openal*)
|
||||
[ -z "$ENABLE_OPENAL" ] && continue
|
||||
;;
|
||||
esac
|
||||
|
||||
pkg_arch=
|
||||
if [ -n "$amd64" ]; then
|
||||
pkg_arch=.x86_64
|
||||
|
||||
if [ "$target" = m32 ]; then
|
||||
set -- "$@" "${pkg}.i686"
|
||||
else
|
||||
set -- "$@" "${pkg}.x86_64"
|
||||
pkg_arch=.i686
|
||||
fi
|
||||
else
|
||||
set -- "$@" "$pkg"
|
||||
fi
|
||||
|
||||
# Check which is newer, wxGTK or wxGTK3.
|
||||
if [ "$pkg" = wxGTK-devel ]; then
|
||||
pkg=$(dnf -q --releasever=$(rpm -E %fedora) --showduplicates list wxGTK-devel wxGTK3-devel 2>/dev/null | awk '{ print $1 "\t" $2 }' | grep -Ev '^(Installed|Available)' | sort -rVu -k 2,2 | head -1 | awk '{ print $1 }' | sed -E 's/\.[^.]+//')
|
||||
|
||||
[ -z "$pkg" ] && pkg=wxGTK3-devel
|
||||
fi
|
||||
|
||||
set -- "$@" "${pkg}${pkg_arch}"
|
||||
done
|
||||
|
||||
# fedora has a bug where all necessary -devel packages are not pulled in for 32 bit direct -devel deps
|
||||
@@ -490,31 +590,36 @@ fedora_installdeps() {
|
||||
case "$target" in
|
||||
mingw-w64-i686)
|
||||
target=mingw32
|
||||
cmake_flags="$cmake_flags -DCMAKE_TOOLCHAIN_FILE=../cmake/Toolchain-cross-MinGW-w64-i686.cmake"
|
||||
cmake_flags="$cmake_flags -DCMAKE_TOOLCHAIN_FILE=../cmake/Toolchain-cross-MinGW-w64-i686-static.cmake"
|
||||
;;
|
||||
mingw-w64-x86_64)
|
||||
target=mingw64
|
||||
cmake_flags="$cmake_flags -DCMAKE_TOOLCHAIN_FILE=../cmake/Toolchain-cross-MinGW-w64-x86_64.cmake"
|
||||
cmake_flags="$cmake_flags -DCMAKE_TOOLCHAIN_FILE=../cmake/Toolchain-cross-MinGW-w64-x86_64-static.cmake"
|
||||
;;
|
||||
*)
|
||||
error 'unknown cross target (this should not happen)'
|
||||
;;
|
||||
esac
|
||||
# install static deps
|
||||
for pkg in zlib gettext libpng SDL2 wxWidgets; do
|
||||
for pkg in zlib gettext SDL2 wxWidgets3; do
|
||||
set -- "$@" "${target}-${pkg}-static"
|
||||
done
|
||||
# install deps that are not available as static
|
||||
for pkg in openal-soft; do
|
||||
set -- "$@" "${target}-${pkg}"
|
||||
done
|
||||
if [ -n "$ENABLE_OPENAL" ]; then
|
||||
for pkg in openal-soft; do
|
||||
set -- "$@" "${target}-${pkg}"
|
||||
done
|
||||
fi
|
||||
|
||||
# get the necessary win32 headers
|
||||
git submodule update --init --remote --recursive
|
||||
|
||||
warning='SFML is required for LINK support, Fedora does not currently have a MinGW SFML package, if you want LINK support you will need to install it manually'
|
||||
fi
|
||||
|
||||
[ -z "$rpms_installed" ] && check sudo dnf -y --nogpgcheck --best --allowerasing install "$@"
|
||||
|
||||
if ! rpm -q $ffmpeg >/dev/null 2>&1; then
|
||||
if [ -n "$ENABLE_FFMPEG" ] && ! rpm -q $ffmpeg >/dev/null 2>&1; then
|
||||
warning 'ffmpeg failed to install (probably due to conflicts)'
|
||||
fi
|
||||
|
||||
@@ -526,7 +631,6 @@ fedora_installdeps() {
|
||||
rhel_installdeps() {
|
||||
rhel=1
|
||||
ffmpeg=ffmpeg-devel
|
||||
no_ffmpeg=
|
||||
rpms_installed=
|
||||
|
||||
check_cross
|
||||
@@ -542,34 +646,35 @@ rhel_installdeps() {
|
||||
check sudo yum -y install epel-release
|
||||
|
||||
# make sure rpmfusion is installed for ffmpeg
|
||||
while [ $tries -gt 0 ]; do
|
||||
mkdir -p "${tmp}/fusion"
|
||||
cd "${tmp}/fusion"
|
||||
if ! curl -fLO https://download1.rpmfusion.org/free/el/rpmfusion-free-release-${rhel_release}.noarch.rpm; then
|
||||
rhel_release=$((rhel_release - 1))
|
||||
tries=$((tries - 1))
|
||||
continue
|
||||
fi
|
||||
if ! curl -fLO https://download1.rpmfusion.org/nonfree/el/rpmfusion-nonfree-release-${rhel_release}.noarch.rpm; then
|
||||
tries=0
|
||||
if [ -n "$ENABLE_FFMPEG" ]; then
|
||||
while [ $tries -gt 0 ]; do
|
||||
mkdir -p "${tmp}/fusion"
|
||||
cd "${tmp}/fusion"
|
||||
if ! curl -fLO https://download1.rpmfusion.org/free/el/rpmfusion-free-release-${rhel_release}.noarch.rpm; then
|
||||
rhel_release=$((rhel_release - 1))
|
||||
tries=$((tries - 1))
|
||||
continue
|
||||
fi
|
||||
if ! curl -fLO https://download1.rpmfusion.org/nonfree/el/rpmfusion-nonfree-release-${rhel_release}.noarch.rpm; then
|
||||
tries=0
|
||||
break
|
||||
fi
|
||||
# check if already installed
|
||||
if rpm -q rpmfusion-free-release-${rhel_release} >/dev/null 2>&1 && rpm -q rpmfusion-nonfree-release-${rhel_release} >/dev/null 2>&1; then
|
||||
info_msg 'rpmfusion already installed, good'
|
||||
break
|
||||
fi
|
||||
# otherwise try to install
|
||||
if ! sudo rpm --nodeps -Uvh ./rpmfusion-*.rpm; then
|
||||
tries=0
|
||||
break
|
||||
fi
|
||||
break
|
||||
done
|
||||
cd "$curdir"
|
||||
if [ $tries -eq 0 ]; then
|
||||
warning 'installing rpmfusion repos failed, continuing without ffmpeg'
|
||||
fi
|
||||
# check if already installed
|
||||
if rpm -q rpmfusion-free-release-${rhel_release} >/dev/null 2>&1 && rpm -q rpmfusion-nonfree-release-${rhel_release} >/dev/null 2>&1; then
|
||||
info_msg 'rpmfusion already installed, good'
|
||||
break
|
||||
fi
|
||||
# otherwise try to install
|
||||
if ! sudo rpm --nodeps -Uvh ./rpmfusion-*.rpm; then
|
||||
tries=0
|
||||
break
|
||||
fi
|
||||
break
|
||||
done
|
||||
cd "$curdir"
|
||||
if [ $tries -eq 0 ]; then
|
||||
warning 'installing rpmfusion repos failed, continuing without ffmpeg'
|
||||
no_ffmpeg=1
|
||||
fi
|
||||
|
||||
# non-multiarch packages first
|
||||
@@ -597,10 +702,13 @@ rhel_installdeps() {
|
||||
|
||||
warning='RHEL does not currently have SFML packages, LINK support will be disabled'
|
||||
|
||||
for pkg in zlib-devel mesa-libGL-devel ffmpeg-devel gettext-devel libpng-devel SDL2-devel openal-soft-devel wxGTK3-devel gtk3-devel; do
|
||||
for pkg in zlib-devel mesa-libGL-devel ffmpeg-devel gettext-devel SDL2-devel openal-soft-devel wxGTK3-devel gtk3-devel; do
|
||||
case $pkg in
|
||||
*ffmpeg*)
|
||||
[ -n "$no_ffmpeg" ] && continue
|
||||
[ -z "$ENABLE_FFMPEG" ] && continue
|
||||
;;
|
||||
*openal*)
|
||||
[ -z "$ENABLE_OPENAL" ] && continue
|
||||
;;
|
||||
esac
|
||||
|
||||
@@ -682,20 +790,25 @@ rhel_installdeps() {
|
||||
;;
|
||||
esac
|
||||
# install static deps
|
||||
for pkg in zlib gettext libpng SDL2 wxWidgets; do
|
||||
for pkg in zlib gettext SDL2 wxWidgets; do
|
||||
set -- "$@" "${target}-${pkg}-static"
|
||||
done
|
||||
# install deps that are not available as static
|
||||
for pkg in openal-soft; do
|
||||
set -- "$@" "${target}-${pkg}"
|
||||
done
|
||||
if [ -n "$ENABLE_OPENAL" ]; then
|
||||
for pkg in openal-soft; do
|
||||
set -- "$@" "${target}-${pkg}"
|
||||
done
|
||||
fi
|
||||
|
||||
# get the necessary win32 headers
|
||||
git submodule update --init --remote --recursive
|
||||
|
||||
warning='SFML is required for LINK support, RHEL/EPEL does not currently have a MinGW SFML package, if you want LINK support you will need to install it manually'
|
||||
fi
|
||||
|
||||
[ -z "$rpms_installed" ] && check sudo yum -y install "$@"
|
||||
|
||||
if ! rpm -q $ffmpeg >/dev/null 2>&1; then
|
||||
if [ -n "$ENABLE_FFMPEG" ] && ! rpm -q $ffmpeg >/dev/null 2>&1; then
|
||||
warning 'ffmpeg failed to install (probably due to conflicts)'
|
||||
fi
|
||||
|
||||
@@ -709,13 +822,11 @@ suse_installdeps() {
|
||||
check_cross
|
||||
installing
|
||||
|
||||
tools="\
|
||||
make cmake ccache nasm gettext-tools pkg-config ccache zip sfml2-devel\
|
||||
" # ffmpeg-devel
|
||||
tools="make cmake ccache nasm gettext-tools pkg-config ccache zip sfml2-devel ninja"
|
||||
|
||||
libs="\
|
||||
gcc gcc-c++ libpng16-devel libSDL2-devel openal-soft-devel wxWidgets-3_0-devel\
|
||||
" # ffmpeg-devel
|
||||
libs="gcc gcc-c++ libSDL2-devel wxWidgets-3_0-devel" # ffmpeg-devel
|
||||
|
||||
[ -n "$ENABLE_OPENAL" ] && libs="$libs openal-soft-devel"
|
||||
# ffmpeg requires packman repos
|
||||
|
||||
if [ "$target" = m32 ]; then
|
||||
@@ -727,6 +838,18 @@ gcc gcc-c++ libpng16-devel libSDL2-devel openal-soft-devel wxWidgets-3_0-devel\
|
||||
build_instructions
|
||||
}
|
||||
|
||||
nixos_installdeps() {
|
||||
nixos=1
|
||||
|
||||
cat <<EOF
|
||||
|
||||
[32mTo build run:[0m
|
||||
|
||||
nix-shell --command 'mkdir build; cd build; $CMAKE .. $cmake_flags -G Ninja; ninja'
|
||||
|
||||
EOF
|
||||
}
|
||||
|
||||
archlinux_require_yaourt() {
|
||||
if ! command -v yaourt >/dev/null; then
|
||||
(
|
||||
@@ -765,18 +888,26 @@ archlinux_installdeps() {
|
||||
|
||||
# common needed dev packages
|
||||
# not using the base-devel group because it can break gcc-multilib
|
||||
check $pacman --noconfirm --needed -S binutils file grep gawk gzip libtool make patch sed util-linux nasm cmake ccache pkg-config git ccache zip
|
||||
check $pacman --noconfirm --needed -S binutils file grep gawk gzip libtool make patch sed util-linux nasm cmake ccache pkg-config git ccache zip ninja
|
||||
|
||||
gtk=gtk3
|
||||
|
||||
$pacman -Q gtk3-classic >/dev/null 2>&1 && gtk=gtk3-classic
|
||||
|
||||
libs="zlib mesa gettext libpng sdl2 openal wxgtk3 $gtk sfml ffmpeg"
|
||||
libs="zlib mesa gettext sdl2 wxgtk3 $gtk sfml"
|
||||
|
||||
[ -n "$ENABLE_OPENAL" ] && libs="$libs openal"
|
||||
[ -n "$ENABLE_FFMPEG" ] && libs="$libs ffmpeg"
|
||||
|
||||
if [ -z "$target" -o "$target" = m32 ]; then
|
||||
if [ -z "$target" -o -z "$amd64" ]; then
|
||||
# native build
|
||||
check $pacman --noconfirm --needed -S "$gcc_pkg" $libs
|
||||
# Native build.
|
||||
#
|
||||
# On newer versions wxgtk2 may have to be manually removed.
|
||||
if ! $pacman --noconfirm --needed -S "$gcc_pkg" $libs; then
|
||||
$pacman --noconfirm -R wxgtk2
|
||||
fi
|
||||
$pacman --noconfirm --needed -S "$gcc_pkg" $libs
|
||||
else
|
||||
# try to build 32 bit binaries
|
||||
|
||||
@@ -860,8 +991,12 @@ EOF
|
||||
fi
|
||||
done
|
||||
|
||||
deps="zlib gettext pkg-config sdl2 wxmsw"
|
||||
|
||||
[ -n "$ENABLE_OPENAL" ] && deps="$deps openal"
|
||||
|
||||
# and the actual deps
|
||||
for p in zlib gettext libpng pkg-config sdl2 openal wxmsw; do
|
||||
for p in $deps; do
|
||||
pkg="${pkg_prefix}${p}"
|
||||
# check if already installed
|
||||
if ! $pacman -Q "$pkg" >/dev/null 2>&1; then
|
||||
@@ -870,6 +1005,9 @@ EOF
|
||||
done
|
||||
[ $# -gt 0 ] && check $pacman --noconfirm --needed -S "$@"
|
||||
|
||||
# get the necessary win32 headers
|
||||
git submodule update --init --remote --recursive
|
||||
|
||||
warning 'SFML is required for LINK support, the SFML package in AUR is currently broken, if you want LINK support you will need to install it manually'
|
||||
fi
|
||||
|
||||
@@ -884,9 +1022,12 @@ solus_installdeps() {
|
||||
|
||||
check sudo eopkg -y update-repo
|
||||
check sudo eopkg -y install -c system.devel
|
||||
check sudo eopkg -y install git ccache
|
||||
check sudo eopkg -y install git ccache ninja
|
||||
|
||||
set -- sdl2-devel wxwidgets-devel libgtk-2-devel libgtk-3-devel libglu-devel
|
||||
|
||||
[ -n "$ENABLE_OPENAL" ] && set -- "$@" openal-soft-devel
|
||||
|
||||
set -- sdl2-devel openal-soft-devel wxwidgets-devel libgtk-2-devel libgtk-3-devel
|
||||
if [ -n "$amd64" -a "$target" = m32 ]; then
|
||||
info_msg 'Calculating dependencies, this will take a while..'
|
||||
|
||||
@@ -949,11 +1090,42 @@ gentoo_installdeps() {
|
||||
installing
|
||||
|
||||
check sudo emerge-webrsync
|
||||
check sudo emerge -vuDUa gcc make cmake ccache binutils libsdl2 libsfml wxGTK zlib dev-util/pkgconfig nasm
|
||||
|
||||
# We want the gtk3 slot for wxWidgets.
|
||||
wx_slot=$(equery -qC list -p -F '$slot' x11-libs/wxGTK | grep gtk3 | sort -rV | head -1)
|
||||
|
||||
ebuilds="\
|
||||
sys-devel/gcc \
|
||||
dev-build/make \
|
||||
dev-build/cmake \
|
||||
dev-util/ccache \
|
||||
sys-devel/binutils \
|
||||
media-libs/libsdl2 \
|
||||
media-libs/libsfml \
|
||||
x11-libs/wxGTK:$wx_slot \
|
||||
sys-libs/zlib \
|
||||
dev-util/pkgconf \
|
||||
dev-lang/nasm \
|
||||
dev-build/ninja"
|
||||
|
||||
[ -n "$ENABLE_OPENAL" ] && ebuilds="$ebuilds media-libs/openal"
|
||||
|
||||
[ -n "$ENABLE_FFMPEG" ] && ebuilds="$ebuilds media-video/ffmpeg"
|
||||
|
||||
check sudo emerge -vna $ebuilds
|
||||
|
||||
build_instructions
|
||||
}
|
||||
|
||||
alpine_installdeps() {
|
||||
installing
|
||||
|
||||
check sudo apk add cmake ninja g++ ccache nasm gettext-dev zlib-dev mesa-dev sdl2-dev glu-dev sfml-dev wxwidgets-dev gtk+3.0-dev zip
|
||||
|
||||
build_instructions
|
||||
}
|
||||
|
||||
|
||||
windows_installdeps() {
|
||||
msys2=1
|
||||
|
||||
@@ -963,15 +1135,45 @@ windows_installdeps() {
|
||||
# update catalogs
|
||||
check pacman -Sy
|
||||
|
||||
pkgs=
|
||||
|
||||
case "$target" in
|
||||
*clang*)
|
||||
pkgs="lldb clang"
|
||||
;;
|
||||
*)
|
||||
pkgs="gcc gcc-libs gcc-libgfortran"
|
||||
;;
|
||||
esac
|
||||
|
||||
case "$target" in
|
||||
*i686*)
|
||||
pkgs="$pkgs nasm"
|
||||
;;
|
||||
esac
|
||||
|
||||
pkgs="$pkgs SDL2 sfml wxWidgets3.2 zlib binutils cmake crt-git extra-cmake-modules headers-git make pkgconf tools-git windows-default-manifest libmangle-git ninja gdb ccache"
|
||||
|
||||
[ -n "$ENABLE_OPENAL" ] && pkgs="$pkgs openal"
|
||||
[ -n "$ENABLE_FFMPEG" ] && pkgs="$pkgs ffmpeg"
|
||||
|
||||
set --
|
||||
for p in SDL2 ffmpeg openal sfml wxWidgets zlib binutils cmake crt-git extra-cmake-modules gcc gcc-libs gcc-libgfortran gdb headers-git make pkg-config tools-git windows-default-manifest libmangle-git nasm; do
|
||||
for p in $pkgs; do
|
||||
set -- "$@" "${target}-${p}"
|
||||
done
|
||||
|
||||
# install
|
||||
check pacman --noconfirm --needed -S git make zip ccache "$@"
|
||||
case "$target" in
|
||||
*clang*)
|
||||
# We use gcc windres for now, llvm-rc is sometimes broken.
|
||||
set -- "$@" mingw-w64-x86_64-binutils
|
||||
;;
|
||||
esac
|
||||
|
||||
cmake_flags="$cmake_flags -G 'MSYS Makefiles'"
|
||||
# install
|
||||
check pacman --noconfirm --needed -S git make zip "$@"
|
||||
|
||||
# get the necessary win32 headers
|
||||
check git submodule update --init --remote --recursive
|
||||
|
||||
if [ "$MSYSTEM" = MSYS ]; then
|
||||
case "$target" in
|
||||
@@ -1017,22 +1219,25 @@ brew_installdeps() {
|
||||
|
||||
check brew -v update
|
||||
|
||||
brews="nasm cmake ccache ffmpeg gettext libpng pkg-config sdl2 wxmac ccache"
|
||||
brews="nasm cmake ccache gettext pkg-config sdl2 wxwidgets ccache ninja"
|
||||
|
||||
[ -n "$ENABLE_FFMPEG" ] && brews="$brews ffmpeg"
|
||||
|
||||
# sfml brew currently broken in the travis mac environment
|
||||
# if [ -z "$TRAVIS" ]; then
|
||||
brews="$brews sfml"
|
||||
# fi
|
||||
|
||||
set --
|
||||
for f in $brews; do
|
||||
if brew info "$f" | grep -Eq '^Not installed$'; then
|
||||
set -- "$@" "$f"
|
||||
fi
|
||||
done
|
||||
[ $# -gt 0 ] && check brew -v install "$@"
|
||||
# This is necessary for the GitHub Actions CI:
|
||||
brew -v install python
|
||||
brew link --overwrite python
|
||||
|
||||
brew link gettext --force
|
||||
check brew -v install -f $brews
|
||||
|
||||
for brew in gettext wxwidgets; do
|
||||
brew unlink $brew
|
||||
brew link $brew --force
|
||||
done
|
||||
|
||||
brew -v cleanup
|
||||
|
||||
@@ -1044,7 +1249,12 @@ macports_installdeps() {
|
||||
installing
|
||||
|
||||
check sudo port -v selfupdate
|
||||
check sudo port -v install cmake ccache nasm ffmpeg gettext libpng pkgconfig libsdl2 sfml wxWidgets-3.0 libiconv
|
||||
|
||||
ports="cmake ccache nasm gettext pkgconfig libsdl2 sfml wxWidgets-3.0 libiconv ninja"
|
||||
|
||||
[ -n "$ENABLE_FFMPEG" ] && ports="$ports ffmpeg"
|
||||
|
||||
check sudo port -v install $ports
|
||||
check sudo port select wxWidgets wxWidgets-3.0
|
||||
|
||||
build_instructions
|
||||
@@ -1055,7 +1265,12 @@ fink_installdeps() {
|
||||
installing
|
||||
|
||||
check sudo fink -vy selfupdate
|
||||
check sudo fink -vy install cmake ccache nasm ffmpeg libgettext8-dev gettext-tools libpng16 pkgconfig sdl2 wxwidgets300-osxcocoa libiconv-dev sfml24-dev ccache
|
||||
|
||||
pkgs="cmake ccache nasm libgettext8-dev gettext-tools pkgconfig sdl2 wxwidgets300-osxcocoa libiconv-dev sfml24-dev ccache ninja"
|
||||
|
||||
[ -n "$ENABLE_FFMPEG" ] && pkgs="$pkgs ffmpeg"
|
||||
|
||||
check sudo fink -vy install $pkgs
|
||||
|
||||
build_instructions
|
||||
}
|
||||
@@ -1066,12 +1281,14 @@ build_instructions() {
|
||||
[32mDone! To build do:[0m
|
||||
|
||||
$pre_build
|
||||
mkdir -p build && cd build
|
||||
$CMAKE .. $cmake_flags
|
||||
make $(jobs_flag)
|
||||
mkdir build && cd build
|
||||
$CMAKE .. -DCMAKE_BUILD_TYPE=Release $cmake_flags -G Ninja
|
||||
ninja
|
||||
$post_build
|
||||
|
||||
EOF
|
||||
}
|
||||
|
||||
main "$@"
|
||||
|
||||
# vim:et sw=4:
|
||||
|
@@ -1,4 +0,0 @@
|
||||
IF(ENABLE_WX)
|
||||
add_subdirectory(wxvbam)
|
||||
ENDIF(ENABLE_WX)
|
||||
|
@@ -1,7 +0,0 @@
|
||||
#!/bin/sh
|
||||
# Generate translation template file for the wxWidgets port
|
||||
wxrc -g ../src/wx/xrc/*.xrc -o wx-xrc-strings.h
|
||||
|
||||
xgettext -k_ -kN_ -o wxvbam/wxvbam.pot ../src/wx/*.cpp ../src/wx/*.h ../src/wx/widgets/*.cpp wx-xrc-strings.h
|
||||
|
||||
rm -r wx-xrc-strings.h
|
@@ -1,8 +1,7 @@
|
||||
if(NOT TRANSLATIONS_ONLY AND NOT ENABLE_WX)
|
||||
return()
|
||||
endif()
|
||||
|
||||
file(GLOB po_files "${CMAKE_CURRENT_SOURCE_DIR}/*.po")
|
||||
|
||||
GETTEXT_CREATE_TRANSLATIONS(
|
||||
wxvbam.pot
|
||||
${po_files}
|
||||
)
|
||||
|
||||
ADD_DEPENDENCIES(visualboyadvance-m translations)
|
||||
gettext_create_translations(wxvbam.pot ${po_files})
|
||||
|
3805
po/wxvbam/ar.po
3805
po/wxvbam/ar.po
File diff suppressed because it is too large
Load Diff
3790
po/wxvbam/bg.po
Normal file
3790
po/wxvbam/bg.po
Normal file
File diff suppressed because it is too large
Load Diff
4312
po/wxvbam/br.po
4312
po/wxvbam/br.po
File diff suppressed because it is too large
Load Diff
3803
po/wxvbam/bs.po
3803
po/wxvbam/bs.po
File diff suppressed because it is too large
Load Diff
3803
po/wxvbam/ca.po
3803
po/wxvbam/ca.po
File diff suppressed because it is too large
Load Diff
3803
po/wxvbam/ca_ES.po
3803
po/wxvbam/ca_ES.po
File diff suppressed because it is too large
Load Diff
4298
po/wxvbam/cs.po
4298
po/wxvbam/cs.po
File diff suppressed because it is too large
Load Diff
3803
po/wxvbam/da.po
3803
po/wxvbam/da.po
File diff suppressed because it is too large
Load Diff
3803
po/wxvbam/da_DK.po
3803
po/wxvbam/da_DK.po
File diff suppressed because it is too large
Load Diff
4462
po/wxvbam/de.po
4462
po/wxvbam/de.po
File diff suppressed because it is too large
Load Diff
3803
po/wxvbam/de_DE.po
3803
po/wxvbam/de_DE.po
File diff suppressed because it is too large
Load Diff
4328
po/wxvbam/el.po
4328
po/wxvbam/el.po
File diff suppressed because it is too large
Load Diff
3803
po/wxvbam/el_GR.po
3803
po/wxvbam/el_GR.po
File diff suppressed because it is too large
Load Diff
3667
po/wxvbam/en.po
3667
po/wxvbam/en.po
File diff suppressed because it is too large
Load Diff
3803
po/wxvbam/en_BR.po
3803
po/wxvbam/en_BR.po
File diff suppressed because it is too large
Load Diff
3803
po/wxvbam/en_GB.po
3803
po/wxvbam/en_GB.po
File diff suppressed because it is too large
Load Diff
5437
po/wxvbam/en_US.po
5437
po/wxvbam/en_US.po
File diff suppressed because it is too large
Load Diff
4965
po/wxvbam/es.po
4965
po/wxvbam/es.po
File diff suppressed because it is too large
Load Diff
5122
po/wxvbam/es_419.po
5122
po/wxvbam/es_419.po
File diff suppressed because it is too large
Load Diff
3804
po/wxvbam/es_AR.po
3804
po/wxvbam/es_AR.po
File diff suppressed because it is too large
Load Diff
3803
po/wxvbam/es_CL.po
3803
po/wxvbam/es_CL.po
File diff suppressed because it is too large
Load Diff
5442
po/wxvbam/es_CO.po
5442
po/wxvbam/es_CO.po
File diff suppressed because it is too large
Load Diff
3803
po/wxvbam/es_CR.po
3803
po/wxvbam/es_CR.po
File diff suppressed because it is too large
Load Diff
3805
po/wxvbam/es_ES.po
3805
po/wxvbam/es_ES.po
File diff suppressed because it is too large
Load Diff
3809
po/wxvbam/es_MX.po
3809
po/wxvbam/es_MX.po
File diff suppressed because it is too large
Load Diff
5438
po/wxvbam/es_PE.po
5438
po/wxvbam/es_PE.po
File diff suppressed because it is too large
Load Diff
3803
po/wxvbam/es_PR.po
3803
po/wxvbam/es_PR.po
File diff suppressed because it is too large
Load Diff
5438
po/wxvbam/es_US.po
5438
po/wxvbam/es_US.po
File diff suppressed because it is too large
Load Diff
3803
po/wxvbam/es_VE.po
3803
po/wxvbam/es_VE.po
File diff suppressed because it is too large
Load Diff
3804
po/wxvbam/fa.po
3804
po/wxvbam/fa.po
File diff suppressed because it is too large
Load Diff
3803
po/wxvbam/fil.po
3803
po/wxvbam/fil.po
File diff suppressed because it is too large
Load Diff
4791
po/wxvbam/fr.po
4791
po/wxvbam/fr.po
File diff suppressed because it is too large
Load Diff
3803
po/wxvbam/fr_CA.po
3803
po/wxvbam/fr_CA.po
File diff suppressed because it is too large
Load Diff
4314
po/wxvbam/fr_FR.po
4314
po/wxvbam/fr_FR.po
File diff suppressed because it is too large
Load Diff
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user