Compare commits
827 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
f8d38cbdd0 | ||
|
|
21c24431db | ||
|
|
f2a059e985 | ||
|
|
1c4b1149e2 | ||
|
|
454be02eab | ||
|
|
072742cba5 | ||
|
|
9812bfc25f | ||
|
|
cbc7782b3a | ||
|
|
40afac6ae0 | ||
|
|
891457c11a | ||
|
|
e9a517985b | ||
|
|
a2058bc1e8 | ||
|
|
de96b8e43e | ||
|
|
d1e5d67336 | ||
|
|
5279697890 | ||
|
|
fd9166e32a | ||
|
|
6b9c53c3c0 | ||
|
|
3620e537ab | ||
|
|
e625fa3b33 | ||
|
|
f0b18e52a3 | ||
|
|
adecaca730 | ||
|
|
10ef3ff683 | ||
|
|
ef5b95d5b9 | ||
|
|
c3e9150125 | ||
|
|
ac0afbcc4a | ||
|
|
a9593e62b7 | ||
|
|
4b7bc99291 | ||
|
|
43e1aa9c01 | ||
|
|
d44d6515d8 | ||
|
|
7c636c6c17 | ||
|
|
c094314a2d | ||
|
|
9da87128f1 | ||
|
|
1036e1f3fb | ||
|
|
6b5fd054f6 | ||
|
|
91b6d68eae | ||
|
|
a0487b12be | ||
|
|
1e07b626c4 | ||
|
|
b247ca3f76 | ||
|
|
5f3cac46eb | ||
|
|
a7c424fc68 | ||
|
|
a35f159117 | ||
|
|
b865b92a6a | ||
|
|
2132978c41 | ||
|
|
97f6b9d845 | ||
|
|
6e4ef6f8a1 | ||
|
|
56bd48bd2a | ||
|
|
ca98523c41 | ||
|
|
290f143b5c | ||
|
|
123ded50ef | ||
|
|
18b7f6925a | ||
|
|
51aaa9f26b | ||
|
|
a75964c993 | ||
|
|
9bd9cb697e | ||
|
|
4d29117148 | ||
|
|
dd4f2e857b | ||
|
|
0b998da183 | ||
|
|
eef7596aeb | ||
|
|
4abf23f9a9 | ||
|
|
56d2754606 | ||
|
|
88ca93d24f | ||
|
|
72c85ef104 | ||
|
|
c6b1763d96 | ||
|
|
844444c33b | ||
|
|
c708408f64 | ||
|
|
03e9db98e6 | ||
|
|
bf3947dcc5 | ||
|
|
5140affe07 | ||
|
|
b808caaa0e | ||
|
|
658c617c75 | ||
|
|
05fcfc32bc | ||
|
|
05a4409b3d | ||
|
|
cadc08af87 | ||
|
|
2678d0f99e | ||
|
|
b1954e411b | ||
|
|
5d47c7ecfa | ||
|
|
f09d399e88 | ||
|
|
c592184aa6 | ||
|
|
bb297ac354 | ||
|
|
7871be05af | ||
|
|
1a9cd725b2 | ||
|
|
1e0395c26d | ||
|
|
7943adedaa | ||
|
|
2285830c8f | ||
|
|
eff4bc7ad6 | ||
|
|
794027d91e | ||
|
|
312625036b | ||
|
|
e7c1dc3b8e | ||
|
|
a29b50b4cd | ||
|
|
d03b03ac93 | ||
|
|
a891d2fdea | ||
|
|
de28034c20 | ||
|
|
01c639c261 | ||
|
|
fe21270bbc | ||
|
|
b9acd64221 | ||
|
|
9bf2092c7e | ||
|
|
0eba34d5a8 | ||
|
|
5257eec81e | ||
|
|
2d2513369a | ||
|
|
6e8cd5a4cc | ||
|
|
7749f8a99d | ||
|
|
ef32d0d321 | ||
|
|
f26d7c7bf2 | ||
|
|
86240966b6 | ||
|
|
f5d3bc2b7b | ||
|
|
b3bd91877c | ||
|
|
00123d2dde | ||
|
|
ecd58e3924 | ||
|
|
0ac3fd0563 | ||
|
|
a805d15797 | ||
|
|
28024d7a01 | ||
|
|
e0fb73414b | ||
|
|
94d6969fed | ||
|
|
8e5fad2209 | ||
|
|
ca49db02df | ||
|
|
08db85fa99 | ||
|
|
e57bcea3b6 | ||
|
|
5c5fae78c6 | ||
|
|
44f8f17763 | ||
|
|
78e7b288b8 | ||
|
|
78131d2d53 | ||
|
|
ca8aa4dc0a | ||
|
|
81ef1292ed | ||
|
|
b67f55cff7 | ||
|
|
9880134b4d | ||
|
|
cc32df6fd8 | ||
|
|
0e48a2196f | ||
|
|
39d27e3a4e | ||
|
|
48e6a4f535 | ||
|
|
7db5126182 | ||
|
|
0d4ac69465 | ||
|
|
32706065ac | ||
|
|
d571b8be81 | ||
|
|
f014c8207c | ||
|
|
b680b53128 | ||
|
|
e2cd11ccd7 | ||
|
|
ab4561aacc | ||
|
|
a7733a6c55 | ||
|
|
688aa50064 | ||
|
|
232bf22e51 | ||
|
|
171c1a5c44 | ||
|
|
80b4fe6613 | ||
|
|
18f640d73d | ||
|
|
9e2667261f | ||
|
|
18e33d2268 | ||
|
|
fd13ccf802 | ||
|
|
fbf947fcd7 | ||
|
|
958031dbaf | ||
|
|
7ddef751ef | ||
|
|
a81ecc2006 | ||
|
|
fedd094987 | ||
|
|
36a8a20434 | ||
|
|
f5204cc8f5 | ||
|
|
808e262a4d | ||
|
|
152cf42029 | ||
|
|
e69385861a | ||
|
|
87f87bf2ff | ||
|
|
b3d86e626b | ||
|
|
d80ebdc77d | ||
|
|
80ac46c9a5 | ||
|
|
4387118d55 | ||
|
|
c2abbaedc8 | ||
|
|
f8927a8a11 | ||
|
|
7054a2a6d2 | ||
|
|
f2f8ecab98 | ||
|
|
be9d417778 | ||
|
|
6e537cd322 | ||
|
|
19cae9b59b | ||
|
|
89e65ed89e | ||
|
|
9892d23735 | ||
|
|
10a3339019 | ||
|
|
8b658bd628 | ||
|
|
5a045db751 | ||
|
|
80e7854300 | ||
|
|
c83c1ed291 | ||
|
|
37412c8dd2 | ||
|
|
aaa1a5451e | ||
|
|
e3d45d99da | ||
|
|
60d9301646 | ||
|
|
23f070128a | ||
|
|
39e0e4ad9e | ||
|
|
bde1853862 | ||
|
|
637b70a723 | ||
|
|
d34c5034c3 | ||
|
|
8dc3dcd2ac | ||
|
|
b25643f0bf | ||
|
|
3231a7d25f | ||
|
|
855769c53e | ||
|
|
7cf069bf4c | ||
|
|
bd94e2ae73 | ||
|
|
6c2871402d | ||
|
|
341ca20529 | ||
|
|
0d300776ca | ||
|
|
fad498cfb8 | ||
|
|
39d3a58b49 | ||
|
|
e98792209e | ||
|
|
2d53641cd0 | ||
|
|
529c61fabe | ||
|
|
614a1c3bb6 | ||
|
|
663d9ce3d1 | ||
|
|
67b8c8d360 | ||
|
|
4c5379fe30 | ||
|
|
65c613fb3e | ||
|
|
d0f265f6d9 | ||
|
|
ec4d13741f | ||
|
|
d6b87f141f | ||
|
|
cd61a2ae20 | ||
|
|
d99528f4b4 | ||
|
|
775a7be958 | ||
|
|
77f5851b3c | ||
|
|
e4ac5c8f6c | ||
|
|
4f6ec26dc9 | ||
|
|
55fda48a3b | ||
|
|
5dc2bc06cf | ||
|
|
f2367575a2 | ||
|
|
345d5d99b3 | ||
|
|
5c86dfeb6e | ||
|
|
b119aa49ef | ||
|
|
8b84d5597f | ||
|
|
b060ba3c38 | ||
|
|
17c2e93c78 | ||
|
|
6a2353f08b | ||
|
|
da2d80d23a | ||
|
|
01f2e70f1d | ||
|
|
b77268b0e3 | ||
|
|
6a4c1f6ac6 | ||
|
|
1d6e21247e | ||
|
|
4a699d6160 | ||
|
|
06584a38ab | ||
|
|
d2dd03dcba | ||
|
|
3b631a4f90 | ||
|
|
3555967812 | ||
|
|
358135a890 | ||
|
|
73ac76a0eb | ||
|
|
972c92a3fe | ||
|
|
f6209dec34 | ||
|
|
738ce6422a | ||
|
|
dd3cb2b43c | ||
|
|
8fd1788ece | ||
|
|
d34bd5338d | ||
|
|
8dca737dc8 | ||
|
|
86ff77665c | ||
|
|
e5e665b9ee | ||
|
|
6863eb6651 | ||
|
|
0493a91a42 | ||
|
|
1ee939c7f7 | ||
|
|
ff8b4fd95a | ||
|
|
a68983b37f | ||
|
|
2d0905a4a6 | ||
|
|
eb96dee176 | ||
|
|
df2ca052ea | ||
|
|
e95c0a4631 | ||
|
|
fbbd45c674 | ||
|
|
69064e96f0 | ||
|
|
1e0b95ca68 | ||
|
|
a5ac768540 | ||
|
|
1c7772e731 | ||
|
|
2db2c96329 | ||
|
|
76616ee6f6 | ||
|
|
37c7a72505 | ||
|
|
b198e296cb | ||
|
|
f38754d0d6 | ||
|
|
e5a0393480 | ||
|
|
e62ef91404 | ||
|
|
71d78425be | ||
|
|
c7db5122c8 | ||
|
|
89fcf69948 | ||
|
|
724ea77bef | ||
|
|
b127dd514d | ||
|
|
a732635e75 | ||
|
|
5072f983ed | ||
|
|
6c9fca3f61 | ||
|
|
91b98bed05 | ||
|
|
195f7502b7 | ||
|
|
1b8779f93e | ||
|
|
f0f124a23a | ||
|
|
2772daa964 | ||
|
|
2338e8a186 | ||
|
|
ab7acd7149 | ||
|
|
43a9aedf7d | ||
|
|
1608ed43c1 | ||
|
|
fa103a69f9 | ||
|
|
f8520f9dd3 | ||
|
|
3a372afc0e | ||
|
|
95d6bec68f | ||
|
|
56f2e20cb4 | ||
|
|
4cbcaba7f2 | ||
|
|
aeeca6e2c0 | ||
|
|
74704d0d2a | ||
|
|
0b384bdd72 | ||
|
|
e9cf3a6806 | ||
|
|
c5f9068664 | ||
|
|
992bbbba1c | ||
|
|
fe9dd63558 | ||
|
|
8e45003c27 | ||
|
|
f53d824e07 | ||
|
|
259670af85 | ||
|
|
c7e9430f99 | ||
|
|
afe573d2eb | ||
|
|
547d9817db | ||
|
|
9c63243fe7 | ||
|
|
5535ba6b47 | ||
|
|
5059d5e2da | ||
|
|
52a80f98ed | ||
|
|
9600319094 | ||
|
|
9b930c8716 | ||
|
|
eb0d2e5b2c | ||
|
|
5e2722475a | ||
|
|
b1e406731d | ||
|
|
8c6d51cb71 | ||
|
|
4b205084f8 | ||
|
|
eb910b0bae | ||
|
|
09a6a1f259 | ||
|
|
315618a18b | ||
|
|
59af03695b | ||
|
|
e1851f7b5b | ||
|
|
a126b4003f | ||
|
|
9067de26ac | ||
|
|
260c5345fd | ||
|
|
29195e8460 | ||
|
|
e3dd05ef21 | ||
|
|
9379bcedf9 | ||
|
|
2c91210d6e | ||
|
|
f721d935e4 | ||
|
|
66597cade3 | ||
|
|
3c5f39e26a | ||
|
|
24e3176f1b | ||
|
|
e49156a074 | ||
|
|
948ebe5213 | ||
|
|
2a64c07215 | ||
|
|
578a5719dd | ||
|
|
e59757e3e8 | ||
|
|
282de8c7f5 | ||
|
|
541021f29c | ||
|
|
6804253bfc | ||
|
|
e01b9dcd39 | ||
|
|
8d4567b930 | ||
|
|
6f6988a487 | ||
|
|
435ab2ce77 | ||
|
|
1afd723c4e | ||
|
|
b09f7f5ac7 | ||
|
|
1b3f0f9ec0 | ||
|
|
d1d68721ac | ||
|
|
2f4afe5b68 | ||
|
|
47fcc70756 | ||
|
|
0e86b696c5 | ||
|
|
54f05b409c | ||
|
|
350dff9b98 | ||
|
|
f198221812 | ||
|
|
dee08b4216 | ||
|
|
e02d074a85 | ||
|
|
8e2da87b97 | ||
|
|
2deba06212 | ||
|
|
90d2dce07a | ||
|
|
a6ac8e1f71 | ||
|
|
69436a9032 | ||
|
|
50d91d13be | ||
|
|
54a6db146e | ||
|
|
3b31fe91a6 | ||
|
|
90c5219be9 | ||
|
|
669fe29173 | ||
|
|
d7d06c8234 | ||
|
|
4754c1322d | ||
|
|
acb093c277 | ||
|
|
21d54edeb9 | ||
|
|
20ea0968da | ||
|
|
398d8c52a2 | ||
|
|
f82d12d381 | ||
|
|
91ee5724ca | ||
|
|
a82443f271 | ||
|
|
1cd0b70055 | ||
|
|
8f8904ad0f | ||
|
|
e975e389df | ||
|
|
d3242393e0 | ||
|
|
ce7d0e81bd | ||
|
|
0cf16e6f8f | ||
|
|
0ab395794e | ||
|
|
ac06a8394b | ||
|
|
46dd1ad154 | ||
|
|
e57a7b6f3b | ||
|
|
409128b07f | ||
|
|
fd562061ee | ||
|
|
c6a7dc8f9c | ||
|
|
5275f7e852 | ||
|
|
6ec19e4630 | ||
|
|
690ac8d4b1 | ||
|
|
7ae1cd33be | ||
|
|
a7c6c184da | ||
|
|
29d6b423a3 | ||
|
|
b3590c5ae6 | ||
|
|
67f549d86d | ||
|
|
9096265bff | ||
|
|
ce265b3948 | ||
|
|
7fee70543d | ||
|
|
f3a48bb0f0 | ||
|
|
c151c12b95 | ||
|
|
b8d999066d | ||
|
|
0e816492b4 | ||
|
|
c6ef099e18 | ||
|
|
1c5872da0c | ||
|
|
d95e94fa07 | ||
|
|
d7bbbd9d40 | ||
|
|
cf56659b18 | ||
|
|
4163b8e40b | ||
|
|
4ca6a5c52c | ||
|
|
511811de3b | ||
|
|
6ef4dfb61f | ||
|
|
5ca2a3b0f7 | ||
|
|
88794d0288 | ||
|
|
30e76a7c11 | ||
|
|
41eb687243 | ||
|
|
5191baa659 | ||
|
|
8159eff664 | ||
|
|
c6eb3d790e | ||
|
|
f62fc8ab15 | ||
|
|
75e85701c6 | ||
|
|
cd85afc9a5 | ||
|
|
b9ba472eda | ||
|
|
bf9d3acf33 | ||
|
|
bd7e291787 | ||
|
|
73b34b6d89 | ||
|
|
f2c7290ee8 | ||
|
|
6f6938f5bb | ||
|
|
601ff92871 | ||
|
|
f119986fad | ||
|
|
402cd21f87 | ||
|
|
8cb694af89 | ||
|
|
73d8cedf7e | ||
|
|
b7e8d36cf8 | ||
|
|
45f5eb9671 | ||
|
|
16fe6d0dcf | ||
|
|
b633c3ffea | ||
|
|
ca1696823c | ||
|
|
c1cc9d484a | ||
|
|
db75cb3e17 | ||
|
|
b8a17c8f22 | ||
|
|
74dff061ff | ||
|
|
3dd846b600 | ||
|
|
8a2e24ecd0 | ||
|
|
6ccca51fee | ||
|
|
a4b3c3d1ad | ||
|
|
bc8947289b | ||
|
|
e7c506c6ec | ||
|
|
8236964029 | ||
|
|
aadecaf102 | ||
|
|
b55e45eef6 | ||
|
|
adbc928148 | ||
|
|
c4c206076a | ||
|
|
5c077d7037 | ||
|
|
8583a2f4f7 | ||
|
|
ed8416ea10 | ||
|
|
deb7454cf7 | ||
|
|
8c40af5aee | ||
|
|
dd893bab41 | ||
|
|
759ee62e7c | ||
|
|
1e9b79e2c1 | ||
|
|
315883a28c | ||
|
|
19b85afe12 | ||
|
|
b2e8a31d68 | ||
|
|
b4b12732cb | ||
|
|
c714c57bb2 | ||
|
|
4697216c5e | ||
|
|
e2fa94e2c3 | ||
|
|
7578a27bf7 | ||
|
|
14e0b3c9e6 | ||
|
|
815acfc7da | ||
|
|
7d8af7d413 | ||
|
|
39810ed516 | ||
|
|
9cbcf8fe34 | ||
|
|
02b476035b | ||
|
|
9eb338f417 | ||
|
|
15e30604fc | ||
|
|
21f677cf58 | ||
|
|
3ead892b1c | ||
|
|
a59e87a896 | ||
|
|
96df7b82de | ||
|
|
5cb5d284c3 | ||
|
|
869517b9c6 | ||
|
|
56cefce1cc | ||
|
|
165af85894 | ||
|
|
7c073c1db7 | ||
|
|
061178ad82 | ||
|
|
dbc7c6e74d | ||
|
|
d87a48ea06 | ||
|
|
b36bb8b5bb | ||
|
|
2ed16c9736 | ||
|
|
c031649979 | ||
|
|
e0746fca12 | ||
|
|
2075042ba7 | ||
|
|
499cd48763 | ||
|
|
5d826b2b62 | ||
|
|
b20943d497 | ||
|
|
b4ab9a4e57 | ||
|
|
cd36a1fe16 | ||
|
|
1cda80cbe7 | ||
|
|
ffd0e6b79d | ||
|
|
a7728b87fc | ||
|
|
c218789abc | ||
|
|
3656cb9fdb | ||
|
|
e93fdf4615 | ||
|
|
6722e25cbe | ||
|
|
790db4283c | ||
|
|
a0359473ff | ||
|
|
ccfdcce5c1 | ||
|
|
811849fa23 | ||
|
|
1051fd9d42 | ||
|
|
5490a992ca | ||
|
|
2d29fb8d15 | ||
|
|
589035c1db | ||
|
|
8f6a578ec0 | ||
|
|
a2fcf4edac | ||
|
|
f56ac5210c | ||
|
|
576069a84d | ||
|
|
7ea7d4cf6c | ||
|
|
21e1359b37 | ||
|
|
eebee9b7c1 | ||
|
|
bfc986a97d | ||
|
|
d65a52242e | ||
|
|
c82c791061 | ||
|
|
bcd18a01d8 | ||
|
|
53a4931974 | ||
|
|
1f7751618e | ||
|
|
497babe8e9 | ||
|
|
973a90a34d | ||
|
|
3cff5cd1a8 | ||
|
|
8766335708 | ||
|
|
908fc939b1 | ||
|
|
73c4557a45 | ||
|
|
accfcbbf5c | ||
|
|
5a36450e01 | ||
|
|
839f4eab7e | ||
|
|
fec0559d11 | ||
|
|
e46fc0a805 | ||
|
|
fb7751360c | ||
|
|
0c2e7d7028 | ||
|
|
fe2e68b410 | ||
|
|
166c4df0b3 | ||
|
|
68684855c6 | ||
|
|
fa0de18ffe | ||
|
|
24ca32f9f7 | ||
|
|
f63de0d0cc | ||
|
|
f6db6058e1 | ||
|
|
d23632ef46 | ||
|
|
1048f213c7 | ||
|
|
98d88bff94 | ||
|
|
861fccd2d6 | ||
|
|
715c3b8510 | ||
|
|
3c6c7c4138 | ||
|
|
95106ca1c2 | ||
|
|
ac106b0aff | ||
|
|
001e45627b | ||
|
|
b8c3457644 | ||
|
|
5f6dcfa82a | ||
|
|
f2dd944acd | ||
|
|
d0f69ebb75 | ||
|
|
04737fb0e8 | ||
|
|
d78550e83e | ||
|
|
c640585bc3 | ||
|
|
a926cdc5be | ||
|
|
43e66b57a0 | ||
|
|
ee60a9801b | ||
|
|
fb69220b95 | ||
|
|
1cf7f67af5 | ||
|
|
8497ba1898 | ||
|
|
234259da91 | ||
|
|
ef7f309012 | ||
|
|
d372fa1a0f | ||
|
|
ea9005868b | ||
|
|
0a3a4a51bd | ||
|
|
1dbd913d9d | ||
|
|
22cded7ccc | ||
|
|
4851f1ad48 | ||
|
|
0d94dd7bf8 | ||
|
|
bbe7f6adfb | ||
|
|
828941a204 | ||
|
|
2ce3f2c131 | ||
|
|
8943552c1c | ||
|
|
dadbb00b85 | ||
|
|
852a8407c8 | ||
|
|
bfbbcad8e5 | ||
|
|
c684987908 | ||
|
|
d0c66e5efb | ||
|
|
53b8f70de8 | ||
|
|
a1eb30ae87 | ||
|
|
c4cb9de44b | ||
|
|
0a89503edd | ||
|
|
f12bd741e2 | ||
|
|
e35039faf7 | ||
|
|
a756943628 | ||
|
|
a9c3e13e5e | ||
|
|
67c8ac2b04 | ||
|
|
82044399e4 | ||
|
|
fdcf2eda5a | ||
|
|
e0997f1f04 | ||
|
|
58859ee709 | ||
|
|
c3771e2fd5 | ||
|
|
2e49365b0f | ||
|
|
cd87aadab3 | ||
|
|
e58f8856f4 | ||
|
|
18a48e6609 | ||
|
|
929b75989c | ||
|
|
7d98030edc | ||
|
|
846d573dd0 | ||
|
|
5805fe636a | ||
|
|
3db9c6a9ff | ||
|
|
22bcf83cb9 | ||
|
|
117eca3c98 | ||
|
|
81affe719f | ||
|
|
3febec4aa4 | ||
|
|
a78c6072ce | ||
|
|
aa6a57be63 | ||
|
|
fd29dd9508 | ||
|
|
5080ebf88f | ||
|
|
873df7805b | ||
|
|
009fb10927 | ||
|
|
3898d29741 | ||
|
|
1c521a3743 | ||
|
|
098d1b30ff | ||
|
|
484108dafc | ||
|
|
029d260ad8 | ||
|
|
e6bc8f8583 | ||
|
|
77a13963bb | ||
|
|
656eacbb09 | ||
|
|
98f9a09b39 | ||
|
|
7e8e8bdb26 | ||
|
|
e2a0f801b9 | ||
|
|
75b31b4151 | ||
|
|
f0763fd31c | ||
|
|
162e7b7699 | ||
|
|
7158a3c83d | ||
|
|
1fa30dd337 | ||
|
|
250049537f | ||
|
|
76e5311320 | ||
|
|
11098cd6d4 | ||
|
|
78a0b347fc | ||
|
|
08a23de051 | ||
|
|
a02ad53c73 | ||
|
|
9400701c96 | ||
|
|
aa983108e8 | ||
|
|
7dca333166 | ||
|
|
0f1ecf66ab | ||
|
|
74984b5a3c | ||
|
|
c5d5984885 | ||
|
|
c1ccfcb988 | ||
|
|
51dc0550d5 | ||
|
|
ac9e36549b | ||
|
|
009e9a598a | ||
|
|
1502ef2661 | ||
|
|
40f9e12bdf | ||
|
|
2fc783e67e | ||
|
|
4f8e6a188a | ||
|
|
b0e44ad1bd | ||
|
|
4a630b1780 | ||
|
|
ffa5e6099d | ||
|
|
8d1cd7008f | ||
|
|
31b5c5e9dd | ||
|
|
0e21a16c1c | ||
|
|
f666384a1d | ||
|
|
afacfcee94 | ||
|
|
7262bf96b8 | ||
|
|
3db489f4df | ||
|
|
6526c28e47 | ||
|
|
e473b9bf10 | ||
|
|
0bde458c27 | ||
|
|
66739ac820 | ||
|
|
4a3763d8d1 | ||
|
|
4230127459 | ||
|
|
a4c672252d | ||
|
|
d5d0473487 | ||
|
|
9bbad1f8f0 | ||
|
|
0523965822 | ||
|
|
cb8cd702e1 | ||
|
|
86b5737d51 | ||
|
|
4027ec7a67 | ||
|
|
c2748a2246 | ||
|
|
5c06afc977 | ||
|
|
4c82a5660f | ||
|
|
beacb5c701 | ||
|
|
8355331cbe | ||
|
|
dc9cb07a81 | ||
|
|
57fe7d9ad0 | ||
|
|
00336de59a | ||
|
|
b37b48f039 | ||
|
|
42ca1a8994 | ||
|
|
db678238ef | ||
|
|
861f88dd30 | ||
|
|
77d42f1eb9 | ||
|
|
364a13017c | ||
|
|
8183deeb30 | ||
|
|
bb56d0a752 | ||
|
|
41eafa4ede | ||
|
|
ce7629200f | ||
|
|
5dca06d3d4 | ||
|
|
b1d18c7f29 | ||
|
|
0b2d019e61 | ||
|
|
ab0dde7fe8 | ||
|
|
ef01d2af82 | ||
|
|
08084799b9 | ||
|
|
3642e401da | ||
|
|
094d284e62 | ||
|
|
2c7459e08d | ||
|
|
315d2c4daf | ||
|
|
e61cabf1ce | ||
|
|
994f409291 | ||
|
|
7d124012c2 | ||
|
|
4d3c80e273 | ||
|
|
a332a7fc35 | ||
|
|
2fb945a489 | ||
|
|
4d2517d163 | ||
|
|
b4848f308f | ||
|
|
1c8876cead | ||
|
|
1bcb6ad20d | ||
|
|
66aaa9cf80 | ||
|
|
61d365e957 | ||
|
|
006b319c3a | ||
|
|
e38ec797fd | ||
|
|
94b42e7a9b | ||
|
|
61097dac72 | ||
|
|
116fe01dee | ||
|
|
ba2bf9f366 | ||
|
|
a5b68f2da2 | ||
|
|
97edb0f954 | ||
|
|
a3531b931b | ||
|
|
0438f070f7 | ||
|
|
f53e36c430 | ||
|
|
8889e2de64 | ||
|
|
2d0b310e19 | ||
|
|
dfb465a11b | ||
|
|
9ed2dc755c | ||
|
|
e70342b356 | ||
|
|
ba0fd794d7 | ||
|
|
dbd7de628f | ||
|
|
d6fdaa93a4 | ||
|
|
80076833d1 | ||
|
|
dc9d3fbf96 | ||
|
|
e12548ab8c | ||
|
|
894261862d | ||
|
|
07a261a259 | ||
|
|
34a7bf4dbb | ||
|
|
5988f6cf88 | ||
|
|
039be1f8e9 | ||
|
|
70e92a1cea | ||
|
|
2af2e37dcd | ||
|
|
a6559b1e51 | ||
|
|
361b8852df | ||
|
|
ff201ce3f9 | ||
|
|
de2ce83a8d | ||
|
|
f37d83abe1 | ||
|
|
ee610ceb3f | ||
|
|
5affacab70 | ||
|
|
924011f36e | ||
|
|
70b5a6f05b | ||
|
|
05c7270dcf | ||
|
|
a75e34d1c2 | ||
|
|
f7139ac20e | ||
|
|
e43d718e0f | ||
|
|
cc0b5e660d | ||
|
|
8f525a37da | ||
|
|
5e62d2b104 | ||
|
|
6c373ee31e | ||
|
|
d98c46beb0 | ||
|
|
850772a4ce | ||
|
|
08be65e649 | ||
|
|
ed8e37ed89 | ||
|
|
1732d6d427 | ||
|
|
bb9a958a1e | ||
|
|
f1b8c36a28 | ||
|
|
03ed12a9b1 | ||
|
|
30f5a3a162 | ||
|
|
e4a3f76f55 | ||
|
|
f5bdb56a7c | ||
|
|
64d4a9e240 | ||
|
|
71d9084a95 | ||
|
|
9d6092faaa | ||
|
|
bb0f17ae6f | ||
|
|
ebb46999d8 | ||
|
|
1c48aa8f97 | ||
|
|
bdc0ad2b8f | ||
|
|
ac8d5e5ab3 | ||
|
|
41416dcffe | ||
|
|
dda7cb5791 | ||
|
|
f7fdeeea9b | ||
|
|
9d7d7590a7 | ||
|
|
77848afc94 | ||
|
|
8f7e96e2a5 | ||
|
|
eab807daeb | ||
|
|
c4bfdcbeac | ||
|
|
3801949887 | ||
|
|
29d5c951c5 | ||
|
|
eb4b0d630f | ||
|
|
b6225d1d9a | ||
|
|
32ec2be0b6 | ||
|
|
d7dfa91f6f | ||
|
|
c4cc9dd417 | ||
|
|
884b707385 | ||
|
|
acbc81c1ea | ||
|
|
cc60dcc8a4 | ||
|
|
275f85e7a6 | ||
|
|
24f99a2920 | ||
|
|
2acfbf12ed | ||
|
|
b0972de510 | ||
|
|
af58636c7c | ||
|
|
7341ad5e6e | ||
|
|
744e6c63b6 | ||
|
|
31aa30e3d0 | ||
|
|
ebb4489c01 | ||
|
|
31b3ae584e | ||
|
|
151afe4663 | ||
|
|
b03f7c1504 | ||
|
|
bceaee6e41 | ||
|
|
0c33c0de2e | ||
|
|
1b32c79a5e | ||
|
|
dd35f1bd68 | ||
|
|
9c0d8bbeb1 | ||
|
|
02753bfc7d | ||
|
|
88ae36f4e1 | ||
|
|
4dcf8f3f45 | ||
|
|
9e82297303 | ||
|
|
14a885f8d0 | ||
|
|
94aee52c64 | ||
|
|
755d3be89b | ||
|
|
6a3ee5fac4 | ||
|
|
6547452136 | ||
|
|
42bf70849c | ||
|
|
236fa2a284 | ||
|
|
2450b435a7 | ||
|
|
353e2977d6 | ||
|
|
641067c399 |
6
.gitignore
vendored
6
.gitignore
vendored
@@ -29,3 +29,9 @@ qtcreator-build/
|
|||||||
/indra/newview/res/viewerRes.rc
|
/indra/newview/res/viewerRes.rc
|
||||||
/indra/newview/res/viewerRes_bc.rc
|
/indra/newview/res/viewerRes_bc.rc
|
||||||
/indra/newview/English.lproj/InfoPlist.strings
|
/indra/newview/English.lproj/InfoPlist.strings
|
||||||
|
/indra/newview/linux_tools/handle_secondlifeprotocol.sh
|
||||||
|
/indra/newview/linux_tools/install.sh
|
||||||
|
/indra/newview/linux_tools/refresh_desktop_app_entry.sh
|
||||||
|
/indra/newview/linux_tools/wrapper.sh
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
29
LICENSES/LEGAL-intel_matrixlib.txt
Normal file
29
LICENSES/LEGAL-intel_matrixlib.txt
Normal file
@@ -0,0 +1,29 @@
|
|||||||
|
INTEL LICENSE AGREEMENT
|
||||||
|
|
||||||
|
IMPORTANT - READ BEFORE COPYING OR USING.
|
||||||
|
Do not use or load this library and any associated materials (collectively,
|
||||||
|
the "Software") until you have read the following terms and conditions. By
|
||||||
|
loading or using the Software, you agree to the terms of this Agreement. If
|
||||||
|
you do not wish to so agree, do not use the Software.
|
||||||
|
|
||||||
|
LICENSE: Subject to the restrictions below, Intel Corporation ("Intel")
|
||||||
|
grants to you the permission to use, copy, distribute and prepare derivative
|
||||||
|
works of this Software for any purpose and without fee, provided, that
|
||||||
|
Intel's copyright notice appear in all copies of the Software files.
|
||||||
|
The distribution of derivative works of the Software is also subject to the
|
||||||
|
following limitations: you (i) are solely responsible to your customers for
|
||||||
|
any liability which may arise from the distribution, (ii) do not make any
|
||||||
|
statement that your product is "certified", or that its performance is
|
||||||
|
guaranteed, by Intel, and (iii) do not use Intel's name or trademarks to
|
||||||
|
market your product without written permission.
|
||||||
|
|
||||||
|
EXCLUSION OF ALL WARRANTIES. The Software is provided "AS IS" without any
|
||||||
|
express or implies warranty of any kind including warranties of
|
||||||
|
merchantability, noninfringement, or fitness for a particular purpose.
|
||||||
|
Intel does not warrant or assume responsibility for the accuracy or
|
||||||
|
completeness of any information contained within the Software.
|
||||||
|
As this Software is given free of charge, in no event shall Intel be liable
|
||||||
|
for any damages whatsoever arising out of the use of or inability to use the
|
||||||
|
Software, even if Intel has been adviced of the possibility of such damages.
|
||||||
|
Intel does not assume any responsibility for any errors which may appear in
|
||||||
|
this Software nor any responsibility to update it.
|
||||||
@@ -4,7 +4,7 @@
|
|||||||
# other commands to guarantee full compatibility
|
# other commands to guarantee full compatibility
|
||||||
# with the version specified
|
# with the version specified
|
||||||
|
|
||||||
cmake_minimum_required(VERSION 2.6.2 FATAL_ERROR)
|
cmake_minimum_required(VERSION 2.8.10 FATAL_ERROR)
|
||||||
|
|
||||||
# Eventually the third-party support modules (cmake/*.cmake) should
|
# Eventually the third-party support modules (cmake/*.cmake) should
|
||||||
# know the full path to all libraries. Until that happens we need
|
# know the full path to all libraries. Until that happens we need
|
||||||
@@ -15,7 +15,7 @@ cmake_minimum_required(VERSION 2.6.2 FATAL_ERROR)
|
|||||||
# CMP0003 to OLD and link to one library (apr) on a per-configuration
|
# CMP0003 to OLD and link to one library (apr) on a per-configuration
|
||||||
# basis to convince CMake to add the proper link directory. This line
|
# basis to convince CMake to add the proper link directory. This line
|
||||||
# can be removed when we use full paths for all libraries.
|
# can be removed when we use full paths for all libraries.
|
||||||
cmake_policy(SET CMP0003 OLD)
|
#cmake_policy(SET CMP0003 OLD)
|
||||||
|
|
||||||
set(ROOT_PROJECT_NAME "Singularity" CACHE STRING
|
set(ROOT_PROJECT_NAME "Singularity" CACHE STRING
|
||||||
"The root project/makefile/solution name. Defaults to Singularity.")
|
"The root project/makefile/solution name. Defaults to Singularity.")
|
||||||
@@ -27,7 +27,6 @@ include(Variables)
|
|||||||
|
|
||||||
# Load versions now. Install locations need them.
|
# Load versions now. Install locations need them.
|
||||||
include(BuildVersion)
|
include(BuildVersion)
|
||||||
|
|
||||||
include(UnixInstall)
|
include(UnixInstall)
|
||||||
|
|
||||||
if (NOT CMAKE_CONFIGURATION_TYPES AND NOT CMAKE_BUILD_TYPE)
|
if (NOT CMAKE_CONFIGURATION_TYPES AND NOT CMAKE_BUILD_TYPE)
|
||||||
@@ -41,6 +40,9 @@ if(NOT STANDALONE)
|
|||||||
# We prepare prebuilt binaries when not building standalone.
|
# We prepare prebuilt binaries when not building standalone.
|
||||||
set(prepare_depends ${CMAKE_BINARY_DIR}/prepare/prebuilt)
|
set(prepare_depends ${CMAKE_BINARY_DIR}/prepare/prebuilt)
|
||||||
endif(NOT STANDALONE)
|
endif(NOT STANDALONE)
|
||||||
|
if(WINDOWS)
|
||||||
|
set(prepare_depends ${prepare_depends} copy_win_libs)
|
||||||
|
endif(WINDOWS)
|
||||||
add_custom_target(prepare DEPENDS ${prepare_depends})
|
add_custom_target(prepare DEPENDS ${prepare_depends})
|
||||||
|
|
||||||
add_subdirectory(cmake)
|
add_subdirectory(cmake)
|
||||||
@@ -107,3 +109,16 @@ add_custom_command(
|
|||||||
DEPENDS ${CMAKE_SOURCE_DIR}/../install.xml
|
DEPENDS ${CMAKE_SOURCE_DIR}/../install.xml
|
||||||
${CMAKE_BINARY_DIR}/DownloadPrebuilt.cmake
|
${CMAKE_BINARY_DIR}/DownloadPrebuilt.cmake
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
|
if(WINDOWS)
|
||||||
|
configure_file(${CMAKE_SOURCE_DIR}/cmake/CopyWinLibs.cmake.in
|
||||||
|
${CMAKE_BINARY_DIR}/CopyWinLibs.cmake @ONLY)
|
||||||
|
add_custom_command(
|
||||||
|
COMMENT "Copying prebuilt libraries to viewer executable directory"
|
||||||
|
OUTPUT ${CMAKE_BINARY_DIR}/CopyWinLibs
|
||||||
|
COMMAND ${CMAKE_COMMAND} -DCUR_CONFIG:STRING=${CMAKE_CFG_INTDIR} -P ${CMAKE_BINARY_DIR}/CopyWinLibs.cmake
|
||||||
|
DEPENDS ${CMAKE_BINARY_DIR}/prepare/prebuilt ${CMAKE_BINARY_DIR}/CopyWinLibs.cmake
|
||||||
|
)
|
||||||
|
add_custom_target(copy_win_libs DEPENDS ${CMAKE_BINARY_DIR}/CopyWinLibs)
|
||||||
|
endif(WINDOWS)
|
||||||
@@ -293,7 +293,36 @@ void AIEngine::add(AIStateMachine* state_machine)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
extern void print_statemachine_diagnostics(U64 total_clocks, U64 max_delta, AIEngine::queued_type::const_reference slowest_state_machine);
|
#if STATE_MACHINE_PROFILING
|
||||||
|
// Called from AIStateMachine::mainloop
|
||||||
|
void print_statemachine_diagnostics(U64 total_clocks, AIStateMachine::StateTimerBase::TimeData& slowest_timer, AIEngine::queued_type::const_reference slowest_element)
|
||||||
|
{
|
||||||
|
AIStateMachine const& slowest_state_machine = slowest_element.statemachine();
|
||||||
|
F64 const tfactor = 1000 / calc_clock_frequency();
|
||||||
|
std::ostringstream msg;
|
||||||
|
|
||||||
|
U64 max_delta = slowest_timer.GetDuration();
|
||||||
|
|
||||||
|
if (total_clocks > max_delta)
|
||||||
|
{
|
||||||
|
msg << "AIStateMachine::mainloop did run for " << (total_clocks * tfactor) << " ms. The slowest ";
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
msg << "AIStateMachine::mainloop: A ";
|
||||||
|
}
|
||||||
|
msg << "state machine " << "(" << slowest_state_machine.getName() << ") " << "ran for " << (max_delta * tfactor) << " ms";
|
||||||
|
if (slowest_state_machine.getRuntime() > max_delta)
|
||||||
|
{
|
||||||
|
msg << " (" << (slowest_state_machine.getRuntime() * tfactor) << " ms in total now)";
|
||||||
|
}
|
||||||
|
msg << ".\n";
|
||||||
|
|
||||||
|
AIStateMachine::StateTimerBase::DumpTimers(msg);
|
||||||
|
|
||||||
|
llwarns << msg.str() << llendl;
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
// MAIN-THREAD
|
// MAIN-THREAD
|
||||||
void AIEngine::mainloop(void)
|
void AIEngine::mainloop(void)
|
||||||
@@ -305,28 +334,33 @@ void AIEngine::mainloop(void)
|
|||||||
queued_element = engine_state_w->list.begin();
|
queued_element = engine_state_w->list.begin();
|
||||||
}
|
}
|
||||||
U64 total_clocks = 0;
|
U64 total_clocks = 0;
|
||||||
#ifndef LL_RELEASE_FOR_DOWNLOAD
|
#if STATE_MACHINE_PROFILING
|
||||||
U64 max_delta = 0;
|
|
||||||
queued_type::value_type slowest_element(NULL);
|
queued_type::value_type slowest_element(NULL);
|
||||||
|
AIStateMachine::StateTimerRoot::TimeData slowest_timer;
|
||||||
#endif
|
#endif
|
||||||
while (queued_element != end)
|
while (queued_element != end)
|
||||||
{
|
{
|
||||||
AIStateMachine& state_machine(queued_element->statemachine());
|
AIStateMachine& state_machine(queued_element->statemachine());
|
||||||
U64 start = get_clock_count();
|
AIStateMachine::StateTimerBase::TimeData time_data;
|
||||||
if (!state_machine.sleep(start))
|
if (!state_machine.sleep(get_clock_count()))
|
||||||
{
|
{
|
||||||
state_machine.multiplex(AIStateMachine::normal_run);
|
AIStateMachine::StateTimerRoot timer(state_machine.getName());
|
||||||
|
state_machine.multiplex(AIStateMachine::normal_run);
|
||||||
|
time_data = timer.GetTimerData();
|
||||||
}
|
}
|
||||||
U64 delta = get_clock_count() - start;
|
if (U64 delta = time_data.GetDuration())
|
||||||
state_machine.add(delta);
|
|
||||||
total_clocks += delta;
|
|
||||||
#ifndef LL_RELEASE_FOR_DOWNLOAD
|
|
||||||
if (delta > max_delta)
|
|
||||||
{
|
{
|
||||||
max_delta = delta;
|
state_machine.add(delta);
|
||||||
slowest_element = *queued_element;
|
total_clocks += delta;
|
||||||
}
|
#if STATE_MACHINE_PROFILING
|
||||||
|
if (delta > slowest_timer.GetDuration())
|
||||||
|
{
|
||||||
|
slowest_element = *queued_element;
|
||||||
|
slowest_timer = time_data;
|
||||||
|
}
|
||||||
#endif
|
#endif
|
||||||
|
}
|
||||||
|
|
||||||
bool active = state_machine.active(this); // This locks mState shortly, so it must be called before locking mEngineState because add() locks mEngineState while holding mState.
|
bool active = state_machine.active(this); // This locks mState shortly, so it must be called before locking mEngineState because add() locks mEngineState while holding mState.
|
||||||
engine_state_type_wat engine_state_w(mEngineState);
|
engine_state_type_wat engine_state_w(mEngineState);
|
||||||
if (!active)
|
if (!active)
|
||||||
@@ -340,8 +374,8 @@ void AIEngine::mainloop(void)
|
|||||||
}
|
}
|
||||||
if (total_clocks >= sMaxCount)
|
if (total_clocks >= sMaxCount)
|
||||||
{
|
{
|
||||||
#ifndef LL_RELEASE_FOR_DOWNLOAD
|
#if STATE_MACHINE_PROFILING
|
||||||
print_statemachine_diagnostics(total_clocks, max_delta, slowest_element);
|
print_statemachine_diagnostics(total_clocks, slowest_timer, slowest_element);
|
||||||
#endif
|
#endif
|
||||||
Dout(dc::statemachine, "Sorting " << engine_state_w->list.size() << " state machines.");
|
Dout(dc::statemachine, "Sorting " << engine_state_w->list.size() << " state machines.");
|
||||||
engine_state_w->list.sort(QueueElementComp());
|
engine_state_w->list.sort(QueueElementComp());
|
||||||
@@ -373,7 +407,7 @@ void AIEngine::setMaxCount(F32 StateMachineMaxTime)
|
|||||||
sMaxCount = calc_clock_frequency() * StateMachineMaxTime / 1000;
|
sMaxCount = calc_clock_frequency() * StateMachineMaxTime / 1000;
|
||||||
}
|
}
|
||||||
|
|
||||||
#if defined(CWDEBUG) || defined(DEBUG_CURLIO)
|
#ifdef CWDEBUG
|
||||||
char const* AIStateMachine::event_str(event_type event)
|
char const* AIStateMachine::event_str(event_type event)
|
||||||
{
|
{
|
||||||
switch(event)
|
switch(event)
|
||||||
@@ -406,7 +440,7 @@ void AIStateMachine::multiplex(event_type event)
|
|||||||
// our need to run (by us having set need_run), so there is no need to run
|
// our need to run (by us having set need_run), so there is no need to run
|
||||||
// ourselves.
|
// ourselves.
|
||||||
llassert(!mMultiplexMutex.isSelfLocked()); // We may never enter recursively!
|
llassert(!mMultiplexMutex.isSelfLocked()); // We may never enter recursively!
|
||||||
if (!mMultiplexMutex.tryLock())
|
if (!mMultiplexMutex.try_lock())
|
||||||
{
|
{
|
||||||
Dout(dc::statemachine(mSMDebug), "Leaving because it is already being run [" << (void*)this << "]");
|
Dout(dc::statemachine(mSMDebug), "Leaving because it is already being run [" << (void*)this << "]");
|
||||||
return;
|
return;
|
||||||
@@ -728,7 +762,7 @@ void AIStateMachine::multiplex(event_type event)
|
|||||||
//=========================================
|
//=========================================
|
||||||
|
|
||||||
// Release the lock on mMultiplexMutex *first*, before releasing the lock on mState,
|
// Release the lock on mMultiplexMutex *first*, before releasing the lock on mState,
|
||||||
// to avoid to ever call the tryLock() and fail, while this thread isn't still
|
// to avoid to ever call the try_lock() and fail, while this thread isn't still
|
||||||
// BEFORE the critical area of mState!
|
// BEFORE the critical area of mState!
|
||||||
|
|
||||||
mMultiplexMutex.unlock();
|
mMultiplexMutex.unlock();
|
||||||
@@ -752,6 +786,22 @@ void AIStateMachine::multiplex(event_type event)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#if STATE_MACHINE_PROFILING
|
||||||
|
std::vector<AIStateMachine::StateTimerBase*> AIStateMachine::StateTimerBase::mTimerStack;
|
||||||
|
AIStateMachine::StateTimerBase::TimeData AIStateMachine::StateTimerBase::TimeData::sRoot("");
|
||||||
|
void AIStateMachine::StateTimer::TimeData::DumpTimer(std::ostringstream& msg, std::string prefix)
|
||||||
|
{
|
||||||
|
F64 const tfactor = 1000 / calc_clock_frequency();
|
||||||
|
msg << prefix << mName << " " << (mEnd - mStart)*tfactor << "ms" << std::endl;
|
||||||
|
prefix.push_back(' ');
|
||||||
|
std::vector<TimeData>::iterator it;
|
||||||
|
for (it = mChildren.begin(); it != mChildren.end(); ++it)
|
||||||
|
{
|
||||||
|
it->DumpTimer(msg, prefix);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
AIStateMachine::state_type AIStateMachine::begin_loop(base_state_type base_state)
|
AIStateMachine::state_type AIStateMachine::begin_loop(base_state_type base_state)
|
||||||
{
|
{
|
||||||
DoutEntering(dc::statemachine(mSMDebug), "AIStateMachine::begin_loop(" << state_str(base_state) << ") [" << (void*)this << "]");
|
DoutEntering(dc::statemachine(mSMDebug), "AIStateMachine::begin_loop(" << state_str(base_state) << ") [" << (void*)this << "]");
|
||||||
@@ -1212,7 +1262,7 @@ void AIStateMachine::abort(void)
|
|||||||
multiplex(insert_abort);
|
multiplex(insert_abort);
|
||||||
}
|
}
|
||||||
// Block until the current run finished.
|
// Block until the current run finished.
|
||||||
if (!mRunMutex.tryLock())
|
if (!mRunMutex.try_lock())
|
||||||
{
|
{
|
||||||
llwarns << "AIStateMachine::abort() blocks because the statemachine is still executing code in another thread." << llendl;
|
llwarns << "AIStateMachine::abort() blocks because the statemachine is still executing code in another thread." << llendl;
|
||||||
mRunMutex.lock();
|
mRunMutex.lock();
|
||||||
|
|||||||
@@ -36,6 +36,7 @@
|
|||||||
|
|
||||||
#include "aithreadsafe.h"
|
#include "aithreadsafe.h"
|
||||||
#include <llpointer.h>
|
#include <llpointer.h>
|
||||||
|
#include "lltimer.h"
|
||||||
#include <list>
|
#include <list>
|
||||||
#include <boost/signals2.hpp>
|
#include <boost/signals2.hpp>
|
||||||
|
|
||||||
@@ -98,11 +99,143 @@ class AIEngine
|
|||||||
extern AIEngine gMainThreadEngine;
|
extern AIEngine gMainThreadEngine;
|
||||||
extern AIEngine gStateMachineThreadEngine;
|
extern AIEngine gStateMachineThreadEngine;
|
||||||
|
|
||||||
|
#ifndef STATE_MACHINE_PROFILING
|
||||||
|
#ifndef LL_RELEASE_FOR_DOWNLOAD
|
||||||
|
#define STATE_MACHINE_PROFILING 1
|
||||||
|
#endif
|
||||||
|
#endif
|
||||||
|
|
||||||
class AIStateMachine : public LLThreadSafeRefCount
|
class AIStateMachine : public LLThreadSafeRefCount
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
typedef U32 state_type; //!< The type of run_state
|
typedef U32 state_type; //!< The type of run_state
|
||||||
|
|
||||||
|
// A simple timer class that will calculate time delta between ctor and GetTimerData call.
|
||||||
|
// Time data is stored as a nested TimeData object.
|
||||||
|
// If STATE_MACHINE_PROFILING is defined then a stack of all StateTimers from root is maintained for debug output.
|
||||||
|
class StateTimerBase
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
class TimeData
|
||||||
|
{
|
||||||
|
friend class StateTimerBase;
|
||||||
|
public:
|
||||||
|
TimeData() : mStart(-1), mEnd(-1) {}
|
||||||
|
U64 GetDuration() { return mEnd - mStart; }
|
||||||
|
private:
|
||||||
|
U64 mStart, mEnd;
|
||||||
|
|
||||||
|
#if !STATE_MACHINE_PROFILING
|
||||||
|
TimeData(const std::string& name) : mStart(get_clock_count()), mEnd(get_clock_count()) {}
|
||||||
|
#else
|
||||||
|
TimeData(const std::string& name) : mName(name), mStart(get_clock_count()), mEnd(get_clock_count()) {}
|
||||||
|
void DumpTimer(std::ostringstream& msg, std::string prefix);
|
||||||
|
std::vector<TimeData> mChildren;
|
||||||
|
std::string mName;
|
||||||
|
static TimeData sRoot;
|
||||||
|
#endif
|
||||||
|
};
|
||||||
|
#if !STATE_MACHINE_PROFILING
|
||||||
|
StateTimerBase(const std::string& name) : mData(name) {}
|
||||||
|
~StateTimerBase() {}
|
||||||
|
protected:
|
||||||
|
TimeData mData;
|
||||||
|
// Return a copy of the underlying timer data.
|
||||||
|
// This allows the data live beyond the scope of the state timer.
|
||||||
|
public:
|
||||||
|
const TimeData GetTimerData()
|
||||||
|
{
|
||||||
|
mData.mEnd = get_clock_count(); //set mEnd to current time, since GetTimerData() will always be called before the dtor, obv.
|
||||||
|
return mData;
|
||||||
|
}
|
||||||
|
#else
|
||||||
|
protected:
|
||||||
|
// Ctors/dtors are hidden. Only StateTimerRoot and StateTimer are permitted to access them.
|
||||||
|
StateTimerBase() : mData(NULL) {}
|
||||||
|
~StateTimerBase()
|
||||||
|
{
|
||||||
|
// If mData is null then the timer was not registered due to being in the wrong thread or the root timer wasn't in the expected state.
|
||||||
|
if (!mData)
|
||||||
|
return;
|
||||||
|
mData->mEnd = get_clock_count();
|
||||||
|
mTimerStack.pop_back();
|
||||||
|
}
|
||||||
|
|
||||||
|
// Also hide internals from everything except StateTimerRoot and StateTimer
|
||||||
|
bool AddAsRoot(const std::string& name)
|
||||||
|
{
|
||||||
|
|
||||||
|
if (!is_main_thread())
|
||||||
|
return true; //Ignoring this timer, but pretending it was added.
|
||||||
|
if (!mTimerStack.empty())
|
||||||
|
return false;
|
||||||
|
TimeData::sRoot = TimeData(name);
|
||||||
|
mData = &TimeData::sRoot;
|
||||||
|
mData->mChildren.clear();
|
||||||
|
mTimerStack.push_back(this);
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
bool AddAsChild(const std::string& name)
|
||||||
|
{
|
||||||
|
if (!is_main_thread())
|
||||||
|
return true; //Ignoring this timer, but pretending it was added.
|
||||||
|
if (mTimerStack.empty())
|
||||||
|
return false;
|
||||||
|
mTimerStack.back()->mData->mChildren.push_back(TimeData(name));
|
||||||
|
mData = &mTimerStack.back()->mData->mChildren.back();
|
||||||
|
mTimerStack.push_back(this);
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
TimeData* mData;
|
||||||
|
static std::vector<StateTimerBase*> mTimerStack;
|
||||||
|
|
||||||
|
public:
|
||||||
|
// Debug spew
|
||||||
|
static void DumpTimers(std::ostringstream& msg)
|
||||||
|
{
|
||||||
|
TimeData::sRoot.DumpTimer(msg, "");
|
||||||
|
}
|
||||||
|
|
||||||
|
// Return a copy of the underlying timer data.
|
||||||
|
// This allows the data live beyond the scope of the state timer.
|
||||||
|
const TimeData GetTimerData() const
|
||||||
|
{
|
||||||
|
if (mData)
|
||||||
|
{
|
||||||
|
TimeData ret = *mData;
|
||||||
|
ret.mEnd = get_clock_count(); //set mEnd to current time, since GetTimerData() will always be called before the dtor, obv.
|
||||||
|
return ret;
|
||||||
|
}
|
||||||
|
return TimeData();
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
};
|
||||||
|
public:
|
||||||
|
#if !STATE_MACHINE_PROFILING
|
||||||
|
typedef StateTimerBase StateTimerRoot;
|
||||||
|
typedef StateTimerBase StateTimer;
|
||||||
|
#else
|
||||||
|
class StateTimerRoot : public StateTimerBase
|
||||||
|
{ //A StateTimerRoot can become a child if a root already exists.
|
||||||
|
public:
|
||||||
|
StateTimerRoot(const std::string& name)
|
||||||
|
{
|
||||||
|
if(!AddAsRoot(name))
|
||||||
|
AddAsChild(name);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
class StateTimer : public StateTimerBase
|
||||||
|
{ //A StateTimer can never become a root
|
||||||
|
public:
|
||||||
|
StateTimer(const std::string& name)
|
||||||
|
{
|
||||||
|
AddAsChild(name);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
#endif
|
||||||
|
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
// The type of event that causes multiplex() to be called.
|
// The type of event that causes multiplex() to be called.
|
||||||
enum event_type {
|
enum event_type {
|
||||||
@@ -197,7 +330,7 @@ class AIStateMachine : public LLThreadSafeRefCount
|
|||||||
bool mDebugAdvanceStatePending; // True while advance_state() was called by not handled yet.
|
bool mDebugAdvanceStatePending; // True while advance_state() was called by not handled yet.
|
||||||
bool mDebugRefCalled; // True when ref() is called (or will be called within the critial area of mMultiplexMutex).
|
bool mDebugRefCalled; // True when ref() is called (or will be called within the critial area of mMultiplexMutex).
|
||||||
#endif
|
#endif
|
||||||
#if defined(CWDEBUG) || defined(DEBUG_CURLIO)
|
#ifdef CWDEBUG
|
||||||
protected:
|
protected:
|
||||||
bool mSMDebug; // Print debug output only when true.
|
bool mSMDebug; // Print debug output only when true.
|
||||||
#endif
|
#endif
|
||||||
@@ -210,7 +343,7 @@ class AIStateMachine : public LLThreadSafeRefCount
|
|||||||
mThreadId(AIThreadID::none), mDebugLastState(bs_killed), mDebugShouldRun(false), mDebugAborted(false), mDebugContPending(false),
|
mThreadId(AIThreadID::none), mDebugLastState(bs_killed), mDebugShouldRun(false), mDebugAborted(false), mDebugContPending(false),
|
||||||
mDebugSetStatePending(false), mDebugAdvanceStatePending(false), mDebugRefCalled(false),
|
mDebugSetStatePending(false), mDebugAdvanceStatePending(false), mDebugRefCalled(false),
|
||||||
#endif
|
#endif
|
||||||
#if defined(CWDEBUG) || defined(DEBUG_CURLIO)
|
#ifdef CWDEBUG
|
||||||
mSMDebug(debug),
|
mSMDebug(debug),
|
||||||
#endif
|
#endif
|
||||||
mRuntime(0)
|
mRuntime(0)
|
||||||
@@ -295,13 +428,16 @@ class AIStateMachine : public LLThreadSafeRefCount
|
|||||||
|
|
||||||
// Return stringified state, for debugging purposes.
|
// Return stringified state, for debugging purposes.
|
||||||
char const* state_str(base_state_type state);
|
char const* state_str(base_state_type state);
|
||||||
#if defined(CWDEBUG) || defined(DEBUG_CURLIO)
|
#ifdef CWDEBUG
|
||||||
char const* event_str(event_type event);
|
char const* event_str(event_type event);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
void add(U64 count) { mRuntime += count; }
|
void add(U64 count) { mRuntime += count; }
|
||||||
U64 getRuntime(void) const { return mRuntime; }
|
U64 getRuntime(void) const { return mRuntime; }
|
||||||
|
|
||||||
|
// For diagnostics. Every derived class must override this.
|
||||||
|
virtual const char* getName() const = 0;
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
virtual void initialize_impl(void) = 0;
|
virtual void initialize_impl(void) = 0;
|
||||||
virtual void multiplex_impl(state_type run_state) = 0;
|
virtual void multiplex_impl(state_type run_state) = 0;
|
||||||
|
|||||||
@@ -182,7 +182,7 @@ class AIStateMachineThreadBase : public AIStateMachine {
|
|||||||
|
|
||||||
protected:
|
protected:
|
||||||
AIStateMachineThreadBase(CWD_ONLY(bool debug))
|
AIStateMachineThreadBase(CWD_ONLY(bool debug))
|
||||||
#if defined(CWDEBUG) || defined(DEBUG_CURLIO)
|
#ifdef CWDEBUG
|
||||||
: AIStateMachine(debug)
|
: AIStateMachine(debug)
|
||||||
#endif
|
#endif
|
||||||
{ }
|
{ }
|
||||||
@@ -222,7 +222,7 @@ class AIStateMachineThread : public AIStateMachineThreadBase {
|
|||||||
public:
|
public:
|
||||||
// Constructor.
|
// Constructor.
|
||||||
AIStateMachineThread(CWD_ONLY(bool debug))
|
AIStateMachineThread(CWD_ONLY(bool debug))
|
||||||
#if defined(CWDEBUG) || defined(DEBUG_CURLIO)
|
#ifdef CWDEBUG
|
||||||
: AIStateMachineThreadBase(debug)
|
: AIStateMachineThreadBase(debug)
|
||||||
#endif
|
#endif
|
||||||
{
|
{
|
||||||
@@ -232,6 +232,13 @@ class AIStateMachineThread : public AIStateMachineThreadBase {
|
|||||||
// Accessor.
|
// Accessor.
|
||||||
THREAD_IMPL& thread_impl(void) { return mThreadImpl; }
|
THREAD_IMPL& thread_impl(void) { return mThreadImpl; }
|
||||||
|
|
||||||
|
/*virtual*/ const char* getName() const
|
||||||
|
{
|
||||||
|
#define STRIZE(arg) #arg
|
||||||
|
return "AIStateMachineThread<"STRIZE(THREAD_IMPL)">";
|
||||||
|
#undef STRIZE
|
||||||
|
}
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
/*virtual*/ AIThreadImpl& impl(void) { return mThreadImpl; }
|
/*virtual*/ AIThreadImpl& impl(void) { return mThreadImpl; }
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -77,7 +77,7 @@ class AITimer : public AIStateMachine {
|
|||||||
|
|
||||||
public:
|
public:
|
||||||
AITimer(CWD_ONLY(bool debug = false)) :
|
AITimer(CWD_ONLY(bool debug = false)) :
|
||||||
#if defined(CWDEBUG) || defined(DEBUG_CURLIO)
|
#ifdef CWDEBUG
|
||||||
AIStateMachine(debug),
|
AIStateMachine(debug),
|
||||||
#endif
|
#endif
|
||||||
mInterval(0) { DoutEntering(dc::statemachine(mSMDebug), "AITimer(void) [" << (void*)this << "]"); }
|
mInterval(0) { DoutEntering(dc::statemachine(mSMDebug), "AITimer(void) [" << (void*)this << "]"); }
|
||||||
@@ -98,6 +98,8 @@ class AITimer : public AIStateMachine {
|
|||||||
*/
|
*/
|
||||||
F64 getInterval(void) const { return mInterval; }
|
F64 getInterval(void) const { return mInterval; }
|
||||||
|
|
||||||
|
/*virtual*/ const char* getName() const { return "AITimer"; }
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
// Call finish() (or abort()), not delete.
|
// Call finish() (or abort()), not delete.
|
||||||
/*virtual*/ ~AITimer() { DoutEntering(dc::statemachine(mSMDebug), "~AITimer() [" << (void*)this << "]"); mFrameTimer.cancel(); }
|
/*virtual*/ ~AITimer() { DoutEntering(dc::statemachine(mSMDebug), "~AITimer() [" << (void*)this << "]"); mFrameTimer.cancel(); }
|
||||||
|
|||||||
@@ -45,15 +45,17 @@ if (WINDOWS)
|
|||||||
if (MSVC10)
|
if (MSVC10)
|
||||||
set(MSVC_DIR 10.0)
|
set(MSVC_DIR 10.0)
|
||||||
set(MSVC_SUFFIX 100)
|
set(MSVC_SUFFIX 100)
|
||||||
|
elseif (MSVC12)
|
||||||
|
set(MSVC_DIR 12.0)
|
||||||
|
set(MSVC_SUFFIX 120)
|
||||||
endif (MSVC10)
|
endif (MSVC10)
|
||||||
if (MSVC11)
|
|
||||||
set(MSVC_DIR 11.0)
|
|
||||||
set(MSVC_SUFFIX 110)
|
|
||||||
endif (MSVC11)
|
|
||||||
|
|
||||||
# Remove default /Zm1000 flag that cmake inserts
|
# Remove default /Zm1000 flag that cmake inserts
|
||||||
string (REPLACE "/Zm1000" " " CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}")
|
string (REPLACE "/Zm1000" " " CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}")
|
||||||
|
|
||||||
|
# Always use /Zm140
|
||||||
|
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /Zm140")
|
||||||
|
|
||||||
# Don't build DLLs.
|
# Don't build DLLs.
|
||||||
set(BUILD_SHARED_LIBS OFF)
|
set(BUILD_SHARED_LIBS OFF)
|
||||||
|
|
||||||
@@ -82,21 +84,27 @@ if (WINDOWS)
|
|||||||
/W3
|
/W3
|
||||||
/c
|
/c
|
||||||
/Zc:forScope
|
/Zc:forScope
|
||||||
/Zc:wchar_t-
|
/Zc:wchar_t-
|
||||||
/nologo
|
/nologo
|
||||||
/Oy-
|
/Oy-
|
||||||
)
|
)
|
||||||
|
|
||||||
# SSE2 is implied on win64
|
# SSE2 is implied on win64
|
||||||
if(WORD_SIZE EQUAL 32)
|
if(WORD_SIZE EQUAL 32)
|
||||||
add_definitions(/arch:SSE2)
|
add_definitions(/arch:SSE2 /D_ATL_XP_TARGETING)
|
||||||
else(WORD_SIZE EQUAL 32)
|
else(WORD_SIZE EQUAL 32)
|
||||||
set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} /wd4267 /wd4250 /wd4244")
|
set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} /wd4267 /wd4250 /wd4244")
|
||||||
endif(WORD_SIZE EQUAL 32)
|
endif(WORD_SIZE EQUAL 32)
|
||||||
|
|
||||||
# configure win32 API for windows XP+ compatibility
|
if (MSVC12)
|
||||||
set(WINVER "0x0501" CACHE STRING "Win32 API Target version (see http://msdn.microsoft.com/en-us/library/aa383745%28v=VS.85%29.aspx)")
|
# configure win32 API for windows vista+ compatibility
|
||||||
add_definitions("/DWINVER=${WINVER}" "/D_WIN32_WINNT=${WINVER}")
|
set(WINVER "0x0600" CACHE STRING "Win32 API Target version (see http://msdn.microsoft.com/en-us/library/aa383745%28v=VS.85%29.aspx)")
|
||||||
|
add_definitions("/DWINVER=${WINVER}" "/D_WIN32_WINNT=${WINVER}")
|
||||||
|
else (MSVC12)
|
||||||
|
# configure win32 API for windows XP+ compatibility
|
||||||
|
set(WINVER "0x0501" CACHE STRING "Win32 API Target version (see http://msdn.microsoft.com/en-us/library/aa383745%28v=VS.85%29.aspx)")
|
||||||
|
add_definitions("/DWINVER=${WINVER}" "/D_WIN32_WINNT=${WINVER}")
|
||||||
|
endif (MSVC12)
|
||||||
|
|
||||||
# Are we using the crummy Visual Studio KDU build workaround?
|
# Are we using the crummy Visual Studio KDU build workaround?
|
||||||
if (NOT DISABLE_FATAL_WARNINGS)
|
if (NOT DISABLE_FATAL_WARNINGS)
|
||||||
@@ -246,30 +254,28 @@ endif (LINUX)
|
|||||||
|
|
||||||
|
|
||||||
if (DARWIN)
|
if (DARWIN)
|
||||||
add_definitions(-DLL_DARWIN=1 -D_XOPEN_SOURCE)
|
add_definitions(-DLL_DARWIN=1)
|
||||||
set(CMAKE_CXX_LINK_FLAGS "-Wl,-headerpad_max_install_names,-search_paths_first")
|
set(CMAKE_CXX_LINK_FLAGS "-Wl,-no_compact_unwind -Wl,-headerpad_max_install_names,-search_paths_first")
|
||||||
set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_CXX_LINK_FLAGS}")
|
set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_CXX_LINK_FLAGS}")
|
||||||
|
set(DARWIN_extra_cstar_flags "-g")
|
||||||
if ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU")
|
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${DARWIN_extra_cstar_flags} -ftemplate-depth=256")
|
||||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -mlong-branch")
|
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${DARWIN_extra_cstar_flags}")
|
||||||
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -mlong-branch")
|
# NOTE: it's critical that the optimization flag is put in front.
|
||||||
# NOTE: it's critical that the optimization flag is put in front.
|
# NOTE: it's critical to have both CXX_FLAGS and C_FLAGS covered.
|
||||||
# NOTE: it's critical to have both CXX_FLAGS and C_FLAGS covered.
|
set(CMAKE_CXX_FLAGS_RELWITHDEBINFO "-O0 ${CMAKE_CXX_FLAGS_RELWITHDEBINFO}")
|
||||||
set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -O3 -msse3 -mtune=generic -mfpmath=sse ${GCC_EXTRA_OPTIMIZATIONS}")
|
set(CMAKE_C_FLAGS_RELWITHDEBINFO "-O0 ${CMAKE_C_FLAGS_RELWITHDEBINFO}")
|
||||||
set(CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE} -O3 -msse3 -mtune=generic -mfpmath=sse ${GCC_EXTRA_OPTIMIZATIONS}")
|
set(CMAKE_XCODE_ATTRIBUTE_CLANG_X86_VECTOR_INSTRUCTIONS SSE3)
|
||||||
set(CMAKE_CXX_FLAGS_RELWITHDEBINFO "${CMAKE_CXX_FLAGS_RELWITHDEBINFO} -O3 -msse3 -mtune=generic -mfpmath=sse ${GCC_EXTRA_OPTIMIZATIONS}")
|
set(CMAKE_XCODE_ATTRIBUTE_GCC_OPTIMIZATION_LEVEL -O3)
|
||||||
set(CMAKE_C_FLAGS_RELWITHDEBINFO "${CMAKE_C_FLAGS_RELWITHDEBINFO} -O3 -msse3 -mtune=generic -mfpmath=sse ${GCC_EXTRA_OPTIMIZATIONS}")
|
set(CMAKE_CXX_FLAGS_RELEASE "-O3 -msse3 ${CMAKE_CXX_FLAGS_RELEASE}")
|
||||||
elseif ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang")
|
set(CMAKE_C_FLAGS_RELEASE "-O3 -msse3 ${CMAKE_C_FLAGS_RELEASE}")
|
||||||
# NOTE: it's critical that the optimization flag is put in front.
|
if (XCODE_VERSION GREATER 4.2)
|
||||||
# NOTE: it's critical to have both CXX_FLAGS and C_FLAGS covered.
|
set(ENABLE_SIGNING TRUE)
|
||||||
set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -O3 -msse3")
|
set(SIGNING_IDENTITY "Developer ID Application: Linden Research, Inc.")
|
||||||
set(CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE} -O3 -msse3")
|
endif (XCODE_VERSION GREATER 4.2)
|
||||||
set(CMAKE_CXX_FLAGS_RELWITHDEBINFO "${CMAKE_CXX_FLAGS_RELWITHDEBINFO} -O3 -msse3")
|
|
||||||
set(CMAKE_C_FLAGS_RELWITHDEBINFO "${CMAKE_C_FLAGS_RELWITHDEBINFO} -O3 -msse3")
|
|
||||||
endif()
|
|
||||||
endif (DARWIN)
|
endif (DARWIN)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
if (LINUX OR DARWIN)
|
if (LINUX OR DARWIN)
|
||||||
if ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU")
|
if ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU")
|
||||||
add_definitions(-DLL_GNUC=1)
|
add_definitions(-DLL_GNUC=1)
|
||||||
@@ -277,13 +283,11 @@ if (LINUX OR DARWIN)
|
|||||||
set(UNIX_CXX_WARNINGS "${UNIX_WARNINGS} -Wno-reorder -Wno-non-virtual-dtor -Woverloaded-virtual")
|
set(UNIX_CXX_WARNINGS "${UNIX_WARNINGS} -Wno-reorder -Wno-non-virtual-dtor -Woverloaded-virtual")
|
||||||
elseif ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang")
|
elseif ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang")
|
||||||
add_definitions(-DLL_CLANG=1)
|
add_definitions(-DLL_CLANG=1)
|
||||||
set(UNIX_WARNINGS "-Wall -Wno-sign-compare -Wno-trigraphs -Wno-tautological-compare -Wno-char-subscripts -Wno-gnu -Wno-logical-op-parentheses -Wno-non-virtual-dtor")
|
set(UNIX_WARNINGS "-Wall -Wno-sign-compare -Wno-trigraphs -Wno-tautological-compare -Wno-char-subscripts -Wno-gnu -Wno-logical-op-parentheses -Wno-logical-not-parentheses -Wno-non-virtual-dtor -Wno-deprecated")
|
||||||
set(UNIX_WARNINGS "${UNIX_WARNINGS} -Woverloaded-virtual -Wno-parentheses-equality -Wno-reorder -Wno-unused-function -Wno-unused-value -Wno-unused-variable")
|
set(UNIX_WARNINGS "${UNIX_WARNINGS} -Woverloaded-virtual -Wno-parentheses-equality -Wno-reorder -Wno-unused-function -Wno-unused-value -Wno-unused-variable -Wno-unused-private-field -Wno-parentheses")
|
||||||
set(UNIX_CXX_WARNINGS "${UNIX_WARNINGS}")
|
set(UNIX_CXX_WARNINGS "${UNIX_WARNINGS}")
|
||||||
elseif ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Intel")
|
elseif ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Intel")
|
||||||
add_definitions(-DLL_ICC=1)
|
add_definitions(-DLL_ICC=1)
|
||||||
set(UNIX_WARNINGS "-wd327 -wd597 -wd858")
|
|
||||||
set(UNIX_CXX_WARNINGS "${UNIX_WARNINGS}")
|
|
||||||
endif ()
|
endif ()
|
||||||
|
|
||||||
if (NOT DISABLE_FATAL_WARNINGS)
|
if (NOT DISABLE_FATAL_WARNINGS)
|
||||||
|
|||||||
@@ -14,25 +14,25 @@ else (STANDALONE)
|
|||||||
use_prebuilt_binary(apr_suite)
|
use_prebuilt_binary(apr_suite)
|
||||||
if (WINDOWS)
|
if (WINDOWS)
|
||||||
set(APR_LIBRARIES
|
set(APR_LIBRARIES
|
||||||
debug ${ARCH_PREBUILT_DIRS_DEBUG}/libapr-1.lib
|
debug libapr-1.lib
|
||||||
optimized ${ARCH_PREBUILT_DIRS_RELEASE}/libapr-1.lib
|
optimized libapr-1.lib
|
||||||
)
|
)
|
||||||
set(APRICONV_LIBRARIES
|
set(APRICONV_LIBRARIES
|
||||||
debug ${ARCH_PREBUILT_DIRS_DEBUG}/libapriconv-1.lib
|
debug libapriconv-1.lib
|
||||||
optimized ${ARCH_PREBUILT_DIRS_RELEASE}/libapriconv-1.lib
|
optimized libapriconv-1.lib
|
||||||
)
|
)
|
||||||
set(APRUTIL_LIBRARIES
|
set(APRUTIL_LIBRARIES
|
||||||
debug ${ARCH_PREBUILT_DIRS_DEBUG}/libaprutil-1.lib ${APRICONV_LIBRARIES}
|
debug libaprutil-1.lib
|
||||||
optimized ${ARCH_PREBUILT_DIRS_RELEASE}/libaprutil-1.lib ${APRICONV_LIBRARIES}
|
optimized libaprutil-1.lib
|
||||||
)
|
)
|
||||||
elseif (DARWIN)
|
elseif (DARWIN)
|
||||||
set(APR_LIBRARIES
|
set(APR_LIBRARIES
|
||||||
debug ${ARCH_PREBUILT_DIRS_DEBUG}/libapr-1.0.dylib
|
debug libapr-1.0.dylib
|
||||||
optimized ${ARCH_PREBUILT_DIRS_RELEASE}/libapr-1.0.dylib
|
optimized libapr-1.0.dylib
|
||||||
)
|
)
|
||||||
set(APRUTIL_LIBRARIES
|
set(APRUTIL_LIBRARIES
|
||||||
debug ${ARCH_PREBUILT_DIRS_DEBUG}/libaprutil-1.dylib
|
debug libaprutil-1.dylib
|
||||||
optimized ${ARCH_PREBUILT_DIRS_RELEASE}/libaprutil-1.dylib
|
optimized libaprutil-1.dylib
|
||||||
)
|
)
|
||||||
set(APRICONV_LIBRARIES iconv)
|
set(APRICONV_LIBRARIES iconv)
|
||||||
else (WINDOWS)
|
else (WINDOWS)
|
||||||
@@ -40,7 +40,10 @@ else (STANDALONE)
|
|||||||
set(APRUTIL_LIBRARIES aprutil-1)
|
set(APRUTIL_LIBRARIES aprutil-1)
|
||||||
set(APRICONV_LIBRARIES iconv)
|
set(APRICONV_LIBRARIES iconv)
|
||||||
endif (WINDOWS)
|
endif (WINDOWS)
|
||||||
set(APR_INCLUDE_DIR ${LIBS_PREBUILT_DIR}/${LL_ARCH_DIR}/include/apr-1)
|
set(APR_INCLUDE_DIR
|
||||||
|
${LIBS_PREBUILT_DIR}/include/apr-1
|
||||||
|
${LIBS_PREBUILT_LEGACY_DIR}/include/apr-1
|
||||||
|
)
|
||||||
|
|
||||||
if (LINUX)
|
if (LINUX)
|
||||||
list(APPEND APRUTIL_LIBRARIES ${DB_LIBRARIES})
|
list(APPEND APRUTIL_LIBRARIES ${DB_LIBRARIES})
|
||||||
|
|||||||
@@ -9,7 +9,10 @@ if (STANDALONE)
|
|||||||
pkg_check_modules(VORBISFILE REQUIRED vorbisfile)
|
pkg_check_modules(VORBISFILE REQUIRED vorbisfile)
|
||||||
else (STANDALONE)
|
else (STANDALONE)
|
||||||
use_prebuilt_binary(ogg-vorbis)
|
use_prebuilt_binary(ogg-vorbis)
|
||||||
set(VORBIS_INCLUDE_DIRS ${LIBS_PREBUILT_DIR}/${LL_ARCH_DIR}/include)
|
set(VORBIS_INCLUDE_DIRS
|
||||||
|
${LIBS_PREBUILT_DIR}/include
|
||||||
|
${LIBS_PREBUILT_LEGACY_DIR}/include
|
||||||
|
)
|
||||||
set(VORBISENC_INCLUDE_DIRS ${VORBIS_INCLUDE_DIRS})
|
set(VORBISENC_INCLUDE_DIRS ${VORBIS_INCLUDE_DIRS})
|
||||||
set(VORBISFILE_INCLUDE_DIRS ${VORBIS_INCLUDE_DIRS})
|
set(VORBISFILE_INCLUDE_DIRS ${VORBIS_INCLUDE_DIRS})
|
||||||
|
|
||||||
|
|||||||
@@ -13,5 +13,8 @@ else (STANDALONE)
|
|||||||
else (LINUX)
|
else (LINUX)
|
||||||
set(DB_LIBRARIES db-4.2)
|
set(DB_LIBRARIES db-4.2)
|
||||||
endif (LINUX)
|
endif (LINUX)
|
||||||
set(DB_INCLUDE_DIRS ${LIBS_PREBUILT_DIR}/${LL_ARCH_DIR}/include)
|
set(DB_INCLUDE_DIRS
|
||||||
|
${LIBS_PREBUILT_DIR}/include
|
||||||
|
${LIBS_PREBUILT_LEGACY_DIR}/include
|
||||||
|
)
|
||||||
endif (STANDALONE)
|
endif (STANDALONE)
|
||||||
|
|||||||
@@ -11,7 +11,10 @@ if (STANDALONE)
|
|||||||
find_package(Boost 1.51.0 COMPONENTS date_time filesystem program_options regex system thread wave context)
|
find_package(Boost 1.51.0 COMPONENTS date_time filesystem program_options regex system thread wave context)
|
||||||
else (STANDALONE)
|
else (STANDALONE)
|
||||||
use_prebuilt_binary(boost)
|
use_prebuilt_binary(boost)
|
||||||
set(Boost_INCLUDE_DIRS ${LIBS_PREBUILT_DIR}/${LL_ARCH_DIR}/include)
|
set(Boost_INCLUDE_DIRS
|
||||||
|
${LIBS_PREBUILT_DIR}/include
|
||||||
|
${LIBS_PREBUILT_LEGACY_DIR}/include
|
||||||
|
)
|
||||||
set(Boost_VERSION "1.52")
|
set(Boost_VERSION "1.52")
|
||||||
|
|
||||||
if (WINDOWS)
|
if (WINDOWS)
|
||||||
|
|||||||
@@ -38,11 +38,6 @@ if (WINDOWS)
|
|||||||
${CMAKE_SOURCE_DIR}/newview/res/viewerRes.rc.in
|
${CMAKE_SOURCE_DIR}/newview/res/viewerRes.rc.in
|
||||||
${CMAKE_SOURCE_DIR}/newview/res/viewerRes.rc
|
${CMAKE_SOURCE_DIR}/newview/res/viewerRes.rc
|
||||||
)
|
)
|
||||||
|
|
||||||
configure_file(
|
|
||||||
${CMAKE_SOURCE_DIR}/newview/res/viewerRes_bc.rc.in
|
|
||||||
${CMAKE_SOURCE_DIR}/newview/res/viewerRes_bc.rc
|
|
||||||
)
|
|
||||||
endif (WINDOWS)
|
endif (WINDOWS)
|
||||||
|
|
||||||
if (DARWIN)
|
if (DARWIN)
|
||||||
@@ -52,13 +47,35 @@ if (DARWIN)
|
|||||||
)
|
)
|
||||||
endif (DARWIN)
|
endif (DARWIN)
|
||||||
|
|
||||||
# Compose the version.
|
if (LINUX)
|
||||||
set(viewer_VERSION "${vMAJOR}.${vMINOR}.${vPATCH}.${vBUILD}")
|
configure_file(
|
||||||
if (viewer_VERSION MATCHES "^[0-9]+\\.[0-9]+\\.[0-9]+\\.[0-9]+$")
|
${CMAKE_SOURCE_DIR}/newview/linux_tools/wrapper.sh.in
|
||||||
message(STATUS "Version is ${viewer_VERSION}")
|
${CMAKE_SOURCE_DIR}/newview/linux_tools/wrapper.sh
|
||||||
else (viewer_VERSION MATCHES "^[0-9]+\\.[0-9]+\\.[0-9]+\\.[0-9]+$")
|
@ONLY
|
||||||
message(FATAL_ERROR "Could not determine version (${viewer_VERSION})")
|
)
|
||||||
endif (viewer_VERSION MATCHES "^[0-9]+\\.[0-9]+\\.[0-9]+\\.[0-9]+$")
|
configure_file(
|
||||||
|
${CMAKE_SOURCE_DIR}/newview/linux_tools/handle_secondlifeprotocol.sh.in
|
||||||
|
${CMAKE_SOURCE_DIR}/newview/linux_tools/handle_secondlifeprotocol.sh
|
||||||
|
@ONLY
|
||||||
|
)
|
||||||
|
configure_file(
|
||||||
|
${CMAKE_SOURCE_DIR}/newview/linux_tools/install.sh.in
|
||||||
|
${CMAKE_SOURCE_DIR}/newview/linux_tools/install.sh
|
||||||
|
@ONLY
|
||||||
|
)
|
||||||
|
configure_file(
|
||||||
|
${CMAKE_SOURCE_DIR}/newview/linux_tools/refresh_desktop_app_entry.sh.in
|
||||||
|
${CMAKE_SOURCE_DIR}/newview/linux_tools/refresh_desktop_app_entry.sh
|
||||||
|
@ONLY
|
||||||
|
)
|
||||||
|
endif (LINUX)
|
||||||
|
|
||||||
|
|
||||||
|
# Compose the version.
|
||||||
|
set(${ROOT_PROJECT_NAME}_VERSION "${vMAJOR}.${vMINOR}.${vPATCH}.${vBUILD}")
|
||||||
|
if (${ROOT_PROJECT_NAME}_VERSION MATCHES "^[0-9]+\\.[0-9]+\\.[0-9]+\\.[0-9]+$")
|
||||||
|
message(STATUS "Version is ${${ROOT_PROJECT_NAME}_VERSION}")
|
||||||
|
else (${ROOT_PROJECT_NAME}_VERSION MATCHES "^[0-9]+\\.[0-9]+\\.[0-9]+\\.[0-9]+$")
|
||||||
|
message(FATAL_ERROR "Could not determine version (${${ROOT_PROJECT_NAME}_VERSION})")
|
||||||
|
endif (${ROOT_PROJECT_NAME}_VERSION MATCHES "^[0-9]+\\.[0-9]+\\.[0-9]+\\.[0-9]+$")
|
||||||
|
|
||||||
# Report version to caller.
|
|
||||||
#set(viewer_VERSION "${viewer_VERSION}" PARENT_SCOPE)
|
|
||||||
|
|||||||
@@ -14,11 +14,14 @@ else (STANDALONE)
|
|||||||
set(CARES_LIBRARIES areslib)
|
set(CARES_LIBRARIES areslib)
|
||||||
elseif (DARWIN)
|
elseif (DARWIN)
|
||||||
set(CARES_LIBRARIES
|
set(CARES_LIBRARIES
|
||||||
optimized ${ARCH_PREBUILT_DIRS_RELEASE}/libcares.a
|
debug libcares.a
|
||||||
debug ${ARCH_PREBUILT_DIRS_DEBUG}/libcares.a
|
optimized libcares.a
|
||||||
)
|
)
|
||||||
else (WINDOWS)
|
else (WINDOWS)
|
||||||
set(CARES_LIBRARIES cares)
|
set(CARES_LIBRARIES cares)
|
||||||
endif (WINDOWS)
|
endif (WINDOWS)
|
||||||
set(CARES_INCLUDE_DIRS ${LIBS_PREBUILT_DIR}/${LL_ARCH_DIR}/include/ares)
|
set(CARES_INCLUDE_DIRS
|
||||||
|
${LIBS_PREBUILT_DIR}/include/ares
|
||||||
|
${LIBS_PREBUILT_LEGACY_DIR}/include/ares
|
||||||
|
)
|
||||||
endif (STANDALONE)
|
endif (STANDALONE)
|
||||||
|
|||||||
@@ -29,8 +29,8 @@ set(cmake_SOURCE_FILES
|
|||||||
ELFIO.cmake
|
ELFIO.cmake
|
||||||
EXPAT.cmake
|
EXPAT.cmake
|
||||||
ExamplePlugin.cmake
|
ExamplePlugin.cmake
|
||||||
FMOD.cmake
|
|
||||||
FMODEX.cmake
|
FMODEX.cmake
|
||||||
|
FMODSTUDIO.cmake
|
||||||
FindAPR.cmake
|
FindAPR.cmake
|
||||||
FindBerkeleyDB.cmake
|
FindBerkeleyDB.cmake
|
||||||
FindCARes.cmake
|
FindCARes.cmake
|
||||||
|
|||||||
@@ -18,5 +18,8 @@ else (STANDALONE)
|
|||||||
list(APPEND CURL_LIBRARIES idn)
|
list(APPEND CURL_LIBRARIES idn)
|
||||||
endif(LINUX AND WORD_SIZE EQUAL 64)
|
endif(LINUX AND WORD_SIZE EQUAL 64)
|
||||||
endif (WINDOWS)
|
endif (WINDOWS)
|
||||||
set(CURL_INCLUDE_DIRS ${LIBS_PREBUILT_DIR}/${LL_ARCH_DIR}/include)
|
set(CURL_INCLUDE_DIRS
|
||||||
|
${LIBS_PREBUILT_DIR}/include
|
||||||
|
${LIBS_PREBUILT_LEGACY_DIR}/include
|
||||||
|
)
|
||||||
endif (STANDALONE)
|
endif (STANDALONE)
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
# -*- cmake -*-
|
# -*- cmake -*-
|
||||||
|
|
||||||
include(Prebuilt)
|
include(Prebuilt)
|
||||||
|
include(Boost)
|
||||||
|
|
||||||
set(COLLADADOM_FIND_QUIETLY OFF)
|
set(COLLADADOM_FIND_QUIETLY OFF)
|
||||||
set(COLLADADOM_FIND_REQUIRED ON)
|
set(COLLADADOM_FIND_REQUIRED ON)
|
||||||
@@ -19,16 +20,33 @@ else (STANDALONE)
|
|||||||
endif (NOT DARWIN AND NOT WINDOWS)
|
endif (NOT DARWIN AND NOT WINDOWS)
|
||||||
|
|
||||||
set(COLLADADOM_INCLUDE_DIRS
|
set(COLLADADOM_INCLUDE_DIRS
|
||||||
${LIBS_PREBUILT_DIR}/${LL_ARCH_DIR}/include/collada
|
${LIBS_PREBUILT_DIR}/include/collada
|
||||||
${LIBS_PREBUILT_DIR}/${LL_ARCH_DIR}/include/collada/1.4
|
${LIBS_PREBUILT_DIR}/include/collada/1.4
|
||||||
)
|
${LIBS_PREBUILT_LEGACY_DIR}/include/collada
|
||||||
|
${LIBS_PREBUILT_LEGACY_DIR}/include/collada/1.4
|
||||||
|
)
|
||||||
|
|
||||||
if (WINDOWS)
|
if (WINDOWS)
|
||||||
add_definitions(-DDOM_DYNAMIC)
|
if(MSVC12)
|
||||||
set(COLLADADOM_LIBRARIES
|
use_prebuilt_binary(pcre)
|
||||||
debug libcollada14dom22-d
|
use_prebuilt_binary(libxml)
|
||||||
optimized libcollada14dom22
|
set(COLLADADOM_LIBRARIES
|
||||||
|
debug libcollada14dom23-sd
|
||||||
|
optimized libcollada14dom23-s
|
||||||
|
libxml2_a
|
||||||
|
debug pcrecppd
|
||||||
|
optimized pcrecpp
|
||||||
|
debug pcred
|
||||||
|
optimized pcre
|
||||||
|
${BOOST_SYSTEM_LIBRARIES}
|
||||||
)
|
)
|
||||||
|
else(MSVC12)
|
||||||
|
add_definitions(-DDOM_DYNAMIC)
|
||||||
|
set(COLLADADOM_LIBRARIES
|
||||||
|
debug libcollada14dom22-d
|
||||||
|
optimized libcollada14dom22
|
||||||
|
)
|
||||||
|
endif(MSVC12)
|
||||||
else (WINDOWS)
|
else (WINDOWS)
|
||||||
set(COLLADADOM_LIBRARIES
|
set(COLLADADOM_LIBRARIES
|
||||||
collada14dom
|
collada14dom
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
# Copies a binary back to the source directory
|
# Copies a binary back to the source directory
|
||||||
|
|
||||||
MACRO(COPY_BACK_TO_SOURCE target)
|
MACRO(COPY_BACK_TO_SOURCE target)
|
||||||
GET_TARGET_PROPERTY(FROM ${target} LOCATION)
|
SET(FROM $<TARGET_FILE:${target}>)
|
||||||
SET(TO ${CMAKE_CURRENT_SOURCE_DIR})
|
SET(TO ${CMAKE_CURRENT_SOURCE_DIR})
|
||||||
#MESSAGE("TARGET ${target} POST_BUILD COMMAND ${CMAKE_COMMAND} -E copy ${FROM} ${TO}")
|
#MESSAGE("TARGET ${target} POST_BUILD COMMAND ${CMAKE_COMMAND} -E copy ${FROM} ${TO}")
|
||||||
ADD_CUSTOM_COMMAND(
|
ADD_CUSTOM_COMMAND(
|
||||||
|
|||||||
@@ -1,317 +0,0 @@
|
|||||||
# -*- cmake -*-
|
|
||||||
|
|
||||||
# The copy_win_libs folder contains file lists and a script used to
|
|
||||||
# copy dlls, exes and such needed to run the SecondLife from within
|
|
||||||
# VisualStudio.
|
|
||||||
|
|
||||||
include(CMakeCopyIfDifferent)
|
|
||||||
|
|
||||||
if(WORD_SIZE EQUAL 32)
|
|
||||||
set(debug_libs_dir "${CMAKE_SOURCE_DIR}/../libraries/i686-win32/lib/debug")
|
|
||||||
set(release_libs_dir "${CMAKE_SOURCE_DIR}/../libraries/i686-win32/lib/release")
|
|
||||||
else(WORD_SIZE EQUAL 32)
|
|
||||||
set(debug_libs_dir "${CMAKE_SOURCE_DIR}/../libraries/x86_64-win/lib/debug")
|
|
||||||
set(release_libs_dir "${CMAKE_SOURCE_DIR}/../libraries/x86_64-win/lib/release")
|
|
||||||
endif(WORD_SIZE EQUAL 32)
|
|
||||||
|
|
||||||
set(vivox_src_dir "${CMAKE_SOURCE_DIR}/newview/vivox-runtime/i686-win32")
|
|
||||||
set(vivox_files
|
|
||||||
SLVoice.exe
|
|
||||||
alut.dll
|
|
||||||
vivoxsdk.dll
|
|
||||||
ortp.dll
|
|
||||||
wrap_oal.dll
|
|
||||||
)
|
|
||||||
copy_if_different(
|
|
||||||
${vivox_src_dir}
|
|
||||||
"${CMAKE_CURRENT_BINARY_DIR}/Debug"
|
|
||||||
out_targets
|
|
||||||
${vivox_files}
|
|
||||||
)
|
|
||||||
set(all_targets ${all_targets} ${out_targets})
|
|
||||||
|
|
||||||
|
|
||||||
set(debug_src_dir "${debug_libs_dir}")
|
|
||||||
set(debug_files
|
|
||||||
libhunspell.dll
|
|
||||||
libapr-1.dll
|
|
||||||
libaprutil-1.dll
|
|
||||||
libapriconv-1.dll
|
|
||||||
libeay32.dll
|
|
||||||
ssleay32.dll
|
|
||||||
libcollada14dom22-d.dll
|
|
||||||
glod.dll
|
|
||||||
)
|
|
||||||
|
|
||||||
copy_if_different(
|
|
||||||
${debug_src_dir}
|
|
||||||
"${CMAKE_CURRENT_BINARY_DIR}/Debug"
|
|
||||||
out_targets
|
|
||||||
${debug_files}
|
|
||||||
)
|
|
||||||
set(all_targets ${all_targets} ${out_targets})
|
|
||||||
|
|
||||||
# Debug config runtime files required for the plugin test mule
|
|
||||||
set(plugintest_debug_src_dir "${debug_libs_dir}")
|
|
||||||
set(plugintest_debug_files
|
|
||||||
libeay32.dll
|
|
||||||
qtcored4.dll
|
|
||||||
qtguid4.dll
|
|
||||||
qtnetworkd4.dll
|
|
||||||
qtopengld4.dll
|
|
||||||
qtwebkitd4.dll
|
|
||||||
ssleay32.dll
|
|
||||||
)
|
|
||||||
copy_if_different(
|
|
||||||
${plugintest_debug_src_dir}
|
|
||||||
"${CMAKE_CURRENT_BINARY_DIR}/../test_apps/llplugintest/Debug"
|
|
||||||
out_targets
|
|
||||||
${plugintest_debug_files}
|
|
||||||
)
|
|
||||||
set(all_targets ${all_targets} ${out_targets})
|
|
||||||
|
|
||||||
# Debug config runtime files required for the plugin test mule (Qt image format plugins)
|
|
||||||
set(plugintest_debug_src_dir "${debug_libs_dir}/imageformats")
|
|
||||||
set(plugintest_debug_files
|
|
||||||
qgifd4.dll
|
|
||||||
qicod4.dll
|
|
||||||
qjpegd4.dll
|
|
||||||
qmngd4.dll
|
|
||||||
qsvgd4.dll
|
|
||||||
qtiffd4.dll
|
|
||||||
)
|
|
||||||
copy_if_different(
|
|
||||||
${plugintest_debug_src_dir}
|
|
||||||
"${CMAKE_CURRENT_BINARY_DIR}/../test_apps/llplugintest/Debug/imageformats"
|
|
||||||
out_targets
|
|
||||||
${plugintest_debug_files}
|
|
||||||
)
|
|
||||||
set(all_targets ${all_targets} ${out_targets})
|
|
||||||
|
|
||||||
copy_if_different(
|
|
||||||
${plugintest_debug_src_dir}
|
|
||||||
"${CMAKE_CURRENT_BINARY_DIR}/llplugin/imageformats"
|
|
||||||
out_targets
|
|
||||||
${plugintest_debug_files}
|
|
||||||
)
|
|
||||||
set(all_targets ${all_targets} ${out_targets})
|
|
||||||
|
|
||||||
# Release & ReleaseDebInfo config runtime files required for the plugin test mule
|
|
||||||
set(plugintest_release_src_dir "${release_libs_dir}")
|
|
||||||
set(plugintest_release_files
|
|
||||||
libeay32.dll
|
|
||||||
qtcore4.dll
|
|
||||||
qtgui4.dll
|
|
||||||
qtnetwork4.dll
|
|
||||||
qtopengl4.dll
|
|
||||||
qtwebkit4.dll
|
|
||||||
ssleay32.dll
|
|
||||||
)
|
|
||||||
copy_if_different(
|
|
||||||
${plugintest_release_src_dir}
|
|
||||||
"${CMAKE_CURRENT_BINARY_DIR}/../test_apps/llplugintest/Release"
|
|
||||||
out_targets
|
|
||||||
${plugintest_release_files}
|
|
||||||
)
|
|
||||||
set(all_targets ${all_targets} ${out_targets})
|
|
||||||
|
|
||||||
copy_if_different(
|
|
||||||
${plugintest_release_src_dir}
|
|
||||||
"${CMAKE_CURRENT_BINARY_DIR}/../test_apps/llplugintest/RelWithDebInfo"
|
|
||||||
out_targets
|
|
||||||
${plugintest_release_files}
|
|
||||||
)
|
|
||||||
set(all_targets ${all_targets} ${out_targets})
|
|
||||||
|
|
||||||
# Release & ReleaseDebInfo config runtime files required for the plugin test mule (Qt image format plugins)
|
|
||||||
set(plugintest_release_src_dir "${release_libs_dir}/imageformats")
|
|
||||||
set(plugintest_release_files
|
|
||||||
qgif4.dll
|
|
||||||
qico4.dll
|
|
||||||
qjpeg4.dll
|
|
||||||
qmng4.dll
|
|
||||||
qsvg4.dll
|
|
||||||
qtiff4.dll
|
|
||||||
)
|
|
||||||
copy_if_different(
|
|
||||||
${plugintest_release_src_dir}
|
|
||||||
"${CMAKE_CURRENT_BINARY_DIR}/../test_apps/llplugintest/Release/imageformats"
|
|
||||||
out_targets
|
|
||||||
${plugintest_release_files}
|
|
||||||
)
|
|
||||||
set(all_targets ${all_targets} ${out_targets})
|
|
||||||
|
|
||||||
copy_if_different(
|
|
||||||
${plugintest_release_src_dir}
|
|
||||||
"${CMAKE_CURRENT_BINARY_DIR}/../test_apps/llplugintest/RelWithDebInfo/imageformats"
|
|
||||||
out_targets
|
|
||||||
${plugintest_release_files}
|
|
||||||
)
|
|
||||||
set(all_targets ${all_targets} ${out_targets})
|
|
||||||
|
|
||||||
copy_if_different(
|
|
||||||
${plugintest_release_src_dir}
|
|
||||||
"${CMAKE_CURRENT_BINARY_DIR}/Release/llplugin/imageformats"
|
|
||||||
out_targets
|
|
||||||
${plugintest_release_files}
|
|
||||||
)
|
|
||||||
set(all_targets ${all_targets} ${out_targets})
|
|
||||||
|
|
||||||
copy_if_different(
|
|
||||||
${plugintest_release_src_dir}
|
|
||||||
"${CMAKE_CURRENT_BINARY_DIR}/RelWithDebInfo/llplugin/imageformats"
|
|
||||||
out_targets
|
|
||||||
${plugintest_release_files}
|
|
||||||
)
|
|
||||||
set(all_targets ${all_targets} ${out_targets})
|
|
||||||
|
|
||||||
# Debug config runtime files required for the plugins
|
|
||||||
set(plugins_debug_src_dir "${debug_libs_dir}")
|
|
||||||
set(plugins_debug_files
|
|
||||||
libeay32.dll
|
|
||||||
qtcored4.dll
|
|
||||||
qtguid4.dll
|
|
||||||
qtnetworkd4.dll
|
|
||||||
qtopengld4.dll
|
|
||||||
qtwebkitd4.dll
|
|
||||||
ssleay32.dll
|
|
||||||
)
|
|
||||||
copy_if_different(
|
|
||||||
${plugins_debug_src_dir}
|
|
||||||
"${CMAKE_CURRENT_BINARY_DIR}/Debug/llplugin"
|
|
||||||
out_targets
|
|
||||||
${plugins_debug_files}
|
|
||||||
)
|
|
||||||
set(all_targets ${all_targets} ${out_targets})
|
|
||||||
|
|
||||||
# Release & ReleaseDebInfo config runtime files required for the plugins
|
|
||||||
set(plugins_release_src_dir "${release_libs_dir}")
|
|
||||||
set(plugins_release_files
|
|
||||||
libeay32.dll
|
|
||||||
qtcore4.dll
|
|
||||||
qtgui4.dll
|
|
||||||
qtnetwork4.dll
|
|
||||||
qtopengl4.dll
|
|
||||||
qtwebkit4.dll
|
|
||||||
ssleay32.dll
|
|
||||||
)
|
|
||||||
copy_if_different(
|
|
||||||
${plugins_release_src_dir}
|
|
||||||
"${CMAKE_CURRENT_BINARY_DIR}/Release/llplugin"
|
|
||||||
out_targets
|
|
||||||
${plugins_release_files}
|
|
||||||
)
|
|
||||||
set(all_targets ${all_targets} ${out_targets})
|
|
||||||
|
|
||||||
copy_if_different(
|
|
||||||
${plugins_release_src_dir}
|
|
||||||
"${CMAKE_CURRENT_BINARY_DIR}/RelWithDebInfo/llplugin"
|
|
||||||
out_targets
|
|
||||||
${plugins_release_files}
|
|
||||||
)
|
|
||||||
set(all_targets ${all_targets} ${out_targets})
|
|
||||||
|
|
||||||
|
|
||||||
set(release_src_dir "${release_libs_dir}")
|
|
||||||
set(release_files
|
|
||||||
libhunspell.dll
|
|
||||||
libapr-1.dll
|
|
||||||
libaprutil-1.dll
|
|
||||||
libapriconv-1.dll
|
|
||||||
libeay32.dll
|
|
||||||
ssleay32.dll
|
|
||||||
libcollada14dom22.dll
|
|
||||||
glod.dll
|
|
||||||
)
|
|
||||||
|
|
||||||
if(WORD_SIZE EQUAL 32)
|
|
||||||
set(release_files ${release_files}
|
|
||||||
libtcmalloc_minimal.dll
|
|
||||||
)
|
|
||||||
endif(WORD_SIZE EQUAL 32)
|
|
||||||
|
|
||||||
|
|
||||||
if(FMODEX)
|
|
||||||
if (WORD_SIZE EQUAL 32)
|
|
||||||
set(fmodex_dll_file "fmodex.dll")
|
|
||||||
else (WORD_SIZE EQUAL 32)
|
|
||||||
set(fmodex_dll_file "fmodex64.dll")
|
|
||||||
endif (WORD_SIZE EQUAL 32)
|
|
||||||
|
|
||||||
find_path(FMODEX_BINARY_DIR "${fmodex_dll_file}"
|
|
||||||
"${release_src_dir}"
|
|
||||||
"${FMODEX_SDK_DIR}/api"
|
|
||||||
"${FMODEX_SDK_DIR}"
|
|
||||||
NO_DEFAULT_PATH
|
|
||||||
)
|
|
||||||
|
|
||||||
if(FMODEX_BINARY_DIR)
|
|
||||||
copy_if_different("${FMODEX_BINARY_DIR}" "${CMAKE_CURRENT_BINARY_DIR}/Release" out_targets "${fmodex_dll_file}")
|
|
||||||
set(all_targets ${all_targets} ${out_targets})
|
|
||||||
copy_if_different("${FMODEX_BINARY_DIR}" "${CMAKE_CURRENT_BINARY_DIR}/RelWithDebInfo" out_targets "${fmodex_dll_file}")
|
|
||||||
set(all_targets ${all_targets} ${out_targets})
|
|
||||||
copy_if_different("${FMODEX_BINARY_DIR}" "${CMAKE_CURRENT_BINARY_DIR}/Debug" out_targets "${fmodex_dll_file}")
|
|
||||||
set(all_targets ${all_targets} ${out_targets})
|
|
||||||
endif(FMODEX_BINARY_DIR)
|
|
||||||
endif(FMODEX)
|
|
||||||
|
|
||||||
if(FMOD)
|
|
||||||
find_path(FMOD_BINARY_DIR fmod.dll
|
|
||||||
${release_src_dir}
|
|
||||||
${FMOD_SDK_DIR}/api
|
|
||||||
${FMOD_SDK_DIR}
|
|
||||||
)
|
|
||||||
|
|
||||||
if(FMOD_BINARY_DIR)
|
|
||||||
copy_if_different("${FMOD_BINARY_DIR}" "${CMAKE_CURRENT_BINARY_DIR}/Release" out_targets fmod.dll)
|
|
||||||
set(all_targets ${all_targets} ${out_targets})
|
|
||||||
copy_if_different("${FMOD_BINARY_DIR}" "${CMAKE_CURRENT_BINARY_DIR}/RelWithDebInfo" out_targets fmod.dll)
|
|
||||||
set(all_targets ${all_targets} ${out_targets})
|
|
||||||
copy_if_different("${FMOD_BINARY_DIR}" "${CMAKE_CURRENT_BINARY_DIR}/Debug" out_targets fmod.dll)
|
|
||||||
set(all_targets ${all_targets} ${out_targets})
|
|
||||||
else(FMOD_BINARY_DIR)
|
|
||||||
list(APPEND release_files fmod.dll) #Required for compile. This will cause an error in copying binaries.
|
|
||||||
endif(FMOD_BINARY_DIR)
|
|
||||||
endif(FMOD)
|
|
||||||
|
|
||||||
copy_if_different(
|
|
||||||
${release_src_dir}
|
|
||||||
"${CMAKE_CURRENT_BINARY_DIR}/Release"
|
|
||||||
out_targets
|
|
||||||
${release_files}
|
|
||||||
)
|
|
||||||
set(all_targets ${all_targets} ${out_targets})
|
|
||||||
|
|
||||||
copy_if_different(
|
|
||||||
${vivox_src_dir}
|
|
||||||
"${CMAKE_CURRENT_BINARY_DIR}/Release"
|
|
||||||
out_targets
|
|
||||||
${vivox_files}
|
|
||||||
)
|
|
||||||
set(all_targets ${all_targets} ${out_targets})
|
|
||||||
|
|
||||||
copy_if_different(
|
|
||||||
${release_src_dir}
|
|
||||||
"${CMAKE_CURRENT_BINARY_DIR}/RelWithDebInfo"
|
|
||||||
out_targets
|
|
||||||
${release_files}
|
|
||||||
)
|
|
||||||
set(all_targets ${all_targets} ${out_targets})
|
|
||||||
|
|
||||||
copy_if_different(
|
|
||||||
${vivox_src_dir}
|
|
||||||
"${CMAKE_CURRENT_BINARY_DIR}/RelWithDebInfo"
|
|
||||||
out_targets
|
|
||||||
${vivox_files}
|
|
||||||
)
|
|
||||||
set(all_targets ${all_targets} ${out_targets})
|
|
||||||
|
|
||||||
add_custom_target(copy_win_libs ALL
|
|
||||||
DEPENDS
|
|
||||||
${all_targets}
|
|
||||||
${release_appconfig_file}
|
|
||||||
${relwithdebinfo_appconfig_file}
|
|
||||||
${debug_appconfig_file}
|
|
||||||
)
|
|
||||||
add_dependencies(copy_win_libs prepare)
|
|
||||||
|
|
||||||
181
indra/cmake/CopyWinLibs.cmake.in
Normal file
181
indra/cmake/CopyWinLibs.cmake.in
Normal file
@@ -0,0 +1,181 @@
|
|||||||
|
# -*- cmake -*-
|
||||||
|
|
||||||
|
# The copy_win_libs folder contains file lists and a script used to
|
||||||
|
# copy dlls, exes and such needed to run the SecondLife from within
|
||||||
|
# VisualStudio.
|
||||||
|
|
||||||
|
set(LIBS_PREBUILT_DIR "@LIBS_PREBUILT_DIR@")
|
||||||
|
set(LIBS_PREBUILT_LEGACY_DIR "@LIBS_PREBUILT_LEGACY_DIR@")
|
||||||
|
set(MSVC10 "@MSVC10@")
|
||||||
|
set(WORD_SIZE "@WORD_SIZE@")
|
||||||
|
|
||||||
|
set(LIBS_RELEASE_DIR
|
||||||
|
${LIBS_PREBUILT_DIR}/lib/release
|
||||||
|
${LIBS_PREBUILT_LEGACY_DIR}/lib/release
|
||||||
|
)
|
||||||
|
set(LIBS_DEBUG_DIR
|
||||||
|
${LIBS_PREBUILT_DIR}/lib/debug
|
||||||
|
${LIBS_PREBUILT_LEGACY_DIR}/lib/debug
|
||||||
|
)
|
||||||
|
|
||||||
|
function(copy_files paths names dest)
|
||||||
|
string(FIND ${dest} ${CUR_CONFIG} idx)
|
||||||
|
if(${idx} LESS 0)
|
||||||
|
return()
|
||||||
|
endif(${idx} LESS 0)
|
||||||
|
foreach(f ${names})
|
||||||
|
foreach(p ${paths})
|
||||||
|
set(from_file "${p}/${f}")
|
||||||
|
set(to_dest "${CMAKE_BINARY_DIR}/newview/${dest}/")
|
||||||
|
if(EXISTS ${from_file})
|
||||||
|
message("Copying ${from_file} to ${to_dest}")
|
||||||
|
if(NOT EXISTS ${to_dest})
|
||||||
|
execute_process(COMMAND md "${to_dest}")
|
||||||
|
endif(NOT EXISTS ${to_dest})
|
||||||
|
execute_process(COMMAND ${CMAKE_COMMAND} -E copy "${from_file}" "${to_dest}${f}" RESULT_VARIABLE result)
|
||||||
|
if(${result})
|
||||||
|
message(SEND_ERROR "Unsuccessful.")
|
||||||
|
endif(${result})
|
||||||
|
set(found 1)
|
||||||
|
break()
|
||||||
|
endif(EXISTS ${from_file})
|
||||||
|
endforeach(p)
|
||||||
|
if(NOT found)
|
||||||
|
message(SEND_ERROR "Failed to find library: ${f}")
|
||||||
|
endif(NOT found)
|
||||||
|
endforeach(f)
|
||||||
|
endfunction(copy_files)
|
||||||
|
|
||||||
|
set(vivox_files
|
||||||
|
ca-bundle.crt
|
||||||
|
libsndfile-1.dll
|
||||||
|
ortp.dll
|
||||||
|
SLVoice.exe
|
||||||
|
vivoxoal.dll
|
||||||
|
vivoxplatform.dll
|
||||||
|
vivoxsdk.dll
|
||||||
|
zlib1.dll
|
||||||
|
)
|
||||||
|
copy_files("${LIBS_RELEASE_DIR}" "${vivox_files}" "Release" )
|
||||||
|
copy_files("${LIBS_RELEASE_DIR}" "${vivox_files}" "RelWithDebInfo")
|
||||||
|
copy_files("${LIBS_DEBUG_DIR}" "${vivox_files}" "Debug")
|
||||||
|
|
||||||
|
set(release_files
|
||||||
|
libhunspell.dll
|
||||||
|
libapr-1.dll
|
||||||
|
libaprutil-1.dll
|
||||||
|
libapriconv-1.dll
|
||||||
|
libeay32.dll
|
||||||
|
ssleay32.dll
|
||||||
|
glod.dll
|
||||||
|
qtcore4.dll
|
||||||
|
)
|
||||||
|
copy_files("${LIBS_RELEASE_DIR}" "${release_files}" "Release")
|
||||||
|
copy_files("${LIBS_RELEASE_DIR}" "${release_files}" "RelWithDebInfo")
|
||||||
|
copy_files("${LIBS_DEBUG_DIR}" "${release_files}" "Debug")
|
||||||
|
|
||||||
|
if(MSVC10)
|
||||||
|
copy_files("${LIBS_DEBUG_DIR}" "libcollada14dom22-d.dll" "Debug")
|
||||||
|
endif(MSVC10)
|
||||||
|
|
||||||
|
if(WORD_SIZE EQUAL 32)
|
||||||
|
set(release_files
|
||||||
|
libcollada14dom22.dll
|
||||||
|
libtcmalloc_minimal.dll
|
||||||
|
)
|
||||||
|
copy_files("${LIBS_RELEASE_DIR}" "${release_files}" "Release")
|
||||||
|
copy_files("${LIBS_RELEASE_DIR}" "${release_files}" "RelWithDebInfo")
|
||||||
|
endif(WORD_SIZE EQUAL 32)
|
||||||
|
|
||||||
|
set(plugins_release_files
|
||||||
|
libeay32.dll
|
||||||
|
qtcore4.dll
|
||||||
|
qtgui4.dll
|
||||||
|
qtnetwork4.dll
|
||||||
|
qtopengl4.dll
|
||||||
|
qtwebkit4.dll
|
||||||
|
ssleay32.dll
|
||||||
|
qtxmlpatterns4.dll
|
||||||
|
)
|
||||||
|
copy_files("${LIBS_RELEASE_DIR}" "${plugins_release_files}" "Release/llplugin")
|
||||||
|
copy_files("${LIBS_RELEASE_DIR}" "${plugins_release_files}" "RelWithDebInfo/llplugin")
|
||||||
|
if(0)
|
||||||
|
copy_files("${LIBS_RELEASE_DIR}" "${plugin_release_files}" "../test_apps/llplugintest/Release")
|
||||||
|
copy_files("${LIBS_RELEASE_DIR}" "${plugin_release_files}" "../test_apps/llplugintest/RelWithDebInfo")
|
||||||
|
endif(0)
|
||||||
|
|
||||||
|
# Debug config runtime files required for the plugins
|
||||||
|
set(plugins_debug_files
|
||||||
|
libeay32.dll
|
||||||
|
qtcored4.dll
|
||||||
|
qtguid4.dll
|
||||||
|
qtnetworkd4.dll
|
||||||
|
qtopengld4.dll
|
||||||
|
qtwebkitd4.dll
|
||||||
|
ssleay32.dll
|
||||||
|
qtxmlpatternsd4.dll
|
||||||
|
)
|
||||||
|
copy_files("${LIBS_DEBUG_DIR}" "${plugins_debug_files}" "Debug/llplugin")
|
||||||
|
if(0)
|
||||||
|
copy_files("${LIBS_DEBUG_DIR}" "${plugins_debug_files}" "../test_apps/llplugintest/Debug")
|
||||||
|
endif(0)
|
||||||
|
|
||||||
|
# Release & ReleaseDebInfo config runtime files required for the plugin test mule (Qt image format plugins)
|
||||||
|
set(plugin_image_release_files
|
||||||
|
qgif4.dll
|
||||||
|
qico4.dll
|
||||||
|
qjpeg4.dll
|
||||||
|
qmng4.dll
|
||||||
|
qsvg4.dll
|
||||||
|
qtiff4.dll
|
||||||
|
)
|
||||||
|
copy_files("${LIBS_RELEASE_DIR}/imageformats" "${plugin_image_release_files}" "Release/llplugin/imageformats")
|
||||||
|
copy_files("${LIBS_RELEASE_DIR}/imageformats" "${plugin_image_release_files}" "RelWithDebInfo/llplugin/imageformats")
|
||||||
|
if(0)
|
||||||
|
copy_files("${LIBS_RELEASE_DIR}/imageformats" "${plugin_image_release_files}" "../test_apps/llplugintest/imageformats/Release")
|
||||||
|
copy_files("${LIBS_RELEASE_DIR}/imageformats" "${plugin_image_release_files}" "../test_apps/llplugintest/imageformats/RelWithDebInfo")
|
||||||
|
endif(0)
|
||||||
|
|
||||||
|
|
||||||
|
# Debug config runtime files required for the plugin test mule (Qt image format plugins)
|
||||||
|
set(plugin_image_debug_files
|
||||||
|
qgifd4.dll
|
||||||
|
qicod4.dll
|
||||||
|
qjpegd4.dll
|
||||||
|
qmngd4.dll
|
||||||
|
qsvgd4.dll
|
||||||
|
qtiffd4.dll
|
||||||
|
)
|
||||||
|
copy_files("${LIBS_DEBUG_DIR}/imageformats" "${plugin_image_debug_files}" "Debug/llplugin/imageformats")
|
||||||
|
if(0)
|
||||||
|
copy_files("${LIBS_DEBUG_DIR}/imageformats" "${plugin_image_debug_files}" "../test_apps/llplugintest/imageformats/Debug")
|
||||||
|
endif(0)
|
||||||
|
|
||||||
|
# Release & ReleaseDebInfo config runtime files required for the plugin test mule (Qt image format plugins)
|
||||||
|
set(plugin_codec_release_files
|
||||||
|
qcncodecs4.dll
|
||||||
|
qjpcodecs4.dll
|
||||||
|
qkrcodecs4.dll
|
||||||
|
qtwcodecs4.dll
|
||||||
|
)
|
||||||
|
copy_files("${LIBS_RELEASE_DIR}/codecs" "${plugin_codec_release_files}" "Release/llplugin/codecs")
|
||||||
|
copy_files("${LIBS_RELEASE_DIR}/codecs" "${plugin_codec_release_files}" "RelWithDebInfo/llplugin/codecs")
|
||||||
|
if(0)
|
||||||
|
copy_files("${LIBS_RELEASE_DIR}/codecs" "${plugin_codec_release_files}" "../test_apps/llplugintest/codecs/Release")
|
||||||
|
copy_files("${LIBS_RELEASE_DIR}/codecs" "${plugin_codec_release_files}" "../test_apps/llplugintest/codecs/RelWithDebInfo")
|
||||||
|
endif(0)
|
||||||
|
|
||||||
|
# Debug config runtime files required for the plugin test mule (Qt image format plugins)
|
||||||
|
set(plugin_codec_debug_files
|
||||||
|
qcncodecsd4.dll
|
||||||
|
qjpcodecsd4.dll
|
||||||
|
qkrcodecsd4.dll
|
||||||
|
qtwcodecsd4.dll
|
||||||
|
)
|
||||||
|
copy_files("${LIBS_DEBUG_DIR}/codecs" "${plugin_codec_debug_files}" "Debug/llplugin/codecs")
|
||||||
|
if(0)
|
||||||
|
copy_files("${LIBS_DEBUG_DIR}/codecs" "${plugin_codec_debug_files}" "../test_apps/llplugintest/codecs/Debug")
|
||||||
|
endif(0)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@@ -10,8 +10,9 @@ elseif (LINUX)
|
|||||||
use_prebuilt_binary(dbusglib)
|
use_prebuilt_binary(dbusglib)
|
||||||
set(DBUSGLIB_FOUND ON FORCE BOOL)
|
set(DBUSGLIB_FOUND ON FORCE BOOL)
|
||||||
set(DBUSGLIB_INCLUDE_DIRS
|
set(DBUSGLIB_INCLUDE_DIRS
|
||||||
${LIBS_PREBUILT_DIR}/${LL_ARCH_DIR}/include/dbus
|
${LIBS_PREBUILT_DIR}/include/dbus
|
||||||
)
|
${LIBS_PREBUILT_LEGACY_DIR}/include/dbus
|
||||||
|
)
|
||||||
# We don't need to explicitly link against dbus-glib itself, because
|
# We don't need to explicitly link against dbus-glib itself, because
|
||||||
# the viewer probes for the system's copy at runtime.
|
# the viewer probes for the system's copy at runtime.
|
||||||
set(DBUSGLIB_LIBRARIES
|
set(DBUSGLIB_LIBRARIES
|
||||||
|
|||||||
@@ -11,25 +11,32 @@ if (WINDOWS)
|
|||||||
set (DIRECTX_ARCHITECTURE x86)
|
set (DIRECTX_ARCHITECTURE x86)
|
||||||
endif (WORD_SIZE EQUAL 32)
|
endif (WORD_SIZE EQUAL 32)
|
||||||
|
|
||||||
|
SET(program_files $ENV{ProgramW6432})
|
||||||
|
if(NOT program_files)
|
||||||
|
SET(program_files $ENV{ProgramFiles})
|
||||||
|
endif(NOT program_files)
|
||||||
|
SET(program_files_x86 "ProgramFiles(x86)")
|
||||||
|
SET(program_files_x86 $ENV{${program_files_x86}})
|
||||||
|
|
||||||
find_path(DIRECTX_ROOT_DIR Include/dxdiag.h
|
find_path(DIRECTX_ROOT_DIR Include/dxdiag.h
|
||||||
PATHS
|
PATHS
|
||||||
"$ENV{DXSDK_DIR}"
|
"$ENV{DXSDK_DIR}"
|
||||||
"$ENV{ProgramFiles}/Microsoft DirectX SDK (June 2010)"
|
"${program_files}/Microsoft DirectX SDK (June 2010)"
|
||||||
"$ENV{ProgramFiles(x86)}/Microsoft DirectX SDK (June 2010)"
|
"${program_files_x86}/Microsoft DirectX SDK (June 2010)"
|
||||||
"$ENV{ProgramFiles}/Microsoft DirectX SDK (February 2010)"
|
"${program_files}/Microsoft DirectX SDK (February 2010)"
|
||||||
"$ENV{ProgramFiles(x86)}/Microsoft DirectX SDK (February 2010)"
|
"${program_files_x86}/Microsoft DirectX SDK (February 2010)"
|
||||||
"$ENV{ProgramFiles}/Microsoft DirectX SDK (March 2009)"
|
"${program_files}/Microsoft DirectX SDK (March 2009)"
|
||||||
"$ENV{ProgramFiles(x86)}/Microsoft DirectX SDK (March 2009)"
|
"${program_files_x86}/Microsoft DirectX SDK (March 2009)"
|
||||||
"$ENV{ProgramFiles}/Microsoft DirectX SDK (August 2008)"
|
"${program_files}/Microsoft DirectX SDK (August 2008)"
|
||||||
"$ENV{ProgramFiles(x86)}/Microsoft DirectX SDK (August 2008)"
|
"${program_files_x86}/Microsoft DirectX SDK (August 2008)"
|
||||||
"$ENV{ProgramFiles}/Microsoft DirectX SDK (June 2008)"
|
"${program_files}/Microsoft DirectX SDK (June 2008)"
|
||||||
"$ENV{ProgramFiles(x86)}/Microsoft DirectX SDK (June 2008)"
|
"${program_files_x86}/Microsoft DirectX SDK (June 2008)"
|
||||||
"$ENV{ProgramFiles}/Microsoft DirectX SDK (March 2008)"
|
"${program_files}/Microsoft DirectX SDK (March 2008)"
|
||||||
"$ENV{ProgramFiles(x86)}/Microsoft DirectX SDK (March 2008)"
|
"${program_files_x86}/Microsoft DirectX SDK (March 2008)"
|
||||||
"$ENV{ProgramFiles}/Microsoft DirectX SDK (November 2007)"
|
"${program_files}/Microsoft DirectX SDK (November 2007)"
|
||||||
"$ENV{ProgramFiles(x86)}/Microsoft DirectX SDK (November 2007)"
|
"${program_files_x86}/Microsoft DirectX SDK (November 2007)"
|
||||||
"$ENV{ProgramFiles}/Microsoft DirectX SDK (August 2007)"
|
"${program_files}/Microsoft DirectX SDK (August 2007)"
|
||||||
"$ENV{ProgramFiles(x86)}/Microsoft DirectX SDK (August 2007)"
|
"${program_files_x86}/Microsoft DirectX SDK (August 2007)"
|
||||||
)
|
)
|
||||||
|
|
||||||
if (DIRECTX_ROOT_DIR)
|
if (DIRECTX_ROOT_DIR)
|
||||||
@@ -38,10 +45,10 @@ if (WINDOWS)
|
|||||||
else (DIRECTX_ROOT_DIR)
|
else (DIRECTX_ROOT_DIR)
|
||||||
find_path (WIN_KIT_ROOT_DIR Include/um/windows.h
|
find_path (WIN_KIT_ROOT_DIR Include/um/windows.h
|
||||||
PATHS
|
PATHS
|
||||||
"$ENV{ProgramFiles}/Windows Kits/8.1"
|
"${program_files}/Windows Kits/8.1"
|
||||||
"$ENV{ProgramFiles(x86)}/Windows Kits/8.1"
|
"${program_files_x86}/Windows Kits/8.1"
|
||||||
"$ENV{ProgramFiles}/Windows Kits/8.0"
|
"${program_files}/Windows Kits/8.0"
|
||||||
"$ENV{ProgramFiles(x86)}/Windows Kits/8.0"
|
"${program_files_x86}/Windows Kits/8.0"
|
||||||
)
|
)
|
||||||
|
|
||||||
find_path (WIN_KIT_LIB_DIR dxguid.lib
|
find_path (WIN_KIT_LIB_DIR dxguid.lib
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
# The top-level CMakeLists.txt configures packages and tool locations.
|
# The top-level CMakeLists.txt configures packages and tool locations.
|
||||||
set(packages "@PREBUILT_PACKAGES@")
|
set(packages "@PREBUILT_PACKAGES@")
|
||||||
set(python "@PYTHON_EXECUTABLE@")
|
set(python "@PYTHON_EXECUTABLE@")
|
||||||
set(install_dir "@CMAKE_SOURCE_DIR@/..")
|
set(install_dir "@CMAKE_BINARY_DIR@/packages")
|
||||||
set(scp "@SCP_EXECUTABLE@")
|
set(scp "@SCP_EXECUTABLE@")
|
||||||
set(scripts_dir "@SCRIPTS_DIR@")
|
set(scripts_dir "@SCRIPTS_DIR@")
|
||||||
set(sentinel_dir "@CMAKE_BINARY_DIR@/prepare")
|
set(sentinel_dir "@CMAKE_BINARY_DIR@/prepare")
|
||||||
@@ -20,7 +20,7 @@ foreach(package ${packages})
|
|||||||
# This package is missing or out of date.
|
# This package is missing or out of date.
|
||||||
message(STATUS "Obtaining${proprietary_message} prebuilt '${package}'")
|
message(STATUS "Obtaining${proprietary_message} prebuilt '${package}'")
|
||||||
execute_process(
|
execute_process(
|
||||||
COMMAND ${python} install.py -p${prebuilt_type} --install-dir=${install_dir} ${scp_option} ${package}
|
COMMAND ${python} install.py -p${prebuilt_type} --install-dir=${install_dir} --installed-manifest=${install_dir}/installed.xml ${scp_option} ${package}
|
||||||
WORKING_DIRECTORY ${scripts_dir}
|
WORKING_DIRECTORY ${scripts_dir}
|
||||||
RESULT_VARIABLE result
|
RESULT_VARIABLE result
|
||||||
)
|
)
|
||||||
|
|||||||
@@ -8,7 +8,10 @@ if (STANDALONE)
|
|||||||
elseif (LINUX)
|
elseif (LINUX)
|
||||||
use_prebuilt_binary(elfio)
|
use_prebuilt_binary(elfio)
|
||||||
set(ELFIO_LIBRARIES ELFIO)
|
set(ELFIO_LIBRARIES ELFIO)
|
||||||
set(ELFIO_INCLUDE_DIR ${LIBS_PREBUILT_DIR}/${LL_ARCH_DIR}/include)
|
set(ELFIO_INCLUDE_DIR
|
||||||
|
${LIBS_PREBUILT_DIR}/include
|
||||||
|
${LIBS_PREBUILT_LEGACY_DIR}/include
|
||||||
|
)
|
||||||
set(ELFIO_FOUND "YES")
|
set(ELFIO_FOUND "YES")
|
||||||
endif (STANDALONE)
|
endif (STANDALONE)
|
||||||
|
|
||||||
|
|||||||
@@ -9,9 +9,16 @@ if (STANDALONE)
|
|||||||
else (STANDALONE)
|
else (STANDALONE)
|
||||||
use_prebuilt_binary(expat)
|
use_prebuilt_binary(expat)
|
||||||
if (WINDOWS)
|
if (WINDOWS)
|
||||||
set(EXPAT_LIBRARIES libexpatMT)
|
if (MSVC12)
|
||||||
|
set(EXPAT_LIBRARIES expat)
|
||||||
|
else (MSVC12)
|
||||||
|
set(EXPAT_LIBRARIES libexpatMT)
|
||||||
|
endif (MSVC12)
|
||||||
else (WINDOWS)
|
else (WINDOWS)
|
||||||
set(EXPAT_LIBRARIES expat)
|
set(EXPAT_LIBRARIES expat)
|
||||||
endif (WINDOWS)
|
endif (WINDOWS)
|
||||||
set(EXPAT_INCLUDE_DIRS ${LIBS_PREBUILT_DIR}/${LL_ARCH_DIR}/include)
|
set(EXPAT_INCLUDE_DIRS
|
||||||
|
${LIBS_PREBUILT_DIR}/include
|
||||||
|
${LIBS_PREBUILT_LEGACY_DIR}/include
|
||||||
|
)
|
||||||
endif (STANDALONE)
|
endif (STANDALONE)
|
||||||
|
|||||||
@@ -1,52 +0,0 @@
|
|||||||
# -*- cmake -*-
|
|
||||||
|
|
||||||
include(Linking)
|
|
||||||
|
|
||||||
if(INSTALL_PROPRIETARY)
|
|
||||||
include(Prebuilt)
|
|
||||||
use_prebuilt_binary(fmod)
|
|
||||||
endif(INSTALL_PROPRIETARY)
|
|
||||||
|
|
||||||
find_library(FMOD_LIBRARY
|
|
||||||
NAMES fmod fmodvc fmod-3.75
|
|
||||||
PATHS
|
|
||||||
optimized ${ARCH_PREBUILT_DIRS_RELEASE}
|
|
||||||
debug ${ARCH_PREBUILT_DIRS_DEBUG}
|
|
||||||
)
|
|
||||||
|
|
||||||
if (NOT FMOD_LIBRARY)
|
|
||||||
set(FMOD_SDK_DIR CACHE PATH "Path to the FMOD SDK.")
|
|
||||||
if (FMOD_SDK_DIR)
|
|
||||||
find_library(FMOD_LIBRARY
|
|
||||||
NAMES fmodvc fmod-3.75 fmod
|
|
||||||
PATHS
|
|
||||||
${FMOD_SDK_DIR}/api/lib
|
|
||||||
${FMOD_SDK_DIR}/api
|
|
||||||
${FMOD_SDK_DIR}/lib
|
|
||||||
${FMOD_SDK_DIR}
|
|
||||||
)
|
|
||||||
endif (FMOD_SDK_DIR)
|
|
||||||
endif (NOT FMOD_LIBRARY)
|
|
||||||
|
|
||||||
find_path(FMOD_INCLUDE_DIR fmod.h
|
|
||||||
${LIBS_PREBUILT_DIR}/include
|
|
||||||
${LIBS_PREBUILT_DIR}/${LL_ARCH_DIR}/include
|
|
||||||
${FMOD_SDK_DIR}/api/inc
|
|
||||||
${FMOD_SDK_DIR}/inc
|
|
||||||
${FMOD_SDK_DIR}
|
|
||||||
)
|
|
||||||
|
|
||||||
if (FMOD_LIBRARY AND FMOD_INCLUDE_DIR)
|
|
||||||
set(FMOD ON CACHE BOOL "Use closed source FMOD sound library.")
|
|
||||||
else (FMOD_LIBRARY AND FMOD_INCLUDE_DIR)
|
|
||||||
set(FMOD_LIBRARY "")
|
|
||||||
set(FMOD_INCLUDE_DIR "")
|
|
||||||
if (FMOD)
|
|
||||||
message(STATUS "No support for FMOD audio (need to set FMOD_SDK_DIR?)")
|
|
||||||
endif (FMOD)
|
|
||||||
set(FMOD OFF CACHE BOOL "Use closed source FMOD sound library.")
|
|
||||||
endif (FMOD_LIBRARY AND FMOD_INCLUDE_DIR)
|
|
||||||
|
|
||||||
if (FMOD)
|
|
||||||
message(STATUS "Building with FMOD audio support")
|
|
||||||
endif (FMOD)
|
|
||||||
@@ -2,81 +2,115 @@
|
|||||||
|
|
||||||
include(Linking)
|
include(Linking)
|
||||||
|
|
||||||
if (NOT FMODEX_LIBRARY)
|
if (FMODEX AND FMODSTUDIO)
|
||||||
set(FMODEX_SDK_DIR CACHE PATH "Path to the FMOD Ex SDK.")
|
message( FATAL_ERROR "You can not enable two FMOD variants at the same time." )
|
||||||
if (FMODEX_SDK_DIR)
|
endif (FMODEX AND FMODSTUDIO)
|
||||||
if(WORD_SIZE EQUAL 32)
|
|
||||||
find_library(FMODEX_LIBRARY
|
|
||||||
fmodex_vc fmodexL_vc fmodex fmodexL
|
|
||||||
PATHS
|
|
||||||
"${FMODEX_SDK_DIR}/api/lib"
|
|
||||||
"${FMODEX_SDK_DIR}/api"
|
|
||||||
"${FMODEX_SDK_DIR}/lib"
|
|
||||||
"${FMODEX_SDK_DIR}"
|
|
||||||
)
|
|
||||||
elseif(WORD_SIZE EQUAL 64)
|
|
||||||
find_library(FMODEX_LIBRARY
|
|
||||||
fmodex64_vc fmodexL64_vc fmodex64 fmodexL64
|
|
||||||
PATHS
|
|
||||||
"${FMODEX_SDK_DIR}/api/lib"
|
|
||||||
"${FMODEX_SDK_DIR}/api"
|
|
||||||
"${FMODEX_SDK_DIR}/lib"
|
|
||||||
"${FMODEX_SDK_DIR}"
|
|
||||||
)
|
|
||||||
endif(WORD_SIZE EQUAL 32)
|
|
||||||
endif(FMODEX_SDK_DIR)
|
|
||||||
if(WINDOWS AND NOT FMODEX_SDK_DIR)
|
|
||||||
GET_FILENAME_COMPONENT(FMODEX_PROG_DIR [HKEY_CURRENT_USER\\Software\\FMOD\ Programmers\ API\ Windows] ABSOLUTE CACHE)
|
|
||||||
if(WORD_SIZE EQUAL 32)
|
|
||||||
find_library(FMODEX_LIBRARY
|
|
||||||
fmodex_vc fmodexL_vc
|
|
||||||
PATHS
|
|
||||||
"${FMODEX_PROG_DIR}/api/lib"
|
|
||||||
"${FMODEX_PROG_DIR}/api"
|
|
||||||
"${FMODEX_PROG_DIR}"
|
|
||||||
)
|
|
||||||
else(WORD_SIZE EQUAL 32)
|
|
||||||
find_library(FMODEX_LIBRARY
|
|
||||||
fmodex64_vc fmodexL64_vc
|
|
||||||
PATHS
|
|
||||||
"${FMODEX_PROG_DIR}/api/lib"
|
|
||||||
"${FMODEX_PROG_DIR}/api"
|
|
||||||
"${FMODEX_PROG_DIR}"
|
|
||||||
)
|
|
||||||
endif(WORD_SIZE EQUAL 32)
|
|
||||||
if(FMODEX_LIBRARY)
|
|
||||||
message(STATUS "Found fmodex in ${FMODEX_PROG_DIR}")
|
|
||||||
set(FMODEX_SDK_DIR "${FMODEX_PROG_DIR}")
|
|
||||||
set(FMODEX_SDK_DIR "${FMODEX_PROG_DIR}" CACHE PATH "Path to the FMOD Ex SDK." FORCE)
|
|
||||||
endif(FMODEX_LIBRARY)
|
|
||||||
endif(WINDOWS AND NOT FMODEX_SDK_DIR)
|
|
||||||
endif (NOT FMODEX_LIBRARY)
|
|
||||||
|
|
||||||
find_path(FMODEX_INCLUDE_DIR fmod.hpp
|
unset(FMOD_LIBRARY_RELEASE CACHE)
|
||||||
"${LIBS_PREBUILT_DIR}/include/fmodex"
|
unset(FMOD_LIBRARY_DEBUG CACHE)
|
||||||
"${LIBS_PREBUILT_DIR}/${LL_ARCH_DIR}/fmodex"
|
unset(FMOD_INCLUDE_DIR CACHE)
|
||||||
"${FMODEX_SDK_DIR}/api/inc"
|
|
||||||
"${FMODEX_SDK_DIR}/inc"
|
|
||||||
"${FMODEX_SDK_DIR}"
|
|
||||||
)
|
|
||||||
|
|
||||||
if(DARWIN)
|
set(FMOD_EXTERNAL_LIB OFF)
|
||||||
set(FMODEX_ORIG_LIBRARY "${FMODEX_LIBRARY}")
|
|
||||||
set(FMODEX_LIBRARY "${CMAKE_CURRENT_BINARY_DIR}/libfmodex.dylib")
|
|
||||||
endif(DARWIN)
|
|
||||||
|
|
||||||
if (FMODEX_LIBRARY AND FMODEX_INCLUDE_DIR)
|
if(STANDALONE OR WINDOWS)
|
||||||
set(FMODEX ON CACHE BOOL "Use closed source FMOD Ex sound library.")
|
if (NOT FMODEX_SDK_DIR AND WINDOWS)
|
||||||
else (FMODEX_LIBRARY AND FMODEX_INCLUDE_DIR)
|
GET_FILENAME_COMPONENT(REG_DIR [HKEY_CURRENT_USER\\Software\\FMOD\ Programmers\ API\ Windows] ABSOLUTE)
|
||||||
set(FMODEX_LIBRARY "")
|
set(FMODEX_SDK_DIR ${REG_DIR} CACHE PATH "Path to the FMOD Ex SDK." FORCE)
|
||||||
set(FMODEX_INCLUDE_DIR "")
|
endif (NOT FMODEX_SDK_DIR AND WINDOWS)
|
||||||
if (FMODEX)
|
if(NOT FMODEX_SDK_DIR AND STANDALONE)
|
||||||
message(STATUS "No support for FMOD Ex audio (need to set FMODEX_SDK_DIR?)")
|
message(FATAL_ERROR "FMODEX_SDK_DIR not set!")
|
||||||
endif (FMODEX)
|
endif(NOT FMODEX_SDK_DIR AND STANDALONE)
|
||||||
set(FMODEX OFF CACHE BOOL "Use closed source FMOD Ex sound library.")
|
endif(STANDALONE OR WINDOWS)
|
||||||
|
|
||||||
|
if(FMODEX_SDK_DIR)
|
||||||
|
set(fmod_lib_paths "${FMODEX_SDK_DIR}/api" "${FMODEX_SDK_DIR}/api/lib" )
|
||||||
|
set(fmod_inc_paths "${FMODEX_SDK_DIR}/api/inc")
|
||||||
|
|
||||||
|
if(WINDOWS)
|
||||||
|
set(CMAKE_FIND_LIBRARY_SUFFIXES_OLD ${CMAKE_FIND_LIBRARY_SUFFIXES})
|
||||||
|
set(CMAKE_FIND_LIBRARY_SUFFIXES .dll)
|
||||||
|
endif(WINDOWS)
|
||||||
|
if(WORD_SIZE EQUAL 64)
|
||||||
|
find_library(FMOD_LIBRARY_RELEASE fmodex64 PATHS ${fmod_lib_paths} NO_DEFAULT_PATH)
|
||||||
|
find_library(FMOD_LIBRARY_DEBUG fmodexL64 PATHS ${fmod_lib_paths} NO_DEFAULT_PATH)
|
||||||
|
else(WORD_SIZE EQUAL 64)#Check if CMAKE_FIND_LIBRARY_PREFIXES is set to 'lib' for darwin.
|
||||||
|
find_library(FMOD_LIBRARY_RELEASE fmodex PATHS ${fmod_lib_paths} NO_DEFAULT_PATH)
|
||||||
|
find_library(FMOD_LIBRARY_DEBUG fmodexL PATHS ${fmod_lib_paths} NO_DEFAULT_PATH)
|
||||||
|
endif(WORD_SIZE EQUAL 64)
|
||||||
|
if(WINDOWS)
|
||||||
|
set(CMAKE_FIND_LIBRARY_SUFFIXES ${CMAKE_FIND_LIBRARY_SUFFIXES_OLD})
|
||||||
|
if(WORD_SIZE EQUAL 64)
|
||||||
|
find_library(FMOD_LINK_LIBRARY_RELEASE fmodex64_vc PATHS ${fmod_lib_paths} NO_DEFAULT_PATH)
|
||||||
|
find_library(FMOD_LINK_LIBRARY_DEBUG fmodexL64_vc PATHS ${fmod_lib_paths} NO_DEFAULT_PATH)
|
||||||
|
else(WORD_SIZE EQUAL 64)#Check if CMAKE_FIND_LIBRARY_PREFIXES is set to 'lib' for darwin.
|
||||||
|
find_library(FMOD_LINK_LIBRARY_RELEASE fmodex_vc PATHS ${fmod_lib_paths} NO_DEFAULT_PATH)
|
||||||
|
find_library(FMOD_LINK_LIBRARY_DEBUG fmodexL_vc PATHS ${fmod_lib_paths} NO_DEFAULT_PATH)
|
||||||
|
endif(WORD_SIZE EQUAL 64)
|
||||||
|
else(WINDOWS)
|
||||||
|
set(FMOD_LINK_LIBRARY_RELEASE ${FMOD_LIBRARY_RELEASE})
|
||||||
|
set(FMOD_LINK_LIBRARY_DEBUG ${FMOD_LIBRARY_DEBUG})
|
||||||
|
endif(WINDOWS)
|
||||||
|
find_path(FMOD_INCLUDE_DIR fmod.hpp ${fmod_inc_paths})
|
||||||
|
if(NOT FMOD_LIBRARY_RELEASE OR NOT FMOD_INCLUDE_DIR)
|
||||||
|
if(STANDALONE)
|
||||||
|
message(FATAL_ERROR "Provided FMODEX_SDK_DIR path not found '{$FMODEX_SDK_DIR}'")
|
||||||
|
else(STANDALONE)
|
||||||
|
message(STATUS "Provided FMODEX_SDK_DIR path not found '${FMODEX_SDK_DIR}'. Falling back to prebuilts")
|
||||||
|
endif(STANDALONE)
|
||||||
|
else(NOT FMOD_LIBRARY_RELEASE OR NOT FMOD_INCLUDE_DIR)
|
||||||
|
message(STATUS "Using system-provided FMOD Ex Libraries")
|
||||||
|
set(FMOD_EXTERNAL_LIB ON)
|
||||||
|
endif(NOT FMOD_LIBRARY_RELEASE OR NOT FMOD_INCLUDE_DIR)
|
||||||
|
endif (FMODEX_SDK_DIR)
|
||||||
|
|
||||||
|
if (NOT FMOD_LIBRARY_RELEASE OR NOT FMOD_INCLUDE_DIR)
|
||||||
|
if(WINDOWS)
|
||||||
|
set(lib_suffix .dll)
|
||||||
|
elseif(DARWIN)
|
||||||
|
set(lib_suffix .dylib)
|
||||||
|
else(WINDOWS)
|
||||||
|
set(lib_suffix .so)
|
||||||
|
endif(WINDOWS)
|
||||||
|
if(WINDOWS)
|
||||||
|
if(WORD_SIZE EQUAL 64)
|
||||||
|
set(FMOD_LIBRARY_RELEASE ${LIBS_PREBUILT_DIR}/lib/release/fmodex64${lib_suffix})
|
||||||
|
set(FMOD_LIBRARY_DEBUG ${LIBS_PREBUILT_DIR}/lib/debug/fmodexL64${lib_suffix})
|
||||||
|
else(WORD_SIZE EQUAL 64)
|
||||||
|
set(FMOD_LIBRARY_RELEASE ${LIBS_PREBUILT_DIR}/lib/release/fmodex${lib_suffix})
|
||||||
|
set(FMOD_LIBRARY_DEBUG ${LIBS_PREBUILT_DIR}/lib/debug/fmodexL${lib_suffix})
|
||||||
|
endif(WORD_SIZE EQUAL 64)
|
||||||
|
else(WINDOWS)
|
||||||
|
if(WORD_SIZE EQUAL 64)
|
||||||
|
set(FMOD_LIBRARY_RELEASE ${LIBS_PREBUILT_DIR}/lib/release/libfmodex64${lib_suffix})
|
||||||
|
set(FMOD_LIBRARY_DEBUG ${LIBS_PREBUILT_DIR}/lib/debug/libfmodex64L${lib_suffix})
|
||||||
|
else(WORD_SIZE EQUAL 64)
|
||||||
|
set(FMOD_LIBRARY_RELEASE ${LIBS_PREBUILT_DIR}/lib/release/libfmodex${lib_suffix})
|
||||||
|
set(FMOD_LIBRARY_DEBUG ${LIBS_PREBUILT_DIR}/lib/debug/libfmodexL${lib_suffix})
|
||||||
|
endif(WORD_SIZE EQUAL 64)
|
||||||
|
endif(WINDOWS)
|
||||||
|
set(FMOD_LINK_LIBRARY_RELEASE ${FMOD_LIBRARY_RELEASE})
|
||||||
|
set(FMOD_LINK_LIBRARY_DEBUG ${FMOD_LIBRARY_DEBUG})
|
||||||
|
if(WINDOWS)
|
||||||
|
string(REPLACE ".dll" "_vc.lib" FMOD_LINK_LIBRARY_RELEASE ${FMOD_LIBRARY_RELEASE})
|
||||||
|
string(REPLACE ".dll" "_vc.lib" FMOD_LINK_LIBRARY_DEBUG ${FMOD_LIBRARY_DEBUG})
|
||||||
|
endif(WINDOWS)
|
||||||
|
use_prebuilt_binary(fmodex)
|
||||||
|
set(FMOD_INCLUDE_DIR
|
||||||
|
${LIBS_PREBUILT_DIR}/include/fmodex)
|
||||||
|
endif(NOT FMOD_LIBRARY_RELEASE OR NOT FMOD_INCLUDE_DIR)
|
||||||
|
|
||||||
|
if(FMOD_LIBRARY_RELEASE AND FMOD_INCLUDE_DIR)
|
||||||
|
set(FMOD ON)
|
||||||
|
if (NOT FMOD_LIBRARY_DEBUG) #Use release library in debug configuration if debug library is absent.
|
||||||
|
set(FMOD_LIBRARY_DEBUG ${FMOD_LIBRARY_RELEASE})
|
||||||
|
endif (NOT FMOD_LIBRARY_DEBUG)
|
||||||
|
else (FMOD_LIBRARY_RELEASE AND FMOD_INCLUDE_DIR)
|
||||||
|
message(STATUS "No support for FMOD EX audio (need to set FMODEX_SDK_DIR?)")
|
||||||
|
set(FMOD OFF)
|
||||||
set(FMODEX OFF)
|
set(FMODEX OFF)
|
||||||
endif (FMODEX_LIBRARY AND FMODEX_INCLUDE_DIR)
|
endif (FMOD_LIBRARY_RELEASE AND FMOD_INCLUDE_DIR)
|
||||||
|
|
||||||
if (FMODEX)
|
if (FMOD)
|
||||||
message(STATUS "Building with FMOD Ex audio support")
|
message(STATUS "Building with FMOD Ex audio support")
|
||||||
endif (FMODEX)
|
set(LLSTARTUP_COMPILE_FLAGS "${LLSTARTUP_COMPILE_FLAGS} -DLL_FMODEX")
|
||||||
|
endif (FMOD)
|
||||||
|
|||||||
112
indra/cmake/FMODSTUDIO.cmake
Normal file
112
indra/cmake/FMODSTUDIO.cmake
Normal file
@@ -0,0 +1,112 @@
|
|||||||
|
# -*- cmake -*-
|
||||||
|
|
||||||
|
include(Linking)
|
||||||
|
|
||||||
|
if (FMODEX AND FMODSTUDIO)
|
||||||
|
message( FATAL_ERROR "You can not enable two FMOD variants at the same time." )
|
||||||
|
endif (FMODEX AND FMODSTUDIO)
|
||||||
|
|
||||||
|
unset(FMOD_LIBRARY_RELEASE CACHE)
|
||||||
|
unset(FMOD_LIBRARY_DEBUG CACHE)
|
||||||
|
unset(FMOD_INCLUDE_DIR CACHE)
|
||||||
|
|
||||||
|
set(FMOD_EXTERNAL_LIB OFF)
|
||||||
|
|
||||||
|
if(STANDALONE OR WINDOWS)
|
||||||
|
if (NOT FMODSTUDIO_SDK_DIR AND WINDOWS)
|
||||||
|
#GET_FILENAME_COMPONENT(REG_DIR [HKEY_CURRENT_USER\\Software\\FMOD\ Studio\ API\ Windows] ABSOLUTE)
|
||||||
|
#set(FMODSTUDIO_SDK_DIR ${REG_DIR} CACHE PATH "Path to the FMOD Studio SDK." FORCE)
|
||||||
|
endif (NOT FMODSTUDIO_SDK_DIR AND WINDOWS)
|
||||||
|
if(NOT FMODSTUDIO_SDK_DIR AND STANDALONE)
|
||||||
|
message(FATAL_ERROR "FMODSTUDIO_SDK_DIR not set!")
|
||||||
|
endif(NOT FMODSTUDIO_SDK_DIR AND STANDALONE)
|
||||||
|
endif(STANDALONE OR WINDOWS)
|
||||||
|
|
||||||
|
if(FMODSTUDIO_SDK_DIR)
|
||||||
|
if(LINUX AND WORD_SIZE EQUAL 32)
|
||||||
|
set(fmod_lib_paths "${FMODSTUDIO_SDK_DIR}/api/lowlevel/lib/x86" )
|
||||||
|
elseif(LINUX)
|
||||||
|
set(fmod_lib_paths "${FMODSTUDIO_SDK_DIR}/api/lowlevel/lib/x86_64")
|
||||||
|
else(LINUX AND WORD_SIZE EQUAL 32)
|
||||||
|
set(fmod_lib_paths "${FMODSTUDIO_SDK_DIR}/api/lowlevel/lib")
|
||||||
|
endif(LINUX AND WORD_SIZE EQUAL 32)
|
||||||
|
set(fmod_inc_paths "${FMODSTUDIO_SDK_DIR}/api/lowlevel/inc")
|
||||||
|
|
||||||
|
if(WINDOWS)
|
||||||
|
set(CMAKE_FIND_LIBRARY_SUFFIXES_OLD ${CMAKE_FIND_LIBRARY_SUFFIXES})
|
||||||
|
set(CMAKE_FIND_LIBRARY_SUFFIXES .dll)
|
||||||
|
endif(WINDOWS)
|
||||||
|
if(WORD_SIZE EQUAL 64 AND WINDOWS)
|
||||||
|
find_library(FMOD_LIBRARY_RELEASE fmod64 PATHS ${fmod_lib_paths} NO_DEFAULT_PATH)
|
||||||
|
find_library(FMOD_LIBRARY_DEBUG fmodL64 PATHS ${fmod_lib_paths} NO_DEFAULT_PATH)
|
||||||
|
else(WORD_SIZE EQUAL 64 AND WINDOWS)#Check if CMAKE_FIND_LIBRARY_PREFIXES is set to 'lib' for darwin.
|
||||||
|
find_library(FMOD_LIBRARY_RELEASE fmod PATHS ${fmod_lib_paths} NO_DEFAULT_PATH)
|
||||||
|
find_library(FMOD_LIBRARY_DEBUG fmodL PATHS ${fmod_lib_paths} NO_DEFAULT_PATH)
|
||||||
|
endif(WORD_SIZE EQUAL 64 AND WINDOWS)
|
||||||
|
if(WINDOWS)
|
||||||
|
set(CMAKE_FIND_LIBRARY_SUFFIXES ${CMAKE_FIND_LIBRARY_SUFFIXES_OLD})
|
||||||
|
string(REPLACE ".dll" "_vc.lib" FMOD_LINK_LIBRARY_RELEASE ${FMOD_LIBRARY_RELEASE})
|
||||||
|
string(REPLACE ".dll" "_vc.lib" FMOD_LINK_LIBRARY_DEBUG ${FMOD_LIBRARY_DEBUG})
|
||||||
|
else(WINDOWS)
|
||||||
|
set(FMOD_LINK_LIBRARY_RELEASE ${FMOD_LIBRARY_RELEASE})
|
||||||
|
set(FMOD_LINK_LIBRARY_DEBUG ${FMOD_LIBRARY_DEBUG})
|
||||||
|
endif(WINDOWS)
|
||||||
|
find_path(FMOD_INCLUDE_DIR fmod.hpp ${fmod_inc_paths})
|
||||||
|
if(NOT FMOD_LIBRARY_RELEASE OR NOT FMOD_INCLUDE_DIR)
|
||||||
|
if(STANDALONE)
|
||||||
|
message(FATAL_ERROR "Provided FMODSTUDIO_SDK_DIR path not found '{$FMODSTUDIO_SDK_DIR}'")
|
||||||
|
else(STANDALONE)
|
||||||
|
message(STATUS "Provided FMODSTUDIO_SDK_DIR path not found '${FMODSTUDIO_SDK_DIR}'. Falling back to prebuilts")
|
||||||
|
endif(STANDALONE)
|
||||||
|
else(NOT FMOD_LIBRARY_RELEASE OR NOT FMOD_INCLUDE_DIR)
|
||||||
|
message(STATUS "Using system-provided FMOD Studio Libraries")
|
||||||
|
set(FMOD_EXTERNAL_LIB ON)
|
||||||
|
endif(NOT FMOD_LIBRARY_RELEASE OR NOT FMOD_INCLUDE_DIR)
|
||||||
|
endif (FMODSTUDIO_SDK_DIR)
|
||||||
|
|
||||||
|
if (NOT FMOD_LIBRARY_RELEASE OR NOT FMOD_INCLUDE_DIR)
|
||||||
|
if(WINDOWS)
|
||||||
|
set(lib_suffix .dll)
|
||||||
|
elseif(DARWIN)
|
||||||
|
set(lib_suffix .dylib)
|
||||||
|
else(WINDOWS)
|
||||||
|
set(lib_suffix .so)
|
||||||
|
endif(WINDOWS)
|
||||||
|
if(WINDOWS)
|
||||||
|
if(WORD_SIZE EQUAL 64)
|
||||||
|
set(FMOD_LIBRARY_RELEASE ${LIBS_PREBUILT_DIR}/lib/release/fmod64${lib_suffix})
|
||||||
|
set(FMOD_LIBRARY_DEBUG ${LIBS_PREBUILT_DIR}/lib/debug/fmodL64${lib_suffix})
|
||||||
|
else(WORD_SIZE EQUAL 64)
|
||||||
|
set(FMOD_LIBRARY_RELEASE ${LIBS_PREBUILT_DIR}/lib/release/fmod${lib_suffix})
|
||||||
|
set(FMOD_LIBRARY_DEBUG ${LIBS_PREBUILT_DIR}/lib/debug/fmodL${lib_suffix})
|
||||||
|
endif(WORD_SIZE EQUAL 64)
|
||||||
|
else(WINDOWS)
|
||||||
|
set(FMOD_LIBRARY_RELEASE ${LIBS_PREBUILT_DIR}/lib/release/libfmod${lib_suffix})
|
||||||
|
set(FMOD_LIBRARY_DEBUG ${LIBS_PREBUILT_DIR}/lib/debug/libfmodL${lib_suffix})
|
||||||
|
endif(WINDOWS)
|
||||||
|
set(FMOD_LINK_LIBRARY_RELEASE ${FMOD_LIBRARY_RELEASE})
|
||||||
|
set(FMOD_LINK_LIBRARY_DEBUG ${FMOD_LIBRARY_DEBUG})
|
||||||
|
if(WINDOWS)
|
||||||
|
string(REPLACE ".dll" "_vc.lib" FMOD_LINK_LIBRARY_RELEASE ${FMOD_LIBRARY_RELEASE})
|
||||||
|
string(REPLACE ".dll" "_vc.lib" FMOD_LINK_LIBRARY_DEBUG ${FMOD_LIBRARY_DEBUG})
|
||||||
|
endif(WINDOWS)
|
||||||
|
use_prebuilt_binary(fmodstudio)
|
||||||
|
set(FMOD_INCLUDE_DIR
|
||||||
|
${LIBS_PREBUILT_DIR}/include/fmodstudio)
|
||||||
|
endif(NOT FMOD_LIBRARY_RELEASE OR NOT FMOD_INCLUDE_DIR)
|
||||||
|
|
||||||
|
if(FMOD_LIBRARY_RELEASE AND FMOD_INCLUDE_DIR)
|
||||||
|
set(FMOD ON)
|
||||||
|
if (NOT FMOD_LIBRARY_DEBUG) #Use release library in debug configuration if debug library is absent.
|
||||||
|
set(FMOD_LIBRARY_DEBUG ${FMOD_LIBRARY_RELEASE})
|
||||||
|
endif (NOT FMOD_LIBRARY_DEBUG)
|
||||||
|
else (FMOD_LIBRARY_RELEASE AND FMOD_INCLUDE_DIR)
|
||||||
|
message(STATUS "No support for FMOD Studio audio (need to set FMODSTUDIO_SDK_DIR?)")
|
||||||
|
set(FMOD OFF)
|
||||||
|
set(FMODSTUDIO OFF)
|
||||||
|
endif (FMOD_LIBRARY_RELEASE AND FMOD_INCLUDE_DIR)
|
||||||
|
|
||||||
|
if (FMOD)
|
||||||
|
message(STATUS "Building with FMOD Studio audio support")
|
||||||
|
set(LLSTARTUP_COMPILE_FLAGS "${LLSTARTUP_COMPILE_FLAGS} -DLL_FMODSTUDIO")
|
||||||
|
endif (FMOD)
|
||||||
@@ -7,12 +7,17 @@ if (STANDALONE)
|
|||||||
pkg_check_modules(FREETYPE REQUIRED freetype2)
|
pkg_check_modules(FREETYPE REQUIRED freetype2)
|
||||||
else (STANDALONE)
|
else (STANDALONE)
|
||||||
use_prebuilt_binary(freetype)
|
use_prebuilt_binary(freetype)
|
||||||
if (LINUX)
|
if(MSVC12)
|
||||||
set(FREETYPE_INCLUDE_DIRS
|
set(FREETYPE_INCLUDE_DIRS
|
||||||
${LIBS_PREBUILT_DIR}/${LL_ARCH_DIR}/include)
|
${LIBS_PREBUILT_DIR}/include/freetype2
|
||||||
else (LINUX)
|
${LIBS_PREBUILT_LEGACY_DIR}/include/freetype2
|
||||||
set(FREETYPE_INCLUDE_DIRS ${LIBS_PREBUILT_DIR}/${LL_ARCH_DIR}/include)
|
)
|
||||||
endif (LINUX)
|
else(MSVC12)
|
||||||
|
set(FREETYPE_INCLUDE_DIRS
|
||||||
|
${LIBS_PREBUILT_DIR}/include
|
||||||
|
${LIBS_PREBUILT_LEGACY_DIR}/include
|
||||||
|
)
|
||||||
|
endif (MSVC12)
|
||||||
|
|
||||||
set(FREETYPE_LIBRARIES freetype)
|
set(FREETYPE_LIBRARIES freetype)
|
||||||
endif (STANDALONE)
|
endif (STANDALONE)
|
||||||
|
|||||||
@@ -8,6 +8,9 @@ if (STANDALONE)
|
|||||||
include(FindGLOD)
|
include(FindGLOD)
|
||||||
else (STANDALONE)
|
else (STANDALONE)
|
||||||
use_prebuilt_binary(GLOD)
|
use_prebuilt_binary(GLOD)
|
||||||
set(GLOD_INCLUDE_DIRS ${LIBS_PREBUILT_DIR}/${LL_ARCH_DIR}/include)
|
set(GLOD_INCLUDE_DIRS
|
||||||
|
${LIBS_PREBUILT_DIR}/include
|
||||||
|
${LIBS_PREBUILT_LEGACY_DIR}/include
|
||||||
|
)
|
||||||
set(GLOD_LIBRARIES glod)
|
set(GLOD_LIBRARIES glod)
|
||||||
endif (STANDALONE)
|
endif (STANDALONE)
|
||||||
|
|||||||
@@ -16,10 +16,13 @@ else (STANDALONE)
|
|||||||
set(GSTREAMER010_FOUND ON FORCE BOOL)
|
set(GSTREAMER010_FOUND ON FORCE BOOL)
|
||||||
set(GSTREAMER010_PLUGINS_BASE_FOUND ON FORCE BOOL)
|
set(GSTREAMER010_PLUGINS_BASE_FOUND ON FORCE BOOL)
|
||||||
set(GSTREAMER010_INCLUDE_DIRS
|
set(GSTREAMER010_INCLUDE_DIRS
|
||||||
${LIBS_PREBUILT_DIR}/${LL_ARCH_DIR}/include/gstreamer-0.10
|
${LIBS_PREBUILT_DIR}/include/gstreamer-0.10
|
||||||
${LIBS_PREBUILT_DIR}/${LL_ARCH_DIR}/include/glib-2.0
|
${LIBS_PREBUILT_DIR}/includeg/lib-2.0
|
||||||
${LIBS_PREBUILT_DIR}/${LL_ARCH_DIR}/include/libxml2
|
${LIBS_PREBUILT_DIR}/include/libxml2
|
||||||
)
|
${LIBS_PREBUILT_LEGACY_DIR}/include/gstreamer-0.10
|
||||||
|
${LIBS_PREBUILT_LEGACY_DIR}/include/glib-2.0
|
||||||
|
${LIBS_PREBUILT_LEGACY_DIR}/include/libxml2
|
||||||
|
)
|
||||||
|
|
||||||
endif (STANDALONE)
|
endif (STANDALONE)
|
||||||
|
|
||||||
|
|||||||
@@ -17,5 +17,10 @@ else (STANDALONE)
|
|||||||
endif (WINDOWS)
|
endif (WINDOWS)
|
||||||
# yes, this does look dumb, no, it's not incorrect
|
# yes, this does look dumb, no, it's not incorrect
|
||||||
# I think it's incorrect: the second one should go --Aleric
|
# I think it's incorrect: the second one should go --Aleric
|
||||||
set(BREAKPAD_INCLUDE_DIRECTORIES "${LIBS_PREBUILT_DIR}/${LL_ARCH_DIR}/include/google_breakpad" "${LIBS_PREBUILT_DIR}/${LL_ARCH_DIR}/include/google_breakpad/google_breakpad")
|
set(BREAKPAD_INCLUDE_DIRECTORIES
|
||||||
|
${LIBS_PREBUILT_DIR}/include/google_breakpad
|
||||||
|
${LIBS_PREBUILT_LEGACY_DIR}/include/google_breakpad
|
||||||
|
${LIBS_PREBUILT_DIR}/include/google_breakpad/google_breakpad
|
||||||
|
${LIBS_PREBUILT_LEGACY_DIR}/include/google_breakpad/google_breakpad
|
||||||
|
)
|
||||||
endif (STANDALONE)
|
endif (STANDALONE)
|
||||||
|
|||||||
@@ -25,7 +25,9 @@ else (STANDALONE)
|
|||||||
set(TCMALLOC_LIBRARIES tcmalloc_minimal)
|
set(TCMALLOC_LIBRARIES tcmalloc_minimal)
|
||||||
endif()
|
endif()
|
||||||
set(GOOGLE_PERFTOOLS_INCLUDE_DIR
|
set(GOOGLE_PERFTOOLS_INCLUDE_DIR
|
||||||
${LIBS_PREBUILT_DIR}/${LL_ARCH_DIR}/include)
|
${LIBS_PREBUILT_DIR}/include
|
||||||
|
${LIBS_PREBUILT_LEGACY_DIR}/include
|
||||||
|
)
|
||||||
endif (LINUX)
|
endif (LINUX)
|
||||||
endif (STANDALONE)
|
endif (STANDALONE)
|
||||||
|
|
||||||
|
|||||||
@@ -6,7 +6,10 @@ if (STANDALONE)
|
|||||||
else (STANDALONE)
|
else (STANDALONE)
|
||||||
use_prebuilt_binary(hunspell)
|
use_prebuilt_binary(hunspell)
|
||||||
|
|
||||||
set(HUNSPELL_INCLUDE_DIR ${LIBS_PREBUILT_DIR}/${LL_ARCH_DIR}/include/hunspell)
|
set(HUNSPELL_INCLUDE_DIR
|
||||||
|
${LIBS_PREBUILT_DIR}/include/hunspell
|
||||||
|
${LIBS_PREBUILT_LEGACY_DIR}/include/hunspell
|
||||||
|
)
|
||||||
|
|
||||||
if (LINUX OR DARWIN)
|
if (LINUX OR DARWIN)
|
||||||
set(HUNSPELL_LIBRARY hunspell-1.3)
|
set(HUNSPELL_LIBRARY hunspell-1.3)
|
||||||
|
|||||||
@@ -13,11 +13,14 @@ else (STANDALONE)
|
|||||||
set(JPEG_LIBRARIES jpeg)
|
set(JPEG_LIBRARIES jpeg)
|
||||||
elseif (DARWIN)
|
elseif (DARWIN)
|
||||||
set(JPEG_LIBRARIES
|
set(JPEG_LIBRARIES
|
||||||
optimized ${ARCH_PREBUILT_DIRS_RELEASE}/libjpeg.a
|
debug libjpeg.a
|
||||||
debug ${ARCH_PREBUILT_DIRS_DEBUG}/libjpeg.a
|
optimized libjpeg.a
|
||||||
)
|
)
|
||||||
elseif (WINDOWS)
|
elseif (WINDOWS)
|
||||||
set(JPEG_LIBRARIES jpeglib)
|
set(JPEG_LIBRARIES jpeglib)
|
||||||
endif (LINUX)
|
endif (LINUX)
|
||||||
set(JPEG_INCLUDE_DIRS ${LIBS_PREBUILT_DIR}/${LL_ARCH_DIR}/include)
|
set(JPEG_INCLUDE_DIRS
|
||||||
|
${LIBS_PREBUILT_DIR}/include
|
||||||
|
${LIBS_PREBUILT_LEGACY_DIR}/include
|
||||||
|
)
|
||||||
endif (STANDALONE)
|
endif (STANDALONE)
|
||||||
|
|||||||
@@ -10,13 +10,22 @@ if (STANDALONE)
|
|||||||
else (STANDALONE)
|
else (STANDALONE)
|
||||||
use_prebuilt_binary(jsoncpp)
|
use_prebuilt_binary(jsoncpp)
|
||||||
if (WINDOWS)
|
if (WINDOWS)
|
||||||
set(JSONCPP_LIBRARIES
|
if(MSVC12)
|
||||||
debug json_vc${MSVC_SUFFIX}d
|
set(JSONCPP_LIBRARIES
|
||||||
optimized json_vc${MSVC_SUFFIX})
|
debug json_vc${MSVC_SUFFIX}debug_libmt.lib
|
||||||
|
optimized json_vc${MSVC_SUFFIX}_libmt)
|
||||||
|
else(MSVC12)
|
||||||
|
set(JSONCPP_LIBRARIES
|
||||||
|
debug json_vc${MSVC_SUFFIX}d
|
||||||
|
optimized json_vc${MSVC_SUFFIX})
|
||||||
|
endif(MSVC12)
|
||||||
elseif (DARWIN)
|
elseif (DARWIN)
|
||||||
set(JSONCPP_LIBRARIES json_linux-gcc-4.0.1_libmt)
|
set(JSONCPP_LIBRARIES json_linux-gcc-4.0.1_libmt)
|
||||||
elseif (LINUX)
|
elseif (LINUX)
|
||||||
set(JSONCPP_LIBRARIES jsoncpp)
|
set(JSONCPP_LIBRARIES jsoncpp)
|
||||||
endif (WINDOWS)
|
endif (WINDOWS)
|
||||||
set(JSONCPP_INCLUDE_DIR ${LIBS_PREBUILT_DIR}/${LL_ARCH_DIR}/include/jsoncpp)
|
set(JSONCPP_INCLUDE_DIR
|
||||||
|
${LIBS_PREBUILT_DIR}/include/jsoncpp
|
||||||
|
${LIBS_PREBUILT_LEGACY_DIR}/include/jsoncpp
|
||||||
|
)
|
||||||
endif (STANDALONE)
|
endif (STANDALONE)
|
||||||
|
|||||||
@@ -87,7 +87,7 @@ MACRO(ADD_BUILD_TEST_INTERNAL name parent libraries source_files)
|
|||||||
${libraries}
|
${libraries}
|
||||||
)
|
)
|
||||||
|
|
||||||
GET_TARGET_PROPERTY(TEST_EXE ${name}_test LOCATION)
|
SET(TEST_EXE $<TARGET_FILE:${name}_test>)
|
||||||
SET(TEST_OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/${name}_test_ok.txt)
|
SET(TEST_OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/${name}_test_ok.txt)
|
||||||
|
|
||||||
IF ("${wrapper}" STREQUAL "")
|
IF ("${wrapper}" STREQUAL "")
|
||||||
|
|||||||
@@ -1,17 +1,13 @@
|
|||||||
# ll_deploy_sharedlibs_command
|
# ll_deploy_sharedlibs_command
|
||||||
# target_exe: the cmake target of the executable for which the shared libs will be deployed.
|
# target_exe: the cmake target of the executable for which the shared libs will be deployed.
|
||||||
macro(ll_deploy_sharedlibs_command target_exe)
|
macro(ll_deploy_sharedlibs_command target_exe)
|
||||||
get_target_property(TARGET_LOCATION ${target_exe} LOCATION)
|
SET(OUTPUT_PATH $<TARGET_FILE:${target_exe}>)
|
||||||
get_filename_component(OUTPUT_PATH ${TARGET_LOCATION} PATH)
|
|
||||||
|
|
||||||
if(DARWIN)
|
if(DARWIN)
|
||||||
SET_TEST_PATH(SEARCH_DIRS)
|
SET_TEST_PATH(SEARCH_DIRS)
|
||||||
get_target_property(IS_BUNDLE ${target_exe} MACOSX_BUNDLE)
|
get_target_property(IS_BUNDLE ${target_exe} MACOSX_BUNDLE)
|
||||||
if(IS_BUNDLE)
|
if(IS_BUNDLE)
|
||||||
# If its a bundle the exe is not in the target location, this should find it.
|
# If its a bundle the exe is not in the target location, this should find it.
|
||||||
get_filename_component(TARGET_FILE ${TARGET_LOCATION} NAME)
|
|
||||||
set(OUTPUT_PATH ${TARGET_LOCATION}.app/Contents/MacOS)
|
|
||||||
set(TARGET_LOCATION ${OUTPUT_PATH}/${TARGET_FILE})
|
|
||||||
set(OUTPUT_PATH ${OUTPUT_PATH}/../Resources)
|
set(OUTPUT_PATH ${OUTPUT_PATH}/../Resources)
|
||||||
endif(IS_BUNDLE)
|
endif(IS_BUNDLE)
|
||||||
elseif(WINDOWS)
|
elseif(WINDOWS)
|
||||||
@@ -26,7 +22,7 @@ macro(ll_deploy_sharedlibs_command target_exe)
|
|||||||
TARGET ${target_exe} POST_BUILD
|
TARGET ${target_exe} POST_BUILD
|
||||||
COMMAND ${CMAKE_COMMAND}
|
COMMAND ${CMAKE_COMMAND}
|
||||||
ARGS
|
ARGS
|
||||||
"-DBIN_NAME=\"${TARGET_LOCATION}\""
|
"-DBIN_NAME=\"$<TARGET_FILE:${target_exe}>\""
|
||||||
"-DSEARCH_DIRS=\"${SEARCH_DIRS}\""
|
"-DSEARCH_DIRS=\"${SEARCH_DIRS}\""
|
||||||
"-DDST_PATH=\"${OUTPUT_PATH}\""
|
"-DDST_PATH=\"${OUTPUT_PATH}\""
|
||||||
"-P"
|
"-P"
|
||||||
@@ -42,7 +38,8 @@ macro(ll_stage_sharedlib DSO_TARGET)
|
|||||||
# Also this directory is shared with RunBuildTest.cmake, y'know, for the tests.
|
# Also this directory is shared with RunBuildTest.cmake, y'know, for the tests.
|
||||||
set_target_properties(${DSO_TARGET} PROPERTIES RUNTIME_OUTPUT_DIRECTORY ${SHARED_LIB_STAGING_DIR})
|
set_target_properties(${DSO_TARGET} PROPERTIES RUNTIME_OUTPUT_DIRECTORY ${SHARED_LIB_STAGING_DIR})
|
||||||
if(NOT WINDOWS)
|
if(NOT WINDOWS)
|
||||||
get_target_property(DSO_PATH ${DSO_TARGET} LOCATION)
|
|
||||||
|
SET(DSO_PATH $<TARGET_FILE:${DSO_TARGET}>)
|
||||||
get_filename_component(DSO_FILE ${DSO_PATH} NAME)
|
get_filename_component(DSO_FILE ${DSO_PATH} NAME)
|
||||||
if(DARWIN)
|
if(DARWIN)
|
||||||
set(SHARED_LIB_STAGING_DIR_CONFIG ${SHARED_LIB_STAGING_DIR}/${CMAKE_CFG_INTDIR}/Resources)
|
set(SHARED_LIB_STAGING_DIR_CONFIG ${SHARED_LIB_STAGING_DIR}/${CMAKE_CFG_INTDIR}/Resources)
|
||||||
|
|||||||
@@ -17,7 +17,10 @@ else (STANDALONE)
|
|||||||
use_prebuilt_binary(mesa)
|
use_prebuilt_binary(mesa)
|
||||||
use_prebuilt_binary(SDL)
|
use_prebuilt_binary(SDL)
|
||||||
set (SDL_FOUND TRUE)
|
set (SDL_FOUND TRUE)
|
||||||
set (SDL_INCLUDE_DIR ${LIBS_PREBUILT_DIR}/${LL_ARCH_DIR})
|
set (SDL_INCLUDE_DIR
|
||||||
|
${LIBS_PREBUILT_DIR}/include
|
||||||
|
${LIBS_PREBUILT_LEGACY_DIR}/include
|
||||||
|
)
|
||||||
if(WORD_SIZE EQUAL 64)
|
if(WORD_SIZE EQUAL 64)
|
||||||
set (SDL_LIBRARY SDL)
|
set (SDL_LIBRARY SDL)
|
||||||
else(WORD_SIZE EQUAL 64)
|
else(WORD_SIZE EQUAL 64)
|
||||||
|
|||||||
@@ -5,26 +5,35 @@ set(${CMAKE_CURRENT_LIST_FILE}_INCLUDED "YES")
|
|||||||
include(Variables)
|
include(Variables)
|
||||||
|
|
||||||
if (NOT STANDALONE)
|
if (NOT STANDALONE)
|
||||||
set(ARCH_PREBUILT_DIRS ${LIBS_PREBUILT_DIR}/${LL_ARCH_DIR}/lib)
|
|
||||||
set(ARCH_PREBUILT_DIRS_RELEASE ${LIBS_PREBUILT_DIR}/${LL_ARCH_DIR}/lib/release)
|
if(CMAKE_BUILD_TYPE)
|
||||||
set(ARCH_PREBUILT_DIRS_DEBUG ${LIBS_PREBUILT_DIR}/${LL_ARCH_DIR}/lib/debug)
|
string(TOLOWER ${CMAKE_BUILD_TYPE} CMAKE_BUILD_TYPE_LOWER)
|
||||||
|
endif(CMAKE_BUILD_TYPE)
|
||||||
|
|
||||||
if(WINDOWS OR ${CMAKE_GENERATOR} MATCHES "Xcode")
|
if(WINDOWS OR ${CMAKE_GENERATOR} MATCHES "Xcode")
|
||||||
# the cmake xcode and VS generators implicitly append ${CMAKE_CFG_INTDIR} to the library paths for us
|
# the cmake xcode and VS generators implicitly append ${CMAKE_CFG_INTDIR} to the library paths for us
|
||||||
# fortunately both windows and darwin are case insensitive filesystems so this works.
|
# fortunately both windows and darwin are case insensitive filesystems so this works.
|
||||||
set(ARCH_PREBUILT_LINK_DIRS "${ARCH_PREBUILT_DIRS}")
|
set(ARCH_PREBUILT_LINK_DIRS
|
||||||
|
${LIBS_PREBUILT_DIR}/lib
|
||||||
|
${LIBS_PREBUILT_LEGACY_DIR}/lib
|
||||||
|
)
|
||||||
else(WINDOWS OR ${CMAKE_GENERATOR} MATCHES "Xcode")
|
else(WINDOWS OR ${CMAKE_GENERATOR} MATCHES "Xcode")
|
||||||
# else block is for linux and any other makefile based generators
|
# else block is for linux and any other makefile based generators
|
||||||
string(TOLOWER ${CMAKE_BUILD_TYPE} CMAKE_BUILD_TYPE_LOWER)
|
set(ARCH_PREBUILT_LINK_DIRS
|
||||||
set(ARCH_PREBUILT_LINK_DIRS ${ARCH_PREBUILT_DIRS}/${CMAKE_BUILD_TYPE_LOWER})
|
${LIBS_PREBUILT_DIR}/lib/${CMAKE_BUILD_TYPE_LOWER}
|
||||||
|
${LIBS_PREBUILT_LEGACY_DIR}/lib/${CMAKE_BUILD_TYPE_LOWER}
|
||||||
|
)
|
||||||
endif(WINDOWS OR ${CMAKE_GENERATOR} MATCHES "Xcode")
|
endif(WINDOWS OR ${CMAKE_GENERATOR} MATCHES "Xcode")
|
||||||
|
|
||||||
if (NOT "${CMAKE_BUILD_TYPE}" STREQUAL "Release")
|
if (NOT "${CMAKE_BUILD_TYPE_LOWER}" STREQUAL "release")
|
||||||
# When we're building something other than Release, append the
|
# When we're building something other than Release, append the
|
||||||
# packages/lib/release directory to deal with autobuild packages that don't
|
# packages/lib/release directory to deal with autobuild packages that don't
|
||||||
# provide (e.g.) lib/debug libraries.
|
# provide (e.g.) lib/debug libraries.
|
||||||
list(APPEND ARCH_PREBUILT_LINK_DIRS ${ARCH_PREBUILT_DIRS_RELEASE})
|
list(APPEND ARCH_PREBUILT_LINK_DIRS
|
||||||
endif (NOT "${CMAKE_BUILD_TYPE}" STREQUAL "Release")
|
${LIBS_PREBUILT_DIR}/lib/release
|
||||||
|
${LIBS_PREBUILT_LEGACY_DIR}/lib/release
|
||||||
|
)
|
||||||
|
endif (NOT "${CMAKE_BUILD_TYPE_LOWER}" STREQUAL "release")
|
||||||
endif (NOT STANDALONE)
|
endif (NOT STANDALONE)
|
||||||
|
|
||||||
link_directories(${ARCH_PREBUILT_LINK_DIRS})
|
link_directories(${ARCH_PREBUILT_LINK_DIRS})
|
||||||
|
|||||||
@@ -15,7 +15,10 @@ else (STANDALONE)
|
|||||||
set(NDOF_LIBRARY ndofdev)
|
set(NDOF_LIBRARY ndofdev)
|
||||||
endif (WINDOWS)
|
endif (WINDOWS)
|
||||||
|
|
||||||
set(NDOF_INCLUDE_DIR ${LIBS_PREBUILT_DIR}/${LL_ARCH_DIR}/include/ndofdev)
|
set(NDOF_INCLUDE_DIR
|
||||||
|
${LIBS_PREBUILT_DIR}/include/ndofdev
|
||||||
|
${LIBS_PREBUILT_LEGACY_DIR}/include/ndofdev
|
||||||
|
)
|
||||||
set(NDOF_FOUND 1)
|
set(NDOF_FOUND 1)
|
||||||
endif (STANDALONE)
|
endif (STANDALONE)
|
||||||
|
|
||||||
|
|||||||
@@ -2,6 +2,7 @@
|
|||||||
include(Linking)
|
include(Linking)
|
||||||
include(Prebuilt)
|
include(Prebuilt)
|
||||||
|
|
||||||
|
if(NOT FMOD)
|
||||||
if (LINUX)
|
if (LINUX)
|
||||||
set(OPENAL ON CACHE BOOL "Enable OpenAL")
|
set(OPENAL ON CACHE BOOL "Enable OpenAL")
|
||||||
else (LINUX)
|
else (LINUX)
|
||||||
@@ -21,9 +22,14 @@ if (OPENAL)
|
|||||||
openal
|
openal
|
||||||
alut
|
alut
|
||||||
)
|
)
|
||||||
set(OPENAL_INCLUDE_DIRS ${LIBS_PREBUILT_DIR}/${LL_ARCH_DIR}/include)
|
set(OPENAL_INCLUDE_DIRS
|
||||||
|
${LIBS_PREBUILT_DIR}/include
|
||||||
|
${LIBS_PREBUILT_LEGACY_DIR}/include
|
||||||
|
)
|
||||||
endif (OPENAL)
|
endif (OPENAL)
|
||||||
|
|
||||||
if (OPENAL)
|
if (OPENAL)
|
||||||
message(STATUS "Building with OpenAL audio support")
|
message(STATUS "Building with OpenAL audio support")
|
||||||
|
set(LLSTARTUP_COMPILE_FLAGS "${LLSTARTUP_COMPILE_FLAGS} -DLL_OPENAL")
|
||||||
endif (OPENAL)
|
endif (OPENAL)
|
||||||
|
endif(NOT FMOD)
|
||||||
|
|||||||
@@ -3,5 +3,8 @@ include(Prebuilt)
|
|||||||
|
|
||||||
if (NOT (STANDALONE OR DARWIN))
|
if (NOT (STANDALONE OR DARWIN))
|
||||||
use_prebuilt_binary(glext)
|
use_prebuilt_binary(glext)
|
||||||
set(GLEXT_INCLUDE_DIR ${LIBS_PREBUILT_DIR}/${LL_ARCH_DIR}/include)
|
set(GLEXT_INCLUDE_DIR
|
||||||
|
${LIBS_PREBUILT_DIR}/include
|
||||||
|
${LIBS_PREBUILT_LEGACY_DIR}/include
|
||||||
|
)
|
||||||
endif (NOT (STANDALONE OR DARWIN))
|
endif (NOT (STANDALONE OR DARWIN))
|
||||||
|
|||||||
@@ -13,9 +13,14 @@ else (STANDALONE OR USE_SYSTEM_OPENSSL)
|
|||||||
else (WINDOWS)
|
else (WINDOWS)
|
||||||
set(OPENSSL_LIBRARIES ssl)
|
set(OPENSSL_LIBRARIES ssl)
|
||||||
endif (WINDOWS)
|
endif (WINDOWS)
|
||||||
set(OPENSSL_INCLUDE_DIRS ${LIBS_PREBUILT_DIR}/${LL_ARCH_DIR}/include)
|
set(OPENSSL_INCLUDE_DIRS
|
||||||
|
${LIBS_PREBUILT_DIR}/include
|
||||||
|
${LIBS_PREBUILT_LEGACY_DIR}/include
|
||||||
|
)
|
||||||
endif (STANDALONE OR USE_SYSTEM_OPENSSL)
|
endif (STANDALONE OR USE_SYSTEM_OPENSSL)
|
||||||
|
|
||||||
if (LINUX OR DARWIN)
|
if (LINUX)
|
||||||
|
set(CRYPTO_LIBRARIES crypto dl)
|
||||||
|
elseif (DARWIN)
|
||||||
set(CRYPTO_LIBRARIES crypto)
|
set(CRYPTO_LIBRARIES crypto)
|
||||||
endif (LINUX OR DARWIN)
|
endif (LINUX)
|
||||||
|
|||||||
@@ -9,11 +9,42 @@ if (STANDALONE)
|
|||||||
else (STANDALONE)
|
else (STANDALONE)
|
||||||
use_prebuilt_binary(libpng)
|
use_prebuilt_binary(libpng)
|
||||||
if (WINDOWS)
|
if (WINDOWS)
|
||||||
set(PNG_LIBRARIES libpng15)
|
if(MSVC12)
|
||||||
|
set(PNG_LIBRARIES libpng16)
|
||||||
|
else(MSVC12)
|
||||||
|
set(PNG_LIBRARIES libpng15)
|
||||||
|
endif(MSVC12)
|
||||||
elseif(DARWIN)
|
elseif(DARWIN)
|
||||||
set(PNG_LIBRARIES png15)
|
set(PNG_LIBRARIES png15)
|
||||||
else(LINUX)
|
else(LINUX)
|
||||||
set(PNG_LIBRARIES png15)
|
if (CMAKE_SIZEOF_VOID_P EQUAL 4) # Singu TODO: update png
|
||||||
|
set(PNG_LIBRARIES png15)
|
||||||
|
else ()
|
||||||
|
#
|
||||||
|
# When we have updated static libraries in competition with older
|
||||||
|
# shared libraries and we want the former to win, we need to do some
|
||||||
|
# extra work. The *_PRELOAD_ARCHIVES settings are invoked early
|
||||||
|
# and will pull in the entire archive to the binary giving it
|
||||||
|
# priority in symbol resolution. Beware of cmake moving the
|
||||||
|
# achive load itself to another place on the link command line. If
|
||||||
|
# that happens, you can try something like -Wl,-lpng16 here to hide
|
||||||
|
# the archive. Also be aware that the linker will not tolerate a
|
||||||
|
# second whole-archive load of the archive. See viewer's
|
||||||
|
# CMakeLists.txt for more information.
|
||||||
|
#
|
||||||
|
set(PNG_PRELOAD_ARCHIVES -Wl,--whole-archive png16 -Wl,--no-whole-archive)
|
||||||
|
set(PNG_LIBRARIES png16)
|
||||||
|
endif ()
|
||||||
endif()
|
endif()
|
||||||
set(PNG_INCLUDE_DIRS ${LIBS_PREBUILT_DIR}/${LL_ARCH_DIR}/include/)
|
if (WINDOWS)
|
||||||
|
set(PNG_INCLUDE_DIRS
|
||||||
|
${LIBS_PREBUILT_DIR}/include/${PNG_LIBRARIES}
|
||||||
|
${LIBS_PREBUILT_LEGACY_DIR}/include/${PNG_LIBRARIES}
|
||||||
|
)
|
||||||
|
else (WINDOWS)
|
||||||
|
set(PNG_INCLUDE_DIRS
|
||||||
|
${LIBS_PREBUILT_DIR}/include/lib${PNG_LIBRARIES}
|
||||||
|
${LIBS_PREBUILT_LEGACY_DIR}/include/lib${PNG_LIBRARIES}
|
||||||
|
)
|
||||||
|
endif (WINDOWS)
|
||||||
endif (STANDALONE)
|
endif (STANDALONE)
|
||||||
|
|||||||
@@ -13,8 +13,9 @@ if (PULSEAUDIO)
|
|||||||
use_prebuilt_binary(pulseaudio)
|
use_prebuilt_binary(pulseaudio)
|
||||||
set(PULSEAUDIO_FOUND ON FORCE BOOL)
|
set(PULSEAUDIO_FOUND ON FORCE BOOL)
|
||||||
set(PULSEAUDIO_INCLUDE_DIRS
|
set(PULSEAUDIO_INCLUDE_DIRS
|
||||||
${LIBS_PREBUILT_DIR}/${LL_ARCH_DIR}/include
|
${LIBS_PREBUILT_DIR}/include
|
||||||
)
|
${LIBS_PREBUILT_LEGACY_DIR}/include
|
||||||
|
)
|
||||||
# We don't need to explicitly link against pulseaudio itself, because
|
# We don't need to explicitly link against pulseaudio itself, because
|
||||||
# the viewer probes for the system's copy at runtime.
|
# the viewer probes for the system's copy at runtime.
|
||||||
set(PULSEAUDIO_LIBRARIES
|
set(PULSEAUDIO_LIBRARIES
|
||||||
|
|||||||
@@ -9,18 +9,29 @@ if (DARWIN)
|
|||||||
include(CMakeFindFrameworks)
|
include(CMakeFindFrameworks)
|
||||||
find_library(QUICKTIME_LIBRARY QuickTime)
|
find_library(QUICKTIME_LIBRARY QuickTime)
|
||||||
elseif (WINDOWS AND WORD_SIZE EQUAL 32)
|
elseif (WINDOWS AND WORD_SIZE EQUAL 32)
|
||||||
set(QUICKTIME_SDK_DIR "$ENV{PROGRAMFILES}/QuickTime SDK"
|
SET(program_files "ProgramFiles(x86)")
|
||||||
|
SET(program_files $ENV{${program_files}})
|
||||||
|
if(NOT program_files)
|
||||||
|
SET(program_files $ENV{ProgramW6432})
|
||||||
|
endif(NOT program_files)
|
||||||
|
if(NOT program_files)
|
||||||
|
SET(program_files $ENV{ProgramFiles})
|
||||||
|
endif(NOT program_files)
|
||||||
|
|
||||||
|
set(QUICKTIME_SDK_DIR "${program_files}/QuickTime SDK"
|
||||||
CACHE PATH "Location of the QuickTime SDK.")
|
CACHE PATH "Location of the QuickTime SDK.")
|
||||||
|
|
||||||
find_library(DEBUG_QUICKTIME_LIBRARY qtmlclient
|
find_library(DEBUG_QUICKTIME_LIBRARY qtmlclient
|
||||||
PATHS
|
PATHS
|
||||||
${ARCH_PREBUILT_DIRS_DEBUG}
|
${LIBS_PREBUILT_DIR}/lib/debug
|
||||||
|
${LIBS_PREBUILT_LEGACY_DIR}/lib/debug
|
||||||
"${QUICKTIME_SDK_DIR}\\libraries"
|
"${QUICKTIME_SDK_DIR}\\libraries"
|
||||||
)
|
)
|
||||||
|
|
||||||
find_library(RELEASE_QUICKTIME_LIBRARY qtmlclient
|
find_library(RELEASE_QUICKTIME_LIBRARY qtmlclient
|
||||||
PATHS
|
PATHS
|
||||||
${ARCH_PREBUILT_DIRS_RELEASE}
|
${LIBS_PREBUILT_DIR}/lib/release
|
||||||
|
${LIBS_PREBUILT_LEGACY_DIR}/lib/release
|
||||||
"${QUICKTIME_SDK_DIR}\\libraries"
|
"${QUICKTIME_SDK_DIR}\\libraries"
|
||||||
)
|
)
|
||||||
|
|
||||||
@@ -33,7 +44,8 @@ elseif (WINDOWS AND WORD_SIZE EQUAL 32)
|
|||||||
endif (DEBUG_QUICKTIME_LIBRARY AND RELEASE_QUICKTIME_LIBRARY)
|
endif (DEBUG_QUICKTIME_LIBRARY AND RELEASE_QUICKTIME_LIBRARY)
|
||||||
|
|
||||||
include_directories(
|
include_directories(
|
||||||
${LIBS_PREBUILT_DIR}/${LL_ARCH_DIR}/include/quicktime
|
${LIBS_PREBUILT_DIR}/include/quicktime
|
||||||
|
${LIBS_PREBUILT_LEGACY_DIR}/include/quicktime
|
||||||
"${QUICKTIME_SDK_DIR}\\CIncludes"
|
"${QUICKTIME_SDK_DIR}\\CIncludes"
|
||||||
)
|
)
|
||||||
endif (DARWIN)
|
endif (DARWIN)
|
||||||
|
|||||||
@@ -55,12 +55,18 @@ else (STANDALONE)
|
|||||||
endif (LINUX)
|
endif (LINUX)
|
||||||
|
|
||||||
include_directories (
|
include_directories (
|
||||||
${LIBS_PREBUILT_DIR}/${LL_ARCH_DIR}/include
|
${LIBS_PREBUILT_DIR}/packages/include
|
||||||
${LIBS_PREBUILT_DIR}/${LL_ARCH_DIR}/include/cairo
|
${LIBS_PREBUILT_DIR}/packages/include/cairo
|
||||||
${LIBS_PREBUILT_DIR}/${LL_ARCH_DIR}/include/pixman-1
|
${LIBS_PREBUILT_DIR}/packages/include/pixman-1
|
||||||
|
${LIBS_PREBUILT_LEGACY_DIR}/include
|
||||||
|
${LIBS_PREBUILT_LEGACY_DIR}/include/cairo
|
||||||
|
${LIBS_PREBUILT_LEGACY_DIR}/include/pixman-1
|
||||||
)
|
)
|
||||||
foreach(include ${${LL_ARCH}_INCLUDES})
|
foreach(include ${${LL_ARCH}_INCLUDES})
|
||||||
include_directories(${LIBS_PREBUILT_DIR}/${LL_ARCH_DIR}/include/${include})
|
include_directories(
|
||||||
|
${LIBS_PREBUILT_DIR}/include/${include}
|
||||||
|
${LIBS_PREBUILT_LEGACY_DIR}/include/${include}
|
||||||
|
)
|
||||||
endforeach(include)
|
endforeach(include)
|
||||||
endif (STANDALONE)
|
endif (STANDALONE)
|
||||||
|
|
||||||
|
|||||||
@@ -11,6 +11,6 @@ if (INSTALL)
|
|||||||
set(APP_BIN_DIR bin)
|
set(APP_BIN_DIR bin)
|
||||||
endif(NOT APP_BIN_DIR)
|
endif(NOT APP_BIN_DIR)
|
||||||
if(NOT APP_SHARE_DIR)
|
if(NOT APP_SHARE_DIR)
|
||||||
set(APP_SHARE_DIR share/secondlife-${viewer_VERSION})
|
set(APP_SHARE_DIR share/secondlife-${${ROOT_PROJECT_NAME}_VERSION})
|
||||||
endif(NOT APP_SHARE_DIR)
|
endif(NOT APP_SHARE_DIR)
|
||||||
endif (INSTALL)
|
endif (INSTALL)
|
||||||
|
|||||||
@@ -32,9 +32,6 @@ set(DISABLE_TCMALLOC OFF CACHE BOOL "Disable linkage of TCMalloc. (64bit builds
|
|||||||
set(LL_TESTS OFF CACHE BOOL "Build and run unit and integration tests (disable for build timing runs to reduce variation)")
|
set(LL_TESTS OFF CACHE BOOL "Build and run unit and integration tests (disable for build timing runs to reduce variation)")
|
||||||
set(DISABLE_FATAL_WARNINGS TRUE CACHE BOOL "Set this to FALSE to enable fatal warnings.")
|
set(DISABLE_FATAL_WARNINGS TRUE CACHE BOOL "Set this to FALSE to enable fatal warnings.")
|
||||||
|
|
||||||
set(LIBS_PREBUILT_DIR ${CMAKE_SOURCE_DIR}/../libraries CACHE PATH
|
|
||||||
"Location of prebuilt libraries.")
|
|
||||||
|
|
||||||
if (${CMAKE_SYSTEM_NAME} MATCHES "Windows")
|
if (${CMAKE_SYSTEM_NAME} MATCHES "Windows")
|
||||||
set(WINDOWS ON BOOL FORCE)
|
set(WINDOWS ON BOOL FORCE)
|
||||||
if (WORD_SIZE EQUAL 32)
|
if (WORD_SIZE EQUAL 32)
|
||||||
@@ -97,24 +94,54 @@ endif (${CMAKE_SYSTEM_NAME} MATCHES "Linux")
|
|||||||
if (${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
|
if (${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
|
||||||
set(DARWIN 1)
|
set(DARWIN 1)
|
||||||
|
|
||||||
if(${CMAKE_GENERATOR} MATCHES "Xcode")
|
execute_process(
|
||||||
#SDK Compiler and Deployment targets for XCode
|
COMMAND sh -c "xcodebuild -version | grep Xcode | cut -d ' ' -f2 | cut -d'.' -f1-2"
|
||||||
if (${XCODE_VERSION} VERSION_LESS 4.0.0)
|
OUTPUT_VARIABLE XCODE_VERSION )
|
||||||
set(CMAKE_OSX_SYSROOT /Developer/SDKs/MacOSX10.5.sdk)
|
string(REGEX REPLACE "(\r?\n)+$" "" XCODE_VERSION "${XCODE_VERSION}")
|
||||||
set(CMAKE_OSX_DEPLOYMENT_TARGET 10.5)
|
|
||||||
else (${XCODE_VERSION} VERSION_LESS 4.0.0)
|
|
||||||
set(CMAKE_OSX_SYSROOT /Developer/SDKs/MacOSX10.6.sdk)
|
|
||||||
set(CMAKE_OSX_DEPLOYMENT_TARGET 10.6)
|
|
||||||
endif (${XCODE_VERSION} VERSION_LESS 4.0.0)
|
|
||||||
else(${CMAKE_GENERATOR} MATCHES "Xcode")
|
|
||||||
set(CMAKE_OSX_SYSROOT /Developer/SDKs/MacOSX10.6.sdk)
|
|
||||||
set(CMAKE_OSX_DEPLOYMENT_TARGET 10.6)
|
|
||||||
endif(${CMAKE_GENERATOR} MATCHES "Xcode")
|
|
||||||
|
|
||||||
set(CMAKE_XCODE_ATTRIBUTE_GCC_VERSION "com.apple.compilers.llvmgcc42")
|
# # To support a different SDK update these Xcode settings:
|
||||||
|
# if (XCODE_VERSION GREATER 4.9) # (Which would be 5.0+)
|
||||||
|
# set(CMAKE_OSX_DEPLOYMENT_TARGET 10.8)
|
||||||
|
# set(CMAKE_OSX_SYSROOT macosx10.9)
|
||||||
|
# else (XCODE_VERION GREATER 4.9)
|
||||||
|
# if (XCODE_VERSION GREATER 4.5)
|
||||||
|
# set(CMAKE_OSX_DEPLOYMENT_TARGET 10.7)
|
||||||
|
# set(CMAKE_OSX_SYSROOT macosx10.8)
|
||||||
|
# else (XCODE_VERSION GREATER 4.5)
|
||||||
|
# if (XCODE_VERSION GREATER 4.2)
|
||||||
|
# set(CMAKE_OSX_DEPLOYMENT_TARGET 10.6)
|
||||||
|
# set(CMAKE_OSX_SYSROOT macosx10.7)
|
||||||
|
# else (XCODE_VERSION GREATER 4.2)
|
||||||
|
# set(CMAKE_OSX_DEPLOYMENT_TARGET 10.6)
|
||||||
|
# set(CMAKE_OSX_SYSROOT macosx10.7)
|
||||||
|
# endif (XCODE_VERSION GREATER 4.2)
|
||||||
|
# endif (XCODE_VERSION GREATER 4.5)
|
||||||
|
# endif (XCODE_VERSION GREATER 4.9)
|
||||||
|
|
||||||
|
# Hardcode SDK we build against until we can test and allow newer ones
|
||||||
|
# as autodetected in the code above
|
||||||
|
set(CMAKE_OSX_DEPLOYMENT_TARGET 10.6)
|
||||||
|
set(CMAKE_OSX_SYSROOT macosx10.6)
|
||||||
|
|
||||||
|
# Support for Unix Makefiles generator
|
||||||
|
if (CMAKE_GENERATOR STREQUAL "Unix Makefiles")
|
||||||
|
execute_process(COMMAND xcodebuild -version -sdk "${CMAKE_OSX_SYSROOT}" Path | head -n 1 OUTPUT_VARIABLE CMAKE_OSX_SYSROOT)
|
||||||
|
string(REGEX REPLACE "(\r?\n)+$" "" CMAKE_OSX_SYSROOT "${CMAKE_OSX_SYSROOT}")
|
||||||
|
endif (CMAKE_GENERATOR STREQUAL "Unix Makefiles")
|
||||||
|
|
||||||
|
# LLVM-GCC has been removed in Xcode5
|
||||||
|
if (XCODE_VERSION GREATER 4.9)
|
||||||
|
set(CMAKE_XCODE_ATTRIBUTE_GCC_VERSION "com.apple.compilers.llvm.clang.1_0")
|
||||||
|
else (XCODE_VERSION GREATER 4.9)
|
||||||
|
set(CMAKE_XCODE_ATTRIBUTE_GCC_VERSION "com.apple.compilers.llvmgcc42")
|
||||||
|
endif (XCODE_VERSION GREATER 4.9)
|
||||||
|
|
||||||
set(CMAKE_XCODE_ATTRIBUTE_DEBUG_INFORMATION_FORMAT dwarf-with-dsym)
|
set(CMAKE_XCODE_ATTRIBUTE_DEBUG_INFORMATION_FORMAT dwarf-with-dsym)
|
||||||
|
|
||||||
|
message(STATUS "Xcode version: ${XCODE_VERSION}")
|
||||||
|
message(STATUS "OSX sysroot: ${CMAKE_OSX_SYSROOT}")
|
||||||
|
message(STATUS "OSX deployment target: ${CMAKE_OSX_DEPLOYMENT_TARGET}")
|
||||||
|
|
||||||
# Build only for i386 by default, system default on MacOSX 10.6 is x86_64
|
# Build only for i386 by default, system default on MacOSX 10.6 is x86_64
|
||||||
set(CMAKE_OSX_ARCHITECTURES i386)
|
set(CMAKE_OSX_ARCHITECTURES i386)
|
||||||
set(ARCH i386)
|
set(ARCH i386)
|
||||||
@@ -124,6 +151,12 @@ if (${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
|
|||||||
set(LL_ARCH_DIR universal-darwin)
|
set(LL_ARCH_DIR universal-darwin)
|
||||||
endif (${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
|
endif (${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
|
||||||
|
|
||||||
|
set(LIBS_PREBUILT_DIR ${CMAKE_BINARY_DIR}/packages CACHE PATH
|
||||||
|
"Location of prebuilt libraries.")
|
||||||
|
|
||||||
|
set(LIBS_PREBUILT_LEGACY_DIR ${CMAKE_BINARY_DIR}/packages/libraries/${LL_ARCH_DIR} CACHE PATH
|
||||||
|
"Legacy location of prebuilt libraries.")
|
||||||
|
|
||||||
if (WINDOWS AND WORD_SIZE EQUAL 32)
|
if (WINDOWS AND WORD_SIZE EQUAL 32)
|
||||||
set(PREBUILT_TYPE windows)
|
set(PREBUILT_TYPE windows)
|
||||||
elseif (WINDOWS AND WORD_SIZE EQUAL 64)
|
elseif (WINDOWS AND WORD_SIZE EQUAL 64)
|
||||||
|
|||||||
@@ -32,8 +32,8 @@ if (WINDOWS)
|
|||||||
)
|
)
|
||||||
elseif (DARWIN)
|
elseif (DARWIN)
|
||||||
set(WEBKIT_PLUGIN_LIBRARIES
|
set(WEBKIT_PLUGIN_LIBRARIES
|
||||||
optimized ${ARCH_PREBUILT_DIRS_RELEASE}/libllqtwebkit.dylib
|
debug libllqtwebkit.dylib
|
||||||
debug ${ARCH_PREBUILT_DIRS_DEBUG}/libllqtwebkit.dylib
|
optimized libllqtwebkit.dylib
|
||||||
)
|
)
|
||||||
elseif (LINUX)
|
elseif (LINUX)
|
||||||
if (STANDALONE)
|
if (STANDALONE)
|
||||||
@@ -50,7 +50,6 @@ elseif (LINUX)
|
|||||||
ssl
|
ssl
|
||||||
# qgif
|
# qgif
|
||||||
# qjpeg
|
# qjpeg
|
||||||
jscore
|
|
||||||
jpeg
|
jpeg
|
||||||
fontconfig
|
fontconfig
|
||||||
X11
|
X11
|
||||||
@@ -58,5 +57,8 @@ elseif (LINUX)
|
|||||||
Xext
|
Xext
|
||||||
GL
|
GL
|
||||||
)
|
)
|
||||||
|
if (CMAKE_SIZEOF_VOID_P EQUAL 4) # Singu TODO: update webkit
|
||||||
|
set(WEBKIT_PLUGIN_LIBRARIES ${WEBKIT_PLUGIN_LIBRARIES} jscore)
|
||||||
|
endif (CMAKE_SIZEOF_VOID_P EQUAL 4)
|
||||||
endif (STANDALONE)
|
endif (STANDALONE)
|
||||||
endif (WINDOWS)
|
endif (WINDOWS)
|
||||||
|
|||||||
@@ -9,5 +9,8 @@ if (STANDALONE)
|
|||||||
else (STANDALONE)
|
else (STANDALONE)
|
||||||
use_prebuilt_binary(xmlrpc-epi)
|
use_prebuilt_binary(xmlrpc-epi)
|
||||||
set(XMLRPCEPI_LIBRARIES xmlrpc-epi)
|
set(XMLRPCEPI_LIBRARIES xmlrpc-epi)
|
||||||
set(XMLRPCEPI_INCLUDE_DIRS ${LIBS_PREBUILT_DIR}/${LL_ARCH_DIR}/include)
|
set(XMLRPCEPI_INCLUDE_DIRS
|
||||||
|
${LIBS_PREBUILT_DIR}/include
|
||||||
|
${LIBS_PREBUILT_LEGACY_DIR}/include
|
||||||
|
)
|
||||||
endif (STANDALONE)
|
endif (STANDALONE)
|
||||||
|
|||||||
@@ -17,6 +17,9 @@ else (STANDALONE)
|
|||||||
set(ZLIB_LIBRARIES z)
|
set(ZLIB_LIBRARIES z)
|
||||||
endif (WINDOWS)
|
endif (WINDOWS)
|
||||||
if (WINDOWS OR LINUX)
|
if (WINDOWS OR LINUX)
|
||||||
set(ZLIB_INCLUDE_DIRS ${LIBS_PREBUILT_DIR}/${LL_ARCH_DIR}/include/zlib)
|
set(ZLIB_INCLUDE_DIRS
|
||||||
|
${LIBS_PREBUILT_DIR}/include/zlib
|
||||||
|
${LIBS_PREBUILT_LEGACY_DIR}/include/zlib
|
||||||
|
)
|
||||||
endif (WINDOWS OR LINUX)
|
endif (WINDOWS OR LINUX)
|
||||||
endif (STANDALONE)
|
endif (STANDALONE)
|
||||||
|
|||||||
@@ -28,97 +28,16 @@
|
|||||||
#ifndef CWDEBUG
|
#ifndef CWDEBUG
|
||||||
|
|
||||||
#ifdef DEBUG_CURLIO
|
#ifdef DEBUG_CURLIO
|
||||||
|
#error DEBUG_CURLIO is not supported without libcwd.
|
||||||
// If CWDEBUG is not defined, but DEBUG_CURLIO is, then replace
|
// In order to use DEBUG_CURLIO you must install and use libcwd.
|
||||||
// some of the cwd macro's with something that generates viewer
|
// Download libcwd:
|
||||||
// specific debug output. Note that this generates a LOT of
|
// git clone https://github.com/CarloWood/libcwd.git
|
||||||
// output and should not normally be defined.
|
#endif
|
||||||
|
|
||||||
#include <string>
|
|
||||||
#include "llpreprocessor.h"
|
|
||||||
|
|
||||||
namespace debug {
|
|
||||||
namespace libcwd {
|
|
||||||
|
|
||||||
struct buf2str {
|
|
||||||
buf2str(char const* buf, int size) : mBuf(buf), mSize(size) { }
|
|
||||||
char const* mBuf;
|
|
||||||
int mSize;
|
|
||||||
};
|
|
||||||
|
|
||||||
struct libcwd_do_type {
|
|
||||||
void on() const { }
|
|
||||||
};
|
|
||||||
extern LL_COMMON_API libcwd_do_type const libcw_do;
|
|
||||||
|
|
||||||
} // namespace libcwd
|
|
||||||
|
|
||||||
enum print_thread_id_t { print_thread_id };
|
|
||||||
inline void init() { }
|
|
||||||
struct Indent {
|
|
||||||
int M_indent;
|
|
||||||
static ll_thread_local int S_indentation;
|
|
||||||
enum LL_COMMON_API print_nt { print };
|
|
||||||
LL_COMMON_API Indent(int indent);
|
|
||||||
LL_COMMON_API ~Indent();
|
|
||||||
};
|
|
||||||
|
|
||||||
extern LL_COMMON_API std::ostream& operator<<(std::ostream& os, libcwd::buf2str const& b2s);
|
|
||||||
extern LL_COMMON_API std::ostream& operator<<(std::ostream& os, Indent::print_nt);
|
|
||||||
extern LL_COMMON_API std::ostream& operator<<(std::ostream& os, print_thread_id_t);
|
|
||||||
|
|
||||||
namespace dc {
|
|
||||||
|
|
||||||
struct fake_channel {
|
|
||||||
int mOn;
|
|
||||||
char const* mLabel;
|
|
||||||
fake_channel(int on, char const* label) : mOn(on), mLabel(label) { }
|
|
||||||
fake_channel(void) : mOn(0) { }
|
|
||||||
fake_channel& operator()(bool) { return *this; }
|
|
||||||
fake_channel const& operator()(bool) const { return *this; }
|
|
||||||
bool is_on() const { return !!mOn; }
|
|
||||||
bool is_off() const { return !mOn; }
|
|
||||||
void on() const { }
|
|
||||||
void off() const { }
|
|
||||||
};
|
|
||||||
extern LL_COMMON_API fake_channel const warning;
|
|
||||||
extern LL_COMMON_API fake_channel const curl;
|
|
||||||
extern LL_COMMON_API fake_channel const curlio;
|
|
||||||
extern LL_COMMON_API fake_channel const curltr;
|
|
||||||
extern LL_COMMON_API fake_channel const statemachine;
|
|
||||||
extern LL_COMMON_API fake_channel const notice;
|
|
||||||
extern LL_COMMON_API fake_channel const snapshot;
|
|
||||||
|
|
||||||
} // namespace dc
|
|
||||||
} // namespace debug
|
|
||||||
|
|
||||||
#define LIBCWD_DEBUG_CHANNELS debug
|
|
||||||
#define LibcwDoutScopeBegin(a, b, c) do { using namespace debug; using namespace debug::libcwd; llinfos_nf << print_thread_id << (c).mLabel << ": " << Indent::print;
|
|
||||||
#define LibcwDoutStream llcont
|
|
||||||
#define LibcwDoutScopeEnd llcont << llendl; } while(0)
|
|
||||||
|
|
||||||
#define Debug(x) do { using namespace debug; using namespace debug::libcwd; x; } while(0)
|
|
||||||
#define Dout(a, b) do { using namespace debug; using namespace debug::libcwd; if ((a).mOn) { llinfos_nf << print_thread_id << (a).mLabel << ": " << Indent::print << b << llendl; } } while(0)
|
|
||||||
#define DoutEntering(a, b) \
|
|
||||||
int __slviewer_debug_indentation = 2; \
|
|
||||||
{ \
|
|
||||||
using namespace debug; \
|
|
||||||
using namespace debug::libcwd; \
|
|
||||||
if ((a).mOn) \
|
|
||||||
llinfos_nf << print_thread_id << (a).mLabel << ": " << Indent::print << "Entering " << b << llendl; \
|
|
||||||
else \
|
|
||||||
__slviewer_debug_indentation = 0; \
|
|
||||||
} \
|
|
||||||
debug::Indent __slviewer_debug_indent(__slviewer_debug_indentation);
|
|
||||||
|
|
||||||
#else // !DEBUG_CURLIO
|
|
||||||
|
|
||||||
#define Debug(x)
|
#define Debug(x)
|
||||||
#define Dout(a, b)
|
#define Dout(a, b)
|
||||||
#define DoutEntering(a, b)
|
#define DoutEntering(a, b)
|
||||||
|
|
||||||
#endif // !DEBUG_CURLIO
|
|
||||||
|
|
||||||
#ifndef DOXYGEN // No need to document this. See http://libcwd.sourceforge.net/ for more info.
|
#ifndef DOXYGEN // No need to document this. See http://libcwd.sourceforge.net/ for more info.
|
||||||
|
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
@@ -392,6 +311,40 @@ void InstanceTracker<T>::dump(void)
|
|||||||
|
|
||||||
} // namespace debug
|
} // namespace debug
|
||||||
|
|
||||||
|
template<class T>
|
||||||
|
class AIDebugInstanceCounter
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
static int sInstanceCount;
|
||||||
|
|
||||||
|
protected:
|
||||||
|
static void print_count(char const* name, int count, bool destruction);
|
||||||
|
|
||||||
|
AIDebugInstanceCounter()
|
||||||
|
{
|
||||||
|
print_count(typeid(T).name(), ++sInstanceCount, false);
|
||||||
|
}
|
||||||
|
AIDebugInstanceCounter(AIDebugInstanceCounter const&)
|
||||||
|
{
|
||||||
|
print_count(typeid(T).name(), ++sInstanceCount, false);
|
||||||
|
}
|
||||||
|
~AIDebugInstanceCounter()
|
||||||
|
{
|
||||||
|
print_count(typeid(T).name(), --sInstanceCount, true);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
//static
|
||||||
|
template<class T>
|
||||||
|
int AIDebugInstanceCounter<T>::sInstanceCount;
|
||||||
|
|
||||||
|
//static
|
||||||
|
template<class T>
|
||||||
|
void AIDebugInstanceCounter<T>::print_count(char const* name, int count, bool destruction)
|
||||||
|
{
|
||||||
|
Dout(dc::notice, (destruction ? "Destructed " : "Constructing ") << name << ", now " << count << " instance" << ((count == 1) ? "." : "s."));
|
||||||
|
}
|
||||||
|
|
||||||
//! Debugging macro.
|
//! Debugging macro.
|
||||||
//
|
//
|
||||||
// Print "Entering " << \a data to channel \a cntrl and increment
|
// Print "Entering " << \a data to channel \a cntrl and increment
|
||||||
|
|||||||
188
indra/develop.py
188
indra/develop.py
@@ -41,6 +41,7 @@ import shutil
|
|||||||
import socket
|
import socket
|
||||||
import sys
|
import sys
|
||||||
import commands
|
import commands
|
||||||
|
import shlex
|
||||||
|
|
||||||
class CommandError(Exception):
|
class CommandError(Exception):
|
||||||
pass
|
pass
|
||||||
@@ -111,11 +112,15 @@ class PlatformSetup(object):
|
|||||||
|
|
||||||
def build_dirs(self):
|
def build_dirs(self):
|
||||||
'''Return the top-level directories in which builds occur.
|
'''Return the top-level directories in which builds occur.
|
||||||
|
|
||||||
This can return more than one directory, e.g. if doing a
|
This can return more than one directory, e.g. if doing a
|
||||||
32-bit viewer and server build on Linux.'''
|
32-bit viewer and server build on Linux.'''
|
||||||
|
|
||||||
return ['build-' + self.platform()]
|
if(os.path.basename(os.path.normpath(os.getcwd())) == 'indra'):
|
||||||
|
prefix = '../'
|
||||||
|
else:
|
||||||
|
prefix = ''
|
||||||
|
|
||||||
|
return [prefix+'build-' + self.platform()]
|
||||||
|
|
||||||
def cmake_commandline(self, src_dir, build_dir, opts, simple):
|
def cmake_commandline(self, src_dir, build_dir, opts, simple):
|
||||||
'''Return the command line to run cmake with.'''
|
'''Return the command line to run cmake with.'''
|
||||||
@@ -169,7 +174,7 @@ class PlatformSetup(object):
|
|||||||
raise
|
raise
|
||||||
|
|
||||||
def parse_build_opts(self, arguments):
|
def parse_build_opts(self, arguments):
|
||||||
opts, targets = getopt.getopt(arguments, 'o:', ['option='])
|
opts, targets = getopt.getopt(arguments, 'D:o:', ['option='])
|
||||||
build_opts = []
|
build_opts = []
|
||||||
for o, a in opts:
|
for o, a in opts:
|
||||||
if o in ('-o', '--option'):
|
if o in ('-o', '--option'):
|
||||||
@@ -221,6 +226,7 @@ class UnixSetup(PlatformSetup):
|
|||||||
exe_suffixes = ('',)
|
exe_suffixes = ('',)
|
||||||
|
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
|
PlatformSetup.__init__(self)
|
||||||
super(UnixSetup, self).__init__()
|
super(UnixSetup, self).__init__()
|
||||||
self.generator = 'Unix Makefiles'
|
self.generator = 'Unix Makefiles'
|
||||||
|
|
||||||
@@ -263,6 +269,7 @@ class UnixSetup(PlatformSetup):
|
|||||||
|
|
||||||
class LinuxSetup(UnixSetup):
|
class LinuxSetup(UnixSetup):
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
|
UnixSetup.__init__(self)
|
||||||
super(LinuxSetup, self).__init__()
|
super(LinuxSetup, self).__init__()
|
||||||
try:
|
try:
|
||||||
self.debian_sarge = open('/etc/debian_version').read().strip() == '3.1'
|
self.debian_sarge = open('/etc/debian_version').read().strip() == '3.1'
|
||||||
@@ -273,9 +280,7 @@ class LinuxSetup(UnixSetup):
|
|||||||
return 'linux'
|
return 'linux'
|
||||||
|
|
||||||
def build_dirs(self):
|
def build_dirs(self):
|
||||||
platform_build = '%s-%s' % (self.platform(), self.build_type.lower())
|
return [PlatformSetup.build_dirs(self)[0]+'-'+self.build_type.lower()]
|
||||||
|
|
||||||
return ['viewer-' + platform_build]
|
|
||||||
|
|
||||||
def cmake_commandline(self, src_dir, build_dir, opts, simple):
|
def cmake_commandline(self, src_dir, build_dir, opts, simple):
|
||||||
args = dict(
|
args = dict(
|
||||||
@@ -384,6 +389,7 @@ class LinuxSetup(UnixSetup):
|
|||||||
|
|
||||||
class DarwinSetup(UnixSetup):
|
class DarwinSetup(UnixSetup):
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
|
UnixSetup.__init__(self)
|
||||||
super(DarwinSetup, self).__init__()
|
super(DarwinSetup, self).__init__()
|
||||||
self.generator = 'Xcode'
|
self.generator = 'Xcode'
|
||||||
|
|
||||||
@@ -396,6 +402,12 @@ class DarwinSetup(UnixSetup):
|
|||||||
else:
|
else:
|
||||||
return UnixSetup.arch(self)
|
return UnixSetup.arch(self)
|
||||||
|
|
||||||
|
def build_dirs(self):
|
||||||
|
if(self.generator == 'Xcode'):
|
||||||
|
return PlatformSetup.build_dirs(self)
|
||||||
|
else:
|
||||||
|
return [PlatformSetup.build_dirs(self)[0]+'-'+self.build_type.lower()]
|
||||||
|
|
||||||
def cmake_commandline(self, src_dir, build_dir, opts, simple):
|
def cmake_commandline(self, src_dir, build_dir, opts, simple):
|
||||||
args = dict(
|
args = dict(
|
||||||
dir=src_dir,
|
dir=src_dir,
|
||||||
@@ -405,15 +417,17 @@ class DarwinSetup(UnixSetup):
|
|||||||
word_size=self.word_size,
|
word_size=self.word_size,
|
||||||
unattended=self.unattended,
|
unattended=self.unattended,
|
||||||
project_name=self.project_name,
|
project_name=self.project_name,
|
||||||
universal=self.universal,
|
universal='',
|
||||||
type=self.build_type.upper(),
|
type='',
|
||||||
)
|
)
|
||||||
|
if(self.generator != 'Xcode'):
|
||||||
|
args['type'] = '-DCMAKE_BUILD_TYPE=%s' % self.build_type.upper()
|
||||||
if self.universal == 'ON':
|
if self.universal == 'ON':
|
||||||
args['universal'] = '-DCMAKE_OSX_ARCHITECTURES:STRING=\'i386;ppc\''
|
args['universal'] = '-DCMAKE_OSX_ARCHITECTURES:STRING=\'i386;ppc\''
|
||||||
#if simple:
|
#if simple:
|
||||||
# return 'cmake %(opts)s %(dir)r' % args
|
# return 'cmake %(opts)s %(dir)r' % args
|
||||||
return ('cmake -G %(generator)r '
|
return ('cmake -G %(generator)r '
|
||||||
'-DCMAKE_BUILD_TYPE:STRING=%(type)s '
|
'%(type)s '
|
||||||
'-DSTANDALONE:BOOL=%(standalone)s '
|
'-DSTANDALONE:BOOL=%(standalone)s '
|
||||||
'-DUNATTENDED:BOOL=%(unattended)s '
|
'-DUNATTENDED:BOOL=%(unattended)s '
|
||||||
'-DWORD_SIZE:STRING=%(word_size)s '
|
'-DWORD_SIZE:STRING=%(word_size)s '
|
||||||
@@ -422,6 +436,18 @@ class DarwinSetup(UnixSetup):
|
|||||||
'%(opts)s %(dir)r' % args)
|
'%(opts)s %(dir)r' % args)
|
||||||
|
|
||||||
def run_build(self, opts, targets):
|
def run_build(self, opts, targets):
|
||||||
|
if(self.generator != 'Xcode'):
|
||||||
|
if targets:
|
||||||
|
targets = ' '.join(targets)
|
||||||
|
else:
|
||||||
|
targets = 'all'
|
||||||
|
|
||||||
|
for d in self.build_dirs():
|
||||||
|
cmd = 'make -C %r %s %s' % (d, ' '.join(opts), targets)
|
||||||
|
print 'Running %r' % cmd
|
||||||
|
self.run(cmd)
|
||||||
|
return
|
||||||
|
|
||||||
cwd = getcwd()
|
cwd = getcwd()
|
||||||
if targets:
|
if targets:
|
||||||
targets = ' '.join(['-target ' + repr(t) for t in targets])
|
targets = ' '.join(['-target ' + repr(t) for t in targets])
|
||||||
@@ -444,19 +470,20 @@ class WindowsSetup(PlatformSetup):
|
|||||||
'gen' : r'Visual Studio 10',
|
'gen' : r'Visual Studio 10',
|
||||||
'ver' : r'10.0'
|
'ver' : r'10.0'
|
||||||
},
|
},
|
||||||
'vc110' : {
|
'vc120' : {
|
||||||
'gen' : r'Visual Studio 11',
|
'gen' : r'Visual Studio 12',
|
||||||
'ver' : r'11.0'
|
'ver' : r'12.0'
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
gens['vs2010'] = gens['vc100']
|
gens['vs2010'] = gens['vc100']
|
||||||
gens['vs2012'] = gens['vc110']
|
gens['vs2013'] = gens['vc120']
|
||||||
|
|
||||||
search_path = r'C:\windows'
|
search_path = r'C:\windows'
|
||||||
exe_suffixes = ('.exe', '.bat', '.com')
|
exe_suffixes = ('.exe', '.bat', '.com')
|
||||||
|
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
|
PlatformSetup.__init__(self)
|
||||||
super(WindowsSetup, self).__init__()
|
super(WindowsSetup, self).__init__()
|
||||||
self._generator = None
|
self._generator = None
|
||||||
self.incredibuild = False
|
self.incredibuild = False
|
||||||
@@ -493,11 +520,24 @@ class WindowsSetup(PlatformSetup):
|
|||||||
|
|
||||||
generator = property(_get_generator, _set_generator)
|
generator = property(_get_generator, _set_generator)
|
||||||
|
|
||||||
|
def get_gen_str(self, gen):
|
||||||
|
if gen is None:
|
||||||
|
gen = self._generator
|
||||||
|
return self.gens[gen.lower()]['ver']
|
||||||
|
|
||||||
def os(self):
|
def os(self):
|
||||||
return 'win32'
|
return 'win32'
|
||||||
|
|
||||||
def build_dirs(self):
|
def build_dirs(self):
|
||||||
return ['build-' + self.generator]
|
if(os.path.basename(os.path.normpath(os.getcwd())) == 'indra'):
|
||||||
|
prefix = '../'
|
||||||
|
else:
|
||||||
|
prefix = ''
|
||||||
|
|
||||||
|
if self.word_size == 64:
|
||||||
|
return [prefix+'build-' + self.generator + '-Win64']
|
||||||
|
else:
|
||||||
|
return [prefix+'build-' + self.generator]
|
||||||
|
|
||||||
def cmake_commandline(self, src_dir, build_dir, opts, simple):
|
def cmake_commandline(self, src_dir, build_dir, opts, simple):
|
||||||
args = dict(
|
args = dict(
|
||||||
@@ -518,7 +558,7 @@ class WindowsSetup(PlatformSetup):
|
|||||||
'-DSTANDALONE:BOOL=%(standalone)s '
|
'-DSTANDALONE:BOOL=%(standalone)s '
|
||||||
'-DUNATTENDED:BOOL=%(unattended)s '
|
'-DUNATTENDED:BOOL=%(unattended)s '
|
||||||
'-DWORD_SIZE:STRING=%(word_size)s '
|
'-DWORD_SIZE:STRING=%(word_size)s '
|
||||||
'-DROOT_PROJECT_NAME:STRING=%(project_name)s '
|
'-DROOT_PROJECT_NAME:STRING=\"%(project_name)s\" '
|
||||||
'%(opts)s "%(dir)s"' % args)
|
'%(opts)s "%(dir)s"' % args)
|
||||||
|
|
||||||
def get_HKLM_registry_value(self, key_str, value_str):
|
def get_HKLM_registry_value(self, key_str, value_str):
|
||||||
@@ -530,19 +570,17 @@ class WindowsSetup(PlatformSetup):
|
|||||||
return value
|
return value
|
||||||
|
|
||||||
def find_visual_studio(self, gen=None):
|
def find_visual_studio(self, gen=None):
|
||||||
if gen is None:
|
gen = self.get_gen_str(gen)
|
||||||
gen = self._generator
|
|
||||||
gen = gen.lower()
|
|
||||||
value_str = (r'EnvironmentDirectory')
|
value_str = (r'EnvironmentDirectory')
|
||||||
key_str = (r'SOFTWARE\Microsoft\VisualStudio\%s\Setup\VS' %
|
key_str = (r'SOFTWARE\Microsoft\VisualStudio\%s\Setup\VS' %
|
||||||
self.gens[gen]['ver'])
|
gen)
|
||||||
print ('Reading VS environment from HKEY_LOCAL_MACHINE\%s\%s' %
|
print ('Reading VS environment from HKEY_LOCAL_MACHINE\%s\%s' %
|
||||||
(key_str, value_str))
|
(key_str, value_str))
|
||||||
try:
|
try:
|
||||||
return self.get_HKLM_registry_value(key_str, value_str)
|
return self.get_HKLM_registry_value(key_str, value_str)
|
||||||
except WindowsError, err:
|
except WindowsError, err:
|
||||||
key_str = (r'SOFTWARE\Wow6432Node\Microsoft\VisualStudio\%s\Setup\VS' %
|
key_str = (r'SOFTWARE\Wow6432Node\Microsoft\VisualStudio\%s\Setup\VS' %
|
||||||
self.gens[gen]['ver'])
|
gen)
|
||||||
|
|
||||||
try:
|
try:
|
||||||
return self.get_HKLM_registry_value(key_str, value_str)
|
return self.get_HKLM_registry_value(key_str, value_str)
|
||||||
@@ -550,14 +588,35 @@ class WindowsSetup(PlatformSetup):
|
|||||||
print >> sys.stderr, "Didn't find ", self.gens[gen]['gen']
|
print >> sys.stderr, "Didn't find ", self.gens[gen]['gen']
|
||||||
return ''
|
return ''
|
||||||
|
|
||||||
|
def find_msbuild(self, gen=None):
|
||||||
|
gen = self.get_gen_str(gen)
|
||||||
|
|
||||||
|
key_str = (r'SOFTWARE\Microsoft\MSBuild\ToolsVersions\12.0')
|
||||||
|
|
||||||
|
print ('Checking MSBuild support for vs ver = %s' % gen)
|
||||||
|
if not self.get_HKLM_registry_value(key_str+'\\'+gen, "VCTargetsPath"):
|
||||||
|
return (None, None)
|
||||||
|
print ('Reading MSBuild location from HKEY_LOCAL_MACHINE\%s\MSBuildToolsPath' %
|
||||||
|
key_str)
|
||||||
|
print key_str
|
||||||
|
try:
|
||||||
|
return (self.get_HKLM_registry_value(key_str, 'MSBuildToolsPath'), gen)
|
||||||
|
except WindowsError, err:
|
||||||
|
key_str = (r'SOFTWARE\Wow6432Node\Microsoft\MSBuild\ToolsVersions\%s' %
|
||||||
|
gen)
|
||||||
|
|
||||||
|
try:
|
||||||
|
return (self.get_HKLM_registry_value(key_str, 'MSBuildToolsPath'), gen)
|
||||||
|
except WindowsError, err:
|
||||||
|
print 'Didn\'t find msbuild'
|
||||||
|
return (None, None)
|
||||||
|
|
||||||
def find_visual_studio_express(self, gen=None):
|
def find_visual_studio_express(self, gen=None):
|
||||||
if gen is None:
|
gen = self.get_gen_str(gen)
|
||||||
gen = self._generator
|
|
||||||
gen = gen.lower()
|
|
||||||
try:
|
try:
|
||||||
import _winreg
|
import _winreg
|
||||||
key_str = (r'SOFTWARE\Microsoft\VCEXpress\%s\Setup\VC' %
|
key_str = (r'SOFTWARE\Microsoft\VCEXpress\%s\Setup\VC' %
|
||||||
self.gens[gen]['ver'])
|
gen)
|
||||||
value_str = (r'ProductDir')
|
value_str = (r'ProductDir')
|
||||||
print ('Reading VS environment from HKEY_LOCAL_MACHINE\%s\%s' %
|
print ('Reading VS environment from HKEY_LOCAL_MACHINE\%s\%s' %
|
||||||
(key_str, value_str))
|
(key_str, value_str))
|
||||||
@@ -569,17 +628,15 @@ class WindowsSetup(PlatformSetup):
|
|||||||
print 'Found: %s' % value
|
print 'Found: %s' % value
|
||||||
return value
|
return value
|
||||||
except WindowsError, err:
|
except WindowsError, err:
|
||||||
print >> sys.stderr, "Didn't find ", self.gens[gen]['gen']
|
print >> sys.stderr, "Didn't find ", gen
|
||||||
return ''
|
return ''
|
||||||
|
|
||||||
def find_visual_studio_express_single(self, gen=None):
|
def find_visual_studio_express_single(self, gen=None):
|
||||||
if gen is None:
|
gen = self.get_gen_str(gen)
|
||||||
gen = self._generator
|
|
||||||
gen = gen.lower()
|
|
||||||
try:
|
try:
|
||||||
import _winreg
|
import _winreg
|
||||||
key_str = (r'SOFTWARE\Microsoft\VCEXpress\%s_Config\Setup\VC' %
|
key_str = (r'SOFTWARE\Microsoft\VCEXpress\%s_Config\Setup\VC' %
|
||||||
self.gens[gen]['ver'])
|
gen)
|
||||||
value_str = (r'ProductDir')
|
value_str = (r'ProductDir')
|
||||||
print ('Reading VS environment from HKEY_CURRENT_USER\%s\%s' %
|
print ('Reading VS environment from HKEY_CURRENT_USER\%s\%s' %
|
||||||
(key_str, value_str))
|
(key_str, value_str))
|
||||||
@@ -591,7 +648,7 @@ class WindowsSetup(PlatformSetup):
|
|||||||
print 'Found: %s' % value
|
print 'Found: %s' % value
|
||||||
return value
|
return value
|
||||||
except WindowsError, err:
|
except WindowsError, err:
|
||||||
print >> sys.stderr, "Didn't find ", self.gens[gen]['gen']
|
print >> sys.stderr, "Didn't find ", gen
|
||||||
return ''
|
return ''
|
||||||
|
|
||||||
def get_build_cmd(self):
|
def get_build_cmd(self):
|
||||||
@@ -600,31 +657,38 @@ class WindowsSetup(PlatformSetup):
|
|||||||
if self.gens[self.generator]['ver'] in [ r'8.0', r'9.0' ]:
|
if self.gens[self.generator]['ver'] in [ r'8.0', r'9.0' ]:
|
||||||
config = '\"%s|Win32\"' % config
|
config = '\"%s|Win32\"' % config
|
||||||
|
|
||||||
return "buildconsole %s.sln /build %s" % (self.project_name, config)
|
return "buildconsole \"%s.sln\" /build %s" % (self.project_name, config), None
|
||||||
environment = self.find_visual_studio()
|
environment = self.find_visual_studio()
|
||||||
if environment == '':
|
if environment == '':
|
||||||
environment = self.find_visual_studio_express()
|
environment = self.find_visual_studio_express()
|
||||||
if environment == '':
|
if environment == '':
|
||||||
environment = self.find_visual_studio_express_single()
|
environment = self.find_visual_studio_express_single()
|
||||||
if environment == '':
|
if environment == '':
|
||||||
print >> sys.stderr, "Something went very wrong during build stage, could not find a Visual Studio?"
|
print >> sys.stderr, "Something went very wrong during build stage, could not find a Visual Studio?"
|
||||||
else:
|
else:
|
||||||
build_dirs=self.build_dirs()
|
build_dirs=self.build_dirs()
|
||||||
print >> sys.stderr, "\nSolution generation complete, it can can now be found in:", build_dirs[0]
|
print >> sys.stderr, "\nSolution generation complete, it can can now be found in:", build_dirs[0]
|
||||||
print >> sys.stderr, "\nAs you are using an Express Visual Studio, the build step cannot be automated"
|
print >> sys.stderr, "\nAs you are using an Express Visual Studio, the build step cannot be automated"
|
||||||
print >> sys.stderr, "\nPlease see https://wiki.secondlife.com/wiki/Microsoft_Visual_Studio#Extra_steps_for_Visual_Studio_Express_editions for Visual Studio Express specific information"
|
print >> sys.stderr, "\nPlease see https://wiki.secondlife.com/wiki/Microsoft_Visual_Studio#Extra_steps_for_Visual_Studio_Express_editions for Visual Studio Express specific information"
|
||||||
exit(0)
|
exit(0)
|
||||||
|
|
||||||
|
msbuild_dir, tool_ver = self.find_msbuild()
|
||||||
|
|
||||||
|
if msbuild_dir is not None and tool_ver is not None:
|
||||||
|
return ('\"%smsbuild.exe\" \"%s.sln\" /p:configuration=%s /p:VisualStudioVersion=%s' %
|
||||||
|
(msbuild_dir, self.project_name, self.build_type, tool_ver)), True
|
||||||
|
|
||||||
# devenv.com is CLI friendly, devenv.exe... not so much.
|
# devenv.com is CLI friendly, devenv.exe... not so much.
|
||||||
return ('"%sdevenv.com" %s.sln /build %s' %
|
return ('"%sdevenv.com" \"%s.sln\" /build %s' %
|
||||||
(self.find_visual_studio(), self.project_name, self.build_type))
|
(self.find_visual_studio(), self.project_name, self.build_type)), None
|
||||||
|
|
||||||
def run(self, command, name=None):
|
def run(self, command, name=None):
|
||||||
'''Run a program. If the program fails, raise an exception.'''
|
'''Run a program. If the program fails, raise an exception.'''
|
||||||
ret = os.system(command)
|
ret = os.system('\"'+command+'\"')
|
||||||
if ret:
|
if ret:
|
||||||
if name is None:
|
if name is None:
|
||||||
name = command.split(None, 1)[0]
|
name = os.path.normpath(shlex.split(command.encode('utf8'),posix=False)[0].strip('"'))
|
||||||
|
|
||||||
path = self.find_in_path(name)
|
path = self.find_in_path(name)
|
||||||
if not path:
|
if not path:
|
||||||
ret = 'was not found'
|
ret = 'was not found'
|
||||||
@@ -650,30 +714,40 @@ class WindowsSetup(PlatformSetup):
|
|||||||
if prev_build == self.build_type:
|
if prev_build == self.build_type:
|
||||||
# Only run vstool if the build type has changed.
|
# Only run vstool if the build type has changed.
|
||||||
continue
|
continue
|
||||||
vstool_cmd = (os.path.join('tools','vstool','VSTool.exe') +
|
|
||||||
' --solution ' +
|
if(os.path.basename(os.path.normpath(os.getcwd())) == 'indra'):
|
||||||
os.path.join(build_dir,'Singularity.sln') +
|
tool_path = os.path.join('tools','vstool','VSTool.exe')
|
||||||
' --config ' + self.build_type +
|
else:
|
||||||
|
tool_path = os.path.join('indra','tools','vstool','VSTool.exe')
|
||||||
|
vstool_cmd = (tool_path +
|
||||||
|
' --solution \"' +
|
||||||
|
os.path.join(build_dir,'%s.sln' % self.project_name) +
|
||||||
|
'\" --config ' + self.build_type +
|
||||||
' --startup secondlife-bin')
|
' --startup secondlife-bin')
|
||||||
print 'Running %r in %r' % (vstool_cmd, getcwd())
|
print 'Running vstool %r in %r' % (vstool_cmd, getcwd())
|
||||||
self.run(vstool_cmd)
|
self.run(vstool_cmd)
|
||||||
print >> open(stamp, 'w'), self.build_type
|
print >> open(stamp, 'w'), self.build_type
|
||||||
|
|
||||||
def run_build(self, opts, targets):
|
def run_build(self, opts, targets):
|
||||||
cwd = getcwd()
|
cwd = getcwd()
|
||||||
build_cmd = self.get_build_cmd()
|
build_cmd, msbuild = self.get_build_cmd()
|
||||||
|
|
||||||
for d in self.build_dirs():
|
for d in self.build_dirs():
|
||||||
try:
|
try:
|
||||||
os.chdir(d)
|
os.chdir(d)
|
||||||
if targets:
|
if targets:
|
||||||
for t in targets:
|
if msbuild:
|
||||||
cmd = '%s /project %s %s' % (build_cmd, t, ' '.join(opts))
|
cmd = '%s /target:%s %s' % (build_cmd, ';'.join(targets), ' '.join(opts))
|
||||||
print 'Running %r in %r' % (cmd, d)
|
print 'Running build(targets) %r in %r' % (cmd, d)
|
||||||
self.run(cmd)
|
self.run(cmd)
|
||||||
|
else:
|
||||||
|
for t in targets:
|
||||||
|
cmd = '%s /project %s %s' % (build_cmd, t, ' '.join(opts))
|
||||||
|
print 'Running build(targets) %r in %r' % (cmd, d)
|
||||||
|
self.run(cmd)
|
||||||
else:
|
else:
|
||||||
cmd = '%s %s' % (build_cmd, ' '.join(opts))
|
cmd = '%s %s' % (build_cmd, ' '.join(opts))
|
||||||
print 'Running %r in %r' % (cmd, d)
|
print 'Running build %r in %r' % (cmd, d)
|
||||||
self.run(cmd)
|
self.run(cmd)
|
||||||
finally:
|
finally:
|
||||||
os.chdir(cwd)
|
os.chdir(cwd)
|
||||||
@@ -694,6 +768,8 @@ class CygwinSetup(WindowsSetup):
|
|||||||
project_name=self.project_name,
|
project_name=self.project_name,
|
||||||
word_size=self.word_size,
|
word_size=self.word_size,
|
||||||
)
|
)
|
||||||
|
if self.word_size == 64:
|
||||||
|
args["generator"] += r' Win64'
|
||||||
#if simple:
|
#if simple:
|
||||||
# return 'cmake %(opts)s "%(dir)s"' % args
|
# return 'cmake %(opts)s "%(dir)s"' % args
|
||||||
return ('cmake -G "%(generator)s" '
|
return ('cmake -G "%(generator)s" '
|
||||||
@@ -739,10 +815,12 @@ Commands:
|
|||||||
Command-options for "configure":
|
Command-options for "configure":
|
||||||
We use cmake variables to change the build configuration.
|
We use cmake variables to change the build configuration.
|
||||||
-DPACKAGE:BOOL=ON Create "package" target to make installers
|
-DPACKAGE:BOOL=ON Create "package" target to make installers
|
||||||
-DLOCALIZESETUP:BOOL=ON Create one win_setup target per supported language
|
|
||||||
-DLL_TESTS:BOOL=OFF Don't generate unit test projects
|
-DLL_TESTS:BOOL=OFF Don't generate unit test projects
|
||||||
-DEXAMPLEPLUGIN:BOOL=OFF Don't generate example plugin project
|
-DEXAMPLEPLUGIN:BOOL=OFF Don't generate example plugin project
|
||||||
-DDISABLE_TCMALLOC:BOOL=ON Disable linkage of TCMalloc. (64bit builds automatically disable TCMalloc)
|
-DDISABLE_TCMALLOC:BOOL=ON Disable linkage of TCMalloc. (64bit builds automatically disable TCMalloc)
|
||||||
|
-DRELEASE_CRASH_REPORTING:BOOL=ON Enable Google Breakpad crash reporting
|
||||||
|
-DFMODSTUDIO:BOOL=ON Use FMOD Studio audio libraries
|
||||||
|
-DFMODEX:BOOL=ON Use FMOD Ex audio libraries
|
||||||
|
|
||||||
Examples:
|
Examples:
|
||||||
Set up a Visual Studio 2010 project with "package" target:
|
Set up a Visual Studio 2010 project with "package" target:
|
||||||
|
|||||||
@@ -2,19 +2,24 @@
|
|||||||
@file __init__.py
|
@file __init__.py
|
||||||
@brief Initialization file for the indra module.
|
@brief Initialization file for the indra module.
|
||||||
|
|
||||||
$LicenseInfo:firstyear=2006&license=internal$
|
$LicenseInfo:firstyear=2006&license=viewerlgpl$
|
||||||
|
Second Life Viewer Source Code
|
||||||
|
Copyright (C) 2006-2010, Linden Research, Inc.
|
||||||
|
|
||||||
Copyright (c) 2006-2009, Linden Research, Inc.
|
This library is free software; you can redistribute it and/or
|
||||||
|
modify it under the terms of the GNU Lesser General Public
|
||||||
|
License as published by the Free Software Foundation;
|
||||||
|
version 2.1 of the License only.
|
||||||
|
|
||||||
The following source code is PROPRIETARY AND CONFIDENTIAL. Use of
|
This library is distributed in the hope that it will be useful,
|
||||||
this source code is governed by the Linden Lab Source Code Disclosure
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
Agreement ("Agreement") previously entered between you and Linden
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||||
Lab. By accessing, using, copying, modifying or distributing this
|
Lesser General Public License for more details.
|
||||||
software, you acknowledge that you have been informed of your
|
|
||||||
obligations under the Agreement and agree to abide by those obligations.
|
|
||||||
|
|
||||||
ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO
|
You should have received a copy of the GNU Lesser General Public
|
||||||
WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY,
|
License along with this library; if not, write to the Free Software
|
||||||
COMPLETENESS OR PERFORMANCE.
|
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
||||||
|
|
||||||
|
Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA
|
||||||
$/LicenseInfo$
|
$/LicenseInfo$
|
||||||
"""
|
"""
|
||||||
|
|||||||
@@ -1,3 +1,25 @@
|
|||||||
|
#!/usr/bin/python
|
||||||
|
##
|
||||||
|
## $LicenseInfo:firstyear=2011&license=viewerlgpl$
|
||||||
|
## Second Life Viewer Source Code
|
||||||
|
## Copyright (C) 2011, Linden Research, Inc.
|
||||||
|
##
|
||||||
|
## This library is free software; you can redistribute it and/or
|
||||||
|
## modify it under the terms of the GNU Lesser General Public
|
||||||
|
## License as published by the Free Software Foundation;
|
||||||
|
## version 2.1 of the License only.
|
||||||
|
##
|
||||||
|
## This library is distributed in the hope that it will be useful,
|
||||||
|
## but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||||
|
## Lesser General Public License for more details.
|
||||||
|
##
|
||||||
|
## You should have received a copy of the GNU Lesser General Public
|
||||||
|
## License along with this library; if not, write to the Free Software
|
||||||
|
## Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
||||||
|
##
|
||||||
|
## Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA
|
||||||
|
## $/LicenseInfo$
|
||||||
from indra.base import llsd, lluuid
|
from indra.base import llsd, lluuid
|
||||||
from datetime import datetime
|
from datetime import datetime
|
||||||
import cllsd
|
import cllsd
|
||||||
@@ -10,7 +32,7 @@ values = (
|
|||||||
'&<>',
|
'&<>',
|
||||||
u'\u81acj',
|
u'\u81acj',
|
||||||
llsd.uri('http://foo<'),
|
llsd.uri('http://foo<'),
|
||||||
lluuid.LLUUID(),
|
lluuid.UUID(),
|
||||||
llsd.LLSD(['thing']),
|
llsd.LLSD(['thing']),
|
||||||
1,
|
1,
|
||||||
myint(31337),
|
myint(31337),
|
||||||
|
|||||||
@@ -1,72 +0,0 @@
|
|||||||
"""\
|
|
||||||
@file lllog.py
|
|
||||||
@brief Logging for event processing
|
|
||||||
|
|
||||||
$LicenseInfo:firstyear=2008&license=mit$
|
|
||||||
|
|
||||||
Copyright (c) 2008-2009, Linden Research, Inc.
|
|
||||||
|
|
||||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
||||||
of this software and associated documentation files (the "Software"), to deal
|
|
||||||
in the Software without restriction, including without limitation the rights
|
|
||||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
||||||
copies of the Software, and to permit persons to whom the Software is
|
|
||||||
furnished to do so, subject to the following conditions:
|
|
||||||
|
|
||||||
The above copyright notice and this permission notice shall be included in
|
|
||||||
all copies or substantial portions of the Software.
|
|
||||||
|
|
||||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
||||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
||||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
||||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
||||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
||||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
|
||||||
THE SOFTWARE.
|
|
||||||
$/LicenseInfo$
|
|
||||||
"""
|
|
||||||
|
|
||||||
from indra.base.llsd import format_notation
|
|
||||||
|
|
||||||
try:
|
|
||||||
import syslog
|
|
||||||
except ImportError:
|
|
||||||
# Windows
|
|
||||||
import sys
|
|
||||||
|
|
||||||
class syslog(object):
|
|
||||||
_logfp = sys.stderr
|
|
||||||
|
|
||||||
def syslog(msg):
|
|
||||||
_logfp.write(msg)
|
|
||||||
if not msg.endswith('\n'):
|
|
||||||
_logfp.write('\n')
|
|
||||||
|
|
||||||
syslog = staticmethod(syslog)
|
|
||||||
|
|
||||||
class Logger(object):
|
|
||||||
def __init__(self, name='indra'):
|
|
||||||
self._sequence = 0
|
|
||||||
try:
|
|
||||||
syslog.openlog(name, syslog.LOG_CONS | syslog.LOG_PID,
|
|
||||||
syslog.LOG_LOCAL0)
|
|
||||||
except AttributeError:
|
|
||||||
# No syslog module on Windows
|
|
||||||
pass
|
|
||||||
|
|
||||||
def next(self):
|
|
||||||
self._sequence += 1
|
|
||||||
return self._sequence
|
|
||||||
|
|
||||||
def log(self, msg, llsd):
|
|
||||||
payload = 'INFO: log: LLLOGMESSAGE (%d) %s %s' % (self.next(), msg,
|
|
||||||
format_notation(llsd))
|
|
||||||
syslog.syslog(payload)
|
|
||||||
|
|
||||||
_logger = None
|
|
||||||
|
|
||||||
def log(msg, llsd):
|
|
||||||
global _logger
|
|
||||||
if _logger is None:
|
|
||||||
_logger = Logger()
|
|
||||||
_logger.log(msg, llsd)
|
|
||||||
@@ -72,8 +72,11 @@ BOOL_FALSE = ('0', '0.0', 'false', '')
|
|||||||
|
|
||||||
|
|
||||||
def format_datestr(v):
|
def format_datestr(v):
|
||||||
""" Formats a datetime object into the string format shared by xml and notation serializations."""
|
""" Formats a datetime or date object into the string format shared by xml and notation serializations."""
|
||||||
return v.isoformat() + 'Z'
|
if hasattr(v, 'microsecond'):
|
||||||
|
return v.isoformat() + 'Z'
|
||||||
|
else:
|
||||||
|
return v.strftime('%Y-%m-%dT%H:%M:%SZ')
|
||||||
|
|
||||||
def parse_datestr(datestr):
|
def parse_datestr(datestr):
|
||||||
"""Parses a datetime object from the string format shared by xml and notation serializations."""
|
"""Parses a datetime object from the string format shared by xml and notation serializations."""
|
||||||
@@ -183,6 +186,7 @@ class LLSDXMLFormatter(object):
|
|||||||
unicode : self.STRING,
|
unicode : self.STRING,
|
||||||
uri : self.URI,
|
uri : self.URI,
|
||||||
datetime.datetime : self.DATE,
|
datetime.datetime : self.DATE,
|
||||||
|
datetime.date : self.DATE,
|
||||||
list : self.ARRAY,
|
list : self.ARRAY,
|
||||||
tuple : self.ARRAY,
|
tuple : self.ARRAY,
|
||||||
types.GeneratorType : self.ARRAY,
|
types.GeneratorType : self.ARRAY,
|
||||||
@@ -234,7 +238,7 @@ class LLSDXMLFormatter(object):
|
|||||||
def MAP(self, v):
|
def MAP(self, v):
|
||||||
return self.elt(
|
return self.elt(
|
||||||
'map',
|
'map',
|
||||||
''.join(["%s%s" % (self.elt('key', key), self.generate(value))
|
''.join(["%s%s" % (self.elt('key', self.xml_esc(str(key))), self.generate(value))
|
||||||
for key, value in v.items()]))
|
for key, value in v.items()]))
|
||||||
|
|
||||||
typeof = type
|
typeof = type
|
||||||
@@ -347,6 +351,7 @@ class LLSDNotationFormatter(object):
|
|||||||
unicode : self.STRING,
|
unicode : self.STRING,
|
||||||
uri : self.URI,
|
uri : self.URI,
|
||||||
datetime.datetime : self.DATE,
|
datetime.datetime : self.DATE,
|
||||||
|
datetime.date : self.DATE,
|
||||||
list : self.ARRAY,
|
list : self.ARRAY,
|
||||||
tuple : self.ARRAY,
|
tuple : self.ARRAY,
|
||||||
types.GeneratorType : self.ARRAY,
|
types.GeneratorType : self.ARRAY,
|
||||||
@@ -924,11 +929,12 @@ def _format_binary_recurse(something):
|
|||||||
(type(something), something))
|
(type(something), something))
|
||||||
|
|
||||||
|
|
||||||
def parse_binary(something):
|
def parse_binary(binary):
|
||||||
header = '<?llsd/binary?>\n'
|
if binary.startswith('<?llsd/binary?>'):
|
||||||
if not something.startswith(header):
|
just_binary = binary.split('\n', 1)[1]
|
||||||
raise LLSDParseError('LLSD binary encoding header not found')
|
else:
|
||||||
return LLSDBinaryParser().parse(something[len(header):])
|
just_binary = binary
|
||||||
|
return LLSDBinaryParser().parse(just_binary)
|
||||||
|
|
||||||
def parse_xml(something):
|
def parse_xml(something):
|
||||||
try:
|
try:
|
||||||
|
|||||||
@@ -28,13 +28,12 @@ $/LicenseInfo$
|
|||||||
|
|
||||||
import random, socket, string, time, re
|
import random, socket, string, time, re
|
||||||
import uuid
|
import uuid
|
||||||
|
|
||||||
# *HACK: Necessary for python 2.4. Consider replacing this code wart
|
|
||||||
# after python >=2.5 has deployed everywhere. 2009-10-05
|
|
||||||
try:
|
try:
|
||||||
|
# Python 2.6
|
||||||
from hashlib import md5
|
from hashlib import md5
|
||||||
except ImportError:
|
except ImportError:
|
||||||
from md5 import md5
|
# Python 2.5 and earlier
|
||||||
|
from md5 import new as md5
|
||||||
|
|
||||||
def _int2binstr(i,l):
|
def _int2binstr(i,l):
|
||||||
s=''
|
s=''
|
||||||
@@ -73,7 +72,7 @@ class UUID(object):
|
|||||||
ip = ''
|
ip = ''
|
||||||
try:
|
try:
|
||||||
ip = socket.gethostbyname(socket.gethostname())
|
ip = socket.gethostbyname(socket.gethostname())
|
||||||
except(socket.gaierror):
|
except(socket.gaierror, socket.error):
|
||||||
# no ip address, so just default to somewhere in 10.x.x.x
|
# no ip address, so just default to somewhere in 10.x.x.x
|
||||||
ip = '10'
|
ip = '10'
|
||||||
for i in range(3):
|
for i in range(3):
|
||||||
@@ -164,7 +163,7 @@ class UUID(object):
|
|||||||
def setFromMemoryDump(self, gdb_string):
|
def setFromMemoryDump(self, gdb_string):
|
||||||
"""
|
"""
|
||||||
We expect to get gdb_string as four hex units. eg:
|
We expect to get gdb_string as four hex units. eg:
|
||||||
0x147d54db 0xc34b3f1b 0x714f989b 0x0a892fd2
|
0x147d54db 0xc34b3f1b 0x714f989b 0x0a892fd2
|
||||||
Which will be translated to:
|
Which will be translated to:
|
||||||
db547d14-1b3f4bc3-9b984f71-d22f890a
|
db547d14-1b3f4bc3-9b984f71-d22f890a
|
||||||
Returns self.
|
Returns self.
|
||||||
@@ -188,7 +187,7 @@ class UUID(object):
|
|||||||
def getAsString(self):
|
def getAsString(self):
|
||||||
"""
|
"""
|
||||||
Return a different string representation of the form
|
Return a different string representation of the form
|
||||||
AAAAAAAA-AAAABBBB-BBBBBBBB-BBCCCCCC (a 128-bit number in hex)
|
AAAAAAAA-AAAABBBB-BBBBBBBB-BBCCCCCC (a 128-bit number in hex)
|
||||||
where A=network address, B=timestamp, C=random.
|
where A=network address, B=timestamp, C=random.
|
||||||
"""
|
"""
|
||||||
i1 = _binstr2int(self._bits[0:4])
|
i1 = _binstr2int(self._bits[0:4])
|
||||||
@@ -234,7 +233,7 @@ NULL = UUID()
|
|||||||
def printTranslatedMemory(four_hex_uints):
|
def printTranslatedMemory(four_hex_uints):
|
||||||
"""
|
"""
|
||||||
We expect to get the string as four hex units. eg:
|
We expect to get the string as four hex units. eg:
|
||||||
0x147d54db 0xc34b3f1b 0x714f989b 0x0a892fd2
|
0x147d54db 0xc34b3f1b 0x714f989b 0x0a892fd2
|
||||||
Which will be translated to:
|
Which will be translated to:
|
||||||
db547d14-1b3f4bc3-9b984f71-d22f890a
|
db547d14-1b3f4bc3-9b984f71-d22f890a
|
||||||
"""
|
"""
|
||||||
|
|||||||
@@ -29,25 +29,93 @@ $/LicenseInfo$
|
|||||||
"""
|
"""
|
||||||
|
|
||||||
import sys
|
import sys
|
||||||
from indra.base import llsd
|
try:
|
||||||
|
import syslog
|
||||||
|
except ImportError:
|
||||||
|
# Windows
|
||||||
|
import sys
|
||||||
|
class syslog(object):
|
||||||
|
# wrap to a lame syslog for windows
|
||||||
|
_logfp = sys.stderr
|
||||||
|
def syslog(msg):
|
||||||
|
_logfp.write(msg)
|
||||||
|
if not msg.endswith('\n'):
|
||||||
|
_logfp.write('\n')
|
||||||
|
syslog = staticmethod(syslog)
|
||||||
|
|
||||||
_sequence_id = 0
|
from indra.base.llsd import format_notation
|
||||||
|
|
||||||
def record_metrics(table, stats, dest=None):
|
def record_metrics(table, stats):
|
||||||
"Write a standard metrics log"
|
"Write a standard metrics log"
|
||||||
_log("LLMETRICS", table, stats, dest)
|
_log("LLMETRICS", table, stats)
|
||||||
|
|
||||||
def record_event(table, data, dest=None):
|
def record_event(table, data):
|
||||||
"Write a standard logmessage log"
|
"Write a standard logmessage log"
|
||||||
_log("LLLOGMESSAGE", table, data, dest)
|
_log("LLLOGMESSAGE", table, data)
|
||||||
|
|
||||||
def _log(header, table, data, dest):
|
def set_destination(dest):
|
||||||
|
"""Set the destination of metrics logs for this process.
|
||||||
|
|
||||||
|
If you do not call this function prior to calling a logging
|
||||||
|
method, that function will open sys.stdout as a destination.
|
||||||
|
Attempts to set dest to None will throw a RuntimeError.
|
||||||
|
@param dest a file-like object which will be the destination for logs."""
|
||||||
if dest is None:
|
if dest is None:
|
||||||
# do this check here in case sys.stdout changes at some
|
raise RuntimeError("Attempt to unset metrics destination.")
|
||||||
# point. as a default parameter, it will never be
|
global _destination
|
||||||
# re-evaluated.
|
_destination = dest
|
||||||
dest = sys.stdout
|
|
||||||
|
def destination():
|
||||||
|
"""Get the destination of the metrics logs for this process.
|
||||||
|
Returns None if no destination is set"""
|
||||||
|
global _destination
|
||||||
|
return _destination
|
||||||
|
|
||||||
|
class SysLogger(object):
|
||||||
|
"A file-like object which writes to syslog."
|
||||||
|
def __init__(self, ident='indra', logopt = None, facility = None):
|
||||||
|
try:
|
||||||
|
if logopt is None:
|
||||||
|
logopt = syslog.LOG_CONS | syslog.LOG_PID
|
||||||
|
if facility is None:
|
||||||
|
facility = syslog.LOG_LOCAL0
|
||||||
|
syslog.openlog(ident, logopt, facility)
|
||||||
|
import atexit
|
||||||
|
atexit.register(syslog.closelog)
|
||||||
|
except AttributeError:
|
||||||
|
# No syslog module on Windows
|
||||||
|
pass
|
||||||
|
|
||||||
|
def write(str):
|
||||||
|
syslog.syslog(str)
|
||||||
|
write = staticmethod(write)
|
||||||
|
|
||||||
|
def flush():
|
||||||
|
pass
|
||||||
|
flush = staticmethod(flush)
|
||||||
|
|
||||||
|
#
|
||||||
|
# internal API
|
||||||
|
#
|
||||||
|
_sequence_id = 0
|
||||||
|
_destination = None
|
||||||
|
|
||||||
|
def _next_id():
|
||||||
global _sequence_id
|
global _sequence_id
|
||||||
print >>dest, header, "(" + str(_sequence_id) + ")",
|
next = _sequence_id
|
||||||
print >>dest, table, llsd.format_notation(data)
|
|
||||||
_sequence_id += 1
|
_sequence_id += 1
|
||||||
|
return next
|
||||||
|
|
||||||
|
def _dest():
|
||||||
|
global _destination
|
||||||
|
if _destination is None:
|
||||||
|
# this default behavior is documented in the metrics functions above.
|
||||||
|
_destination = sys.stdout
|
||||||
|
return _destination
|
||||||
|
|
||||||
|
def _log(header, table, data):
|
||||||
|
log_line = "%s (%d) %s %s" \
|
||||||
|
% (header, _next_id(), table, format_notation(data))
|
||||||
|
dest = _dest()
|
||||||
|
dest.write(log_line)
|
||||||
|
dest.flush()
|
||||||
|
|||||||
@@ -39,6 +39,12 @@ except:
|
|||||||
pass
|
pass
|
||||||
|
|
||||||
_g_builder = None
|
_g_builder = None
|
||||||
|
def _builder():
|
||||||
|
global _g_builder
|
||||||
|
if _g_builder is None:
|
||||||
|
_g_builder = ServiceBuilder()
|
||||||
|
return _g_builder
|
||||||
|
|
||||||
def build(name, context={}, **kwargs):
|
def build(name, context={}, **kwargs):
|
||||||
""" Convenience method for using a global, singleton, service builder. Pass arguments either via a dict or via python keyword arguments, or both!
|
""" Convenience method for using a global, singleton, service builder. Pass arguments either via a dict or via python keyword arguments, or both!
|
||||||
|
|
||||||
@@ -56,6 +62,11 @@ def build(name, context={}, **kwargs):
|
|||||||
_g_builder = ServiceBuilder()
|
_g_builder = ServiceBuilder()
|
||||||
return _g_builder.buildServiceURL(name, context, **kwargs)
|
return _g_builder.buildServiceURL(name, context, **kwargs)
|
||||||
|
|
||||||
|
def build_path(name, context={}, **kwargs):
|
||||||
|
context = context.copy() # shouldn't modify the caller's dictionary
|
||||||
|
context.update(kwargs)
|
||||||
|
return _builder().buildPath(name, context)
|
||||||
|
|
||||||
class ServiceBuilder(object):
|
class ServiceBuilder(object):
|
||||||
def __init__(self, services_definition = services_config):
|
def __init__(self, services_definition = services_config):
|
||||||
"""\
|
"""\
|
||||||
@@ -73,12 +84,21 @@ class ServiceBuilder(object):
|
|||||||
continue
|
continue
|
||||||
if isinstance(service_builder, dict):
|
if isinstance(service_builder, dict):
|
||||||
# We will be constructing several builders
|
# We will be constructing several builders
|
||||||
for name, builder in service_builder.items():
|
for name, builder in service_builder.iteritems():
|
||||||
full_builder_name = service['name'] + '-' + name
|
full_builder_name = service['name'] + '-' + name
|
||||||
self.builders[full_builder_name] = builder
|
self.builders[full_builder_name] = builder
|
||||||
else:
|
else:
|
||||||
self.builders[service['name']] = service_builder
|
self.builders[service['name']] = service_builder
|
||||||
|
|
||||||
|
def buildPath(self, name, context):
|
||||||
|
"""\
|
||||||
|
@brief given the environment on construction, return a service path.
|
||||||
|
@param name The name of the service.
|
||||||
|
@param context A dict of name value lookups for the service.
|
||||||
|
@returns Returns the
|
||||||
|
"""
|
||||||
|
return russ.format(self.builders[name], context)
|
||||||
|
|
||||||
def buildServiceURL(self, name, context={}, **kwargs):
|
def buildServiceURL(self, name, context={}, **kwargs):
|
||||||
"""\
|
"""\
|
||||||
@brief given the environment on construction, return a service URL.
|
@brief given the environment on construction, return a service URL.
|
||||||
@@ -108,7 +128,7 @@ def on_in(query_name, host_key, schema_key):
|
|||||||
@param schema_key Logical name of destination schema. Will
|
@param schema_key Logical name of destination schema. Will
|
||||||
be looked up in indra.xml.
|
be looked up in indra.xml.
|
||||||
"""
|
"""
|
||||||
host_name = config.get(host_key)
|
return "on/config:%s/in/config:%s/%s" % (host_key.strip('/'),
|
||||||
schema_name = config.get(schema_key)
|
schema_key.strip('/'),
|
||||||
return '/'.join( ('on', host_name, 'in', schema_name, query_name.lstrip('/')) )
|
query_name.lstrip('/'))
|
||||||
|
|
||||||
|
|||||||
@@ -1,3 +1,32 @@
|
|||||||
|
"""\
|
||||||
|
@file siesta.py
|
||||||
|
@brief A tiny llsd based RESTful web services framework
|
||||||
|
|
||||||
|
$LicenseInfo:firstyear=2008&license=mit$
|
||||||
|
|
||||||
|
Copyright (c) 2008, Linden Research, Inc.
|
||||||
|
|
||||||
|
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||||
|
of this software and associated documentation files (the "Software"), to deal
|
||||||
|
in the Software without restriction, including without limitation the rights
|
||||||
|
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||||
|
copies of the Software, and to permit persons to whom the Software is
|
||||||
|
furnished to do so, subject to the following conditions:
|
||||||
|
|
||||||
|
The above copyright notice and this permission notice shall be included in
|
||||||
|
all copies or substantial portions of the Software.
|
||||||
|
|
||||||
|
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||||
|
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||||
|
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||||
|
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||||
|
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||||
|
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||||
|
THE SOFTWARE.
|
||||||
|
$/LicenseInfo$
|
||||||
|
"""
|
||||||
|
|
||||||
|
from indra.base import config
|
||||||
from indra.base import llsd
|
from indra.base import llsd
|
||||||
from webob import exc
|
from webob import exc
|
||||||
import webob
|
import webob
|
||||||
@@ -37,11 +66,11 @@ def mime_type(content_type):
|
|||||||
return content_type.split(';', 1)[0].strip().lower()
|
return content_type.split(';', 1)[0].strip().lower()
|
||||||
|
|
||||||
class BodyLLSD(object):
|
class BodyLLSD(object):
|
||||||
'''Give a webob Request or Response an llsd property.
|
'''Give a webob Request or Response an llsd based "content" property.
|
||||||
|
|
||||||
Getting the llsd property parses the body, and caches the result.
|
Getting the content property parses the body, and caches the result.
|
||||||
|
|
||||||
Setting the llsd property formats a payload, and the body property
|
Setting the content property formats a payload, and the body property
|
||||||
is set.'''
|
is set.'''
|
||||||
|
|
||||||
def _llsd__get(self):
|
def _llsd__get(self):
|
||||||
@@ -80,7 +109,7 @@ class BodyLLSD(object):
|
|||||||
if hasattr(self, '_llsd'):
|
if hasattr(self, '_llsd'):
|
||||||
del self._llsd
|
del self._llsd
|
||||||
|
|
||||||
llsd = property(_llsd__get, _llsd__set, _llsd__del)
|
content = property(_llsd__get, _llsd__set, _llsd__del)
|
||||||
|
|
||||||
|
|
||||||
class Response(webob.Response, BodyLLSD):
|
class Response(webob.Response, BodyLLSD):
|
||||||
@@ -114,10 +143,10 @@ class Request(webob.Request, BodyLLSD):
|
|||||||
|
|
||||||
Sensible content type and accept headers are used by default.
|
Sensible content type and accept headers are used by default.
|
||||||
|
|
||||||
Setting the llsd property also sets the body. Getting the llsd
|
Setting the content property also sets the body. Getting the content
|
||||||
property parses the body if necessary.
|
property parses the body if necessary.
|
||||||
|
|
||||||
If you set the body property directly, the llsd property will be
|
If you set the body property directly, the content property will be
|
||||||
deleted.'''
|
deleted.'''
|
||||||
|
|
||||||
default_content_type = 'application/llsd+xml'
|
default_content_type = 'application/llsd+xml'
|
||||||
@@ -149,11 +178,11 @@ class Request(webob.Request, BodyLLSD):
|
|||||||
body = property(webob.Request._body__get, _body__set,
|
body = property(webob.Request._body__get, _body__set,
|
||||||
webob.Request._body__del, webob.Request._body__get.__doc__)
|
webob.Request._body__del, webob.Request._body__get.__doc__)
|
||||||
|
|
||||||
def create_response(self, llsd=None, status='200 OK',
|
def create_response(self, content=None, status='200 OK',
|
||||||
conditional_response=webob.NoDefault):
|
conditional_response=webob.NoDefault):
|
||||||
resp = self.ResponseClass(status=status, request=self,
|
resp = self.ResponseClass(status=status, request=self,
|
||||||
conditional_response=conditional_response)
|
conditional_response=conditional_response)
|
||||||
resp.llsd = llsd
|
resp.content = content
|
||||||
return resp
|
return resp
|
||||||
|
|
||||||
def curl(self):
|
def curl(self):
|
||||||
@@ -196,12 +225,18 @@ llsd_formatters = {
|
|||||||
'application/xml': llsd.format_xml,
|
'application/xml': llsd.format_xml,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
formatter_qualities = (
|
||||||
|
('application/llsd+xml', 1.0),
|
||||||
|
('application/llsd+notation', 0.5),
|
||||||
|
('application/llsd+binary', 0.4),
|
||||||
|
('application/xml', 0.3),
|
||||||
|
('application/json', 0.2),
|
||||||
|
)
|
||||||
|
|
||||||
def formatter_for_mime_type(mime_type):
|
def formatter_for_mime_type(mime_type):
|
||||||
'''Return a formatter that encodes to the given MIME type.
|
'''Return a formatter that encodes to the given MIME type.
|
||||||
|
|
||||||
The result is a pair of function and MIME type.'''
|
The result is a pair of function and MIME type.'''
|
||||||
|
|
||||||
try:
|
try:
|
||||||
return llsd_formatters[mime_type], mime_type
|
return llsd_formatters[mime_type], mime_type
|
||||||
except KeyError:
|
except KeyError:
|
||||||
@@ -214,21 +249,19 @@ def formatter_for_request(req):
|
|||||||
'''Return a formatter that encodes to the preferred type of the client.
|
'''Return a formatter that encodes to the preferred type of the client.
|
||||||
|
|
||||||
The result is a pair of function and actual MIME type.'''
|
The result is a pair of function and actual MIME type.'''
|
||||||
|
ctype = req.accept.best_match(formatter_qualities)
|
||||||
for ctype in req.accept.best_matches('application/llsd+xml'):
|
try:
|
||||||
try:
|
return llsd_formatters[ctype], ctype
|
||||||
return llsd_formatters[ctype], ctype
|
except KeyError:
|
||||||
except KeyError:
|
|
||||||
pass
|
|
||||||
else:
|
|
||||||
raise exc.HTTPNotAcceptable().exception
|
raise exc.HTTPNotAcceptable().exception
|
||||||
|
|
||||||
|
|
||||||
def wsgi_adapter(func, environ, start_response):
|
def wsgi_adapter(func, environ, start_response):
|
||||||
'''Adapt a Siesta callable to act as a WSGI application.'''
|
'''Adapt a Siesta callable to act as a WSGI application.'''
|
||||||
|
# Process the request as appropriate.
|
||||||
try:
|
try:
|
||||||
req = Request(environ)
|
req = Request(environ)
|
||||||
|
#print req.urlvars
|
||||||
resp = func(req, **req.urlvars)
|
resp = func(req, **req.urlvars)
|
||||||
if not isinstance(resp, webob.Response):
|
if not isinstance(resp, webob.Response):
|
||||||
try:
|
try:
|
||||||
@@ -281,7 +314,8 @@ def llsd_class(cls):
|
|||||||
allowed = [m for m in http11_methods
|
allowed = [m for m in http11_methods
|
||||||
if hasattr(instance, 'handle_' + m.lower())]
|
if hasattr(instance, 'handle_' + m.lower())]
|
||||||
raise exc.HTTPMethodNotAllowed(
|
raise exc.HTTPMethodNotAllowed(
|
||||||
headers={'Allowed': ', '.join(allowed)}).exception
|
headers={'Allow': ', '.join(allowed)}).exception
|
||||||
|
#print "kwargs: ", kwargs
|
||||||
return handler(req, **kwargs)
|
return handler(req, **kwargs)
|
||||||
|
|
||||||
def replacement(environ, start_response):
|
def replacement(environ, start_response):
|
||||||
@@ -336,7 +370,7 @@ def curl(reqs):
|
|||||||
|
|
||||||
route_re = re.compile(r'''
|
route_re = re.compile(r'''
|
||||||
\{ # exact character "{"
|
\{ # exact character "{"
|
||||||
(\w+) # variable name (restricted to a-z, 0-9, _)
|
(\w*) # "config" or variable (restricted to a-z, 0-9, _)
|
||||||
(?:([:~])([^}]+))? # optional :type or ~regex part
|
(?:([:~])([^}]+))? # optional :type or ~regex part
|
||||||
\} # exact character "}"
|
\} # exact character "}"
|
||||||
''', re.VERBOSE)
|
''', re.VERBOSE)
|
||||||
@@ -344,27 +378,37 @@ route_re = re.compile(r'''
|
|||||||
predefined_regexps = {
|
predefined_regexps = {
|
||||||
'uuid': r'[a-f0-9][a-f0-9-]{31,35}',
|
'uuid': r'[a-f0-9][a-f0-9-]{31,35}',
|
||||||
'int': r'\d+',
|
'int': r'\d+',
|
||||||
|
'host': r'[a-z0-9][a-z0-9\-\.]*',
|
||||||
}
|
}
|
||||||
|
|
||||||
def compile_route(route):
|
def compile_route(route):
|
||||||
fp = StringIO()
|
fp = StringIO()
|
||||||
last_pos = 0
|
last_pos = 0
|
||||||
for match in route_re.finditer(route):
|
for match in route_re.finditer(route):
|
||||||
|
#print "matches: ", match.groups()
|
||||||
fp.write(re.escape(route[last_pos:match.start()]))
|
fp.write(re.escape(route[last_pos:match.start()]))
|
||||||
var_name = match.group(1)
|
var_name = match.group(1)
|
||||||
sep = match.group(2)
|
sep = match.group(2)
|
||||||
expr = match.group(3)
|
expr = match.group(3)
|
||||||
if expr:
|
if var_name == 'config':
|
||||||
if sep == ':':
|
expr = re.escape(str(config.get(var_name)))
|
||||||
expr = predefined_regexps[expr]
|
|
||||||
# otherwise, treat what follows '~' as a regexp
|
|
||||||
else:
|
else:
|
||||||
expr = '[^/]+'
|
if expr:
|
||||||
expr = '(?P<%s>%s)' % (var_name, expr)
|
if sep == ':':
|
||||||
|
expr = predefined_regexps[expr]
|
||||||
|
# otherwise, treat what follows '~' as a regexp
|
||||||
|
else:
|
||||||
|
expr = '[^/]+'
|
||||||
|
if var_name != '':
|
||||||
|
expr = '(?P<%s>%s)' % (var_name, expr)
|
||||||
|
else:
|
||||||
|
expr = '(%s)' % (expr,)
|
||||||
fp.write(expr)
|
fp.write(expr)
|
||||||
last_pos = match.end()
|
last_pos = match.end()
|
||||||
fp.write(re.escape(route[last_pos:]))
|
fp.write(re.escape(route[last_pos:]))
|
||||||
return '^%s$' % fp.getvalue()
|
compiled_route = '^%s$' % fp.getvalue()
|
||||||
|
#print route, "->", compiled_route
|
||||||
|
return compiled_route
|
||||||
|
|
||||||
class Router(object):
|
class Router(object):
|
||||||
'''WSGI routing class. Parses a URL and hands off a request to
|
'''WSGI routing class. Parses a URL and hands off a request to
|
||||||
@@ -372,21 +416,43 @@ class Router(object):
|
|||||||
responds with a 404.'''
|
responds with a 404.'''
|
||||||
|
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
self.routes = []
|
self._new_routes = []
|
||||||
self.paths = []
|
self._routes = []
|
||||||
|
self._paths = []
|
||||||
|
|
||||||
def add(self, route, app, methods=None):
|
def add(self, route, app, methods=None):
|
||||||
self.paths.append(route)
|
self._new_routes.append((route, app, methods))
|
||||||
self.routes.append((re.compile(compile_route(route)), app,
|
|
||||||
methods and dict.fromkeys(methods)))
|
def _create_routes(self):
|
||||||
|
for route, app, methods in self._new_routes:
|
||||||
|
self._paths.append(route)
|
||||||
|
self._routes.append(
|
||||||
|
(re.compile(compile_route(route)),
|
||||||
|
app,
|
||||||
|
methods and dict.fromkeys(methods)))
|
||||||
|
self._new_routes = []
|
||||||
|
|
||||||
def __call__(self, environ, start_response):
|
def __call__(self, environ, start_response):
|
||||||
|
# load up the config from the config file. Only needs to be
|
||||||
|
# done once per interpreter. This is the entry point of all
|
||||||
|
# siesta applications, so this is where we trap it.
|
||||||
|
_conf = config.get_config()
|
||||||
|
if _conf is None:
|
||||||
|
import os.path
|
||||||
|
fname = os.path.join(
|
||||||
|
environ.get('ll.config_dir', '/local/linden/etc'),
|
||||||
|
'indra.xml')
|
||||||
|
config.load(fname)
|
||||||
|
|
||||||
|
# proceed with handling the request
|
||||||
|
self._create_routes()
|
||||||
path_info = environ['PATH_INFO']
|
path_info = environ['PATH_INFO']
|
||||||
request_method = environ['REQUEST_METHOD']
|
request_method = environ['REQUEST_METHOD']
|
||||||
allowed = []
|
allowed = []
|
||||||
for regex, app, methods in self.routes:
|
for regex, app, methods in self._routes:
|
||||||
m = regex.match(path_info)
|
m = regex.match(path_info)
|
||||||
if m:
|
if m:
|
||||||
|
#print "groupdict:",m.groupdict()
|
||||||
if not methods or request_method in methods:
|
if not methods or request_method in methods:
|
||||||
environ['paste.urlvars'] = m.groupdict()
|
environ['paste.urlvars'] = m.groupdict()
|
||||||
return app(environ, start_response)
|
return app(environ, start_response)
|
||||||
@@ -396,7 +462,7 @@ class Router(object):
|
|||||||
allowed = dict.fromkeys(allows).keys()
|
allowed = dict.fromkeys(allows).keys()
|
||||||
allowed.sort()
|
allowed.sort()
|
||||||
resp = exc.HTTPMethodNotAllowed(
|
resp = exc.HTTPMethodNotAllowed(
|
||||||
headers={'Allowed': ', '.join(allowed)})
|
headers={'Allow': ', '.join(allowed)})
|
||||||
else:
|
else:
|
||||||
resp = exc.HTTPNotFound()
|
resp = exc.HTTPNotFound()
|
||||||
return resp(environ, start_response)
|
return resp(environ, start_response)
|
||||||
|
|||||||
@@ -39,6 +39,7 @@ import shutil
|
|||||||
import sys
|
import sys
|
||||||
import tarfile
|
import tarfile
|
||||||
import errno
|
import errno
|
||||||
|
import subprocess
|
||||||
|
|
||||||
def path_ancestors(path):
|
def path_ancestors(path):
|
||||||
drive, path = os.path.splitdrive(os.path.normpath(path))
|
drive, path = os.path.splitdrive(os.path.normpath(path))
|
||||||
@@ -279,10 +280,11 @@ class LLManifest(object):
|
|||||||
self.file_list = []
|
self.file_list = []
|
||||||
self.excludes = []
|
self.excludes = []
|
||||||
self.actions = []
|
self.actions = []
|
||||||
self.src_prefix = [args['source']]
|
self.src_prefix = list([args['source']])
|
||||||
self.artwork_prefix = [args['artwork']]
|
self.artwork_prefix = list([args['artwork']])
|
||||||
self.build_prefix = [args['build']]
|
self.build_prefix = list([args['build']])
|
||||||
self.dst_prefix = [args['dest']]
|
self.alt_build_prefix = list([args['build']])
|
||||||
|
self.dst_prefix = list([args['dest']])
|
||||||
self.created_paths = []
|
self.created_paths = []
|
||||||
self.package_name = "Unknown"
|
self.package_name = "Unknown"
|
||||||
|
|
||||||
@@ -309,7 +311,7 @@ class LLManifest(object):
|
|||||||
in the file list by path()."""
|
in the file list by path()."""
|
||||||
self.excludes.append(glob)
|
self.excludes.append(glob)
|
||||||
|
|
||||||
def prefix(self, src='', build=None, dst=None):
|
def prefix(self, src='', build=None, dst=None, alt_build=None):
|
||||||
""" Pushes a prefix onto the stack. Until end_prefix is
|
""" Pushes a prefix onto the stack. Until end_prefix is
|
||||||
called, all relevant method calls (esp. to path()) will prefix
|
called, all relevant method calls (esp. to path()) will prefix
|
||||||
paths with the entire prefix stack. Source and destination
|
paths with the entire prefix stack. Source and destination
|
||||||
@@ -320,10 +322,15 @@ class LLManifest(object):
|
|||||||
dst = src
|
dst = src
|
||||||
if build is None:
|
if build is None:
|
||||||
build = src
|
build = src
|
||||||
|
if alt_build is None:
|
||||||
|
alt_build = build
|
||||||
|
|
||||||
self.src_prefix.append(src)
|
self.src_prefix.append(src)
|
||||||
self.artwork_prefix.append(src)
|
self.artwork_prefix.append(src)
|
||||||
self.build_prefix.append(build)
|
self.build_prefix.append(build)
|
||||||
self.dst_prefix.append(dst)
|
self.dst_prefix.append(dst)
|
||||||
|
self.alt_build_prefix.append(alt_build)
|
||||||
|
|
||||||
return True # so that you can wrap it in an if to get indentation
|
return True # so that you can wrap it in an if to get indentation
|
||||||
|
|
||||||
def end_prefix(self, descr=None):
|
def end_prefix(self, descr=None):
|
||||||
@@ -336,25 +343,30 @@ class LLManifest(object):
|
|||||||
src = self.src_prefix.pop()
|
src = self.src_prefix.pop()
|
||||||
artwork = self.artwork_prefix.pop()
|
artwork = self.artwork_prefix.pop()
|
||||||
build = self.build_prefix.pop()
|
build = self.build_prefix.pop()
|
||||||
|
alt_build_prefix = self.alt_build_prefix.pop()
|
||||||
dst = self.dst_prefix.pop()
|
dst = self.dst_prefix.pop()
|
||||||
if descr and not(src == descr or build == descr or dst == descr):
|
if descr and not(src == descr or build == descr or dst == descr):
|
||||||
raise ValueError, "End prefix '" + descr + "' didn't match '" +src+ "' or '" +dst + "'"
|
raise ValueError, "End prefix '" + descr + "' didn't match '" +src+ "' or '" +dst + "'"
|
||||||
|
|
||||||
def get_src_prefix(self):
|
def get_src_prefix(self):
|
||||||
""" Returns the current source prefix."""
|
""" Returns the current source prefix."""
|
||||||
return os.path.join(*self.src_prefix)
|
return os.path.relpath(os.path.normpath(os.path.join(*self.src_prefix)))
|
||||||
|
|
||||||
def get_artwork_prefix(self):
|
def get_artwork_prefix(self):
|
||||||
""" Returns the current artwork prefix."""
|
""" Returns the current artwork prefix."""
|
||||||
return os.path.join(*self.artwork_prefix)
|
return os.path.relpath(os.path.normpath(os.path.join(*self.artwork_prefix)))
|
||||||
|
|
||||||
def get_build_prefix(self):
|
def get_build_prefix(self):
|
||||||
""" Returns the current build prefix."""
|
""" Returns the current build prefix."""
|
||||||
return os.path.join(*self.build_prefix)
|
return os.path.relpath(os.path.normpath(os.path.join(*self.build_prefix)))
|
||||||
|
|
||||||
|
def get_alt_build_prefix(self):
|
||||||
|
""" Returns the current alternate source prefix."""
|
||||||
|
return os.path.relpath(os.path.normpath(os.path.join(*self.alt_build_prefix)))
|
||||||
|
|
||||||
def get_dst_prefix(self):
|
def get_dst_prefix(self):
|
||||||
""" Returns the current destination prefix."""
|
""" Returns the current destination prefix."""
|
||||||
return os.path.join(*self.dst_prefix)
|
return os.path.relpath(os.path.normpath(os.path.join(*self.dst_prefix)))
|
||||||
|
|
||||||
def src_path_of(self, relpath):
|
def src_path_of(self, relpath):
|
||||||
"""Returns the full path to a file or directory specified
|
"""Returns the full path to a file or directory specified
|
||||||
@@ -371,42 +383,25 @@ class LLManifest(object):
|
|||||||
relative to the destination directory."""
|
relative to the destination directory."""
|
||||||
return os.path.join(self.get_dst_prefix(), relpath)
|
return os.path.join(self.get_dst_prefix(), relpath)
|
||||||
|
|
||||||
def ensure_src_dir(self, reldir):
|
|
||||||
"""Construct the path for a directory relative to the
|
|
||||||
source path, and ensures that it exists. Returns the
|
|
||||||
full path."""
|
|
||||||
path = os.path.join(self.get_src_prefix(), reldir)
|
|
||||||
self.cmakedirs(path)
|
|
||||||
return path
|
|
||||||
|
|
||||||
def ensure_dst_dir(self, reldir):
|
|
||||||
"""Construct the path for a directory relative to the
|
|
||||||
destination path, and ensures that it exists. Returns the
|
|
||||||
full path."""
|
|
||||||
path = os.path.join(self.get_dst_prefix(), reldir)
|
|
||||||
self.cmakedirs(path)
|
|
||||||
return path
|
|
||||||
|
|
||||||
def run_command(self, command):
|
def run_command(self, command):
|
||||||
""" Runs an external command, and returns the output. Raises
|
""" Runs an external command, and returns the output. Raises
|
||||||
an exception if the command reurns a nonzero status code. For
|
an exception if the command reurns a nonzero status code. For
|
||||||
debugging/informational purpoases, prints out the command's
|
debugging/informational purpoases, prints out the command's
|
||||||
output as it is received."""
|
output as it is received."""
|
||||||
print "Running command:", command
|
print "Running command:", command
|
||||||
fd = os.popen(command, 'r')
|
fd = subprocess.Popen(command, stdout=subprocess.PIPE, stderr=subprocess.PIPE, shell=True)
|
||||||
lines = []
|
lines = []
|
||||||
while True:
|
while True:
|
||||||
lines.append(fd.readline())
|
lines.append(fd.stdout.readline())
|
||||||
if lines[-1] == '':
|
if lines[-1] == '':
|
||||||
break
|
break
|
||||||
else:
|
else:
|
||||||
print lines[-1],
|
print lines[-1].rstrip('\n'),
|
||||||
output = ''.join(lines)
|
output = ''.join(lines)
|
||||||
status = fd.close()
|
if fd.returncode:
|
||||||
if status:
|
|
||||||
raise RuntimeError(
|
raise RuntimeError(
|
||||||
"Command %s returned non-zero status (%s) \noutput:\n%s"
|
"Command %s returned non-zero status (%s) \noutput:\n%s"
|
||||||
% (command, status, output) )
|
% (command, fd.returncode, output) )
|
||||||
return output
|
return output
|
||||||
|
|
||||||
def created_path(self, path):
|
def created_path(self, path):
|
||||||
@@ -484,29 +479,30 @@ class LLManifest(object):
|
|||||||
if method is not None:
|
if method is not None:
|
||||||
method(src, dst)
|
method(src, dst)
|
||||||
self.file_list.append([src, dst])
|
self.file_list.append([src, dst])
|
||||||
return 1
|
return [dst]
|
||||||
else:
|
else:
|
||||||
sys.stdout.write(" (excluding %r, %r)" % (src, dst))
|
sys.stdout.write(" (excluding %r, %r)" % (src, dst))
|
||||||
sys.stdout.flush()
|
sys.stdout.flush()
|
||||||
return 0
|
return []
|
||||||
|
|
||||||
def process_directory(self, src, dst):
|
def process_directory(self, src, dst):
|
||||||
if not self.includes(src, dst):
|
if not self.includes(src, dst):
|
||||||
sys.stdout.write(" (excluding %r, %r)" % (src, dst))
|
sys.stdout.write(" (excluding %r, %r)" % (src, dst))
|
||||||
sys.stdout.flush()
|
sys.stdout.flush()
|
||||||
return 0
|
return []
|
||||||
names = os.listdir(src)
|
names = os.listdir(src)
|
||||||
self.cmakedirs(dst)
|
self.cmakedirs(dst)
|
||||||
errors = []
|
errors = []
|
||||||
|
found_files = []
|
||||||
count = 0
|
count = 0
|
||||||
for name in names:
|
for name in names:
|
||||||
srcname = os.path.join(src, name)
|
srcname = os.path.join(src, name)
|
||||||
dstname = os.path.join(dst, name)
|
dstname = os.path.join(dst, name)
|
||||||
if os.path.isdir(srcname):
|
if os.path.isdir(srcname):
|
||||||
count += self.process_directory(srcname, dstname)
|
found_files.extend(self.process_directory(srcname, dstname))
|
||||||
else:
|
else:
|
||||||
count += self.process_file(srcname, dstname)
|
found_files.extend(self.process_file(srcname, dstname))
|
||||||
return count
|
return found_files
|
||||||
|
|
||||||
def includes(self, src, dst):
|
def includes(self, src, dst):
|
||||||
if src:
|
if src:
|
||||||
@@ -586,25 +582,11 @@ class LLManifest(object):
|
|||||||
if os.path.exists(f):
|
if os.path.exists(f):
|
||||||
return f
|
return f
|
||||||
# didn't find it, return last item in list
|
# didn't find it, return last item in list
|
||||||
if len(list) > 0:
|
if list:
|
||||||
return list[-1]
|
return list[-1]
|
||||||
else:
|
else:
|
||||||
return None
|
return None
|
||||||
|
|
||||||
def contents_of_tar(self, src_tar, dst_dir):
|
|
||||||
""" Extracts the contents of the tarfile (specified
|
|
||||||
relative to the source prefix) into the directory
|
|
||||||
specified relative to the destination directory."""
|
|
||||||
self.check_file_exists(src_tar)
|
|
||||||
tf = tarfile.open(self.src_path_of(src_tar), 'r')
|
|
||||||
for member in tf.getmembers():
|
|
||||||
tf.extract(member, self.ensure_dst_dir(dst_dir))
|
|
||||||
# TODO get actions working on these dudes, perhaps we should extract to a temporary directory and then process_directory on it?
|
|
||||||
self.file_list.append([src_tar,
|
|
||||||
self.dst_path_of(os.path.join(dst_dir,member.name))])
|
|
||||||
tf.close()
|
|
||||||
|
|
||||||
|
|
||||||
def wildcard_regex(self, src_glob, dst_glob):
|
def wildcard_regex(self, src_glob, dst_glob):
|
||||||
src_re = re.escape(src_glob)
|
src_re = re.escape(src_glob)
|
||||||
src_re = src_re.replace('\*', '([-a-zA-Z0-9._ ]*)')
|
src_re = src_re.replace('\*', '([-a-zA-Z0-9._ ]*)')
|
||||||
@@ -615,12 +597,6 @@ class LLManifest(object):
|
|||||||
i = i+1
|
i = i+1
|
||||||
return re.compile(src_re), dst_temp
|
return re.compile(src_re), dst_temp
|
||||||
|
|
||||||
def check_file_exists(self, path):
|
|
||||||
if not os.path.exists(path) and not os.path.islink(path):
|
|
||||||
raise RuntimeError("Path %s doesn't exist" % (
|
|
||||||
os.path.normpath(os.path.join(os.getcwd(), path)),))
|
|
||||||
|
|
||||||
|
|
||||||
wildcard_pattern = re.compile('\*')
|
wildcard_pattern = re.compile('\*')
|
||||||
def expand_globs(self, src, dst):
|
def expand_globs(self, src, dst):
|
||||||
src_list = glob.glob(src)
|
src_list = glob.glob(src)
|
||||||
@@ -630,40 +606,61 @@ class LLManifest(object):
|
|||||||
d = src_re.sub(d_template, s.replace('\\', '/'))
|
d = src_re.sub(d_template, s.replace('\\', '/'))
|
||||||
yield os.path.normpath(s), os.path.normpath(d)
|
yield os.path.normpath(s), os.path.normpath(d)
|
||||||
|
|
||||||
|
def path2basename(self, path, file):
|
||||||
|
"""
|
||||||
|
It is a common idiom to write:
|
||||||
|
self.path(os.path.join(somedir, somefile), somefile)
|
||||||
|
|
||||||
|
So instead you can write:
|
||||||
|
self.path2basename(somedir, somefile)
|
||||||
|
|
||||||
|
Note that this is NOT the same as:
|
||||||
|
self.path(os.path.join(somedir, somefile))
|
||||||
|
|
||||||
|
which is the same as:
|
||||||
|
temppath = os.path.join(somedir, somefile)
|
||||||
|
self.path(temppath, temppath)
|
||||||
|
"""
|
||||||
|
return self.path(os.path.join(path, file), file)
|
||||||
|
|
||||||
def path(self, src, dst=None):
|
def path(self, src, dst=None):
|
||||||
sys.stdout.write("Processing %s => %s ... " % (src, dst))
|
|
||||||
sys.stdout.flush()
|
sys.stdout.flush()
|
||||||
if src == None:
|
if src == None:
|
||||||
raise RuntimeError("No source file, dst is " + dst)
|
raise RuntimeError("No source file, dst is " + dst)
|
||||||
if dst == None:
|
if dst == None:
|
||||||
dst = src
|
dst = src
|
||||||
dst = os.path.join(self.get_dst_prefix(), dst)
|
dst = os.path.join(self.get_dst_prefix(), dst)
|
||||||
|
sys.stdout.write("Processing %s => %s ... " % (src, dst))
|
||||||
count = 0
|
count = 0
|
||||||
is_glob = False
|
is_glob = False
|
||||||
|
found_files = []
|
||||||
|
|
||||||
# look under each prefix for matching paths
|
# look under each prefix for matching paths. Paths are normalized so './../blah' will match '../blah/../blah/'
|
||||||
paths = set([os.path.join(self.get_src_prefix(), src),
|
paths = set([os.path.normpath(os.path.join(self.get_src_prefix(), src)),
|
||||||
os.path.join(self.get_artwork_prefix(), src),
|
os.path.normpath(os.path.join(self.get_artwork_prefix(), src)),
|
||||||
os.path.join(self.get_build_prefix(), src)])
|
os.path.normpath(os.path.join(self.get_build_prefix(), src)),
|
||||||
|
os.path.normpath(os.path.join(self.get_alt_build_prefix(), src))]
|
||||||
|
)
|
||||||
for path in paths:
|
for path in paths:
|
||||||
if self.wildcard_pattern.search(path):
|
if self.wildcard_pattern.search(path):
|
||||||
is_glob = True
|
is_glob = True
|
||||||
for s,d in self.expand_globs(path, dst):
|
for s,d in self.expand_globs(path, dst):
|
||||||
assert(s != d)
|
assert(s != d)
|
||||||
count += self.process_file(s, d)
|
found_files.extend(self.process_file(s, d))
|
||||||
else:
|
else:
|
||||||
# if it's a directory, recurse through it
|
# if it's a directory, recurse through it
|
||||||
if os.path.isdir(path):
|
if os.path.isdir(path):
|
||||||
count += self.process_directory(path, dst)
|
found_files.extend(self.process_directory(path, dst))
|
||||||
elif os.path.exists(path):
|
elif os.path.exists(path):
|
||||||
count += self.process_file(path, dst)
|
found_files.extend(self.process_file(path, dst))
|
||||||
|
|
||||||
# if we're specifying a single path (not a glob),
|
# if we're specifying a single path (not a glob),
|
||||||
# we should error out if it doesn't exist
|
# we should error out if it doesn't exist
|
||||||
if count == 0 and not is_glob:
|
if not found_files and not is_glob:
|
||||||
raise RuntimeError("No files match %s\n" % str(paths))
|
raise RuntimeError("No files match %s\n" % str(paths))
|
||||||
|
|
||||||
print "%d files" % count
|
print "%d files" % len(found_files)
|
||||||
|
return found_files
|
||||||
|
|
||||||
def do(self, *actions):
|
def do(self, *actions):
|
||||||
self.actions = actions
|
self.actions = actions
|
||||||
|
|||||||
@@ -1,4 +1,28 @@
|
|||||||
#!/usr/bin/python
|
#!/usr/bin/env python
|
||||||
|
"""\
|
||||||
|
@file llperformance.py
|
||||||
|
|
||||||
|
$LicenseInfo:firstyear=2010&license=viewerlgpl$
|
||||||
|
Second Life Viewer Source Code
|
||||||
|
Copyright (C) 2010-2011, Linden Research, Inc.
|
||||||
|
|
||||||
|
This library is free software; you can redistribute it and/or
|
||||||
|
modify it under the terms of the GNU Lesser General Public
|
||||||
|
License as published by the Free Software Foundation;
|
||||||
|
version 2.1 of the License only.
|
||||||
|
|
||||||
|
This library is distributed in the hope that it will be useful,
|
||||||
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||||
|
Lesser General Public License for more details.
|
||||||
|
|
||||||
|
You should have received a copy of the GNU Lesser General Public
|
||||||
|
License along with this library; if not, write to the Free Software
|
||||||
|
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
||||||
|
|
||||||
|
Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA
|
||||||
|
$/LicenseInfo$
|
||||||
|
"""
|
||||||
|
|
||||||
# ------------------------------------------------
|
# ------------------------------------------------
|
||||||
# Sim metrics utility functions.
|
# Sim metrics utility functions.
|
||||||
|
|||||||
@@ -90,6 +90,17 @@ all the output, and get the result.
|
|||||||
child.tochild.close()
|
child.tochild.close()
|
||||||
result = child.poll()
|
result = child.poll()
|
||||||
if result != -1:
|
if result != -1:
|
||||||
|
# At this point, the child process has exited and result
|
||||||
|
# is the return value from the process. Between the time
|
||||||
|
# we called select() and poll() the process may have
|
||||||
|
# exited so read all the data left on the child process
|
||||||
|
# stdout and stderr.
|
||||||
|
last = child.fromchild.read()
|
||||||
|
if last:
|
||||||
|
out.append(last)
|
||||||
|
last = child.childerr.read()
|
||||||
|
if last:
|
||||||
|
err.append(last)
|
||||||
child.tochild.close()
|
child.tochild.close()
|
||||||
child.fromchild.close()
|
child.fromchild.close()
|
||||||
child.childerr.close()
|
child.childerr.close()
|
||||||
|
|||||||
@@ -1,95 +0,0 @@
|
|||||||
"""@file llversion.py
|
|
||||||
@brief Utility for parsing llcommon/llversion${server}.h
|
|
||||||
for the version string and channel string
|
|
||||||
Utility that parses svn info for branch and revision
|
|
||||||
|
|
||||||
$LicenseInfo:firstyear=2006&license=mit$
|
|
||||||
|
|
||||||
Copyright (c) 2006-2009, Linden Research, Inc.
|
|
||||||
|
|
||||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
||||||
of this software and associated documentation files (the "Software"), to deal
|
|
||||||
in the Software without restriction, including without limitation the rights
|
|
||||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
||||||
copies of the Software, and to permit persons to whom the Software is
|
|
||||||
furnished to do so, subject to the following conditions:
|
|
||||||
|
|
||||||
The above copyright notice and this permission notice shall be included in
|
|
||||||
all copies or substantial portions of the Software.
|
|
||||||
|
|
||||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
||||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
||||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
||||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
||||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
||||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
|
||||||
THE SOFTWARE.
|
|
||||||
$/LicenseInfo$
|
|
||||||
"""
|
|
||||||
|
|
||||||
import re, sys, os, commands
|
|
||||||
|
|
||||||
# Methods for gathering version information from
|
|
||||||
# llversionviewer.h and llversionserver.h
|
|
||||||
|
|
||||||
def get_src_root():
|
|
||||||
indra_lib_python_indra_path = os.path.dirname(__file__)
|
|
||||||
return os.path.abspath(os.path.realpath(indra_lib_python_indra_path + "/../../../../../"))
|
|
||||||
|
|
||||||
def get_version_file_contents(version_type):
|
|
||||||
filepath = get_src_root() + '/indra/llcommon/llversion%s.h' % version_type
|
|
||||||
file = open(filepath,"r")
|
|
||||||
file_str = file.read()
|
|
||||||
file.close()
|
|
||||||
return file_str
|
|
||||||
|
|
||||||
def get_version(version_type):
|
|
||||||
file_str = get_version_file_contents(version_type)
|
|
||||||
m = re.search('const S32 LL_VERSION_MAJOR = (\d+);', file_str)
|
|
||||||
VER_MAJOR = m.group(1)
|
|
||||||
m = re.search('const S32 LL_VERSION_MINOR = (\d+);', file_str)
|
|
||||||
VER_MINOR = m.group(1)
|
|
||||||
m = re.search('const S32 LL_VERSION_PATCH = (\d+);', file_str)
|
|
||||||
VER_PATCH = m.group(1)
|
|
||||||
m = re.search('const S32 LL_VERSION_BUILD = (\d+);', file_str)
|
|
||||||
VER_BUILD = m.group(1)
|
|
||||||
version = "%(VER_MAJOR)s.%(VER_MINOR)s.%(VER_PATCH)s.%(VER_BUILD)s" % locals()
|
|
||||||
return version
|
|
||||||
|
|
||||||
def get_channel(version_type):
|
|
||||||
file_str = get_version_file_contents(version_type)
|
|
||||||
m = re.search('const char \* const LL_CHANNEL = "(.+)";', file_str)
|
|
||||||
return m.group(1)
|
|
||||||
|
|
||||||
def get_viewer_version():
|
|
||||||
return get_version('viewer')
|
|
||||||
|
|
||||||
def get_server_version():
|
|
||||||
return get_version('server')
|
|
||||||
|
|
||||||
def get_viewer_channel():
|
|
||||||
return get_channel('viewer')
|
|
||||||
|
|
||||||
def get_server_channel():
|
|
||||||
return get_channel('server')
|
|
||||||
|
|
||||||
# Methods for gathering subversion information
|
|
||||||
def get_svn_status_matching(regular_expression):
|
|
||||||
# Get the subversion info from the working source tree
|
|
||||||
status, output = commands.getstatusoutput('svn info %s' % get_src_root())
|
|
||||||
m = regular_expression.search(output)
|
|
||||||
if not m:
|
|
||||||
print "Failed to parse svn info output, resultfollows:"
|
|
||||||
print output
|
|
||||||
raise Exception, "No matching svn status in "+src_root
|
|
||||||
return m.group(1)
|
|
||||||
|
|
||||||
def get_svn_branch():
|
|
||||||
branch_re = re.compile('URL: (\S+)')
|
|
||||||
return get_svn_status_matching(branch_re)
|
|
||||||
|
|
||||||
def get_svn_revision():
|
|
||||||
last_rev_re = re.compile('Last Changed Rev: (\d+)')
|
|
||||||
return get_svn_status_matching(last_rev_re)
|
|
||||||
|
|
||||||
|
|
||||||
@@ -40,7 +40,6 @@ from indra.base import llsd
|
|||||||
from indra.base import config
|
from indra.base import config
|
||||||
|
|
||||||
DEBUG = False
|
DEBUG = False
|
||||||
|
|
||||||
NQ_FILE_SUFFIX = config.get('named-query-file-suffix', '.nq')
|
NQ_FILE_SUFFIX = config.get('named-query-file-suffix', '.nq')
|
||||||
NQ_FILE_SUFFIX_LEN = len(NQ_FILE_SUFFIX)
|
NQ_FILE_SUFFIX_LEN = len(NQ_FILE_SUFFIX)
|
||||||
|
|
||||||
@@ -52,6 +51,11 @@ def _init_g_named_manager(sql_dir = None):
|
|||||||
|
|
||||||
This function is intended entirely for testing purposes,
|
This function is intended entirely for testing purposes,
|
||||||
because it's tricky to control the config from inside a test."""
|
because it's tricky to control the config from inside a test."""
|
||||||
|
global NQ_FILE_SUFFIX
|
||||||
|
NQ_FILE_SUFFIX = config.get('named-query-file-suffix', '.nq')
|
||||||
|
global NQ_FILE_SUFFIX_LEN
|
||||||
|
NQ_FILE_SUFFIX_LEN = len(NQ_FILE_SUFFIX)
|
||||||
|
|
||||||
if sql_dir is None:
|
if sql_dir is None:
|
||||||
sql_dir = config.get('named-query-base-dir')
|
sql_dir = config.get('named-query-base-dir')
|
||||||
|
|
||||||
@@ -65,11 +69,11 @@ def _init_g_named_manager(sql_dir = None):
|
|||||||
_g_named_manager = NamedQueryManager(
|
_g_named_manager = NamedQueryManager(
|
||||||
os.path.abspath(os.path.realpath(sql_dir)))
|
os.path.abspath(os.path.realpath(sql_dir)))
|
||||||
|
|
||||||
def get(name):
|
def get(name, schema = None):
|
||||||
"Get the named query object to be used to perform queries"
|
"Get the named query object to be used to perform queries"
|
||||||
if _g_named_manager is None:
|
if _g_named_manager is None:
|
||||||
_init_g_named_manager()
|
_init_g_named_manager()
|
||||||
return _g_named_manager.get(name)
|
return _g_named_manager.get(name).for_schema(schema)
|
||||||
|
|
||||||
def sql(connection, name, params):
|
def sql(connection, name, params):
|
||||||
# use module-global NamedQuery object to perform default substitution
|
# use module-global NamedQuery object to perform default substitution
|
||||||
@@ -280,7 +284,10 @@ class NamedQuery(object):
|
|||||||
|
|
||||||
So, we need a vendor (or extention) for LIKE_STRING. Anyone
|
So, we need a vendor (or extention) for LIKE_STRING. Anyone
|
||||||
want to write it?"""
|
want to write it?"""
|
||||||
utf8_value = unicode(value, "utf-8")
|
if isinstance(value, unicode):
|
||||||
|
utf8_value = value
|
||||||
|
else:
|
||||||
|
utf8_value = unicode(value, "utf-8")
|
||||||
esc_list = []
|
esc_list = []
|
||||||
remove_chars = set(u"%_")
|
remove_chars = set(u"%_")
|
||||||
for glyph in utf8_value:
|
for glyph in utf8_value:
|
||||||
@@ -317,6 +324,8 @@ class NamedQuery(object):
|
|||||||
|
|
||||||
def for_schema(self, db_name):
|
def for_schema(self, db_name):
|
||||||
"Look trough the alternates and return the correct query"
|
"Look trough the alternates and return the correct query"
|
||||||
|
if db_name is None:
|
||||||
|
return self
|
||||||
try:
|
try:
|
||||||
return self._alternative[db_name]
|
return self._alternative[db_name]
|
||||||
except KeyError, e:
|
except KeyError, e:
|
||||||
@@ -342,20 +351,20 @@ class NamedQuery(object):
|
|||||||
else:
|
else:
|
||||||
cursor = connection.cursor()
|
cursor = connection.cursor()
|
||||||
|
|
||||||
statement = self.sql(connection, params)
|
full_query, params = self._construct_sql(params)
|
||||||
if DEBUG:
|
if DEBUG:
|
||||||
print "SQL:", statement
|
print "SQL:", self.sql(connection, params)
|
||||||
rows = cursor.execute(statement)
|
rows = cursor.execute(full_query, params)
|
||||||
|
|
||||||
# *NOTE: the expect_rows argument is a very cheesy way to get some
|
# *NOTE: the expect_rows argument is a very cheesy way to get some
|
||||||
# validation on the result set. If you want to add more expectation
|
# validation on the result set. If you want to add more expectation
|
||||||
# logic, do something more object-oriented and flexible. Or use an ORM.
|
# logic, do something more object-oriented and flexible. Or use an ORM.
|
||||||
if(self._return_as_map):
|
if(self._return_as_map):
|
||||||
expect_rows = 1
|
expect_rows = 1
|
||||||
if expect_rows is not None and rows != expect_rows:
|
if expect_rows is not None and rows != expect_rows:
|
||||||
cursor.close()
|
cursor.close()
|
||||||
raise ExpectationFailed("Statement expected %s rows, got %s. Sql: %s" % (
|
raise ExpectationFailed("Statement expected %s rows, got %s. Sql: '%s' %s" % (
|
||||||
expect_rows, rows, statement))
|
expect_rows, rows, full_query, params))
|
||||||
|
|
||||||
# convert to dicts manually if we're not using a dictcursor
|
# convert to dicts manually if we're not using a dictcursor
|
||||||
if use_dictcursor:
|
if use_dictcursor:
|
||||||
@@ -381,11 +390,9 @@ class NamedQuery(object):
|
|||||||
return result_set[0]
|
return result_set[0]
|
||||||
return result_set
|
return result_set
|
||||||
|
|
||||||
def sql(self, connection, params):
|
def _construct_sql(self, params):
|
||||||
""" Generates an SQL statement from the named query document
|
""" Returns a query string and a dictionary of parameters,
|
||||||
and a dictionary of parameters.
|
suitable for directly passing to the execute() method."""
|
||||||
|
|
||||||
"""
|
|
||||||
self.refresh()
|
self.refresh()
|
||||||
|
|
||||||
# build the query from the options available and the params
|
# build the query from the options available and the params
|
||||||
@@ -431,10 +438,23 @@ class NamedQuery(object):
|
|||||||
new_params[self._build_integer_key(key)] = int(params[key])
|
new_params[self._build_integer_key(key)] = int(params[key])
|
||||||
params.update(new_params)
|
params.update(new_params)
|
||||||
|
|
||||||
|
return full_query, params
|
||||||
|
|
||||||
|
def sql(self, connection, params):
|
||||||
|
""" Generates an SQL statement from the named query document
|
||||||
|
and a dictionary of parameters.
|
||||||
|
|
||||||
|
*NOTE: Only use for debugging, because it uses the
|
||||||
|
non-standard MySQLdb 'literal' method.
|
||||||
|
"""
|
||||||
|
if not DEBUG:
|
||||||
|
import warnings
|
||||||
|
warnings.warn("Don't use named_query.sql() when not debugging. Used on %s" % self._location)
|
||||||
# do substitution using the mysql (non-standard) 'literal'
|
# do substitution using the mysql (non-standard) 'literal'
|
||||||
# function to do the escaping.
|
# function to do the escaping.
|
||||||
sql = full_query % connection.literal(params)
|
full_query, params = self._construct_sql(params)
|
||||||
return sql
|
return full_query % connection.literal(params)
|
||||||
|
|
||||||
|
|
||||||
def refresh(self):
|
def refresh(self):
|
||||||
""" Refresh self from the file on the filesystem.
|
""" Refresh self from the file on the filesystem.
|
||||||
|
|||||||
@@ -3,20 +3,27 @@
|
|||||||
@file simperf_oprof_interface.py
|
@file simperf_oprof_interface.py
|
||||||
@brief Manage OProfile data collection on a host
|
@brief Manage OProfile data collection on a host
|
||||||
|
|
||||||
$LicenseInfo:firstyear=2008&license=internal$
|
$LicenseInfo:firstyear=2008&license=mit$
|
||||||
|
|
||||||
Copyright (c) 2008-2009, Linden Research, Inc.
|
Copyright (c) 2008-2009, Linden Research, Inc.
|
||||||
|
|
||||||
The following source code is PROPRIETARY AND CONFIDENTIAL. Use of
|
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||||
this source code is governed by the Linden Lab Source Code Disclosure
|
of this software and associated documentation files (the "Software"), to deal
|
||||||
Agreement ("Agreement") previously entered between you and Linden
|
in the Software without restriction, including without limitation the rights
|
||||||
Lab. By accessing, using, copying, modifying or distributing this
|
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||||
software, you acknowledge that you have been informed of your
|
copies of the Software, and to permit persons to whom the Software is
|
||||||
obligations under the Agreement and agree to abide by those obligations.
|
furnished to do so, subject to the following conditions:
|
||||||
|
|
||||||
ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO
|
The above copyright notice and this permission notice shall be included in
|
||||||
WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY,
|
all copies or substantial portions of the Software.
|
||||||
COMPLETENESS OR PERFORMANCE.
|
|
||||||
|
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||||
|
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||||
|
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||||
|
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||||
|
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||||
|
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||||
|
THE SOFTWARE.
|
||||||
$/LicenseInfo$
|
$/LicenseInfo$
|
||||||
"""
|
"""
|
||||||
|
|
||||||
|
|||||||
@@ -1,4 +1,31 @@
|
|||||||
#!/usr/bin/python
|
#!/usr/bin/env python
|
||||||
|
"""\
|
||||||
|
@file simperf_proc_interface.py
|
||||||
|
@brief Utility to extract log messages from *.<pid>.llsd files containing performance statistics.
|
||||||
|
|
||||||
|
$LicenseInfo:firstyear=2008&license=mit$
|
||||||
|
|
||||||
|
Copyright (c) 2008-2009, Linden Research, Inc.
|
||||||
|
|
||||||
|
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||||
|
of this software and associated documentation files (the "Software"), to deal
|
||||||
|
in the Software without restriction, including without limitation the rights
|
||||||
|
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||||
|
copies of the Software, and to permit persons to whom the Software is
|
||||||
|
furnished to do so, subject to the following conditions:
|
||||||
|
|
||||||
|
The above copyright notice and this permission notice shall be included in
|
||||||
|
all copies or substantial portions of the Software.
|
||||||
|
|
||||||
|
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||||
|
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||||
|
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||||
|
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||||
|
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||||
|
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||||
|
THE SOFTWARE.
|
||||||
|
$/LicenseInfo$
|
||||||
|
"""
|
||||||
|
|
||||||
# ----------------------------------------------------
|
# ----------------------------------------------------
|
||||||
# Utility to extract log messages from *.<pid>.llsd
|
# Utility to extract log messages from *.<pid>.llsd
|
||||||
|
|||||||
146
indra/lib/python/indra/util/test_win32_manifest.py
Normal file
146
indra/lib/python/indra/util/test_win32_manifest.py
Normal file
@@ -0,0 +1,146 @@
|
|||||||
|
#!/usr/bin/env python
|
||||||
|
"""\
|
||||||
|
@file test_win32_manifest.py
|
||||||
|
@brief Test an assembly binding version and uniqueness in a windows dll or exe.
|
||||||
|
|
||||||
|
$LicenseInfo:firstyear=2009&license=viewerlgpl$
|
||||||
|
Second Life Viewer Source Code
|
||||||
|
Copyright (C) 2009-2011, Linden Research, Inc.
|
||||||
|
|
||||||
|
This library is free software; you can redistribute it and/or
|
||||||
|
modify it under the terms of the GNU Lesser General Public
|
||||||
|
License as published by the Free Software Foundation;
|
||||||
|
version 2.1 of the License only.
|
||||||
|
|
||||||
|
This library is distributed in the hope that it will be useful,
|
||||||
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||||
|
Lesser General Public License for more details.
|
||||||
|
|
||||||
|
You should have received a copy of the GNU Lesser General Public
|
||||||
|
License along with this library; if not, write to the Free Software
|
||||||
|
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
||||||
|
|
||||||
|
Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA
|
||||||
|
$/LicenseInfo$
|
||||||
|
"""
|
||||||
|
import sys, os
|
||||||
|
import tempfile
|
||||||
|
from xml.dom.minidom import parse
|
||||||
|
|
||||||
|
class AssemblyTestException(Exception):
|
||||||
|
pass
|
||||||
|
|
||||||
|
class NoManifestException(AssemblyTestException):
|
||||||
|
pass
|
||||||
|
|
||||||
|
class MultipleBindingsException(AssemblyTestException):
|
||||||
|
pass
|
||||||
|
|
||||||
|
class UnexpectedVersionException(AssemblyTestException):
|
||||||
|
pass
|
||||||
|
|
||||||
|
class NoMatchingAssemblyException(AssemblyTestException):
|
||||||
|
pass
|
||||||
|
|
||||||
|
def get_HKLM_registry_value(key_str, value_str):
|
||||||
|
import _winreg
|
||||||
|
reg = _winreg.ConnectRegistry(None, _winreg.HKEY_LOCAL_MACHINE)
|
||||||
|
key = _winreg.OpenKey(reg, key_str)
|
||||||
|
value = _winreg.QueryValueEx(key, value_str)[0]
|
||||||
|
#print 'Found: %s' % value
|
||||||
|
return value
|
||||||
|
|
||||||
|
def find_vc_dir():
|
||||||
|
supported_versions = (r'8.0', r'9.0')
|
||||||
|
supported_products = (r'VisualStudio', r'VCExpress')
|
||||||
|
value_str = (r'ProductDir')
|
||||||
|
|
||||||
|
for product in supported_products:
|
||||||
|
for version in supported_versions:
|
||||||
|
key_str = (r'SOFTWARE\Microsoft\%s\%s\Setup\VC' %
|
||||||
|
(product, version))
|
||||||
|
try:
|
||||||
|
return get_HKLM_registry_value(key_str, value_str)
|
||||||
|
except WindowsError, err:
|
||||||
|
x64_key_str = (r'SOFTWARE\Wow6432Node\Microsoft\VisualStudio\%s\Setup\VS' %
|
||||||
|
version)
|
||||||
|
try:
|
||||||
|
return get_HKLM_registry_value(x64_key_str, value_str)
|
||||||
|
except:
|
||||||
|
print >> sys.stderr, "Didn't find MS %s version %s " % (product,version)
|
||||||
|
|
||||||
|
raise
|
||||||
|
|
||||||
|
def find_mt_path():
|
||||||
|
vc_dir = find_vc_dir()
|
||||||
|
mt_path = '\"%sbin\\mt.exe\"' % vc_dir
|
||||||
|
return mt_path
|
||||||
|
|
||||||
|
def test_assembly_binding(src_filename, assembly_name, assembly_ver):
|
||||||
|
print "checking %s dependency %s..." % (src_filename, assembly_name)
|
||||||
|
|
||||||
|
(tmp_file_fd, tmp_file_name) = tempfile.mkstemp(suffix='.xml')
|
||||||
|
tmp_file = os.fdopen(tmp_file_fd)
|
||||||
|
tmp_file.close()
|
||||||
|
|
||||||
|
mt_path = find_mt_path()
|
||||||
|
resource_id = ""
|
||||||
|
if os.path.splitext(src_filename)[1].lower() == ".dll":
|
||||||
|
resource_id = ";#2"
|
||||||
|
system_call = '%s -nologo -inputresource:%s%s -out:%s > NUL' % (mt_path, src_filename, resource_id, tmp_file_name)
|
||||||
|
print "Executing: %s" % system_call
|
||||||
|
mt_result = os.system(system_call)
|
||||||
|
if mt_result == 31:
|
||||||
|
print "No manifest found in %s" % src_filename
|
||||||
|
raise NoManifestException()
|
||||||
|
|
||||||
|
manifest_dom = parse(tmp_file_name)
|
||||||
|
nodes = manifest_dom.getElementsByTagName('assemblyIdentity')
|
||||||
|
|
||||||
|
versions = list()
|
||||||
|
for node in nodes:
|
||||||
|
if node.getAttribute('name') == assembly_name:
|
||||||
|
versions.append(node.getAttribute('version'))
|
||||||
|
|
||||||
|
if len(versions) == 0:
|
||||||
|
print "No matching assemblies found in %s" % src_filename
|
||||||
|
raise NoMatchingAssemblyException()
|
||||||
|
|
||||||
|
elif len(versions) > 1:
|
||||||
|
print "Multiple bindings to %s found:" % assembly_name
|
||||||
|
print versions
|
||||||
|
print
|
||||||
|
raise MultipleBindingsException(versions)
|
||||||
|
|
||||||
|
elif versions[0] != assembly_ver:
|
||||||
|
print "Unexpected version found for %s:" % assembly_name
|
||||||
|
print "Wanted %s, found %s" % (assembly_ver, versions[0])
|
||||||
|
print
|
||||||
|
raise UnexpectedVersionException(assembly_ver, versions[0])
|
||||||
|
|
||||||
|
os.remove(tmp_file_name)
|
||||||
|
|
||||||
|
print "SUCCESS: %s OK!" % src_filename
|
||||||
|
print
|
||||||
|
|
||||||
|
if __name__ == '__main__':
|
||||||
|
|
||||||
|
print
|
||||||
|
print "Running test_win32_manifest.py..."
|
||||||
|
|
||||||
|
usage = 'test_win32_manfest <srcFileName> <assemblyName> <assemblyVersion>'
|
||||||
|
|
||||||
|
try:
|
||||||
|
src_filename = sys.argv[1]
|
||||||
|
assembly_name = sys.argv[2]
|
||||||
|
assembly_ver = sys.argv[3]
|
||||||
|
except:
|
||||||
|
print "Usage:"
|
||||||
|
print usage
|
||||||
|
print
|
||||||
|
raise
|
||||||
|
|
||||||
|
test_assembly_binding(src_filename, assembly_name, assembly_ver)
|
||||||
|
|
||||||
|
|
||||||
@@ -45,13 +45,6 @@ Typical usage:
|
|||||||
|
|
||||||
This module works with Python 2.3 or higher."""
|
This module works with Python 2.3 or higher."""
|
||||||
|
|
||||||
# *HACK: Necessary for python 2.4. Consider replacing this code wart
|
|
||||||
# after python >=2.5 has deployed everywhere. 2009-10-05
|
|
||||||
try:
|
|
||||||
from hashlib import md5
|
|
||||||
except ImportError:
|
|
||||||
from md5 import md5
|
|
||||||
|
|
||||||
__author__ = 'Ka-Ping Yee <ping@zesty.ca>'
|
__author__ = 'Ka-Ping Yee <ping@zesty.ca>'
|
||||||
__date__ = '$Date: 2006/06/12 23:15:40 $'.split()[1].replace('/', '-')
|
__date__ = '$Date: 2006/06/12 23:15:40 $'.split()[1].replace('/', '-')
|
||||||
__version__ = '$Revision: 1.30 $'.split()[1]
|
__version__ = '$Revision: 1.30 $'.split()[1]
|
||||||
@@ -453,6 +446,13 @@ def uuid1(node=None, clock_seq=None):
|
|||||||
|
|
||||||
def uuid3(namespace, name):
|
def uuid3(namespace, name):
|
||||||
"""Generate a UUID from the MD5 hash of a namespace UUID and a name."""
|
"""Generate a UUID from the MD5 hash of a namespace UUID and a name."""
|
||||||
|
try:
|
||||||
|
# Python 2.6
|
||||||
|
from hashlib import md5
|
||||||
|
except ImportError:
|
||||||
|
# Python 2.5 and earlier
|
||||||
|
from md5 import new as md5
|
||||||
|
|
||||||
hash = md5(namespace.bytes + name).digest()
|
hash = md5(namespace.bytes + name).digest()
|
||||||
return UUID(bytes=hash[:16], version=3)
|
return UUID(bytes=hash[:16], version=3)
|
||||||
|
|
||||||
|
|||||||
@@ -317,7 +317,7 @@ namespace HACD
|
|||||||
bool m_addFacesPoints; //>! specifies whether to add faces points or not
|
bool m_addFacesPoints; //>! specifies whether to add faces points or not
|
||||||
bool m_addExtraDistPoints; //>! specifies whether to add extra points for concave shapes or not
|
bool m_addExtraDistPoints; //>! specifies whether to add extra points for concave shapes or not
|
||||||
|
|
||||||
friend HACD * const CreateHACD(HeapManager * heapManager = 0);
|
friend HACD * const CreateHACD(HeapManager * heapManager);
|
||||||
friend void DestroyHACD(HACD * const hacd);
|
friend void DestroyHACD(HACD * const hacd);
|
||||||
};
|
};
|
||||||
inline HACD * const CreateHACD(HeapManager * heapManager)
|
inline HACD * const CreateHACD(HeapManager * heapManager)
|
||||||
|
|||||||
@@ -17,6 +17,10 @@
|
|||||||
#include <assert.h>
|
#include <assert.h>
|
||||||
#include <limits>
|
#include <limits>
|
||||||
#include "hacdManifoldMesh.h"
|
#include "hacdManifoldMesh.h"
|
||||||
|
|
||||||
|
#if _MSC_VER >= 1800
|
||||||
|
#include <algorithm>
|
||||||
|
#endif
|
||||||
namespace HACD
|
namespace HACD
|
||||||
{
|
{
|
||||||
bool BBox::Raycast(const Vec3<Float> & origin, const Vec3<Float> & dir, Float & distMin) const
|
bool BBox::Raycast(const Vec3<Float> & origin, const Vec3<Float> & dir, Float & distMin) const
|
||||||
|
|||||||
@@ -7,7 +7,7 @@ include(00-Common)
|
|||||||
include_directories(${LIBS_OPEN_DIR}/libhacd)
|
include_directories(${LIBS_OPEN_DIR}/libhacd)
|
||||||
|
|
||||||
set (libndhacd_SOURCE_FILES
|
set (libndhacd_SOURCE_FILES
|
||||||
LLConvexDecomposition.cpp
|
llconvexdecomposition.cpp
|
||||||
nd_hacdConvexDecomposition.cpp
|
nd_hacdConvexDecomposition.cpp
|
||||||
nd_hacdStructs.cpp
|
nd_hacdStructs.cpp
|
||||||
nd_hacdUtils.cpp
|
nd_hacdUtils.cpp
|
||||||
@@ -16,12 +16,12 @@ set (libndhacd_SOURCE_FILES
|
|||||||
)
|
)
|
||||||
|
|
||||||
set (libndhacd_HEADER_FILES
|
set (libndhacd_HEADER_FILES
|
||||||
LLConvexDecomposition.h
|
llconvexdecomposition.h
|
||||||
ndConvexDecomposition.h
|
ndConvexDecomposition.h
|
||||||
nd_hacdConvexDecomposition.h
|
nd_hacdConvexDecomposition.h
|
||||||
nd_hacdStructs.h
|
nd_hacdStructs.h
|
||||||
nd_StructTracer.h
|
nd_StructTracer.h
|
||||||
LLConvexDecompositionStubImpl.h
|
llconvexdecompositionstubimpl.h
|
||||||
nd_EnterExitTracer.h
|
nd_EnterExitTracer.h
|
||||||
nd_hacdDefines.h
|
nd_hacdDefines.h
|
||||||
nd_hacdUtils.h
|
nd_hacdUtils.h
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
/**
|
/**
|
||||||
* @file LLConvexDecomposition.cpp
|
* @file llconvexdecomposition.cpp
|
||||||
* @author falcon@lindenlab.com
|
* @author falcon@lindenlab.com
|
||||||
* @brief A stub implementation of LLConvexDecomposition interface
|
* @brief A stub implementation of LLConvexDecomposition interface
|
||||||
*
|
*
|
||||||
@@ -35,7 +35,7 @@
|
|||||||
|
|
||||||
#include "nd_hacdConvexDecomposition.h"
|
#include "nd_hacdConvexDecomposition.h"
|
||||||
|
|
||||||
#include "LLConvexDecomposition.h"
|
#include "llconvexdecomposition.h"
|
||||||
|
|
||||||
|
|
||||||
/*static */bool LLConvexDecomposition::s_isInitialized = false;
|
/*static */bool LLConvexDecomposition::s_isInitialized = false;
|
||||||
@@ -1,5 +1,5 @@
|
|||||||
/**
|
/**
|
||||||
* @file LLConvexDecomposition.cpp
|
* @file llconvexdecomposition.cpp
|
||||||
* @brief LLConvexDecomposition interface definition
|
* @brief LLConvexDecomposition interface definition
|
||||||
*
|
*
|
||||||
* $LicenseInfo:firstyear=2011&license=viewerlgpl$
|
* $LicenseInfo:firstyear=2011&license=viewerlgpl$
|
||||||
@@ -1,5 +1,5 @@
|
|||||||
/**
|
/**
|
||||||
* @file LLConvexDecompositionStubImpl.cpp
|
* @file llconvexdecompositionstubimpl.cpp
|
||||||
* @author falcon@lindenlab.com
|
* @author falcon@lindenlab.com
|
||||||
* @brief A stub implementation of LLConvexDecomposition
|
* @brief A stub implementation of LLConvexDecomposition
|
||||||
*
|
*
|
||||||
@@ -28,7 +28,7 @@
|
|||||||
|
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include <memory>
|
#include <memory>
|
||||||
#include "LLConvexDecompositionStubImpl.h"
|
#include "llconvexdecompositionstubimpl.h"
|
||||||
|
|
||||||
LLConvexDecomposition* LLConvexDecompositionImpl::getInstance()
|
LLConvexDecomposition* LLConvexDecompositionImpl::getInstance()
|
||||||
{
|
{
|
||||||
@@ -1,5 +1,5 @@
|
|||||||
/**
|
/**
|
||||||
* @file LLConvexDecompositionStubImpl.h
|
* @file llconvexdecompositionstubimpl.h
|
||||||
* @author falcon@lindenlab.com
|
* @author falcon@lindenlab.com
|
||||||
* @brief A stub implementation of LLConvexDecomposition
|
* @brief A stub implementation of LLConvexDecomposition
|
||||||
*
|
*
|
||||||
@@ -29,7 +29,7 @@
|
|||||||
#ifndef LL_CONVEX_DECOMP_UTIL_H
|
#ifndef LL_CONVEX_DECOMP_UTIL_H
|
||||||
#define LL_CONVEX_DECOMP_UTIL_H
|
#define LL_CONVEX_DECOMP_UTIL_H
|
||||||
|
|
||||||
#include "LLConvexDecomposition.h"
|
#include "llconvexdecomposition.h"
|
||||||
|
|
||||||
class LLConvexDecompositionImpl : public LLConvexDecomposition
|
class LLConvexDecompositionImpl : public LLConvexDecomposition
|
||||||
{
|
{
|
||||||
@@ -21,7 +21,7 @@
|
|||||||
|
|
||||||
|
|
||||||
#include "ndConvexDecomposition.h"
|
#include "ndConvexDecomposition.h"
|
||||||
#include "LLConvexDecomposition.h"
|
#include "llconvexdecomposition.h"
|
||||||
#include "nd_hacdStructs.h"
|
#include "nd_hacdStructs.h"
|
||||||
|
|
||||||
namespace ndStructTracer
|
namespace ndStructTracer
|
||||||
|
|||||||
@@ -19,7 +19,7 @@
|
|||||||
#ifndef ND_HACD_CONVEXDECOMP_H
|
#ifndef ND_HACD_CONVEXDECOMP_H
|
||||||
#define ND_HACD_CONVEXDECOMP_H
|
#define ND_HACD_CONVEXDECOMP_H
|
||||||
|
|
||||||
#include "LLConvexDecomposition.h"
|
#include "llconvexdecomposition.h"
|
||||||
|
|
||||||
#include <map>
|
#include <map>
|
||||||
#include <vector>
|
#include <vector>
|
||||||
|
|||||||
@@ -17,7 +17,6 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
#include "nd_hacdStructs.h"
|
#include "nd_hacdStructs.h"
|
||||||
#include "LLConvexDecomposition.h"
|
|
||||||
|
|
||||||
void DecompHull::clear()
|
void DecompHull::clear()
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -21,7 +21,7 @@
|
|||||||
|
|
||||||
#include "nd_hacdDefines.h"
|
#include "nd_hacdDefines.h"
|
||||||
#include "hacdHACD.h"
|
#include "hacdHACD.h"
|
||||||
#include "LLConvexDecomposition.h"
|
#include "llconvexdecomposition.h"
|
||||||
#include <vector>
|
#include <vector>
|
||||||
|
|
||||||
struct LLCDHull;
|
struct LLCDHull;
|
||||||
|
|||||||
@@ -20,7 +20,6 @@
|
|||||||
#define ND_HACD_UTILS_H
|
#define ND_HACD_UTILS_H
|
||||||
|
|
||||||
#include "nd_hacdStructs.h"
|
#include "nd_hacdStructs.h"
|
||||||
#include "LLConvexDecomposition.h"
|
|
||||||
|
|
||||||
tHACD* init( int nConcavity, int nClusters, int nMaxVerticesPerHull, double dMaxConnectDist, HACDDecoder *aData );
|
tHACD* init( int nConcavity, int nClusters, int nMaxVerticesPerHull, double dMaxConnectDist, HACDDecoder *aData );
|
||||||
DecompData decompose( tHACD *aHACD );
|
DecompData decompose( tHACD *aHACD );
|
||||||
|
|||||||
@@ -182,9 +182,6 @@ LLAvatarAppearance::LLAvatarAppearance(LLWearableData* wearable_data) :
|
|||||||
}
|
}
|
||||||
|
|
||||||
mIsBuilt = FALSE;
|
mIsBuilt = FALSE;
|
||||||
|
|
||||||
mNumCollisionVolumes = 0;
|
|
||||||
mCollisionVolumes = NULL;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// virtual
|
// virtual
|
||||||
@@ -294,7 +291,7 @@ LLAvatarAppearance::~LLAvatarAppearance()
|
|||||||
mJointMap.clear();
|
mJointMap.clear();
|
||||||
|
|
||||||
clearSkeleton();
|
clearSkeleton();
|
||||||
deleteAndClearArray(mCollisionVolumes);
|
clearCollisionVolumes();
|
||||||
|
|
||||||
std::for_each(mPolyMeshes.begin(), mPolyMeshes.end(), DeletePairedPointer());
|
std::for_each(mPolyMeshes.begin(), mPolyMeshes.end(), DeletePairedPointer());
|
||||||
mPolyMeshes.clear();
|
mPolyMeshes.clear();
|
||||||
@@ -575,12 +572,12 @@ BOOL LLAvatarAppearance::setupBone(const LLAvatarBoneInfo* info, LLJoint* parent
|
|||||||
}
|
}
|
||||||
else // collision volume
|
else // collision volume
|
||||||
{
|
{
|
||||||
if (volume_num >= (S32)mNumCollisionVolumes)
|
if (volume_num >= (S32)mCollisionVolumes.size())
|
||||||
{
|
{
|
||||||
llwarns << "Too many bones" << llendl;
|
llwarns << "Too many bones" << llendl;
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
joint = (&mCollisionVolumes[volume_num]);
|
joint = (mCollisionVolumes[volume_num]);
|
||||||
joint->setName( info->mName );
|
joint->setName( info->mName );
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -983,19 +980,19 @@ BOOL LLAvatarAppearance::loadSkeletonNode ()
|
|||||||
mRoot->addChild(mMeshLOD[MESH_ID_SKIRT]);
|
mRoot->addChild(mMeshLOD[MESH_ID_SKIRT]);
|
||||||
mRoot->addChild(mMeshLOD[MESH_ID_HEAD]);
|
mRoot->addChild(mMeshLOD[MESH_ID_HEAD]);
|
||||||
|
|
||||||
LLAvatarJoint *skull = (LLAvatarJoint*)mRoot->findJoint("mSkull");
|
LLJoint *skull = mRoot->findJoint("mSkull");
|
||||||
if (skull)
|
if (skull)
|
||||||
{
|
{
|
||||||
skull->addChild(mMeshLOD[MESH_ID_HAIR] );
|
skull->addChild(mMeshLOD[MESH_ID_HAIR] );
|
||||||
}
|
}
|
||||||
|
|
||||||
LLAvatarJoint *eyeL = (LLAvatarJoint*)mRoot->findJoint("mEyeLeft");
|
LLJoint *eyeL = mRoot->findJoint("mEyeLeft");
|
||||||
if (eyeL)
|
if (eyeL)
|
||||||
{
|
{
|
||||||
eyeL->addChild( mMeshLOD[MESH_ID_EYEBALL_LEFT] );
|
eyeL->addChild( mMeshLOD[MESH_ID_EYEBALL_LEFT] );
|
||||||
}
|
}
|
||||||
|
|
||||||
LLAvatarJoint *eyeR = (LLAvatarJoint*)mRoot->findJoint("mEyeRight");
|
LLJoint *eyeR = mRoot->findJoint("mEyeRight");
|
||||||
if (eyeR)
|
if (eyeR)
|
||||||
{
|
{
|
||||||
eyeR->addChild( mMeshLOD[MESH_ID_EYEBALL_RIGHT] );
|
eyeR->addChild( mMeshLOD[MESH_ID_EYEBALL_RIGHT] );
|
||||||
@@ -1250,12 +1247,12 @@ LLVector3 LLAvatarAppearance::getVolumePos(S32 joint_index, LLVector3& volume_of
|
|||||||
return LLVector3::zero;
|
return LLVector3::zero;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (joint_index > mNumCollisionVolumes)
|
if (joint_index > (S32)mCollisionVolumes.size())
|
||||||
{
|
{
|
||||||
return LLVector3::zero;
|
return LLVector3::zero;
|
||||||
}
|
}
|
||||||
|
|
||||||
return mCollisionVolumes[joint_index].getVolumePos(volume_offset);
|
return mCollisionVolumes[joint_index]->getVolumePos(volume_offset);
|
||||||
}
|
}
|
||||||
|
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
@@ -1266,12 +1263,12 @@ LLJoint* LLAvatarAppearance::findCollisionVolume(U32 volume_id)
|
|||||||
//SNOW-488: As mNumCollisionVolumes is a S32 and we are casting from a U32 to a S32
|
//SNOW-488: As mNumCollisionVolumes is a S32 and we are casting from a U32 to a S32
|
||||||
//to compare we also need to be sure of the wrap around case producing (S32) <0
|
//to compare we also need to be sure of the wrap around case producing (S32) <0
|
||||||
//or in terms of the U32 an out of bounds index in the array.
|
//or in terms of the U32 an out of bounds index in the array.
|
||||||
if ((S32)volume_id > mNumCollisionVolumes || (S32)volume_id<0)
|
if ((S32)volume_id > (S32)mCollisionVolumes.size() || (S32)volume_id<0)
|
||||||
{
|
{
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
return &mCollisionVolumes[volume_id];
|
return mCollisionVolumes[volume_id];
|
||||||
}
|
}
|
||||||
|
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
@@ -1279,9 +1276,9 @@ LLJoint* LLAvatarAppearance::findCollisionVolume(U32 volume_id)
|
|||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
S32 LLAvatarAppearance::getCollisionVolumeID(std::string &name)
|
S32 LLAvatarAppearance::getCollisionVolumeID(std::string &name)
|
||||||
{
|
{
|
||||||
for (S32 i = 0; i < mNumCollisionVolumes; i++)
|
for (S32 i = 0; i < (S32)mCollisionVolumes.size(); i++)
|
||||||
{
|
{
|
||||||
if (mCollisionVolumes[i].getName() == name)
|
if (mCollisionVolumes[i]->getName() == name)
|
||||||
{
|
{
|
||||||
return i;
|
return i;
|
||||||
}
|
}
|
||||||
@@ -1530,21 +1527,34 @@ LLTexLayerSet* LLAvatarAppearance::getAvatarLayerSet(EBakedTextureIndex baked_in
|
|||||||
return mBakedTextureDatas[baked_index].mTexLayerSet;
|
return mBakedTextureDatas[baked_index].mTexLayerSet;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void LLAvatarAppearance::clearCollisionVolumes()
|
||||||
|
{
|
||||||
|
std::for_each(mCollisionVolumes.begin(), mCollisionVolumes.end(),
|
||||||
|
DeletePointer());
|
||||||
|
mCollisionVolumes.clear();
|
||||||
|
}
|
||||||
|
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
// allocateCollisionVolumes()
|
// allocateCollisionVolumes()
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
BOOL LLAvatarAppearance::allocateCollisionVolumes( U32 num )
|
BOOL LLAvatarAppearance::allocateCollisionVolumes( U32 num )
|
||||||
{
|
{
|
||||||
deleteAndClearArray(mCollisionVolumes);
|
mCollisionVolumes.reserve(num);
|
||||||
mNumCollisionVolumes = 0;
|
|
||||||
|
|
||||||
mCollisionVolumes = new LLAvatarJointCollisionVolume[num];
|
LLAvatarJointCollisionVolume* cv;
|
||||||
if (!mCollisionVolumes)
|
for (U32 i = 0; i < num; ++i)
|
||||||
{
|
{
|
||||||
return FALSE;
|
cv = new LLAvatarJointCollisionVolume();
|
||||||
|
if (cv)
|
||||||
|
{
|
||||||
|
mCollisionVolumes.push_back(cv);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
clearCollisionVolumes();
|
||||||
|
return false;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
mNumCollisionVolumes = num;
|
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -337,9 +337,9 @@ protected:
|
|||||||
// Collision volumes
|
// Collision volumes
|
||||||
//--------------------------------------------------------------------
|
//--------------------------------------------------------------------
|
||||||
public:
|
public:
|
||||||
S32 mNumCollisionVolumes;
|
std::vector<LLAvatarJointCollisionVolume*> mCollisionVolumes;
|
||||||
LLAvatarJointCollisionVolume* mCollisionVolumes;
|
|
||||||
protected:
|
protected:
|
||||||
|
void clearCollisionVolumes();
|
||||||
BOOL allocateCollisionVolumes(U32 num);
|
BOOL allocateCollisionVolumes(U32 num);
|
||||||
|
|
||||||
/** Physics
|
/** Physics
|
||||||
|
|||||||
@@ -105,8 +105,9 @@ void LLAvatarJoint::setValid( BOOL valid, BOOL recursive )
|
|||||||
for (child_list_t::iterator iter = mChildren.begin();
|
for (child_list_t::iterator iter = mChildren.begin();
|
||||||
iter != mChildren.end(); ++iter)
|
iter != mChildren.end(); ++iter)
|
||||||
{
|
{
|
||||||
LLAvatarJoint* joint = (LLAvatarJoint*)(*iter);
|
LLAvatarJoint* joint = dynamic_cast<LLAvatarJoint*>(*iter);
|
||||||
joint->setValid(valid, TRUE);
|
if (joint)
|
||||||
|
joint->setValid(valid, TRUE);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -124,7 +125,8 @@ void LLAvatarJoint::setSkeletonComponents( U32 comp, BOOL recursive )
|
|||||||
iter != mChildren.end(); ++iter)
|
iter != mChildren.end(); ++iter)
|
||||||
{
|
{
|
||||||
LLAvatarJoint* joint = dynamic_cast<LLAvatarJoint*>(*iter);
|
LLAvatarJoint* joint = dynamic_cast<LLAvatarJoint*>(*iter);
|
||||||
joint->setSkeletonComponents(comp, recursive);
|
if (joint)
|
||||||
|
joint->setSkeletonComponents(comp, recursive);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -138,8 +140,9 @@ void LLAvatarJoint::setVisible(BOOL visible, BOOL recursive)
|
|||||||
for (child_list_t::iterator iter = mChildren.begin();
|
for (child_list_t::iterator iter = mChildren.begin();
|
||||||
iter != mChildren.end(); ++iter)
|
iter != mChildren.end(); ++iter)
|
||||||
{
|
{
|
||||||
LLAvatarJoint* joint = (LLAvatarJoint*)(*iter);
|
LLAvatarJoint* joint = dynamic_cast<LLAvatarJoint*>(*iter);
|
||||||
joint->setVisible(visible, recursive);
|
if(joint)
|
||||||
|
joint->setVisible(visible, recursive);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -150,7 +153,8 @@ void LLAvatarJoint::updateFaceSizes(U32 &num_vertices, U32& num_indices, F32 pix
|
|||||||
iter != mChildren.end(); ++iter)
|
iter != mChildren.end(); ++iter)
|
||||||
{
|
{
|
||||||
LLAvatarJoint* joint = dynamic_cast<LLAvatarJoint*>(*iter);
|
LLAvatarJoint* joint = dynamic_cast<LLAvatarJoint*>(*iter);
|
||||||
joint->updateFaceSizes(num_vertices, num_indices, pixel_area);
|
if (joint)
|
||||||
|
joint->updateFaceSizes(num_vertices, num_indices, pixel_area);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -160,7 +164,8 @@ void LLAvatarJoint::updateFaceData(LLFace *face, F32 pixel_area, BOOL damp_wind,
|
|||||||
iter != mChildren.end(); ++iter)
|
iter != mChildren.end(); ++iter)
|
||||||
{
|
{
|
||||||
LLAvatarJoint* joint = dynamic_cast<LLAvatarJoint*>(*iter);
|
LLAvatarJoint* joint = dynamic_cast<LLAvatarJoint*>(*iter);
|
||||||
joint->updateFaceData(face, pixel_area, damp_wind, terse_update);
|
if (joint)
|
||||||
|
joint->updateFaceData(face, pixel_area, damp_wind, terse_update);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -170,7 +175,8 @@ void LLAvatarJoint::updateJointGeometry()
|
|||||||
iter != mChildren.end(); ++iter)
|
iter != mChildren.end(); ++iter)
|
||||||
{
|
{
|
||||||
LLAvatarJoint* joint = dynamic_cast<LLAvatarJoint*>(*iter);
|
LLAvatarJoint* joint = dynamic_cast<LLAvatarJoint*>(*iter);
|
||||||
joint->updateJointGeometry();
|
if (joint)
|
||||||
|
joint->updateJointGeometry();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -184,6 +190,9 @@ BOOL LLAvatarJoint::updateLOD(F32 pixel_area, BOOL activate)
|
|||||||
iter != mChildren.end(); ++iter)
|
iter != mChildren.end(); ++iter)
|
||||||
{
|
{
|
||||||
LLAvatarJoint* joint = dynamic_cast<LLAvatarJoint*>(*iter);
|
LLAvatarJoint* joint = dynamic_cast<LLAvatarJoint*>(*iter);
|
||||||
|
if (!joint)
|
||||||
|
continue;
|
||||||
|
|
||||||
F32 jointLOD = joint->getLOD();
|
F32 jointLOD = joint->getLOD();
|
||||||
|
|
||||||
if (found_lod || jointLOD == DEFAULT_AVATAR_JOINT_LOD)
|
if (found_lod || jointLOD == DEFAULT_AVATAR_JOINT_LOD)
|
||||||
@@ -213,7 +222,8 @@ void LLAvatarJoint::dump()
|
|||||||
iter != mChildren.end(); ++iter)
|
iter != mChildren.end(); ++iter)
|
||||||
{
|
{
|
||||||
LLAvatarJoint* joint = dynamic_cast<LLAvatarJoint*>(*iter);
|
LLAvatarJoint* joint = dynamic_cast<LLAvatarJoint*>(*iter);
|
||||||
joint->dump();
|
if (joint)
|
||||||
|
joint->dump();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -260,7 +270,7 @@ void LLAvatarJointCollisionVolume::renderCollision()
|
|||||||
updateWorldMatrix();
|
updateWorldMatrix();
|
||||||
|
|
||||||
gGL.pushMatrix();
|
gGL.pushMatrix();
|
||||||
gGL.multMatrix( &mXform.getWorldMatrix().mMatrix[0][0] );
|
gGL.multMatrix( mXform.getWorldMatrix() );
|
||||||
|
|
||||||
gGL.diffuseColor3f( 0.f, 0.f, 1.f );
|
gGL.diffuseColor3f( 0.f, 0.f, 1.f );
|
||||||
|
|
||||||
|
|||||||
@@ -127,6 +127,16 @@ public:
|
|||||||
LLAvatarJointCollisionVolume();
|
LLAvatarJointCollisionVolume();
|
||||||
virtual ~LLAvatarJointCollisionVolume() {};
|
virtual ~LLAvatarJointCollisionVolume() {};
|
||||||
|
|
||||||
|
void* operator new(size_t size)
|
||||||
|
{
|
||||||
|
return ll_aligned_malloc_16(size);
|
||||||
|
}
|
||||||
|
|
||||||
|
void operator delete(void* ptr)
|
||||||
|
{
|
||||||
|
ll_aligned_free_16(ptr);
|
||||||
|
}
|
||||||
|
|
||||||
/*virtual*/ BOOL inheritScale() { return TRUE; }
|
/*virtual*/ BOOL inheritScale() { return TRUE; }
|
||||||
/*virtual*/ U32 render( F32 pixelArea, BOOL first_pass = TRUE, BOOL is_dummy = FALSE );
|
/*virtual*/ U32 render( F32 pixelArea, BOOL first_pass = TRUE, BOOL is_dummy = FALSE );
|
||||||
|
|
||||||
|
|||||||
@@ -83,30 +83,28 @@ LLSkinJoint::~LLSkinJoint()
|
|||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
// LLSkinJoint::setupSkinJoint()
|
// LLSkinJoint::setupSkinJoint()
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
BOOL LLSkinJoint::setupSkinJoint( LLAvatarJoint *joint)
|
void LLSkinJoint::setupSkinJoint( LLJoint *joint)
|
||||||
{
|
{
|
||||||
|
mRootToJointSkinOffset.clearVec();
|
||||||
|
mRootToParentJointSkinOffset.clearVec();
|
||||||
|
|
||||||
// find the named joint
|
// find the named joint
|
||||||
mJoint = joint;
|
if (!(mJoint = joint))
|
||||||
if ( !mJoint )
|
|
||||||
{
|
{
|
||||||
llinfos << "Can't find joint" << llendl;
|
llinfos << "Can't find joint" << llendl;
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
// compute the inverse root skin matrix
|
// compute the inverse root skin matrix
|
||||||
mRootToJointSkinOffset.clearVec();
|
do
|
||||||
|
|
||||||
LLVector3 rootSkinOffset;
|
|
||||||
while (joint)
|
|
||||||
{
|
{
|
||||||
rootSkinOffset += joint->getSkinOffset();
|
mRootToJointSkinOffset -= joint->getSkinOffset();
|
||||||
joint = (LLAvatarJoint*)joint->getParent();
|
} while (joint = joint->getParent());
|
||||||
}
|
|
||||||
|
|
||||||
mRootToJointSkinOffset = -rootSkinOffset;
|
|
||||||
mRootToParentJointSkinOffset = mRootToJointSkinOffset;
|
mRootToParentJointSkinOffset = mRootToJointSkinOffset;
|
||||||
mRootToParentJointSkinOffset += mJoint->getSkinOffset();
|
mRootToParentJointSkinOffset += mJoint->getSkinOffset();
|
||||||
|
|
||||||
return TRUE;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -307,15 +305,14 @@ void LLAvatarJointMesh::setMesh( LLPolyMesh *mesh )
|
|||||||
for (jn = 0; jn < numJointNames; jn++)
|
for (jn = 0; jn < numJointNames; jn++)
|
||||||
{
|
{
|
||||||
//llinfos << "Setting up joint " << jointNames[jn] << llendl;
|
//llinfos << "Setting up joint " << jointNames[jn] << llendl;
|
||||||
LLAvatarJoint* joint = (LLAvatarJoint*)(getRoot()->findJoint(jointNames[jn]) );
|
mSkinJoints[jn].setupSkinJoint( getRoot()->findJoint(jointNames[jn]) );
|
||||||
mSkinJoints[jn].setupSkinJoint( joint );
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// setup joint array
|
// setup joint array
|
||||||
if (!mMesh->isLOD())
|
if (!mMesh->isLOD())
|
||||||
{
|
{
|
||||||
setupJoint((LLAvatarJoint*)getRoot());
|
setupJoint(getRoot());
|
||||||
}
|
}
|
||||||
|
|
||||||
// llinfos << "joint render entries: " << mMesh->mJointRenderData.count() << llendl;
|
// llinfos << "joint render entries: " << mMesh->mJointRenderData.count() << llendl;
|
||||||
@@ -324,7 +321,7 @@ void LLAvatarJointMesh::setMesh( LLPolyMesh *mesh )
|
|||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
// setupJoint()
|
// setupJoint()
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
void LLAvatarJointMesh::setupJoint(LLAvatarJoint* current_joint)
|
void LLAvatarJointMesh::setupJoint(LLJoint* current_joint)
|
||||||
{
|
{
|
||||||
// llinfos << "Mesh: " << getName() << llendl;
|
// llinfos << "Mesh: " << getName() << llendl;
|
||||||
|
|
||||||
@@ -345,7 +342,7 @@ void LLAvatarJointMesh::setupJoint(LLAvatarJoint* current_joint)
|
|||||||
if(mMesh->mJointRenderData.count() && mMesh->mJointRenderData[mMesh->mJointRenderData.count() - 1]->mWorldMatrix == ¤t_joint->getParent()->getWorldMatrix())
|
if(mMesh->mJointRenderData.count() && mMesh->mJointRenderData[mMesh->mJointRenderData.count() - 1]->mWorldMatrix == ¤t_joint->getParent()->getWorldMatrix())
|
||||||
{
|
{
|
||||||
// ...then just add ourselves
|
// ...then just add ourselves
|
||||||
LLAvatarJoint* jointp = js.mJoint;
|
LLJoint* jointp = js.mJoint;
|
||||||
mMesh->mJointRenderData.put(new LLJointRenderData(&jointp->getWorldMatrix(), &js));
|
mMesh->mJointRenderData.put(new LLJointRenderData(&jointp->getWorldMatrix(), &js));
|
||||||
// llinfos << "joint " << joint_count << js.mJoint->getName() << llendl;
|
// llinfos << "joint " << joint_count << js.mJoint->getName() << llendl;
|
||||||
// joint_count++;
|
// joint_count++;
|
||||||
@@ -366,8 +363,9 @@ void LLAvatarJointMesh::setupJoint(LLAvatarJoint* current_joint)
|
|||||||
for (LLJoint::child_list_t::iterator iter = current_joint->mChildren.begin();
|
for (LLJoint::child_list_t::iterator iter = current_joint->mChildren.begin();
|
||||||
iter != current_joint->mChildren.end(); ++iter)
|
iter != current_joint->mChildren.end(); ++iter)
|
||||||
{
|
{
|
||||||
LLAvatarJoint* child_joint = (LLAvatarJoint*)(*iter);
|
LLAvatarJoint* child_joint = dynamic_cast<LLAvatarJoint*>(*iter);
|
||||||
setupJoint(child_joint);
|
if(child_joint)
|
||||||
|
setupJoint(child_joint);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -49,9 +49,9 @@ class LLSkinJoint
|
|||||||
public:
|
public:
|
||||||
LLSkinJoint();
|
LLSkinJoint();
|
||||||
~LLSkinJoint();
|
~LLSkinJoint();
|
||||||
BOOL setupSkinJoint( LLAvatarJoint *joint);
|
void setupSkinJoint( LLJoint *joint);
|
||||||
|
|
||||||
LLAvatarJoint *mJoint;
|
LLJoint* mJoint;
|
||||||
LLVector3 mRootToJointSkinOffset;
|
LLVector3 mRootToJointSkinOffset;
|
||||||
LLVector3 mRootToParentJointSkinOffset;
|
LLVector3 mRootToParentJointSkinOffset;
|
||||||
};
|
};
|
||||||
@@ -122,7 +122,7 @@ public:
|
|||||||
void setMesh( LLPolyMesh *mesh );
|
void setMesh( LLPolyMesh *mesh );
|
||||||
|
|
||||||
// Sets up joint matrix data for rendering
|
// Sets up joint matrix data for rendering
|
||||||
void setupJoint(LLAvatarJoint* current_joint);
|
void setupJoint(LLJoint* current_joint);
|
||||||
|
|
||||||
// Sets ID for picking
|
// Sets ID for picking
|
||||||
void setMeshID( S32 id ) {mMeshID = id;}
|
void setMeshID( S32 id ) {mMeshID = id;}
|
||||||
|
|||||||
@@ -231,9 +231,9 @@ BOOL LLPolyMeshSharedData::allocateVertexData( U32 numVertices )
|
|||||||
mBaseCoords = (LLVector4a*) ll_aligned_malloc_16(numVertices*sizeof(LLVector4a));
|
mBaseCoords = (LLVector4a*) ll_aligned_malloc_16(numVertices*sizeof(LLVector4a));
|
||||||
mBaseNormals = (LLVector4a*) ll_aligned_malloc_16(numVertices*sizeof(LLVector4a));
|
mBaseNormals = (LLVector4a*) ll_aligned_malloc_16(numVertices*sizeof(LLVector4a));
|
||||||
mBaseBinormals = (LLVector4a*) ll_aligned_malloc_16(numVertices*sizeof(LLVector4a));
|
mBaseBinormals = (LLVector4a*) ll_aligned_malloc_16(numVertices*sizeof(LLVector4a));
|
||||||
mTexCoords = (LLVector2*) ll_aligned_malloc_16(numVertices*sizeof(LLVector2));
|
mTexCoords = (LLVector2*) ll_aligned_malloc_16((numVertices+numVertices%2)*sizeof(LLVector2));
|
||||||
mDetailTexCoords = (LLVector2*) ll_aligned_malloc_16(numVertices*sizeof(LLVector2));
|
mDetailTexCoords = (LLVector2*) ll_aligned_malloc_16((numVertices+numVertices%2)*sizeof(LLVector2));
|
||||||
mWeights = (F32*) ll_aligned_malloc_16(numVertices*sizeof(F32));
|
mWeights = (F32*) ll_aligned_malloc_16(((numVertices)*sizeof(F32)+0xF) & ~0xF);
|
||||||
for (i = 0; i < numVertices; i++)
|
for (i = 0; i < numVertices; i++)
|
||||||
{
|
{
|
||||||
mBaseCoords[i].clear();
|
mBaseCoords[i].clear();
|
||||||
|
|||||||
@@ -146,10 +146,10 @@ public:
|
|||||||
class LLJointRenderData
|
class LLJointRenderData
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
LLJointRenderData(const LLMatrix4* world_matrix, LLSkinJoint* skin_joint) : mWorldMatrix(world_matrix), mSkinJoint(skin_joint) {}
|
LLJointRenderData(const LLMatrix4a* world_matrix, LLSkinJoint* skin_joint) : mWorldMatrix(world_matrix), mSkinJoint(skin_joint) {}
|
||||||
~LLJointRenderData(){}
|
~LLJointRenderData(){}
|
||||||
|
|
||||||
const LLMatrix4* mWorldMatrix;
|
const LLMatrix4a* mWorldMatrix;
|
||||||
LLSkinJoint* mSkinJoint;
|
LLSkinJoint* mSkinJoint;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -647,11 +647,11 @@ BOOL LLPolyMorphTarget::setInfo(LLPolyMorphTargetInfo* info)
|
|||||||
for (iter = getInfo()->mVolumeInfoList.begin(); iter != getInfo()->mVolumeInfoList.end(); iter++)
|
for (iter = getInfo()->mVolumeInfoList.begin(); iter != getInfo()->mVolumeInfoList.end(); iter++)
|
||||||
{
|
{
|
||||||
LLPolyVolumeMorphInfo *volume_info = &(*iter);
|
LLPolyVolumeMorphInfo *volume_info = &(*iter);
|
||||||
for (S32 i = 0; i < avatarp->mNumCollisionVolumes; i++)
|
for (S32 i = 0; i < (S32)avatarp->mCollisionVolumes.size(); i++)
|
||||||
{
|
{
|
||||||
if (avatarp->mCollisionVolumes[i].getName() == volume_info->mName)
|
if (avatarp->mCollisionVolumes[i]->getName() == volume_info->mName)
|
||||||
{
|
{
|
||||||
mVolumeMorphs.push_back(LLPolyVolumeMorph(&avatarp->mCollisionVolumes[i],
|
mVolumeMorphs.push_back(LLPolyVolumeMorph(avatarp->mCollisionVolumes[i],
|
||||||
volume_info->mScale,
|
volume_info->mScale,
|
||||||
volume_info->mPos));
|
volume_info->mPos));
|
||||||
break;
|
break;
|
||||||
|
|||||||
@@ -163,6 +163,16 @@ public:
|
|||||||
LLPolyMorphTarget(LLPolyMesh *poly_mesh);
|
LLPolyMorphTarget(LLPolyMesh *poly_mesh);
|
||||||
~LLPolyMorphTarget();
|
~LLPolyMorphTarget();
|
||||||
|
|
||||||
|
void* operator new(size_t size)
|
||||||
|
{
|
||||||
|
return ll_aligned_malloc_16(size);
|
||||||
|
}
|
||||||
|
|
||||||
|
void operator delete(void* ptr)
|
||||||
|
{
|
||||||
|
ll_aligned_free_16(ptr);
|
||||||
|
}
|
||||||
|
|
||||||
// Special: These functions are overridden by child classes
|
// Special: These functions are overridden by child classes
|
||||||
LLPolyMorphTargetInfo* getInfo() const { return (LLPolyMorphTargetInfo*)mInfo; }
|
LLPolyMorphTargetInfo* getInfo() const { return (LLPolyMorphTargetInfo*)mInfo; }
|
||||||
// This sets mInfo and calls initialization functions
|
// This sets mInfo and calls initialization functions
|
||||||
|
|||||||
@@ -154,13 +154,13 @@ BOOL LLPolySkeletalDistortion::setInfo(LLPolySkeletalDistortionInfo *info)
|
|||||||
for (LLJoint::child_list_t::iterator iter = joint->mChildren.begin();
|
for (LLJoint::child_list_t::iterator iter = joint->mChildren.begin();
|
||||||
iter != joint->mChildren.end(); ++iter)
|
iter != joint->mChildren.end(); ++iter)
|
||||||
{
|
{
|
||||||
LLAvatarJoint* child_joint = (LLAvatarJoint*)(*iter);
|
LLAvatarJoint* child_joint = dynamic_cast<LLAvatarJoint*>(*iter);
|
||||||
if (child_joint->inheritScale())
|
if (child_joint && child_joint->inheritScale())
|
||||||
{
|
{
|
||||||
LLVector3 childDeformation = LLVector3(child_joint->getScale());
|
LLVector3 childDeformation = LLVector3(child_joint->getScale());
|
||||||
childDeformation.scaleVec(bone_info->mScaleDeformation);
|
childDeformation.scaleVec(bone_info->mScaleDeformation);
|
||||||
mJointScales[child_joint] = childDeformation;
|
mJointScales[child_joint] = childDeformation;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (bone_info->mHasPositionDeformation)
|
if (bone_info->mHasPositionDeformation)
|
||||||
|
|||||||
@@ -68,6 +68,15 @@ class LLPolySkeletalDistortionInfo : public LLViewerVisualParamInfo
|
|||||||
{
|
{
|
||||||
friend class LLPolySkeletalDistortion;
|
friend class LLPolySkeletalDistortion;
|
||||||
public:
|
public:
|
||||||
|
void* operator new(size_t size)
|
||||||
|
{
|
||||||
|
return ll_aligned_malloc_16(size);
|
||||||
|
}
|
||||||
|
|
||||||
|
void operator delete(void* ptr)
|
||||||
|
{
|
||||||
|
ll_aligned_free_16(ptr);
|
||||||
|
}
|
||||||
|
|
||||||
LLPolySkeletalDistortionInfo();
|
LLPolySkeletalDistortionInfo();
|
||||||
/*virtual*/ ~LLPolySkeletalDistortionInfo() {};
|
/*virtual*/ ~LLPolySkeletalDistortionInfo() {};
|
||||||
@@ -77,12 +86,12 @@ public:
|
|||||||
protected:
|
protected:
|
||||||
typedef std::vector<LLPolySkeletalBoneInfo> bone_info_list_t;
|
typedef std::vector<LLPolySkeletalBoneInfo> bone_info_list_t;
|
||||||
bone_info_list_t mBoneInfoList;
|
bone_info_list_t mBoneInfoList;
|
||||||
};
|
} LL_ALIGN_POSTFIX(16);
|
||||||
|
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
// LLPolySkeletalDeformation
|
// LLPolySkeletalDeformation
|
||||||
// A set of joint scale data for deforming the avatar mesh
|
// A set of joint scale data for deforming the avatar mesh
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
|
LL_ALIGN_PREFIX(16)
|
||||||
class LLPolySkeletalDistortion : public LLViewerVisualParam
|
class LLPolySkeletalDistortion : public LLViewerVisualParam
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
|
|||||||
@@ -5,25 +5,21 @@ project(llaudio)
|
|||||||
include(00-Common)
|
include(00-Common)
|
||||||
include(Audio)
|
include(Audio)
|
||||||
include(LLAudio)
|
include(LLAudio)
|
||||||
|
if (FMODSTUDIO)
|
||||||
|
include(FMODSTUDIO)
|
||||||
|
endif (FMODSTUDIO)
|
||||||
if (FMODEX)
|
if (FMODEX)
|
||||||
include(FMODEX)
|
include(FMODEX)
|
||||||
set(FMOD OFF)
|
|
||||||
endif (FMODEX)
|
endif (FMODEX)
|
||||||
if (NOT FMODEX)
|
|
||||||
include(FMOD)
|
|
||||||
endif (NOT FMODEX)
|
|
||||||
include(OPENAL)
|
include(OPENAL)
|
||||||
include(LLCommon)
|
include(LLCommon)
|
||||||
include(LLMath)
|
include(LLMath)
|
||||||
include(LLMessage)
|
include(LLMessage)
|
||||||
include(LLVFS)
|
include(LLVFS)
|
||||||
|
|
||||||
if (FMODEX)
|
if (FMOD)
|
||||||
include_directories(${FMODEX_INCLUDE_DIR})
|
|
||||||
endif(FMODEX)
|
|
||||||
if(FMOD)
|
|
||||||
include_directories(${FMOD_INCLUDE_DIR})
|
include_directories(${FMOD_INCLUDE_DIR})
|
||||||
endif (FMOD)
|
endif(FMOD)
|
||||||
|
|
||||||
include_directories(
|
include_directories(
|
||||||
${LLAUDIO_INCLUDE_DIRS}
|
${LLAUDIO_INCLUDE_DIRS}
|
||||||
@@ -58,6 +54,20 @@ set(llaudio_HEADER_FILES
|
|||||||
llwindgen.h
|
llwindgen.h
|
||||||
)
|
)
|
||||||
|
|
||||||
|
if (FMODSTUDIO)
|
||||||
|
list(APPEND llaudio_SOURCE_FILES
|
||||||
|
llaudioengine_fmodstudio.cpp
|
||||||
|
lllistener_fmodstudio.cpp
|
||||||
|
llstreamingaudio_fmodstudio.cpp
|
||||||
|
)
|
||||||
|
|
||||||
|
list(APPEND llaudio_HEADER_FILES
|
||||||
|
llaudioengine_fmodstudio.h
|
||||||
|
lllistener_fmodstudio.h
|
||||||
|
llstreamingaudio_fmodstudio.h
|
||||||
|
)
|
||||||
|
endif (FMODSTUDIO)
|
||||||
|
|
||||||
if (FMODEX)
|
if (FMODEX)
|
||||||
list(APPEND llaudio_SOURCE_FILES
|
list(APPEND llaudio_SOURCE_FILES
|
||||||
llaudioengine_fmodex.cpp
|
llaudioengine_fmodex.cpp
|
||||||
@@ -71,26 +81,6 @@ if (FMODEX)
|
|||||||
llstreamingaudio_fmodex.h
|
llstreamingaudio_fmodex.h
|
||||||
)
|
)
|
||||||
endif (FMODEX)
|
endif (FMODEX)
|
||||||
if (FMOD)
|
|
||||||
list(APPEND llaudio_SOURCE_FILES
|
|
||||||
llaudioengine_fmod.cpp
|
|
||||||
lllistener_fmod.cpp
|
|
||||||
llstreamingaudio_fmod.cpp
|
|
||||||
)
|
|
||||||
|
|
||||||
list(APPEND llaudio_HEADER_FILES
|
|
||||||
llaudioengine_fmod.h
|
|
||||||
lllistener_fmod.h
|
|
||||||
llstreamingaudio_fmod.h
|
|
||||||
)
|
|
||||||
|
|
||||||
if (LINUX)
|
|
||||||
if (${CXX_VERSION} MATCHES "4.[23]")
|
|
||||||
set_source_files_properties(llaudioengine_fmod.cpp
|
|
||||||
COMPILE_FLAGS -Wno-error=write-strings)
|
|
||||||
endif (${CXX_VERSION} MATCHES "4.[23]")
|
|
||||||
endif (LINUX)
|
|
||||||
endif (FMOD)
|
|
||||||
|
|
||||||
if (OPENAL)
|
if (OPENAL)
|
||||||
list(APPEND llaudio_SOURCE_FILES
|
list(APPEND llaudio_SOURCE_FILES
|
||||||
|
|||||||
@@ -24,7 +24,7 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef LL_LLAUDIODECODEMGR_H
|
#ifndef LL_LLAUDIODECODEMGR_H
|
||||||
#define LL_LLAUDIODECODEMG_H
|
#define LL_LLAUDIODECODEMGR_H
|
||||||
|
|
||||||
#include "stdtypes.h"
|
#include "stdtypes.h"
|
||||||
|
|
||||||
|
|||||||
@@ -174,6 +174,9 @@ void LLAudioEngine::shutdown()
|
|||||||
delete mBuffers[i];
|
delete mBuffers[i];
|
||||||
mBuffers[i] = NULL;
|
mBuffers[i] = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
delete mStreamingAudioImpl;
|
||||||
|
mStreamingAudioImpl = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -1,789 +0,0 @@
|
|||||||
/**
|
|
||||||
* @file audioengine_fmod.cpp
|
|
||||||
* @brief Implementation of LLAudioEngine class abstracting the audio support as a FMOD 3D implementation
|
|
||||||
*
|
|
||||||
* $LicenseInfo:firstyear=2002&license=viewerlgpl$
|
|
||||||
* Second Life Viewer Source Code
|
|
||||||
* Copyright (C) 2010, Linden Research, Inc.
|
|
||||||
*
|
|
||||||
* This library is free software; you can redistribute it and/or
|
|
||||||
* modify it under the terms of the GNU Lesser General Public
|
|
||||||
* License as published by the Free Software Foundation;
|
|
||||||
* version 2.1 of the License only.
|
|
||||||
*
|
|
||||||
* This library is distributed in the hope that it will be useful,
|
|
||||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
||||||
* Lesser General Public License for more details.
|
|
||||||
*
|
|
||||||
* You should have received a copy of the GNU Lesser General Public
|
|
||||||
* License along with this library; if not, write to the Free Software
|
|
||||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
|
||||||
*
|
|
||||||
* Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA
|
|
||||||
* $/LicenseInfo$
|
|
||||||
*/
|
|
||||||
|
|
||||||
#include "linden_common.h"
|
|
||||||
|
|
||||||
#include "llstreamingaudio.h"
|
|
||||||
#include "llstreamingaudio_fmod.h"
|
|
||||||
|
|
||||||
#include "llaudioengine_fmod.h"
|
|
||||||
#include "lllistener_fmod.h"
|
|
||||||
|
|
||||||
#include "llerror.h"
|
|
||||||
#include "llmath.h"
|
|
||||||
#include "llrand.h"
|
|
||||||
|
|
||||||
#include "fmod.h"
|
|
||||||
#include "fmod_errors.h"
|
|
||||||
#include "lldir.h"
|
|
||||||
#include "llapr.h"
|
|
||||||
|
|
||||||
#include "sound_ids.h"
|
|
||||||
|
|
||||||
|
|
||||||
extern "C" {
|
|
||||||
void * F_CALLBACKAPI windCallback(void *originalbuffer, void *newbuffer, int length, void* userdata);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
LLAudioEngine_FMOD::LLAudioEngine_FMOD()
|
|
||||||
{
|
|
||||||
mInited = false;
|
|
||||||
mWindGen = NULL;
|
|
||||||
mWindDSP = NULL;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
LLAudioEngine_FMOD::~LLAudioEngine_FMOD()
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
bool LLAudioEngine_FMOD::init(const S32 num_channels, void* userdata)
|
|
||||||
{
|
|
||||||
LLAudioEngine::init(num_channels, userdata);
|
|
||||||
|
|
||||||
// Reserve one extra channel for the http stream.
|
|
||||||
if (!FSOUND_SetMinHardwareChannels(num_channels + 1))
|
|
||||||
{
|
|
||||||
LL_WARNS("AppInit") << "FMOD::init[0](), error: " << FMOD_ErrorString(FSOUND_GetError()) << LL_ENDL;
|
|
||||||
}
|
|
||||||
|
|
||||||
LL_DEBUGS("AppInit") << "LLAudioEngine_FMOD::init() initializing FMOD" << LL_ENDL;
|
|
||||||
|
|
||||||
F32 version = FSOUND_GetVersion();
|
|
||||||
if (version < FMOD_VERSION)
|
|
||||||
{
|
|
||||||
LL_WARNS("AppInit") << "Error : You are using the wrong FMOD version (" << version
|
|
||||||
<< ")! You should be using FMOD " << FMOD_VERSION << LL_ENDL;
|
|
||||||
//return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
U32 fmod_flags = 0x0;
|
|
||||||
|
|
||||||
#if LL_WINDOWS
|
|
||||||
// Windows needs to know which window is frontmost.
|
|
||||||
// This must be called before FSOUND_Init() per the FMOD docs.
|
|
||||||
// This could be used to let FMOD handle muting when we lose focus,
|
|
||||||
// but we don't actually want to do that because we want to distinguish
|
|
||||||
// between minimized and not-focused states.
|
|
||||||
if (!FSOUND_SetHWND(userdata))
|
|
||||||
{
|
|
||||||
LL_WARNS("AppInit") << "Error setting FMOD window: "
|
|
||||||
<< FMOD_ErrorString(FSOUND_GetError()) << LL_ENDL;
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
// Play audio when we don't have focus.
|
|
||||||
// (For example, IM client on top of us.)
|
|
||||||
// This means we also try to play audio when minimized,
|
|
||||||
// so we manually handle muting in that case. JC
|
|
||||||
fmod_flags |= FSOUND_INIT_GLOBALFOCUS;
|
|
||||||
fmod_flags |= FSOUND_INIT_DSOUND_HRTF_FULL;
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#if LL_LINUX
|
|
||||||
// initialize the FMOD engine
|
|
||||||
|
|
||||||
// This is a hack to use only FMOD's basic FPU mixer
|
|
||||||
// when the LL_VALGRIND environmental variable is set,
|
|
||||||
// otherwise valgrind will fall over on FMOD's MMX detection
|
|
||||||
if (getenv("LL_VALGRIND")) /*Flawfinder: ignore*/
|
|
||||||
{
|
|
||||||
LL_INFOS("AppInit") << "Pacifying valgrind in FMOD init." << LL_ENDL;
|
|
||||||
FSOUND_SetMixer(FSOUND_MIXER_QUALITY_FPU);
|
|
||||||
}
|
|
||||||
|
|
||||||
// If we don't set an output method, Linux FMOD always
|
|
||||||
// decides on OSS and fails otherwise. So we'll manually
|
|
||||||
// try ESD, then OSS, then ALSA.
|
|
||||||
// Why this order? See SL-13250, but in short, OSS emulated
|
|
||||||
// on top of ALSA is ironically more reliable than raw ALSA.
|
|
||||||
// Ack, and ESD has more reliable failure modes - but has worse
|
|
||||||
// latency - than all of them, so wins for now.
|
|
||||||
bool audio_ok = false;
|
|
||||||
|
|
||||||
if (!audio_ok)
|
|
||||||
{
|
|
||||||
if (NULL == getenv("LL_BAD_FMOD_ESD")) /*Flawfinder: ignore*/
|
|
||||||
{
|
|
||||||
LL_DEBUGS("AppInit") << "Trying ESD audio output..." << LL_ENDL;
|
|
||||||
if(FSOUND_SetOutput(FSOUND_OUTPUT_ESD) &&
|
|
||||||
FSOUND_Init(44100, num_channels, fmod_flags))
|
|
||||||
{
|
|
||||||
LL_DEBUGS("AppInit") << "ESD audio output initialized OKAY"
|
|
||||||
<< LL_ENDL;
|
|
||||||
audio_ok = true;
|
|
||||||
} else {
|
|
||||||
LL_WARNS("AppInit") << "ESD audio output FAILED to initialize: "
|
|
||||||
<< FMOD_ErrorString(FSOUND_GetError()) << LL_ENDL;
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
LL_DEBUGS("AppInit") << "ESD audio output SKIPPED" << LL_ENDL;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if (!audio_ok)
|
|
||||||
{
|
|
||||||
if (NULL == getenv("LL_BAD_FMOD_OSS")) /*Flawfinder: ignore*/
|
|
||||||
{
|
|
||||||
LL_DEBUGS("AppInit") << "Trying OSS audio output..." << LL_ENDL;
|
|
||||||
if(FSOUND_SetOutput(FSOUND_OUTPUT_OSS) &&
|
|
||||||
FSOUND_Init(44100, num_channels, fmod_flags))
|
|
||||||
{
|
|
||||||
LL_DEBUGS("AppInit") << "OSS audio output initialized OKAY" << LL_ENDL;
|
|
||||||
audio_ok = true;
|
|
||||||
} else {
|
|
||||||
LL_WARNS("AppInit") << "OSS audio output FAILED to initialize: "
|
|
||||||
<< FMOD_ErrorString(FSOUND_GetError()) << LL_ENDL;
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
LL_DEBUGS("AppInit") << "OSS audio output SKIPPED" << LL_ENDL;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if (!audio_ok)
|
|
||||||
{
|
|
||||||
if (NULL == getenv("LL_BAD_FMOD_ALSA")) /*Flawfinder: ignore*/
|
|
||||||
{
|
|
||||||
LL_DEBUGS("AppInit") << "Trying ALSA audio output..." << LL_ENDL;
|
|
||||||
if(FSOUND_SetOutput(FSOUND_OUTPUT_ALSA) &&
|
|
||||||
FSOUND_Init(44100, num_channels, fmod_flags))
|
|
||||||
{
|
|
||||||
LL_DEBUGS("AppInit") << "ALSA audio output initialized OKAY" << LL_ENDL;
|
|
||||||
audio_ok = true;
|
|
||||||
} else {
|
|
||||||
LL_WARNS("AppInit") << "ALSA audio output FAILED to initialize: "
|
|
||||||
<< FMOD_ErrorString(FSOUND_GetError()) << LL_ENDL;
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
LL_DEBUGS("AppInit") << "OSS audio output SKIPPED" << LL_ENDL;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if (!audio_ok)
|
|
||||||
{
|
|
||||||
LL_WARNS("AppInit") << "Overall audio init failure." << LL_ENDL;
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
// On Linux, FMOD causes a SIGPIPE for some netstream error
|
|
||||||
// conditions (an FMOD bug); ignore SIGPIPE so it doesn't crash us.
|
|
||||||
// NOW FIXED in FMOD 3.x since 2006-10-01.
|
|
||||||
//signal(SIGPIPE, SIG_IGN);
|
|
||||||
|
|
||||||
// We're interested in logging which output method we
|
|
||||||
// ended up with, for QA purposes.
|
|
||||||
switch (FSOUND_GetOutput())
|
|
||||||
{
|
|
||||||
case FSOUND_OUTPUT_NOSOUND: LL_DEBUGS("AppInit") << "Audio output: NoSound" << LL_ENDL; break;
|
|
||||||
case FSOUND_OUTPUT_OSS: LL_DEBUGS("AppInit") << "Audio output: OSS" << LL_ENDL; break;
|
|
||||||
case FSOUND_OUTPUT_ESD: LL_DEBUGS("AppInit") << "Audio output: ESD" << LL_ENDL; break;
|
|
||||||
case FSOUND_OUTPUT_ALSA: LL_DEBUGS("AppInit") << "Audio output: ALSA" << LL_ENDL; break;
|
|
||||||
default: LL_INFOS("AppInit") << "Audio output: Unknown!" << LL_ENDL; break;
|
|
||||||
};
|
|
||||||
|
|
||||||
#else // LL_LINUX
|
|
||||||
|
|
||||||
// initialize the FMOD engine
|
|
||||||
if (!FSOUND_Init(44100, num_channels, fmod_flags))
|
|
||||||
{
|
|
||||||
LL_WARNS("AppInit") << "Error initializing FMOD: "
|
|
||||||
<< FMOD_ErrorString(FSOUND_GetError()) << LL_ENDL;
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
#endif
|
|
||||||
|
|
||||||
// set up our favourite FMOD-native streaming audio implementation if none has already been added
|
|
||||||
if (!getStreamingAudioImpl()) // no existing implementation added
|
|
||||||
setStreamingAudioImpl(new LLStreamingAudio_FMOD());
|
|
||||||
|
|
||||||
LL_DEBUGS("AppInit") << "LLAudioEngine_FMOD::init() FMOD initialized correctly" << LL_ENDL;
|
|
||||||
|
|
||||||
mInited = true;
|
|
||||||
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
std::string LLAudioEngine_FMOD::getDriverName(bool verbose)
|
|
||||||
{
|
|
||||||
if (verbose)
|
|
||||||
{
|
|
||||||
F32 version = FSOUND_GetVersion();
|
|
||||||
return llformat("FMOD version %f", version);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
return "FMOD";
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
void LLAudioEngine_FMOD::allocateListener(void)
|
|
||||||
{
|
|
||||||
mListenerp = (LLListener *) new LLListener_FMOD();
|
|
||||||
if (!mListenerp)
|
|
||||||
{
|
|
||||||
llwarns << "Listener creation failed" << llendl;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
void LLAudioEngine_FMOD::shutdown()
|
|
||||||
{
|
|
||||||
if (mWindDSP)
|
|
||||||
{
|
|
||||||
FSOUND_DSP_SetActive(mWindDSP,false);
|
|
||||||
FSOUND_DSP_Free(mWindDSP);
|
|
||||||
}
|
|
||||||
|
|
||||||
stopInternetStream();
|
|
||||||
|
|
||||||
LLAudioEngine::shutdown();
|
|
||||||
|
|
||||||
llinfos << "LLAudioEngine_FMOD::shutdown() closing FMOD" << llendl;
|
|
||||||
FSOUND_Close();
|
|
||||||
llinfos << "LLAudioEngine_FMOD::shutdown() done closing FMOD" << llendl;
|
|
||||||
|
|
||||||
delete mListenerp;
|
|
||||||
mListenerp = NULL;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
LLAudioBuffer * LLAudioEngine_FMOD::createBuffer()
|
|
||||||
{
|
|
||||||
return new LLAudioBufferFMOD();
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
LLAudioChannel * LLAudioEngine_FMOD::createChannel()
|
|
||||||
{
|
|
||||||
return new LLAudioChannelFMOD();
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
bool LLAudioEngine_FMOD::initWind()
|
|
||||||
{
|
|
||||||
if (!mWindGen)
|
|
||||||
{
|
|
||||||
bool enable;
|
|
||||||
|
|
||||||
switch (FSOUND_GetMixer())
|
|
||||||
{
|
|
||||||
case FSOUND_MIXER_MMXP5:
|
|
||||||
case FSOUND_MIXER_MMXP6:
|
|
||||||
case FSOUND_MIXER_QUALITY_MMXP5:
|
|
||||||
case FSOUND_MIXER_QUALITY_MMXP6:
|
|
||||||
enable = (typeid(MIXBUFFERFORMAT) == typeid(S16));
|
|
||||||
break;
|
|
||||||
case FSOUND_MIXER_BLENDMODE:
|
|
||||||
enable = (typeid(MIXBUFFERFORMAT) == typeid(S32));
|
|
||||||
break;
|
|
||||||
case FSOUND_MIXER_QUALITY_FPU:
|
|
||||||
enable = (typeid(MIXBUFFERFORMAT) == typeid(F32));
|
|
||||||
break;
|
|
||||||
default:
|
|
||||||
// FSOUND_GetMixer() does not return a valid mixer type on Darwin
|
|
||||||
LL_INFOS("AppInit") << "Unknown FMOD mixer type, assuming default" << LL_ENDL;
|
|
||||||
enable = true;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (enable)
|
|
||||||
{
|
|
||||||
mWindGen = new LLWindGen<MIXBUFFERFORMAT>(FSOUND_GetOutputRate());
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
LL_WARNS("AppInit") << "Incompatible FMOD mixer type, wind noise disabled" << LL_ENDL;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
mNextWindUpdate = 0.0;
|
|
||||||
|
|
||||||
if (mWindGen && !mWindDSP)
|
|
||||||
{
|
|
||||||
mWindDSP = FSOUND_DSP_Create(&windCallback, FSOUND_DSP_DEFAULTPRIORITY_CLEARUNIT + 20, mWindGen);
|
|
||||||
}
|
|
||||||
if (mWindDSP)
|
|
||||||
{
|
|
||||||
FSOUND_DSP_SetActive(mWindDSP, true);
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
void LLAudioEngine_FMOD::cleanupWind()
|
|
||||||
{
|
|
||||||
if (mWindDSP)
|
|
||||||
{
|
|
||||||
FSOUND_DSP_SetActive(mWindDSP, false);
|
|
||||||
FSOUND_DSP_Free(mWindDSP);
|
|
||||||
mWindDSP = NULL;
|
|
||||||
}
|
|
||||||
|
|
||||||
delete mWindGen;
|
|
||||||
mWindGen = NULL;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
//-----------------------------------------------------------------------
|
|
||||||
void LLAudioEngine_FMOD::updateWind(LLVector3 wind_vec, F32 camera_height_above_water)
|
|
||||||
{
|
|
||||||
LLVector3 wind_pos;
|
|
||||||
F64 pitch;
|
|
||||||
F64 center_freq;
|
|
||||||
|
|
||||||
if (!mEnableWind)
|
|
||||||
{
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (mWindUpdateTimer.checkExpirationAndReset(LL_WIND_UPDATE_INTERVAL))
|
|
||||||
{
|
|
||||||
|
|
||||||
// wind comes in as Linden coordinate (+X = forward, +Y = left, +Z = up)
|
|
||||||
// need to convert this to the conventional orientation DS3D and OpenAL use
|
|
||||||
// where +X = right, +Y = up, +Z = backwards
|
|
||||||
|
|
||||||
wind_vec.setVec(-wind_vec.mV[1], wind_vec.mV[2], -wind_vec.mV[0]);
|
|
||||||
|
|
||||||
// cerr << "Wind update" << endl;
|
|
||||||
|
|
||||||
pitch = 1.0 + mapWindVecToPitch(wind_vec);
|
|
||||||
center_freq = 80.0 * pow(pitch,2.5*(mapWindVecToGain(wind_vec)+1.0));
|
|
||||||
|
|
||||||
mWindGen->mTargetFreq = (F32)center_freq;
|
|
||||||
mWindGen->mTargetGain = (F32)mapWindVecToGain(wind_vec) * mMaxWindGain;
|
|
||||||
mWindGen->mTargetPanGainR = (F32)mapWindVecToPan(wind_vec);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/*
|
|
||||||
//-----------------------------------------------------------------------
|
|
||||||
void LLAudioEngine_FMOD::setSourceMinDistance(U16 source_num, F64 distance)
|
|
||||||
{
|
|
||||||
if (!mInited)
|
|
||||||
{
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
if (mBuffer[source_num])
|
|
||||||
{
|
|
||||||
mMinDistance[source_num] = (F32) distance;
|
|
||||||
if (!FSOUND_Sample_SetMinMaxDistance(mBuffer[source_num],mMinDistance[source_num], mMaxDistance[source_num]))
|
|
||||||
{
|
|
||||||
llwarns << "FMOD::setSourceMinDistance(" << source_num << "), error: " << FMOD_ErrorString(FSOUND_GetError()) << llendl;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
//-----------------------------------------------------------------------
|
|
||||||
void LLAudioEngine_FMOD::setSourceMaxDistance(U16 source_num, F64 distance)
|
|
||||||
{
|
|
||||||
if (!mInited)
|
|
||||||
{
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
if (mBuffer[source_num])
|
|
||||||
{
|
|
||||||
mMaxDistance[source_num] = (F32) distance;
|
|
||||||
if (!FSOUND_Sample_SetMinMaxDistance(mBuffer[source_num],mMinDistance[source_num], mMaxDistance[source_num]))
|
|
||||||
{
|
|
||||||
llwarns << "FMOD::setSourceMaxDistance(" << source_num << "), error: " << FMOD_ErrorString(FSOUND_GetError()) << llendl;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
//-----------------------------------------------------------------------
|
|
||||||
void LLAudioEngine_FMOD::get3DParams(S32 source_num, S32 *volume, S32 *freq, S32 *inside, S32 *outside, LLVector3 *orient, S32 *out_volume, F32 *min_dist, F32 *max_dist)
|
|
||||||
{
|
|
||||||
*volume = 0;
|
|
||||||
*freq = 0;
|
|
||||||
*inside = 0;
|
|
||||||
*outside = 0;
|
|
||||||
*orient = LLVector3::zero;
|
|
||||||
*out_volume = 0;
|
|
||||||
*min_dist = 0.f;
|
|
||||||
*max_dist = 0.f;
|
|
||||||
}
|
|
||||||
|
|
||||||
*/
|
|
||||||
|
|
||||||
|
|
||||||
//-----------------------------------------------------------------------
|
|
||||||
void LLAudioEngine_FMOD::setInternalGain(F32 gain)
|
|
||||||
{
|
|
||||||
if (!mInited)
|
|
||||||
{
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
gain = llclamp( gain, 0.0f, 1.0f );
|
|
||||||
FSOUND_SetSFXMasterVolume( llround( 255.0f * gain ) );
|
|
||||||
|
|
||||||
LLStreamingAudioInterface *saimpl = getStreamingAudioImpl();
|
|
||||||
if ( saimpl )
|
|
||||||
{
|
|
||||||
// fmod likes its streaming audio channel gain re-asserted after
|
|
||||||
// master volume change.
|
|
||||||
saimpl->setGain(saimpl->getGain());
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
//
|
|
||||||
// LLAudioChannelFMOD implementation
|
|
||||||
//
|
|
||||||
|
|
||||||
LLAudioChannelFMOD::LLAudioChannelFMOD() : LLAudioChannel(), mChannelID(0), mLastSamplePos(0)
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
LLAudioChannelFMOD::~LLAudioChannelFMOD()
|
|
||||||
{
|
|
||||||
cleanup();
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
bool LLAudioChannelFMOD::updateBuffer()
|
|
||||||
{
|
|
||||||
if (LLAudioChannel::updateBuffer())
|
|
||||||
{
|
|
||||||
// Base class update returned true, which means that we need to actually
|
|
||||||
// set up the channel for a different buffer.
|
|
||||||
|
|
||||||
LLAudioBufferFMOD *bufferp = (LLAudioBufferFMOD *)mCurrentSourcep->getCurrentBuffer();
|
|
||||||
|
|
||||||
// Grab the FMOD sample associated with the buffer
|
|
||||||
FSOUND_SAMPLE *samplep = bufferp->getSample();
|
|
||||||
if (!samplep)
|
|
||||||
{
|
|
||||||
// This is bad, there should ALWAYS be a sample associated with a legit
|
|
||||||
// buffer.
|
|
||||||
llerrs << "No FMOD sample!" << llendl;
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
// Actually play the sound. Start it off paused so we can do all the necessary
|
|
||||||
// setup.
|
|
||||||
mChannelID = FSOUND_PlaySoundEx(FSOUND_FREE, samplep, FSOUND_DSP_GetSFXUnit(), true);
|
|
||||||
|
|
||||||
//llinfos << "Setting up channel " << std::hex << mChannelID << std::dec << llendl;
|
|
||||||
}
|
|
||||||
|
|
||||||
// If we have a source for the channel, we need to update its gain.
|
|
||||||
if (mCurrentSourcep)
|
|
||||||
{
|
|
||||||
// SJB: warnings can spam and hurt framerate, disabling
|
|
||||||
if (!FSOUND_SetVolume(mChannelID, llround(getSecondaryGain() * mCurrentSourcep->getGain() * 255.0f)))
|
|
||||||
{
|
|
||||||
// llwarns << "LLAudioChannelFMOD::updateBuffer error: " << FMOD_ErrorString(FSOUND_GetError()) << llendl;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!FSOUND_SetLoopMode(mChannelID, mCurrentSourcep->isLoop() ? FSOUND_LOOP_NORMAL : FSOUND_LOOP_OFF))
|
|
||||||
{
|
|
||||||
// llwarns << "Channel " << mChannelID << "Source ID: " << mCurrentSourcep->getID()
|
|
||||||
// << " at " << mCurrentSourcep->getPositionGlobal() << llendl;
|
|
||||||
// llwarns << "LLAudioChannelFMOD::updateBuffer error: " << FMOD_ErrorString(FSOUND_GetError()) << llendl;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
void LLAudioChannelFMOD::update3DPosition()
|
|
||||||
{
|
|
||||||
if (!mChannelID)
|
|
||||||
{
|
|
||||||
// We're not actually a live channel (i.e., we're not playing back anything)
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
LLAudioBufferFMOD *bufferp = (LLAudioBufferFMOD *)mCurrentBufferp;
|
|
||||||
if (!bufferp)
|
|
||||||
{
|
|
||||||
// We don't have a buffer associated with us (should really have been picked up
|
|
||||||
// by the above if.
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (mCurrentSourcep->isAmbient())
|
|
||||||
{
|
|
||||||
// Ambient sound, don't need to do any positional updates.
|
|
||||||
bufferp->set3DMode(false);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
// Localized sound. Update the position and velocity of the sound.
|
|
||||||
bufferp->set3DMode(true);
|
|
||||||
|
|
||||||
LLVector3 float_pos;
|
|
||||||
float_pos.setVec(mCurrentSourcep->getPositionGlobal());
|
|
||||||
if (!FSOUND_3D_SetAttributes(mChannelID, float_pos.mV, mCurrentSourcep->getVelocity().mV))
|
|
||||||
{
|
|
||||||
LL_DEBUGS("FMOD") << "LLAudioChannelFMOD::update3DPosition error: " << FMOD_ErrorString(FSOUND_GetError()) << LL_ENDL;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
void LLAudioChannelFMOD::updateLoop()
|
|
||||||
{
|
|
||||||
if (!mChannelID)
|
|
||||||
{
|
|
||||||
// May want to clear up the loop/sample counters.
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
//
|
|
||||||
// Hack: We keep track of whether we looped or not by seeing when the
|
|
||||||
// sample position looks like it's going backwards. Not reliable; may
|
|
||||||
// yield false negatives.
|
|
||||||
//
|
|
||||||
U32 cur_pos = FSOUND_GetCurrentPosition(mChannelID);
|
|
||||||
if (cur_pos < (U32)mLastSamplePos)
|
|
||||||
{
|
|
||||||
mLoopedThisFrame = true;
|
|
||||||
}
|
|
||||||
mLastSamplePos = cur_pos;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
void LLAudioChannelFMOD::cleanup()
|
|
||||||
{
|
|
||||||
LLAudioChannel::cleanup();
|
|
||||||
if (!mChannelID)
|
|
||||||
{
|
|
||||||
//llinfos << "Aborting cleanup with no channelID." << llendl;
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
//llinfos << "Cleaning up channel: " << mChannelID << llendl;
|
|
||||||
if (!FSOUND_StopSound(mChannelID))
|
|
||||||
{
|
|
||||||
LL_DEBUGS("FMOD") << "LLAudioChannelFMOD::cleanup error: " << FMOD_ErrorString(FSOUND_GetError()) << llendl;
|
|
||||||
}
|
|
||||||
|
|
||||||
mChannelID = 0;
|
|
||||||
mLastSamplePos = 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
void LLAudioChannelFMOD::play()
|
|
||||||
{
|
|
||||||
if (!mChannelID)
|
|
||||||
{
|
|
||||||
llwarns << "Playing without a channelID, aborting" << llendl;
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
if(!FSOUND_IsPaused(mChannelID))
|
|
||||||
{
|
|
||||||
FSOUND_SetPaused(mChannelID, true);
|
|
||||||
FSOUND_SetCurrentPosition(mChannelID, 0);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!FSOUND_SetPaused(mChannelID, false))
|
|
||||||
{
|
|
||||||
llwarns << "LLAudioChannelFMOD::play error: " << FMOD_ErrorString(FSOUND_GetError()) << llendl;
|
|
||||||
}
|
|
||||||
getSource()->setPlayedOnce(true);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
void LLAudioChannelFMOD::playSynced(LLAudioChannel *channelp)
|
|
||||||
{
|
|
||||||
LLAudioChannelFMOD *fmod_channelp = (LLAudioChannelFMOD*)channelp;
|
|
||||||
if (!(fmod_channelp->mChannelID && mChannelID))
|
|
||||||
{
|
|
||||||
// Don't have channels allocated to both the master and the slave
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
U32 position = FSOUND_GetCurrentPosition(fmod_channelp->mChannelID) % mCurrentBufferp->getLength();
|
|
||||||
// Try to match the position of our sync master
|
|
||||||
if (!FSOUND_SetCurrentPosition(mChannelID, position))
|
|
||||||
{
|
|
||||||
llwarns << "LLAudioChannelFMOD::playSynced unable to set current position" << llendl;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Start us playing
|
|
||||||
play();
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
bool LLAudioChannelFMOD::isPlaying()
|
|
||||||
{
|
|
||||||
if (!mChannelID)
|
|
||||||
{
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
return FSOUND_IsPlaying(mChannelID) && (!FSOUND_GetPaused(mChannelID));
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
//
|
|
||||||
// LLAudioBufferFMOD implementation
|
|
||||||
//
|
|
||||||
|
|
||||||
|
|
||||||
LLAudioBufferFMOD::LLAudioBufferFMOD() : LLAudioBuffer()
|
|
||||||
{
|
|
||||||
mSamplep = NULL;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
LLAudioBufferFMOD::~LLAudioBufferFMOD()
|
|
||||||
{
|
|
||||||
if (mSamplep)
|
|
||||||
{
|
|
||||||
// Clean up the associated FMOD sample if it exists.
|
|
||||||
FSOUND_Sample_Free(mSamplep);
|
|
||||||
mSamplep = NULL;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
bool LLAudioBufferFMOD::loadWAV(const std::string& filename)
|
|
||||||
{
|
|
||||||
// Try to open a wav file from disk. This will eventually go away, as we don't
|
|
||||||
// really want to block doing this.
|
|
||||||
if (filename.empty())
|
|
||||||
{
|
|
||||||
// invalid filename, abort.
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!LLAPRFile::isExist(filename, LL_APR_RPB))
|
|
||||||
{
|
|
||||||
// File not found, abort.
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (mSamplep)
|
|
||||||
{
|
|
||||||
// If there's already something loaded in this buffer, clean it up.
|
|
||||||
FSOUND_Sample_Free(mSamplep);
|
|
||||||
mSamplep = NULL;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Load up the wav file into an fmod sample
|
|
||||||
#if LL_WINDOWS
|
|
||||||
// MikeS. - Loading the sound file manually and then handing it over to FMOD,
|
|
||||||
// since FMOD uses posix IO internally,
|
|
||||||
// which doesn't work with unicode file paths.
|
|
||||||
LLFILE* sound_file = LLFile::fopen(filename,"rb"); /* Flawfinder: ignore */
|
|
||||||
if (sound_file)
|
|
||||||
{
|
|
||||||
fseek(sound_file,0,SEEK_END);
|
|
||||||
U32 file_length = ftell(sound_file); //Find the length of the file by seeking to the end and getting the offset
|
|
||||||
size_t read_count;
|
|
||||||
fseek(sound_file,0,SEEK_SET); //Seek back to the beginning
|
|
||||||
char* buffer = new char[file_length];
|
|
||||||
llassert(buffer);
|
|
||||||
read_count = fread((void*)buffer,file_length,1,sound_file);//Load it..
|
|
||||||
if(ferror(sound_file)==0 && (read_count == 1)){//No read error, and we got 1 chunk of our size...
|
|
||||||
unsigned int mode_flags = FSOUND_LOOP_NORMAL | FSOUND_LOADMEMORY;
|
|
||||||
//FSOUND_16BITS | FSOUND_MONO | FSOUND_LOADMEMORY | FSOUND_LOOP_NORMAL;
|
|
||||||
mSamplep = FSOUND_Sample_Load(FSOUND_UNMANAGED, buffer, mode_flags , 0, file_length);
|
|
||||||
}
|
|
||||||
delete[] buffer;
|
|
||||||
fclose(sound_file);
|
|
||||||
}
|
|
||||||
#else
|
|
||||||
mSamplep = FSOUND_Sample_Load(FSOUND_UNMANAGED, filename.c_str(), FSOUND_LOOP_NORMAL, 0, 0);
|
|
||||||
#endif
|
|
||||||
|
|
||||||
if (!mSamplep)
|
|
||||||
{
|
|
||||||
// We failed to load the file for some reason.
|
|
||||||
llwarns << "Could not load data '" << filename << "': "
|
|
||||||
<< FMOD_ErrorString(FSOUND_GetError()) << llendl;
|
|
||||||
|
|
||||||
//
|
|
||||||
// If we EVER want to load wav files provided by end users, we need
|
|
||||||
// to rethink this!
|
|
||||||
//
|
|
||||||
// file is probably corrupt - remove it.
|
|
||||||
LLFile::remove(filename);
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Everything went well, return true
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
U32 LLAudioBufferFMOD::getLength()
|
|
||||||
{
|
|
||||||
if (!mSamplep)
|
|
||||||
{
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
return FSOUND_Sample_GetLength(mSamplep);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
void LLAudioBufferFMOD::set3DMode(bool use3d)
|
|
||||||
{
|
|
||||||
U16 current_mode = FSOUND_Sample_GetMode(mSamplep);
|
|
||||||
|
|
||||||
if (use3d)
|
|
||||||
{
|
|
||||||
if (!FSOUND_Sample_SetMode(mSamplep, (current_mode & (~FSOUND_2D))))
|
|
||||||
{
|
|
||||||
llwarns << "LLAudioBufferFMOD::set3DMode error: " << FMOD_ErrorString(FSOUND_GetError()) << llendl;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
if (!FSOUND_Sample_SetMode(mSamplep, current_mode | FSOUND_2D))
|
|
||||||
{
|
|
||||||
llwarns << "LLAudioBufferFMOD::set3DMode error: " << FMOD_ErrorString(FSOUND_GetError()) << llendl;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
void * F_CALLBACKAPI windCallback(void *originalbuffer, void *newbuffer, int length, void* userdata)
|
|
||||||
{
|
|
||||||
// originalbuffer = fmod's original mixbuffer.
|
|
||||||
// newbuffer = the buffer passed from the previous DSP unit.
|
|
||||||
// length = length in samples at this mix time.
|
|
||||||
// userdata = user parameter passed through in FSOUND_DSP_Create.
|
|
||||||
|
|
||||||
LLWindGen<LLAudioEngine_FMOD::MIXBUFFERFORMAT> *windgen =
|
|
||||||
(LLWindGen<LLAudioEngine_FMOD::MIXBUFFERFORMAT> *)userdata;
|
|
||||||
|
|
||||||
newbuffer = windgen->windGenerate((LLAudioEngine_FMOD::MIXBUFFERFORMAT *)newbuffer, length);
|
|
||||||
|
|
||||||
return newbuffer;
|
|
||||||
}
|
|
||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user