makepanda.py 281 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333233423352336233723382339234023412342234323442345234623472348234923502351235223532354235523562357235823592360236123622363236423652366236723682369237023712372237323742375237623772378237923802381238223832384238523862387238823892390239123922393239423952396239723982399240024012402240324042405240624072408240924102411241224132414241524162417241824192420242124222423242424252426242724282429243024312432243324342435243624372438243924402441244224432444244524462447244824492450245124522453245424552456245724582459246024612462246324642465246624672468246924702471247224732474247524762477247824792480248124822483248424852486248724882489249024912492249324942495249624972498249925002501250225032504250525062507250825092510251125122513251425152516251725182519252025212522252325242525252625272528252925302531253225332534253525362537253825392540254125422543254425452546254725482549255025512552255325542555255625572558255925602561256225632564256525662567256825692570257125722573257425752576257725782579258025812582258325842585258625872588258925902591259225932594259525962597259825992600260126022603260426052606260726082609261026112612261326142615261626172618261926202621262226232624262526262627262826292630263126322633263426352636263726382639264026412642264326442645264626472648264926502651265226532654265526562657265826592660266126622663266426652666266726682669267026712672267326742675267626772678267926802681268226832684268526862687268826892690269126922693269426952696269726982699270027012702270327042705270627072708270927102711271227132714271527162717271827192720272127222723272427252726272727282729273027312732273327342735273627372738273927402741274227432744274527462747274827492750275127522753275427552756275727582759276027612762276327642765276627672768276927702771277227732774277527762777277827792780278127822783278427852786278727882789279027912792279327942795279627972798279928002801280228032804280528062807280828092810281128122813281428152816281728182819282028212822282328242825282628272828282928302831283228332834283528362837283828392840284128422843284428452846284728482849285028512852285328542855285628572858285928602861286228632864286528662867286828692870287128722873287428752876287728782879288028812882288328842885288628872888288928902891289228932894289528962897289828992900290129022903290429052906290729082909291029112912291329142915291629172918291929202921292229232924292529262927292829292930293129322933293429352936293729382939294029412942294329442945294629472948294929502951295229532954295529562957295829592960296129622963296429652966296729682969297029712972297329742975297629772978297929802981298229832984298529862987298829892990299129922993299429952996299729982999300030013002300330043005300630073008300930103011301230133014301530163017301830193020302130223023302430253026302730283029303030313032303330343035303630373038303930403041304230433044304530463047304830493050305130523053305430553056305730583059306030613062306330643065306630673068306930703071307230733074307530763077307830793080308130823083308430853086308730883089309030913092309330943095309630973098309931003101310231033104310531063107310831093110311131123113311431153116311731183119312031213122312331243125312631273128312931303131313231333134313531363137313831393140314131423143314431453146314731483149315031513152315331543155315631573158315931603161316231633164316531663167316831693170317131723173317431753176317731783179318031813182318331843185318631873188318931903191319231933194319531963197319831993200320132023203320432053206320732083209321032113212321332143215321632173218321932203221322232233224322532263227322832293230323132323233323432353236323732383239324032413242324332443245324632473248324932503251325232533254325532563257325832593260326132623263326432653266326732683269327032713272327332743275327632773278327932803281328232833284328532863287328832893290329132923293329432953296329732983299330033013302330333043305330633073308330933103311331233133314331533163317331833193320332133223323332433253326332733283329333033313332333333343335333633373338333933403341334233433344334533463347334833493350335133523353335433553356335733583359336033613362336333643365336633673368336933703371337233733374337533763377337833793380338133823383338433853386338733883389339033913392339333943395339633973398339934003401340234033404340534063407340834093410341134123413341434153416341734183419342034213422342334243425342634273428342934303431343234333434343534363437343834393440344134423443344434453446344734483449345034513452345334543455345634573458345934603461346234633464346534663467346834693470347134723473347434753476347734783479348034813482348334843485348634873488348934903491349234933494349534963497349834993500350135023503350435053506350735083509351035113512351335143515351635173518351935203521352235233524352535263527352835293530353135323533353435353536353735383539354035413542354335443545354635473548354935503551355235533554355535563557355835593560356135623563356435653566356735683569357035713572357335743575357635773578357935803581358235833584358535863587358835893590359135923593359435953596359735983599360036013602360336043605360636073608360936103611361236133614361536163617361836193620362136223623362436253626362736283629363036313632363336343635363636373638363936403641364236433644364536463647364836493650365136523653365436553656365736583659366036613662366336643665366636673668366936703671367236733674367536763677367836793680368136823683368436853686368736883689369036913692369336943695369636973698369937003701370237033704370537063707370837093710371137123713371437153716371737183719372037213722372337243725372637273728372937303731373237333734373537363737373837393740374137423743374437453746374737483749375037513752375337543755375637573758375937603761376237633764376537663767376837693770377137723773377437753776377737783779378037813782378337843785378637873788378937903791379237933794379537963797379837993800380138023803380438053806380738083809381038113812381338143815381638173818381938203821382238233824382538263827382838293830383138323833383438353836383738383839384038413842384338443845384638473848384938503851385238533854385538563857385838593860386138623863386438653866386738683869387038713872387338743875387638773878387938803881388238833884388538863887388838893890389138923893389438953896389738983899390039013902390339043905390639073908390939103911391239133914391539163917391839193920392139223923392439253926392739283929393039313932393339343935393639373938393939403941394239433944394539463947394839493950395139523953395439553956395739583959396039613962396339643965396639673968396939703971397239733974397539763977397839793980398139823983398439853986398739883989399039913992399339943995399639973998399940004001400240034004400540064007400840094010401140124013401440154016401740184019402040214022402340244025402640274028402940304031403240334034403540364037403840394040404140424043404440454046404740484049405040514052405340544055405640574058405940604061406240634064406540664067406840694070407140724073407440754076407740784079408040814082408340844085408640874088408940904091409240934094409540964097409840994100410141024103410441054106410741084109411041114112411341144115411641174118411941204121412241234124412541264127412841294130413141324133413441354136413741384139414041414142414341444145414641474148414941504151415241534154415541564157415841594160416141624163416441654166416741684169417041714172417341744175417641774178417941804181418241834184418541864187418841894190419141924193419441954196419741984199420042014202420342044205420642074208420942104211421242134214421542164217421842194220422142224223422442254226422742284229423042314232423342344235423642374238423942404241424242434244424542464247424842494250425142524253425442554256425742584259426042614262426342644265426642674268426942704271427242734274427542764277427842794280428142824283428442854286428742884289429042914292429342944295429642974298429943004301430243034304430543064307430843094310431143124313431443154316431743184319432043214322432343244325432643274328432943304331433243334334433543364337433843394340434143424343434443454346434743484349435043514352435343544355435643574358435943604361436243634364436543664367436843694370437143724373437443754376437743784379438043814382438343844385438643874388438943904391439243934394439543964397439843994400440144024403440444054406440744084409441044114412441344144415441644174418441944204421442244234424442544264427442844294430443144324433443444354436443744384439444044414442444344444445444644474448444944504451445244534454445544564457445844594460446144624463446444654466446744684469447044714472447344744475447644774478447944804481448244834484448544864487448844894490449144924493449444954496449744984499450045014502450345044505450645074508450945104511451245134514451545164517451845194520452145224523452445254526452745284529453045314532453345344535453645374538453945404541454245434544454545464547454845494550455145524553455445554556455745584559456045614562456345644565456645674568456945704571457245734574457545764577457845794580458145824583458445854586458745884589459045914592459345944595459645974598459946004601460246034604460546064607460846094610461146124613461446154616461746184619462046214622462346244625462646274628462946304631463246334634463546364637463846394640464146424643464446454646464746484649465046514652465346544655465646574658465946604661466246634664466546664667466846694670467146724673467446754676467746784679468046814682468346844685468646874688468946904691469246934694469546964697469846994700470147024703470447054706470747084709471047114712471347144715471647174718471947204721472247234724472547264727472847294730473147324733473447354736473747384739474047414742474347444745474647474748474947504751475247534754475547564757475847594760476147624763476447654766476747684769477047714772477347744775477647774778477947804781478247834784478547864787478847894790479147924793479447954796479747984799480048014802480348044805480648074808480948104811481248134814481548164817481848194820482148224823482448254826482748284829483048314832483348344835483648374838483948404841484248434844484548464847484848494850485148524853485448554856485748584859486048614862486348644865486648674868486948704871487248734874487548764877487848794880488148824883488448854886488748884889489048914892489348944895489648974898489949004901490249034904490549064907490849094910491149124913491449154916491749184919492049214922492349244925492649274928492949304931493249334934493549364937493849394940494149424943494449454946494749484949495049514952495349544955495649574958495949604961496249634964496549664967496849694970497149724973497449754976497749784979498049814982498349844985498649874988498949904991499249934994499549964997499849995000500150025003500450055006500750085009501050115012501350145015501650175018501950205021502250235024502550265027502850295030503150325033503450355036503750385039504050415042504350445045504650475048504950505051505250535054505550565057505850595060506150625063506450655066506750685069507050715072507350745075507650775078507950805081508250835084508550865087508850895090509150925093509450955096509750985099510051015102510351045105510651075108510951105111511251135114511551165117511851195120512151225123512451255126512751285129513051315132513351345135513651375138513951405141514251435144514551465147514851495150515151525153515451555156515751585159516051615162516351645165516651675168516951705171517251735174517551765177517851795180518151825183518451855186518751885189519051915192519351945195519651975198519952005201520252035204520552065207520852095210521152125213521452155216521752185219522052215222522352245225522652275228522952305231523252335234523552365237523852395240524152425243524452455246524752485249525052515252525352545255525652575258525952605261526252635264526552665267526852695270527152725273527452755276527752785279528052815282528352845285528652875288528952905291529252935294529552965297529852995300530153025303530453055306530753085309531053115312531353145315531653175318531953205321532253235324532553265327532853295330533153325333533453355336533753385339534053415342534353445345534653475348534953505351535253535354535553565357535853595360536153625363536453655366536753685369537053715372537353745375537653775378537953805381538253835384538553865387538853895390539153925393539453955396539753985399540054015402540354045405540654075408540954105411541254135414541554165417541854195420542154225423542454255426542754285429543054315432543354345435543654375438543954405441544254435444544554465447544854495450545154525453545454555456545754585459546054615462546354645465546654675468546954705471547254735474547554765477547854795480548154825483548454855486548754885489549054915492549354945495549654975498549955005501550255035504550555065507550855095510551155125513551455155516551755185519552055215522552355245525552655275528552955305531553255335534553555365537553855395540554155425543554455455546554755485549555055515552555355545555555655575558555955605561556255635564556555665567556855695570557155725573557455755576557755785579558055815582558355845585558655875588558955905591559255935594559555965597559855995600560156025603560456055606560756085609561056115612561356145615561656175618561956205621562256235624562556265627562856295630563156325633563456355636563756385639564056415642564356445645564656475648564956505651565256535654565556565657565856595660566156625663566456655666566756685669567056715672567356745675567656775678567956805681568256835684568556865687568856895690569156925693569456955696569756985699570057015702570357045705570657075708570957105711571257135714571557165717571857195720572157225723572457255726572757285729573057315732573357345735573657375738573957405741574257435744574557465747574857495750575157525753575457555756575757585759576057615762576357645765576657675768576957705771577257735774577557765777577857795780578157825783578457855786578757885789579057915792579357945795579657975798579958005801580258035804580558065807580858095810581158125813581458155816581758185819582058215822582358245825582658275828582958305831583258335834583558365837583858395840584158425843584458455846584758485849585058515852585358545855585658575858585958605861586258635864586558665867586858695870587158725873587458755876587758785879588058815882588358845885588658875888588958905891589258935894589558965897589858995900590159025903590459055906590759085909591059115912591359145915591659175918591959205921592259235924592559265927592859295930593159325933593459355936593759385939594059415942594359445945594659475948594959505951595259535954595559565957595859595960596159625963596459655966596759685969597059715972597359745975597659775978597959805981598259835984598559865987598859895990599159925993599459955996599759985999600060016002600360046005600660076008600960106011601260136014601560166017601860196020602160226023602460256026602760286029603060316032603360346035603660376038603960406041604260436044604560466047604860496050605160526053605460556056605760586059606060616062606360646065606660676068606960706071607260736074607560766077607860796080608160826083608460856086608760886089609060916092609360946095609660976098609961006101610261036104610561066107610861096110611161126113611461156116611761186119612061216122612361246125612661276128612961306131613261336134613561366137613861396140614161426143614461456146614761486149615061516152615361546155615661576158615961606161616261636164616561666167616861696170617161726173617461756176617761786179618061816182618361846185618661876188618961906191619261936194619561966197619861996200620162026203620462056206620762086209621062116212621362146215621662176218621962206221622262236224622562266227622862296230623162326233623462356236623762386239624062416242624362446245624662476248624962506251625262536254625562566257625862596260626162626263626462656266626762686269627062716272627362746275627662776278627962806281628262836284628562866287628862896290629162926293629462956296629762986299630063016302630363046305630663076308630963106311631263136314631563166317631863196320632163226323632463256326632763286329633063316332633363346335633663376338633963406341634263436344634563466347634863496350635163526353635463556356635763586359636063616362636363646365636663676368636963706371637263736374637563766377637863796380638163826383638463856386638763886389639063916392639363946395639663976398639964006401640264036404640564066407640864096410641164126413641464156416641764186419642064216422642364246425642664276428642964306431643264336434643564366437643864396440644164426443644464456446
  1. #!/usr/bin/env python
  2. ########################################################################
  3. #
  4. # To build panda using this script, type 'makepanda.py' on unix
  5. # or 'makepanda.bat' on windows, and examine the help-text.
  6. # Then run the script again with the appropriate options to compile
  7. # panda3d.
  8. #
  9. ########################################################################
  10. import sys
  11. if sys.version_info < (3, 6):
  12. print("This version of Python is not supported, use version 3.6 or higher.")
  13. exit(1)
  14. try:
  15. import os
  16. import time
  17. import re
  18. import getopt
  19. import threading
  20. import signal
  21. import shutil
  22. import plistlib
  23. import queue
  24. except KeyboardInterrupt:
  25. raise
  26. except:
  27. print("You are either using an incomplete or an old version of Python!")
  28. print("Please install the development package of Python and try again.")
  29. exit(1)
  30. if sys.version_info >= (3, 10):
  31. from sysconfig import get_platform
  32. else:
  33. from distutils.util import get_platform
  34. from makepandacore import *
  35. try:
  36. import zlib
  37. except:
  38. zlib = None
  39. ########################################################################
  40. ##
  41. ## PARSING THE COMMAND LINE OPTIONS
  42. ##
  43. ## You might be tempted to change the defaults by editing them
  44. ## here. Don't do it. Instead, create a script that compiles
  45. ## panda with your preferred options. Or, create
  46. ## a 'makepandaPreferences' file and put it into your python path.
  47. ##
  48. ########################################################################
  49. COMPILER=0
  50. INSTALLER=0
  51. WHEEL=0
  52. RUNTESTS=0
  53. GENMAN=0
  54. COMPRESSOR="zlib"
  55. THREADCOUNT=0
  56. CFLAGS=""
  57. CXXFLAGS=""
  58. LDFLAGS=""
  59. DISTRIBUTOR=""
  60. VERSION=None
  61. DEBVERSION=None
  62. WHLVERSION=None
  63. RPMVERSION=None
  64. RPMRELEASE="1"
  65. GIT_COMMIT=None
  66. MAJOR_VERSION=None
  67. OSX_ARCHS=[]
  68. STRDXSDKVERSION = 'default'
  69. WINDOWS_SDK = None
  70. MSVC_VERSION = None
  71. BOOUSEINTELCOMPILER = False
  72. OPENCV_VER_23 = False
  73. PLATFORM = None
  74. COPY_PYTHON = True
  75. PkgListSet(["PYTHON", "DIRECT", # Python support
  76. "GL", "GLES", "GLES2"] + DXVERSIONS + ["TINYDISPLAY", "NVIDIACG", # 3D graphics
  77. "EGL", # OpenGL (ES) integration
  78. "EIGEN", # Linear algebra acceleration
  79. "OPENAL", "FMODEX", # Audio playback
  80. "VORBIS", "OPUS", "FFMPEG", "SWSCALE", "SWRESAMPLE", # Audio decoding
  81. "ODE", "BULLET", "PANDAPHYSICS", # Physics
  82. "SPEEDTREE", # SpeedTree
  83. "ZLIB", "PNG", "JPEG", "TIFF", "OPENEXR", "SQUISH", # 2D Formats support
  84. ] + MAYAVERSIONS + MAXVERSIONS + [ "FCOLLADA", "ASSIMP", "EGG", # 3D Formats support
  85. "FREETYPE", "HARFBUZZ", # Text rendering
  86. "VRPN", "OPENSSL", # Transport
  87. "FFTW", # Algorithm helpers
  88. "ARTOOLKIT", "OPENCV", "DIRECTCAM", "VISION", # Augmented Reality
  89. "GTK3", # GTK3 is used for PStats on Unix
  90. "MFC", "WX", "FLTK", # Used for web plug-in only
  91. "COCOA", # macOS toolkits
  92. "X11", # Unix platform support
  93. "PANDATOOL", "PVIEW", "DEPLOYTOOLS", # Toolchain
  94. "SKEL", # Example SKEL project
  95. "PANDAFX", # Some distortion special lenses
  96. "PANDAPARTICLESYSTEM", # Built in particle system
  97. "CONTRIB", # Experimental
  98. "SSE2", "NEON", # Compiler features
  99. "MIMALLOC", # Memory allocators
  100. "NAVIGATION", # Detour Toolset
  101. "NAVMESHGEN", # Recast Toolset
  102. ])
  103. CheckPandaSourceTree()
  104. def keyboardInterruptHandler(x,y):
  105. exit("keyboard interrupt")
  106. signal.signal(signal.SIGINT, keyboardInterruptHandler)
  107. ########################################################################
  108. ##
  109. ## Command-line parser.
  110. ##
  111. ## You can type "makepanda --help" to see all the options.
  112. ##
  113. ########################################################################
  114. def usage(problem):
  115. if problem:
  116. print("")
  117. print("Error parsing command-line input: %s" % (problem))
  118. print("")
  119. print("Makepanda generates a 'built' subdirectory containing a")
  120. print("compiled copy of Panda3D. Command-line arguments are:")
  121. print("")
  122. print(" --help (print the help message you're reading now)")
  123. print(" --verbose (print out more information)")
  124. print(" --tests (run the test suite)")
  125. print(" --installer (build an installer)")
  126. print(" --wheel (build a pip-installable .whl)")
  127. print(" --optimize X (optimization level can be 1,2,3,4)")
  128. print(" --version X (set the panda version number)")
  129. print(" --lzma (use lzma compression when building Windows installer)")
  130. print(" --distributor X (short string identifying the distributor of the build)")
  131. print(" --outputdir X (use the specified directory instead of 'built')")
  132. print(" --threads N (use the multithreaded build system. see manual)")
  133. print(" --universal (build universal binaries (macOS 11.0+ only))")
  134. print(" --override \"O=V\" (override dtool_config/prc option value)")
  135. print(" --static (builds libraries for static linking)")
  136. print(" --target X (experimental cross-compilation (android only))")
  137. print(" --arch X (target architecture for cross-compilation)")
  138. print("")
  139. for pkg in PkgListGet():
  140. p = pkg.lower()
  141. print(" --use-%-9s --no-%-9s (enable/disable use of %s)"%(p, p, pkg))
  142. if sys.platform != 'win32':
  143. print(" --<PKG>-incdir (custom location for header files of thirdparty package)")
  144. print(" --<PKG>-libdir (custom location for library files of thirdparty package)")
  145. print("")
  146. print(" --nothing (disable every third-party lib)")
  147. print(" --everything (enable every third-party lib)")
  148. print(" --directx-sdk=X (specify version of DirectX SDK to use: jun2010, aug2009)")
  149. print(" --windows-sdk=X (specify Windows SDK version, eg. 7.1, 8.1, 10 or 11. Default is 8.1)")
  150. print(" --msvc-version=X (specify Visual C++ version, eg. 10, 11, 12, 14, 14.1, 14.2, 14.3. Default is 14)")
  151. print(" --use-icl (experimental setting to use an intel compiler instead of MSVC on Windows)")
  152. print("")
  153. print("The simplest way to compile panda is to just type:")
  154. print("")
  155. print(" makepanda --everything")
  156. print("")
  157. os._exit(1)
  158. def parseopts(args):
  159. global INSTALLER,WHEEL,RUNTESTS,GENMAN,DISTRIBUTOR,VERSION
  160. global COMPRESSOR,THREADCOUNT,OSX_ARCHS
  161. global DEBVERSION,WHLVERSION,RPMVERSION,RPMRELEASE,GIT_COMMIT
  162. global STRDXSDKVERSION, WINDOWS_SDK, MSVC_VERSION, BOOUSEINTELCOMPILER
  163. global COPY_PYTHON
  164. # Options for which to display a deprecation warning.
  165. removedopts = [
  166. "use-touchinput", "no-touchinput", "no-awesomium", "no-directscripts",
  167. "no-carbon", "no-physx", "no-rocket", "host", "osxtarget=",
  168. ]
  169. # All recognized options.
  170. longopts = [
  171. "help","distributor=","verbose","tests",
  172. "optimize=","everything","nothing","installer","wheel","rtdist","nocolor",
  173. "version=","lzma","no-python","threads=","outputdir=","override=",
  174. "static","debversion=","rpmversion=","rpmrelease=","p3dsuffix=","rtdist-version=",
  175. "directx-sdk=", "windows-sdk=", "msvc-version=", "clean", "use-icl",
  176. "universal", "target=", "arch=", "git-commit=", "no-copy-python",
  177. "cggl-incdir=", "cggl-libdir=",
  178. ] + removedopts
  179. anything = 0
  180. optimize = ""
  181. target = None
  182. target_archs = []
  183. universal = False
  184. clean_build = False
  185. for pkg in PkgListGet():
  186. longopts.append("use-" + pkg.lower())
  187. longopts.append("no-" + pkg.lower())
  188. longopts.append(pkg.lower() + "-incdir=")
  189. longopts.append(pkg.lower() + "-libdir=")
  190. try:
  191. opts, extras = getopt.getopt(args, "", longopts)
  192. for option, value in opts:
  193. if (option=="--help"): raise Exception
  194. elif (option=="--optimize"): optimize=value
  195. elif (option=="--installer"): INSTALLER=1
  196. elif (option=="--tests"): RUNTESTS=1
  197. elif (option=="--wheel"): WHEEL=1
  198. elif (option=="--verbose"): SetVerbose(True)
  199. elif (option=="--distributor"): DISTRIBUTOR=value
  200. elif (option=="--genman"): GENMAN=1
  201. elif (option=="--everything"): PkgEnableAll()
  202. elif (option=="--nothing"): PkgDisableAll()
  203. elif (option=="--threads"): THREADCOUNT=int(value)
  204. elif (option=="--outputdir"): SetOutputDir(value.strip())
  205. elif (option=="--universal"): universal = True
  206. elif (option=="--target"): target = value.strip()
  207. elif (option=="--arch"): target_archs.append(value.strip())
  208. elif (option=="--nocolor"): DisableColors()
  209. elif (option=="--version"):
  210. match = re.match(r'^\d+\.\d+(\.\d+)+', value)
  211. if not match:
  212. usage("version requires three digits")
  213. WHLVERSION = value
  214. VERSION = match.group()
  215. elif (option=="--lzma"): COMPRESSOR="lzma"
  216. elif (option=="--override"): AddOverride(value.strip())
  217. elif (option=="--static"): SetLinkAllStatic(True)
  218. elif (option=="--debversion"): DEBVERSION=value
  219. elif (option=="--rpmversion"): RPMVERSION=value
  220. elif (option=="--rpmrelease"): RPMRELEASE=value
  221. elif (option=="--git-commit"): GIT_COMMIT=value
  222. # Backward compatibility, OPENGL was renamed to GL
  223. elif (option=="--use-opengl"): PkgEnable("GL")
  224. elif (option=="--no-opengl"): PkgDisable("GL")
  225. elif (option=="--directx-sdk"):
  226. STRDXSDKVERSION = value.strip().lower()
  227. if STRDXSDKVERSION == '':
  228. print("No DirectX SDK version specified. Using 'default' DirectX SDK search")
  229. STRDXSDKVERSION = 'default'
  230. elif (option=="--windows-sdk"):
  231. WINDOWS_SDK = value.strip().lower()
  232. elif (option=="--msvc-version"):
  233. MSVC_VERSION = value.strip().lower()
  234. elif (option=="--use-icl"): BOOUSEINTELCOMPILER = True
  235. elif (option=="--clean"): clean_build = True
  236. elif (option=="--no-copy-python"): COPY_PYTHON = False
  237. elif (option[2:] in removedopts or option[2:]+'=' in removedopts):
  238. Warn("Ignoring removed option %s" % (option))
  239. else:
  240. for pkg in PkgListGet() + ['CGGL']:
  241. if option == "--use-" + pkg.lower():
  242. PkgEnable(pkg)
  243. break
  244. elif option == "--no-" + pkg.lower():
  245. PkgDisable(pkg)
  246. break
  247. elif option == "--" + pkg.lower() + "-incdir":
  248. PkgSetCustomLocation(pkg)
  249. IncDirectory(pkg, value)
  250. break
  251. elif option == "--" + pkg.lower() + "-libdir":
  252. PkgSetCustomLocation(pkg)
  253. LibDirectory(pkg, value)
  254. break
  255. if (option == "--everything" or option.startswith("--use-")
  256. or option == "--nothing" or option.startswith("--no-")):
  257. anything = 1
  258. except:
  259. usage(sys.exc_info()[1])
  260. if not anything:
  261. usage("You should specify a list of packages to use or --everything to enable all packages.")
  262. if (optimize==""): optimize = "3"
  263. if target is not None or target_archs:
  264. SetTarget(target, target_archs[-1] if target_archs else None)
  265. if universal:
  266. if target_archs:
  267. exit("--universal is incompatible with --arch")
  268. OSX_ARCHS.append("x86_64")
  269. OSX_ARCHS.append("arm64")
  270. elif target_archs:
  271. OSX_ARCHS = target_archs
  272. try:
  273. SetOptimize(int(optimize))
  274. assert GetOptimize() in [1, 2, 3, 4]
  275. except:
  276. usage("Invalid setting for OPTIMIZE")
  277. if GIT_COMMIT is not None and not re.match("^[a-f0-9]{40}$", GIT_COMMIT):
  278. usage("Invalid SHA-1 hash given for --git-commit option!")
  279. if GetTarget() == 'windows':
  280. if not MSVC_VERSION:
  281. print("No MSVC version specified. Defaulting to 14 (Visual Studio 2015).")
  282. MSVC_VERSION = (14, 0)
  283. else:
  284. try:
  285. MSVC_VERSION = tuple(int(d) for d in MSVC_VERSION.split('.'))[:2]
  286. if (len(MSVC_VERSION) == 1):
  287. MSVC_VERSION += (0,)
  288. except:
  289. usage("Invalid setting for --msvc-version")
  290. if MSVC_VERSION < (14, 0):
  291. warn_prefix = "%sERROR:%s " % (GetColor("red"), GetColor())
  292. print("=========================================================================")
  293. print(warn_prefix + "Support for MSVC versions before 2015 has been discontinued.")
  294. print(warn_prefix + "For more information, or any questions, please visit:")
  295. print(warn_prefix + " https://github.com/panda3d/panda3d/issues/288")
  296. print("=========================================================================")
  297. sys.stdout.flush()
  298. time.sleep(1.0)
  299. sys.exit(1)
  300. if clean_build and os.path.isdir(GetOutputDir()):
  301. print("Deleting %s" % (GetOutputDir()))
  302. shutil.rmtree(GetOutputDir())
  303. parseopts(sys.argv[1:])
  304. ########################################################################
  305. ##
  306. ## Handle environment variables.
  307. ##
  308. ########################################################################
  309. if ("CFLAGS" in os.environ):
  310. CFLAGS = os.environ["CFLAGS"].strip()
  311. if ("CXXFLAGS" in os.environ):
  312. CXXFLAGS = os.environ["CXXFLAGS"].strip()
  313. if ("RPM_OPT_FLAGS" in os.environ):
  314. CFLAGS += " " + os.environ["RPM_OPT_FLAGS"].strip()
  315. CXXFLAGS += " " + os.environ["RPM_OPT_FLAGS"].strip()
  316. if ("LDFLAGS" in os.environ):
  317. LDFLAGS = os.environ["LDFLAGS"].strip()
  318. os.environ["MAKEPANDA"] = os.path.abspath(sys.argv[0])
  319. if GetHost() == "darwin":
  320. if tuple(OSX_ARCHS) == ('arm64',):
  321. os.environ["MACOSX_DEPLOYMENT_TARGET"] = "11.0"
  322. else:
  323. os.environ["MACOSX_DEPLOYMENT_TARGET"] = "10.9"
  324. ########################################################################
  325. ##
  326. ## Configure things based on the command-line parameters.
  327. ##
  328. ########################################################################
  329. if VERSION is None:
  330. # Take the value from the setup.cfg file.
  331. VERSION = GetMetadataValue('version')
  332. if WHLVERSION is None:
  333. WHLVERSION = VERSION
  334. print("Version: %s" % VERSION)
  335. if DEBVERSION is None:
  336. DEBVERSION = VERSION
  337. if RPMVERSION is None:
  338. RPMVERSION = VERSION
  339. MAJOR_VERSION = '.'.join(VERSION.split('.')[:2])
  340. # Now determine the distutils-style platform tag for the target system.
  341. target = GetTarget()
  342. if target == 'windows':
  343. if GetTargetArch() == 'x64':
  344. PLATFORM = 'win-amd64'
  345. else:
  346. PLATFORM = 'win32'
  347. elif target == 'darwin':
  348. arch_tag = None
  349. if not OSX_ARCHS:
  350. arch_tag = GetTargetArch()
  351. elif len(OSX_ARCHS) == 1:
  352. arch_tag = OSX_ARCHS[0]
  353. elif frozenset(OSX_ARCHS) == frozenset(('i386', 'ppc')):
  354. arch_tag = 'fat'
  355. elif frozenset(OSX_ARCHS) == frozenset(('x86_64', 'i386')):
  356. arch_tag = 'intel'
  357. elif frozenset(OSX_ARCHS) == frozenset(('x86_64', 'ppc64')):
  358. arch_tag = 'fat64'
  359. elif frozenset(OSX_ARCHS) == frozenset(('x86_64', 'i386', 'ppc')):
  360. arch_tag = 'fat32'
  361. elif frozenset(OSX_ARCHS) == frozenset(('x86_64', 'i386', 'ppc64', 'ppc')):
  362. arch_tag = 'universal'
  363. elif frozenset(OSX_ARCHS) == frozenset(('x86_64', 'arm64')):
  364. arch_tag = 'universal2'
  365. else:
  366. raise RuntimeError('No arch tag for arch combination %s' % OSX_ARCHS)
  367. if arch_tag == 'arm64':
  368. PLATFORM = 'macosx-11.0-' + arch_tag
  369. else:
  370. PLATFORM = 'macosx-10.9-' + arch_tag
  371. elif target == 'linux' and (os.path.isfile("/lib/libc-2.5.so") or os.path.isfile("/lib64/libc-2.5.so")) and os.path.isdir("/opt/python"):
  372. # This is manylinux1. A bit of a sloppy check, though.
  373. if GetTargetArch() in ('x86_64', 'amd64'):
  374. PLATFORM = 'manylinux1-x86_64'
  375. elif GetTargetArch() in ('arm64', 'aarch64'):
  376. PLATFORM = 'manylinux1-aarch64'
  377. else:
  378. PLATFORM = 'manylinux1-i686'
  379. elif target == 'linux' and (os.path.isfile("/lib/libc-2.12.so") or os.path.isfile("/lib64/libc-2.12.so")) and os.path.isdir("/opt/python"):
  380. # Same sloppy check for manylinux2010.
  381. if GetTargetArch() in ('x86_64', 'amd64'):
  382. PLATFORM = 'manylinux2010-x86_64'
  383. elif GetTargetArch() in ('arm64', 'aarch64'):
  384. PLATFORM = 'manylinux2010-aarch64'
  385. else:
  386. PLATFORM = 'manylinux2010-i686'
  387. elif target == 'linux' and (os.path.isfile("/lib/libc-2.17.so") or os.path.isfile("/lib64/libc-2.17.so")) and os.path.isdir("/opt/python"):
  388. # Same sloppy check for manylinux2014.
  389. if GetTargetArch() in ('x86_64', 'amd64'):
  390. PLATFORM = 'manylinux2014-x86_64'
  391. elif GetTargetArch() in ('arm64', 'aarch64'):
  392. PLATFORM = 'manylinux2014-aarch64'
  393. else:
  394. PLATFORM = 'manylinux2014-i686'
  395. elif target == 'linux' and (os.path.isfile("/lib/i386-linux-gnu/libc-2.24.so") or os.path.isfile("/lib/x86_64-linux-gnu/libc-2.24.so")) and os.path.isdir("/opt/python"):
  396. # Same sloppy check for manylinux_2_24.
  397. if GetTargetArch() in ('x86_64', 'amd64'):
  398. PLATFORM = 'manylinux_2_24-x86_64'
  399. elif GetTargetArch() in ('arm64', 'aarch64'):
  400. PLATFORM = 'manylinux_2_24-aarch64'
  401. else:
  402. PLATFORM = 'manylinux_2_24-i686'
  403. elif not CrossCompiling():
  404. if HasTargetArch():
  405. # Replace the architecture in the platform string.
  406. platform_parts = get_platform().rsplit('-', 1)
  407. target_arch = GetTargetArch()
  408. if target_arch == 'amd64':
  409. target_arch = 'x86_64'
  410. PLATFORM = platform_parts[0] + '-' + target_arch
  411. else:
  412. # We're not cross-compiling; just take the host arch.
  413. PLATFORM = get_platform()
  414. else:
  415. target_arch = GetTargetArch()
  416. if target_arch == 'amd64':
  417. target_arch = 'x86_64'
  418. PLATFORM = '{0}-{1}'.format(target, target_arch)
  419. print("Platform: %s" % PLATFORM)
  420. outputdir_suffix = ""
  421. if DISTRIBUTOR == "":
  422. DISTRIBUTOR = "makepanda"
  423. if not IsCustomOutputDir():
  424. if GetTarget() == "windows" and GetTargetArch() == 'x64':
  425. outputdir_suffix += '_x64'
  426. SetOutputDir("built" + outputdir_suffix)
  427. if (INSTALLER) and (PkgSkip("PYTHON")) and GetTarget() == 'windows':
  428. exit("Cannot build installer on Windows without python")
  429. if WHEEL and PkgSkip("PYTHON"):
  430. exit("Cannot build wheel without Python")
  431. if not os.path.isdir("contrib"):
  432. PkgDisable("CONTRIB")
  433. ########################################################################
  434. ##
  435. ## Load the dependency cache.
  436. ##
  437. ########################################################################
  438. LoadDependencyCache()
  439. ########################################################################
  440. ##
  441. ## Locate various SDKs.
  442. ##
  443. ########################################################################
  444. MakeBuildTree()
  445. SdkLocateDirectX(STRDXSDKVERSION)
  446. SdkLocateMaya()
  447. SdkLocateMax()
  448. SdkLocateMacOSX(OSX_ARCHS)
  449. SdkLocatePython(False)
  450. SdkLocateWindows(WINDOWS_SDK)
  451. SdkLocateSpeedTree()
  452. SdkLocateAndroid()
  453. SdkAutoDisableDirectX()
  454. SdkAutoDisableMaya()
  455. SdkAutoDisableMax()
  456. SdkAutoDisableSpeedTree()
  457. if not PkgSkip("PYTHON") and SDK["PYTHONVERSION"] == "python2.7":
  458. pref = "%sERROR:%s " % (GetColor("red"), GetColor())
  459. print("========================================================================")
  460. print(pref + "Python 2.7 has reached EOL as of January 1, 2020 and is no longer")
  461. print(pref + "supported. Please upgrade to Python 3.5 or later.")
  462. print("========================================================================")
  463. sys.stdout.flush()
  464. sys.exit(1)
  465. ########################################################################
  466. ##
  467. ## Choose a Compiler.
  468. ##
  469. ## This should also set up any environment variables needed to make
  470. ## the compiler work.
  471. ##
  472. ########################################################################
  473. if GetHost() == 'windows' and GetTarget() == 'windows':
  474. COMPILER = "MSVC"
  475. SdkLocateVisualStudio(MSVC_VERSION)
  476. else:
  477. COMPILER = "GCC"
  478. SetupBuildEnvironment(COMPILER)
  479. ########################################################################
  480. ##
  481. ## External includes, external libraries, and external defsyms.
  482. ##
  483. ########################################################################
  484. IncDirectory("ALWAYS", GetOutputDir()+"/tmp")
  485. IncDirectory("ALWAYS", GetOutputDir()+"/include")
  486. if (COMPILER == "MSVC"):
  487. PkgDisable("X11")
  488. PkgDisable("GLES")
  489. PkgDisable("GLES2")
  490. PkgDisable("EGL")
  491. PkgDisable("COCOA")
  492. DefSymbol("FLEX", "YY_NO_UNISTD_H")
  493. if not PkgSkip("PYTHON"):
  494. IncDirectory("ALWAYS", SDK["PYTHON"] + "/include")
  495. LibDirectory("ALWAYS", SDK["PYTHON"] + "/libs")
  496. SmartPkgEnable("EIGEN", "eigen3", (), ("Eigen/Dense",), target_pkg = 'ALWAYS')
  497. for pkg in PkgListGet():
  498. if not PkgSkip(pkg):
  499. if (pkg[:4]=="MAYA"):
  500. IncDirectory(pkg, SDK[pkg] + "/include")
  501. DefSymbol(pkg, "MAYAVERSION", pkg)
  502. DefSymbol(pkg, "MLIBRARY_DONTUSE_MFC_MANIFEST", "")
  503. elif (pkg[:3]=="MAX"):
  504. IncDirectory(pkg, SDK[pkg] + "/include")
  505. IncDirectory(pkg, SDK[pkg] + "/include/CS")
  506. IncDirectory(pkg, SDK[pkg+"CS"] + "/include")
  507. IncDirectory(pkg, SDK[pkg+"CS"] + "/include/CS")
  508. DefSymbol(pkg, "MAX", pkg)
  509. if (int(pkg[3:]) >= 2013):
  510. DefSymbol(pkg, "UNICODE", "")
  511. DefSymbol(pkg, "_UNICODE", "")
  512. elif (pkg[:2]=="DX"):
  513. IncDirectory(pkg, SDK[pkg] + "/include")
  514. elif GetThirdpartyDir() is not None:
  515. IncDirectory(pkg, GetThirdpartyDir() + pkg.lower() + "/include")
  516. for pkg in DXVERSIONS:
  517. if not PkgSkip(pkg):
  518. vnum=pkg[2:]
  519. if GetTargetArch() == 'x64':
  520. LibDirectory(pkg, SDK[pkg] + '/lib/x64')
  521. else:
  522. LibDirectory(pkg, SDK[pkg] + '/lib/x86')
  523. LibDirectory(pkg, SDK[pkg] + '/lib')
  524. LibName(pkg, 'd3dVNUM.lib'.replace("VNUM", vnum))
  525. LibName(pkg, 'd3dxVNUM.lib'.replace("VNUM", vnum))
  526. LibName(pkg, 'dxerr.lib')
  527. #LibName(pkg, 'ddraw.lib')
  528. LibName(pkg, 'dxguid.lib')
  529. if SDK.get("VISUALSTUDIO_VERSION") >= (14,0):
  530. # dxerr needs this for __vsnwprintf definition.
  531. LibName(pkg, 'legacy_stdio_definitions.lib')
  532. if not PkgSkip("FREETYPE") and os.path.isdir(GetThirdpartyDir() + "freetype/include/freetype2"):
  533. IncDirectory("FREETYPE", GetThirdpartyDir() + "freetype/include/freetype2")
  534. IncDirectory("ALWAYS", GetThirdpartyDir() + "extras/include")
  535. LibName("WINSOCK", "wsock32.lib")
  536. LibName("WINSOCK2", "wsock32.lib")
  537. LibName("WINSOCK2", "ws2_32.lib")
  538. LibName("WINCOMCTL", "comctl32.lib")
  539. LibName("WINCOMDLG", "comdlg32.lib")
  540. LibName("WINUSER", "user32.lib")
  541. LibName("WINMM", "winmm.lib")
  542. LibName("WINIMM", "imm32.lib")
  543. LibName("WINKERNEL", "kernel32.lib")
  544. LibName("WINOLE", "ole32.lib")
  545. LibName("WINOLEAUT", "oleaut32.lib")
  546. LibName("WINOLDNAMES", "oldnames.lib")
  547. LibName("WINSHELL", "shell32.lib")
  548. LibName("WINGDI", "gdi32.lib")
  549. LibName("ADVAPI", "advapi32.lib")
  550. LibName("IPHLPAPI", "iphlpapi.lib")
  551. LibName("SETUPAPI", "setupapi.lib")
  552. LibName("GL", "opengl32.lib")
  553. LibName("GLES", "libgles_cm.lib")
  554. LibName("GLES2", "libGLESv2.lib")
  555. LibName("EGL", "libEGL.lib")
  556. LibName("MSIMG", "msimg32.lib")
  557. if (PkgSkip("DIRECTCAM")==0): LibName("DIRECTCAM", "strmiids.lib")
  558. if (PkgSkip("DIRECTCAM")==0): LibName("DIRECTCAM", "quartz.lib")
  559. if (PkgSkip("DIRECTCAM")==0): LibName("DIRECTCAM", "odbc32.lib")
  560. if (PkgSkip("DIRECTCAM")==0): LibName("DIRECTCAM", "odbccp32.lib")
  561. if (PkgSkip("MIMALLOC")==0): LibName("MIMALLOC", GetThirdpartyDir() + "mimalloc/lib/mimalloc-static.lib")
  562. if (PkgSkip("OPENSSL")==0):
  563. if os.path.isfile(GetThirdpartyDir() + "openssl/lib/libpandassl.lib"):
  564. LibName("OPENSSL", GetThirdpartyDir() + "openssl/lib/libpandassl.lib")
  565. LibName("OPENSSL", GetThirdpartyDir() + "openssl/lib/libpandaeay.lib")
  566. elif os.path.isfile(GetThirdpartyDir() + "openssl/lib/ssleay32.lib"):
  567. LibName("OPENSSL", GetThirdpartyDir() + "openssl/lib/libeay32.lib")
  568. LibName("OPENSSL", GetThirdpartyDir() + "openssl/lib/ssleay32.lib")
  569. else:
  570. LibName("OPENSSL", GetThirdpartyDir() + "openssl/lib/libssl.lib")
  571. LibName("OPENSSL", GetThirdpartyDir() + "openssl/lib/libcrypto.lib")
  572. LibName("OPENSSL", "crypt32.lib")
  573. LibName("OPENSSL", "ws2_32.lib")
  574. if (PkgSkip("PNG")==0):
  575. if os.path.isfile(GetThirdpartyDir() + "png/lib/libpng16_static.lib"):
  576. LibName("PNG", GetThirdpartyDir() + "png/lib/libpng16_static.lib")
  577. else:
  578. LibName("PNG", GetThirdpartyDir() + "png/lib/libpng_static.lib")
  579. if (PkgSkip("TIFF")==0):
  580. if os.path.isfile(GetThirdpartyDir() + "tiff/lib/libtiff.lib"):
  581. LibName("TIFF", GetThirdpartyDir() + "tiff/lib/libtiff.lib")
  582. else:
  583. LibName("TIFF", GetThirdpartyDir() + "tiff/lib/tiff.lib")
  584. if (PkgSkip("OPENEXR")==0):
  585. if os.path.isfile(GetThirdpartyDir() + "openexr/lib/OpenEXRCore-3_1.lib"):
  586. LibName("OPENEXR", GetThirdpartyDir() + "openexr/lib/OpenEXR-3_1.lib")
  587. LibName("OPENEXR", GetThirdpartyDir() + "openexr/lib/IlmThread-3_1.lib")
  588. LibName("OPENEXR", GetThirdpartyDir() + "openexr/lib/Imath-3_1.lib")
  589. LibName("OPENEXR", GetThirdpartyDir() + "openexr/lib/Iex-3_1.lib")
  590. elif os.path.isfile(GetThirdpartyDir() + "openexr/lib/OpenEXR-3_0.lib"):
  591. LibName("OPENEXR", GetThirdpartyDir() + "openexr/lib/OpenEXR-3_0.lib")
  592. LibName("OPENEXR", GetThirdpartyDir() + "openexr/lib/IlmThread-3_0.lib")
  593. LibName("OPENEXR", GetThirdpartyDir() + "openexr/lib/Imath-3_0.lib")
  594. LibName("OPENEXR", GetThirdpartyDir() + "openexr/lib/Iex-3_0.lib")
  595. elif os.path.isfile(GetThirdpartyDir() + "openexr/lib/OpenEXR.lib"):
  596. LibName("OPENEXR", GetThirdpartyDir() + "openexr/lib/OpenEXR.lib")
  597. LibName("OPENEXR", GetThirdpartyDir() + "openexr/lib/IlmThread.lib")
  598. LibName("OPENEXR", GetThirdpartyDir() + "openexr/lib/Imath.lib")
  599. LibName("OPENEXR", GetThirdpartyDir() + "openexr/lib/Iex.lib")
  600. else:
  601. suffix = ""
  602. if os.path.isfile(GetThirdpartyDir() + "openexr/lib/IlmImf-2_2.lib"):
  603. suffix = "-2_2"
  604. elif os.path.isfile(GetThirdpartyDir() + "openexr/lib/IlmImf-2_3.lib"):
  605. suffix = "-2_3"
  606. elif os.path.isfile(GetThirdpartyDir() + "openexr/lib/IlmImf-2_4.lib"):
  607. suffix = "-2_4"
  608. LibName("OPENEXR", GetThirdpartyDir() + "openexr/lib/Imath" + suffix + ".lib")
  609. if os.path.isfile(GetThirdpartyDir() + "openexr/lib/IlmImf" + suffix + "_s.lib"):
  610. suffix += "_s" # _s suffix observed for OpenEXR 2.3 only so far
  611. LibName("OPENEXR", GetThirdpartyDir() + "openexr/lib/IlmImf" + suffix + ".lib")
  612. LibName("OPENEXR", GetThirdpartyDir() + "openexr/lib/IlmThread" + suffix + ".lib")
  613. LibName("OPENEXR", GetThirdpartyDir() + "openexr/lib/Iex" + suffix + ".lib")
  614. if suffix == "-2_2":
  615. LibName("OPENEXR", GetThirdpartyDir() + "openexr/lib/Half.lib")
  616. else:
  617. LibName("OPENEXR", GetThirdpartyDir() + "openexr/lib/Half" + suffix + ".lib")
  618. IncDirectory("OPENEXR", GetThirdpartyDir() + "openexr/include/OpenEXR")
  619. IncDirectory("OPENEXR", GetThirdpartyDir() + "openexr/include/Imath")
  620. if (PkgSkip("JPEG")==0): LibName("JPEG", GetThirdpartyDir() + "jpeg/lib/jpeg-static.lib")
  621. if (PkgSkip("ZLIB")==0): LibName("ZLIB", GetThirdpartyDir() + "zlib/lib/zlibstatic.lib")
  622. if (PkgSkip("VRPN")==0): LibName("VRPN", GetThirdpartyDir() + "vrpn/lib/vrpn.lib")
  623. if (PkgSkip("VRPN")==0): LibName("VRPN", GetThirdpartyDir() + "vrpn/lib/quat.lib")
  624. if (PkgSkip("NVIDIACG")==0): LibName("CGGL", GetThirdpartyDir() + "nvidiacg/lib/cgGL.lib")
  625. if (PkgSkip("NVIDIACG")==0): LibName("CGDX9", GetThirdpartyDir() + "nvidiacg/lib/cgD3D9.lib")
  626. if (PkgSkip("NVIDIACG")==0): LibName("NVIDIACG", GetThirdpartyDir() + "nvidiacg/lib/cg.lib")
  627. if (PkgSkip("FREETYPE")==0): LibName("FREETYPE", GetThirdpartyDir() + "freetype/lib/freetype.lib")
  628. if (PkgSkip("HARFBUZZ")==0):
  629. LibName("HARFBUZZ", GetThirdpartyDir() + "harfbuzz/lib/harfbuzz.lib")
  630. IncDirectory("HARFBUZZ", GetThirdpartyDir() + "harfbuzz/include/harfbuzz")
  631. if (PkgSkip("FFTW")==0): LibName("FFTW", GetThirdpartyDir() + "fftw/lib/fftw3.lib")
  632. if (PkgSkip("ARTOOLKIT")==0):LibName("ARTOOLKIT",GetThirdpartyDir() + "artoolkit/lib/libAR.lib")
  633. if (PkgSkip("OPENCV")==0): LibName("OPENCV", GetThirdpartyDir() + "opencv/lib/cv.lib")
  634. if (PkgSkip("OPENCV")==0): LibName("OPENCV", GetThirdpartyDir() + "opencv/lib/highgui.lib")
  635. if (PkgSkip("OPENCV")==0): LibName("OPENCV", GetThirdpartyDir() + "opencv/lib/cvaux.lib")
  636. if (PkgSkip("OPENCV")==0): LibName("OPENCV", GetThirdpartyDir() + "opencv/lib/ml.lib")
  637. if (PkgSkip("OPENCV")==0): LibName("OPENCV", GetThirdpartyDir() + "opencv/lib/cxcore.lib")
  638. if (PkgSkip("FFMPEG")==0): LibName("FFMPEG", GetThirdpartyDir() + "ffmpeg/lib/avcodec.lib")
  639. if (PkgSkip("FFMPEG")==0): LibName("FFMPEG", GetThirdpartyDir() + "ffmpeg/lib/avformat.lib")
  640. if (PkgSkip("FFMPEG")==0): LibName("FFMPEG", GetThirdpartyDir() + "ffmpeg/lib/avutil.lib")
  641. if (PkgSkip("SWSCALE")==0): LibName("SWSCALE", GetThirdpartyDir() + "ffmpeg/lib/swscale.lib")
  642. if (PkgSkip("SWRESAMPLE")==0):LibName("SWRESAMPLE",GetThirdpartyDir() + "ffmpeg/lib/swresample.lib")
  643. if (PkgSkip("FCOLLADA")==0):
  644. LibName("FCOLLADA", GetThirdpartyDir() + "fcollada/lib/FCollada.lib")
  645. IncDirectory("FCOLLADA", GetThirdpartyDir() + "fcollada/include/FCollada")
  646. if (PkgSkip("ASSIMP")==0):
  647. LibName("ASSIMP", GetThirdpartyDir() + "assimp/lib/assimp.lib")
  648. if os.path.isfile(GetThirdpartyDir() + "assimp/lib/IrrXML.lib"):
  649. LibName("ASSIMP", GetThirdpartyDir() + "assimp/lib/IrrXML.lib")
  650. IncDirectory("ASSIMP", GetThirdpartyDir() + "assimp/include")
  651. if (PkgSkip("SQUISH")==0):
  652. if GetOptimize() <= 2:
  653. LibName("SQUISH", GetThirdpartyDir() + "squish/lib/squishd.lib")
  654. else:
  655. LibName("SQUISH", GetThirdpartyDir() + "squish/lib/squish.lib")
  656. if (PkgSkip("OPENAL")==0):
  657. LibName("OPENAL", GetThirdpartyDir() + "openal/lib/OpenAL32.lib")
  658. if not os.path.isfile(GetThirdpartyDir() + "openal/bin/OpenAL32.dll"):
  659. # Link OpenAL Soft statically.
  660. DefSymbol("OPENAL", "AL_LIBTYPE_STATIC")
  661. if (PkgSkip("ODE")==0):
  662. LibName("ODE", GetThirdpartyDir() + "ode/lib/ode_single.lib")
  663. DefSymbol("ODE", "dSINGLE", "")
  664. if (PkgSkip("FMODEX")==0):
  665. if (GetTargetArch() == 'x64'):
  666. LibName("FMODEX", GetThirdpartyDir() + "fmodex/lib/fmodex64_vc.lib")
  667. else:
  668. LibName("FMODEX", GetThirdpartyDir() + "fmodex/lib/fmodex_vc.lib")
  669. if (PkgSkip("VORBIS")==0):
  670. for lib in ('ogg', 'vorbis', 'vorbisfile'):
  671. path = GetThirdpartyDir() + "vorbis/lib/lib{0}_static.lib".format(lib)
  672. if not os.path.isfile(path):
  673. path = GetThirdpartyDir() + "vorbis/lib/{0}.lib".format(lib)
  674. LibName("VORBIS", path)
  675. if (PkgSkip("OPUS")==0):
  676. IncDirectory("OPUS", GetThirdpartyDir() + "opus/include/opus")
  677. for lib in ('ogg', 'opus', 'opusfile'):
  678. path = GetThirdpartyDir() + "opus/lib/lib{0}_static.lib".format(lib)
  679. if not os.path.isfile(path):
  680. path = GetThirdpartyDir() + "opus/lib/{0}.lib".format(lib)
  681. LibName("OPUS", path)
  682. for pkg in MAYAVERSIONS:
  683. if not PkgSkip(pkg):
  684. LibName(pkg, '"' + SDK[pkg] + '/lib/Foundation.lib"')
  685. LibName(pkg, '"' + SDK[pkg] + '/lib/OpenMaya.lib"')
  686. LibName(pkg, '"' + SDK[pkg] + '/lib/OpenMayaAnim.lib"')
  687. LibName(pkg, '"' + SDK[pkg] + '/lib/OpenMayaUI.lib"')
  688. for pkg in MAXVERSIONS:
  689. if not PkgSkip(pkg):
  690. LibName(pkg, SDK[pkg] + '/lib/core.lib')
  691. LibName(pkg, SDK[pkg] + '/lib/edmodel.lib')
  692. LibName(pkg, SDK[pkg] + '/lib/gfx.lib')
  693. LibName(pkg, SDK[pkg] + '/lib/geom.lib')
  694. LibName(pkg, SDK[pkg] + '/lib/mesh.lib')
  695. LibName(pkg, SDK[pkg] + '/lib/maxutil.lib')
  696. LibName(pkg, SDK[pkg] + '/lib/paramblk2.lib')
  697. if not PkgSkip("SPEEDTREE"):
  698. if GetTargetArch() == 'x64':
  699. libdir = SDK["SPEEDTREE"] + "/Lib/Windows/VC10.x64/"
  700. p64ext = '64'
  701. else:
  702. libdir = SDK["SPEEDTREE"] + "/Lib/Windows/VC10/"
  703. p64ext = ''
  704. debugext = ''
  705. if (GetOptimize() <= 2): debugext = "_d"
  706. libsuffix = "_v%s_VC100MT%s_Static%s.lib" % (
  707. SDK["SPEEDTREEVERSION"], p64ext, debugext)
  708. LibName("SPEEDTREE", "%sSpeedTreeCore%s" % (libdir, libsuffix))
  709. LibName("SPEEDTREE", "%sSpeedTreeForest%s" % (libdir, libsuffix))
  710. LibName("SPEEDTREE", "%sSpeedTree%sRenderer%s" % (libdir, SDK["SPEEDTREEAPI"], libsuffix))
  711. LibName("SPEEDTREE", "%sSpeedTreeRenderInterface%s" % (libdir, libsuffix))
  712. if (SDK["SPEEDTREEAPI"] == "OpenGL"):
  713. LibName("SPEEDTREE", "%sglew32.lib" % (libdir))
  714. LibName("SPEEDTREE", "glu32.lib")
  715. IncDirectory("SPEEDTREE", SDK["SPEEDTREE"] + "/Include")
  716. if (PkgSkip("BULLET")==0):
  717. suffix = '.lib'
  718. if GetTargetArch() == 'x64' and os.path.isfile(GetThirdpartyDir() + "bullet/lib/BulletCollision_x64.lib"):
  719. suffix = '_x64.lib'
  720. LibName("BULLET", GetThirdpartyDir() + "bullet/lib/LinearMath" + suffix)
  721. LibName("BULLET", GetThirdpartyDir() + "bullet/lib/BulletCollision" + suffix)
  722. LibName("BULLET", GetThirdpartyDir() + "bullet/lib/BulletDynamics" + suffix)
  723. LibName("BULLET", GetThirdpartyDir() + "bullet/lib/BulletSoftBody" + suffix)
  724. if (COMPILER=="GCC"):
  725. if GetTarget() != "darwin":
  726. PkgDisable("COCOA")
  727. if GetTarget() == 'darwin':
  728. if OSX_ARCHS and 'x86_64' not in OSX_ARCHS and 'i386' not in OSX_ARCHS:
  729. # These support only these archs, so don't build them if we're not
  730. # targeting any of the supported archs.
  731. PkgDisable("FMODEX")
  732. PkgDisable("NVIDIACG")
  733. elif OSX_ARCHS and 'arm64' in OSX_ARCHS:
  734. # We must be using the 11.0 SDK or higher, so can't build FMOD Ex
  735. if not PkgSkip("FMODEX"):
  736. Warn("thirdparty package fmodex is not supported when targeting arm64, excluding from build")
  737. PkgDisable("FMODEX")
  738. elif not os.path.isfile(SDK.get("MACOSX", "") + '/usr/lib/libstdc++.6.0.9.tbd') and \
  739. not os.path.isfile(SDK.get("MACOSX", "") + '/usr/lib/libstdc++.6.0.9.dylib'):
  740. # Also, we can't target FMOD Ex on 10.14 and above
  741. if not PkgSkip("FMODEX"):
  742. Warn("thirdparty package fmodex requires one of MacOSX 10.9-10.13 SDK, excluding from build")
  743. PkgDisable("FMODEX")
  744. #if not PkgSkip("PYTHON"):
  745. # IncDirectory("PYTHON", SDK["PYTHON"])
  746. if (GetHost() == "darwin"):
  747. if (PkgSkip("FREETYPE")==0 and not os.path.isdir(GetThirdpartyDir() + 'freetype')):
  748. IncDirectory("FREETYPE", "/usr/X11/include")
  749. IncDirectory("FREETYPE", "/usr/X11/include/freetype2")
  750. LibDirectory("FREETYPE", "/usr/X11/lib")
  751. if (GetHost() == "freebsd"):
  752. IncDirectory("ALWAYS", "/usr/local/include")
  753. LibDirectory("ALWAYS", "/usr/local/lib")
  754. if (os.path.isdir("/usr/PCBSD")):
  755. IncDirectory("ALWAYS", "/usr/PCBSD/local/include")
  756. LibDirectory("ALWAYS", "/usr/PCBSD/local/lib")
  757. SmartPkgEnable("INOTIFY", "libinotify", ("inotify"), "sys/inotify.h")
  758. if GetTarget() != "windows":
  759. PkgDisable("DIRECTCAM")
  760. fcollada_libs = ("FColladaD", "FColladaSD", "FColladaS")
  761. # WARNING! The order of the ffmpeg libraries matters!
  762. ffmpeg_libs = ("libavformat", "libavcodec", "libavutil")
  763. assimp_libs = ("libassimp", "libassimpd")
  764. # Name pkg-config libs, include(dir)s
  765. SmartPkgEnable("EIGEN", "eigen3", (), ("Eigen/Dense",), target_pkg = 'ALWAYS')
  766. SmartPkgEnable("ARTOOLKIT", "", ("AR"), "AR/ar.h")
  767. SmartPkgEnable("FCOLLADA", "", ChooseLib(fcollada_libs, "FCOLLADA"), ("FCollada", "FCollada/FCollada.h"))
  768. SmartPkgEnable("ASSIMP", "assimp", ChooseLib(assimp_libs, "ASSIMP"), "assimp/Importer.hpp")
  769. SmartPkgEnable("FFMPEG", ffmpeg_libs, ffmpeg_libs, ("libavformat/avformat.h", "libavcodec/avcodec.h", "libavutil/avutil.h"))
  770. SmartPkgEnable("SWSCALE", "libswscale", "libswscale", ("libswscale/swscale.h"), target_pkg = "FFMPEG", thirdparty_dir = "ffmpeg")
  771. SmartPkgEnable("SWRESAMPLE","libswresample", "libswresample", ("libswresample/swresample.h"), target_pkg = "FFMPEG", thirdparty_dir = "ffmpeg")
  772. SmartPkgEnable("FFTW", "fftw3", ("fftw3"), ("fftw.h"))
  773. SmartPkgEnable("FMODEX", "", ("fmodex"), ("fmodex", "fmodex/fmod.h"))
  774. SmartPkgEnable("FREETYPE", "freetype2", ("freetype"), ("freetype2", "freetype2/freetype/freetype.h"))
  775. SmartPkgEnable("HARFBUZZ", "harfbuzz", ("harfbuzz"), ("harfbuzz", "harfbuzz/hb-ft.h"))
  776. SmartPkgEnable("GL", "gl", ("GL"), ("GL/gl.h"), framework = "OpenGL")
  777. SmartPkgEnable("GLES", "glesv1_cm", ("GLESv1_CM"), ("GLES/gl.h"), framework = "OpenGLES")
  778. SmartPkgEnable("GLES2", "glesv2", ("GLESv2"), ("GLES2/gl2.h")) #framework = "OpenGLES"?
  779. SmartPkgEnable("EGL", "egl", ("EGL"), ("EGL/egl.h"))
  780. SmartPkgEnable("NVIDIACG", "", ("Cg"), "Cg/cg.h", framework = "Cg")
  781. SmartPkgEnable("ODE", "", ("ode"), "ode/ode.h", tool = "ode-config")
  782. SmartPkgEnable("OPENAL", "openal", ("openal"), "AL/al.h", framework = "OpenAL")
  783. SmartPkgEnable("SQUISH", "", ("squish"), "squish.h")
  784. SmartPkgEnable("TIFF", "libtiff-4", ("tiff"), "tiff.h")
  785. SmartPkgEnable("OPENEXR", "OpenEXR", ("IlmImf", "Imath", "Half", "Iex", "IexMath", "IlmThread"), ("OpenEXR", "Imath", "OpenEXR/ImfOutputFile.h"))
  786. SmartPkgEnable("VRPN", "", ("vrpn", "quat"), ("vrpn", "quat.h", "vrpn/vrpn_Types.h"))
  787. SmartPkgEnable("BULLET", "bullet", ("BulletSoftBody", "BulletDynamics", "BulletCollision", "LinearMath"), ("bullet", "bullet/btBulletDynamicsCommon.h"))
  788. SmartPkgEnable("VORBIS", "vorbisfile",("vorbisfile", "vorbis", "ogg"), ("ogg/ogg.h", "vorbis/vorbisfile.h"))
  789. SmartPkgEnable("OPUS", "opusfile", ("opusfile", "opus", "ogg"), ("ogg/ogg.h", "opus/opusfile.h", "opus"))
  790. SmartPkgEnable("JPEG", "", ("jpeg"), "jpeglib.h")
  791. SmartPkgEnable("PNG", "libpng", ("png"), "png.h", tool = "libpng-config")
  792. SmartPkgEnable("MIMALLOC", "", ("mimalloc"), "mimalloc.h")
  793. # Copy freetype libraries to be specified after harfbuzz libraries as well,
  794. # because there's a circular dependency between the two libraries.
  795. if not PkgSkip("FREETYPE") and not PkgSkip("HARFBUZZ"):
  796. for (opt, name) in LIBNAMES:
  797. if opt == "FREETYPE":
  798. LibName("HARFBUZZ", name)
  799. if not PkgSkip("FFMPEG"):
  800. if GetTarget() == "darwin":
  801. LibName("FFMPEG", "-framework VideoDecodeAcceleration")
  802. elif os.path.isfile(GetThirdpartyDir() + "ffmpeg/lib/libavcodec.a"):
  803. # Needed when linking ffmpeg statically on Linux.
  804. LibName("FFMPEG", "-Wl,-Bsymbolic")
  805. # Don't export ffmpeg symbols from libp3ffmpeg when linking statically.
  806. for ffmpeg_lib in ffmpeg_libs:
  807. LibName("FFMPEG", "-Wl,--exclude-libs,%s.a" % (ffmpeg_lib))
  808. if GetTarget() != "darwin":
  809. for fcollada_lib in fcollada_libs:
  810. LibName("FCOLLADA", "-Wl,--exclude-libs,lib%s.a" % (fcollada_lib))
  811. if not PkgSkip("SWSCALE"):
  812. LibName("SWSCALE", "-Wl,--exclude-libs,libswscale.a")
  813. if not PkgSkip("SWRESAMPLE"):
  814. LibName("SWRESAMPLE", "-Wl,--exclude-libs,libswresample.a")
  815. if not PkgSkip("JPEG"):
  816. LibName("JPEG", "-Wl,--exclude-libs,libjpeg.a")
  817. if not PkgSkip("TIFF"):
  818. LibName("TIFF", "-Wl,--exclude-libs,libtiff.a")
  819. if not PkgSkip("PNG"):
  820. LibName("PNG", "-Wl,--exclude-libs,libpng.a")
  821. LibName("PNG", "-Wl,--exclude-libs,libpng16.a")
  822. if not PkgSkip("SQUISH"):
  823. LibName("SQUISH", "-Wl,--exclude-libs,libsquish.a")
  824. if not PkgSkip("OPENEXR"):
  825. LibName("OPENEXR", "-Wl,--exclude-libs,libHalf.a")
  826. LibName("OPENEXR", "-Wl,--exclude-libs,libIex.a")
  827. LibName("OPENEXR", "-Wl,--exclude-libs,libIexMath.a")
  828. LibName("OPENEXR", "-Wl,--exclude-libs,libIlmImf.a")
  829. LibName("OPENEXR", "-Wl,--exclude-libs,libIlmImfUtil.a")
  830. LibName("OPENEXR", "-Wl,--exclude-libs,libIlmThread.a")
  831. LibName("OPENEXR", "-Wl,--exclude-libs,libImath.a")
  832. if not PkgSkip("VORBIS"):
  833. LibName("VORBIS", "-Wl,--exclude-libs,libogg.a")
  834. LibName("VORBIS", "-Wl,--exclude-libs,libvorbis.a")
  835. LibName("VORBIS", "-Wl,--exclude-libs,libvorbisenc.a")
  836. LibName("VORBIS", "-Wl,--exclude-libs,libvorbisfile.a")
  837. if not PkgSkip("OPUS"):
  838. LibName("OPUS", "-Wl,--exclude-libs,libogg.a")
  839. LibName("OPUS", "-Wl,--exclude-libs,libopus.a")
  840. LibName("OPUS", "-Wl,--exclude-libs,libopusfile.a")
  841. if not PkgSkip("VRPN"):
  842. LibName("VRPN", "-Wl,--exclude-libs,libvrpn.a")
  843. LibName("VRPN", "-Wl,--exclude-libs,libquat.a")
  844. if not PkgSkip("ARTOOLKIT"):
  845. LibName("ARTOOLKIT", "-Wl,--exclude-libs,libAR.a")
  846. LibName("ARTOOLKIT", "-Wl,--exclude-libs,libARMulti.a")
  847. if not PkgSkip("MIMALLOC"):
  848. LibName("MIMALLOC", "-Wl,--exclude-libs,libmimalloc.a")
  849. if PkgSkip("FFMPEG") or GetTarget() == "darwin":
  850. cv_lib = ChooseLib(("opencv_core", "cv"), "OPENCV")
  851. if cv_lib == "opencv_core":
  852. OPENCV_VER_23 = True
  853. SmartPkgEnable("OPENCV", "opencv", ("opencv_core", "opencv_highgui"), ("opencv2/core/core.hpp"))
  854. else:
  855. SmartPkgEnable("OPENCV", "opencv", ("cv", "highgui", "cvaux", "ml", "cxcore"),
  856. ("opencv", "opencv/cv.h", "opencv/cxcore.h", "opencv/highgui.h"))
  857. else:
  858. PkgDisable("OPENCV")
  859. if not PkgSkip("OPENAL"):
  860. if GetTarget() == "darwin":
  861. LibName("OPENAL", "-framework AudioUnit")
  862. LibName("OPENAL", "-framework AudioToolbox")
  863. LibName("OPENAL", "-framework CoreAudio")
  864. else:
  865. LibName("OPENAL", "-Wl,--exclude-libs,libopenal.a")
  866. if not PkgSkip("ASSIMP") and \
  867. os.path.isfile(GetThirdpartyDir() + "assimp/lib/libassimp.a"):
  868. # Also pick up IrrXML, which is needed when linking statically.
  869. irrxml = GetThirdpartyDir() + "assimp/lib/libIrrXML.a"
  870. if os.path.isfile(irrxml):
  871. LibName("ASSIMP", irrxml)
  872. if GetTarget() != "darwin":
  873. LibName("ASSIMP", "-Wl,--exclude-libs,libassimp.a")
  874. LibName("ASSIMP", "-Wl,--exclude-libs,libIrrXML.a")
  875. if not PkgSkip("PYTHON"):
  876. python_lib = SDK["PYTHONVERSION"]
  877. SmartPkgEnable("PYTHON", "", python_lib, (SDK["PYTHONVERSION"], SDK["PYTHONVERSION"] + "/Python.h"))
  878. if GetTarget() == "linux":
  879. LibName("PYTHON", "-lutil")
  880. LibName("PYTHON", "-lrt")
  881. SmartPkgEnable("OPENSSL", "openssl", ("ssl", "crypto"), ("openssl/ssl.h", "openssl/crypto.h"))
  882. SmartPkgEnable("ZLIB", "zlib", ("z"), "zlib.h")
  883. SmartPkgEnable("GTK3", "gtk+-3.0")
  884. if not PkgSkip("OPENSSL") and GetTarget() != "darwin":
  885. LibName("OPENSSL", "-Wl,--exclude-libs,libssl.a")
  886. LibName("OPENSSL", "-Wl,--exclude-libs,libcrypto.a")
  887. if GetTarget() != 'darwin':
  888. # CgGL is covered by the Cg framework, and we don't need X11 components on OSX
  889. if not PkgSkip("NVIDIACG"):
  890. SmartPkgEnable("CGGL", "", ("CgGL"), "Cg/cgGL.h", thirdparty_dir = "nvidiacg")
  891. if GetTarget() != "android":
  892. SmartPkgEnable("X11", "x11", "X11", ("X11", "X11/Xlib.h", "X11/XKBlib.h"))
  893. else:
  894. PkgDisable("X11")
  895. if GetHost() != "darwin":
  896. # Workaround for an issue where pkg-config does not include this path
  897. if GetTargetArch() in ("x86_64", "amd64"):
  898. if not PkgSkip("X11"):
  899. if (os.path.isdir("/usr/X11R6/lib64")):
  900. LibDirectory("ALWAYS", "/usr/X11R6/lib64")
  901. else:
  902. LibDirectory("ALWAYS", "/usr/X11R6/lib")
  903. elif not PkgSkip("X11"):
  904. LibDirectory("ALWAYS", "/usr/X11R6/lib")
  905. for pkg in MAYAVERSIONS:
  906. if (PkgSkip(pkg)==0 and (pkg in SDK)):
  907. if (GetHost() == "darwin"):
  908. # Sheesh, Autodesk really can't make up their mind
  909. # regarding the location of the Maya devkit on macOS.
  910. if (os.path.isdir(SDK[pkg] + "/Maya.app/Contents/lib")):
  911. LibDirectory(pkg, SDK[pkg] + "/Maya.app/Contents/lib")
  912. if (os.path.isdir(SDK[pkg] + "/Maya.app/Contents/MacOS")):
  913. LibDirectory(pkg, SDK[pkg] + "/Maya.app/Contents/MacOS")
  914. if (os.path.isdir(SDK[pkg] + "/lib")):
  915. LibDirectory(pkg, SDK[pkg] + "/lib")
  916. if (os.path.isdir(SDK[pkg] + "/Maya.app/Contents/include/maya")):
  917. IncDirectory(pkg, SDK[pkg] + "/Maya.app/Contents/include")
  918. if (os.path.isdir(SDK[pkg] + "/devkit/include/maya")):
  919. IncDirectory(pkg, SDK[pkg] + "/devkit/include")
  920. if (os.path.isdir(SDK[pkg] + "/include/maya")):
  921. IncDirectory(pkg, SDK[pkg] + "/include")
  922. else:
  923. LibDirectory(pkg, SDK[pkg] + "/lib")
  924. IncDirectory(pkg, SDK[pkg] + "/include")
  925. DefSymbol(pkg, "MAYAVERSION", pkg)
  926. if GetTarget() == 'darwin':
  927. LibName("ALWAYS", "-framework AppKit")
  928. LibName("IOKIT", "-framework IOKit")
  929. LibName("QUARTZ", "-framework Quartz")
  930. LibName("AGL", "-framework AGL")
  931. LibName("CARBON", "-framework Carbon")
  932. LibName("COCOA", "-framework Cocoa")
  933. # Fix for a bug in OSX Leopard:
  934. LibName("GL", "-dylib_file /System/Library/Frameworks/OpenGL.framework/Versions/A/Libraries/libGL.dylib:/System/Library/Frameworks/OpenGL.framework/Versions/A/Libraries/libGL.dylib")
  935. # Temporary exceptions to removal of this flag
  936. if not PkgSkip("FFMPEG"):
  937. LibName("FFMPEG", "-undefined dynamic_lookup")
  938. if not PkgSkip("ASSIMP"):
  939. LibName("ASSIMP", "-undefined dynamic_lookup")
  940. if not PkgSkip("OPENEXR"):
  941. LibName("OPENEXR", "-undefined dynamic_lookup")
  942. if not PkgSkip("VRPN"):
  943. LibName("VRPN", "-undefined dynamic_lookup")
  944. if GetTarget() == 'android':
  945. LibName("ALWAYS", '-llog')
  946. LibName("ANDROID", '-landroid')
  947. LibName("JNIGRAPHICS", '-ljnigraphics')
  948. LibName("OPENSLES", '-lOpenSLES')
  949. for pkg in MAYAVERSIONS:
  950. if (PkgSkip(pkg)==0 and (pkg in SDK)):
  951. if GetTarget() == 'darwin':
  952. LibName(pkg, "-Wl,-rpath,/Applications/Autodesk/" + pkg.lower() + "/Maya.app/Contents/MacOS")
  953. else:
  954. LibName(pkg, "-Wl,-rpath," + SDK[pkg] + "/lib")
  955. LibName(pkg, "-lOpenMaya")
  956. LibName(pkg, "-lOpenMayaAnim")
  957. LibName(pkg, "-lOpenMayaUI")
  958. LibName(pkg, "-lAnimSlice")
  959. LibName(pkg, "-lDeformSlice")
  960. LibName(pkg, "-lModifiers")
  961. LibName(pkg, "-lDynSlice")
  962. LibName(pkg, "-lKinSlice")
  963. LibName(pkg, "-lModelSlice")
  964. LibName(pkg, "-lNurbsSlice")
  965. LibName(pkg, "-lPolySlice")
  966. LibName(pkg, "-lProjectSlice")
  967. LibName(pkg, "-lImage")
  968. LibName(pkg, "-lShared")
  969. LibName(pkg, "-lTranslators")
  970. LibName(pkg, "-lDataModel")
  971. LibName(pkg, "-lRenderModel")
  972. LibName(pkg, "-lNurbsEngine")
  973. LibName(pkg, "-lDependEngine")
  974. LibName(pkg, "-lCommandEngine")
  975. LibName(pkg, "-lFoundation")
  976. if pkg not in ("MAYA2020", "MAYA2022"):
  977. LibName(pkg, "-lIMFbase")
  978. if GetTarget() != 'darwin':
  979. LibName(pkg, "-lOpenMayalib")
  980. else:
  981. LibName(pkg, "-dylib_file /System/Library/Frameworks/OpenGL.framework/Versions/A/Libraries/libGL.dylib:/System/Library/Frameworks/OpenGL.framework/Versions/A/Libraries/libGL.dylib")
  982. DefSymbol("WITHINPANDA", "WITHIN_PANDA", "1")
  983. if GetLinkAllStatic():
  984. DefSymbol("ALWAYS", "LINK_ALL_STATIC")
  985. if GetTarget() == 'android':
  986. DefSymbol("ALWAYS", "ANDROID")
  987. if not PkgSkip("EIGEN"):
  988. if GetOptimize() >= 3:
  989. if COMPILER == "MSVC":
  990. # Squeeze out a bit more performance on MSVC builds...
  991. # Only do this if EIGEN_NO_DEBUG is also set, otherwise it
  992. # will turn them into runtime assertions.
  993. DefSymbol("ALWAYS", "EIGEN_NO_STATIC_ASSERT")
  994. if not PkgSkip("EGL"):
  995. DefSymbol('EGL', 'HAVE_EGL', '')
  996. if PkgSkip("X11"):
  997. DefSymbol('EGL', 'EGL_NO_X11', '')
  998. if not PkgSkip("X11"):
  999. DefSymbol('X11', 'USE_X11', '')
  1000. ########################################################################
  1001. ##
  1002. ## Give a Status Report on Command-Line Options
  1003. ##
  1004. ########################################################################
  1005. def printStatus(header,warnings):
  1006. if GetVerbose():
  1007. print("")
  1008. print("-------------------------------------------------------------------")
  1009. print(header)
  1010. tkeep = ""
  1011. tomit = ""
  1012. for x in PkgListGet():
  1013. if PkgSkip(x):
  1014. tomit = tomit + x + " "
  1015. else:
  1016. tkeep = tkeep + x + " "
  1017. print("Makepanda: Compiler: %s" % (COMPILER))
  1018. print("Makepanda: Optimize: %d" % (GetOptimize()))
  1019. print("Makepanda: Keep Pkg: %s" % (tkeep))
  1020. print("Makepanda: Omit Pkg: %s" % (tomit))
  1021. if GENMAN:
  1022. print("Makepanda: Generate API reference manual")
  1023. else:
  1024. print("Makepanda: Don't generate API reference manual")
  1025. if GetHost() == "windows":
  1026. if INSTALLER:
  1027. print("Makepanda: Build installer, using %s" % (COMPRESSOR))
  1028. else:
  1029. print("Makepanda: Don't build installer")
  1030. print("Makepanda: Version ID: %s" % (VERSION))
  1031. for x in warnings:
  1032. print("Makepanda: %s" % (x))
  1033. print("-------------------------------------------------------------------")
  1034. print("")
  1035. sys.stdout.flush()
  1036. ########################################################################
  1037. ##
  1038. ## BracketNameWithQuotes
  1039. ##
  1040. ########################################################################
  1041. def BracketNameWithQuotes(name):
  1042. # Workaround for OSX bug - compiler doesn't like those flags quoted.
  1043. if (name.startswith("-framework")): return name
  1044. if (name.startswith("-dylib_file")): return name
  1045. if (name.startswith("-undefined ")): return name
  1046. # Don't add quotes when it's not necessary.
  1047. if " " not in name: return name
  1048. # Account for quoted name (leave as is) but quote everything else (e.g., to protect spaces within paths from improper parsing)
  1049. if (name.startswith('"') and name.endswith('"')): return name
  1050. else: return '"' + name + '"'
  1051. ########################################################################
  1052. ##
  1053. ## CompileCxx
  1054. ##
  1055. ########################################################################
  1056. def CompileCxx(obj,src,opts):
  1057. ipath = GetListOption(opts, "DIR:")
  1058. optlevel = GetOptimizeOption(opts)
  1059. if (COMPILER=="MSVC"):
  1060. if not BOOUSEINTELCOMPILER:
  1061. cmd = "cl "
  1062. if GetTargetArch() == 'x64':
  1063. cmd += "/favor:blend "
  1064. cmd += "/wd4996 /wd4275 /wd4273 "
  1065. # Set the minimum version to Windows Vista.
  1066. cmd += "/DWINVER=0x600 "
  1067. cmd += "/Fo" + obj + " /nologo /c"
  1068. if GetTargetArch() == 'x86':
  1069. # x86 (32 bit) MSVC 2015+ defaults to /arch:SSE2
  1070. if not PkgSkip("SSE2") or 'SSE2' in opts: # x86 with SSE2
  1071. cmd += " /arch:SSE2" # let's still be explicit and pass in /arch:SSE2
  1072. else: # x86 without SSE2
  1073. cmd += " /arch:IA32"
  1074. for x in ipath: cmd += " /I" + x
  1075. for (opt,dir) in INCDIRECTORIES:
  1076. if (opt=="ALWAYS") or (opt in opts): cmd += " /I" + BracketNameWithQuotes(dir)
  1077. for (opt,var,val) in DEFSYMBOLS:
  1078. if (opt=="ALWAYS") or (opt in opts): cmd += " /D" + var + "=" + val
  1079. if (opts.count('MSFORSCOPE')): cmd += ' /Zc:forScope-'
  1080. if (optlevel==1): cmd += " /MDd /Zi /RTCs /GS"
  1081. if (optlevel==2): cmd += " /MDd /Zi"
  1082. if (optlevel==3): cmd += " /MD /Zi /GS- /O2 /fp:fast"
  1083. if (optlevel==4):
  1084. cmd += " /MD /Zi /GS- /O2 /fp:fast /DFORCE_INLINING /DNDEBUG /GL"
  1085. cmd += " /Zp16" # jean-claude add /Zp16 insures correct static alignment for SSEx
  1086. cmd += " /Fd" + os.path.splitext(obj)[0] + ".pdb"
  1087. building = GetValueOption(opts, "BUILDING:")
  1088. if (building):
  1089. cmd += " /DBUILDING_" + building
  1090. if ("BIGOBJ" in opts) or GetTargetArch() == 'x64':
  1091. cmd += " /bigobj"
  1092. cmd += " /Zm300"
  1093. if 'EXCEPTIONS' in opts:
  1094. cmd += " /EHsc"
  1095. else:
  1096. cmd += " /D_HAS_EXCEPTIONS=0"
  1097. if 'RTTI' not in opts:
  1098. cmd += " /GR-"
  1099. cmd += " /W3 " + BracketNameWithQuotes(src)
  1100. oscmd(cmd)
  1101. else:
  1102. cmd = "icl "
  1103. if GetTargetArch() == 'x64':
  1104. cmd += "/favor:blend "
  1105. cmd += "/wd4996 /wd4275 /wd4267 /wd4101 /wd4273 "
  1106. cmd += "/DWINVER=0x600 "
  1107. cmd += "/Fo" + obj + " /c"
  1108. for x in ipath: cmd += " /I" + x
  1109. for (opt,dir) in INCDIRECTORIES:
  1110. if (opt=="ALWAYS") or (opt in opts): cmd += " /I" + BracketNameWithQuotes(dir)
  1111. for (opt,var,val) in DEFSYMBOLS:
  1112. if (opt=="ALWAYS") or (opt in opts): cmd += " /D" + var + "=" + val
  1113. if (opts.count('MSFORSCOPE')): cmd += ' /Zc:forScope-'
  1114. if (optlevel==1): cmd += " /MDd /Zi /RTCs /GS"
  1115. if (optlevel==2): cmd += " /MDd /Zi /arch:SSE3"
  1116. # core changes from jean-claude (dec 2011)
  1117. # ----------------------------------------
  1118. # performance will be seeked at level 3 & 4
  1119. # -----------------------------------------
  1120. if (optlevel==3):
  1121. cmd += " /MD /Zi /O2 /Oi /Ot /arch:SSE3"
  1122. cmd += " /Ob0"
  1123. cmd += " /Qipo-" # beware of IPO !!!
  1124. ## Lesson learned: Don't use /GL flag -> end result is MESSY
  1125. ## ----------------------------------------------------------------
  1126. if (optlevel==4):
  1127. cmd += " /MD /Zi /O3 /Oi /Ot /Ob0 /Yc /DNDEBUG" # /Ob0 a ete rajoute en cours de route a 47%
  1128. cmd += " /Qipo" # optimization multi file
  1129. # for 3 & 4 optimization levels
  1130. # -----------------------------
  1131. if (optlevel>=3):
  1132. cmd += " /fp:fast=2"
  1133. cmd += " /Qftz"
  1134. cmd += " /Qfp-speculation:fast"
  1135. cmd += " /Qopt-matmul" # needs /O2 or /O3
  1136. cmd += " /Qprec-div-"
  1137. cmd += " /Qsimd"
  1138. cmd += " /QxHost" # compile for target host; Compiling for distribs should probably strictly enforce /arch:..
  1139. cmd += " /Quse-intel-optimized-headers" # use intel optimized headers
  1140. cmd += " /Qparallel" # enable parallelization
  1141. cmd += " /Qvc10" # for Microsoft Visual C++ 2010
  1142. ## PCH files coexistence: the /Qpchi option causes the Intel C++ Compiler to name its
  1143. ## PCH files with a .pchi filename suffix and reduce build time.
  1144. ## The /Qpchi option is on by default but interferes with Microsoft libs; so use /Qpchi- to turn it off.
  1145. ## I need to have a deeper look at this since the compile time is quite influenced by this setting !!!
  1146. cmd += " /Qpchi-" # keep it this way!
  1147. ## Inlining seems to be an issue here ! (the linker doesn't find necessary info later on)
  1148. ## ------------------------------------
  1149. ## so don't use cmd += " /DFORCE_INLINING" (need to check why with Panda developpers!)
  1150. ## Inline expansion /Ob1 : Allow functions marked inline to be inlined.
  1151. ## Inline any /Ob2 : Inline functions deemed appropriate by compiler.
  1152. ## Ctor displacement /vd0 : Disable constructor displacement.
  1153. ## Choose this option only if no class constructors or destructors call virtual functions.
  1154. ## Use /vd1 (default) to enable. Alternate: #pragma vtordisp
  1155. ## Best case ptrs /vmb : Use best case "pointer to class member" representation.
  1156. ## Use this option if you always define a class before you declare a pointer to a member of the class.
  1157. ## The compiler will issue an error if it encounters a pointer declaration before the class is defined.
  1158. ## Alternate: #pragma pointers_to_members
  1159. cmd += " /Fd" + os.path.splitext(obj)[0] + ".pdb"
  1160. building = GetValueOption(opts, "BUILDING:")
  1161. if (building): cmd += " /DBUILDING_" + building
  1162. if ("BIGOBJ" in opts) or GetTargetArch() == 'x64':
  1163. cmd += " /bigobj"
  1164. # level of warnings and optimization reports
  1165. if GetVerbose():
  1166. cmd += " /W3 " # or /W4 or /Wall
  1167. cmd += " /Qopt-report:2 /Qopt-report-phase:hlo /Qopt-report-phase:hpo" # some optimization reports
  1168. else:
  1169. cmd += " /W1 "
  1170. cmd += " /EHa /Zm300"
  1171. cmd += " " + BracketNameWithQuotes(src)
  1172. oscmd(cmd)
  1173. if (COMPILER=="GCC"):
  1174. if (src.endswith(".c")): cmd = GetCC() +' -fPIC -c -o ' + obj
  1175. else: cmd = GetCXX()+' -std=gnu++11 -ftemplate-depth-70 -fPIC -c -o ' + obj
  1176. for (opt, dir) in INCDIRECTORIES:
  1177. if (opt=="ALWAYS") or (opt in opts): cmd += ' -I' + BracketNameWithQuotes(dir)
  1178. for (opt, dir) in FRAMEWORKDIRECTORIES:
  1179. if (opt=="ALWAYS") or (opt in opts): cmd += ' -F' + BracketNameWithQuotes(dir)
  1180. for (opt,var,val) in DEFSYMBOLS:
  1181. if (opt=="ALWAYS") or (opt in opts): cmd += ' -D' + var + '=' + val
  1182. for x in ipath: cmd += ' -I' + x
  1183. if not GetLinkAllStatic() and 'NOHIDDEN' not in opts:
  1184. cmd += ' -fvisibility=hidden'
  1185. # Mac-specific flags.
  1186. if GetTarget() == "darwin":
  1187. cmd += " -Wno-deprecated-declarations"
  1188. if SDK.get("MACOSX"):
  1189. cmd += " -isysroot " + SDK["MACOSX"]
  1190. if tuple(OSX_ARCHS) == ('arm64',):
  1191. cmd += " -mmacosx-version-min=11.0"
  1192. else:
  1193. cmd += " -mmacosx-version-min=10.9"
  1194. # Use libc++ to enable C++11 features.
  1195. cmd += " -stdlib=libc++"
  1196. for arch in OSX_ARCHS:
  1197. if 'NOARCH:' + arch.upper() not in opts:
  1198. cmd += " -arch %s" % arch
  1199. if "SYSROOT" in SDK:
  1200. if GetTarget() != "android":
  1201. cmd += ' --sysroot=%s' % (SDK["SYSROOT"])
  1202. cmd += ' -no-canonical-prefixes'
  1203. # Android-specific flags.
  1204. arch = GetTargetArch()
  1205. if GetTarget() == "android":
  1206. # Most of the specific optimization flags here were
  1207. # just copied from the default Android Makefiles.
  1208. if "ANDROID_GCC_TOOLCHAIN" in SDK:
  1209. cmd += ' -gcc-toolchain ' + SDK["ANDROID_GCC_TOOLCHAIN"].replace('\\', '/')
  1210. cmd += ' -ffunction-sections -funwind-tables'
  1211. cmd += ' -target ' + SDK["ANDROID_TRIPLE"]
  1212. if arch == 'armv7a':
  1213. cmd += ' -march=armv7-a -mfloat-abi=softfp -mfpu=vfpv3-d16'
  1214. elif arch == 'arm':
  1215. cmd += ' -march=armv5te -mtune=xscale -msoft-float'
  1216. elif arch == 'mips':
  1217. cmd += ' -mips32'
  1218. elif arch == 'mips64':
  1219. cmd += ' -fintegrated-as'
  1220. elif arch == 'x86':
  1221. cmd += ' -march=i686 -mssse3 -mfpmath=sse -m32'
  1222. cmd += ' -mstackrealign'
  1223. elif arch == 'x86_64':
  1224. cmd += ' -march=x86-64 -msse4.2 -mpopcnt -m64'
  1225. cmd += " -Wa,--noexecstack"
  1226. # Do we want thumb or arm instructions?
  1227. if arch != 'arm64' and arch.startswith('arm'):
  1228. if optlevel >= 3:
  1229. cmd += ' -mthumb'
  1230. else:
  1231. cmd += ' -marm'
  1232. # Enable SIMD instructions if requested
  1233. if arch != 'arm64' and arch.startswith('arm') and PkgSkip("NEON") == 0:
  1234. cmd += ' -mfpu=neon'
  1235. else:
  1236. cmd += " -pthread"
  1237. if not src.endswith(".c"):
  1238. # We don't use exceptions for most modules.
  1239. if 'EXCEPTIONS' in opts:
  1240. cmd += " -fexceptions"
  1241. else:
  1242. cmd += " -fno-exceptions"
  1243. if src.endswith(".mm"):
  1244. # Work around Apple compiler bug.
  1245. cmd += " -U__EXCEPTIONS"
  1246. target = GetTarget()
  1247. if 'RTTI' not in opts and target != "darwin":
  1248. # We always disable RTTI on Android for memory usage reasons.
  1249. if optlevel >= 4 or target == "android":
  1250. cmd += " -fno-rtti"
  1251. if ('SSE2' in opts or not PkgSkip("SSE2")) and not arch.startswith("arm") and arch != 'aarch64':
  1252. cmd += " -msse2"
  1253. # Needed by both Python, Panda, Eigen, all of which break aliasing rules.
  1254. cmd += " -fno-strict-aliasing"
  1255. # Certain clang versions crash when passing these math flags while
  1256. # compiling Objective-C++ code
  1257. if not src.endswith(".m") and not src.endswith(".mm"):
  1258. if optlevel >= 3:
  1259. cmd += " -ffast-math -fno-stack-protector"
  1260. if optlevel == 3:
  1261. # Fast math is nice, but we'd like to see NaN in dev builds.
  1262. cmd += " -fno-finite-math-only"
  1263. # Make sure this is off to avoid GCC/Eigen bug (see GitHub #228)
  1264. cmd += " -fno-unsafe-math-optimizations"
  1265. if (optlevel==1): cmd += " -ggdb -D_DEBUG"
  1266. if (optlevel==2): cmd += " -O1 -D_DEBUG"
  1267. if (optlevel==3): cmd += " -O2"
  1268. if (optlevel==4): cmd += " -O3 -DNDEBUG"
  1269. # Enable more warnings.
  1270. cmd += " -Wall -Wno-unused-function"
  1271. if not src.endswith(".c"):
  1272. cmd += " -Wno-reorder"
  1273. # Ignore unused variables in NDEBUG builds, often used in asserts.
  1274. if optlevel == 4:
  1275. cmd += " -Wno-unused-variable"
  1276. if src.endswith(".c"):
  1277. cmd += ' ' + CFLAGS
  1278. else:
  1279. cmd += ' ' + CXXFLAGS
  1280. cmd = cmd.rstrip()
  1281. building = GetValueOption(opts, "BUILDING:")
  1282. if (building): cmd += " -DBUILDING_" + building
  1283. cmd += ' ' + BracketNameWithQuotes(src)
  1284. oscmd(cmd)
  1285. ########################################################################
  1286. ##
  1287. ## CompileBison
  1288. ##
  1289. ########################################################################
  1290. def CompileBison(wobj, wsrc, opts):
  1291. ifile = os.path.basename(wsrc)
  1292. wdsth = GetOutputDir() + "/include/" + ifile[:-4] + ".h"
  1293. wdsth2 = GetOutputDir() + "/tmp/" + ifile + ".h"
  1294. wdstc = GetOutputDir() + "/tmp/" + ifile + ".cxx"
  1295. pre = GetValueOption(opts, "BISONPREFIX_")
  1296. bison = GetBison()
  1297. if bison is None:
  1298. # We don't have bison. See if there is a prebuilt file.
  1299. base, ext = os.path.splitext(wsrc)
  1300. if os.path.isfile(base + '.h.prebuilt') and \
  1301. os.path.isfile(base + '.cxx.prebuilt'):
  1302. CopyFile(wdstc, base + '.cxx.prebuilt')
  1303. CopyFile(wdsth, base + '.h.prebuilt')
  1304. CopyFile(wdsth2, base + '.h.prebuilt')
  1305. else:
  1306. exit('Could not find bison!')
  1307. else:
  1308. oscmd(bison + ' -y -d -o'+GetOutputDir()+'/tmp/'+ifile+'.c -p '+pre+' '+wsrc)
  1309. CopyFile(wdstc, GetOutputDir()+"/tmp/"+ifile+".c")
  1310. CopyFile(wdsth, GetOutputDir()+"/tmp/"+ifile+".h")
  1311. # Finally, compile the generated source file.
  1312. CompileCxx(wobj, wdstc, opts + ["FLEX"])
  1313. ########################################################################
  1314. ##
  1315. ## CompileFlex
  1316. ##
  1317. ########################################################################
  1318. def CompileFlex(wobj,wsrc,opts):
  1319. ifile = os.path.basename(wsrc)
  1320. wdst = GetOutputDir()+"/tmp/"+ifile+".cxx"
  1321. pre = GetValueOption(opts, "BISONPREFIX_")
  1322. dashi = opts.count("FLEXDASHI")
  1323. flex = GetFlex()
  1324. want_version = GetValueOption(opts, "FLEXVERSION:")
  1325. if flex and want_version:
  1326. # Is flex at the required version for this file?
  1327. want_version = tuple(map(int, want_version.split('.')))
  1328. have_version = GetFlexVersion()
  1329. if want_version > have_version:
  1330. Warn("Skipping flex %s for file %s, need at least %s" % (
  1331. '.'.join(map(str, have_version)),
  1332. ifile,
  1333. '.'.join(map(str, want_version)),
  1334. ))
  1335. flex = None
  1336. if flex is None:
  1337. # We don't have flex. See if there is a prebuilt file.
  1338. base, ext = os.path.splitext(wsrc)
  1339. if os.path.isfile(base + '.cxx.prebuilt'):
  1340. CopyFile(wdst, base + '.cxx.prebuilt')
  1341. else:
  1342. exit('Could not find flex!')
  1343. else:
  1344. if (dashi):
  1345. oscmd(flex + " -i -P" + pre + " -o"+wdst+" "+wsrc)
  1346. else:
  1347. oscmd(flex + " -P" + pre + " -o"+wdst+" "+wsrc)
  1348. # Finally, compile the generated source file.
  1349. CompileCxx(wobj, wdst, opts + ["FLEX"])
  1350. ########################################################################
  1351. ##
  1352. ## CompileIgate
  1353. ##
  1354. ########################################################################
  1355. def CompileIgate(woutd,wsrc,opts):
  1356. outbase = os.path.basename(woutd)[:-3]
  1357. woutc = GetOutputDir()+"/tmp/"+outbase+"_igate.cxx"
  1358. srcdir = GetValueOption(opts, "SRCDIR:")
  1359. module = GetValueOption(opts, "IMOD:")
  1360. library = GetValueOption(opts, "ILIB:")
  1361. ipath = GetListOption(opts, "DIR:")
  1362. if (PkgSkip("PYTHON")):
  1363. WriteFile(woutc, "")
  1364. WriteFile(woutd, "")
  1365. ConditionalWriteFile(woutd, "")
  1366. return
  1367. if not CrossCompiling():
  1368. # If we're compiling for this platform, we can use the one we've built.
  1369. cmd = os.path.join(GetOutputDir(), 'bin', 'interrogate')
  1370. else:
  1371. # Assume that interrogate is on the PATH somewhere.
  1372. cmd = 'interrogate'
  1373. if GetVerbose():
  1374. cmd += ' -v'
  1375. cmd += ' -srcdir %s -I%s' % (srcdir, srcdir)
  1376. cmd += ' -DCPPPARSER -D__STDC__=1 -D__cplusplus=201103L'
  1377. if (COMPILER=="MSVC"):
  1378. cmd += ' -D_WIN32'
  1379. if GetTargetArch() == 'x64':
  1380. cmd += ' -D_WIN64 -D_M_X64 -D_M_AMD64'
  1381. else:
  1382. cmd += ' -D_M_IX86'
  1383. # NOTE: this 1600 value is the version number for VC2010.
  1384. cmd += ' -D_MSC_VER=1600 -D"__declspec(param)=" -D__cdecl -D_near -D_far -D__near -D__far -D__stdcall'
  1385. if (COMPILER=="GCC"):
  1386. cmd += ' -D__attribute__\\(x\\)='
  1387. target_arch = GetTargetArch()
  1388. if target_arch in ("x86_64", "amd64"):
  1389. cmd += ' -D_LP64'
  1390. elif target_arch in ('aarch64', 'arm64'):
  1391. cmd += ' -D_LP64 -D__LP64__ -D__aarch64__'
  1392. else:
  1393. cmd += ' -D__i386__'
  1394. target = GetTarget()
  1395. if target == 'darwin':
  1396. cmd += ' -D__APPLE__'
  1397. elif target == 'android':
  1398. cmd += ' -D__ANDROID__'
  1399. optlevel = GetOptimizeOption(opts)
  1400. if (optlevel==1): cmd += ' -D_DEBUG'
  1401. if (optlevel==2): cmd += ' -D_DEBUG'
  1402. if (optlevel==3): pass
  1403. if (optlevel==4): cmd += ' -DNDEBUG'
  1404. cmd += ' -oc ' + woutc + ' -od ' + woutd
  1405. cmd += ' -fnames -string -refcount -assert -python-native'
  1406. cmd += ' -S' + GetOutputDir() + '/include/parser-inc'
  1407. # Add -I, -S and -D flags
  1408. for x in ipath:
  1409. cmd += ' -I' + BracketNameWithQuotes(x)
  1410. for (opt,dir) in INCDIRECTORIES:
  1411. if (opt=="ALWAYS") or (opt in opts):
  1412. cmd += ' -S' + BracketNameWithQuotes(dir)
  1413. for (opt,var,val) in DEFSYMBOLS:
  1414. if (opt=="ALWAYS") or (opt in opts):
  1415. cmd += ' -D' + var + '=' + val
  1416. #building = GetValueOption(opts, "BUILDING:")
  1417. #if (building): cmd += " -DBUILDING_"+building
  1418. cmd += ' -module ' + module + ' -library ' + library
  1419. for x in wsrc:
  1420. if (x.startswith("/")):
  1421. cmd += ' ' + BracketNameWithQuotes(x)
  1422. else:
  1423. cmd += ' ' + BracketNameWithQuotes(os.path.basename(x))
  1424. oscmd(cmd)
  1425. ########################################################################
  1426. ##
  1427. ## CompileImod
  1428. ##
  1429. ########################################################################
  1430. def CompileImod(wobj, wsrc, opts):
  1431. module = GetValueOption(opts, "IMOD:")
  1432. library = GetValueOption(opts, "ILIB:")
  1433. if (COMPILER=="MSVC"):
  1434. woutc = wobj[:-4]+".cxx"
  1435. if (COMPILER=="GCC"):
  1436. woutc = wobj[:-2]+".cxx"
  1437. if (PkgSkip("PYTHON")):
  1438. WriteFile(woutc, "")
  1439. CompileCxx(wobj, woutc, opts)
  1440. return
  1441. if not CrossCompiling():
  1442. # If we're compiling for this platform, we can use the one we've built.
  1443. cmd = os.path.join(GetOutputDir(), 'bin', 'interrogate_module')
  1444. else:
  1445. # Assume that interrogate_module is on the PATH somewhere.
  1446. cmd = 'interrogate_module'
  1447. cmd += ' -oc ' + woutc + ' -module ' + module + ' -library ' + library + ' -python-native'
  1448. importmod = GetValueOption(opts, "IMPORT:")
  1449. if importmod:
  1450. cmd += ' -import ' + importmod
  1451. for x in wsrc: cmd += ' ' + BracketNameWithQuotes(x)
  1452. oscmd(cmd)
  1453. CompileCxx(wobj,woutc,opts)
  1454. return
  1455. ########################################################################
  1456. ##
  1457. ## CompileLib
  1458. ##
  1459. ########################################################################
  1460. def CompileLib(lib, obj, opts):
  1461. if (COMPILER=="MSVC"):
  1462. if not BOOUSEINTELCOMPILER:
  1463. #Use MSVC Linker
  1464. cmd = 'link /lib /nologo'
  1465. if GetOptimizeOption(opts) == 4:
  1466. cmd += " /LTCG"
  1467. if HasTargetArch():
  1468. cmd += " /MACHINE:" + GetTargetArch().upper()
  1469. cmd += ' /OUT:' + BracketNameWithQuotes(lib)
  1470. for x in obj:
  1471. if not x.endswith('.lib'):
  1472. cmd += ' ' + BracketNameWithQuotes(x)
  1473. oscmd(cmd)
  1474. else:
  1475. # Choose Intel linker; from Jean-Claude
  1476. cmd = 'xilink /verbose:lib /lib '
  1477. if HasTargetArch():
  1478. cmd += " /MACHINE:" + GetTargetArch().upper()
  1479. cmd += ' /OUT:' + BracketNameWithQuotes(lib)
  1480. for x in obj: cmd += ' ' + BracketNameWithQuotes(x)
  1481. cmd += ' /LIBPATH:"C:\\Program Files (x86)\\Intel\\Composer XE 2011 SP1\\ipp\\lib\\ia32"'
  1482. cmd += ' /LIBPATH:"C:\\Program Files (x86)\\Intel\\Composer XE 2011 SP1\\TBB\\Lib\\ia32\\vc10"'
  1483. cmd += ' /LIBPATH:"C:\\Program Files (x86)\\Intel\\Composer XE 2011 SP1\\compiler\\lib\\ia32"'
  1484. oscmd(cmd)
  1485. if (COMPILER=="GCC"):
  1486. if GetTarget() == 'darwin':
  1487. cmd = 'libtool -static -o ' + BracketNameWithQuotes(lib)
  1488. else:
  1489. cmd = GetAR() + ' cru ' + BracketNameWithQuotes(lib)
  1490. for x in obj:
  1491. if GetLinkAllStatic() and x.endswith('.a'):
  1492. continue
  1493. cmd += ' ' + BracketNameWithQuotes(x)
  1494. oscmd(cmd)
  1495. oscmd(GetRanlib() + ' ' + BracketNameWithQuotes(lib))
  1496. ########################################################################
  1497. ##
  1498. ## CompileLink
  1499. ##
  1500. ########################################################################
  1501. def CompileLink(dll, obj, opts):
  1502. if (COMPILER=="MSVC"):
  1503. if not BOOUSEINTELCOMPILER:
  1504. cmd = "link /nologo "
  1505. if HasTargetArch():
  1506. cmd += " /MACHINE:" + GetTargetArch().upper()
  1507. if ("MFC" not in opts):
  1508. cmd += " /NOD:MFC90.LIB /NOD:MFC80.LIB /NOD:LIBCMT"
  1509. cmd += " /NOD:LIBCI.LIB /DEBUG"
  1510. cmd += " /nod:libc /nod:libcmtd /nod:atlthunk /nod:atls /nod:atlsd"
  1511. if (GetOrigExt(dll) != ".exe"): cmd += " /DLL"
  1512. optlevel = GetOptimizeOption(opts)
  1513. if (optlevel==1): cmd += " /MAP /MAPINFO:EXPORTS /NOD:MSVCRT.LIB /NOD:MSVCPRT.LIB /NOD:MSVCIRT.LIB"
  1514. if (optlevel==2): cmd += " /MAP:NUL /NOD:MSVCRT.LIB /NOD:MSVCPRT.LIB /NOD:MSVCIRT.LIB"
  1515. if (optlevel==3): cmd += " /MAP:NUL /NOD:MSVCRTD.LIB /NOD:MSVCPRTD.LIB /NOD:MSVCIRTD.LIB"
  1516. if (optlevel==4): cmd += " /MAP:NUL /LTCG /NOD:MSVCRTD.LIB /NOD:MSVCPRTD.LIB /NOD:MSVCIRTD.LIB"
  1517. if ("MFC" in opts):
  1518. if (optlevel<=2): cmd += " /NOD:MSVCRTD.LIB mfcs100d.lib MSVCRTD.lib"
  1519. else: cmd += " /NOD:MSVCRT.LIB mfcs100.lib MSVCRT.lib"
  1520. cmd += " /FIXED:NO /OPT:REF /STACK:4194304 /INCREMENTAL:NO "
  1521. cmd += ' /OUT:' + BracketNameWithQuotes(dll)
  1522. if not PkgSkip("PYTHON"):
  1523. # If we're building without Python, don't pick it up implicitly.
  1524. if "PYTHON" not in opts:
  1525. pythonv = SDK["PYTHONVERSION"].replace('.', '')
  1526. if optlevel <= 2:
  1527. cmd += ' /NOD:{}d.lib'.format(pythonv)
  1528. else:
  1529. cmd += ' /NOD:{}.lib'.format(pythonv)
  1530. # Set the subsystem. Specify that we want to target Windows XP.
  1531. subsystem = GetValueOption(opts, "SUBSYSTEM:") or "CONSOLE"
  1532. cmd += " /SUBSYSTEM:" + subsystem
  1533. if GetTargetArch() == 'x64':
  1534. cmd += ",6.00"
  1535. else:
  1536. cmd += ",6.00"
  1537. if dll.endswith(".dll") or dll.endswith(".pyd"):
  1538. cmd += ' /IMPLIB:' + GetOutputDir() + '/lib/' + os.path.splitext(os.path.basename(dll))[0] + ".lib"
  1539. for (opt, dir) in LIBDIRECTORIES:
  1540. if (opt=="ALWAYS") or (opt in opts):
  1541. cmd += ' /LIBPATH:' + BracketNameWithQuotes(dir)
  1542. for x in obj:
  1543. if x.endswith(".dll") or x.endswith(".pyd"):
  1544. cmd += ' ' + GetOutputDir() + '/lib/' + os.path.splitext(os.path.basename(x))[0] + ".lib"
  1545. elif x.endswith(".lib"):
  1546. dname = os.path.splitext(os.path.basename(x))[0] + ".dll"
  1547. if (GetOrigExt(x) != ".ilb" and os.path.exists(GetOutputDir()+"/bin/" + dname)):
  1548. exit("Error: in makepanda, specify "+dname+", not "+x)
  1549. cmd += ' ' + BracketNameWithQuotes(x)
  1550. elif x.endswith(".def"):
  1551. cmd += ' /DEF:' + BracketNameWithQuotes(x)
  1552. elif x.endswith(".dat"):
  1553. pass
  1554. else:
  1555. cmd += ' ' + BracketNameWithQuotes(x)
  1556. if (GetOrigExt(dll)==".exe" and "NOICON" not in opts):
  1557. cmd += " " + GetOutputDir() + "/tmp/pandaIcon.res"
  1558. for (opt, name) in LIBNAMES:
  1559. if (opt=="ALWAYS") or (opt in opts):
  1560. cmd += " " + BracketNameWithQuotes(name)
  1561. oscmd(cmd)
  1562. else:
  1563. cmd = "xilink"
  1564. if GetVerbose(): cmd += " /verbose:lib"
  1565. if HasTargetArch():
  1566. cmd += " /MACHINE:" + GetTargetArch().upper()
  1567. if ("MFC" not in opts):
  1568. cmd += " /NOD:MFC90.LIB /NOD:MFC80.LIB /NOD:LIBCMT"
  1569. cmd += " /NOD:LIBCI.LIB /DEBUG"
  1570. cmd += " /nod:libc /nod:libcmtd /nod:atlthunk /nod:atls"
  1571. cmd += ' /LIBPATH:"C:\\Program Files (x86)\\Intel\\Composer XE 2011 SP1\\ipp\\lib\\ia32"'
  1572. cmd += ' /LIBPATH:"C:\\Program Files (x86)\\Intel\\Composer XE 2011 SP1\\TBB\\Lib\\ia32\\vc10"'
  1573. cmd += ' /LIBPATH:"C:\\Program Files (x86)\\Intel\\Composer XE 2011 SP1\\compiler\\lib\\ia32"'
  1574. if (GetOrigExt(dll) != ".exe"): cmd += " /DLL"
  1575. optlevel = GetOptimizeOption(opts)
  1576. if (optlevel==1): cmd += " /MAP /MAPINFO:EXPORTS /NOD:MSVCRT.LIB /NOD:MSVCPRT.LIB /NOD:MSVCIRT.LIB"
  1577. if (optlevel==2): cmd += " /MAP:NUL /NOD:MSVCRT.LIB /NOD:MSVCPRT.LIB /NOD:MSVCIRT.LIB"
  1578. if (optlevel==3): cmd += " /MAP:NUL /NOD:MSVCRTD.LIB /NOD:MSVCPRTD.LIB /NOD:MSVCIRTD.LIB"
  1579. if (optlevel==4): cmd += " /MAP:NUL /LTCG /NOD:MSVCRTD.LIB /NOD:MSVCPRTD.LIB /NOD:MSVCIRTD.LIB"
  1580. if ("MFC" in opts):
  1581. if (optlevel<=2): cmd += " /NOD:MSVCRTD.LIB mfcs100d.lib MSVCRTD.lib"
  1582. else: cmd += " /NOD:MSVCRT.LIB mfcs100.lib MSVCRT.lib"
  1583. cmd += " /FIXED:NO /OPT:REF /STACK:4194304 /INCREMENTAL:NO "
  1584. cmd += ' /OUT:' + BracketNameWithQuotes(dll)
  1585. subsystem = GetValueOption(opts, "SUBSYSTEM:")
  1586. if subsystem:
  1587. cmd += " /SUBSYSTEM:" + subsystem
  1588. if dll.endswith(".dll"):
  1589. cmd += ' /IMPLIB:' + GetOutputDir() + '/lib/' + os.path.splitext(os.path.basename(dll))[0] + ".lib"
  1590. for (opt, dir) in LIBDIRECTORIES:
  1591. if (opt=="ALWAYS") or (opt in opts):
  1592. cmd += ' /LIBPATH:' + BracketNameWithQuotes(dir)
  1593. for x in obj:
  1594. if x.endswith(".dll") or x.endswith(".pyd"):
  1595. cmd += ' ' + GetOutputDir() + '/lib/' + os.path.splitext(os.path.basename(x))[0] + ".lib"
  1596. elif x.endswith(".lib"):
  1597. dname = os.path.splitext(dll)[0]+".dll"
  1598. if (GetOrigExt(x) != ".ilb" and os.path.exists(GetOutputDir()+"/bin/" + os.path.splitext(os.path.basename(x))[0] + ".dll")):
  1599. exit("Error: in makepanda, specify "+dname+", not "+x)
  1600. cmd += ' ' + BracketNameWithQuotes(x)
  1601. elif x.endswith(".def"):
  1602. cmd += ' /DEF:' + BracketNameWithQuotes(x)
  1603. elif x.endswith(".dat"):
  1604. pass
  1605. else:
  1606. cmd += ' ' + BracketNameWithQuotes(x)
  1607. if (GetOrigExt(dll)==".exe" and "NOICON" not in opts):
  1608. cmd += " " + GetOutputDir() + "/tmp/pandaIcon.res"
  1609. for (opt, name) in LIBNAMES:
  1610. if (opt=="ALWAYS") or (opt in opts):
  1611. cmd += " " + BracketNameWithQuotes(name)
  1612. oscmd(cmd)
  1613. if COMPILER == "GCC":
  1614. cxx = GetCXX()
  1615. if GetOrigExt(dll) == ".exe":
  1616. cmd = cxx + ' -o ' + dll + ' -L' + GetOutputDir() + '/lib -L' + GetOutputDir() + '/tmp'
  1617. if GetTarget() == "android":
  1618. # Necessary to work around an issue with libandroid depending on vendor libraries
  1619. cmd += ' -Wl,--allow-shlib-undefined'
  1620. else:
  1621. if (GetTarget() == "darwin"):
  1622. cmd = cxx
  1623. if GetOrigExt(dll) == ".pyd":
  1624. cmd += ' -bundle -undefined dynamic_lookup'
  1625. elif "BUNDLE" in opts:
  1626. cmd += ' -bundle'
  1627. else:
  1628. install_name = '@loader_path/../lib/' + os.path.basename(dll)
  1629. cmd += ' -dynamiclib -install_name ' + install_name
  1630. cmd += ' -compatibility_version ' + MAJOR_VERSION + ' -current_version ' + VERSION
  1631. cmd += ' -o ' + dll + ' -L' + GetOutputDir() + '/lib -L' + GetOutputDir() + '/tmp'
  1632. else:
  1633. cmd = cxx + ' -shared'
  1634. # Always set soname on Android to avoid a linker warning when loading the library.
  1635. if "MODULE" not in opts or GetTarget() == 'android':
  1636. cmd += " -Wl,-soname=" + os.path.basename(dll)
  1637. cmd += ' -o ' + dll + ' -L' + GetOutputDir() + '/lib -L' + GetOutputDir() + '/tmp'
  1638. for x in obj:
  1639. if GetOrigExt(x) != ".dat":
  1640. cmd += ' ' + x
  1641. if (GetOrigExt(dll) == ".exe" and GetTarget() == 'windows' and "NOICON" not in opts):
  1642. cmd += " " + GetOutputDir() + "/tmp/pandaIcon.res"
  1643. # macOS specific flags.
  1644. if GetTarget() == 'darwin':
  1645. cmd += " -headerpad_max_install_names"
  1646. if SDK.get("MACOSX"):
  1647. cmd += " -isysroot " + SDK["MACOSX"] + " -Wl,-syslibroot," + SDK["MACOSX"]
  1648. if tuple(OSX_ARCHS) == ('arm64',):
  1649. cmd += " -mmacosx-version-min=11.0"
  1650. else:
  1651. cmd += " -mmacosx-version-min=10.9"
  1652. # Use libc++ to enable C++11 features.
  1653. cmd += " -stdlib=libc++"
  1654. for arch in OSX_ARCHS:
  1655. if 'NOARCH:' + arch.upper() not in opts:
  1656. cmd += " -arch %s" % arch
  1657. elif GetTarget() == 'android':
  1658. arch = GetTargetArch()
  1659. if "ANDROID_GCC_TOOLCHAIN" in SDK:
  1660. cmd += ' -gcc-toolchain ' + SDK["ANDROID_GCC_TOOLCHAIN"].replace('\\', '/')
  1661. cmd += " -Wl,-z,noexecstack -Wl,-z,relro -Wl,-z,now"
  1662. cmd += ' -target ' + SDK["ANDROID_TRIPLE"]
  1663. if arch == 'armv7a':
  1664. cmd += " -march=armv7-a -Wl,--fix-cortex-a8"
  1665. elif arch == 'mips':
  1666. cmd += ' -mips32'
  1667. cmd += ' -lc -lm'
  1668. else:
  1669. cmd += " -pthread"
  1670. if "SYSROOT" in SDK:
  1671. cmd += " --sysroot=%s -no-canonical-prefixes" % (SDK["SYSROOT"])
  1672. if LDFLAGS != "":
  1673. cmd += " " + LDFLAGS
  1674. # Don't link libraries with Python, except on Android.
  1675. if "PYTHON" in opts and GetOrigExt(dll) != ".exe" and GetTarget() != 'android':
  1676. opts = opts[:]
  1677. opts.remove("PYTHON")
  1678. for (opt, dir) in LIBDIRECTORIES:
  1679. if (opt=="ALWAYS") or (opt in opts):
  1680. cmd += ' -L' + BracketNameWithQuotes(dir)
  1681. for (opt, dir) in FRAMEWORKDIRECTORIES:
  1682. if (opt=="ALWAYS") or (opt in opts):
  1683. cmd += ' -F' + BracketNameWithQuotes(dir)
  1684. for (opt, name) in LIBNAMES:
  1685. if (opt=="ALWAYS") or (opt in opts):
  1686. cmd += ' ' + BracketNameWithQuotes(name)
  1687. if GetTarget() != 'freebsd':
  1688. cmd += " -ldl"
  1689. oscmd(cmd)
  1690. if GetOptimizeOption(opts) == 4 and GetTarget() in ('linux', 'android'):
  1691. oscmd(GetStrip() + " --strip-unneeded " + BracketNameWithQuotes(dll))
  1692. os.system("chmod +x " + BracketNameWithQuotes(dll))
  1693. if dll.endswith("." + MAJOR_VERSION + ".dylib"):
  1694. newdll = dll[:-6-len(MAJOR_VERSION)] + "dylib"
  1695. if os.path.isfile(newdll):
  1696. os.remove(newdll)
  1697. oscmd("ln -s " + BracketNameWithQuotes(os.path.basename(dll)) + " " + BracketNameWithQuotes(newdll))
  1698. elif dll.endswith("." + MAJOR_VERSION):
  1699. newdll = dll[:-len(MAJOR_VERSION)-1]
  1700. if os.path.isfile(newdll):
  1701. os.remove(newdll)
  1702. oscmd("ln -s " + BracketNameWithQuotes(os.path.basename(dll)) + " " + BracketNameWithQuotes(newdll))
  1703. ##########################################################################################
  1704. #
  1705. # CompileEgg
  1706. #
  1707. ##########################################################################################
  1708. def CompileEgg(eggfile, src, opts):
  1709. pz = False
  1710. if eggfile.endswith(".pz"):
  1711. pz = True
  1712. eggfile = eggfile[:-3]
  1713. # Determine the location of the pzip and flt2egg tools.
  1714. if CrossCompiling():
  1715. # We may not be able to use our generated versions of these tools,
  1716. # so we'll expect them to already be present in the PATH.
  1717. pzip = 'pzip'
  1718. flt2egg = 'flt2egg'
  1719. else:
  1720. # If we're compiling for this machine, we can use the binaries we've built.
  1721. pzip = os.path.join(GetOutputDir(), 'bin', 'pzip')
  1722. flt2egg = os.path.join(GetOutputDir(), 'bin', 'flt2egg')
  1723. if not os.path.isfile(pzip):
  1724. pzip = 'pzip'
  1725. if not os.path.isfile(flt2egg):
  1726. flt2egg = 'flt2egg'
  1727. if src.endswith(".egg"):
  1728. CopyFile(eggfile, src)
  1729. elif src.endswith(".flt"):
  1730. oscmd(flt2egg + ' -ps keep -o ' + BracketNameWithQuotes(eggfile) + ' ' + BracketNameWithQuotes(src))
  1731. if pz:
  1732. if zlib:
  1733. WriteBinaryFile(eggfile + '.pz', zlib.compress(ReadBinaryFile(eggfile)))
  1734. os.remove(eggfile)
  1735. else:
  1736. oscmd(pzip + ' ' + BracketNameWithQuotes(eggfile))
  1737. ##########################################################################################
  1738. #
  1739. # CompileRes, CompileRsrc
  1740. #
  1741. ##########################################################################################
  1742. def CompileRes(target, src, opts):
  1743. """Compiles a Windows .rc file into a .res file."""
  1744. ipath = GetListOption(opts, "DIR:")
  1745. if (COMPILER == "MSVC"):
  1746. cmd = "rc"
  1747. cmd += " /Fo" + BracketNameWithQuotes(target)
  1748. for x in ipath: cmd += " /I" + x
  1749. for (opt,dir) in INCDIRECTORIES:
  1750. if (opt=="ALWAYS") or (opt in opts):
  1751. cmd += " /I" + BracketNameWithQuotes(dir)
  1752. for (opt,var,val) in DEFSYMBOLS:
  1753. if (opt=="ALWAYS") or (opt in opts):
  1754. cmd += " /D" + var + "=" + val
  1755. cmd += " " + BracketNameWithQuotes(src)
  1756. else:
  1757. cmd = "windres"
  1758. for x in ipath: cmd += " -I" + x
  1759. for (opt,dir) in INCDIRECTORIES:
  1760. if (opt=="ALWAYS") or (opt in opts):
  1761. cmd += " -I" + BracketNameWithQuotes(dir)
  1762. for (opt,var,val) in DEFSYMBOLS:
  1763. if (opt=="ALWAYS") or (opt in opts):
  1764. cmd += " -D" + var + "=" + val
  1765. cmd += " -i " + BracketNameWithQuotes(src)
  1766. cmd += " -o " + BracketNameWithQuotes(target)
  1767. oscmd(cmd)
  1768. def CompileRsrc(target, src, opts):
  1769. """Compiles a Mac OS .r file into an .rsrc file."""
  1770. ipath = GetListOption(opts, "DIR:")
  1771. if os.path.isfile("/usr/bin/Rez"):
  1772. cmd = "Rez -useDF"
  1773. elif os.path.isfile("/Library/Developer/CommandLineTools/usr/bin/Rez"):
  1774. cmd = "/Library/Developer/CommandLineTools/usr/bin/Rez -useDF"
  1775. else:
  1776. cmd = "/Developer/Tools/Rez -useDF"
  1777. cmd += " -o " + BracketNameWithQuotes(target)
  1778. for x in ipath:
  1779. cmd += " -i " + x
  1780. for (opt,dir) in INCDIRECTORIES:
  1781. if (opt=="ALWAYS") or (opt in opts):
  1782. cmd += " -i " + BracketNameWithQuotes(dir)
  1783. for (opt,var,val) in DEFSYMBOLS:
  1784. if (opt=="ALWAYS") or (opt in opts):
  1785. if (val == ""):
  1786. cmd += " -d " + var
  1787. else:
  1788. cmd += " -d " + var + " = " + val
  1789. cmd += " " + BracketNameWithQuotes(src)
  1790. oscmd(cmd)
  1791. ##########################################################################################
  1792. #
  1793. # CompileJava (Android only)
  1794. #
  1795. ##########################################################################################
  1796. def CompileJava(target, src, opts):
  1797. """Compiles a .java file into a .class file."""
  1798. if GetHost() == 'android':
  1799. cmd = "ecj "
  1800. else:
  1801. cmd = "javac -bootclasspath " + BracketNameWithQuotes(SDK["ANDROID_JAR"]) + " "
  1802. optlevel = GetOptimizeOption(opts)
  1803. if optlevel >= 4:
  1804. cmd += "-debug:none "
  1805. cmd += "-cp " + GetOutputDir() + "/classes "
  1806. cmd += "-d " + GetOutputDir() + "/classes "
  1807. cmd += BracketNameWithQuotes(src)
  1808. oscmd(cmd)
  1809. ##########################################################################################
  1810. #
  1811. # FreezePy
  1812. #
  1813. ##########################################################################################
  1814. def FreezePy(target, inputs, opts):
  1815. assert len(inputs) > 0
  1816. cmdstr = BracketNameWithQuotes(SDK["PYTHONEXEC"].replace('\\', '/')) + " "
  1817. cmdstr += "-B "
  1818. cmdstr += os.path.join(GetOutputDir(), "direct", "dist", "pfreeze.py")
  1819. if 'FREEZE_STARTUP' in opts:
  1820. cmdstr += " -s"
  1821. if GetOrigExt(target) == '.exe':
  1822. src = inputs.pop(0)
  1823. else:
  1824. src = ""
  1825. for i in inputs:
  1826. i = os.path.splitext(i)[0]
  1827. i = i.replace('/', '.')
  1828. if i.startswith('direct.src'):
  1829. i = i.replace('.src.', '.')
  1830. cmdstr += " -i " + i
  1831. cmdstr += " -o " + target + " " + src
  1832. if ("LINK_PYTHON_STATIC" in opts):
  1833. os.environ["LINK_PYTHON_STATIC"] = "1"
  1834. oscmd(cmdstr)
  1835. if ("LINK_PYTHON_STATIC" in os.environ):
  1836. del os.environ["LINK_PYTHON_STATIC"]
  1837. if (not os.path.exists(target)):
  1838. exit("FREEZER_ERROR")
  1839. ##########################################################################################
  1840. #
  1841. # CompileBundle
  1842. #
  1843. ##########################################################################################
  1844. def CompileBundle(target, inputs, opts):
  1845. assert GetTarget() == "darwin", 'bundles can only be made for macOS'
  1846. plist = None
  1847. resources = []
  1848. objects = []
  1849. for i in inputs:
  1850. if i.endswith(".plist"):
  1851. if plist is not None:
  1852. exit("Only one plist file can be used when creating a bundle!")
  1853. plist = i
  1854. elif i.endswith(".rsrc") or i.endswith(".icns"):
  1855. resources.append(i)
  1856. elif GetOrigExt(i) == ".obj" or GetOrigExt(i) in SUFFIX_LIB or GetOrigExt(i) in SUFFIX_DLL:
  1857. objects.append(i)
  1858. else:
  1859. exit("Don't know how to bundle file %s" % i)
  1860. # Now link the object files to form the bundle.
  1861. if plist is None:
  1862. exit("One plist file must be used when creating a bundle!")
  1863. bundleName = plistlib.load(plist)["CFBundleExecutable"]
  1864. oscmd("rm -rf %s" % target)
  1865. oscmd("mkdir -p %s/Contents/MacOS/" % target)
  1866. oscmd("mkdir -p %s/Contents/Resources/" % target)
  1867. if target.endswith(".app"):
  1868. SetOrigExt("%s/Contents/MacOS/%s" % (target, bundleName), ".exe")
  1869. else:
  1870. SetOrigExt("%s/Contents/MacOS/%s" % (target, bundleName), ".dll")
  1871. CompileLink("%s/Contents/MacOS/%s" % (target, bundleName), objects, opts + ["BUNDLE"])
  1872. oscmd("cp %s %s/Contents/Info.plist" % (plist, target))
  1873. for r in resources:
  1874. oscmd("cp %s %s/Contents/Resources/" % (r, target))
  1875. ##########################################################################################
  1876. #
  1877. # CompileMIDL
  1878. #
  1879. ##########################################################################################
  1880. def CompileMIDL(target, src, opts):
  1881. ipath = GetListOption(opts, "DIR:")
  1882. if (COMPILER=="MSVC"):
  1883. cmd = "midl"
  1884. cmd += " /out" + BracketNameWithQuotes(os.path.dirname(target))
  1885. for x in ipath: cmd += " /I" + x
  1886. for (opt,dir) in INCDIRECTORIES:
  1887. if (opt=="ALWAYS") or (opt in opts): cmd += " /I" + BracketNameWithQuotes(dir)
  1888. for (opt,var,val) in DEFSYMBOLS:
  1889. if (opt=="ALWAYS") or (opt in opts): cmd += " /D" + var + "=" + val
  1890. cmd += " " + BracketNameWithQuotes(src)
  1891. oscmd(cmd)
  1892. ##########################################################################################
  1893. #
  1894. # CompileDalvik
  1895. #
  1896. ##########################################################################################
  1897. def CompileDalvik(target, inputs, opts):
  1898. cmd = "d8 --output " + os.path.dirname(target)
  1899. if GetOptimize() <= 2:
  1900. cmd += " --debug"
  1901. else:
  1902. cmd += " --release"
  1903. if "ANDROID_API" in SDK:
  1904. cmd += " --min-api %d" % (SDK["ANDROID_API"])
  1905. if "ANDROID_JAR" in SDK:
  1906. cmd += " --lib %s" % (SDK["ANDROID_JAR"])
  1907. for i in inputs:
  1908. cmd += " " + BracketNameWithQuotes(i)
  1909. oscmd(cmd)
  1910. ##########################################################################################
  1911. #
  1912. # CompileAnything
  1913. #
  1914. ##########################################################################################
  1915. def CompileAnything(target, inputs, opts, progress = None):
  1916. if opts.count("DEPENDENCYONLY"):
  1917. return
  1918. if len(inputs) == 0:
  1919. exit("No input files for target "+target)
  1920. infile = inputs[0]
  1921. origsuffix = GetOrigExt(target)
  1922. if len(inputs) == 1 and origsuffix == GetOrigExt(infile):
  1923. # It must be a simple copy operation.
  1924. ProgressOutput(progress, "Copying file", target)
  1925. CopyFile(target, infile)
  1926. if origsuffix == ".exe" and GetHost() != "windows":
  1927. os.system("chmod +x \"%s\"" % target)
  1928. return
  1929. elif infile.endswith(".py"):
  1930. if origsuffix == ".obj":
  1931. source = os.path.splitext(target)[0] + ".c"
  1932. SetOrigExt(source, ".c")
  1933. ProgressOutput(progress, "Building frozen source", source)
  1934. FreezePy(source, inputs, opts)
  1935. ProgressOutput(progress, "Building C++ object", target)
  1936. return CompileCxx(target, source, opts)
  1937. if origsuffix == ".exe":
  1938. ProgressOutput(progress, "Building frozen executable", target)
  1939. else:
  1940. ProgressOutput(progress, "Building frozen library", target)
  1941. return FreezePy(target, inputs, opts)
  1942. elif infile.endswith(".idl"):
  1943. ProgressOutput(progress, "Compiling MIDL file", infile)
  1944. return CompileMIDL(target, infile, opts)
  1945. elif origsuffix in SUFFIX_LIB:
  1946. ProgressOutput(progress, "Linking static library", target)
  1947. return CompileLib(target, inputs, opts)
  1948. elif origsuffix in SUFFIX_DLL or (origsuffix == ".plugin" and GetTarget() != "darwin"):
  1949. if (origsuffix == ".exe"):
  1950. ProgressOutput(progress, "Linking executable", target)
  1951. else:
  1952. ProgressOutput(progress, "Linking dynamic library", target)
  1953. # Add version number to the dynamic library, on unix
  1954. if origsuffix == ".dll" and "MODULE" not in opts:
  1955. tplatform = GetTarget()
  1956. if tplatform == "darwin":
  1957. # On Mac, libraries are named like libpanda.1.2.dylib
  1958. if target.lower().endswith(".dylib"):
  1959. target = target[:-5] + MAJOR_VERSION + ".dylib"
  1960. SetOrigExt(target, origsuffix)
  1961. elif tplatform != "windows" and tplatform != "android":
  1962. # On Linux, libraries are named like libpanda.so.1.2
  1963. target += "." + MAJOR_VERSION
  1964. SetOrigExt(target, origsuffix)
  1965. return CompileLink(target, inputs, opts)
  1966. elif origsuffix == ".in":
  1967. ProgressOutput(progress, "Building Interrogate database", target)
  1968. return CompileIgate(target, inputs, opts)
  1969. elif origsuffix == ".plugin" and GetTarget() == "darwin":
  1970. ProgressOutput(progress, "Building plugin bundle", target)
  1971. return CompileBundle(target, inputs, opts)
  1972. elif origsuffix == ".app":
  1973. ProgressOutput(progress, "Building application bundle", target)
  1974. return CompileBundle(target, inputs, opts)
  1975. elif origsuffix == ".pz":
  1976. ProgressOutput(progress, "Compressing", target)
  1977. return CompileEgg(target, infile, opts)
  1978. elif origsuffix == ".egg":
  1979. ProgressOutput(progress, "Converting", target)
  1980. return CompileEgg(target, infile, opts)
  1981. elif origsuffix == ".res":
  1982. ProgressOutput(progress, "Building resource object", target)
  1983. return CompileRes(target, infile, opts)
  1984. elif origsuffix == ".rsrc":
  1985. ProgressOutput(progress, "Building resource object", target)
  1986. return CompileRsrc(target, infile, opts)
  1987. elif origsuffix == ".class":
  1988. ProgressOutput(progress, "Building Java class", target)
  1989. return CompileJava(target, infile, opts)
  1990. elif origsuffix == ".obj":
  1991. if (infile.endswith(".cxx")):
  1992. ProgressOutput(progress, "Building C++ object", target)
  1993. return CompileCxx(target, infile, opts)
  1994. if (infile.endswith(".cpp")):
  1995. ProgressOutput(progress, "Building C++ object", target)
  1996. return CompileCxx(target, infile, opts)
  1997. elif infile.endswith(".c"):
  1998. ProgressOutput(progress, "Building C object", target)
  1999. return CompileCxx(target, infile, opts)
  2000. elif infile.endswith(".mm"):
  2001. ProgressOutput(progress, "Building Objective-C++ object", target)
  2002. return CompileCxx(target, infile, opts)
  2003. elif infile.endswith(".yxx"):
  2004. ProgressOutput(progress, "Building Bison object", target)
  2005. return CompileBison(target, infile, opts)
  2006. elif infile.endswith(".lxx"):
  2007. ProgressOutput(progress, "Building Flex object", target)
  2008. return CompileFlex(target, infile, opts)
  2009. elif infile.endswith(".in"):
  2010. ProgressOutput(progress, "Building Interrogate object", target)
  2011. return CompileImod(target, inputs, opts)
  2012. elif infile.endswith(".rc"):
  2013. ProgressOutput(progress, "Building resource object", target)
  2014. return CompileRes(target, infile, opts)
  2015. elif infile.endswith(".r"):
  2016. ProgressOutput(progress, "Building resource object", target)
  2017. return CompileRsrc(target, infile, opts)
  2018. elif origsuffix == ".dex":
  2019. ProgressOutput(progress, "Building Dalvik object", target)
  2020. return CompileDalvik(target, inputs, opts)
  2021. exit("Don't know how to compile: %s from %s" % (target, inputs))
  2022. ##########################################################################################
  2023. #
  2024. # Generate dtool_config.h, prc_parameters.h, and dtool_have_xxx.dat
  2025. #
  2026. ##########################################################################################
  2027. DTOOL_CONFIG=[
  2028. #_Variable_________________________Windows___________________Unix__________
  2029. ("HAVE_PYTHON", '1', '1'),
  2030. ("USE_DEBUG_PYTHON", 'UNDEF', 'UNDEF'),
  2031. ("PYTHON_FRAMEWORK", 'UNDEF', 'UNDEF'),
  2032. ("COMPILE_IN_DEFAULT_FONT", '1', '1'),
  2033. ("STDFLOAT_DOUBLE", 'UNDEF', 'UNDEF'),
  2034. ("HAVE_MAYA", '1', '1'),
  2035. ("REPORT_OPENSSL_ERRORS", '1', '1'),
  2036. ("USE_PANDAFILESTREAM", '1', '1'),
  2037. ("USE_DELETED_CHAIN", '1', '1'),
  2038. ("HAVE_MIMALLOC", 'UNDEF', 'UNDEF'),
  2039. ("HAVE_WGL", '1', 'UNDEF'),
  2040. ("HAVE_DX9", 'UNDEF', 'UNDEF'),
  2041. ("HAVE_THREADS", '1', '1'),
  2042. ("SIMPLE_THREADS", 'UNDEF', 'UNDEF'),
  2043. ("OS_SIMPLE_THREADS", '1', '1'),
  2044. ("DEBUG_THREADS", 'UNDEF', 'UNDEF'),
  2045. ("HAVE_POSIX_THREADS", 'UNDEF', '1'),
  2046. ("MUTEX_SPINLOCK", 'UNDEF', 'UNDEF'),
  2047. ("HAVE_AUDIO", '1', '1'),
  2048. ("NOTIFY_DEBUG", 'UNDEF', 'UNDEF'),
  2049. ("DO_PSTATS", 'UNDEF', 'UNDEF'),
  2050. ("DO_DCAST", 'UNDEF', 'UNDEF'),
  2051. ("DO_COLLISION_RECORDING", 'UNDEF', 'UNDEF'),
  2052. ("SUPPORT_IMMEDIATE_MODE", 'UNDEF', 'UNDEF'),
  2053. ("SUPPORT_FIXED_FUNCTION", '1', '1'),
  2054. ("DO_MEMORY_USAGE", 'UNDEF', 'UNDEF'),
  2055. ("DO_PIPELINING", '1', '1'),
  2056. ("DEFAULT_PATHSEP", '";"', '":"'),
  2057. ("WORDS_BIGENDIAN", 'UNDEF', 'UNDEF'),
  2058. ("PHAVE_LOCKF", '1', '1'),
  2059. ("SIMPLE_STRUCT_POINTERS", '1', 'UNDEF'),
  2060. ("HAVE_DINKUM", 'UNDEF', 'UNDEF'),
  2061. ("HAVE_STL_HASH", 'UNDEF', 'UNDEF'),
  2062. ("GETTIMEOFDAY_ONE_PARAM", 'UNDEF', 'UNDEF'),
  2063. ("HAVE_GETOPT", 'UNDEF', '1'),
  2064. ("HAVE_GETOPT_LONG_ONLY", 'UNDEF', '1'),
  2065. ("PHAVE_GETOPT_H", 'UNDEF', '1'),
  2066. ("PHAVE_LINUX_INPUT_H", 'UNDEF', '1'),
  2067. ("IOCTL_TERMINAL_WIDTH", 'UNDEF', '1'),
  2068. ("HAVE_IOS_TYPEDEFS", '1', '1'),
  2069. ("HAVE_IOS_BINARY", '1', '1'),
  2070. ("STATIC_INIT_GETENV", '1', 'UNDEF'),
  2071. ("HAVE_PROC_SELF_EXE", 'UNDEF', '1'),
  2072. ("HAVE_PROC_SELF_MAPS", 'UNDEF', '1'),
  2073. ("HAVE_PROC_SELF_ENVIRON", 'UNDEF', '1'),
  2074. ("HAVE_PROC_SELF_CMDLINE", 'UNDEF', '1'),
  2075. ("HAVE_PROC_CURPROC_FILE", 'UNDEF', 'UNDEF'),
  2076. ("HAVE_PROC_CURPROC_MAP", 'UNDEF', 'UNDEF'),
  2077. ("HAVE_PROC_SELF_CMDLINE", 'UNDEF', 'UNDEF'),
  2078. ("HAVE_GLOBAL_ARGV", '1', 'UNDEF'),
  2079. ("PROTOTYPE_GLOBAL_ARGV", 'UNDEF', 'UNDEF'),
  2080. ("GLOBAL_ARGV", '__argv', 'UNDEF'),
  2081. ("GLOBAL_ARGC", '__argc', 'UNDEF'),
  2082. ("PHAVE_IO_H", '1', 'UNDEF'),
  2083. ("PHAVE_IOSTREAM", '1', '1'),
  2084. ("PHAVE_STRING_H", 'UNDEF', '1'),
  2085. ("PHAVE_LIMITS_H", 'UNDEF', '1'),
  2086. ("PHAVE_STDLIB_H", 'UNDEF', '1'),
  2087. ("PHAVE_MALLOC_H", '1', '1'),
  2088. ("PHAVE_SYS_MALLOC_H", 'UNDEF', 'UNDEF'),
  2089. ("PHAVE_ALLOCA_H", 'UNDEF', '1'),
  2090. ("PHAVE_LOCALE_H", 'UNDEF', '1'),
  2091. ("PHAVE_SSTREAM", '1', '1'),
  2092. ("PHAVE_NEW", '1', '1'),
  2093. ("PHAVE_SYS_TYPES_H", '1', '1'),
  2094. ("PHAVE_SYS_TIME_H", 'UNDEF', '1'),
  2095. ("PHAVE_UNISTD_H", 'UNDEF', '1'),
  2096. ("PHAVE_UTIME_H", 'UNDEF', '1'),
  2097. ("PHAVE_GLOB_H", 'UNDEF', '1'),
  2098. ("PHAVE_DIRENT_H", 'UNDEF', '1'),
  2099. ("PHAVE_UCONTEXT_H", 'UNDEF', '1'),
  2100. ("PHAVE_STDINT_H", '1', '1'),
  2101. ("HAVE_RTTI", '1', '1'),
  2102. ("HAVE_X11", 'UNDEF', '1'),
  2103. ("IS_LINUX", 'UNDEF', '1'),
  2104. ("IS_OSX", 'UNDEF', 'UNDEF'),
  2105. ("IS_FREEBSD", 'UNDEF', 'UNDEF'),
  2106. ("HAVE_EIGEN", 'UNDEF', 'UNDEF'),
  2107. ("LINMATH_ALIGN", '1', '1'),
  2108. ("HAVE_ZLIB", 'UNDEF', 'UNDEF'),
  2109. ("HAVE_PNG", 'UNDEF', 'UNDEF'),
  2110. ("HAVE_JPEG", 'UNDEF', 'UNDEF'),
  2111. ("HAVE_VIDEO4LINUX", 'UNDEF', '1'),
  2112. ("HAVE_TIFF", 'UNDEF', 'UNDEF'),
  2113. ("HAVE_OPENEXR", 'UNDEF', 'UNDEF'),
  2114. ("HAVE_SGI_RGB", '1', '1'),
  2115. ("HAVE_TGA", '1', '1'),
  2116. ("HAVE_IMG", '1', '1'),
  2117. ("HAVE_SOFTIMAGE_PIC", '1', '1'),
  2118. ("HAVE_BMP", '1', '1'),
  2119. ("HAVE_PNM", '1', '1'),
  2120. ("HAVE_STB_IMAGE", '1', '1'),
  2121. ("HAVE_VORBIS", 'UNDEF', 'UNDEF'),
  2122. ("HAVE_OPUS", 'UNDEF', 'UNDEF'),
  2123. ("HAVE_FREETYPE", 'UNDEF', 'UNDEF'),
  2124. ("HAVE_FFTW", 'UNDEF', 'UNDEF'),
  2125. ("HAVE_OPENSSL", 'UNDEF', 'UNDEF'),
  2126. ("HAVE_NET", 'UNDEF', 'UNDEF'),
  2127. ("WANT_NATIVE_NET", '1', '1'),
  2128. ("SIMULATE_NETWORK_DELAY", 'UNDEF', 'UNDEF'),
  2129. ("HAVE_CG", 'UNDEF', 'UNDEF'),
  2130. ("HAVE_CGGL", 'UNDEF', 'UNDEF'),
  2131. ("HAVE_CGDX9", 'UNDEF', 'UNDEF'),
  2132. ("HAVE_ARTOOLKIT", 'UNDEF', 'UNDEF'),
  2133. ("HAVE_DIRECTCAM", 'UNDEF', 'UNDEF'),
  2134. ("HAVE_SQUISH", 'UNDEF', 'UNDEF'),
  2135. ("HAVE_COCOA", 'UNDEF', 'UNDEF'),
  2136. ("HAVE_OPENAL_FRAMEWORK", 'UNDEF', 'UNDEF'),
  2137. ("USE_TAU", 'UNDEF', 'UNDEF'),
  2138. ("PRC_SAVE_DESCRIPTIONS", '1', '1'),
  2139. # ("_SECURE_SCL", '0', 'UNDEF'),
  2140. # ("_SECURE_SCL_THROWS", '0', 'UNDEF'),
  2141. ]
  2142. PRC_PARAMETERS=[
  2143. ("DEFAULT_PRC_DIR", '"<auto>etc"', '"<auto>etc"'),
  2144. ("PRC_DIR_ENVVARS", '"PANDA_PRC_DIR"', '"PANDA_PRC_DIR"'),
  2145. ("PRC_PATH_ENVVARS", '"PANDA_PRC_PATH"', '"PANDA_PRC_PATH"'),
  2146. ("PRC_PATH2_ENVVARS", '""', '""'),
  2147. ("PRC_PATTERNS", '"*.prc"', '"*.prc"'),
  2148. ("PRC_ENCRYPTED_PATTERNS", '"*.prc.pe"', '"*.prc.pe"'),
  2149. ("PRC_ENCRYPTION_KEY", '""', '""'),
  2150. ("PRC_EXECUTABLE_PATTERNS", '""', '""'),
  2151. ("PRC_EXECUTABLE_ARGS_ENVVAR", '"PANDA_PRC_XARGS"', '"PANDA_PRC_XARGS"'),
  2152. ("PRC_PUBLIC_KEYS_FILENAME", '""', '""'),
  2153. ("PRC_RESPECT_TRUST_LEVEL", 'UNDEF', 'UNDEF'),
  2154. ("PRC_DCONFIG_TRUST_LEVEL", '0', '0'),
  2155. ("PRC_INC_TRUST_LEVEL", '0', '0'),
  2156. ]
  2157. def WriteConfigSettings():
  2158. dtool_config={}
  2159. prc_parameters={}
  2160. speedtree_parameters={}
  2161. if (GetTarget() == 'windows'):
  2162. for key,win,unix in DTOOL_CONFIG:
  2163. dtool_config[key] = win
  2164. for key,win,unix in PRC_PARAMETERS:
  2165. prc_parameters[key] = win
  2166. else:
  2167. for key,win,unix in DTOOL_CONFIG:
  2168. dtool_config[key] = unix
  2169. for key,win,unix in PRC_PARAMETERS:
  2170. prc_parameters[key] = unix
  2171. for x in PkgListGet():
  2172. if ("HAVE_"+x in dtool_config):
  2173. if (PkgSkip(x)==0):
  2174. dtool_config["HAVE_"+x] = '1'
  2175. else:
  2176. dtool_config["HAVE_"+x] = 'UNDEF'
  2177. dtool_config["HAVE_NET"] = '1'
  2178. if GetTarget() == 'windows':
  2179. if not PkgSkip("MIMALLOC"):
  2180. # This is faster than both DeletedBufferChain and malloc,
  2181. # especially in the multi-threaded case.
  2182. dtool_config["USE_MEMORY_MIMALLOC"] = '1'
  2183. dtool_config["USE_DELETED_CHAIN"] = 'UNDEF'
  2184. else:
  2185. # If we don't have mimalloc, use DeletedBufferChain as fallback,
  2186. # which is still more efficient than malloc.
  2187. dtool_config["USE_DELETED_CHAIN"] = '1'
  2188. else:
  2189. # On other systems, the default malloc seems to be fine.
  2190. dtool_config["USE_DELETED_CHAIN"] = 'UNDEF'
  2191. if (PkgSkip("NVIDIACG")==0):
  2192. dtool_config["HAVE_CG"] = '1'
  2193. dtool_config["HAVE_CGGL"] = '1'
  2194. dtool_config["HAVE_CGDX9"] = '1'
  2195. if GetTarget() not in ("linux", "android"):
  2196. dtool_config["HAVE_PROC_SELF_EXE"] = 'UNDEF'
  2197. dtool_config["HAVE_PROC_SELF_MAPS"] = 'UNDEF'
  2198. dtool_config["HAVE_PROC_SELF_CMDLINE"] = 'UNDEF'
  2199. dtool_config["HAVE_PROC_SELF_ENVIRON"] = 'UNDEF'
  2200. if (GetTarget() == "darwin"):
  2201. dtool_config["PYTHON_FRAMEWORK"] = 'Python'
  2202. dtool_config["PHAVE_MALLOC_H"] = 'UNDEF'
  2203. dtool_config["PHAVE_SYS_MALLOC_H"] = '1'
  2204. dtool_config["HAVE_OPENAL_FRAMEWORK"] = '1'
  2205. dtool_config["HAVE_X11"] = 'UNDEF' # We might have X11, but we don't need it.
  2206. dtool_config["IS_LINUX"] = 'UNDEF'
  2207. dtool_config["HAVE_VIDEO4LINUX"] = 'UNDEF'
  2208. dtool_config["PHAVE_LINUX_INPUT_H"] = 'UNDEF'
  2209. dtool_config["IS_OSX"] = '1'
  2210. if (GetTarget() == "freebsd"):
  2211. dtool_config["IS_LINUX"] = 'UNDEF'
  2212. dtool_config["HAVE_VIDEO4LINUX"] = 'UNDEF'
  2213. dtool_config["IS_FREEBSD"] = '1'
  2214. dtool_config["PHAVE_ALLOCA_H"] = 'UNDEF'
  2215. dtool_config["PHAVE_MALLOC_H"] = 'UNDEF'
  2216. dtool_config["HAVE_PROC_CURPROC_FILE"] = '1'
  2217. dtool_config["HAVE_PROC_CURPROC_MAP"] = '1'
  2218. dtool_config["HAVE_PROC_CURPROC_CMDLINE"] = '1'
  2219. if (GetTarget() == "android"):
  2220. # Android does have RTTI, but we disable it anyway.
  2221. dtool_config["HAVE_RTTI"] = 'UNDEF'
  2222. dtool_config["PHAVE_GLOB_H"] = 'UNDEF'
  2223. dtool_config["PHAVE_LOCKF"] = 'UNDEF'
  2224. dtool_config["HAVE_VIDEO4LINUX"] = 'UNDEF'
  2225. if (GetOptimize() <= 2 and GetTarget() == "windows"):
  2226. dtool_config["USE_DEBUG_PYTHON"] = '1'
  2227. if (GetOptimize() <= 3):
  2228. if (dtool_config["HAVE_NET"] != 'UNDEF'):
  2229. dtool_config["DO_PSTATS"] = '1'
  2230. if (GetOptimize() <= 3):
  2231. dtool_config["DO_DCAST"] = '1'
  2232. if (GetOptimize() <= 3):
  2233. dtool_config["DO_COLLISION_RECORDING"] = '1'
  2234. if (GetOptimize() <= 3):
  2235. dtool_config["DO_MEMORY_USAGE"] = '1'
  2236. if (GetOptimize() <= 3):
  2237. dtool_config["NOTIFY_DEBUG"] = '1'
  2238. if (GetOptimize() >= 4):
  2239. dtool_config["PRC_SAVE_DESCRIPTIONS"] = 'UNDEF'
  2240. if (GetOptimize() >= 4):
  2241. # Disable RTTI on release builds.
  2242. dtool_config["HAVE_RTTI"] = 'UNDEF'
  2243. # Now that we have OS_SIMPLE_THREADS, we can support
  2244. # SIMPLE_THREADS on exotic architectures like win64, so we no
  2245. # longer need to disable it for this platform.
  2246. ## if GetTarget() == 'windows' and GetTargetArch() == 'x64':
  2247. ## dtool_config["SIMPLE_THREADS"] = 'UNDEF'
  2248. if not PkgSkip("SPEEDTREE"):
  2249. speedtree_parameters["SPEEDTREE_OPENGL"] = "UNDEF"
  2250. speedtree_parameters["SPEEDTREE_DIRECTX9"] = "UNDEF"
  2251. if SDK["SPEEDTREEAPI"] == "OpenGL":
  2252. speedtree_parameters["SPEEDTREE_OPENGL"] = "1"
  2253. elif SDK["SPEEDTREEAPI"] == "DirectX9":
  2254. speedtree_parameters["SPEEDTREE_DIRECTX9"] = "1"
  2255. speedtree_parameters["SPEEDTREE_BIN_DIR"] = (SDK["SPEEDTREE"] + "/Bin")
  2256. conf = "/* prc_parameters.h. Generated automatically by makepanda.py */\n"
  2257. for key in sorted(prc_parameters.keys()):
  2258. if ((key == "DEFAULT_PRC_DIR") or (key[:4]=="PRC_")):
  2259. val = OverrideValue(key, prc_parameters[key])
  2260. if (val == 'UNDEF'): conf = conf + "#undef " + key + "\n"
  2261. else: conf = conf + "#define " + key + " " + val + "\n"
  2262. ConditionalWriteFile(GetOutputDir() + '/include/prc_parameters.h', conf)
  2263. conf = "/* dtool_config.h. Generated automatically by makepanda.py */\n"
  2264. for key in sorted(dtool_config.keys()):
  2265. val = OverrideValue(key, dtool_config[key])
  2266. if key in ('HAVE_CG', 'HAVE_CGGL', 'HAVE_CGDX9') and val != 'UNDEF':
  2267. # These are not available for ARM, period.
  2268. conf = conf + "#ifdef __aarch64__\n"
  2269. conf = conf + "#undef " + key + "\n"
  2270. conf = conf + "#else\n"
  2271. conf = conf + "#define " + key + " " + val + "\n"
  2272. conf = conf + "#endif\n"
  2273. elif val == 'UNDEF':
  2274. conf = conf + "#undef " + key + "\n"
  2275. else:
  2276. conf = conf + "#define " + key + " " + val + "\n"
  2277. ConditionalWriteFile(GetOutputDir() + '/include/dtool_config.h', conf)
  2278. if not PkgSkip("SPEEDTREE"):
  2279. conf = "/* speedtree_parameters.h. Generated automatically by makepanda.py */\n"
  2280. for key in sorted(speedtree_parameters.keys()):
  2281. val = OverrideValue(key, speedtree_parameters[key])
  2282. if (val == 'UNDEF'): conf = conf + "#undef " + key + "\n"
  2283. else: conf = conf + "#define " + key + " \"" + val.replace("\\", "\\\\") + "\"\n"
  2284. ConditionalWriteFile(GetOutputDir() + '/include/speedtree_parameters.h', conf)
  2285. for x in PkgListGet():
  2286. if (PkgSkip(x)): ConditionalWriteFile(GetOutputDir() + '/tmp/dtool_have_'+x.lower()+'.dat', "0\n")
  2287. else: ConditionalWriteFile(GetOutputDir() + '/tmp/dtool_have_'+x.lower()+'.dat', "1\n")
  2288. # Finally, write a platform.dat with the platform we are compiling for.
  2289. ConditionalWriteFile(GetOutputDir() + '/tmp/platform.dat', PLATFORM)
  2290. # This is useful for tools like makepackage that need to know things about
  2291. # the build parameters.
  2292. ConditionalWriteFile(GetOutputDir() + '/tmp/optimize.dat', str(GetOptimize()))
  2293. WriteConfigSettings()
  2294. WarnConflictingFiles()
  2295. if SystemLibraryExists("dtoolbase"):
  2296. Warn("Found conflicting Panda3D libraries from other ppremake build!")
  2297. if SystemLibraryExists("p3dtoolconfig"):
  2298. Warn("Found conflicting Panda3D libraries from other makepanda build!")
  2299. ##########################################################################################
  2300. #
  2301. # Generate pandaVersion.h, pythonversion, null.cxx, etc.
  2302. #
  2303. ##########################################################################################
  2304. PANDAVERSION_H="""
  2305. #define PANDA_MAJOR_VERSION $VERSION1
  2306. #define PANDA_MINOR_VERSION $VERSION2
  2307. #define PANDA_SEQUENCE_VERSION $VERSION3
  2308. #define PANDA_VERSION $NVERSION
  2309. #define PANDA_NUMERIC_VERSION $NVERSION
  2310. #define PANDA_VERSION_STR "$VERSION"
  2311. #define PANDA_ABI_VERSION_STR "$VERSION1.$VERSION2"
  2312. #define PANDA_DISTRIBUTOR "$DISTRIBUTOR"
  2313. """
  2314. CHECKPANDAVERSION_CXX="""
  2315. # include "dtoolbase.h"
  2316. EXPCL_DTOOL_DTOOLBASE int panda_version_$VERSION1_$VERSION2 = 0;
  2317. """
  2318. CHECKPANDAVERSION_H="""
  2319. # ifndef CHECKPANDAVERSION_H
  2320. # define CHECKPANDAVERSION_H
  2321. # include "dtoolbase.h"
  2322. extern EXPCL_DTOOL_DTOOLBASE int panda_version_$VERSION1_$VERSION2;
  2323. // Hack to forcibly depend on the check
  2324. template<typename T>
  2325. class CheckPandaVersion {
  2326. public:
  2327. int check_version() { return panda_version_$VERSION1_$VERSION2; }
  2328. };
  2329. template class CheckPandaVersion<void>;
  2330. # endif
  2331. """
  2332. def CreatePandaVersionFiles():
  2333. version1=int(VERSION.split(".")[0])
  2334. version2=int(VERSION.split(".")[1])
  2335. version3=int(VERSION.split(".")[2])
  2336. nversion=version1*1000000+version2*1000+version3
  2337. if (DISTRIBUTOR != "cmu"):
  2338. # Subtract 1 if we are not an official version.
  2339. nversion -= 1
  2340. pandaversion_h = PANDAVERSION_H
  2341. pandaversion_h = pandaversion_h.replace("$VERSION1",str(version1))
  2342. pandaversion_h = pandaversion_h.replace("$VERSION2",str(version2))
  2343. pandaversion_h = pandaversion_h.replace("$VERSION3",str(version3))
  2344. pandaversion_h = pandaversion_h.replace("$VERSION",VERSION)
  2345. pandaversion_h = pandaversion_h.replace("$NVERSION",str(nversion))
  2346. pandaversion_h = pandaversion_h.replace("$DISTRIBUTOR",DISTRIBUTOR)
  2347. if (DISTRIBUTOR == "cmu"):
  2348. pandaversion_h += "\n#define PANDA_OFFICIAL_VERSION\n"
  2349. else:
  2350. pandaversion_h += "\n#undef PANDA_OFFICIAL_VERSION\n"
  2351. if GIT_COMMIT:
  2352. pandaversion_h += "\n#define PANDA_GIT_COMMIT_STR \"%s\"\n" % (GIT_COMMIT)
  2353. # Allow creating a deterministic build by setting this.
  2354. source_date = os.environ.get("SOURCE_DATE_EPOCH")
  2355. if source_date:
  2356. # This matches the GCC / Clang format for __DATE__ __TIME__
  2357. source_date = time.gmtime(int(source_date))
  2358. try:
  2359. source_date = time.strftime('%b %e %Y %H:%M:%S', source_date)
  2360. except ValueError:
  2361. source_date = time.strftime('%b %d %Y %H:%M:%S', source_date)
  2362. if source_date[3:5] == ' 0':
  2363. source_date = source_date[:3] + ' ' + source_date[5:]
  2364. pandaversion_h += "\n#define PANDA_BUILD_DATE_STR \"%s\"\n" % (source_date)
  2365. checkpandaversion_cxx = CHECKPANDAVERSION_CXX.replace("$VERSION1",str(version1))
  2366. checkpandaversion_cxx = checkpandaversion_cxx.replace("$VERSION2",str(version2))
  2367. checkpandaversion_cxx = checkpandaversion_cxx.replace("$VERSION3",str(version3))
  2368. checkpandaversion_cxx = checkpandaversion_cxx.replace("$NVERSION",str(nversion))
  2369. checkpandaversion_h = CHECKPANDAVERSION_H.replace("$VERSION1",str(version1))
  2370. checkpandaversion_h = checkpandaversion_h.replace("$VERSION2",str(version2))
  2371. checkpandaversion_h = checkpandaversion_h.replace("$VERSION3",str(version3))
  2372. checkpandaversion_h = checkpandaversion_h.replace("$NVERSION",str(nversion))
  2373. ConditionalWriteFile(GetOutputDir()+'/include/pandaVersion.h', pandaversion_h)
  2374. ConditionalWriteFile(GetOutputDir()+'/include/checkPandaVersion.cxx', checkpandaversion_cxx)
  2375. ConditionalWriteFile(GetOutputDir()+'/include/checkPandaVersion.h', checkpandaversion_h)
  2376. ConditionalWriteFile(GetOutputDir()+"/tmp/null.cxx","")
  2377. CreatePandaVersionFiles()
  2378. ##########################################################################################
  2379. #
  2380. # Copy the "direct" tree
  2381. #
  2382. ##########################################################################################
  2383. if not PkgSkip("DIRECT"):
  2384. CopyPythonTree(GetOutputDir() + '/direct', 'direct/src', threads=THREADCOUNT)
  2385. ConditionalWriteFile(GetOutputDir() + '/direct/__init__.py', "")
  2386. # This file used to be copied, but would nowadays cause conflicts.
  2387. # Let's get it out of the way in case someone hasn't cleaned their build since.
  2388. if os.path.isfile(GetOutputDir() + '/bin/panda3d.py'):
  2389. os.remove(GetOutputDir() + '/bin/panda3d.py')
  2390. if os.path.isfile(GetOutputDir() + '/lib/panda3d.py'):
  2391. os.remove(GetOutputDir() + '/lib/panda3d.py')
  2392. # This directory doesn't exist at all any more.
  2393. if os.path.isdir(os.path.join(GetOutputDir(), 'direct', 'ffi')):
  2394. shutil.rmtree(os.path.join(GetOutputDir(), 'direct', 'ffi'))
  2395. # These files used to exist; remove them to avoid conflicts.
  2396. del_files = ['core.py', 'core.pyc', 'core.pyo',
  2397. '_core.pyd', '_core.so',
  2398. 'direct.py', 'direct.pyc', 'direct.pyo',
  2399. '_direct.pyd', '_direct.so',
  2400. 'dtoolconfig.pyd', 'dtoolconfig.so']
  2401. for basename in del_files:
  2402. path = os.path.join(GetOutputDir(), 'panda3d', basename)
  2403. if os.path.isfile(path):
  2404. print("Removing %s" % (path))
  2405. os.remove(path)
  2406. # Write an appropriate panda3d/__init__.py
  2407. p3d_init = """"Python bindings for the Panda3D libraries"
  2408. __version__ = '%s'
  2409. if __debug__:
  2410. if 1 / 2 == 0:
  2411. raise ImportError("Python 2 is not supported.")
  2412. """ % (WHLVERSION)
  2413. if GetTarget() == 'windows':
  2414. p3d_init += """
  2415. if '__file__' in locals():
  2416. import os
  2417. bindir = os.path.join(os.path.dirname(__file__), '..', 'bin')
  2418. if os.path.isdir(bindir):
  2419. if hasattr(os, 'add_dll_directory'):
  2420. os.add_dll_directory(bindir)
  2421. elif not os.environ.get('PATH'):
  2422. os.environ['PATH'] = bindir
  2423. else:
  2424. os.environ['PATH'] = bindir + os.pathsep + os.environ['PATH']
  2425. del os, bindir
  2426. """
  2427. if not PkgSkip("PYTHON"):
  2428. ConditionalWriteFile(GetOutputDir() + '/panda3d/__init__.py', p3d_init)
  2429. # Also add this file, for backward compatibility.
  2430. ConditionalWriteFile(GetOutputDir() + '/panda3d/dtoolconfig.py', """\
  2431. '''Alias of :mod:`panda3d.interrogatedb`.
  2432. .. deprecated:: 1.10.0
  2433. This module has been renamed to :mod:`panda3d.interrogatedb`.
  2434. '''
  2435. if __debug__:
  2436. print("Warning: panda3d.dtoolconfig is deprecated, use panda3d.interrogatedb instead.")
  2437. from .interrogatedb import *
  2438. """)
  2439. # PandaModules is now deprecated; generate a shim for backward compatibility.
  2440. for fn in glob.glob(GetOutputDir() + '/pandac/*.py') + glob.glob(GetOutputDir() + '/pandac/*.py[co]'):
  2441. if os.path.basename(fn) not in ('PandaModules.py', '__init__.py'):
  2442. os.remove(fn)
  2443. panda_modules = ['core']
  2444. if not PkgSkip("PANDAPHYSICS"):
  2445. panda_modules.append('physics')
  2446. if not PkgSkip('PANDAFX'):
  2447. panda_modules.append('fx')
  2448. if not PkgSkip("DIRECT"):
  2449. panda_modules.append('direct')
  2450. if not PkgSkip("VISION"):
  2451. panda_modules.append('vision')
  2452. if not PkgSkip("NAVIGATION"):
  2453. panda_modules.append('navigation')
  2454. if not PkgSkip("NAVMESHGEN"):
  2455. panda_modules.append('navmeshgen')
  2456. if not PkgSkip("SKEL"):
  2457. panda_modules.append('skel')
  2458. if not PkgSkip("EGG"):
  2459. panda_modules.append('egg')
  2460. if not PkgSkip("ODE"):
  2461. panda_modules.append('ode')
  2462. if not PkgSkip("VRPN"):
  2463. panda_modules.append('vrpn')
  2464. panda_modules_code = """
  2465. "This module is deprecated. Import from panda3d.core and other panda3d.* modules instead."
  2466. if __debug__:
  2467. print("Warning: pandac.PandaModules is deprecated, import from panda3d.core instead")
  2468. """
  2469. for module in panda_modules:
  2470. panda_modules_code += """
  2471. try:
  2472. from panda3d.%s import *
  2473. except ImportError as err:
  2474. if "No module named %s" not in str(err):
  2475. raise""" % (module, module)
  2476. panda_modules_code += """
  2477. from direct.showbase import DConfig
  2478. def get_config_showbase():
  2479. return DConfig
  2480. def get_config_express():
  2481. return DConfig
  2482. getConfigShowbase = get_config_showbase
  2483. getConfigExpress = get_config_express
  2484. """
  2485. exthelpers_code = """
  2486. "This module is deprecated. Import from direct.extensions_native.extension_native_helpers instead."
  2487. from direct.extensions_native.extension_native_helpers import *
  2488. """
  2489. if not PkgSkip("PYTHON"):
  2490. ConditionalWriteFile(GetOutputDir() + '/pandac/PandaModules.py', panda_modules_code)
  2491. ConditionalWriteFile(GetOutputDir() + '/pandac/extension_native_helpers.py', exthelpers_code)
  2492. ConditionalWriteFile(GetOutputDir() + '/pandac/__init__.py', '')
  2493. ##########################################################################################
  2494. #
  2495. # Write the dist-info directory.
  2496. #
  2497. ##########################################################################################
  2498. # This is just some basic stuff since setuptools just needs this file to
  2499. # exist, otherwise it will not read the entry_points.txt file. Maybe we will
  2500. # eventually want to merge this with the metadata generator in makewheel.py.
  2501. METADATA = """Metadata-Version: 2.0
  2502. Name: Panda3D
  2503. Version: {version}
  2504. License: BSD
  2505. Home-page: https://www.panda3d.org/
  2506. Author: Panda3D Team
  2507. Author-email: [email protected]
  2508. """
  2509. ENTRY_POINTS = """[distutils.commands]
  2510. build_apps = direct.dist.commands:build_apps
  2511. bdist_apps = direct.dist.commands:bdist_apps
  2512. """
  2513. if not PkgSkip("DIRECT"):
  2514. dist_dir = os.path.join(GetOutputDir(), 'panda3d.dist-info')
  2515. MakeDirectory(dist_dir)
  2516. ConditionalWriteFile(os.path.join(dist_dir, 'METADATA'), METADATA.format(version=VERSION))
  2517. ConditionalWriteFile(os.path.join(dist_dir, 'entry_points.txt'), ENTRY_POINTS)
  2518. ##########################################################################################
  2519. #
  2520. # Generate the PRC files into the ETC directory.
  2521. #
  2522. ##########################################################################################
  2523. confautoprc = ReadFile("makepanda/confauto.in")
  2524. if not PkgSkip("SPEEDTREE"):
  2525. # If SpeedTree is available, enable it in the config file
  2526. confautoprc = confautoprc.replace('#st#', '')
  2527. else:
  2528. # otherwise, disable it.
  2529. confautoprc = confautoprc.replace('#st#', '#')
  2530. confautoprc = confautoprc.replace('\r\n', '\n')
  2531. if PkgSkip("ASSIMP") or GetLinkAllStatic():
  2532. confautoprc = confautoprc.replace("load-file-type p3assimp", "#load-file-type p3assimp")
  2533. if PkgSkip("EGG") or GetLinkAllStatic():
  2534. confautoprc = confautoprc.replace("load-file-type egg pandaegg", "#load-file-type egg pandaegg")
  2535. if PkgSkip("PANDATOOL") or PkgSkip("EGG") or GetLinkAllStatic():
  2536. confautoprc = confautoprc.replace("load-file-type p3ptloader", "#load-file-type p3ptloader")
  2537. if PkgSkip("FFMPEG") or GetLinkAllStatic():
  2538. confautoprc = confautoprc.replace("load-audio-type * p3ffmpeg", "#load-audio-type * p3ffmpeg")
  2539. confautoprc = confautoprc.replace("load-video-type * p3ffmpeg", "#load-video-type * p3ffmpeg")
  2540. if (os.path.isfile("makepanda/myconfig.in")):
  2541. configprc = ReadFile("makepanda/myconfig.in")
  2542. else:
  2543. configprc = ReadFile("makepanda/config.in")
  2544. configprc = configprc.replace('\r\n', '\n')
  2545. if (GetTarget() == 'windows'):
  2546. configprc = configprc.replace("$XDG_CACHE_HOME/panda3d", "$USER_APPDATA/Panda3D-%s" % MAJOR_VERSION)
  2547. elif not PkgSkip("X11") and not PkgSkip("GL") and not PkgSkip("EGL") and not GetLinkAllStatic():
  2548. configprc = configprc.replace("#load-display pandadx9", "aux-display p3headlessgl")
  2549. else:
  2550. configprc = configprc.replace("aux-display pandadx9", "")
  2551. if (GetTarget() == 'darwin'):
  2552. configprc = configprc.replace("$XDG_CACHE_HOME/panda3d", "$HOME/Library/Caches/Panda3D-%s" % MAJOR_VERSION)
  2553. if PkgSkip("GL") or GetLinkAllStatic():
  2554. configprc = configprc.replace("\nload-display pandagl", "\n#load-display pandagl")
  2555. if PkgSkip("GLES") or GetLinkAllStatic():
  2556. configprc = configprc.replace("\n#load-display pandagles\n", "\n")
  2557. if PkgSkip("GL") and not PkgSkip("GLES2") and not GetLinkAllStatic():
  2558. configprc = configprc.replace("\n#load-display pandagles2", "\nload-display pandagles2")
  2559. elif PkgSkip("GLES2") or GetLinkAllStatic():
  2560. configprc = configprc.replace("\n#load-display pandagles2", "")
  2561. if PkgSkip("DX9") or GetLinkAllStatic():
  2562. configprc = configprc.replace("\n#load-display pandadx9", "")
  2563. if PkgSkip("TINYDISPLAY") or GetLinkAllStatic():
  2564. configprc = configprc.replace("\n#load-display p3tinydisplay", "")
  2565. if PkgSkip("OPENAL") or GetLinkAllStatic():
  2566. configprc = configprc.replace("audio-library-name p3openal_audio", "#audio-library-name p3openal_audio")
  2567. if GetTarget() == 'windows':
  2568. # Convert to Windows newlines.
  2569. ConditionalWriteFile(GetOutputDir()+"/etc/Config.prc", configprc, newline='\r\n')
  2570. ConditionalWriteFile(GetOutputDir()+"/etc/Confauto.prc", confautoprc, newline='\r\n')
  2571. else:
  2572. ConditionalWriteFile(GetOutputDir()+"/etc/Config.prc", configprc)
  2573. ConditionalWriteFile(GetOutputDir()+"/etc/Confauto.prc", confautoprc)
  2574. ##########################################################################################
  2575. #
  2576. # Copy the precompiled binaries and DLLs into the build.
  2577. #
  2578. ##########################################################################################
  2579. tp_dir = GetThirdpartyDir()
  2580. if tp_dir is not None:
  2581. dylibs = {}
  2582. if GetTarget() == 'darwin':
  2583. # Make a list of all the dylibs we ship, to figure out whether we should use
  2584. # install_name_tool to correct the library reference to point to our copy.
  2585. for pkg in PkgListGet():
  2586. if PkgSkip(pkg):
  2587. continue
  2588. tp_libdir = os.path.join(tp_dir, pkg.lower(), "lib")
  2589. for lib in glob.glob(os.path.join(tp_libdir, "*.dylib")):
  2590. dylibs[os.path.basename(lib)] = os.path.basename(os.path.realpath(lib))
  2591. if not PkgSkip("PYTHON"):
  2592. for lib in glob.glob(os.path.join(tp_libdir, SDK["PYTHONVERSION"], "*.dylib")):
  2593. dylibs[os.path.basename(lib)] = os.path.basename(os.path.realpath(lib))
  2594. for pkg in PkgListGet():
  2595. if PkgSkip(pkg):
  2596. continue
  2597. tp_pkg = tp_dir + pkg.lower()
  2598. if GetTarget() == 'windows':
  2599. if os.path.exists(tp_pkg + "/bin"):
  2600. CopyAllFiles(GetOutputDir() + "/bin/", tp_pkg + "/bin/")
  2601. if (PkgSkip("PYTHON")==0 and os.path.exists(tp_pkg + "/bin/" + SDK["PYTHONVERSION"])):
  2602. CopyAllFiles(GetOutputDir() + "/bin/", tp_pkg + "/bin/" + SDK["PYTHONVERSION"] + "/")
  2603. elif GetTarget() == 'darwin':
  2604. tp_libdir = os.path.join(tp_pkg, "lib")
  2605. tp_libs = glob.glob(os.path.join(tp_libdir, "*.dylib"))
  2606. if not PkgSkip("PYTHON"):
  2607. tp_libs += glob.glob(os.path.join(tp_libdir, SDK["PYTHONVERSION"], "*.dylib"))
  2608. tp_libs += glob.glob(os.path.join(tp_libdir, SDK["PYTHONVERSION"], "*.so"))
  2609. if pkg != 'PYTHON':
  2610. tp_libs += glob.glob(os.path.join(tp_libdir, SDK["PYTHONVERSION"], "*.py"))
  2611. for tp_lib in tp_libs:
  2612. basename = os.path.basename(tp_lib)
  2613. if basename.endswith('.dylib'):
  2614. # It's a dynamic link library. Put it in the lib directory.
  2615. target = GetOutputDir() + "/lib/" + basename
  2616. dep_prefix = "@loader_path/../lib/"
  2617. lib_id = dep_prefix + basename
  2618. else:
  2619. # It's a Python module, like _rocketcore.so. Copy it to the root, because
  2620. # nowadays the 'lib' directory may no longer be on the PYTHONPATH.
  2621. target = GetOutputDir() + "/" + basename
  2622. dep_prefix = "@loader_path/lib/"
  2623. lib_id = basename
  2624. if not NeedsBuild([target], [tp_lib]):
  2625. continue
  2626. CopyFile(target, tp_lib)
  2627. if os.path.islink(target) or target.endswith('.py'):
  2628. continue
  2629. # Correct the inter-library dependencies so that the build is relocatable.
  2630. oscmd('install_name_tool -id %s %s' % (lib_id, target))
  2631. oscmd("otool -L %s | grep .dylib > %s/tmp/otool-libs.txt" % (target, GetOutputDir()), True)
  2632. for line in open(GetOutputDir() + "/tmp/otool-libs.txt", "r"):
  2633. line = line.strip()
  2634. if not line or line.startswith(dep_prefix) or line.endswith(":"):
  2635. continue
  2636. libdep = line.split(" ", 1)[0]
  2637. dep_basename = os.path.basename(libdep)
  2638. if dep_basename in dylibs:
  2639. dep_target = dylibs[dep_basename]
  2640. oscmd("install_name_tool -change %s %s%s %s" % (libdep, dep_prefix, dep_target, target), True)
  2641. JustBuilt([target], [tp_lib])
  2642. for fwx in glob.glob(tp_pkg + "/*.framework"):
  2643. MakeDirectory(GetOutputDir() + "/Frameworks")
  2644. CopyTree(GetOutputDir() + "/Frameworks/" + os.path.basename(fwx), fwx)
  2645. else: # Linux / FreeBSD case.
  2646. for tp_lib in glob.glob(tp_pkg + "/lib/*.so*"):
  2647. CopyFile(GetOutputDir() + "/lib/" + os.path.basename(tp_lib), tp_lib)
  2648. if not PkgSkip("PYTHON"):
  2649. for tp_lib in glob.glob(os.path.join(tp_pkg, "lib", SDK["PYTHONVERSION"], "*.so*")):
  2650. base = os.path.basename(tp_lib)
  2651. if base.startswith('lib'):
  2652. CopyFile(GetOutputDir() + "/lib/" + base, tp_lib)
  2653. else:
  2654. # It's a Python module, like _rocketcore.so.
  2655. CopyFile(GetOutputDir() + "/" + base, tp_lib)
  2656. if GetTarget() == 'windows':
  2657. if os.path.isdir(os.path.join(tp_dir, "extras", "bin")):
  2658. CopyAllFiles(GetOutputDir() + "/bin/", tp_dir + "extras/bin/")
  2659. if not PkgSkip("PYTHON"):
  2660. # We need to copy the Python DLL to the bin directory for now.
  2661. pydll = "/" + SDK["PYTHONVERSION"].replace(".", "")
  2662. if GetOptimize() <= 2:
  2663. pydll += "_d.dll"
  2664. else:
  2665. pydll += ".dll"
  2666. CopyFile(GetOutputDir() + "/bin" + pydll, SDK["PYTHON"] + pydll)
  2667. for fn in glob.glob(SDK["PYTHON"] + "/vcruntime*.dll"):
  2668. CopyFile(GetOutputDir() + "/bin/", fn)
  2669. # Copy the whole Python directory.
  2670. if COPY_PYTHON:
  2671. CopyTree(GetOutputDir() + "/python", SDK["PYTHON"])
  2672. # NB: Python does not always ship with the correct manifest/dll.
  2673. # Figure out the correct one to ship, and grab it from WinSxS dir.
  2674. manifest = GetOutputDir() + '/tmp/python.manifest'
  2675. if os.path.isfile(manifest):
  2676. os.unlink(manifest)
  2677. oscmd('mt -inputresource:"%s\\python.exe";#1 -out:"%s" -nologo' % (SDK["PYTHON"], manifest), True)
  2678. if COPY_PYTHON and os.path.isfile(manifest):
  2679. import xml.etree.ElementTree as ET
  2680. tree = ET.parse(manifest)
  2681. idents = tree.findall('./{urn:schemas-microsoft-com:asm.v1}dependency/{urn:schemas-microsoft-com:asm.v1}dependentAssembly/{urn:schemas-microsoft-com:asm.v1}assemblyIdentity')
  2682. else:
  2683. idents = ()
  2684. for ident in idents:
  2685. sxs_name = '_'.join([
  2686. ident.get('processorArchitecture'),
  2687. ident.get('name').lower(),
  2688. ident.get('publicKeyToken'),
  2689. ident.get('version'),
  2690. ])
  2691. # Find the manifest matching these parameters.
  2692. pattern = os.path.join('C:' + os.sep, 'Windows', 'WinSxS', 'Manifests', sxs_name + '_*.manifest')
  2693. manifests = glob.glob(pattern)
  2694. if not manifests:
  2695. Warn("Could not locate manifest %s. You may need to reinstall the Visual C++ Redistributable." % (pattern))
  2696. continue
  2697. CopyFile(GetOutputDir() + "/python/" + ident.get('name') + ".manifest", manifests[0])
  2698. # Also copy the corresponding msvcr dll.
  2699. pattern = os.path.join('C:' + os.sep, 'Windows', 'WinSxS', sxs_name + '_*', 'msvcr*.dll')
  2700. for file in glob.glob(pattern):
  2701. CopyFile(GetOutputDir() + "/python/", file)
  2702. # Copy python.exe to ppython.exe.
  2703. if COPY_PYTHON:
  2704. if not os.path.isfile(SDK["PYTHON"] + "/ppython.exe") and os.path.isfile(SDK["PYTHON"] + "/python.exe"):
  2705. CopyFile(GetOutputDir() + "/python/ppython.exe", SDK["PYTHON"] + "/python.exe")
  2706. if not os.path.isfile(SDK["PYTHON"] + "/ppythonw.exe") and os.path.isfile(SDK["PYTHON"] + "/pythonw.exe"):
  2707. CopyFile(GetOutputDir() + "/python/ppythonw.exe", SDK["PYTHON"] + "/pythonw.exe")
  2708. ConditionalWriteFile(GetOutputDir() + "/python/panda.pth", "..\n../bin\n")
  2709. # Copy over the MSVC runtime.
  2710. if GetTarget() == 'windows' and "VISUALSTUDIO" in SDK:
  2711. vcver = "%s%s" % (SDK["MSVC_VERSION"][0], 0) # ignore minor version.
  2712. crtname = "Microsoft.VC%s.CRT" % (vcver)
  2713. if ("VCTOOLSVERSION" in SDK):
  2714. dir = os.path.join(SDK["VISUALSTUDIO"], "VC", "Redist", "MSVC", SDK["VCTOOLSVERSION"], "onecore", GetTargetArch(), crtname)
  2715. else:
  2716. dir = os.path.join(SDK["VISUALSTUDIO"], "VC", "redist", GetTargetArch(), crtname)
  2717. if os.path.isfile(os.path.join(dir, "msvcr" + vcver + ".dll")):
  2718. CopyFile(GetOutputDir() + "/bin/", os.path.join(dir, "msvcr" + vcver + ".dll"))
  2719. if os.path.isfile(os.path.join(dir, "msvcp" + vcver + ".dll")):
  2720. CopyFile(GetOutputDir() + "/bin/", os.path.join(dir, "msvcp" + vcver + ".dll"))
  2721. if os.path.isfile(os.path.join(dir, "vcruntime" + vcver + ".dll")):
  2722. CopyFile(GetOutputDir() + "/bin/", os.path.join(dir, "vcruntime" + vcver + ".dll"))
  2723. ########################################################################
  2724. ##
  2725. ## Copy various stuff into the build.
  2726. ##
  2727. ########################################################################
  2728. if GetTarget() == 'windows':
  2729. # Convert to Windows newlines so they can be opened by notepad.
  2730. WriteFile(GetOutputDir() + "/LICENSE", ReadFile("doc/LICENSE"), newline='\r\n')
  2731. WriteFile(GetOutputDir() + "/ReleaseNotes", ReadFile("doc/ReleaseNotes"), newline='\r\n')
  2732. CopyFile(GetOutputDir() + "/pandaIcon.ico", "panda/src/configfiles/pandaIcon.ico")
  2733. else:
  2734. CopyFile(GetOutputDir()+"/", "doc/LICENSE")
  2735. CopyFile(GetOutputDir()+"/", "doc/ReleaseNotes")
  2736. if not PkgSkip("PANDATOOL"):
  2737. CopyAllFiles(GetOutputDir()+"/plugins/", "pandatool/src/scripts/", ".mel")
  2738. CopyAllFiles(GetOutputDir()+"/plugins/", "pandatool/src/scripts/", ".ms")
  2739. if not PkgSkip("PYTHON") and os.path.isdir(GetThirdpartyBase() + "/Pmw"):
  2740. CopyTree(GetOutputDir() + "/Pmw", GetThirdpartyBase() + "/Pmw", exclude=["Pmw_1_3", "Pmw_1_3_3"])
  2741. ConditionalWriteFile(GetOutputDir()+'/include/ctl3d.h', '/* dummy file to make MAX happy */')
  2742. # Since Eigen is included by all sorts of core headers, as a convenience
  2743. # to C++ users on Win and Mac, we include it in the Panda include directory.
  2744. if not PkgSkip("EIGEN") and GetTarget() in ("windows", "darwin") and GetThirdpartyDir():
  2745. CopyTree(GetOutputDir()+'/include/Eigen', GetThirdpartyDir()+'eigen/include/Eigen')
  2746. ########################################################################
  2747. #
  2748. # Copy header files to the built/include/parser-inc directory.
  2749. #
  2750. ########################################################################
  2751. CopyTree(GetOutputDir()+'/include/parser-inc','dtool/src/parser-inc')
  2752. DeleteVCS(GetOutputDir()+'/include/parser-inc')
  2753. ########################################################################
  2754. #
  2755. # Transfer all header files to the built/include directory.
  2756. #
  2757. ########################################################################
  2758. CopyAllHeaders('dtool/src/dtoolbase')
  2759. CopyAllHeaders('dtool/src/dtoolutil', skip=["pandaVersion.h", "checkPandaVersion.h"])
  2760. CopyFile(GetOutputDir()+'/include/','dtool/src/dtoolutil/vector_src.cxx')
  2761. CopyAllHeaders('dtool/metalibs/dtool')
  2762. CopyAllHeaders('dtool/src/cppparser')
  2763. CopyAllHeaders('dtool/src/prc', skip=["prc_parameters.h"])
  2764. CopyAllHeaders('dtool/src/dconfig')
  2765. CopyAllHeaders('dtool/src/interrogatedb')
  2766. CopyAllHeaders('dtool/metalibs/dtoolconfig')
  2767. CopyAllHeaders('dtool/src/interrogate')
  2768. CopyAllHeaders('dtool/src/test_interrogate')
  2769. CopyAllHeaders('panda/src/putil')
  2770. CopyAllHeaders('panda/src/pandabase')
  2771. CopyAllHeaders('panda/src/express')
  2772. CopyAllHeaders('panda/src/downloader')
  2773. CopyAllHeaders('panda/metalibs/pandaexpress')
  2774. CopyAllHeaders('panda/src/pipeline')
  2775. CopyAllHeaders('panda/src/linmath')
  2776. CopyAllHeaders('panda/src/putil')
  2777. CopyAllHeaders('dtool/src/prckeys')
  2778. CopyAllHeaders('panda/src/audio')
  2779. CopyAllHeaders('panda/src/event')
  2780. CopyAllHeaders('panda/src/mathutil')
  2781. CopyAllHeaders('panda/src/gsgbase')
  2782. CopyAllHeaders('panda/src/pnmimage')
  2783. CopyAllHeaders('panda/src/nativenet')
  2784. CopyAllHeaders('panda/src/net')
  2785. CopyAllHeaders('panda/src/pstatclient')
  2786. CopyAllHeaders('panda/src/gobj')
  2787. CopyAllHeaders('panda/src/movies')
  2788. CopyAllHeaders('panda/src/pgraphnodes')
  2789. CopyAllHeaders('panda/src/pgraph')
  2790. CopyAllHeaders('panda/src/cull')
  2791. CopyAllHeaders('panda/src/display')
  2792. CopyAllHeaders('panda/src/chan')
  2793. CopyAllHeaders('panda/src/char')
  2794. CopyAllHeaders('panda/src/dgraph')
  2795. CopyAllHeaders('panda/src/device')
  2796. CopyAllHeaders('panda/src/pnmtext')
  2797. CopyAllHeaders('panda/src/text')
  2798. CopyAllHeaders('panda/src/grutil')
  2799. if not PkgSkip("VISION"):
  2800. CopyAllHeaders('panda/src/vision')
  2801. if not PkgSkip("FFMPEG"):
  2802. CopyAllHeaders('panda/src/ffmpeg')
  2803. if not PkgSkip("NAVIGATION"):
  2804. CopyAllHeaders('panda/src/navigation/Detour/Include')
  2805. CopyAllHeaders('panda/src/navigation')
  2806. if not PkgSkip("NAVMESHGEN"):
  2807. CopyAllHeaders('panda/src/navmeshgen/Recast/Include')
  2808. CopyAllHeaders('panda/src/navmeshgen')
  2809. CopyAllHeaders('panda/src/tform')
  2810. CopyAllHeaders('panda/src/collide')
  2811. CopyAllHeaders('panda/src/parametrics')
  2812. CopyAllHeaders('panda/src/pgui')
  2813. CopyAllHeaders('panda/src/pnmimagetypes')
  2814. CopyAllHeaders('panda/src/recorder')
  2815. if not PkgSkip("VRPN"):
  2816. CopyAllHeaders('panda/src/vrpn')
  2817. CopyAllHeaders('panda/src/wgldisplay')
  2818. CopyAllHeaders('panda/src/ode')
  2819. CopyAllHeaders('panda/metalibs/pandaode')
  2820. if not PkgSkip("PANDAPHYSICS"):
  2821. CopyAllHeaders('panda/src/physics')
  2822. if not PkgSkip("PANDAPARTICLESYSTEM"):
  2823. CopyAllHeaders('panda/src/particlesystem')
  2824. CopyAllHeaders('panda/src/dxml')
  2825. CopyAllHeaders('panda/metalibs/panda')
  2826. CopyAllHeaders('panda/src/audiotraits')
  2827. CopyAllHeaders('panda/src/audiotraits')
  2828. CopyAllHeaders('panda/src/distort')
  2829. CopyAllHeaders('panda/src/downloadertools')
  2830. CopyAllHeaders('panda/src/windisplay')
  2831. CopyAllHeaders('panda/src/dxgsg9')
  2832. CopyAllHeaders('panda/metalibs/pandadx9')
  2833. if not PkgSkip("EGG"):
  2834. CopyAllHeaders('panda/src/egg')
  2835. CopyAllHeaders('panda/src/egg2pg')
  2836. CopyAllHeaders('panda/src/framework')
  2837. CopyAllHeaders('panda/metalibs/pandafx')
  2838. CopyAllHeaders('panda/src/glstuff')
  2839. CopyAllHeaders('panda/src/glgsg')
  2840. CopyAllHeaders('panda/src/glesgsg')
  2841. CopyAllHeaders('panda/src/gles2gsg')
  2842. if not PkgSkip("EGG"):
  2843. CopyAllHeaders('panda/metalibs/pandaegg')
  2844. if GetTarget() == 'windows':
  2845. CopyAllHeaders('panda/src/wgldisplay')
  2846. elif GetTarget() == 'darwin':
  2847. CopyAllHeaders('panda/src/cocoadisplay')
  2848. elif GetTarget() == 'android':
  2849. CopyAllHeaders('panda/src/android')
  2850. CopyAllHeaders('panda/src/androiddisplay')
  2851. if not PkgSkip('X11'):
  2852. CopyAllHeaders('panda/src/x11display')
  2853. if not PkgSkip('GL'):
  2854. CopyAllHeaders('panda/src/glxdisplay')
  2855. CopyAllHeaders('panda/src/egldisplay')
  2856. CopyAllHeaders('panda/metalibs/pandagl')
  2857. CopyAllHeaders('panda/metalibs/pandagles')
  2858. CopyAllHeaders('panda/metalibs/pandagles2')
  2859. CopyAllHeaders('panda/metalibs/pandaphysics')
  2860. CopyAllHeaders('panda/src/testbed')
  2861. if not PkgSkip("BULLET"):
  2862. CopyAllHeaders('panda/src/bullet')
  2863. CopyAllHeaders('panda/metalibs/pandabullet')
  2864. if not PkgSkip("SPEEDTREE"):
  2865. CopyAllHeaders('contrib/src/speedtree')
  2866. if not PkgSkip("DIRECT"):
  2867. CopyAllHeaders('direct/src/directbase')
  2868. CopyAllHeaders('direct/src/dcparser')
  2869. CopyAllHeaders('direct/src/deadrec')
  2870. CopyAllHeaders('direct/src/distributed')
  2871. CopyAllHeaders('direct/src/interval')
  2872. CopyAllHeaders('direct/src/showbase')
  2873. CopyAllHeaders('direct/src/dcparse')
  2874. if not PkgSkip("PANDATOOL"):
  2875. CopyAllHeaders('pandatool/src/pandatoolbase')
  2876. CopyAllHeaders('pandatool/src/converter')
  2877. CopyAllHeaders('pandatool/src/progbase')
  2878. CopyAllHeaders('pandatool/src/eggbase')
  2879. CopyAllHeaders('pandatool/src/bam')
  2880. CopyAllHeaders('pandatool/src/daeegg')
  2881. CopyAllHeaders('pandatool/src/daeprogs')
  2882. CopyAllHeaders('pandatool/src/dxf')
  2883. CopyAllHeaders('pandatool/src/dxfegg')
  2884. CopyAllHeaders('pandatool/src/dxfprogs')
  2885. CopyAllHeaders('pandatool/src/palettizer')
  2886. CopyAllHeaders('pandatool/src/egg-mkfont')
  2887. CopyAllHeaders('pandatool/src/eggcharbase')
  2888. CopyAllHeaders('pandatool/src/egg-optchar')
  2889. CopyAllHeaders('pandatool/src/egg-palettize')
  2890. CopyAllHeaders('pandatool/src/egg-qtess')
  2891. CopyAllHeaders('pandatool/src/eggprogs')
  2892. CopyAllHeaders('pandatool/src/flt')
  2893. CopyAllHeaders('pandatool/src/fltegg')
  2894. CopyAllHeaders('pandatool/src/fltprogs')
  2895. CopyAllHeaders('pandatool/src/imagebase')
  2896. CopyAllHeaders('pandatool/src/imageprogs')
  2897. CopyAllHeaders('pandatool/src/pfmprogs')
  2898. CopyAllHeaders('pandatool/src/lwo')
  2899. CopyAllHeaders('pandatool/src/lwoegg')
  2900. CopyAllHeaders('pandatool/src/lwoprogs')
  2901. CopyAllHeaders('pandatool/src/maya')
  2902. CopyAllHeaders('pandatool/src/mayaegg')
  2903. CopyAllHeaders('pandatool/src/maxegg')
  2904. CopyAllHeaders('pandatool/src/maxprogs')
  2905. CopyAllHeaders('pandatool/src/objegg')
  2906. CopyAllHeaders('pandatool/src/objprogs')
  2907. CopyAllHeaders('pandatool/src/vrml')
  2908. CopyAllHeaders('pandatool/src/vrmlegg')
  2909. CopyAllHeaders('pandatool/src/xfile')
  2910. CopyAllHeaders('pandatool/src/xfileegg')
  2911. CopyAllHeaders('pandatool/src/ptloader')
  2912. CopyAllHeaders('pandatool/src/miscprogs')
  2913. CopyAllHeaders('pandatool/src/pstatserver')
  2914. CopyAllHeaders('pandatool/src/text-stats')
  2915. CopyAllHeaders('pandatool/src/vrmlprogs')
  2916. CopyAllHeaders('pandatool/src/win-stats')
  2917. CopyAllHeaders('pandatool/src/xfileprogs')
  2918. if not PkgSkip("CONTRIB"):
  2919. CopyAllHeaders('contrib/src/contribbase')
  2920. CopyAllHeaders('contrib/src/ai')
  2921. ########################################################################
  2922. #
  2923. # These definitions are syntactic shorthand. They make it easy
  2924. # to link with the usual libraries without listing them all.
  2925. #
  2926. ########################################################################
  2927. COMMON_DTOOL_LIBS=[
  2928. 'libp3dtool.dll',
  2929. 'libp3dtoolconfig.dll',
  2930. ]
  2931. COMMON_PANDA_LIBS=[
  2932. 'libpanda.dll',
  2933. 'libpandaexpress.dll'
  2934. ] + COMMON_DTOOL_LIBS
  2935. COMMON_EGG2X_LIBS=[
  2936. 'libp3eggbase.lib',
  2937. 'libp3progbase.lib',
  2938. 'libp3converter.lib',
  2939. 'libp3pandatoolbase.lib',
  2940. 'libpandaegg.dll',
  2941. ] + COMMON_PANDA_LIBS
  2942. ########################################################################
  2943. #
  2944. # This section contains a list of all the files that need to be compiled.
  2945. #
  2946. ########################################################################
  2947. print("Generating dependencies...")
  2948. sys.stdout.flush()
  2949. #
  2950. # Compile Panda icon resource file.
  2951. # We do it first because we need it at
  2952. # the time we compile an executable.
  2953. #
  2954. if GetTarget() == 'windows':
  2955. OPTS=['DIR:panda/src/configfiles']
  2956. TargetAdd('pandaIcon.res', opts=OPTS, input='pandaIcon.rc')
  2957. #
  2958. # DIRECTORY: dtool/src/dtoolbase/
  2959. #
  2960. OPTS=['DIR:dtool/src/dtoolbase', 'BUILDING:DTOOL', 'MIMALLOC']
  2961. TargetAdd('p3dtoolbase_composite1.obj', opts=OPTS, input='p3dtoolbase_composite1.cxx')
  2962. TargetAdd('p3dtoolbase_composite2.obj', opts=OPTS, input='p3dtoolbase_composite2.cxx')
  2963. TargetAdd('p3dtoolbase_lookup3.obj', opts=OPTS, input='lookup3.c')
  2964. TargetAdd('p3dtoolbase_indent.obj', opts=OPTS, input='indent.cxx')
  2965. #
  2966. # DIRECTORY: dtool/src/dtoolutil/
  2967. #
  2968. OPTS=['DIR:dtool/src/dtoolutil', 'BUILDING:DTOOL']
  2969. TargetAdd('p3dtoolutil_composite1.obj', opts=OPTS, input='p3dtoolutil_composite1.cxx')
  2970. TargetAdd('p3dtoolutil_composite2.obj', opts=OPTS, input='p3dtoolutil_composite2.cxx')
  2971. if GetTarget() == 'darwin':
  2972. TargetAdd('p3dtoolutil_filename_assist.obj', opts=OPTS, input='filename_assist.mm')
  2973. #
  2974. # DIRECTORY: dtool/metalibs/dtool/
  2975. #
  2976. OPTS=['DIR:dtool/metalibs/dtool', 'BUILDING:DTOOL']
  2977. TargetAdd('p3dtool_dtool.obj', opts=OPTS, input='dtool.cxx')
  2978. TargetAdd('libp3dtool.dll', input='p3dtool_dtool.obj')
  2979. TargetAdd('libp3dtool.dll', input='p3dtoolutil_composite1.obj')
  2980. TargetAdd('libp3dtool.dll', input='p3dtoolutil_composite2.obj')
  2981. if GetTarget() == 'darwin':
  2982. TargetAdd('libp3dtool.dll', input='p3dtoolutil_filename_assist.obj')
  2983. TargetAdd('libp3dtool.dll', input='p3dtoolbase_composite1.obj')
  2984. TargetAdd('libp3dtool.dll', input='p3dtoolbase_composite2.obj')
  2985. TargetAdd('libp3dtool.dll', input='p3dtoolbase_indent.obj')
  2986. TargetAdd('libp3dtool.dll', input='p3dtoolbase_lookup3.obj')
  2987. TargetAdd('libp3dtool.dll', opts=['ADVAPI','WINSHELL','WINKERNEL','MIMALLOC'])
  2988. #
  2989. # DIRECTORY: dtool/src/cppparser/
  2990. #
  2991. OPTS=['DIR:dtool/src/cppparser', 'BISONPREFIX_cppyy']
  2992. CreateFile(GetOutputDir()+"/include/cppBison.h")
  2993. TargetAdd('p3cppParser_cppBison.obj', opts=OPTS, input='cppBison.yxx')
  2994. TargetAdd('cppBison.h', input='p3cppParser_cppBison.obj', opts=['DEPENDENCYONLY'])
  2995. TargetAdd('p3cppParser_composite1.obj', opts=OPTS, input='p3cppParser_composite1.cxx')
  2996. TargetAdd('p3cppParser_composite2.obj', opts=OPTS, input='p3cppParser_composite2.cxx')
  2997. TargetAdd('libp3cppParser.ilb', input='p3cppParser_composite1.obj')
  2998. TargetAdd('libp3cppParser.ilb', input='p3cppParser_composite2.obj')
  2999. TargetAdd('libp3cppParser.ilb', input='p3cppParser_cppBison.obj')
  3000. #
  3001. # DIRECTORY: dtool/src/prc/
  3002. #
  3003. OPTS=['DIR:dtool/src/prc', 'BUILDING:DTOOLCONFIG', 'OPENSSL']
  3004. TargetAdd('p3prc_composite1.obj', opts=OPTS, input='p3prc_composite1.cxx')
  3005. TargetAdd('p3prc_composite2.obj', opts=OPTS, input='p3prc_composite2.cxx')
  3006. #
  3007. # DIRECTORY: dtool/metalibs/dtoolconfig/
  3008. #
  3009. OPTS=['DIR:dtool/metalibs/dtoolconfig', 'BUILDING:DTOOLCONFIG']
  3010. TargetAdd('p3dtoolconfig_dtoolconfig.obj', opts=OPTS, input='dtoolconfig.cxx')
  3011. TargetAdd('libp3dtoolconfig.dll', input='p3dtoolconfig_dtoolconfig.obj')
  3012. TargetAdd('libp3dtoolconfig.dll', input='p3prc_composite1.obj')
  3013. TargetAdd('libp3dtoolconfig.dll', input='p3prc_composite2.obj')
  3014. TargetAdd('libp3dtoolconfig.dll', input='libp3dtool.dll')
  3015. TargetAdd('libp3dtoolconfig.dll', opts=['ADVAPI', 'OPENSSL', 'WINGDI', 'WINUSER'])
  3016. #
  3017. # DIRECTORY: dtool/src/interrogatedb/
  3018. #
  3019. OPTS=['DIR:dtool/src/interrogatedb', 'BUILDING:INTERROGATEDB']
  3020. TargetAdd('p3interrogatedb_composite1.obj', opts=OPTS, input='p3interrogatedb_composite1.cxx')
  3021. TargetAdd('p3interrogatedb_composite2.obj', opts=OPTS, input='p3interrogatedb_composite2.cxx')
  3022. TargetAdd('libp3interrogatedb.dll', input='p3interrogatedb_composite1.obj')
  3023. TargetAdd('libp3interrogatedb.dll', input='p3interrogatedb_composite2.obj')
  3024. TargetAdd('libp3interrogatedb.dll', input='libp3dtool.dll')
  3025. TargetAdd('libp3interrogatedb.dll', input='libp3dtoolconfig.dll')
  3026. # This used to be called dtoolconfig.pyd, but it just contains the interrogatedb
  3027. # stuff, so it has been renamed appropriately.
  3028. OPTS=['DIR:dtool/metalibs/dtoolconfig']
  3029. PyTargetAdd('interrogatedb_pydtool.obj', opts=OPTS, input="pydtool.cxx")
  3030. PyTargetAdd('interrogatedb.pyd', input='interrogatedb_pydtool.obj')
  3031. PyTargetAdd('interrogatedb.pyd', input='libp3dtool.dll')
  3032. PyTargetAdd('interrogatedb.pyd', input='libp3dtoolconfig.dll')
  3033. PyTargetAdd('interrogatedb.pyd', input='libp3interrogatedb.dll')
  3034. #
  3035. # DIRECTORY: dtool/src/interrogate/
  3036. #
  3037. OPTS=['DIR:dtool/src/interrogate', 'DIR:dtool/src/cppparser', 'DIR:dtool/src/interrogatedb']
  3038. TargetAdd('interrogate_composite1.obj', opts=OPTS, input='interrogate_composite1.cxx')
  3039. TargetAdd('interrogate_composite2.obj', opts=OPTS, input='interrogate_composite2.cxx')
  3040. TargetAdd('interrogate.exe', input='interrogate_composite1.obj')
  3041. TargetAdd('interrogate.exe', input='interrogate_composite2.obj')
  3042. TargetAdd('interrogate.exe', input='libp3cppParser.ilb')
  3043. TargetAdd('interrogate.exe', input=COMMON_DTOOL_LIBS)
  3044. TargetAdd('interrogate.exe', input='libp3interrogatedb.dll')
  3045. TargetAdd('interrogate.exe', opts=['ADVAPI', 'WINSHELL', 'WINGDI', 'WINUSER'])
  3046. preamble = WriteEmbeddedStringFile('interrogate_preamble_python_native', inputs=[
  3047. 'dtool/src/interrogatedb/py_panda.cxx',
  3048. 'dtool/src/interrogatedb/py_compat.cxx',
  3049. 'dtool/src/interrogatedb/py_wrappers.cxx',
  3050. 'dtool/src/interrogatedb/dtool_super_base.cxx',
  3051. ])
  3052. TargetAdd('interrogate_module_preamble_python_native.obj', opts=OPTS, input=preamble)
  3053. TargetAdd('interrogate_module_interrogate_module.obj', opts=OPTS, input='interrogate_module.cxx')
  3054. TargetAdd('interrogate_module.exe', input='interrogate_module_interrogate_module.obj')
  3055. TargetAdd('interrogate_module.exe', input='interrogate_module_preamble_python_native.obj')
  3056. TargetAdd('interrogate_module.exe', input='libp3cppParser.ilb')
  3057. TargetAdd('interrogate_module.exe', input=COMMON_DTOOL_LIBS)
  3058. TargetAdd('interrogate_module.exe', input='libp3interrogatedb.dll')
  3059. TargetAdd('interrogate_module.exe', opts=['ADVAPI', 'WINSHELL', 'WINGDI', 'WINUSER'])
  3060. TargetAdd('parse_file_parse_file.obj', opts=OPTS, input='parse_file.cxx')
  3061. TargetAdd('parse_file.exe', input='parse_file_parse_file.obj')
  3062. TargetAdd('parse_file.exe', input='libp3cppParser.ilb')
  3063. TargetAdd('parse_file.exe', input=COMMON_DTOOL_LIBS)
  3064. TargetAdd('parse_file.exe', input='libp3interrogatedb.dll')
  3065. TargetAdd('parse_file.exe', opts=['ADVAPI', 'WINSHELL', 'WINGDI', 'WINUSER'])
  3066. #
  3067. # DIRECTORY: dtool/src/prckeys/
  3068. #
  3069. if not PkgSkip("OPENSSL"):
  3070. OPTS=['DIR:dtool/src/prckeys', 'OPENSSL']
  3071. TargetAdd('make-prc-key_makePrcKey.obj', opts=OPTS, input='makePrcKey.cxx')
  3072. TargetAdd('make-prc-key.exe', input='make-prc-key_makePrcKey.obj')
  3073. TargetAdd('make-prc-key.exe', input=COMMON_DTOOL_LIBS)
  3074. TargetAdd('make-prc-key.exe', opts=['ADVAPI', 'OPENSSL', 'WINSHELL', 'WINGDI', 'WINUSER'])
  3075. #
  3076. # DIRECTORY: dtool/src/test_interrogate/
  3077. #
  3078. OPTS=['DIR:dtool/src/test_interrogate']
  3079. TargetAdd('test_interrogate_test_interrogate.obj', opts=OPTS, input='test_interrogate.cxx')
  3080. TargetAdd('test_interrogate.exe', input='test_interrogate_test_interrogate.obj')
  3081. TargetAdd('test_interrogate.exe', input='libp3interrogatedb.dll')
  3082. TargetAdd('test_interrogate.exe', input=COMMON_DTOOL_LIBS)
  3083. TargetAdd('test_interrogate.exe', opts=['ADVAPI', 'WINSHELL', 'WINGDI', 'WINUSER'])
  3084. #
  3085. # DIRECTORY: dtool/src/dtoolbase/
  3086. #
  3087. OPTS=['DIR:dtool/src/dtoolbase']
  3088. IGATEFILES=GetDirectoryContents('dtool/src/dtoolbase', ["*_composite*.cxx"])
  3089. IGATEFILES += [
  3090. "typeHandle.h",
  3091. "typeHandle_ext.h",
  3092. "typeRegistry.h",
  3093. "typedObject.h",
  3094. "neverFreeMemory.h",
  3095. ]
  3096. TargetAdd('libp3dtoolbase.in', opts=OPTS, input=IGATEFILES)
  3097. TargetAdd('libp3dtoolbase.in', opts=['IMOD:panda3d.core', 'ILIB:libp3dtoolbase', 'SRCDIR:dtool/src/dtoolbase'])
  3098. PyTargetAdd('p3dtoolbase_typeHandle_ext.obj', opts=OPTS, input='typeHandle_ext.cxx')
  3099. #
  3100. # DIRECTORY: dtool/src/dtoolutil/
  3101. #
  3102. OPTS=['DIR:dtool/src/dtoolutil']
  3103. IGATEFILES=GetDirectoryContents('dtool/src/dtoolutil', ["*_composite*.cxx"])
  3104. IGATEFILES += [
  3105. "config_dtoolutil.h",
  3106. "pandaSystem.h",
  3107. "dSearchPath.h",
  3108. "executionEnvironment.h",
  3109. "textEncoder.h",
  3110. "textEncoder_ext.h",
  3111. "filename.h",
  3112. "filename_ext.h",
  3113. "globPattern.h",
  3114. "globPattern_ext.h",
  3115. "pandaFileStream.h",
  3116. "lineStream.h",
  3117. "iostream_ext.h",
  3118. ]
  3119. TargetAdd('libp3dtoolutil.in', opts=OPTS, input=IGATEFILES)
  3120. TargetAdd('libp3dtoolutil.in', opts=['IMOD:panda3d.core', 'ILIB:libp3dtoolutil', 'SRCDIR:dtool/src/dtoolutil'])
  3121. PyTargetAdd('p3dtoolutil_ext_composite.obj', opts=OPTS, input='p3dtoolutil_ext_composite.cxx')
  3122. #
  3123. # DIRECTORY: dtool/src/prc/
  3124. #
  3125. OPTS=['DIR:dtool/src/prc']
  3126. IGATEFILES=GetDirectoryContents('dtool/src/prc', ["*.h", "*_composite*.cxx"])
  3127. TargetAdd('libp3prc.in', opts=OPTS, input=IGATEFILES)
  3128. TargetAdd('libp3prc.in', opts=['IMOD:panda3d.core', 'ILIB:libp3prc', 'SRCDIR:dtool/src/prc'])
  3129. PyTargetAdd('p3prc_ext_composite.obj', opts=OPTS, input='p3prc_ext_composite.cxx')
  3130. #
  3131. # DIRECTORY: panda/src/pandabase/
  3132. #
  3133. OPTS=['DIR:panda/src/pandabase', 'BUILDING:PANDAEXPRESS']
  3134. TargetAdd('p3pandabase_pandabase.obj', opts=OPTS, input='pandabase.cxx')
  3135. #
  3136. # DIRECTORY: panda/src/express/
  3137. #
  3138. OPTS=['DIR:panda/src/express', 'BUILDING:PANDAEXPRESS', 'OPENSSL', 'ZLIB']
  3139. TargetAdd('p3express_composite1.obj', opts=OPTS, input='p3express_composite1.cxx')
  3140. TargetAdd('p3express_composite2.obj', opts=OPTS, input='p3express_composite2.cxx')
  3141. OPTS=['DIR:panda/src/express', 'OPENSSL', 'ZLIB']
  3142. IGATEFILES=GetDirectoryContents('panda/src/express', ["*.h", "*_composite*.cxx"])
  3143. TargetAdd('libp3express.in', opts=OPTS, input=IGATEFILES)
  3144. TargetAdd('libp3express.in', opts=['IMOD:panda3d.core', 'ILIB:libp3express', 'SRCDIR:panda/src/express'])
  3145. PyTargetAdd('p3express_ext_composite.obj', opts=OPTS, input='p3express_ext_composite.cxx')
  3146. #
  3147. # DIRECTORY: panda/src/downloader/
  3148. #
  3149. OPTS=['DIR:panda/src/downloader', 'BUILDING:PANDAEXPRESS', 'OPENSSL', 'ZLIB']
  3150. TargetAdd('p3downloader_composite1.obj', opts=OPTS, input='p3downloader_composite1.cxx')
  3151. TargetAdd('p3downloader_composite2.obj', opts=OPTS, input='p3downloader_composite2.cxx')
  3152. OPTS=['DIR:panda/src/downloader', 'OPENSSL', 'ZLIB']
  3153. IGATEFILES=GetDirectoryContents('panda/src/downloader', ["*.h", "*_composite*.cxx"])
  3154. TargetAdd('libp3downloader.in', opts=OPTS, input=IGATEFILES)
  3155. TargetAdd('libp3downloader.in', opts=['IMOD:panda3d.core', 'ILIB:libp3downloader', 'SRCDIR:panda/src/downloader'])
  3156. #
  3157. # DIRECTORY: panda/metalibs/pandaexpress/
  3158. #
  3159. OPTS=['DIR:panda/metalibs/pandaexpress', 'BUILDING:PANDAEXPRESS', 'ZLIB']
  3160. TargetAdd('pandaexpress_pandaexpress.obj', opts=OPTS, input='pandaexpress.cxx')
  3161. TargetAdd('libpandaexpress.dll', input='pandaexpress_pandaexpress.obj')
  3162. TargetAdd('libpandaexpress.dll', input='p3downloader_composite1.obj')
  3163. TargetAdd('libpandaexpress.dll', input='p3downloader_composite2.obj')
  3164. TargetAdd('libpandaexpress.dll', input='p3express_composite1.obj')
  3165. TargetAdd('libpandaexpress.dll', input='p3express_composite2.obj')
  3166. TargetAdd('libpandaexpress.dll', input='p3pandabase_pandabase.obj')
  3167. TargetAdd('libpandaexpress.dll', input=COMMON_DTOOL_LIBS)
  3168. TargetAdd('libpandaexpress.dll', opts=['ADVAPI', 'WINSOCK2', 'OPENSSL', 'ZLIB', 'WINGDI', 'WINUSER', 'ANDROID'])
  3169. #
  3170. # DIRECTORY: panda/src/pipeline/
  3171. #
  3172. OPTS=['DIR:panda/src/pipeline', 'BUILDING:PANDA']
  3173. TargetAdd('p3pipeline_composite1.obj', opts=OPTS, input='p3pipeline_composite1.cxx')
  3174. TargetAdd('p3pipeline_composite2.obj', opts=OPTS, input='p3pipeline_composite2.cxx')
  3175. TargetAdd('p3pipeline_contextSwitch.obj', opts=OPTS, input='contextSwitch.c')
  3176. OPTS=['DIR:panda/src/pipeline']
  3177. IGATEFILES=GetDirectoryContents('panda/src/pipeline', ["*.h", "*_composite*.cxx"])
  3178. TargetAdd('libp3pipeline.in', opts=OPTS, input=IGATEFILES)
  3179. TargetAdd('libp3pipeline.in', opts=['IMOD:panda3d.core', 'ILIB:libp3pipeline', 'SRCDIR:panda/src/pipeline'])
  3180. PyTargetAdd('p3pipeline_pythonThread.obj', opts=OPTS, input='pythonThread.cxx')
  3181. #
  3182. # DIRECTORY: panda/src/linmath/
  3183. #
  3184. OPTS=['DIR:panda/src/linmath', 'BUILDING:PANDA']
  3185. TargetAdd('p3linmath_composite1.obj', opts=OPTS, input='p3linmath_composite1.cxx')
  3186. TargetAdd('p3linmath_composite2.obj', opts=OPTS, input='p3linmath_composite2.cxx')
  3187. OPTS=['DIR:panda/src/linmath']
  3188. IGATEFILES=GetDirectoryContents('panda/src/linmath', ["*.h", "*_composite*.cxx"])
  3189. for ifile in IGATEFILES[:]:
  3190. if "_src." in ifile:
  3191. IGATEFILES.remove(ifile)
  3192. IGATEFILES.remove('cast_to_double.h')
  3193. IGATEFILES.remove('lmat_ops.h')
  3194. IGATEFILES.remove('cast_to_float.h')
  3195. TargetAdd('libp3linmath.in', opts=OPTS, input=IGATEFILES)
  3196. TargetAdd('libp3linmath.in', opts=['IMOD:panda3d.core', 'ILIB:libp3linmath', 'SRCDIR:panda/src/linmath'])
  3197. #
  3198. # DIRECTORY: panda/src/putil/
  3199. #
  3200. OPTS=['DIR:panda/src/putil', 'BUILDING:PANDA', 'ZLIB']
  3201. TargetAdd('p3putil_composite1.obj', opts=OPTS, input='p3putil_composite1.cxx')
  3202. TargetAdd('p3putil_composite2.obj', opts=OPTS, input='p3putil_composite2.cxx')
  3203. OPTS=['DIR:panda/src/putil', 'ZLIB']
  3204. IGATEFILES=GetDirectoryContents('panda/src/putil', ["*.h", "*_composite*.cxx"])
  3205. IGATEFILES.remove("test_bam.h")
  3206. IGATEFILES.remove("config_util.h")
  3207. TargetAdd('libp3putil.in', opts=OPTS, input=IGATEFILES)
  3208. TargetAdd('libp3putil.in', opts=['IMOD:panda3d.core', 'ILIB:libp3putil', 'SRCDIR:panda/src/putil'])
  3209. PyTargetAdd('p3putil_ext_composite.obj', opts=OPTS, input='p3putil_ext_composite.cxx')
  3210. #
  3211. # DIRECTORY: panda/src/audio/
  3212. #
  3213. OPTS=['DIR:panda/src/audio', 'BUILDING:PANDA']
  3214. TargetAdd('p3audio_composite1.obj', opts=OPTS, input='p3audio_composite1.cxx')
  3215. OPTS=['DIR:panda/src/audio']
  3216. IGATEFILES=["audio.h"]
  3217. TargetAdd('libp3audio.in', opts=OPTS, input=IGATEFILES)
  3218. TargetAdd('libp3audio.in', opts=['IMOD:panda3d.core', 'ILIB:libp3audio', 'SRCDIR:panda/src/audio'])
  3219. #
  3220. # DIRECTORY: panda/src/event/
  3221. #
  3222. OPTS=['DIR:panda/src/event', 'BUILDING:PANDA']
  3223. TargetAdd('p3event_composite1.obj', opts=OPTS, input='p3event_composite1.cxx')
  3224. TargetAdd('p3event_composite2.obj', opts=OPTS, input='p3event_composite2.cxx')
  3225. OPTS=['DIR:panda/src/event']
  3226. PyTargetAdd('p3event_asyncFuture_ext.obj', opts=OPTS, input='asyncFuture_ext.cxx')
  3227. PyTargetAdd('p3event_pythonTask.obj', opts=OPTS, input='pythonTask.cxx')
  3228. IGATEFILES=GetDirectoryContents('panda/src/event', ["*.h", "*_composite*.cxx"])
  3229. TargetAdd('libp3event.in', opts=OPTS, input=IGATEFILES)
  3230. TargetAdd('libp3event.in', opts=['IMOD:panda3d.core', 'ILIB:libp3event', 'SRCDIR:panda/src/event'])
  3231. #
  3232. # DIRECTORY: panda/src/mathutil/
  3233. #
  3234. OPTS=['DIR:panda/src/mathutil', 'BUILDING:PANDA', 'FFTW']
  3235. TargetAdd('p3mathutil_composite1.obj', opts=OPTS, input='p3mathutil_composite1.cxx')
  3236. TargetAdd('p3mathutil_composite2.obj', opts=OPTS, input='p3mathutil_composite2.cxx')
  3237. OPTS=['DIR:panda/src/mathutil', 'FFTW']
  3238. IGATEFILES=GetDirectoryContents('panda/src/mathutil', ["*.h", "*_composite*.cxx"])
  3239. for ifile in IGATEFILES[:]:
  3240. if "_src." in ifile:
  3241. IGATEFILES.remove(ifile)
  3242. TargetAdd('libp3mathutil.in', opts=OPTS, input=IGATEFILES)
  3243. TargetAdd('libp3mathutil.in', opts=['IMOD:panda3d.core', 'ILIB:libp3mathutil', 'SRCDIR:panda/src/mathutil'])
  3244. #
  3245. # DIRECTORY: panda/src/gsgbase/
  3246. #
  3247. OPTS=['DIR:panda/src/gsgbase', 'BUILDING:PANDA']
  3248. TargetAdd('p3gsgbase_composite1.obj', opts=OPTS, input='p3gsgbase_composite1.cxx')
  3249. OPTS=['DIR:panda/src/gsgbase']
  3250. IGATEFILES=GetDirectoryContents('panda/src/gsgbase', ["*.h", "*_composite*.cxx"])
  3251. TargetAdd('libp3gsgbase.in', opts=OPTS, input=IGATEFILES)
  3252. TargetAdd('libp3gsgbase.in', opts=['IMOD:panda3d.core', 'ILIB:libp3gsgbase', 'SRCDIR:panda/src/gsgbase'])
  3253. #
  3254. # DIRECTORY: panda/src/pnmimage/
  3255. #
  3256. OPTS=['DIR:panda/src/pnmimage', 'BUILDING:PANDA', 'ZLIB']
  3257. TargetAdd('p3pnmimage_composite1.obj', opts=OPTS, input='p3pnmimage_composite1.cxx')
  3258. TargetAdd('p3pnmimage_composite2.obj', opts=OPTS, input='p3pnmimage_composite2.cxx')
  3259. TargetAdd('p3pnmimage_convert_srgb_sse2.obj', opts=OPTS+['SSE2'], input='convert_srgb_sse2.cxx')
  3260. OPTS=['DIR:panda/src/pnmimage', 'ZLIB']
  3261. IGATEFILES=GetDirectoryContents('panda/src/pnmimage', ["*.h", "*_composite*.cxx"])
  3262. TargetAdd('libp3pnmimage.in', opts=OPTS, input=IGATEFILES)
  3263. TargetAdd('libp3pnmimage.in', opts=['IMOD:panda3d.core', 'ILIB:libp3pnmimage', 'SRCDIR:panda/src/pnmimage'])
  3264. PyTargetAdd('p3pnmimage_pfmFile_ext.obj', opts=OPTS, input='pfmFile_ext.cxx')
  3265. #
  3266. # DIRECTORY: panda/src/nativenet/
  3267. #
  3268. OPTS=['DIR:panda/src/nativenet', 'BUILDING:PANDA']
  3269. TargetAdd('p3nativenet_composite1.obj', opts=OPTS, input='p3nativenet_composite1.cxx')
  3270. OPTS=['DIR:panda/src/nativenet']
  3271. IGATEFILES=GetDirectoryContents('panda/src/nativenet', ["*.h", "*_composite*.cxx"])
  3272. TargetAdd('libp3nativenet.in', opts=OPTS, input=IGATEFILES)
  3273. TargetAdd('libp3nativenet.in', opts=['IMOD:panda3d.core', 'ILIB:libp3nativenet', 'SRCDIR:panda/src/nativenet'])
  3274. #
  3275. # DIRECTORY: panda/src/net/
  3276. #
  3277. OPTS=['DIR:panda/src/net', 'BUILDING:PANDA']
  3278. TargetAdd('p3net_composite1.obj', opts=OPTS, input='p3net_composite1.cxx')
  3279. TargetAdd('p3net_composite2.obj', opts=OPTS, input='p3net_composite2.cxx')
  3280. OPTS=['DIR:panda/src/net']
  3281. IGATEFILES=GetDirectoryContents('panda/src/net', ["*.h", "*_composite*.cxx"])
  3282. IGATEFILES.remove("datagram_ui.h")
  3283. TargetAdd('libp3net.in', opts=OPTS, input=IGATEFILES)
  3284. TargetAdd('libp3net.in', opts=['IMOD:panda3d.core', 'ILIB:libp3net', 'SRCDIR:panda/src/net'])
  3285. #
  3286. # DIRECTORY: panda/src/pstatclient/
  3287. #
  3288. OPTS=['DIR:panda/src/pstatclient', 'BUILDING:PANDA']
  3289. TargetAdd('p3pstatclient_composite1.obj', opts=OPTS, input='p3pstatclient_composite1.cxx')
  3290. TargetAdd('p3pstatclient_composite2.obj', opts=OPTS, input='p3pstatclient_composite2.cxx')
  3291. OPTS=['DIR:panda/src/pstatclient']
  3292. IGATEFILES=GetDirectoryContents('panda/src/pstatclient', ["*.h", "*_composite*.cxx"])
  3293. IGATEFILES.remove("config_pstats.h")
  3294. TargetAdd('libp3pstatclient.in', opts=OPTS, input=IGATEFILES)
  3295. TargetAdd('libp3pstatclient.in', opts=['IMOD:panda3d.core', 'ILIB:libp3pstatclient', 'SRCDIR:panda/src/pstatclient'])
  3296. #
  3297. # DIRECTORY: panda/src/gobj/
  3298. #
  3299. OPTS=['DIR:panda/src/gobj', 'BUILDING:PANDA', 'NVIDIACG', 'ZLIB', 'SQUISH']
  3300. TargetAdd('p3gobj_composite1.obj', opts=OPTS, input='p3gobj_composite1.cxx')
  3301. TargetAdd('p3gobj_composite2.obj', opts=OPTS+['BIGOBJ'], input='p3gobj_composite2.cxx')
  3302. OPTS=['DIR:panda/src/gobj', 'NVIDIACG', 'ZLIB', 'SQUISH']
  3303. IGATEFILES=GetDirectoryContents('panda/src/gobj', ["*.h", "*_composite*.cxx"])
  3304. TargetAdd('libp3gobj.in', opts=OPTS, input=IGATEFILES)
  3305. TargetAdd('libp3gobj.in', opts=['IMOD:panda3d.core', 'ILIB:libp3gobj', 'SRCDIR:panda/src/gobj'])
  3306. PyTargetAdd('p3gobj_ext_composite.obj', opts=OPTS, input='p3gobj_ext_composite.cxx')
  3307. #
  3308. # DIRECTORY: panda/src/pgraphnodes/
  3309. #
  3310. OPTS=['DIR:panda/src/pgraphnodes', 'BUILDING:PANDA']
  3311. TargetAdd('p3pgraphnodes_composite1.obj', opts=OPTS, input='p3pgraphnodes_composite1.cxx')
  3312. TargetAdd('p3pgraphnodes_composite2.obj', opts=OPTS, input='p3pgraphnodes_composite2.cxx')
  3313. OPTS=['DIR:panda/src/pgraphnodes']
  3314. IGATEFILES=GetDirectoryContents('panda/src/pgraphnodes', ["*.h", "*_composite*.cxx"])
  3315. TargetAdd('libp3pgraphnodes.in', opts=OPTS, input=IGATEFILES)
  3316. TargetAdd('libp3pgraphnodes.in', opts=['IMOD:panda3d.core', 'ILIB:libp3pgraphnodes', 'SRCDIR:panda/src/pgraphnodes'])
  3317. #
  3318. # DIRECTORY: panda/src/pgraph/
  3319. #
  3320. OPTS=['DIR:panda/src/pgraph', 'BUILDING:PANDA']
  3321. TargetAdd('p3pgraph_nodePath.obj', opts=OPTS, input='nodePath.cxx')
  3322. TargetAdd('p3pgraph_composite1.obj', opts=OPTS, input='p3pgraph_composite1.cxx')
  3323. TargetAdd('p3pgraph_composite2.obj', opts=OPTS, input='p3pgraph_composite2.cxx')
  3324. TargetAdd('p3pgraph_composite3.obj', opts=OPTS, input='p3pgraph_composite3.cxx')
  3325. TargetAdd('p3pgraph_composite4.obj', opts=OPTS, input='p3pgraph_composite4.cxx')
  3326. OPTS=['DIR:panda/src/pgraph']
  3327. IGATEFILES=GetDirectoryContents('panda/src/pgraph', ["*.h", "nodePath.cxx", "*_composite*.cxx"])
  3328. TargetAdd('libp3pgraph.in', opts=OPTS, input=IGATEFILES)
  3329. TargetAdd('libp3pgraph.in', opts=['IMOD:panda3d.core', 'ILIB:libp3pgraph', 'SRCDIR:panda/src/pgraph'])
  3330. PyTargetAdd('p3pgraph_ext_composite.obj', opts=OPTS, input='p3pgraph_ext_composite.cxx')
  3331. #
  3332. # DIRECTORY: panda/src/cull/
  3333. #
  3334. OPTS=['DIR:panda/src/cull', 'BUILDING:PANDA']
  3335. TargetAdd('p3cull_composite1.obj', opts=OPTS, input='p3cull_composite1.cxx')
  3336. TargetAdd('p3cull_composite2.obj', opts=OPTS, input='p3cull_composite2.cxx')
  3337. OPTS=['DIR:panda/src/cull']
  3338. IGATEFILES=GetDirectoryContents('panda/src/cull', ["*.h", "*_composite*.cxx"])
  3339. TargetAdd('libp3cull.in', opts=OPTS, input=IGATEFILES)
  3340. TargetAdd('libp3cull.in', opts=['IMOD:panda3d.core', 'ILIB:libp3cull', 'SRCDIR:panda/src/cull'])
  3341. #
  3342. # DIRECTORY: panda/src/dgraph/
  3343. #
  3344. OPTS=['DIR:panda/src/dgraph', 'BUILDING:PANDA']
  3345. TargetAdd('p3dgraph_composite1.obj', opts=OPTS, input='p3dgraph_composite1.cxx')
  3346. TargetAdd('p3dgraph_composite2.obj', opts=OPTS, input='p3dgraph_composite2.cxx')
  3347. OPTS=['DIR:panda/src/dgraph']
  3348. IGATEFILES=GetDirectoryContents('panda/src/dgraph', ["*.h", "*_composite*.cxx"])
  3349. TargetAdd('libp3dgraph.in', opts=OPTS, input=IGATEFILES)
  3350. TargetAdd('libp3dgraph.in', opts=['IMOD:panda3d.core', 'ILIB:libp3dgraph', 'SRCDIR:panda/src/dgraph'])
  3351. #
  3352. # DIRECTORY: panda/src/device/
  3353. #
  3354. OPTS=['DIR:panda/src/device', 'BUILDING:PANDA']
  3355. TargetAdd('p3device_composite1.obj', opts=OPTS, input='p3device_composite1.cxx')
  3356. TargetAdd('p3device_composite2.obj', opts=OPTS, input='p3device_composite2.cxx')
  3357. OPTS=['DIR:panda/src/device']
  3358. IGATEFILES=GetDirectoryContents('panda/src/device', ["*.h", "*_composite*.cxx"])
  3359. TargetAdd('libp3device.in', opts=OPTS, input=IGATEFILES)
  3360. TargetAdd('libp3device.in', opts=['IMOD:panda3d.core', 'ILIB:libp3device', 'SRCDIR:panda/src/device'])
  3361. #
  3362. # DIRECTORY: panda/src/display/
  3363. #
  3364. OPTS=['DIR:panda/src/display', 'BUILDING:PANDA', 'X11']
  3365. TargetAdd('p3display_graphicsStateGuardian.obj', opts=OPTS, input='graphicsStateGuardian.cxx')
  3366. TargetAdd('p3display_composite1.obj', opts=OPTS, input='p3display_composite1.cxx')
  3367. TargetAdd('p3display_composite2.obj', opts=OPTS, input='p3display_composite2.cxx')
  3368. OPTS=['DIR:panda/src/display', 'X11']
  3369. IGATEFILES=GetDirectoryContents('panda/src/display', ["*.h", "*_composite*.cxx"])
  3370. IGATEFILES.remove("renderBuffer.h")
  3371. TargetAdd('libp3display.in', opts=OPTS, input=IGATEFILES)
  3372. TargetAdd('libp3display.in', opts=['IMOD:panda3d.core', 'ILIB:libp3display', 'SRCDIR:panda/src/display'])
  3373. PyTargetAdd('p3display_ext_composite.obj', opts=OPTS, input='p3display_ext_composite.cxx')
  3374. #
  3375. # DIRECTORY: panda/src/chan/
  3376. #
  3377. OPTS=['DIR:panda/src/chan', 'BUILDING:PANDA']
  3378. TargetAdd('p3chan_composite1.obj', opts=OPTS, input='p3chan_composite1.cxx')
  3379. TargetAdd('p3chan_composite2.obj', opts=OPTS, input='p3chan_composite2.cxx')
  3380. OPTS=['DIR:panda/src/chan']
  3381. IGATEFILES=GetDirectoryContents('panda/src/chan', ["*.h", "*_composite*.cxx"])
  3382. IGATEFILES.remove('movingPart.h')
  3383. IGATEFILES.remove('animChannelFixed.h')
  3384. TargetAdd('libp3chan.in', opts=OPTS, input=IGATEFILES)
  3385. TargetAdd('libp3chan.in', opts=['IMOD:panda3d.core', 'ILIB:libp3chan', 'SRCDIR:panda/src/chan'])
  3386. # DIRECTORY: panda/src/char/
  3387. #
  3388. OPTS=['DIR:panda/src/char', 'BUILDING:PANDA']
  3389. TargetAdd('p3char_composite1.obj', opts=OPTS, input='p3char_composite1.cxx')
  3390. TargetAdd('p3char_composite2.obj', opts=OPTS, input='p3char_composite2.cxx')
  3391. OPTS=['DIR:panda/src/char']
  3392. IGATEFILES=GetDirectoryContents('panda/src/char', ["*.h", "*_composite*.cxx"])
  3393. TargetAdd('libp3char.in', opts=OPTS, input=IGATEFILES)
  3394. TargetAdd('libp3char.in', opts=['IMOD:panda3d.core', 'ILIB:libp3char', 'SRCDIR:panda/src/char'])
  3395. #
  3396. # DIRECTORY: panda/src/pnmtext/
  3397. #
  3398. if not PkgSkip("FREETYPE"):
  3399. OPTS=['DIR:panda/src/pnmtext', 'BUILDING:PANDA', 'FREETYPE']
  3400. TargetAdd('p3pnmtext_composite1.obj', opts=OPTS, input='p3pnmtext_composite1.cxx')
  3401. OPTS=['DIR:panda/src/pnmtext', 'FREETYPE']
  3402. IGATEFILES=GetDirectoryContents('panda/src/pnmtext', ["*.h", "*_composite*.cxx"])
  3403. TargetAdd('libp3pnmtext.in', opts=OPTS, input=IGATEFILES)
  3404. TargetAdd('libp3pnmtext.in', opts=['IMOD:panda3d.core', 'ILIB:libp3pnmtext', 'SRCDIR:panda/src/pnmtext'])
  3405. #
  3406. # DIRECTORY: panda/src/text/
  3407. #
  3408. if not PkgSkip("HARFBUZZ"):
  3409. DefSymbol("HARFBUZZ", "HAVE_HARFBUZZ")
  3410. OPTS=['DIR:panda/src/text', 'BUILDING:PANDA', 'ZLIB', 'FREETYPE', 'HARFBUZZ']
  3411. TargetAdd('p3text_composite1.obj', opts=OPTS, input='p3text_composite1.cxx')
  3412. TargetAdd('p3text_composite2.obj', opts=OPTS, input='p3text_composite2.cxx')
  3413. OPTS=['DIR:panda/src/text', 'ZLIB', 'FREETYPE']
  3414. IGATEFILES=GetDirectoryContents('panda/src/text', ["*.h", "*_composite*.cxx"])
  3415. TargetAdd('libp3text.in', opts=OPTS, input=IGATEFILES)
  3416. TargetAdd('libp3text.in', opts=['IMOD:panda3d.core', 'ILIB:libp3text', 'SRCDIR:panda/src/text'])
  3417. #
  3418. # DIRECTORY: panda/src/movies/
  3419. #
  3420. OPTS=['DIR:panda/src/movies', 'BUILDING:PANDA', 'VORBIS', 'OPUS']
  3421. TargetAdd('p3movies_composite1.obj', opts=OPTS, input='p3movies_composite1.cxx')
  3422. OPTS=['DIR:panda/src/movies', 'VORBIS', 'OPUS']
  3423. IGATEFILES=GetDirectoryContents('panda/src/movies', ["*.h", "*_composite*.cxx"])
  3424. TargetAdd('libp3movies.in', opts=OPTS, input=IGATEFILES)
  3425. TargetAdd('libp3movies.in', opts=['IMOD:panda3d.core', 'ILIB:libp3movies', 'SRCDIR:panda/src/movies'])
  3426. #
  3427. # DIRECTORY: panda/src/grutil/
  3428. #
  3429. OPTS=['DIR:panda/src/grutil', 'BUILDING:PANDA']
  3430. TargetAdd('p3grutil_multitexReducer.obj', opts=OPTS, input='multitexReducer.cxx')
  3431. TargetAdd('p3grutil_composite1.obj', opts=OPTS, input='p3grutil_composite1.cxx')
  3432. TargetAdd('p3grutil_composite2.obj', opts=OPTS, input='p3grutil_composite2.cxx')
  3433. OPTS=['DIR:panda/src/grutil']
  3434. IGATEFILES=GetDirectoryContents('panda/src/grutil', ["*.h", "*_composite*.cxx"])
  3435. TargetAdd('libp3grutil.in', opts=OPTS, input=IGATEFILES)
  3436. TargetAdd('libp3grutil.in', opts=['IMOD:panda3d.core', 'ILIB:libp3grutil', 'SRCDIR:panda/src/grutil'])
  3437. #
  3438. # DIRECTORY: panda/src/tform/
  3439. #
  3440. OPTS=['DIR:panda/src/tform', 'BUILDING:PANDA']
  3441. TargetAdd('p3tform_composite1.obj', opts=OPTS, input='p3tform_composite1.cxx')
  3442. TargetAdd('p3tform_composite2.obj', opts=OPTS, input='p3tform_composite2.cxx')
  3443. OPTS=['DIR:panda/src/tform']
  3444. IGATEFILES=GetDirectoryContents('panda/src/tform', ["*.h", "*_composite*.cxx"])
  3445. TargetAdd('libp3tform.in', opts=OPTS, input=IGATEFILES)
  3446. TargetAdd('libp3tform.in', opts=['IMOD:panda3d.core', 'ILIB:libp3tform', 'SRCDIR:panda/src/tform'])
  3447. #
  3448. # DIRECTORY: panda/src/collide/
  3449. #
  3450. OPTS=['DIR:panda/src/collide', 'BUILDING:PANDA']
  3451. TargetAdd('p3collide_composite1.obj', opts=OPTS, input='p3collide_composite1.cxx')
  3452. TargetAdd('p3collide_composite2.obj', opts=OPTS, input='p3collide_composite2.cxx')
  3453. OPTS=['DIR:panda/src/collide']
  3454. IGATEFILES=GetDirectoryContents('panda/src/collide', ["*.h", "*_composite*.cxx"])
  3455. TargetAdd('libp3collide.in', opts=OPTS, input=IGATEFILES)
  3456. TargetAdd('libp3collide.in', opts=['IMOD:panda3d.core', 'ILIB:libp3collide', 'SRCDIR:panda/src/collide'])
  3457. PyTargetAdd('p3collide_ext_composite.obj', opts=OPTS, input='p3collide_ext_composite.cxx')
  3458. #
  3459. # DIRECTORY: panda/src/parametrics/
  3460. #
  3461. OPTS=['DIR:panda/src/parametrics', 'BUILDING:PANDA']
  3462. TargetAdd('p3parametrics_composite1.obj', opts=OPTS, input='p3parametrics_composite1.cxx')
  3463. TargetAdd('p3parametrics_composite2.obj', opts=OPTS, input='p3parametrics_composite2.cxx')
  3464. OPTS=['DIR:panda/src/parametrics']
  3465. IGATEFILES=GetDirectoryContents('panda/src/parametrics', ["*.h", "*_composite*.cxx"])
  3466. TargetAdd('libp3parametrics.in', opts=OPTS, input=IGATEFILES)
  3467. TargetAdd('libp3parametrics.in', opts=['IMOD:panda3d.core', 'ILIB:libp3parametrics', 'SRCDIR:panda/src/parametrics'])
  3468. #
  3469. # DIRECTORY: panda/src/pgui/
  3470. #
  3471. OPTS=['DIR:panda/src/pgui', 'BUILDING:PANDA']
  3472. TargetAdd('p3pgui_composite1.obj', opts=OPTS, input='p3pgui_composite1.cxx')
  3473. TargetAdd('p3pgui_composite2.obj', opts=OPTS, input='p3pgui_composite2.cxx')
  3474. OPTS=['DIR:panda/src/pgui']
  3475. IGATEFILES=GetDirectoryContents('panda/src/pgui', ["*.h", "*_composite*.cxx"])
  3476. TargetAdd('libp3pgui.in', opts=OPTS, input=IGATEFILES)
  3477. TargetAdd('libp3pgui.in', opts=['IMOD:panda3d.core', 'ILIB:libp3pgui', 'SRCDIR:panda/src/pgui'])
  3478. #
  3479. # DIRECTORY: panda/src/pnmimagetypes/
  3480. #
  3481. OPTS=['DIR:panda/src/pnmimagetypes', 'DIR:panda/src/pnmimage', 'BUILDING:PANDA', 'PNG', 'ZLIB', 'JPEG', 'TIFF', 'OPENEXR', 'EXCEPTIONS']
  3482. TargetAdd('p3pnmimagetypes_composite1.obj', opts=OPTS, input='p3pnmimagetypes_composite1.cxx')
  3483. TargetAdd('p3pnmimagetypes_composite2.obj', opts=OPTS, input='p3pnmimagetypes_composite2.cxx')
  3484. #
  3485. # DIRECTORY: panda/src/recorder/
  3486. #
  3487. OPTS=['DIR:panda/src/recorder', 'BUILDING:PANDA']
  3488. TargetAdd('p3recorder_composite1.obj', opts=OPTS, input='p3recorder_composite1.cxx')
  3489. TargetAdd('p3recorder_composite2.obj', opts=OPTS, input='p3recorder_composite2.cxx')
  3490. OPTS=['DIR:panda/src/recorder']
  3491. IGATEFILES=GetDirectoryContents('panda/src/recorder', ["*.h", "*_composite*.cxx"])
  3492. TargetAdd('libp3recorder.in', opts=OPTS, input=IGATEFILES)
  3493. TargetAdd('libp3recorder.in', opts=['IMOD:panda3d.core', 'ILIB:libp3recorder', 'SRCDIR:panda/src/recorder'])
  3494. #
  3495. # DIRECTORY: panda/src/dxml/
  3496. #
  3497. DefSymbol("TINYXML", "TIXML_USE_STL", "")
  3498. OPTS=['DIR:panda/src/dxml', 'TINYXML']
  3499. TargetAdd('tinyxml_composite1.obj', opts=OPTS, input='tinyxml_composite1.cxx')
  3500. TargetAdd('libp3tinyxml.ilb', input='tinyxml_composite1.obj')
  3501. OPTS=['DIR:panda/src/dxml', 'BUILDING:PANDA', 'TINYXML']
  3502. TargetAdd('p3dxml_composite1.obj', opts=OPTS, input='p3dxml_composite1.cxx')
  3503. OPTS=['DIR:panda/src/dxml', 'TINYXML']
  3504. IGATEFILES=GetDirectoryContents('panda/src/dxml', ["*.h", "p3dxml_composite1.cxx"])
  3505. TargetAdd('libp3dxml.in', opts=OPTS, input=IGATEFILES)
  3506. TargetAdd('libp3dxml.in', opts=['IMOD:panda3d.core', 'ILIB:libp3dxml', 'SRCDIR:panda/src/dxml'])
  3507. #
  3508. # DIRECTORY: panda/metalibs/panda/
  3509. #
  3510. OPTS=['DIR:panda/metalibs/panda', 'BUILDING:PANDA', 'JPEG', 'PNG', 'HARFBUZZ',
  3511. 'TIFF', 'OPENEXR', 'ZLIB', 'FREETYPE', 'FFTW', 'ADVAPI', 'WINSOCK2',
  3512. 'SQUISH', 'NVIDIACG', 'VORBIS', 'OPUS', 'WINUSER', 'WINMM', 'WINGDI', 'IPHLPAPI',
  3513. 'SETUPAPI', 'INOTIFY', 'IOKIT']
  3514. TargetAdd('panda_panda.obj', opts=OPTS, input='panda.cxx')
  3515. TargetAdd('libpanda.dll', input='panda_panda.obj')
  3516. TargetAdd('libpanda.dll', input='p3recorder_composite1.obj')
  3517. TargetAdd('libpanda.dll', input='p3recorder_composite2.obj')
  3518. TargetAdd('libpanda.dll', input='p3pgraphnodes_composite1.obj')
  3519. TargetAdd('libpanda.dll', input='p3pgraphnodes_composite2.obj')
  3520. TargetAdd('libpanda.dll', input='p3pgraph_nodePath.obj')
  3521. TargetAdd('libpanda.dll', input='p3pgraph_composite1.obj')
  3522. TargetAdd('libpanda.dll', input='p3pgraph_composite2.obj')
  3523. TargetAdd('libpanda.dll', input='p3pgraph_composite3.obj')
  3524. TargetAdd('libpanda.dll', input='p3pgraph_composite4.obj')
  3525. TargetAdd('libpanda.dll', input='p3cull_composite1.obj')
  3526. TargetAdd('libpanda.dll', input='p3cull_composite2.obj')
  3527. TargetAdd('libpanda.dll', input='p3movies_composite1.obj')
  3528. TargetAdd('libpanda.dll', input='p3grutil_multitexReducer.obj')
  3529. TargetAdd('libpanda.dll', input='p3grutil_composite1.obj')
  3530. TargetAdd('libpanda.dll', input='p3grutil_composite2.obj')
  3531. TargetAdd('libpanda.dll', input='p3chan_composite1.obj')
  3532. TargetAdd('libpanda.dll', input='p3chan_composite2.obj')
  3533. TargetAdd('libpanda.dll', input='p3pstatclient_composite1.obj')
  3534. TargetAdd('libpanda.dll', input='p3pstatclient_composite2.obj')
  3535. TargetAdd('libpanda.dll', input='p3char_composite1.obj')
  3536. TargetAdd('libpanda.dll', input='p3char_composite2.obj')
  3537. TargetAdd('libpanda.dll', input='p3collide_composite1.obj')
  3538. TargetAdd('libpanda.dll', input='p3collide_composite2.obj')
  3539. TargetAdd('libpanda.dll', input='p3device_composite1.obj')
  3540. TargetAdd('libpanda.dll', input='p3device_composite2.obj')
  3541. TargetAdd('libpanda.dll', input='p3dgraph_composite1.obj')
  3542. TargetAdd('libpanda.dll', input='p3dgraph_composite2.obj')
  3543. TargetAdd('libpanda.dll', input='p3display_graphicsStateGuardian.obj')
  3544. TargetAdd('libpanda.dll', input='p3display_composite1.obj')
  3545. TargetAdd('libpanda.dll', input='p3display_composite2.obj')
  3546. TargetAdd('libpanda.dll', input='p3pipeline_composite1.obj')
  3547. TargetAdd('libpanda.dll', input='p3pipeline_composite2.obj')
  3548. TargetAdd('libpanda.dll', input='p3pipeline_contextSwitch.obj')
  3549. TargetAdd('libpanda.dll', input='p3event_composite1.obj')
  3550. TargetAdd('libpanda.dll', input='p3event_composite2.obj')
  3551. TargetAdd('libpanda.dll', input='p3gobj_composite1.obj')
  3552. TargetAdd('libpanda.dll', input='p3gobj_composite2.obj')
  3553. TargetAdd('libpanda.dll', input='p3gsgbase_composite1.obj')
  3554. TargetAdd('libpanda.dll', input='p3linmath_composite1.obj')
  3555. TargetAdd('libpanda.dll', input='p3linmath_composite2.obj')
  3556. TargetAdd('libpanda.dll', input='p3mathutil_composite1.obj')
  3557. TargetAdd('libpanda.dll', input='p3mathutil_composite2.obj')
  3558. TargetAdd('libpanda.dll', input='p3parametrics_composite1.obj')
  3559. TargetAdd('libpanda.dll', input='p3parametrics_composite2.obj')
  3560. TargetAdd('libpanda.dll', input='p3pnmimagetypes_composite1.obj')
  3561. TargetAdd('libpanda.dll', input='p3pnmimagetypes_composite2.obj')
  3562. TargetAdd('libpanda.dll', input='p3pnmimage_composite1.obj')
  3563. TargetAdd('libpanda.dll', input='p3pnmimage_composite2.obj')
  3564. TargetAdd('libpanda.dll', input='p3pnmimage_convert_srgb_sse2.obj')
  3565. TargetAdd('libpanda.dll', input='p3text_composite1.obj')
  3566. TargetAdd('libpanda.dll', input='p3text_composite2.obj')
  3567. TargetAdd('libpanda.dll', input='p3tform_composite1.obj')
  3568. TargetAdd('libpanda.dll', input='p3tform_composite2.obj')
  3569. TargetAdd('libpanda.dll', input='p3putil_composite1.obj')
  3570. TargetAdd('libpanda.dll', input='p3putil_composite2.obj')
  3571. TargetAdd('libpanda.dll', input='p3audio_composite1.obj')
  3572. TargetAdd('libpanda.dll', input='p3pgui_composite1.obj')
  3573. TargetAdd('libpanda.dll', input='p3pgui_composite2.obj')
  3574. TargetAdd('libpanda.dll', input='p3net_composite1.obj')
  3575. TargetAdd('libpanda.dll', input='p3net_composite2.obj')
  3576. TargetAdd('libpanda.dll', input='p3nativenet_composite1.obj')
  3577. TargetAdd('libpanda.dll', input='p3pandabase_pandabase.obj')
  3578. TargetAdd('libpanda.dll', input='libpandaexpress.dll')
  3579. TargetAdd('libpanda.dll', input='p3dxml_composite1.obj')
  3580. TargetAdd('libpanda.dll', input='libp3dtoolconfig.dll')
  3581. TargetAdd('libpanda.dll', input='libp3dtool.dll')
  3582. if PkgSkip("FREETYPE")==0:
  3583. TargetAdd('libpanda.dll', input="p3pnmtext_composite1.obj")
  3584. TargetAdd('libpanda.dll', dep='dtool_have_freetype.dat')
  3585. TargetAdd('libpanda.dll', opts=OPTS)
  3586. PyTargetAdd('core_module.obj', input='libp3dtoolbase.in')
  3587. PyTargetAdd('core_module.obj', input='libp3dtoolutil.in')
  3588. PyTargetAdd('core_module.obj', input='libp3prc.in')
  3589. PyTargetAdd('core_module.obj', input='libp3downloader.in')
  3590. PyTargetAdd('core_module.obj', input='libp3express.in')
  3591. PyTargetAdd('core_module.obj', input='libp3recorder.in')
  3592. PyTargetAdd('core_module.obj', input='libp3pgraphnodes.in')
  3593. PyTargetAdd('core_module.obj', input='libp3pgraph.in')
  3594. PyTargetAdd('core_module.obj', input='libp3cull.in')
  3595. PyTargetAdd('core_module.obj', input='libp3grutil.in')
  3596. PyTargetAdd('core_module.obj', input='libp3chan.in')
  3597. PyTargetAdd('core_module.obj', input='libp3pstatclient.in')
  3598. PyTargetAdd('core_module.obj', input='libp3char.in')
  3599. PyTargetAdd('core_module.obj', input='libp3collide.in')
  3600. PyTargetAdd('core_module.obj', input='libp3device.in')
  3601. PyTargetAdd('core_module.obj', input='libp3dgraph.in')
  3602. PyTargetAdd('core_module.obj', input='libp3display.in')
  3603. PyTargetAdd('core_module.obj', input='libp3pipeline.in')
  3604. PyTargetAdd('core_module.obj', input='libp3event.in')
  3605. PyTargetAdd('core_module.obj', input='libp3gobj.in')
  3606. PyTargetAdd('core_module.obj', input='libp3gsgbase.in')
  3607. PyTargetAdd('core_module.obj', input='libp3linmath.in')
  3608. PyTargetAdd('core_module.obj', input='libp3mathutil.in')
  3609. PyTargetAdd('core_module.obj', input='libp3parametrics.in')
  3610. PyTargetAdd('core_module.obj', input='libp3pnmimage.in')
  3611. PyTargetAdd('core_module.obj', input='libp3text.in')
  3612. PyTargetAdd('core_module.obj', input='libp3tform.in')
  3613. PyTargetAdd('core_module.obj', input='libp3putil.in')
  3614. PyTargetAdd('core_module.obj', input='libp3audio.in')
  3615. PyTargetAdd('core_module.obj', input='libp3nativenet.in')
  3616. PyTargetAdd('core_module.obj', input='libp3net.in')
  3617. PyTargetAdd('core_module.obj', input='libp3pgui.in')
  3618. PyTargetAdd('core_module.obj', input='libp3movies.in')
  3619. PyTargetAdd('core_module.obj', input='libp3dxml.in')
  3620. if PkgSkip("FREETYPE")==0:
  3621. PyTargetAdd('core_module.obj', input='libp3pnmtext.in')
  3622. PyTargetAdd('core_module.obj', opts=['IMOD:panda3d.core', 'ILIB:core'])
  3623. PyTargetAdd('core.pyd', input='libp3dtoolbase_igate.obj')
  3624. PyTargetAdd('core.pyd', input='p3dtoolbase_typeHandle_ext.obj')
  3625. PyTargetAdd('core.pyd', input='libp3dtoolutil_igate.obj')
  3626. PyTargetAdd('core.pyd', input='p3dtoolutil_ext_composite.obj')
  3627. PyTargetAdd('core.pyd', input='libp3prc_igate.obj')
  3628. PyTargetAdd('core.pyd', input='p3prc_ext_composite.obj')
  3629. PyTargetAdd('core.pyd', input='libp3downloader_igate.obj')
  3630. PyTargetAdd('core.pyd', input='p3express_ext_composite.obj')
  3631. PyTargetAdd('core.pyd', input='libp3express_igate.obj')
  3632. PyTargetAdd('core.pyd', input='libp3recorder_igate.obj')
  3633. PyTargetAdd('core.pyd', input='libp3pgraphnodes_igate.obj')
  3634. PyTargetAdd('core.pyd', input='libp3pgraph_igate.obj')
  3635. PyTargetAdd('core.pyd', input='libp3movies_igate.obj')
  3636. PyTargetAdd('core.pyd', input='libp3grutil_igate.obj')
  3637. PyTargetAdd('core.pyd', input='libp3chan_igate.obj')
  3638. PyTargetAdd('core.pyd', input='libp3pstatclient_igate.obj')
  3639. PyTargetAdd('core.pyd', input='libp3char_igate.obj')
  3640. PyTargetAdd('core.pyd', input='libp3collide_igate.obj')
  3641. PyTargetAdd('core.pyd', input='libp3device_igate.obj')
  3642. PyTargetAdd('core.pyd', input='libp3dgraph_igate.obj')
  3643. PyTargetAdd('core.pyd', input='libp3display_igate.obj')
  3644. PyTargetAdd('core.pyd', input='libp3pipeline_igate.obj')
  3645. PyTargetAdd('core.pyd', input='libp3event_igate.obj')
  3646. PyTargetAdd('core.pyd', input='libp3gobj_igate.obj')
  3647. PyTargetAdd('core.pyd', input='libp3gsgbase_igate.obj')
  3648. PyTargetAdd('core.pyd', input='libp3linmath_igate.obj')
  3649. PyTargetAdd('core.pyd', input='libp3mathutil_igate.obj')
  3650. PyTargetAdd('core.pyd', input='libp3parametrics_igate.obj')
  3651. PyTargetAdd('core.pyd', input='libp3pnmimage_igate.obj')
  3652. PyTargetAdd('core.pyd', input='libp3text_igate.obj')
  3653. PyTargetAdd('core.pyd', input='libp3tform_igate.obj')
  3654. PyTargetAdd('core.pyd', input='libp3putil_igate.obj')
  3655. PyTargetAdd('core.pyd', input='libp3audio_igate.obj')
  3656. PyTargetAdd('core.pyd', input='libp3pgui_igate.obj')
  3657. PyTargetAdd('core.pyd', input='libp3net_igate.obj')
  3658. PyTargetAdd('core.pyd', input='libp3nativenet_igate.obj')
  3659. PyTargetAdd('core.pyd', input='libp3dxml_igate.obj')
  3660. if PkgSkip("FREETYPE")==0:
  3661. PyTargetAdd('core.pyd', input="libp3pnmtext_igate.obj")
  3662. PyTargetAdd('core.pyd', input='p3pipeline_pythonThread.obj')
  3663. PyTargetAdd('core.pyd', input='p3putil_ext_composite.obj')
  3664. PyTargetAdd('core.pyd', input='p3pnmimage_pfmFile_ext.obj')
  3665. PyTargetAdd('core.pyd', input='p3event_asyncFuture_ext.obj')
  3666. PyTargetAdd('core.pyd', input='p3event_pythonTask.obj')
  3667. PyTargetAdd('core.pyd', input='p3gobj_ext_composite.obj')
  3668. PyTargetAdd('core.pyd', input='p3pgraph_ext_composite.obj')
  3669. PyTargetAdd('core.pyd', input='p3display_ext_composite.obj')
  3670. PyTargetAdd('core.pyd', input='p3collide_ext_composite.obj')
  3671. PyTargetAdd('core.pyd', input='core_module.obj')
  3672. if not GetLinkAllStatic() and GetTarget() != 'emscripten':
  3673. PyTargetAdd('core.pyd', input='libp3tinyxml.ilb')
  3674. PyTargetAdd('core.pyd', input='libp3interrogatedb.dll')
  3675. PyTargetAdd('core.pyd', input=COMMON_PANDA_LIBS)
  3676. PyTargetAdd('core.pyd', opts=['WINSOCK2'])
  3677. #
  3678. # DIRECTORY: panda/src/vision/
  3679. #
  3680. if not PkgSkip("VISION"):
  3681. # We want to know whether we have ffmpeg so that we can override the .avi association.
  3682. if not PkgSkip("FFMPEG"):
  3683. DefSymbol("OPENCV", "HAVE_FFMPEG")
  3684. if not PkgSkip("OPENCV"):
  3685. DefSymbol("OPENCV", "HAVE_OPENCV")
  3686. if OPENCV_VER_23:
  3687. DefSymbol("OPENCV", "OPENCV_VER_23")
  3688. OPTS=['DIR:panda/src/vision', 'BUILDING:VISION', 'ARTOOLKIT', 'OPENCV', 'DX9', 'DIRECTCAM', 'JPEG', 'EXCEPTIONS']
  3689. TargetAdd('p3vision_composite1.obj', opts=OPTS, input='p3vision_composite1.cxx', dep=[
  3690. 'dtool_have_ffmpeg.dat',
  3691. 'dtool_have_opencv.dat',
  3692. 'dtool_have_directcam.dat',
  3693. ])
  3694. TargetAdd('libp3vision.dll', input='p3vision_composite1.obj')
  3695. TargetAdd('libp3vision.dll', input=COMMON_PANDA_LIBS)
  3696. TargetAdd('libp3vision.dll', opts=OPTS)
  3697. OPTS=['DIR:panda/src/vision', 'ARTOOLKIT', 'OPENCV', 'DX9', 'DIRECTCAM', 'JPEG', 'EXCEPTIONS']
  3698. IGATEFILES=GetDirectoryContents('panda/src/vision', ["*.h", "*_composite*.cxx"])
  3699. TargetAdd('libp3vision.in', opts=OPTS, input=IGATEFILES)
  3700. TargetAdd('libp3vision.in', opts=['IMOD:panda3d.vision', 'ILIB:libp3vision', 'SRCDIR:panda/src/vision'])
  3701. PyTargetAdd('vision_module.obj', input='libp3vision.in')
  3702. PyTargetAdd('vision_module.obj', opts=OPTS)
  3703. PyTargetAdd('vision_module.obj', opts=['IMOD:panda3d.vision', 'ILIB:vision', 'IMPORT:panda3d.core'])
  3704. PyTargetAdd('vision.pyd', input='vision_module.obj')
  3705. PyTargetAdd('vision.pyd', input='libp3vision_igate.obj')
  3706. PyTargetAdd('vision.pyd', input='libp3vision.dll')
  3707. PyTargetAdd('vision.pyd', input='libp3interrogatedb.dll')
  3708. PyTargetAdd('vision.pyd', input=COMMON_PANDA_LIBS)
  3709. #
  3710. # DIRECTORY: panda/src/navigation/
  3711. #
  3712. if not PkgSkip("NAVIGATION"):
  3713. OPTS=['DIR:panda/src/navigation', 'BUILDING:NAVIGATION']
  3714. TargetAdd('p3navigation_composite1.obj', opts=OPTS, input='p3navigation_composite1.cxx')
  3715. OPTS=['DIR:panda/src/navigation/Detour/Source', 'BUILDING:NAVIGATION']
  3716. TargetAdd('p3navigation_DetourAlloc.obj', opts=OPTS, input='DetourAlloc.cpp')
  3717. TargetAdd('p3navigation_DetourAssert.obj', opts=OPTS, input='DetourAssert.cpp')
  3718. TargetAdd('p3navigation_DetourCommon.obj', opts=OPTS, input='DetourCommon.cpp')
  3719. TargetAdd('p3navigation_DetourNavMesh.obj', opts=OPTS, input='DetourNavMesh.cpp')
  3720. TargetAdd('p3navigation_DetourNavMeshBuilder.obj', opts=OPTS, input='DetourNavMeshBuilder.cpp')
  3721. TargetAdd('p3navigation_DetourNavMeshQuery.obj', opts=OPTS, input='DetourNavMeshQuery.cpp')
  3722. TargetAdd('p3navigation_DetourNode.obj', opts=OPTS, input='DetourNode.cpp')
  3723. TargetAdd('libp3navigation.dll', input='p3navigation_composite1.obj')
  3724. TargetAdd('libp3navigation.dll', input='p3navigation_DetourAlloc.obj')
  3725. TargetAdd('libp3navigation.dll', input='p3navigation_DetourAssert.obj')
  3726. TargetAdd('libp3navigation.dll', input='p3navigation_DetourCommon.obj')
  3727. TargetAdd('libp3navigation.dll', input='p3navigation_DetourNavMesh.obj')
  3728. TargetAdd('libp3navigation.dll', input='p3navigation_DetourNavMeshBuilder.obj')
  3729. TargetAdd('libp3navigation.dll', input='p3navigation_DetourNavMeshQuery.obj')
  3730. TargetAdd('libp3navigation.dll', input='p3navigation_DetourNode.obj')
  3731. TargetAdd('libp3navigation.dll', input=COMMON_PANDA_LIBS)
  3732. OPTS=['DIR:panda/src/navigation', 'BUILDING:NAVIGATION']
  3733. TargetAdd('libp3navigation.dll', opts=OPTS)
  3734. OPTS=['DIR:panda/src/navigation']
  3735. IGATEFILES=GetDirectoryContents('panda/src/navigation', ["*.h", "*_composite*.cxx"])
  3736. TargetAdd('libp3navigation.in', opts=OPTS, input=IGATEFILES)
  3737. TargetAdd('libp3navigation.in', opts=['IMOD:panda3d.navigation', 'ILIB:libp3navigation', 'SRCDIR:panda/src/navigation'])
  3738. PyTargetAdd('navigation_module.obj', input='libp3navigation.in')
  3739. PyTargetAdd('navigation_module.obj', opts=OPTS)
  3740. PyTargetAdd('navigation_module.obj', opts=['IMOD:panda3d.navigation', 'ILIB:navigation', 'IMPORT:panda3d.core'])
  3741. PyTargetAdd('navigation.pyd', input='navigation_module.obj')
  3742. PyTargetAdd('navigation.pyd', input='libp3navigation_igate.obj')
  3743. PyTargetAdd('navigation.pyd', input='libp3navigation.dll')
  3744. PyTargetAdd('navigation.pyd', input='libp3interrogatedb.dll')
  3745. PyTargetAdd('navigation.pyd', input=COMMON_PANDA_LIBS)
  3746. #
  3747. # DIRECTORY: panda/src/navmeshgen/
  3748. #
  3749. if not PkgSkip("NAVMESHGEN"):
  3750. OPTS=['DIR:panda/src/navmeshgen', 'BUILDING:NAVMESHGEN']
  3751. TargetAdd('p3navmeshgen_composite1.obj', opts=OPTS, input='p3navmeshgen_composite1.cxx')
  3752. OPTS=['DIR:panda/src/navmeshgen/Recast/Source', 'BUILDING:NAVMESHGEN']
  3753. TargetAdd('p3navmeshgen_Recast.obj', opts=OPTS, input='Recast.cpp')
  3754. TargetAdd('p3navmeshgen_RecastAlloc.obj', opts=OPTS, input='RecastAlloc.cpp')
  3755. TargetAdd('p3navmeshgen_RecastArea.obj', opts=OPTS, input='RecastArea.cpp')
  3756. TargetAdd('p3navmeshgen_RecastAssert.obj', opts=OPTS, input='RecastAssert.cpp')
  3757. TargetAdd('p3navmeshgen_RecastContour.obj', opts=OPTS, input='RecastContour.cpp')
  3758. TargetAdd('p3navmeshgen_RecastFilter.obj', opts=OPTS, input='RecastFilter.cpp')
  3759. TargetAdd('p3navmeshgen_RecastLayers.obj', opts=OPTS, input='RecastLayers.cpp')
  3760. TargetAdd('p3navmeshgen_RecastMesh.obj', opts=OPTS, input='RecastMesh.cpp')
  3761. TargetAdd('p3navmeshgen_RecastMeshDetail.obj', opts=OPTS, input='RecastMeshDetail.cpp')
  3762. TargetAdd('p3navmeshgen_RecastRasterization.obj', opts=OPTS, input='RecastRasterization.cpp')
  3763. TargetAdd('p3navmeshgen_RecastRegion.obj', opts=OPTS, input='RecastRegion.cpp')
  3764. TargetAdd('libp3navmeshgen.dll', input='p3navmeshgen_composite1.obj')
  3765. TargetAdd('libp3navmeshgen.dll', input='p3navmeshgen_Recast.obj')
  3766. TargetAdd('libp3navmeshgen.dll', input='p3navmeshgen_RecastAlloc.obj')
  3767. TargetAdd('libp3navmeshgen.dll', input='p3navmeshgen_RecastArea.obj')
  3768. TargetAdd('libp3navmeshgen.dll', input='p3navmeshgen_RecastAssert.obj')
  3769. TargetAdd('libp3navmeshgen.dll', input='p3navmeshgen_RecastContour.obj')
  3770. TargetAdd('libp3navmeshgen.dll', input='p3navmeshgen_RecastFilter.obj')
  3771. TargetAdd('libp3navmeshgen.dll', input='p3navmeshgen_RecastLayers.obj')
  3772. TargetAdd('libp3navmeshgen.dll', input='p3navmeshgen_RecastMesh.obj')
  3773. TargetAdd('libp3navmeshgen.dll', input='p3navmeshgen_RecastMeshDetail.obj')
  3774. TargetAdd('libp3navmeshgen.dll', input='p3navmeshgen_RecastRasterization.obj')
  3775. TargetAdd('libp3navmeshgen.dll', input='p3navmeshgen_RecastRegion.obj')
  3776. TargetAdd('libp3navmeshgen.dll', input='libp3navigation.dll')
  3777. TargetAdd('libp3navmeshgen.dll', input=COMMON_PANDA_LIBS)
  3778. OPTS=['DIR:panda/src/navmeshgen', 'BUILDING:NAVMESHGEN']
  3779. TargetAdd('libp3navmeshgen.dll', opts=OPTS)
  3780. OPTS=['DIR:panda/src/navmeshgen']
  3781. IGATEFILES=GetDirectoryContents('panda/src/navmeshgen', ["*.h", "*_composite*.cxx"])
  3782. TargetAdd('libp3navmeshgen.in', opts=OPTS, input=IGATEFILES)
  3783. TargetAdd('libp3navmeshgen.in', opts=['IMOD:panda3d.navmeshgen', 'ILIB:libp3navmeshgen', 'SRCDIR:panda/src/navmeshgen'])
  3784. PyTargetAdd('navmeshgen_module.obj', input='libp3navmeshgen.in')
  3785. PyTargetAdd('navmeshgen_module.obj', opts=OPTS)
  3786. PyTargetAdd('navmeshgen_module.obj', opts=['IMOD:panda3d.navmeshgen', 'ILIB:navmeshgen', 'IMPORT:panda3d.core'])
  3787. PyTargetAdd('navmeshgen.pyd', input='navmeshgen_module.obj')
  3788. PyTargetAdd('navmeshgen.pyd', input='libp3navmeshgen_igate.obj')
  3789. PyTargetAdd('navmeshgen.pyd', input='libp3navmeshgen.dll')
  3790. PyTargetAdd('navmeshgen.pyd', input='libp3interrogatedb.dll')
  3791. PyTargetAdd('navmeshgen.pyd', input=COMMON_PANDA_LIBS)
  3792. #
  3793. # DIRECTORY: panda/src/p3skel
  3794. #
  3795. if not PkgSkip('SKEL'):
  3796. OPTS=['DIR:panda/src/skel', 'BUILDING:PANDASKEL', 'ADVAPI']
  3797. TargetAdd('p3skel_composite1.obj', opts=OPTS, input='p3skel_composite1.cxx')
  3798. OPTS=['DIR:panda/src/skel', 'ADVAPI']
  3799. IGATEFILES=GetDirectoryContents("panda/src/skel", ["*.h", "*_composite*.cxx"])
  3800. TargetAdd('libp3skel.in', opts=OPTS, input=IGATEFILES)
  3801. TargetAdd('libp3skel.in', opts=['IMOD:panda3d.skel', 'ILIB:libp3skel', 'SRCDIR:panda/src/skel'])
  3802. #
  3803. # DIRECTORY: panda/src/p3skel
  3804. #
  3805. if not PkgSkip('SKEL'):
  3806. OPTS=['BUILDING:PANDASKEL', 'ADVAPI']
  3807. TargetAdd('libpandaskel.dll', input='p3skel_composite1.obj')
  3808. TargetAdd('libpandaskel.dll', input=COMMON_PANDA_LIBS)
  3809. TargetAdd('libpandaskel.dll', opts=OPTS)
  3810. PyTargetAdd('skel_module.obj', input='libp3skel.in')
  3811. PyTargetAdd('skel_module.obj', opts=['IMOD:panda3d.skel', 'ILIB:skel', 'IMPORT:panda3d.core'])
  3812. PyTargetAdd('skel.pyd', input='skel_module.obj')
  3813. PyTargetAdd('skel.pyd', input='libp3skel_igate.obj')
  3814. PyTargetAdd('skel.pyd', input='libpandaskel.dll')
  3815. PyTargetAdd('skel.pyd', input='libp3interrogatedb.dll')
  3816. PyTargetAdd('skel.pyd', input=COMMON_PANDA_LIBS)
  3817. #
  3818. # DIRECTORY: panda/src/distort/
  3819. #
  3820. if not PkgSkip('PANDAFX'):
  3821. OPTS=['DIR:panda/src/distort', 'BUILDING:PANDAFX']
  3822. TargetAdd('p3distort_composite1.obj', opts=OPTS, input='p3distort_composite1.cxx')
  3823. OPTS=['DIR:panda/metalibs/pandafx', 'DIR:panda/src/distort', 'NVIDIACG']
  3824. IGATEFILES=GetDirectoryContents('panda/src/distort', ["*.h", "*_composite*.cxx"])
  3825. TargetAdd('libp3distort.in', opts=OPTS, input=IGATEFILES)
  3826. TargetAdd('libp3distort.in', opts=['IMOD:panda3d.fx', 'ILIB:libp3distort', 'SRCDIR:panda/src/distort'])
  3827. #
  3828. # DIRECTORY: panda/metalibs/pandafx/
  3829. #
  3830. if not PkgSkip('PANDAFX'):
  3831. OPTS=['DIR:panda/metalibs/pandafx', 'DIR:panda/src/distort', 'BUILDING:PANDAFX', 'NVIDIACG']
  3832. TargetAdd('pandafx_pandafx.obj', opts=OPTS, input='pandafx.cxx')
  3833. TargetAdd('libpandafx.dll', input='pandafx_pandafx.obj')
  3834. TargetAdd('libpandafx.dll', input='p3distort_composite1.obj')
  3835. TargetAdd('libpandafx.dll', input=COMMON_PANDA_LIBS)
  3836. TargetAdd('libpandafx.dll', opts=['ADVAPI', 'NVIDIACG'])
  3837. OPTS=['DIR:panda/metalibs/pandafx', 'DIR:panda/src/distort', 'NVIDIACG']
  3838. PyTargetAdd('fx_module.obj', input='libp3distort.in')
  3839. PyTargetAdd('fx_module.obj', opts=OPTS)
  3840. PyTargetAdd('fx_module.obj', opts=['IMOD:panda3d.fx', 'ILIB:fx', 'IMPORT:panda3d.core'])
  3841. PyTargetAdd('fx.pyd', input='fx_module.obj')
  3842. PyTargetAdd('fx.pyd', input='libp3distort_igate.obj')
  3843. PyTargetAdd('fx.pyd', input='libpandafx.dll')
  3844. PyTargetAdd('fx.pyd', input='libp3interrogatedb.dll')
  3845. PyTargetAdd('fx.pyd', input=COMMON_PANDA_LIBS)
  3846. #
  3847. # DIRECTORY: panda/src/vrpn/
  3848. #
  3849. if not PkgSkip("VRPN"):
  3850. OPTS=['DIR:panda/src/vrpn', 'BUILDING:VRPN', 'VRPN']
  3851. TargetAdd('p3vrpn_composite1.obj', opts=OPTS, input='p3vrpn_composite1.cxx')
  3852. TargetAdd('libp3vrpn.dll', input='p3vrpn_composite1.obj')
  3853. TargetAdd('libp3vrpn.dll', input=COMMON_PANDA_LIBS)
  3854. TargetAdd('libp3vrpn.dll', opts=['VRPN'])
  3855. OPTS=['DIR:panda/src/vrpn', 'VRPN']
  3856. IGATEFILES=GetDirectoryContents('panda/src/vrpn', ["*.h", "*_composite*.cxx"])
  3857. TargetAdd('libp3vrpn.in', opts=OPTS, input=IGATEFILES)
  3858. TargetAdd('libp3vrpn.in', opts=['IMOD:panda3d.vrpn', 'ILIB:libp3vrpn', 'SRCDIR:panda/src/vrpn'])
  3859. PyTargetAdd('vrpn_module.obj', input='libp3vrpn.in')
  3860. PyTargetAdd('vrpn_module.obj', opts=OPTS)
  3861. PyTargetAdd('vrpn_module.obj', opts=['IMOD:panda3d.vrpn', 'ILIB:vrpn', 'IMPORT:panda3d.core'])
  3862. PyTargetAdd('vrpn.pyd', input='vrpn_module.obj')
  3863. PyTargetAdd('vrpn.pyd', input='libp3vrpn_igate.obj')
  3864. PyTargetAdd('vrpn.pyd', input='libp3vrpn.dll')
  3865. PyTargetAdd('vrpn.pyd', input='libp3interrogatedb.dll')
  3866. PyTargetAdd('vrpn.pyd', input=COMMON_PANDA_LIBS)
  3867. #
  3868. # DIRECTORY: panda/src/ffmpeg
  3869. #
  3870. if PkgSkip("FFMPEG") == 0:
  3871. if not PkgSkip("SWSCALE"):
  3872. DefSymbol("FFMPEG", "HAVE_SWSCALE")
  3873. if not PkgSkip("SWRESAMPLE"):
  3874. DefSymbol("FFMPEG", "HAVE_SWRESAMPLE")
  3875. OPTS=['DIR:panda/src/ffmpeg', 'BUILDING:FFMPEG', 'FFMPEG', 'SWSCALE', 'SWRESAMPLE']
  3876. TargetAdd('p3ffmpeg_composite1.obj', opts=OPTS, input='p3ffmpeg_composite1.cxx', dep=[
  3877. 'dtool_have_swscale.dat', 'dtool_have_swresample.dat'])
  3878. TargetAdd('libp3ffmpeg.dll', input='p3ffmpeg_composite1.obj')
  3879. TargetAdd('libp3ffmpeg.dll', input=COMMON_PANDA_LIBS)
  3880. TargetAdd('libp3ffmpeg.dll', opts=OPTS)
  3881. #
  3882. # DIRECTORY: panda/src/audiotraits/
  3883. #
  3884. if PkgSkip("FMODEX") == 0:
  3885. OPTS=['DIR:panda/src/audiotraits', 'BUILDING:FMOD_AUDIO', 'FMODEX']
  3886. TargetAdd('fmod_audio_fmod_audio_composite1.obj', opts=OPTS, input='fmod_audio_composite1.cxx')
  3887. TargetAdd('libp3fmod_audio.dll', input='fmod_audio_fmod_audio_composite1.obj')
  3888. TargetAdd('libp3fmod_audio.dll', input=COMMON_PANDA_LIBS)
  3889. TargetAdd('libp3fmod_audio.dll', opts=['MODULE', 'ADVAPI', 'WINUSER', 'WINMM', 'FMODEX'])
  3890. if PkgSkip("OPENAL") == 0:
  3891. OPTS=['DIR:panda/src/audiotraits', 'BUILDING:OPENAL_AUDIO', 'OPENAL']
  3892. TargetAdd('openal_audio_openal_audio_composite1.obj', opts=OPTS, input='openal_audio_composite1.cxx')
  3893. TargetAdd('libp3openal_audio.dll', input='openal_audio_openal_audio_composite1.obj')
  3894. TargetAdd('libp3openal_audio.dll', input=COMMON_PANDA_LIBS)
  3895. TargetAdd('libp3openal_audio.dll', opts=['MODULE', 'ADVAPI', 'WINUSER', 'WINMM', 'WINSHELL', 'WINOLE', 'OPENAL', 'OPENSLES'])
  3896. #
  3897. # DIRECTORY: panda/src/downloadertools/
  3898. #
  3899. if not PkgSkip("OPENSSL") and not PkgSkip("DEPLOYTOOLS"):
  3900. OPTS=['DIR:panda/src/downloadertools', 'ADVAPI', 'WINSOCK2', 'WINSHELL', 'WINGDI', 'WINUSER']
  3901. TargetAdd('pdecrypt_pdecrypt.obj', opts=OPTS, input='pdecrypt.cxx')
  3902. TargetAdd('pdecrypt.exe', input=['pdecrypt_pdecrypt.obj'])
  3903. TargetAdd('pdecrypt.exe', input=COMMON_PANDA_LIBS)
  3904. TargetAdd('pdecrypt.exe', opts=OPTS)
  3905. TargetAdd('pencrypt_pencrypt.obj', opts=OPTS, input='pencrypt.cxx')
  3906. TargetAdd('pencrypt.exe', input=['pencrypt_pencrypt.obj'])
  3907. TargetAdd('pencrypt.exe', input=COMMON_PANDA_LIBS)
  3908. TargetAdd('pencrypt.exe', opts=OPTS)
  3909. #
  3910. # DIRECTORY: panda/src/downloadertools/
  3911. #
  3912. if not PkgSkip("ZLIB") and not PkgSkip("DEPLOYTOOLS"):
  3913. OPTS=['DIR:panda/src/downloadertools', 'ZLIB', 'ADVAPI', 'WINSOCK2', 'WINSHELL', 'WINGDI', 'WINUSER']
  3914. TargetAdd('multify_multify.obj', opts=OPTS, input='multify.cxx')
  3915. TargetAdd('multify.exe', input=['multify_multify.obj'])
  3916. TargetAdd('multify.exe', input=COMMON_PANDA_LIBS)
  3917. TargetAdd('multify.exe', opts=OPTS)
  3918. TargetAdd('pzip_pzip.obj', opts=OPTS, input='pzip.cxx')
  3919. TargetAdd('pzip.exe', input=['pzip_pzip.obj'])
  3920. TargetAdd('pzip.exe', input=COMMON_PANDA_LIBS)
  3921. TargetAdd('pzip.exe', opts=OPTS)
  3922. TargetAdd('punzip_punzip.obj', opts=OPTS, input='punzip.cxx')
  3923. TargetAdd('punzip.exe', input=['punzip_punzip.obj'])
  3924. TargetAdd('punzip.exe', input=COMMON_PANDA_LIBS)
  3925. TargetAdd('punzip.exe', opts=OPTS)
  3926. #
  3927. # DIRECTORY: panda/src/windisplay/
  3928. #
  3929. if GetTarget() == 'windows':
  3930. OPTS=['DIR:panda/src/windisplay', 'BUILDING:PANDAWIN']
  3931. TargetAdd('p3windisplay_composite1.obj', opts=OPTS+["BIGOBJ"], input='p3windisplay_composite1.cxx')
  3932. TargetAdd('p3windisplay_windetectdx9.obj', opts=OPTS + ["DX9"], input='winDetectDx9.cxx')
  3933. TargetAdd('libp3windisplay.dll', input='p3windisplay_composite1.obj')
  3934. TargetAdd('libp3windisplay.dll', input='p3windisplay_windetectdx9.obj')
  3935. TargetAdd('libp3windisplay.dll', input=COMMON_PANDA_LIBS)
  3936. TargetAdd('libp3windisplay.dll', opts=['WINIMM', 'WINGDI', 'WINKERNEL', 'WINOLDNAMES', 'WINUSER', 'WINMM',"BIGOBJ"])
  3937. #
  3938. # DIRECTORY: panda/metalibs/pandadx9/
  3939. #
  3940. if GetTarget() == 'windows' and not PkgSkip("DX9"):
  3941. OPTS=['DIR:panda/src/dxgsg9', 'BUILDING:PANDADX', 'DX9', 'NVIDIACG', 'CGDX9']
  3942. TargetAdd('p3dxgsg9_dxGraphicsStateGuardian9.obj', opts=OPTS, input='dxGraphicsStateGuardian9.cxx')
  3943. TargetAdd('p3dxgsg9_composite1.obj', opts=OPTS, input='p3dxgsg9_composite1.cxx')
  3944. OPTS=['DIR:panda/metalibs/pandadx9', 'BUILDING:PANDADX', 'DX9', 'NVIDIACG', 'CGDX9']
  3945. TargetAdd('pandadx9_pandadx9.obj', opts=OPTS, input='pandadx9.cxx')
  3946. TargetAdd('libpandadx9.dll', input='pandadx9_pandadx9.obj')
  3947. TargetAdd('libpandadx9.dll', input='p3dxgsg9_dxGraphicsStateGuardian9.obj')
  3948. TargetAdd('libpandadx9.dll', input='p3dxgsg9_composite1.obj')
  3949. TargetAdd('libpandadx9.dll', input='libp3windisplay.dll')
  3950. TargetAdd('libpandadx9.dll', input=COMMON_PANDA_LIBS)
  3951. TargetAdd('libpandadx9.dll', opts=['MODULE', 'ADVAPI', 'WINGDI', 'WINKERNEL', 'WINUSER', 'WINMM', 'DX9', 'NVIDIACG', 'CGDX9'])
  3952. #
  3953. # DIRECTORY: panda/src/egg/
  3954. #
  3955. if not PkgSkip("EGG"):
  3956. OPTS=['DIR:panda/src/egg', 'BUILDING:PANDAEGG', 'ZLIB', 'BISONPREFIX_eggyy', 'FLEXDASHI', 'FLEXVERSION:2.5.6']
  3957. CreateFile(GetOutputDir()+"/include/parser.h")
  3958. TargetAdd('p3egg_parser.obj', opts=OPTS, input='parser.yxx')
  3959. TargetAdd('parser.h', input='p3egg_parser.obj', opts=['DEPENDENCYONLY'])
  3960. TargetAdd('p3egg_lexer.obj', opts=OPTS, input='lexer.lxx')
  3961. TargetAdd('p3egg_composite1.obj', opts=OPTS, input='p3egg_composite1.cxx')
  3962. TargetAdd('p3egg_composite2.obj', opts=OPTS, input='p3egg_composite2.cxx')
  3963. OPTS=['DIR:panda/src/egg', 'ZLIB']
  3964. IGATEFILES=GetDirectoryContents('panda/src/egg', ["*.h", "*_composite*.cxx"])
  3965. if "parser.h" in IGATEFILES:
  3966. IGATEFILES.remove("parser.h")
  3967. TargetAdd('libp3egg.in', opts=OPTS, input=IGATEFILES)
  3968. TargetAdd('libp3egg.in', opts=['IMOD:panda3d.egg', 'ILIB:libp3egg', 'SRCDIR:panda/src/egg'])
  3969. PyTargetAdd('p3egg_ext_composite.obj', opts=OPTS, input='p3egg_ext_composite.cxx')
  3970. #
  3971. # DIRECTORY: panda/src/egg2pg/
  3972. #
  3973. if not PkgSkip("EGG"):
  3974. OPTS=['DIR:panda/src/egg2pg', 'BUILDING:PANDAEGG']
  3975. TargetAdd('p3egg2pg_composite1.obj', opts=OPTS, input='p3egg2pg_composite1.cxx')
  3976. TargetAdd('p3egg2pg_composite2.obj', opts=OPTS, input='p3egg2pg_composite2.cxx')
  3977. OPTS=['DIR:panda/src/egg2pg']
  3978. IGATEFILES=['load_egg_file.h', 'save_egg_file.h']
  3979. TargetAdd('libp3egg2pg.in', opts=OPTS, input=IGATEFILES)
  3980. TargetAdd('libp3egg2pg.in', opts=['IMOD:panda3d.egg', 'ILIB:libp3egg2pg', 'SRCDIR:panda/src/egg2pg'])
  3981. #
  3982. # DIRECTORY: panda/src/framework/
  3983. #
  3984. deps = []
  3985. # Framework wants to link in a renderer when building statically, so tell it what is available.
  3986. if GetLinkAllStatic():
  3987. deps = ['dtool_have_gl.dat', 'dtool_have_tinydisplay.dat', 'dtool_have_egg.dat']
  3988. if not PkgSkip("GL"):
  3989. DefSymbol("FRAMEWORK", "HAVE_GL")
  3990. if not PkgSkip("TINYDISPLAY"):
  3991. DefSymbol("FRAMEWORK", "HAVE_TINYDISPLAY")
  3992. if not PkgSkip("EGG"):
  3993. DefSymbol("FRAMEWORK", "HAVE_EGG")
  3994. OPTS=['DIR:panda/src/framework', 'BUILDING:FRAMEWORK', 'FRAMEWORK']
  3995. TargetAdd('p3framework_composite1.obj', opts=OPTS, input='p3framework_composite1.cxx', dep=deps)
  3996. TargetAdd('libp3framework.dll', input='p3framework_composite1.obj')
  3997. TargetAdd('libp3framework.dll', input=COMMON_PANDA_LIBS)
  3998. TargetAdd('libp3framework.dll', opts=['ADVAPI'])
  3999. #
  4000. # DIRECTORY: panda/src/glgsg/
  4001. #
  4002. if not PkgSkip("GL"):
  4003. OPTS=['DIR:panda/src/glgsg', 'DIR:panda/src/glstuff', 'BUILDING:PANDAGL', 'GL', 'NVIDIACG']
  4004. TargetAdd('p3glgsg_config_glgsg.obj', opts=OPTS, input='config_glgsg.cxx')
  4005. TargetAdd('p3glgsg_glgsg.obj', opts=OPTS, input='glgsg.cxx')
  4006. #
  4007. # DIRECTORY: panda/src/glesgsg/
  4008. #
  4009. if not PkgSkip("GLES"):
  4010. OPTS=['DIR:panda/src/glesgsg', 'DIR:panda/src/glstuff', 'BUILDING:PANDAGLES', 'GLES']
  4011. TargetAdd('p3glesgsg_config_glesgsg.obj', opts=OPTS, input='config_glesgsg.cxx')
  4012. TargetAdd('p3glesgsg_glesgsg.obj', opts=OPTS, input='glesgsg.cxx')
  4013. #
  4014. # DIRECTORY: panda/src/gles2gsg/
  4015. #
  4016. if not PkgSkip("GLES2"):
  4017. OPTS=['DIR:panda/src/gles2gsg', 'DIR:panda/src/glstuff', 'BUILDING:PANDAGLES2', 'GLES2']
  4018. TargetAdd('p3gles2gsg_config_gles2gsg.obj', opts=OPTS, input='config_gles2gsg.cxx')
  4019. TargetAdd('p3gles2gsg_gles2gsg.obj', opts=OPTS, input='gles2gsg.cxx')
  4020. #
  4021. # DIRECTORY: panda/metalibs/pandaegg/
  4022. #
  4023. if not PkgSkip("EGG"):
  4024. OPTS=['DIR:panda/metalibs/pandaegg', 'DIR:panda/src/egg', 'BUILDING:PANDAEGG']
  4025. TargetAdd('pandaegg_pandaegg.obj', opts=OPTS, input='pandaegg.cxx')
  4026. TargetAdd('libpandaegg.dll', input='pandaegg_pandaegg.obj')
  4027. TargetAdd('libpandaegg.dll', input='p3egg2pg_composite1.obj')
  4028. TargetAdd('libpandaegg.dll', input='p3egg2pg_composite2.obj')
  4029. TargetAdd('libpandaegg.dll', input='p3egg_composite1.obj')
  4030. TargetAdd('libpandaegg.dll', input='p3egg_composite2.obj')
  4031. TargetAdd('libpandaegg.dll', input='p3egg_parser.obj')
  4032. TargetAdd('libpandaegg.dll', input='p3egg_lexer.obj')
  4033. TargetAdd('libpandaegg.dll', input=COMMON_PANDA_LIBS)
  4034. TargetAdd('libpandaegg.dll', opts=['ADVAPI'])
  4035. OPTS=['DIR:panda/metalibs/pandaegg', 'DIR:panda/src/egg']
  4036. PyTargetAdd('egg_module.obj', input='libp3egg2pg.in')
  4037. PyTargetAdd('egg_module.obj', input='libp3egg.in')
  4038. PyTargetAdd('egg_module.obj', opts=OPTS)
  4039. PyTargetAdd('egg_module.obj', opts=['IMOD:panda3d.egg', 'ILIB:egg', 'IMPORT:panda3d.core'])
  4040. PyTargetAdd('egg.pyd', input='egg_module.obj')
  4041. PyTargetAdd('egg.pyd', input='p3egg_ext_composite.obj')
  4042. PyTargetAdd('egg.pyd', input='libp3egg_igate.obj')
  4043. PyTargetAdd('egg.pyd', input='libp3egg2pg_igate.obj')
  4044. PyTargetAdd('egg.pyd', input='libpandaegg.dll')
  4045. PyTargetAdd('egg.pyd', input='libp3interrogatedb.dll')
  4046. PyTargetAdd('egg.pyd', input=COMMON_PANDA_LIBS)
  4047. #
  4048. # DIRECTORY: panda/src/x11display/
  4049. #
  4050. if GetTarget() not in ['windows', 'darwin'] and not PkgSkip("X11"):
  4051. OPTS=['DIR:panda/src/x11display', 'BUILDING:PANDAX11', 'X11']
  4052. TargetAdd('p3x11display_composite1.obj', opts=OPTS, input='p3x11display_composite1.cxx')
  4053. #
  4054. # DIRECTORY: panda/src/glxdisplay/
  4055. #
  4056. if GetTarget() not in ['windows', 'darwin'] and not PkgSkip("GL") and not PkgSkip("X11"):
  4057. DefSymbol('GLX', 'HAVE_GLX', '')
  4058. OPTS=['DIR:panda/src/glxdisplay', 'BUILDING:PANDAGL', 'GL', 'NVIDIACG', 'CGGL', 'GLX']
  4059. TargetAdd('p3glxdisplay_composite1.obj', opts=OPTS, input='p3glxdisplay_composite1.cxx')
  4060. OPTS=['DIR:panda/metalibs/pandagl', 'BUILDING:PANDAGL', 'GL', 'NVIDIACG', 'CGGL', 'GLX']
  4061. TargetAdd('pandagl_pandagl.obj', opts=OPTS, input='pandagl.cxx')
  4062. TargetAdd('libpandagl.dll', input='p3x11display_composite1.obj')
  4063. TargetAdd('libpandagl.dll', input='pandagl_pandagl.obj')
  4064. TargetAdd('libpandagl.dll', input='p3glgsg_config_glgsg.obj')
  4065. TargetAdd('libpandagl.dll', input='p3glgsg_glgsg.obj')
  4066. TargetAdd('libpandagl.dll', input='p3glxdisplay_composite1.obj')
  4067. TargetAdd('libpandagl.dll', input=COMMON_PANDA_LIBS)
  4068. TargetAdd('libpandagl.dll', opts=['MODULE', 'GL', 'NVIDIACG', 'CGGL', 'X11'])
  4069. #
  4070. # DIRECTORY: panda/src/cocoadisplay/
  4071. #
  4072. if GetTarget() == 'darwin' and PkgSkip("COCOA")==0 and not PkgSkip("GL"):
  4073. OPTS=['DIR:panda/src/cocoadisplay', 'BUILDING:PANDAGL', 'GL', 'NVIDIACG', 'CGGL']
  4074. TargetAdd('p3cocoadisplay_composite1.obj', opts=OPTS, input='p3cocoadisplay_composite1.mm')
  4075. OPTS=['DIR:panda/metalibs/pandagl', 'BUILDING:PANDAGL', 'GL', 'NVIDIACG', 'CGGL']
  4076. TargetAdd('pandagl_pandagl.obj', opts=OPTS, input='pandagl.cxx')
  4077. TargetAdd('libpandagl.dll', input='pandagl_pandagl.obj')
  4078. TargetAdd('libpandagl.dll', input='p3glgsg_config_glgsg.obj')
  4079. TargetAdd('libpandagl.dll', input='p3glgsg_glgsg.obj')
  4080. TargetAdd('libpandagl.dll', input='p3cocoadisplay_composite1.obj')
  4081. if not PkgSkip('PANDAFX'):
  4082. TargetAdd('libpandagl.dll', input='libpandafx.dll')
  4083. TargetAdd('libpandagl.dll', input=COMMON_PANDA_LIBS)
  4084. TargetAdd('libpandagl.dll', opts=['MODULE', 'GL', 'NVIDIACG', 'CGGL', 'COCOA', 'CARBON', 'QUARTZ'])
  4085. #
  4086. # DIRECTORY: panda/src/wgldisplay/
  4087. #
  4088. if GetTarget() == 'windows' and not PkgSkip("GL"):
  4089. OPTS=['DIR:panda/src/wgldisplay', 'DIR:panda/src/glstuff', 'BUILDING:PANDAGL', 'NVIDIACG', 'CGGL']
  4090. TargetAdd('p3wgldisplay_composite1.obj', opts=OPTS, input='p3wgldisplay_composite1.cxx')
  4091. OPTS=['DIR:panda/metalibs/pandagl', 'BUILDING:PANDAGL', 'NVIDIACG', 'CGGL']
  4092. TargetAdd('pandagl_pandagl.obj', opts=OPTS, input='pandagl.cxx')
  4093. TargetAdd('libpandagl.dll', input='pandagl_pandagl.obj')
  4094. TargetAdd('libpandagl.dll', input='p3glgsg_config_glgsg.obj')
  4095. TargetAdd('libpandagl.dll', input='p3glgsg_glgsg.obj')
  4096. TargetAdd('libpandagl.dll', input='p3wgldisplay_composite1.obj')
  4097. TargetAdd('libpandagl.dll', input='libp3windisplay.dll')
  4098. if not PkgSkip('PANDAFX'):
  4099. TargetAdd('libpandagl.dll', input='libpandafx.dll')
  4100. TargetAdd('libpandagl.dll', input=COMMON_PANDA_LIBS)
  4101. TargetAdd('libpandagl.dll', opts=['MODULE', 'WINGDI', 'GL', 'WINKERNEL', 'WINOLDNAMES', 'WINUSER', 'WINMM', 'NVIDIACG', 'CGGL'])
  4102. #
  4103. # DIRECTORY: panda/src/egldisplay/
  4104. #
  4105. # If we're not compiling with any windowing system at all, but we do have EGL,
  4106. # we can use that to create a headless libpandagl instead.
  4107. if not PkgSkip("EGL") and not PkgSkip("GL") and PkgSkip("X11") and GetTarget() not in ('windows', 'darwin'):
  4108. OPTS=['DIR:panda/src/egldisplay', 'DIR:panda/src/glstuff', 'BUILDING:PANDAGL', 'GL', 'EGL']
  4109. TargetAdd('pandagl_egldisplay_composite1.obj', opts=OPTS, input='p3egldisplay_composite1.cxx')
  4110. OPTS=['DIR:panda/metalibs/pandagl', 'BUILDING:PANDAGL', 'GL', 'EGL']
  4111. TargetAdd('pandagl_pandagl.obj', opts=OPTS, input='pandagl.cxx')
  4112. TargetAdd('libpandagl.dll', input='pandagl_pandagl.obj')
  4113. TargetAdd('libpandagl.dll', input='p3glgsg_config_glgsg.obj')
  4114. TargetAdd('libpandagl.dll', input='p3glgsg_glgsg.obj')
  4115. TargetAdd('libpandagl.dll', input='pandagl_egldisplay_composite1.obj')
  4116. TargetAdd('libpandagl.dll', input=COMMON_PANDA_LIBS)
  4117. TargetAdd('libpandagl.dll', opts=['MODULE', 'GL', 'EGL', 'CGGL'])
  4118. elif not PkgSkip("EGL") and not PkgSkip("GL") and GetTarget() not in ('windows', 'darwin'):
  4119. # As a temporary solution for #1086, build this module, which we can use as a
  4120. # fallback to OpenGL for headless systems.
  4121. OPTS=['DIR:panda/src/egldisplay', 'DIR:panda/src/glstuff', 'BUILDING:PANDAGL', 'GL', 'EGL']
  4122. TargetAdd('p3headlessgl_egldisplay_composite1.obj', opts=OPTS, input='p3egldisplay_composite1.cxx')
  4123. OPTS=['DIR:panda/metalibs/pandagl', 'BUILDING:PANDAGL', 'GL', 'EGL']
  4124. TargetAdd('p3headlessgl_pandagl.obj', opts=OPTS, input='pandagl.cxx')
  4125. TargetAdd('libp3headlessgl.dll', input='p3headlessgl_pandagl.obj')
  4126. TargetAdd('libp3headlessgl.dll', input='p3glgsg_config_glgsg.obj')
  4127. TargetAdd('libp3headlessgl.dll', input='p3glgsg_glgsg.obj')
  4128. TargetAdd('libp3headlessgl.dll', input='p3headlessgl_egldisplay_composite1.obj')
  4129. TargetAdd('libp3headlessgl.dll', input=COMMON_PANDA_LIBS)
  4130. TargetAdd('libp3headlessgl.dll', opts=['MODULE', 'GL', 'EGL', 'CGGL'])
  4131. #
  4132. # DIRECTORY: panda/src/egldisplay/
  4133. #
  4134. if GetTarget() != 'android' and not PkgSkip("EGL") and not PkgSkip("GLES"):
  4135. DefSymbol('GLES', 'OPENGLES_1', '')
  4136. OPTS=['DIR:panda/src/egldisplay', 'DIR:panda/src/glstuff', 'BUILDING:PANDAGLES', 'GLES', 'EGL', 'X11']
  4137. TargetAdd('pandagles_egldisplay_composite1.obj', opts=OPTS, input='p3egldisplay_composite1.cxx')
  4138. OPTS=['DIR:panda/metalibs/pandagles', 'BUILDING:PANDAGLES', 'GLES', 'EGL']
  4139. TargetAdd('pandagles_pandagles.obj', opts=OPTS, input='pandagles.cxx')
  4140. if not PkgSkip("X11"):
  4141. TargetAdd('libpandagles.dll', input='p3x11display_composite1.obj')
  4142. TargetAdd('libpandagles.dll', input='pandagles_pandagles.obj')
  4143. TargetAdd('libpandagles.dll', input='p3glesgsg_config_glesgsg.obj')
  4144. TargetAdd('libpandagles.dll', input='p3glesgsg_glesgsg.obj')
  4145. TargetAdd('libpandagles.dll', input='pandagles_egldisplay_composite1.obj')
  4146. TargetAdd('libpandagles.dll', input=COMMON_PANDA_LIBS)
  4147. TargetAdd('libpandagles.dll', opts=['MODULE', 'GLES', 'EGL', 'X11'])
  4148. #
  4149. # DIRECTORY: panda/src/egldisplay/
  4150. #
  4151. if GetTarget() != 'android' and not PkgSkip("EGL") and not PkgSkip("GLES2"):
  4152. DefSymbol('GLES2', 'OPENGLES_2', '')
  4153. OPTS=['DIR:panda/src/egldisplay', 'DIR:panda/src/glstuff', 'BUILDING:PANDAGLES2', 'GLES2', 'EGL', 'X11']
  4154. TargetAdd('pandagles2_egldisplay_composite1.obj', opts=OPTS, input='p3egldisplay_composite1.cxx')
  4155. OPTS=['DIR:panda/metalibs/pandagles2', 'BUILDING:PANDAGLES2', 'GLES2', 'EGL']
  4156. TargetAdd('pandagles2_pandagles2.obj', opts=OPTS, input='pandagles2.cxx')
  4157. if not PkgSkip("X11"):
  4158. TargetAdd('libpandagles2.dll', input='p3x11display_composite1.obj')
  4159. TargetAdd('libpandagles2.dll', input='pandagles2_pandagles2.obj')
  4160. TargetAdd('libpandagles2.dll', input='p3gles2gsg_config_gles2gsg.obj')
  4161. TargetAdd('libpandagles2.dll', input='p3gles2gsg_gles2gsg.obj')
  4162. TargetAdd('libpandagles2.dll', input='pandagles2_egldisplay_composite1.obj')
  4163. TargetAdd('libpandagles2.dll', input=COMMON_PANDA_LIBS)
  4164. TargetAdd('libpandagles2.dll', opts=['MODULE', 'GLES2', 'EGL', 'X11'])
  4165. #
  4166. # DIRECTORY: panda/src/ode/
  4167. #
  4168. if not PkgSkip("ODE"):
  4169. OPTS=['DIR:panda/src/ode', 'BUILDING:PANDAODE', 'ODE']
  4170. TargetAdd('p3ode_composite1.obj', opts=OPTS, input='p3ode_composite1.cxx')
  4171. TargetAdd('p3ode_composite2.obj', opts=OPTS, input='p3ode_composite2.cxx')
  4172. TargetAdd('p3ode_composite3.obj', opts=OPTS, input='p3ode_composite3.cxx')
  4173. OPTS=['DIR:panda/src/ode', 'ODE']
  4174. IGATEFILES=GetDirectoryContents('panda/src/ode', ["*.h", "*_composite*.cxx"])
  4175. IGATEFILES.remove("odeConvexGeom.h")
  4176. IGATEFILES.remove("odeHelperStructs.h")
  4177. TargetAdd('libpandaode.in', opts=OPTS, input=IGATEFILES)
  4178. TargetAdd('libpandaode.in', opts=['IMOD:panda3d.ode', 'ILIB:libpandaode', 'SRCDIR:panda/src/ode'])
  4179. PyTargetAdd('p3ode_ext_composite.obj', opts=OPTS, input='p3ode_ext_composite.cxx')
  4180. #
  4181. # DIRECTORY: panda/metalibs/pandaode/
  4182. #
  4183. if not PkgSkip("ODE"):
  4184. OPTS=['DIR:panda/metalibs/pandaode', 'BUILDING:PANDAODE', 'ODE']
  4185. TargetAdd('pandaode_pandaode.obj', opts=OPTS, input='pandaode.cxx')
  4186. TargetAdd('libpandaode.dll', input='pandaode_pandaode.obj')
  4187. TargetAdd('libpandaode.dll', input='p3ode_composite1.obj')
  4188. TargetAdd('libpandaode.dll', input='p3ode_composite2.obj')
  4189. TargetAdd('libpandaode.dll', input='p3ode_composite3.obj')
  4190. TargetAdd('libpandaode.dll', input=COMMON_PANDA_LIBS)
  4191. TargetAdd('libpandaode.dll', opts=['WINUSER', 'ODE'])
  4192. OPTS=['DIR:panda/metalibs/pandaode', 'ODE']
  4193. PyTargetAdd('ode_module.obj', input='libpandaode.in')
  4194. PyTargetAdd('ode_module.obj', opts=OPTS)
  4195. PyTargetAdd('ode_module.obj', opts=['IMOD:panda3d.ode', 'ILIB:ode', 'IMPORT:panda3d.core'])
  4196. PyTargetAdd('ode.pyd', input='ode_module.obj')
  4197. PyTargetAdd('ode.pyd', input='libpandaode_igate.obj')
  4198. PyTargetAdd('ode.pyd', input='p3ode_ext_composite.obj')
  4199. PyTargetAdd('ode.pyd', input='libpandaode.dll')
  4200. PyTargetAdd('ode.pyd', input='libp3interrogatedb.dll')
  4201. PyTargetAdd('ode.pyd', input=COMMON_PANDA_LIBS)
  4202. PyTargetAdd('ode.pyd', opts=['WINUSER', 'ODE'])
  4203. #
  4204. # DIRECTORY: panda/src/bullet/
  4205. #
  4206. if not PkgSkip("BULLET"):
  4207. OPTS=['DIR:panda/src/bullet', 'BUILDING:PANDABULLET', 'BULLET']
  4208. TargetAdd('p3bullet_composite.obj', opts=OPTS, input='p3bullet_composite.cxx')
  4209. OPTS=['DIR:panda/src/bullet', 'BULLET']
  4210. IGATEFILES=GetDirectoryContents('panda/src/bullet', ["*.h", "*_composite*.cxx"])
  4211. TargetAdd('libpandabullet.in', opts=OPTS, input=IGATEFILES)
  4212. TargetAdd('libpandabullet.in', opts=['IMOD:panda3d.bullet', 'ILIB:libpandabullet', 'SRCDIR:panda/src/bullet'])
  4213. #
  4214. # DIRECTORY: panda/metalibs/pandabullet/
  4215. #
  4216. if not PkgSkip("BULLET"):
  4217. OPTS=['DIR:panda/metalibs/pandabullet', 'BUILDING:PANDABULLET', 'BULLET']
  4218. TargetAdd('pandabullet_pandabullet.obj', opts=OPTS, input='pandabullet.cxx')
  4219. TargetAdd('libpandabullet.dll', input='pandabullet_pandabullet.obj')
  4220. TargetAdd('libpandabullet.dll', input='p3bullet_composite.obj')
  4221. TargetAdd('libpandabullet.dll', input=COMMON_PANDA_LIBS)
  4222. TargetAdd('libpandabullet.dll', opts=['WINUSER', 'BULLET'])
  4223. OPTS=['DIR:panda/metalibs/pandabullet', 'BULLET']
  4224. PyTargetAdd('bullet_module.obj', input='libpandabullet.in')
  4225. PyTargetAdd('bullet_module.obj', opts=OPTS)
  4226. PyTargetAdd('bullet_module.obj', opts=['IMOD:panda3d.bullet', 'ILIB:bullet', 'IMPORT:panda3d.core'])
  4227. PyTargetAdd('bullet.pyd', input='bullet_module.obj')
  4228. PyTargetAdd('bullet.pyd', input='libpandabullet_igate.obj')
  4229. PyTargetAdd('bullet.pyd', input='libpandabullet.dll')
  4230. PyTargetAdd('bullet.pyd', input='libp3interrogatedb.dll')
  4231. PyTargetAdd('bullet.pyd', input=COMMON_PANDA_LIBS)
  4232. PyTargetAdd('bullet.pyd', opts=['WINUSER', 'BULLET'])
  4233. #
  4234. # DIRECTORY: panda/src/physics/
  4235. #
  4236. if not PkgSkip("PANDAPHYSICS"):
  4237. OPTS=['DIR:panda/src/physics', 'BUILDING:PANDAPHYSICS']
  4238. TargetAdd('p3physics_composite1.obj', opts=OPTS, input='p3physics_composite1.cxx')
  4239. TargetAdd('p3physics_composite2.obj', opts=OPTS, input='p3physics_composite2.cxx')
  4240. OPTS=['DIR:panda/src/physics']
  4241. IGATEFILES=GetDirectoryContents('panda/src/physics', ["*.h", "*_composite*.cxx"])
  4242. IGATEFILES.remove("forces.h")
  4243. TargetAdd('libp3physics.in', opts=OPTS, input=IGATEFILES)
  4244. TargetAdd('libp3physics.in', opts=['IMOD:panda3d.physics', 'ILIB:libp3physics', 'SRCDIR:panda/src/physics'])
  4245. #
  4246. # DIRECTORY: panda/src/particlesystem/
  4247. #
  4248. if not PkgSkip("PANDAPHYSICS") and not PkgSkip("PANDAPARTICLESYSTEM"):
  4249. OPTS=['DIR:panda/src/particlesystem', 'BUILDING:PANDAPHYSICS']
  4250. TargetAdd('p3particlesystem_composite1.obj', opts=OPTS, input='p3particlesystem_composite1.cxx')
  4251. TargetAdd('p3particlesystem_composite2.obj', opts=OPTS, input='p3particlesystem_composite2.cxx')
  4252. OPTS=['DIR:panda/src/particlesystem']
  4253. IGATEFILES=GetDirectoryContents('panda/src/particlesystem', ["*.h", "*_composite*.cxx"])
  4254. IGATEFILES.remove('orientedParticle.h')
  4255. IGATEFILES.remove('orientedParticleFactory.h')
  4256. IGATEFILES.remove('particlefactories.h')
  4257. IGATEFILES.remove('emitters.h')
  4258. IGATEFILES.remove('particles.h')
  4259. TargetAdd('libp3particlesystem.in', opts=OPTS, input=IGATEFILES)
  4260. TargetAdd('libp3particlesystem.in', opts=['IMOD:panda3d.physics', 'ILIB:libp3particlesystem', 'SRCDIR:panda/src/particlesystem'])
  4261. #
  4262. # DIRECTORY: panda/metalibs/pandaphysics/
  4263. #
  4264. if not PkgSkip("PANDAPHYSICS"):
  4265. OPTS=['DIR:panda/metalibs/pandaphysics', 'BUILDING:PANDAPHYSICS']
  4266. TargetAdd('pandaphysics_pandaphysics.obj', opts=OPTS, input='pandaphysics.cxx')
  4267. TargetAdd('libpandaphysics.dll', input='pandaphysics_pandaphysics.obj')
  4268. TargetAdd('libpandaphysics.dll', input='p3physics_composite1.obj')
  4269. TargetAdd('libpandaphysics.dll', input='p3physics_composite2.obj')
  4270. TargetAdd('libpandaphysics.dll', input='p3particlesystem_composite1.obj')
  4271. TargetAdd('libpandaphysics.dll', input='p3particlesystem_composite2.obj')
  4272. TargetAdd('libpandaphysics.dll', input=COMMON_PANDA_LIBS)
  4273. TargetAdd('libpandaphysics.dll', opts=['ADVAPI'])
  4274. OPTS=['DIR:panda/metalibs/pandaphysics']
  4275. PyTargetAdd('physics_module.obj', input='libp3physics.in')
  4276. if not PkgSkip("PANDAPARTICLESYSTEM"):
  4277. PyTargetAdd('physics_module.obj', input='libp3particlesystem.in')
  4278. PyTargetAdd('physics_module.obj', opts=OPTS)
  4279. PyTargetAdd('physics_module.obj', opts=['IMOD:panda3d.physics', 'ILIB:physics', 'IMPORT:panda3d.core'])
  4280. PyTargetAdd('physics.pyd', input='physics_module.obj')
  4281. PyTargetAdd('physics.pyd', input='libp3physics_igate.obj')
  4282. if not PkgSkip("PANDAPARTICLESYSTEM"):
  4283. PyTargetAdd('physics.pyd', input='libp3particlesystem_igate.obj')
  4284. PyTargetAdd('physics.pyd', input='libpandaphysics.dll')
  4285. PyTargetAdd('physics.pyd', input='libp3interrogatedb.dll')
  4286. PyTargetAdd('physics.pyd', input=COMMON_PANDA_LIBS)
  4287. #
  4288. # DIRECTORY: contrib/src/speedtree/
  4289. #
  4290. if not PkgSkip("SPEEDTREE"):
  4291. OPTS=['DIR:contrib/src/speedtree', 'BUILDING:PANDASPEEDTREE', 'SPEEDTREE']
  4292. TargetAdd('pandaspeedtree_composite1.obj', opts=OPTS, input='pandaspeedtree_composite1.cxx')
  4293. IGATEFILES=GetDirectoryContents('contrib/src/speedtree', ["*.h", "*_composite*.cxx"])
  4294. TargetAdd('libpandaspeedtree.in', opts=OPTS, input=IGATEFILES)
  4295. TargetAdd('libpandaspeedtree.in', opts=['IMOD:libpandaspeedtree', 'ILIB:libpandaspeedtree', 'SRCDIR:contrib/src/speedtree'])
  4296. PyTargetAdd('libpandaspeedtree_module.obj', input='libpandaspeedtree.in')
  4297. PyTargetAdd('libpandaspeedtree_module.obj', opts=OPTS)
  4298. PyTargetAdd('libpandaspeedtree_module.obj', opts=['IMOD:libpandaspeedtree', 'ILIB:libpandaspeedtree'])
  4299. TargetAdd('libpandaspeedtree.dll', input='pandaspeedtree_composite1.obj')
  4300. PyTargetAdd('libpandaspeedtree.dll', input='libpandaspeedtree_igate.obj')
  4301. TargetAdd('libpandaspeedtree.dll', input='libpandaspeedtree_module.obj')
  4302. TargetAdd('libpandaspeedtree.dll', input=COMMON_PANDA_LIBS)
  4303. TargetAdd('libpandaspeedtree.dll', opts=['SPEEDTREE'])
  4304. if SDK["SPEEDTREEAPI"] == 'OpenGL':
  4305. TargetAdd('libpandaspeedtree.dll', opts=['GL', 'NVIDIACG', 'CGGL'])
  4306. elif SDK["SPEEDTREEAPI"] == 'DirectX9':
  4307. TargetAdd('libpandaspeedtree.dll', opts=['DX9', 'NVIDIACG', 'CGDX9'])
  4308. #
  4309. # DIRECTORY: panda/src/testbed/
  4310. #
  4311. if not PkgSkip("PVIEW"):
  4312. OPTS=['DIR:panda/src/testbed']
  4313. TargetAdd('pview_pview.obj', opts=OPTS, input='pview.cxx')
  4314. TargetAdd('pview.exe', input='pview_pview.obj')
  4315. TargetAdd('pview.exe', input='libp3framework.dll')
  4316. if not PkgSkip("EGG"):
  4317. TargetAdd('pview.exe', input='libpandaegg.dll')
  4318. TargetAdd('pview.exe', input=COMMON_PANDA_LIBS)
  4319. TargetAdd('pview.exe', opts=['ADVAPI', 'WINSOCK2', 'WINSHELL'])
  4320. if GetLinkAllStatic() and not PkgSkip("GL"):
  4321. TargetAdd('pview.exe', input='libpandagl.dll')
  4322. #
  4323. # DIRECTORY: panda/src/android/
  4324. #
  4325. if GetTarget() == 'android':
  4326. OPTS=['DIR:panda/src/android', 'PNG']
  4327. TargetAdd('org/panda3d/android/NativeIStream.class', opts=OPTS, input='NativeIStream.java')
  4328. TargetAdd('org/panda3d/android/NativeOStream.class', opts=OPTS, input='NativeOStream.java')
  4329. TargetAdd('org/panda3d/android/PandaActivity.class', opts=OPTS, input='PandaActivity.java')
  4330. TargetAdd('org/panda3d/android/PythonActivity.class', opts=OPTS, input='PythonActivity.java')
  4331. TargetAdd('classes.dex', input='org/panda3d/android/NativeIStream.class')
  4332. TargetAdd('classes.dex', input='org/panda3d/android/NativeOStream.class')
  4333. TargetAdd('classes.dex', input='org/panda3d/android/PandaActivity.class')
  4334. TargetAdd('classes.dex', input='org/panda3d/android/PythonActivity.class')
  4335. TargetAdd('p3android_composite1.obj', opts=OPTS, input='p3android_composite1.cxx')
  4336. TargetAdd('libp3android.dll', input='p3android_composite1.obj')
  4337. TargetAdd('libp3android.dll', input=COMMON_PANDA_LIBS)
  4338. TargetAdd('libp3android.dll', opts=['JNIGRAPHICS'])
  4339. TargetAdd('android_native_app_glue.obj', opts=OPTS + ['NOHIDDEN'], input='android_native_app_glue.c')
  4340. TargetAdd('android_main.obj', opts=OPTS, input='android_main.cxx')
  4341. if not PkgSkip("PVIEW"):
  4342. TargetAdd('libpview_pview.obj', opts=OPTS, input='pview.cxx')
  4343. TargetAdd('libpview.dll', input='android_native_app_glue.obj')
  4344. TargetAdd('libpview.dll', input='android_main.obj')
  4345. TargetAdd('libpview.dll', input='libpview_pview.obj')
  4346. TargetAdd('libpview.dll', input='libp3framework.dll')
  4347. if not PkgSkip("EGG"):
  4348. TargetAdd('libpview.dll', input='libpandaegg.dll')
  4349. TargetAdd('libpview.dll', input='libp3android.dll')
  4350. TargetAdd('libpview.dll', input=COMMON_PANDA_LIBS)
  4351. TargetAdd('libpview.dll', opts=['MODULE', 'ANDROID'])
  4352. if not PkgSkip("PYTHON"):
  4353. OPTS += ['PYTHON']
  4354. TargetAdd('ppython_ppython.obj', opts=OPTS, input='python_main.cxx')
  4355. TargetAdd('libppython.dll', input='android_native_app_glue.obj')
  4356. TargetAdd('libppython.dll', input='android_main.obj')
  4357. TargetAdd('libppython.dll', input='ppython_ppython.obj')
  4358. TargetAdd('libppython.dll', input='libp3framework.dll')
  4359. TargetAdd('libppython.dll', input='libp3android.dll')
  4360. TargetAdd('libppython.dll', input=COMMON_PANDA_LIBS)
  4361. TargetAdd('libppython.dll', opts=['MODULE', 'ANDROID', 'PYTHON'])
  4362. #
  4363. # DIRECTORY: panda/src/androiddisplay/
  4364. #
  4365. if GetTarget() == 'android' and not PkgSkip("EGL") and not PkgSkip("GLES"):
  4366. DefSymbol('GLES', 'OPENGLES_1', '')
  4367. OPTS=['DIR:panda/src/androiddisplay', 'DIR:panda/src/glstuff', 'BUILDING:PANDAGLES', 'GLES', 'EGL']
  4368. TargetAdd('pandagles_androiddisplay_composite1.obj', opts=OPTS, input='p3androiddisplay_composite1.cxx')
  4369. OPTS=['DIR:panda/metalibs/pandagles', 'BUILDING:PANDAGLES', 'GLES', 'EGL']
  4370. TargetAdd('pandagles_pandagles.obj', opts=OPTS, input='pandagles.cxx')
  4371. TargetAdd('libpandagles.dll', input='pandagles_pandagles.obj')
  4372. TargetAdd('libpandagles.dll', input='p3glesgsg_config_glesgsg.obj')
  4373. TargetAdd('libpandagles.dll', input='p3glesgsg_glesgsg.obj')
  4374. TargetAdd('libpandagles.dll', input='pandagles_androiddisplay_composite1.obj')
  4375. TargetAdd('libpandagles.dll', input='libp3android.dll')
  4376. TargetAdd('libpandagles.dll', input=COMMON_PANDA_LIBS)
  4377. TargetAdd('libpandagles.dll', opts=['MODULE', 'GLES', 'EGL'])
  4378. if GetTarget() == 'android' and not PkgSkip("EGL") and not PkgSkip("GLES2"):
  4379. DefSymbol('GLES2', 'OPENGLES_2', '')
  4380. OPTS=['DIR:panda/src/androiddisplay', 'DIR:panda/src/glstuff', 'BUILDING:PANDAGLES2', 'GLES2', 'EGL']
  4381. TargetAdd('pandagles2_androiddisplay_composite1.obj', opts=OPTS, input='p3androiddisplay_composite1.cxx')
  4382. OPTS=['DIR:panda/metalibs/pandagles2', 'BUILDING:PANDAGLES2', 'GLES2', 'EGL']
  4383. TargetAdd('pandagles2_pandagles2.obj', opts=OPTS, input='pandagles2.cxx')
  4384. TargetAdd('libpandagles2.dll', input='pandagles2_pandagles2.obj')
  4385. TargetAdd('libpandagles2.dll', input='p3gles2gsg_config_gles2gsg.obj')
  4386. TargetAdd('libpandagles2.dll', input='p3gles2gsg_gles2gsg.obj')
  4387. TargetAdd('libpandagles2.dll', input='pandagles2_androiddisplay_composite1.obj')
  4388. TargetAdd('libpandagles2.dll', input='libp3android.dll')
  4389. TargetAdd('libpandagles2.dll', input=COMMON_PANDA_LIBS)
  4390. TargetAdd('libpandagles2.dll', opts=['MODULE', 'GLES2', 'EGL'])
  4391. #
  4392. # DIRECTORY: panda/src/tinydisplay/
  4393. #
  4394. if (GetTarget() in ('windows', 'darwin') or not PkgSkip("X11")) and not PkgSkip("TINYDISPLAY"):
  4395. OPTS=['DIR:panda/src/tinydisplay', 'BUILDING:TINYDISPLAY', 'X11']
  4396. TargetAdd('p3tinydisplay_composite1.obj', opts=OPTS, input='p3tinydisplay_composite1.cxx')
  4397. TargetAdd('p3tinydisplay_composite2.obj', opts=OPTS, input='p3tinydisplay_composite2.cxx')
  4398. TargetAdd('p3tinydisplay_ztriangle_1.obj', opts=OPTS, input='ztriangle_1.cxx')
  4399. TargetAdd('p3tinydisplay_ztriangle_2.obj', opts=OPTS, input='ztriangle_2.cxx')
  4400. TargetAdd('p3tinydisplay_ztriangle_3.obj', opts=OPTS, input='ztriangle_3.cxx')
  4401. TargetAdd('p3tinydisplay_ztriangle_4.obj', opts=OPTS, input='ztriangle_4.cxx')
  4402. TargetAdd('p3tinydisplay_ztriangle_table.obj', opts=OPTS, input='ztriangle_table.cxx')
  4403. if GetTarget() == 'windows':
  4404. TargetAdd('libp3tinydisplay.dll', input='libp3windisplay.dll')
  4405. TargetAdd('libp3tinydisplay.dll', opts=['WINIMM', 'WINGDI', 'WINKERNEL', 'WINOLDNAMES', 'WINUSER', 'WINMM'])
  4406. elif GetTarget() != 'darwin':
  4407. TargetAdd('libp3tinydisplay.dll', input='p3x11display_composite1.obj')
  4408. TargetAdd('libp3tinydisplay.dll', opts=['X11'])
  4409. TargetAdd('libp3tinydisplay.dll', input='p3tinydisplay_composite1.obj')
  4410. TargetAdd('libp3tinydisplay.dll', input='p3tinydisplay_composite2.obj')
  4411. TargetAdd('libp3tinydisplay.dll', input='p3tinydisplay_ztriangle_1.obj')
  4412. TargetAdd('libp3tinydisplay.dll', input='p3tinydisplay_ztriangle_2.obj')
  4413. TargetAdd('libp3tinydisplay.dll', input='p3tinydisplay_ztriangle_3.obj')
  4414. TargetAdd('libp3tinydisplay.dll', input='p3tinydisplay_ztriangle_4.obj')
  4415. TargetAdd('libp3tinydisplay.dll', input='p3tinydisplay_ztriangle_table.obj')
  4416. TargetAdd('libp3tinydisplay.dll', input=COMMON_PANDA_LIBS)
  4417. #
  4418. # DIRECTORY: direct/src/directbase/
  4419. #
  4420. if not PkgSkip("DIRECT"):
  4421. OPTS=['DIR:direct/src/directbase']
  4422. TargetAdd('p3directbase_directbase.obj', opts=OPTS+['BUILDING:DIRECT'], input='directbase.cxx')
  4423. #
  4424. # DIRECTORY: direct/src/dcparser/
  4425. #
  4426. if not PkgSkip("DIRECT"):
  4427. OPTS=['DIR:direct/src/dcparser', 'BUILDING:DIRECT_DCPARSER', 'WITHINPANDA', 'BISONPREFIX_dcyy']
  4428. CreateFile(GetOutputDir()+"/include/dcParser.h")
  4429. TargetAdd('p3dcparser_dcParser.obj', opts=OPTS, input='dcParser.yxx')
  4430. TargetAdd('dcParser.h', input='p3dcparser_dcParser.obj', opts=['DEPENDENCYONLY'])
  4431. TargetAdd('p3dcparser_dcLexer.obj', opts=OPTS, input='dcLexer.lxx')
  4432. TargetAdd('p3dcparser_composite1.obj', opts=OPTS, input='p3dcparser_composite1.cxx')
  4433. TargetAdd('p3dcparser_composite2.obj', opts=OPTS, input='p3dcparser_composite2.cxx')
  4434. OPTS=['DIR:direct/src/dcparser', 'WITHINPANDA']
  4435. IGATEFILES=GetDirectoryContents('direct/src/dcparser', ["*.h", "*_composite*.cxx"])
  4436. if "dcParser.h" in IGATEFILES:
  4437. IGATEFILES.remove("dcParser.h")
  4438. if "dcmsgtypes.h" in IGATEFILES:
  4439. IGATEFILES.remove('dcmsgtypes.h')
  4440. TargetAdd('libp3dcparser.in', opts=OPTS, input=IGATEFILES)
  4441. TargetAdd('libp3dcparser.in', opts=['IMOD:panda3d.direct', 'ILIB:libp3dcparser', 'SRCDIR:direct/src/dcparser'])
  4442. PyTargetAdd('p3dcparser_ext_composite.obj', opts=OPTS, input='p3dcparser_ext_composite.cxx')
  4443. #
  4444. # DIRECTORY: direct/src/deadrec/
  4445. #
  4446. if not PkgSkip("DIRECT"):
  4447. OPTS=['DIR:direct/src/deadrec', 'BUILDING:DIRECT']
  4448. TargetAdd('p3deadrec_composite1.obj', opts=OPTS, input='p3deadrec_composite1.cxx')
  4449. OPTS=['DIR:direct/src/deadrec']
  4450. IGATEFILES=GetDirectoryContents('direct/src/deadrec', ["*.h", "*_composite*.cxx"])
  4451. TargetAdd('libp3deadrec.in', opts=OPTS, input=IGATEFILES)
  4452. TargetAdd('libp3deadrec.in', opts=['IMOD:panda3d.direct', 'ILIB:libp3deadrec', 'SRCDIR:direct/src/deadrec'])
  4453. #
  4454. # DIRECTORY: direct/src/distributed/
  4455. #
  4456. if not PkgSkip("DIRECT"):
  4457. OPTS=['DIR:direct/src/distributed', 'DIR:direct/src/dcparser', 'WITHINPANDA', 'BUILDING:DIRECT']
  4458. TargetAdd('p3distributed_config_distributed.obj', opts=OPTS, input='config_distributed.cxx')
  4459. OPTS=['DIR:direct/src/distributed', 'WITHINPANDA']
  4460. IGATEFILES=GetDirectoryContents('direct/src/distributed', ["*.h", "*.cxx"])
  4461. TargetAdd('libp3distributed.in', opts=OPTS, input=IGATEFILES)
  4462. TargetAdd('libp3distributed.in', opts=['IMOD:panda3d.direct', 'ILIB:libp3distributed', 'SRCDIR:direct/src/distributed'])
  4463. PyTargetAdd('p3distributed_cConnectionRepository.obj', opts=OPTS, input='cConnectionRepository.cxx')
  4464. PyTargetAdd('p3distributed_cDistributedSmoothNodeBase.obj', opts=OPTS, input='cDistributedSmoothNodeBase.cxx')
  4465. #
  4466. # DIRECTORY: direct/src/interval/
  4467. #
  4468. if not PkgSkip("DIRECT"):
  4469. OPTS=['DIR:direct/src/interval', 'BUILDING:DIRECT']
  4470. TargetAdd('p3interval_composite1.obj', opts=OPTS, input='p3interval_composite1.cxx')
  4471. OPTS=['DIR:direct/src/interval']
  4472. IGATEFILES=GetDirectoryContents('direct/src/interval', ["*.h", "*_composite*.cxx"])
  4473. TargetAdd('libp3interval.in', opts=OPTS, input=IGATEFILES)
  4474. TargetAdd('libp3interval.in', opts=['IMOD:panda3d.direct', 'ILIB:libp3interval', 'SRCDIR:direct/src/interval'])
  4475. PyTargetAdd('p3interval_cInterval_ext.obj', opts=OPTS, input='cInterval_ext.cxx')
  4476. #
  4477. # DIRECTORY: direct/src/showbase/
  4478. #
  4479. if not PkgSkip("DIRECT"):
  4480. OPTS=['DIR:direct/src/showbase', 'BUILDING:DIRECT']
  4481. TargetAdd('p3showbase_showBase.obj', opts=OPTS, input='showBase.cxx')
  4482. if GetTarget() == 'darwin':
  4483. TargetAdd('p3showbase_showBase_assist.obj', opts=OPTS, input='showBase_assist.mm')
  4484. OPTS=['DIR:direct/src/showbase']
  4485. IGATEFILES=GetDirectoryContents('direct/src/showbase', ["*.h", "showBase.cxx"])
  4486. TargetAdd('libp3showbase.in', opts=OPTS, input=IGATEFILES)
  4487. TargetAdd('libp3showbase.in', opts=['IMOD:panda3d.direct', 'ILIB:libp3showbase', 'SRCDIR:direct/src/showbase'])
  4488. #
  4489. # DIRECTORY: direct/src/motiontrail/
  4490. #
  4491. if not PkgSkip("DIRECT"):
  4492. OPTS=['DIR:direct/src/motiontrail', 'BUILDING:DIRECT']
  4493. TargetAdd('p3motiontrail_cMotionTrail.obj', opts=OPTS, input='cMotionTrail.cxx')
  4494. TargetAdd('p3motiontrail_config_motiontrail.obj', opts=OPTS, input='config_motiontrail.cxx')
  4495. OPTS=['DIR:direct/src/motiontrail']
  4496. IGATEFILES=GetDirectoryContents('direct/src/motiontrail', ["*.h", "cMotionTrail.cxx"])
  4497. TargetAdd('libp3motiontrail.in', opts=OPTS, input=IGATEFILES)
  4498. TargetAdd('libp3motiontrail.in', opts=['IMOD:panda3d.direct', 'ILIB:libp3motiontrail', 'SRCDIR:direct/src/motiontrail'])
  4499. #
  4500. # DIRECTORY: direct/metalibs/direct/
  4501. #
  4502. if not PkgSkip("DIRECT"):
  4503. TargetAdd('libp3direct.dll', input='p3directbase_directbase.obj')
  4504. TargetAdd('libp3direct.dll', input='p3dcparser_composite1.obj')
  4505. TargetAdd('libp3direct.dll', input='p3dcparser_composite2.obj')
  4506. TargetAdd('libp3direct.dll', input='p3dcparser_dcParser.obj')
  4507. TargetAdd('libp3direct.dll', input='p3dcparser_dcLexer.obj')
  4508. TargetAdd('libp3direct.dll', input='p3showbase_showBase.obj')
  4509. if GetTarget() == 'darwin':
  4510. TargetAdd('libp3direct.dll', input='p3showbase_showBase_assist.obj')
  4511. TargetAdd('libp3direct.dll', input='p3deadrec_composite1.obj')
  4512. TargetAdd('libp3direct.dll', input='p3distributed_config_distributed.obj')
  4513. TargetAdd('libp3direct.dll', input='p3interval_composite1.obj')
  4514. TargetAdd('libp3direct.dll', input='p3motiontrail_config_motiontrail.obj')
  4515. TargetAdd('libp3direct.dll', input='p3motiontrail_cMotionTrail.obj')
  4516. TargetAdd('libp3direct.dll', input=COMMON_PANDA_LIBS)
  4517. TargetAdd('libp3direct.dll', opts=['ADVAPI', 'WINUSER', 'WINGDI'])
  4518. PyTargetAdd('direct_module.obj', input='libp3dcparser.in')
  4519. PyTargetAdd('direct_module.obj', input='libp3showbase.in')
  4520. PyTargetAdd('direct_module.obj', input='libp3deadrec.in')
  4521. PyTargetAdd('direct_module.obj', input='libp3interval.in')
  4522. PyTargetAdd('direct_module.obj', input='libp3distributed.in')
  4523. PyTargetAdd('direct_module.obj', input='libp3motiontrail.in')
  4524. PyTargetAdd('direct_module.obj', opts=['IMOD:panda3d.direct', 'ILIB:direct', 'IMPORT:panda3d.core'])
  4525. PyTargetAdd('direct.pyd', input='libp3dcparser_igate.obj')
  4526. PyTargetAdd('direct.pyd', input='libp3showbase_igate.obj')
  4527. PyTargetAdd('direct.pyd', input='libp3deadrec_igate.obj')
  4528. PyTargetAdd('direct.pyd', input='libp3interval_igate.obj')
  4529. PyTargetAdd('direct.pyd', input='p3interval_cInterval_ext.obj')
  4530. PyTargetAdd('direct.pyd', input='libp3distributed_igate.obj')
  4531. PyTargetAdd('direct.pyd', input='libp3motiontrail_igate.obj')
  4532. # These are part of direct.pyd, not libp3direct.dll, because they rely on
  4533. # the Python libraries. If a C++ user needs these modules, we can move them
  4534. # back and filter out the Python-specific code.
  4535. PyTargetAdd('direct.pyd', input='p3dcparser_ext_composite.obj')
  4536. PyTargetAdd('direct.pyd', input='p3distributed_cConnectionRepository.obj')
  4537. PyTargetAdd('direct.pyd', input='p3distributed_cDistributedSmoothNodeBase.obj')
  4538. PyTargetAdd('direct.pyd', input='direct_module.obj')
  4539. PyTargetAdd('direct.pyd', input='libp3direct.dll')
  4540. PyTargetAdd('direct.pyd', input='libp3interrogatedb.dll')
  4541. PyTargetAdd('direct.pyd', input=COMMON_PANDA_LIBS)
  4542. PyTargetAdd('direct.pyd', opts=['WINUSER', 'WINGDI', 'WINSOCK2'])
  4543. #
  4544. # DIRECTORY: direct/src/dcparse/
  4545. #
  4546. if not PkgSkip("DIRECT"):
  4547. OPTS=['DIR:direct/src/dcparse', 'DIR:direct/src/dcparser', 'WITHINPANDA', 'ADVAPI']
  4548. TargetAdd('dcparse_dcparse.obj', opts=OPTS, input='dcparse.cxx')
  4549. TargetAdd('p3dcparse.exe', input='dcparse_dcparse.obj')
  4550. TargetAdd('p3dcparse.exe', input='libp3direct.dll')
  4551. TargetAdd('p3dcparse.exe', input=COMMON_PANDA_LIBS)
  4552. TargetAdd('p3dcparse.exe', opts=['ADVAPI'])
  4553. #
  4554. # DIRECTORY: pandatool/src/pandatoolbase/
  4555. #
  4556. if not PkgSkip("PANDATOOL"):
  4557. OPTS=['DIR:pandatool/src/pandatoolbase']
  4558. TargetAdd('p3pandatoolbase_composite1.obj', opts=OPTS, input='p3pandatoolbase_composite1.cxx')
  4559. TargetAdd('libp3pandatoolbase.lib', input='p3pandatoolbase_composite1.obj')
  4560. #
  4561. # DIRECTORY: pandatool/src/converter/
  4562. #
  4563. if not PkgSkip("PANDATOOL") and not PkgSkip("EGG"):
  4564. OPTS=['DIR:pandatool/src/converter']
  4565. TargetAdd('p3converter_somethingToEggConverter.obj', opts=OPTS, input='somethingToEggConverter.cxx')
  4566. TargetAdd('p3converter_eggToSomethingConverter.obj', opts=OPTS, input='eggToSomethingConverter.cxx')
  4567. TargetAdd('libp3converter.lib', input='p3converter_somethingToEggConverter.obj')
  4568. TargetAdd('libp3converter.lib', input='p3converter_eggToSomethingConverter.obj')
  4569. #
  4570. # DIRECTORY: pandatool/src/progbase/
  4571. #
  4572. if not PkgSkip("PANDATOOL"):
  4573. OPTS=['DIR:pandatool/src/progbase', 'ZLIB']
  4574. TargetAdd('p3progbase_composite1.obj', opts=OPTS, input='p3progbase_composite1.cxx')
  4575. TargetAdd('libp3progbase.lib', input='p3progbase_composite1.obj')
  4576. #
  4577. # DIRECTORY: pandatool/src/eggbase/
  4578. #
  4579. if not PkgSkip("PANDATOOL") and not PkgSkip("EGG"):
  4580. OPTS=['DIR:pandatool/src/eggbase']
  4581. TargetAdd('p3eggbase_composite1.obj', opts=OPTS, input='p3eggbase_composite1.cxx')
  4582. TargetAdd('libp3eggbase.lib', input='p3eggbase_composite1.obj')
  4583. #
  4584. # DIRECTORY: pandatool/src/bam/
  4585. #
  4586. if not PkgSkip("PANDATOOL"):
  4587. OPTS=['DIR:pandatool/src/bam']
  4588. TargetAdd('bam-info_bamInfo.obj', opts=OPTS, input='bamInfo.cxx')
  4589. TargetAdd('bam-info.exe', input='bam-info_bamInfo.obj')
  4590. TargetAdd('bam-info.exe', input='libp3progbase.lib')
  4591. TargetAdd('bam-info.exe', input='libp3pandatoolbase.lib')
  4592. TargetAdd('bam-info.exe', input=COMMON_PANDA_LIBS)
  4593. TargetAdd('bam-info.exe', opts=['ADVAPI', 'FFTW'])
  4594. if not PkgSkip("EGG"):
  4595. TargetAdd('bam2egg_bamToEgg.obj', opts=OPTS, input='bamToEgg.cxx')
  4596. TargetAdd('bam2egg.exe', input='bam2egg_bamToEgg.obj')
  4597. TargetAdd('bam2egg.exe', input=COMMON_EGG2X_LIBS)
  4598. TargetAdd('bam2egg.exe', opts=['ADVAPI', 'FFTW'])
  4599. TargetAdd('egg2bam_eggToBam.obj', opts=OPTS, input='eggToBam.cxx')
  4600. TargetAdd('egg2bam.exe', input='egg2bam_eggToBam.obj')
  4601. TargetAdd('egg2bam.exe', input=COMMON_EGG2X_LIBS)
  4602. TargetAdd('egg2bam.exe', opts=['ADVAPI', 'FFTW'])
  4603. #
  4604. # DIRECTORY: pandatool/src/daeegg/
  4605. #
  4606. if not PkgSkip("PANDATOOL") and not PkgSkip("FCOLLADA") and not PkgSkip("EGG"):
  4607. OPTS=['DIR:pandatool/src/daeegg', 'FCOLLADA']
  4608. TargetAdd('p3daeegg_composite1.obj', opts=OPTS, input='p3daeegg_composite1.cxx')
  4609. TargetAdd('libp3daeegg.lib', input='p3daeegg_composite1.obj')
  4610. TargetAdd('libp3daeegg.lib', opts=['FCOLLADA', 'CARBON'])
  4611. #
  4612. # DIRECTORY: pandatool/src/assimp
  4613. #
  4614. if not PkgSkip("PANDATOOL") and not PkgSkip("ASSIMP"):
  4615. OPTS=['DIR:pandatool/src/assimp', 'BUILDING:ASSIMP', 'ASSIMP', 'MODULE']
  4616. TargetAdd('p3assimp_composite1.obj', opts=OPTS, input='p3assimp_composite1.cxx')
  4617. TargetAdd('libp3assimp.dll', input='p3assimp_composite1.obj')
  4618. TargetAdd('libp3assimp.dll', input=COMMON_PANDA_LIBS)
  4619. TargetAdd('libp3assimp.dll', opts=OPTS+['ZLIB', 'ADVAPI'])
  4620. #
  4621. # DIRECTORY: pandatool/src/daeprogs/
  4622. #
  4623. if not PkgSkip("PANDATOOL") and not PkgSkip("FCOLLADA") and not PkgSkip("EGG"):
  4624. OPTS=['DIR:pandatool/src/daeprogs', 'FCOLLADA']
  4625. TargetAdd('dae2egg_daeToEgg.obj', opts=OPTS, input='daeToEgg.cxx')
  4626. TargetAdd('dae2egg.exe', input='dae2egg_daeToEgg.obj')
  4627. TargetAdd('dae2egg.exe', input='libp3daeegg.lib')
  4628. TargetAdd('dae2egg.exe', input=COMMON_EGG2X_LIBS)
  4629. TargetAdd('dae2egg.exe', opts=['WINUSER', 'FCOLLADA', 'CARBON'])
  4630. #
  4631. # DIRECTORY: pandatool/src/dxf/
  4632. #
  4633. if not PkgSkip("PANDATOOL"):
  4634. OPTS=['DIR:pandatool/src/dxf']
  4635. TargetAdd('p3dxf_composite1.obj', opts=OPTS, input='p3dxf_composite1.cxx')
  4636. TargetAdd('libp3dxf.lib', input='p3dxf_composite1.obj')
  4637. #
  4638. # DIRECTORY: pandatool/src/dxfegg/
  4639. #
  4640. if not PkgSkip("PANDATOOL") and not PkgSkip("EGG"):
  4641. OPTS=['DIR:pandatool/src/dxfegg']
  4642. TargetAdd('p3dxfegg_dxfToEggConverter.obj', opts=OPTS, input='dxfToEggConverter.cxx')
  4643. TargetAdd('p3dxfegg_dxfToEggLayer.obj', opts=OPTS, input='dxfToEggLayer.cxx')
  4644. TargetAdd('libp3dxfegg.lib', input='p3dxfegg_dxfToEggConverter.obj')
  4645. TargetAdd('libp3dxfegg.lib', input='p3dxfegg_dxfToEggLayer.obj')
  4646. #
  4647. # DIRECTORY: pandatool/src/dxfprogs/
  4648. #
  4649. if not PkgSkip("PANDATOOL"):
  4650. OPTS=['DIR:pandatool/src/dxfprogs']
  4651. TargetAdd('dxf-points_dxfPoints.obj', opts=OPTS, input='dxfPoints.cxx')
  4652. TargetAdd('dxf-points.exe', input='dxf-points_dxfPoints.obj')
  4653. TargetAdd('dxf-points.exe', input='libp3progbase.lib')
  4654. TargetAdd('dxf-points.exe', input='libp3dxf.lib')
  4655. TargetAdd('dxf-points.exe', input='libp3pandatoolbase.lib')
  4656. TargetAdd('dxf-points.exe', input=COMMON_PANDA_LIBS)
  4657. TargetAdd('dxf-points.exe', opts=['ADVAPI', 'FFTW'])
  4658. if not PkgSkip("EGG"):
  4659. TargetAdd('dxf2egg_dxfToEgg.obj', opts=OPTS, input='dxfToEgg.cxx')
  4660. TargetAdd('dxf2egg.exe', input='dxf2egg_dxfToEgg.obj')
  4661. TargetAdd('dxf2egg.exe', input='libp3dxfegg.lib')
  4662. TargetAdd('dxf2egg.exe', input='libp3dxf.lib')
  4663. TargetAdd('dxf2egg.exe', input=COMMON_EGG2X_LIBS)
  4664. TargetAdd('dxf2egg.exe', opts=['ADVAPI', 'FFTW'])
  4665. TargetAdd('egg2dxf_eggToDXF.obj', opts=OPTS, input='eggToDXF.cxx')
  4666. TargetAdd('egg2dxf_eggToDXFLayer.obj', opts=OPTS, input='eggToDXFLayer.cxx')
  4667. TargetAdd('egg2dxf.exe', input='egg2dxf_eggToDXF.obj')
  4668. TargetAdd('egg2dxf.exe', input='egg2dxf_eggToDXFLayer.obj')
  4669. TargetAdd('egg2dxf.exe', input='libp3dxf.lib')
  4670. TargetAdd('egg2dxf.exe', input=COMMON_EGG2X_LIBS)
  4671. TargetAdd('egg2dxf.exe', opts=['ADVAPI', 'FFTW'])
  4672. #
  4673. # DIRECTORY: pandatool/src/objegg/
  4674. #
  4675. if not PkgSkip("PANDATOOL") and not PkgSkip("EGG"):
  4676. OPTS=['DIR:pandatool/src/objegg']
  4677. TargetAdd('p3objegg_objToEggConverter.obj', opts=OPTS, input='objToEggConverter.cxx')
  4678. TargetAdd('p3objegg_eggToObjConverter.obj', opts=OPTS, input='eggToObjConverter.cxx')
  4679. TargetAdd('p3objegg_config_objegg.obj', opts=OPTS, input='config_objegg.cxx')
  4680. TargetAdd('libp3objegg.lib', input='p3objegg_objToEggConverter.obj')
  4681. TargetAdd('libp3objegg.lib', input='p3objegg_eggToObjConverter.obj')
  4682. TargetAdd('libp3objegg.lib', input='p3objegg_config_objegg.obj')
  4683. #
  4684. # DIRECTORY: pandatool/src/objprogs/
  4685. #
  4686. if not PkgSkip("PANDATOOL") and not PkgSkip("EGG"):
  4687. OPTS=['DIR:pandatool/src/objprogs']
  4688. TargetAdd('obj2egg_objToEgg.obj', opts=OPTS, input='objToEgg.cxx')
  4689. TargetAdd('obj2egg.exe', input='obj2egg_objToEgg.obj')
  4690. TargetAdd('obj2egg.exe', input='libp3objegg.lib')
  4691. TargetAdd('obj2egg.exe', input=COMMON_EGG2X_LIBS)
  4692. TargetAdd('egg2obj_eggToObj.obj', opts=OPTS, input='eggToObj.cxx')
  4693. TargetAdd('egg2obj.exe', input='egg2obj_eggToObj.obj')
  4694. TargetAdd('egg2obj.exe', input='libp3objegg.lib')
  4695. TargetAdd('egg2obj.exe', input=COMMON_EGG2X_LIBS)
  4696. #
  4697. # DIRECTORY: pandatool/src/palettizer/
  4698. #
  4699. if not PkgSkip("PANDATOOL") and not PkgSkip("EGG"):
  4700. OPTS=['DIR:pandatool/src/palettizer']
  4701. TargetAdd('p3palettizer_composite1.obj', opts=OPTS, input='p3palettizer_composite1.cxx')
  4702. TargetAdd('libp3palettizer.lib', input='p3palettizer_composite1.obj')
  4703. #
  4704. # DIRECTORY: pandatool/src/egg-mkfont/
  4705. #
  4706. if not PkgSkip("FREETYPE") and not PkgSkip("PANDATOOL") and not PkgSkip("EGG"):
  4707. OPTS=['DIR:pandatool/src/egg-mkfont', 'DIR:pandatool/src/palettizer', 'FREETYPE']
  4708. TargetAdd('egg-mkfont_eggMakeFont.obj', opts=OPTS, input='eggMakeFont.cxx')
  4709. TargetAdd('egg-mkfont_rangeDescription.obj', opts=OPTS, input='rangeDescription.cxx')
  4710. TargetAdd('egg-mkfont_rangeIterator.obj', opts=OPTS, input='rangeIterator.cxx')
  4711. TargetAdd('egg-mkfont.exe', input='egg-mkfont_eggMakeFont.obj')
  4712. TargetAdd('egg-mkfont.exe', input='egg-mkfont_rangeDescription.obj')
  4713. TargetAdd('egg-mkfont.exe', input='egg-mkfont_rangeIterator.obj')
  4714. TargetAdd('egg-mkfont.exe', input='libp3palettizer.lib')
  4715. TargetAdd('egg-mkfont.exe', input=COMMON_EGG2X_LIBS)
  4716. TargetAdd('egg-mkfont.exe', opts=['ADVAPI', 'FREETYPE'])
  4717. #
  4718. # DIRECTORY: pandatool/src/eggcharbase/
  4719. #
  4720. if not PkgSkip("PANDATOOL") and not PkgSkip("EGG"):
  4721. OPTS=['DIR:pandatool/src/eggcharbase', 'ZLIB']
  4722. TargetAdd('p3eggcharbase_composite1.obj', opts=OPTS, input='p3eggcharbase_composite1.cxx')
  4723. TargetAdd('libp3eggcharbase.lib', input='p3eggcharbase_composite1.obj')
  4724. #
  4725. # DIRECTORY: pandatool/src/egg-optchar/
  4726. #
  4727. if not PkgSkip("PANDATOOL") and not PkgSkip("EGG"):
  4728. OPTS=['DIR:pandatool/src/egg-optchar']
  4729. TargetAdd('egg-optchar_config_egg_optchar.obj', opts=OPTS, input='config_egg_optchar.cxx')
  4730. TargetAdd('egg-optchar_eggOptchar.obj', opts=OPTS, input='eggOptchar.cxx')
  4731. TargetAdd('egg-optchar_eggOptcharUserData.obj', opts=OPTS, input='eggOptcharUserData.cxx')
  4732. TargetAdd('egg-optchar_vertexMembership.obj', opts=OPTS, input='vertexMembership.cxx')
  4733. TargetAdd('egg-optchar.exe', input='egg-optchar_config_egg_optchar.obj')
  4734. TargetAdd('egg-optchar.exe', input='egg-optchar_eggOptchar.obj')
  4735. TargetAdd('egg-optchar.exe', input='egg-optchar_eggOptcharUserData.obj')
  4736. TargetAdd('egg-optchar.exe', input='egg-optchar_vertexMembership.obj')
  4737. TargetAdd('egg-optchar.exe', input='libp3eggcharbase.lib')
  4738. TargetAdd('egg-optchar.exe', input=COMMON_EGG2X_LIBS)
  4739. TargetAdd('egg-optchar.exe', opts=['ADVAPI', 'FREETYPE'])
  4740. #
  4741. # DIRECTORY: pandatool/src/egg-palettize/
  4742. #
  4743. if not PkgSkip("PANDATOOL") and not PkgSkip("EGG"):
  4744. OPTS=['DIR:pandatool/src/egg-palettize', 'DIR:pandatool/src/palettizer']
  4745. TargetAdd('egg-palettize_eggPalettize.obj', opts=OPTS, input='eggPalettize.cxx')
  4746. TargetAdd('egg-palettize.exe', input='egg-palettize_eggPalettize.obj')
  4747. TargetAdd('egg-palettize.exe', input='libp3palettizer.lib')
  4748. TargetAdd('egg-palettize.exe', input=COMMON_EGG2X_LIBS)
  4749. TargetAdd('egg-palettize.exe', opts=['ADVAPI'])
  4750. #
  4751. # DIRECTORY: pandatool/src/egg-qtess/
  4752. #
  4753. if not PkgSkip("PANDATOOL") and not PkgSkip("EGG"):
  4754. OPTS=['DIR:pandatool/src/egg-qtess']
  4755. TargetAdd('egg-qtess_composite1.obj', opts=OPTS, input='egg-qtess_composite1.cxx')
  4756. TargetAdd('egg-qtess.exe', input='egg-qtess_composite1.obj')
  4757. TargetAdd('egg-qtess.exe', input='libp3eggbase.lib')
  4758. TargetAdd('egg-qtess.exe', input='libp3progbase.lib')
  4759. TargetAdd('egg-qtess.exe', input='libp3converter.lib')
  4760. TargetAdd('egg-qtess.exe', input=COMMON_EGG2X_LIBS)
  4761. TargetAdd('egg-qtess.exe', opts=['ADVAPI'])
  4762. #
  4763. # DIRECTORY: pandatool/src/eggprogs/
  4764. #
  4765. if not PkgSkip("PANDATOOL") and not PkgSkip("EGG"):
  4766. OPTS=['DIR:pandatool/src/eggprogs']
  4767. TargetAdd('egg-crop_eggCrop.obj', opts=OPTS, input='eggCrop.cxx')
  4768. TargetAdd('egg-crop.exe', input='egg-crop_eggCrop.obj')
  4769. TargetAdd('egg-crop.exe', input=COMMON_EGG2X_LIBS)
  4770. TargetAdd('egg-crop.exe', opts=['ADVAPI'])
  4771. TargetAdd('egg-make-tube_eggMakeTube.obj', opts=OPTS, input='eggMakeTube.cxx')
  4772. TargetAdd('egg-make-tube.exe', input='egg-make-tube_eggMakeTube.obj')
  4773. TargetAdd('egg-make-tube.exe', input=COMMON_EGG2X_LIBS)
  4774. TargetAdd('egg-make-tube.exe', opts=['ADVAPI'])
  4775. TargetAdd('egg-texture-cards_eggTextureCards.obj', opts=OPTS, input='eggTextureCards.cxx')
  4776. TargetAdd('egg-texture-cards.exe', input='egg-texture-cards_eggTextureCards.obj')
  4777. TargetAdd('egg-texture-cards.exe', input=COMMON_EGG2X_LIBS)
  4778. TargetAdd('egg-texture-cards.exe', opts=['ADVAPI'])
  4779. TargetAdd('egg-topstrip_eggTopstrip.obj', opts=OPTS, input='eggTopstrip.cxx')
  4780. TargetAdd('egg-topstrip.exe', input='egg-topstrip_eggTopstrip.obj')
  4781. TargetAdd('egg-topstrip.exe', input='libp3eggcharbase.lib')
  4782. TargetAdd('egg-topstrip.exe', input=COMMON_EGG2X_LIBS)
  4783. TargetAdd('egg-topstrip.exe', opts=['ADVAPI'])
  4784. TargetAdd('egg-trans_eggTrans.obj', opts=OPTS, input='eggTrans.cxx')
  4785. TargetAdd('egg-trans.exe', input='egg-trans_eggTrans.obj')
  4786. TargetAdd('egg-trans.exe', input=COMMON_EGG2X_LIBS)
  4787. TargetAdd('egg-trans.exe', opts=['ADVAPI'])
  4788. TargetAdd('egg2c_eggToC.obj', opts=OPTS, input='eggToC.cxx')
  4789. TargetAdd('egg2c.exe', input='egg2c_eggToC.obj')
  4790. TargetAdd('egg2c.exe', input=COMMON_EGG2X_LIBS)
  4791. TargetAdd('egg2c.exe', opts=['ADVAPI'])
  4792. TargetAdd('egg-rename_eggRename.obj', opts=OPTS, input='eggRename.cxx')
  4793. TargetAdd('egg-rename.exe', input='egg-rename_eggRename.obj')
  4794. TargetAdd('egg-rename.exe', input=COMMON_EGG2X_LIBS)
  4795. TargetAdd('egg-rename.exe', opts=['ADVAPI'])
  4796. TargetAdd('egg-retarget-anim_eggRetargetAnim.obj', opts=OPTS, input='eggRetargetAnim.cxx')
  4797. TargetAdd('egg-retarget-anim.exe', input='egg-retarget-anim_eggRetargetAnim.obj')
  4798. TargetAdd('egg-retarget-anim.exe', input='libp3eggcharbase.lib')
  4799. TargetAdd('egg-retarget-anim.exe', input=COMMON_EGG2X_LIBS)
  4800. TargetAdd('egg-retarget-anim.exe', opts=['ADVAPI'])
  4801. TargetAdd('egg-list-textures_eggListTextures.obj', opts=OPTS, input='eggListTextures.cxx')
  4802. TargetAdd('egg-list-textures.exe', input='egg-list-textures_eggListTextures.obj')
  4803. TargetAdd('egg-list-textures.exe', input=COMMON_EGG2X_LIBS)
  4804. TargetAdd('egg-list-textures.exe', opts=['ADVAPI'])
  4805. #
  4806. # DIRECTORY: pandatool/src/flt/
  4807. #
  4808. if not PkgSkip("PANDATOOL"):
  4809. OPTS=['DIR:pandatool/src/flt', 'ZLIB']
  4810. TargetAdd('p3flt_composite1.obj', opts=OPTS, input='p3flt_composite1.cxx')
  4811. TargetAdd('libp3flt.lib', input=['p3flt_composite1.obj'])
  4812. #
  4813. # DIRECTORY: pandatool/src/fltegg/
  4814. #
  4815. if not PkgSkip("PANDATOOL") and not PkgSkip("EGG"):
  4816. OPTS=['DIR:pandatool/src/fltegg']
  4817. TargetAdd('p3fltegg_fltToEggConverter.obj', opts=OPTS, input='fltToEggConverter.cxx')
  4818. TargetAdd('p3fltegg_fltToEggLevelState.obj', opts=OPTS, input='fltToEggLevelState.cxx')
  4819. TargetAdd('libp3fltegg.lib', input=['p3fltegg_fltToEggConverter.obj', 'p3fltegg_fltToEggLevelState.obj'])
  4820. #
  4821. # DIRECTORY: pandatool/src/fltprogs/
  4822. #
  4823. if not PkgSkip("PANDATOOL"):
  4824. OPTS=['DIR:pandatool/src/fltprogs', 'DIR:pandatool/src/flt']
  4825. TargetAdd('flt-info_fltInfo.obj', opts=OPTS, input='fltInfo.cxx')
  4826. TargetAdd('flt-info.exe', input='flt-info_fltInfo.obj')
  4827. TargetAdd('flt-info.exe', input='libp3flt.lib')
  4828. TargetAdd('flt-info.exe', input='libp3progbase.lib')
  4829. TargetAdd('flt-info.exe', input='libp3pandatoolbase.lib')
  4830. TargetAdd('flt-info.exe', input=COMMON_PANDA_LIBS)
  4831. TargetAdd('flt-info.exe', opts=['ADVAPI'])
  4832. TargetAdd('flt-trans_fltTrans.obj', opts=OPTS, input='fltTrans.cxx')
  4833. TargetAdd('flt-trans.exe', input='flt-trans_fltTrans.obj')
  4834. TargetAdd('flt-trans.exe', input='libp3flt.lib')
  4835. TargetAdd('flt-trans.exe', input='libp3progbase.lib')
  4836. TargetAdd('flt-trans.exe', input='libp3pandatoolbase.lib')
  4837. TargetAdd('flt-trans.exe', input=COMMON_PANDA_LIBS)
  4838. TargetAdd('flt-trans.exe', opts=['ADVAPI'])
  4839. if not PkgSkip("EGG"):
  4840. TargetAdd('egg2flt_eggToFlt.obj', opts=OPTS, input='eggToFlt.cxx')
  4841. TargetAdd('egg2flt.exe', input='egg2flt_eggToFlt.obj')
  4842. TargetAdd('egg2flt.exe', input='libp3flt.lib')
  4843. TargetAdd('egg2flt.exe', input=COMMON_EGG2X_LIBS)
  4844. TargetAdd('egg2flt.exe', opts=['ADVAPI'])
  4845. TargetAdd('flt2egg_fltToEgg.obj', opts=OPTS, input='fltToEgg.cxx')
  4846. TargetAdd('flt2egg.exe', input='flt2egg_fltToEgg.obj')
  4847. TargetAdd('flt2egg.exe', input='libp3flt.lib')
  4848. TargetAdd('flt2egg.exe', input='libp3fltegg.lib')
  4849. TargetAdd('flt2egg.exe', input=COMMON_EGG2X_LIBS)
  4850. TargetAdd('flt2egg.exe', opts=['ADVAPI'])
  4851. #
  4852. # DIRECTORY: pandatool/src/imagebase/
  4853. #
  4854. if not PkgSkip("PANDATOOL"):
  4855. OPTS=['DIR:pandatool/src/imagebase']
  4856. TargetAdd('p3imagebase_composite1.obj', opts=OPTS, input='p3imagebase_composite1.cxx')
  4857. TargetAdd('libp3imagebase.lib', input='p3imagebase_composite1.obj')
  4858. #
  4859. # DIRECTORY: pandatool/src/imageprogs/
  4860. #
  4861. if not PkgSkip("PANDATOOL"):
  4862. OPTS=['DIR:pandatool/src/imageprogs']
  4863. TargetAdd('image-info_imageInfo.obj', opts=OPTS, input='imageInfo.cxx')
  4864. TargetAdd('image-info.exe', input='image-info_imageInfo.obj')
  4865. TargetAdd('image-info.exe', input='libp3imagebase.lib')
  4866. TargetAdd('image-info.exe', input='libp3progbase.lib')
  4867. TargetAdd('image-info.exe', input='libp3pandatoolbase.lib')
  4868. TargetAdd('image-info.exe', input=COMMON_PANDA_LIBS)
  4869. TargetAdd('image-info.exe', opts=['ADVAPI'])
  4870. TargetAdd('image-resize_imageResize.obj', opts=OPTS, input='imageResize.cxx')
  4871. TargetAdd('image-resize.exe', input='image-resize_imageResize.obj')
  4872. TargetAdd('image-resize.exe', input='libp3imagebase.lib')
  4873. TargetAdd('image-resize.exe', input='libp3progbase.lib')
  4874. TargetAdd('image-resize.exe', input='libp3pandatoolbase.lib')
  4875. TargetAdd('image-resize.exe', input=COMMON_PANDA_LIBS)
  4876. TargetAdd('image-resize.exe', opts=['ADVAPI'])
  4877. TargetAdd('image-trans_imageTrans.obj', opts=OPTS, input='imageTrans.cxx')
  4878. TargetAdd('image-trans.exe', input='image-trans_imageTrans.obj')
  4879. TargetAdd('image-trans.exe', input='libp3imagebase.lib')
  4880. TargetAdd('image-trans.exe', input='libp3progbase.lib')
  4881. TargetAdd('image-trans.exe', input='libp3pandatoolbase.lib')
  4882. TargetAdd('image-trans.exe', input=COMMON_PANDA_LIBS)
  4883. TargetAdd('image-trans.exe', opts=['ADVAPI'])
  4884. #
  4885. # DIRECTORY: pandatool/src/pfmprogs/
  4886. #
  4887. if not PkgSkip("PANDATOOL"):
  4888. OPTS=['DIR:pandatool/src/pfmprogs']
  4889. TargetAdd('pfm-trans_pfmTrans.obj', opts=OPTS, input='pfmTrans.cxx')
  4890. TargetAdd('pfm-trans.exe', input='pfm-trans_pfmTrans.obj')
  4891. TargetAdd('pfm-trans.exe', input='libp3progbase.lib')
  4892. TargetAdd('pfm-trans.exe', input='libp3pandatoolbase.lib')
  4893. TargetAdd('pfm-trans.exe', input=COMMON_PANDA_LIBS)
  4894. TargetAdd('pfm-trans.exe', opts=['ADVAPI'])
  4895. TargetAdd('pfm-bba_pfmBba.obj', opts=OPTS, input='pfmBba.cxx')
  4896. TargetAdd('pfm-bba_config_pfmprogs.obj', opts=OPTS, input='config_pfmprogs.cxx')
  4897. TargetAdd('pfm-bba.exe', input='pfm-bba_pfmBba.obj')
  4898. TargetAdd('pfm-bba.exe', input='pfm-bba_config_pfmprogs.obj')
  4899. TargetAdd('pfm-bba.exe', input='libp3progbase.lib')
  4900. TargetAdd('pfm-bba.exe', input='libp3pandatoolbase.lib')
  4901. TargetAdd('pfm-bba.exe', input=COMMON_PANDA_LIBS)
  4902. TargetAdd('pfm-bba.exe', opts=['ADVAPI'])
  4903. #
  4904. # DIRECTORY: pandatool/src/lwo/
  4905. #
  4906. if not PkgSkip("PANDATOOL"):
  4907. OPTS=['DIR:pandatool/src/lwo']
  4908. TargetAdd('p3lwo_composite1.obj', opts=OPTS, input='p3lwo_composite1.cxx')
  4909. TargetAdd('libp3lwo.lib', input='p3lwo_composite1.obj')
  4910. #
  4911. # DIRECTORY: pandatool/src/lwoegg/
  4912. #
  4913. if not PkgSkip("PANDATOOL") and not PkgSkip("EGG"):
  4914. OPTS=['DIR:pandatool/src/lwoegg']
  4915. TargetAdd('p3lwoegg_composite1.obj', opts=OPTS, input='p3lwoegg_composite1.cxx')
  4916. TargetAdd('libp3lwoegg.lib', input='p3lwoegg_composite1.obj')
  4917. #
  4918. # DIRECTORY: pandatool/src/lwoprogs/
  4919. #
  4920. if not PkgSkip("PANDATOOL"):
  4921. OPTS=['DIR:pandatool/src/lwoprogs', 'DIR:pandatool/src/lwo']
  4922. TargetAdd('lwo-scan_lwoScan.obj', opts=OPTS, input='lwoScan.cxx')
  4923. TargetAdd('lwo-scan.exe', input='lwo-scan_lwoScan.obj')
  4924. TargetAdd('lwo-scan.exe', input='libp3lwo.lib')
  4925. TargetAdd('lwo-scan.exe', input='libp3progbase.lib')
  4926. TargetAdd('lwo-scan.exe', input='libp3pandatoolbase.lib')
  4927. TargetAdd('lwo-scan.exe', input=COMMON_PANDA_LIBS)
  4928. TargetAdd('lwo-scan.exe', opts=['ADVAPI'])
  4929. if not PkgSkip("EGG"):
  4930. TargetAdd('lwo2egg_lwoToEgg.obj', opts=OPTS, input='lwoToEgg.cxx')
  4931. TargetAdd('lwo2egg.exe', input='lwo2egg_lwoToEgg.obj')
  4932. TargetAdd('lwo2egg.exe', input='libp3lwo.lib')
  4933. TargetAdd('lwo2egg.exe', input='libp3lwoegg.lib')
  4934. TargetAdd('lwo2egg.exe', input=COMMON_EGG2X_LIBS)
  4935. TargetAdd('lwo2egg.exe', opts=['ADVAPI'])
  4936. #
  4937. # DIRECTORY: pandatool/src/maya/
  4938. #
  4939. for VER in MAYAVERSIONS:
  4940. VNUM = VER[4:]
  4941. if PkgSkip(VER) or PkgSkip("PANDATOOL"):
  4942. continue
  4943. OPTS=['DIR:pandatool/src/maya', VER]
  4944. TargetAdd('maya'+VNUM+'_composite1.obj', opts=OPTS, input='p3maya_composite1.cxx')
  4945. TargetAdd('libmaya'+VNUM+'.lib', input='maya'+VNUM+'_composite1.obj')
  4946. #
  4947. # DIRECTORY: pandatool/src/mayaegg/
  4948. #
  4949. for VER in MAYAVERSIONS:
  4950. VNUM = VER[4:]
  4951. if PkgSkip(VER) or PkgSkip("PANDATOOL") or PkgSkip("EGG"):
  4952. continue
  4953. OPTS=['DIR:pandatool/src/mayaegg', 'DIR:pandatool/src/maya', VER]
  4954. TargetAdd('mayaegg'+VNUM+'_loader.obj', opts=OPTS, input='mayaEggLoader.cxx')
  4955. TargetAdd('mayaegg'+VNUM+'_composite1.obj', opts=OPTS, input='p3mayaegg_composite1.cxx')
  4956. TargetAdd('libmayaegg'+VNUM+'.lib', input='mayaegg'+VNUM+'_loader.obj')
  4957. TargetAdd('libmayaegg'+VNUM+'.lib', input='mayaegg'+VNUM+'_composite1.obj')
  4958. #
  4959. # DIRECTORY: pandatool/src/maxegg/
  4960. #
  4961. for VER in MAXVERSIONS:
  4962. VNUM = VER[3:]
  4963. if PkgSkip(VER) or PkgSkip("PANDATOOL") or PkgSkip("EGG"):
  4964. continue
  4965. OPTS=['DIR:pandatool/src/maxegg', VER, "WINCOMCTL", "WINCOMDLG", "WINUSER", "MSFORSCOPE", "RTTI"]
  4966. TargetAdd('maxEgg'+VNUM+'.res', opts=OPTS, input='maxEgg.rc')
  4967. TargetAdd('maxegg'+VNUM+'_loader.obj', opts=OPTS, input='maxEggLoader.cxx')
  4968. TargetAdd('maxegg'+VNUM+'_composite1.obj', opts=OPTS, input='p3maxegg_composite1.cxx')
  4969. TargetAdd('maxegg'+VNUM+'.dlo', input='maxegg'+VNUM+'_composite1.obj')
  4970. TargetAdd('maxegg'+VNUM+'.dlo', input='maxEgg'+VNUM+'.res')
  4971. TargetAdd('maxegg'+VNUM+'.dlo', input='maxEgg.def', ipath=OPTS)
  4972. TargetAdd('maxegg'+VNUM+'.dlo', input=COMMON_EGG2X_LIBS)
  4973. TargetAdd('maxegg'+VNUM+'.dlo', opts=OPTS)
  4974. #
  4975. # DIRECTORY: pandatool/src/maxprogs/
  4976. #
  4977. for VER in MAXVERSIONS:
  4978. VNUM = VER[3:]
  4979. if PkgSkip(VER) or PkgSkip("PANDATOOL") or PkgSkip("EGG"):
  4980. continue
  4981. OPTS=['DIR:pandatool/src/maxprogs', VER, "WINCOMCTL", "WINCOMDLG", "WINUSER", "MSFORSCOPE", "RTTI"]
  4982. TargetAdd('maxImportRes.res', opts=OPTS, input='maxImportRes.rc')
  4983. TargetAdd('maxprogs'+VNUM+'_maxeggimport.obj', opts=OPTS, input='maxEggImport.cxx')
  4984. TargetAdd('maxeggimport'+VNUM+'.dle', input='maxegg'+VNUM+'_loader.obj')
  4985. TargetAdd('maxeggimport'+VNUM+'.dle', input='maxprogs'+VNUM+'_maxeggimport.obj')
  4986. TargetAdd('maxeggimport'+VNUM+'.dle', input='libpandaegg.dll')
  4987. TargetAdd('maxeggimport'+VNUM+'.dle', input='libpanda.dll')
  4988. TargetAdd('maxeggimport'+VNUM+'.dle', input='libpandaexpress.dll')
  4989. TargetAdd('maxeggimport'+VNUM+'.dle', input='maxImportRes.res')
  4990. TargetAdd('maxeggimport'+VNUM+'.dle', input='maxEggImport.def', ipath=OPTS)
  4991. TargetAdd('maxeggimport'+VNUM+'.dle', input=COMMON_DTOOL_LIBS)
  4992. TargetAdd('maxeggimport'+VNUM+'.dle', opts=OPTS)
  4993. #
  4994. # DIRECTORY: pandatool/src/vrml/
  4995. #
  4996. if not PkgSkip("PANDATOOL"):
  4997. OPTS=['DIR:pandatool/src/vrml', 'ZLIB', 'BISONPREFIX_vrmlyy']
  4998. CreateFile(GetOutputDir() + "/include/vrmlParser.h")
  4999. TargetAdd('p3vrml_vrmlParser.obj', opts=OPTS, input='vrmlParser.yxx')
  5000. TargetAdd('vrmlParser.h', input='p3vrml_vrmlParser.obj', opts=['DEPENDENCYONLY'])
  5001. TargetAdd('p3vrml_vrmlLexer.obj', opts=OPTS, input='vrmlLexer.lxx')
  5002. TargetAdd('p3vrml_parse_vrml.obj', opts=OPTS, input='parse_vrml.cxx')
  5003. TargetAdd('p3vrml_standard_nodes.obj', opts=OPTS, input='standard_nodes.cxx')
  5004. TargetAdd('p3vrml_vrmlNode.obj', opts=OPTS, input='vrmlNode.cxx')
  5005. TargetAdd('p3vrml_vrmlNodeType.obj', opts=OPTS, input='vrmlNodeType.cxx')
  5006. TargetAdd('libp3vrml.lib', input='p3vrml_parse_vrml.obj')
  5007. TargetAdd('libp3vrml.lib', input='p3vrml_standard_nodes.obj')
  5008. TargetAdd('libp3vrml.lib', input='p3vrml_vrmlNode.obj')
  5009. TargetAdd('libp3vrml.lib', input='p3vrml_vrmlNodeType.obj')
  5010. TargetAdd('libp3vrml.lib', input='p3vrml_vrmlParser.obj')
  5011. TargetAdd('libp3vrml.lib', input='p3vrml_vrmlLexer.obj')
  5012. #
  5013. # DIRECTORY: pandatool/src/vrmlegg/
  5014. #
  5015. if not PkgSkip("PANDATOOL") and not PkgSkip("EGG"):
  5016. OPTS=['DIR:pandatool/src/vrmlegg', 'DIR:pandatool/src/vrml']
  5017. TargetAdd('p3vrmlegg_indexedFaceSet.obj', opts=OPTS, input='indexedFaceSet.cxx')
  5018. TargetAdd('p3vrmlegg_vrmlAppearance.obj', opts=OPTS, input='vrmlAppearance.cxx')
  5019. TargetAdd('p3vrmlegg_vrmlToEggConverter.obj', opts=OPTS, input='vrmlToEggConverter.cxx')
  5020. TargetAdd('libp3vrmlegg.lib', input='p3vrmlegg_indexedFaceSet.obj')
  5021. TargetAdd('libp3vrmlegg.lib', input='p3vrmlegg_vrmlAppearance.obj')
  5022. TargetAdd('libp3vrmlegg.lib', input='p3vrmlegg_vrmlToEggConverter.obj')
  5023. #
  5024. # DIRECTORY: pandatool/src/xfile/
  5025. #
  5026. if not PkgSkip("PANDATOOL"):
  5027. OPTS=['DIR:pandatool/src/xfile', 'ZLIB', 'BISONPREFIX_xyy', 'FLEXDASHI']
  5028. CreateFile(GetOutputDir() + "/include/xParser.h")
  5029. TargetAdd('p3xfile_xParser.obj', opts=OPTS, input='xParser.yxx')
  5030. TargetAdd('xParser.h', input='p3xfile_xParser.obj', opts=['DEPENDENCYONLY'])
  5031. TargetAdd('p3xfile_xLexer.obj', opts=OPTS, input='xLexer.lxx')
  5032. TargetAdd('p3xfile_composite1.obj', opts=OPTS, input='p3xfile_composite1.cxx')
  5033. TargetAdd('libp3xfile.lib', input='p3xfile_composite1.obj')
  5034. TargetAdd('libp3xfile.lib', input='p3xfile_xParser.obj')
  5035. TargetAdd('libp3xfile.lib', input='p3xfile_xLexer.obj')
  5036. #
  5037. # DIRECTORY: pandatool/src/xfileegg/
  5038. #
  5039. if not PkgSkip("PANDATOOL") and not PkgSkip("EGG"):
  5040. OPTS=['DIR:pandatool/src/xfileegg', 'DIR:pandatool/src/xfile']
  5041. TargetAdd('p3xfileegg_composite1.obj', opts=OPTS, input='p3xfileegg_composite1.cxx')
  5042. TargetAdd('libp3xfileegg.lib', input='p3xfileegg_composite1.obj')
  5043. #
  5044. # DIRECTORY: pandatool/src/ptloader/
  5045. #
  5046. if not PkgSkip("PANDATOOL") and not PkgSkip("EGG"):
  5047. if not PkgSkip("FCOLLADA"):
  5048. DefSymbol("FCOLLADA", "HAVE_FCOLLADA")
  5049. OPTS=['DIR:pandatool/src/ptloader', 'DIR:pandatool/src/flt', 'DIR:pandatool/src/lwo', 'DIR:pandatool/src/xfile', 'DIR:pandatool/src/xfileegg', 'DIR:pandatool/src/daeegg', 'BUILDING:PTLOADER', 'FCOLLADA']
  5050. TargetAdd('p3ptloader_config_ptloader.obj', opts=OPTS, input='config_ptloader.cxx', dep='dtool_have_fcollada.dat')
  5051. TargetAdd('p3ptloader_loaderFileTypePandatool.obj', opts=OPTS, input='loaderFileTypePandatool.cxx')
  5052. TargetAdd('libp3ptloader.dll', input='p3ptloader_config_ptloader.obj')
  5053. TargetAdd('libp3ptloader.dll', input='p3ptloader_loaderFileTypePandatool.obj')
  5054. TargetAdd('libp3ptloader.dll', input='libp3fltegg.lib')
  5055. TargetAdd('libp3ptloader.dll', input='libp3flt.lib')
  5056. TargetAdd('libp3ptloader.dll', input='libp3lwoegg.lib')
  5057. TargetAdd('libp3ptloader.dll', input='libp3lwo.lib')
  5058. TargetAdd('libp3ptloader.dll', input='libp3dxfegg.lib')
  5059. TargetAdd('libp3ptloader.dll', input='libp3dxf.lib')
  5060. TargetAdd('libp3ptloader.dll', input='libp3objegg.lib')
  5061. TargetAdd('libp3ptloader.dll', input='libp3vrmlegg.lib')
  5062. TargetAdd('libp3ptloader.dll', input='libp3vrml.lib')
  5063. TargetAdd('libp3ptloader.dll', input='libp3xfileegg.lib')
  5064. TargetAdd('libp3ptloader.dll', input='libp3xfile.lib')
  5065. if not PkgSkip("FCOLLADA"): TargetAdd('libp3ptloader.dll', input='libp3daeegg.lib')
  5066. TargetAdd('libp3ptloader.dll', input='libp3eggbase.lib')
  5067. TargetAdd('libp3ptloader.dll', input='libp3progbase.lib')
  5068. TargetAdd('libp3ptloader.dll', input='libp3converter.lib')
  5069. TargetAdd('libp3ptloader.dll', input='libp3pandatoolbase.lib')
  5070. TargetAdd('libp3ptloader.dll', input='libpandaegg.dll')
  5071. TargetAdd('libp3ptloader.dll', input=COMMON_PANDA_LIBS)
  5072. TargetAdd('libp3ptloader.dll', opts=['MODULE', 'ADVAPI', 'FCOLLADA', 'WINUSER'])
  5073. #
  5074. # DIRECTORY: pandatool/src/miscprogs/
  5075. #
  5076. # This is a bit of an esoteric tool, and it causes issues because
  5077. # it conflicts with tools of the same name in different packages.
  5078. #if not PkgSkip("PANDATOOL"):
  5079. # OPTS=['DIR:pandatool/src/miscprogs']
  5080. # TargetAdd('bin2c_binToC.obj', opts=OPTS, input='binToC.cxx')
  5081. # TargetAdd('bin2c.exe', input='bin2c_binToC.obj')
  5082. # TargetAdd('bin2c.exe', input='libp3progbase.lib')
  5083. # TargetAdd('bin2c.exe', input='libp3pandatoolbase.lib')
  5084. # TargetAdd('bin2c.exe', input=COMMON_PANDA_LIBS)
  5085. # TargetAdd('bin2c.exe', opts=['ADVAPI'])
  5086. #
  5087. # DIRECTORY: pandatool/src/pstatserver/
  5088. #
  5089. if not PkgSkip("PANDATOOL"):
  5090. OPTS=['DIR:pandatool/src/pstatserver']
  5091. TargetAdd('p3pstatserver_composite1.obj', opts=OPTS, input='p3pstatserver_composite1.cxx')
  5092. TargetAdd('libp3pstatserver.lib', input='p3pstatserver_composite1.obj')
  5093. #
  5094. # DIRECTORY: pandatool/src/text-stats/
  5095. #
  5096. if not PkgSkip("PANDATOOL"):
  5097. OPTS=['DIR:pandatool/src/text-stats']
  5098. TargetAdd('text-stats_textMonitor.obj', opts=OPTS, input='textMonitor.cxx')
  5099. TargetAdd('text-stats_textStats.obj', opts=OPTS, input='textStats.cxx')
  5100. TargetAdd('text-stats.exe', input='text-stats_textMonitor.obj')
  5101. TargetAdd('text-stats.exe', input='text-stats_textStats.obj')
  5102. TargetAdd('text-stats.exe', input='libp3progbase.lib')
  5103. TargetAdd('text-stats.exe', input='libp3pstatserver.lib')
  5104. TargetAdd('text-stats.exe', input='libp3pandatoolbase.lib')
  5105. TargetAdd('text-stats.exe', input=COMMON_PANDA_LIBS)
  5106. TargetAdd('text-stats.exe', opts=['ADVAPI'])
  5107. #
  5108. # DIRECTORY: pandatool/src/vrmlprogs/
  5109. #
  5110. if not PkgSkip("PANDATOOL"):
  5111. OPTS=['DIR:pandatool/src/vrmlprogs', 'DIR:pandatool/src/vrml', 'DIR:pandatool/src/vrmlegg']
  5112. TargetAdd('vrml-trans_vrmlTrans.obj', opts=OPTS, input='vrmlTrans.cxx')
  5113. TargetAdd('vrml-trans.exe', input='vrml-trans_vrmlTrans.obj')
  5114. TargetAdd('vrml-trans.exe', input='libp3vrml.lib')
  5115. TargetAdd('vrml-trans.exe', input='libp3progbase.lib')
  5116. TargetAdd('vrml-trans.exe', input='libp3pandatoolbase.lib')
  5117. TargetAdd('vrml-trans.exe', input=COMMON_PANDA_LIBS)
  5118. TargetAdd('vrml-trans.exe', opts=['ADVAPI'])
  5119. if not PkgSkip("EGG"):
  5120. TargetAdd('vrml2egg_vrmlToEgg.obj', opts=OPTS, input='vrmlToEgg.cxx')
  5121. TargetAdd('vrml2egg.exe', input='vrml2egg_vrmlToEgg.obj')
  5122. TargetAdd('vrml2egg.exe', input='libp3vrmlegg.lib')
  5123. TargetAdd('vrml2egg.exe', input='libp3vrml.lib')
  5124. TargetAdd('vrml2egg.exe', input=COMMON_EGG2X_LIBS)
  5125. TargetAdd('vrml2egg.exe', opts=['ADVAPI'])
  5126. #
  5127. # DIRECTORY: pandatool/src/win-stats/
  5128. # DIRECTORY: pandatool/src/gtk-stats/
  5129. #
  5130. if not PkgSkip("PANDATOOL") and (GetTarget() == 'windows' or not PkgSkip("GTK3")):
  5131. if GetTarget() == 'windows':
  5132. OPTS=['DIR:pandatool/src/win-stats']
  5133. TargetAdd('pstats_composite1.obj', opts=OPTS, input='winstats_composite1.cxx')
  5134. else:
  5135. OPTS=['DIR:pandatool/src/gtk-stats', 'GTK3']
  5136. TargetAdd('pstats_composite1.obj', opts=OPTS, input='gtkstats_composite1.cxx')
  5137. TargetAdd('pstats.exe', input='pstats_composite1.obj')
  5138. TargetAdd('pstats.exe', input='libp3pstatserver.lib')
  5139. TargetAdd('pstats.exe', input='libp3progbase.lib')
  5140. TargetAdd('pstats.exe', input='libp3pandatoolbase.lib')
  5141. TargetAdd('pstats.exe', input=COMMON_PANDA_LIBS)
  5142. TargetAdd('pstats.exe', opts=['SUBSYSTEM:WINDOWS', 'WINCOMCTL', 'WINSOCK', 'WINIMM', 'WINGDI', 'WINKERNEL', 'WINOLDNAMES', 'WINUSER', 'WINMM', 'GTK3'])
  5143. #
  5144. # DIRECTORY: pandatool/src/xfileprogs/
  5145. #
  5146. if not PkgSkip("PANDATOOL"):
  5147. OPTS=['DIR:pandatool/src/xfileprogs', 'DIR:pandatool/src/xfile', 'DIR:pandatool/src/xfileegg']
  5148. TargetAdd('x-trans_xFileTrans.obj', opts=OPTS, input='xFileTrans.cxx')
  5149. TargetAdd('x-trans.exe', input='x-trans_xFileTrans.obj')
  5150. TargetAdd('x-trans.exe', input='libp3progbase.lib')
  5151. TargetAdd('x-trans.exe', input='libp3xfile.lib')
  5152. TargetAdd('x-trans.exe', input='libp3pandatoolbase.lib')
  5153. TargetAdd('x-trans.exe', input=COMMON_PANDA_LIBS)
  5154. TargetAdd('x-trans.exe', opts=['ADVAPI'])
  5155. if not PkgSkip("EGG"):
  5156. TargetAdd('egg2x_eggToX.obj', opts=OPTS, input='eggToX.cxx')
  5157. TargetAdd('egg2x.exe', input='egg2x_eggToX.obj')
  5158. TargetAdd('egg2x.exe', input='libp3xfileegg.lib')
  5159. TargetAdd('egg2x.exe', input='libp3xfile.lib')
  5160. TargetAdd('egg2x.exe', input=COMMON_EGG2X_LIBS)
  5161. TargetAdd('egg2x.exe', opts=['ADVAPI'])
  5162. TargetAdd('x2egg_xFileToEgg.obj', opts=OPTS, input='xFileToEgg.cxx')
  5163. TargetAdd('x2egg.exe', input='x2egg_xFileToEgg.obj')
  5164. TargetAdd('x2egg.exe', input='libp3xfileegg.lib')
  5165. TargetAdd('x2egg.exe', input='libp3xfile.lib')
  5166. TargetAdd('x2egg.exe', input=COMMON_EGG2X_LIBS)
  5167. TargetAdd('x2egg.exe', opts=['ADVAPI'])
  5168. #
  5169. # DIRECTORY: pandatool/src/mayaprogs/
  5170. #
  5171. MAYA_BUILT = False
  5172. for VER in MAYAVERSIONS:
  5173. VNUM = VER[4:]
  5174. if PkgSkip(VER) or PkgSkip("PANDATOOL") or PkgSkip("EGG"):
  5175. continue
  5176. if GetTarget() == 'darwin':
  5177. if int(VNUM) < 2009:
  5178. # No x86_64 support.
  5179. continue
  5180. if tuple(OSX_ARCHS) == ('arm64',):
  5181. # No arm64 support.
  5182. continue
  5183. ARCH_OPTS = ['NOARCH:ARM64']
  5184. else:
  5185. ARCH_OPTS = []
  5186. MAYA_BUILT = True
  5187. OPTS=['DIR:pandatool/src/mayaprogs', 'DIR:pandatool/src/maya', 'DIR:pandatool/src/mayaegg', 'BUILDING:MISC', VER] + ARCH_OPTS
  5188. TargetAdd('mayaeggimport'+VNUM+'_mayaeggimport.obj', opts=OPTS, input='mayaEggImport.cxx')
  5189. TargetAdd('mayaeggimport'+VNUM+'.mll', input='mayaegg'+VNUM+'_loader.obj')
  5190. TargetAdd('mayaeggimport'+VNUM+'.mll', input='mayaeggimport'+VNUM+'_mayaeggimport.obj')
  5191. TargetAdd('mayaeggimport'+VNUM+'.mll', input='libpandaegg.dll')
  5192. TargetAdd('mayaeggimport'+VNUM+'.mll', input=COMMON_PANDA_LIBS)
  5193. TargetAdd('mayaeggimport'+VNUM+'.mll', opts=['ADVAPI', VER]+ARCH_OPTS)
  5194. TargetAdd('mayaloader'+VNUM+'_config_mayaloader.obj', opts=OPTS, input='config_mayaloader.cxx')
  5195. TargetAdd('libp3mayaloader'+VNUM+'.dll', input='mayaloader'+VNUM+'_config_mayaloader.obj')
  5196. TargetAdd('libp3mayaloader'+VNUM+'.dll', input='libmayaegg'+VNUM+'.lib')
  5197. TargetAdd('libp3mayaloader'+VNUM+'.dll', input='libp3ptloader.dll')
  5198. TargetAdd('libp3mayaloader'+VNUM+'.dll', input='libmaya'+VNUM+'.lib')
  5199. TargetAdd('libp3mayaloader'+VNUM+'.dll', input='libp3fltegg.lib')
  5200. TargetAdd('libp3mayaloader'+VNUM+'.dll', input='libp3flt.lib')
  5201. TargetAdd('libp3mayaloader'+VNUM+'.dll', input='libp3lwoegg.lib')
  5202. TargetAdd('libp3mayaloader'+VNUM+'.dll', input='libp3lwo.lib')
  5203. TargetAdd('libp3mayaloader'+VNUM+'.dll', input='libp3dxfegg.lib')
  5204. TargetAdd('libp3mayaloader'+VNUM+'.dll', input='libp3dxf.lib')
  5205. TargetAdd('libp3mayaloader'+VNUM+'.dll', input='libp3objegg.lib')
  5206. TargetAdd('libp3mayaloader'+VNUM+'.dll', input='libp3vrmlegg.lib')
  5207. TargetAdd('libp3mayaloader'+VNUM+'.dll', input='libp3vrml.lib')
  5208. TargetAdd('libp3mayaloader'+VNUM+'.dll', input='libp3xfileegg.lib')
  5209. TargetAdd('libp3mayaloader'+VNUM+'.dll', input='libp3xfile.lib')
  5210. TargetAdd('libp3mayaloader'+VNUM+'.dll', input='libp3eggbase.lib')
  5211. TargetAdd('libp3mayaloader'+VNUM+'.dll', input='libp3progbase.lib')
  5212. TargetAdd('libp3mayaloader'+VNUM+'.dll', input='libp3converter.lib')
  5213. TargetAdd('libp3mayaloader'+VNUM+'.dll', input='libp3pandatoolbase.lib')
  5214. TargetAdd('libp3mayaloader'+VNUM+'.dll', input='libpandaegg.dll')
  5215. TargetAdd('libp3mayaloader'+VNUM+'.dll', input=COMMON_PANDA_LIBS)
  5216. TargetAdd('libp3mayaloader'+VNUM+'.dll', opts=['ADVAPI', VER]+ARCH_OPTS)
  5217. TargetAdd('mayapview'+VNUM+'_mayaPview.obj', opts=OPTS, input='mayaPview.cxx')
  5218. TargetAdd('libmayapview'+VNUM+'.mll', input='mayapview'+VNUM+'_mayaPview.obj')
  5219. TargetAdd('libmayapview'+VNUM+'.mll', input='libmayaegg'+VNUM+'.lib')
  5220. TargetAdd('libmayapview'+VNUM+'.mll', input='libmaya'+VNUM+'.lib')
  5221. TargetAdd('libmayapview'+VNUM+'.mll', input='libp3framework.dll')
  5222. TargetAdd('libmayapview'+VNUM+'.mll', input=COMMON_EGG2X_LIBS)
  5223. TargetAdd('libmayapview'+VNUM+'.mll', opts=['ADVAPI', VER]+ARCH_OPTS)
  5224. TargetAdd('mayaprogs'+VNUM+'_eggToMaya.obj', opts=OPTS, input='eggToMaya.cxx')
  5225. TargetAdd('mayaprogs'+VNUM+'_mayaToEgg.obj', opts=OPTS, input='mayaToEgg.cxx')
  5226. TargetAdd('mayaprogs_mayaConversionServer.obj', opts=OPTS, input='mayaConversionServer.cxx')
  5227. TargetAdd('maya2egg'+VNUM+'_mayaToEggBin.obj', opts=OPTS, input='mayaToEggBin.cxx')
  5228. TargetAdd('maya2egg'+VNUM+'_bin.exe', input='mayaprogs'+VNUM+'_eggToMaya.obj')
  5229. TargetAdd('maya2egg'+VNUM+'_bin.exe', input='mayaprogs'+VNUM+'_mayaToEgg.obj')
  5230. TargetAdd('maya2egg'+VNUM+'_bin.exe', input='mayaprogs_mayaConversionServer.obj')
  5231. TargetAdd('maya2egg'+VNUM+'_bin.exe', input='maya2egg'+VNUM+'_mayaToEggBin.obj')
  5232. TargetAdd('maya2egg'+VNUM+'_bin.exe', input='libmayaegg'+VNUM+'.lib')
  5233. TargetAdd('maya2egg'+VNUM+'_bin.exe', input='libmaya'+VNUM+'.lib')
  5234. TargetAdd('maya2egg'+VNUM+'_bin.exe', input=COMMON_EGG2X_LIBS)
  5235. TargetAdd('maya2egg'+VNUM+'_bin.exe', opts=['ADVAPI', VER]+ARCH_OPTS)
  5236. TargetAdd('egg2maya'+VNUM+'_eggToMayaBin.obj', opts=OPTS, input='eggToMayaBin.cxx')
  5237. TargetAdd('egg2maya'+VNUM+'_bin.exe', input='mayaprogs'+VNUM+'_eggToMaya.obj')
  5238. TargetAdd('egg2maya'+VNUM+'_bin.exe', input='mayaprogs'+VNUM+'_mayaToEgg.obj')
  5239. TargetAdd('egg2maya'+VNUM+'_bin.exe', input='mayaprogs_mayaConversionServer.obj')
  5240. TargetAdd('egg2maya'+VNUM+'_bin.exe', input='egg2maya'+VNUM+'_eggToMayaBin.obj')
  5241. TargetAdd('egg2maya'+VNUM+'_bin.exe', input='libmayaegg'+VNUM+'.lib')
  5242. TargetAdd('egg2maya'+VNUM+'_bin.exe', input='libmaya'+VNUM+'.lib')
  5243. TargetAdd('egg2maya'+VNUM+'_bin.exe', input=COMMON_EGG2X_LIBS)
  5244. TargetAdd('egg2maya'+VNUM+'_bin.exe', opts=['ADVAPI', VER]+ARCH_OPTS)
  5245. TargetAdd('mayasavepview'+VNUM+'_mayaSavePview.obj', opts=OPTS, input='mayaSavePview.cxx')
  5246. TargetAdd('libmayasavepview'+VNUM+'.mll', input='mayasavepview'+VNUM+'_mayaSavePview.obj')
  5247. TargetAdd('libmayasavepview'+VNUM+'.mll', opts=['ADVAPI', VER]+ARCH_OPTS)
  5248. TargetAdd('mayapath'+VNUM+'.obj', opts=OPTS, input='mayapath.cxx')
  5249. TargetAdd('maya2egg'+VNUM+'.exe', input='mayapath'+VNUM+'.obj')
  5250. TargetAdd('maya2egg'+VNUM+'.exe', input='libpandaexpress.dll')
  5251. TargetAdd('maya2egg'+VNUM+'.exe', input=COMMON_DTOOL_LIBS)
  5252. TargetAdd('maya2egg'+VNUM+'.exe', opts=['ADVAPI']+ARCH_OPTS)
  5253. TargetAdd('egg2maya'+VNUM+'.exe', input='mayapath'+VNUM+'.obj')
  5254. TargetAdd('egg2maya'+VNUM+'.exe', input='libpandaexpress.dll')
  5255. TargetAdd('egg2maya'+VNUM+'.exe', input=COMMON_DTOOL_LIBS)
  5256. TargetAdd('egg2maya'+VNUM+'.exe', opts=['ADVAPI']+ARCH_OPTS)
  5257. if MAYA_BUILT:
  5258. TargetAdd('mayaprogs_mayaConversionClient.obj', opts=OPTS, input='mayaConversionClient.cxx')
  5259. TargetAdd('maya2egg_mayaToEggClient.obj', opts=OPTS, input='mayaToEggClient.cxx')
  5260. TargetAdd('maya2egg_client.exe', input='mayaprogs_mayaConversionClient.obj')
  5261. TargetAdd('maya2egg_client.exe', input='maya2egg_mayaToEggClient.obj')
  5262. TargetAdd('maya2egg_client.exe', input=COMMON_EGG2X_LIBS)
  5263. TargetAdd('egg2maya_eggToMayaClient.obj', opts=OPTS, input='eggToMayaClient.cxx')
  5264. TargetAdd('egg2maya_client.exe', input='mayaprogs_mayaConversionClient.obj')
  5265. TargetAdd('egg2maya_client.exe', input='egg2maya_eggToMayaClient.obj')
  5266. TargetAdd('egg2maya_client.exe', input=COMMON_EGG2X_LIBS)
  5267. #
  5268. # DIRECTORY: contrib/src/ai/
  5269. #
  5270. if not PkgSkip("CONTRIB"):
  5271. OPTS=['DIR:contrib/src/ai', 'BUILDING:PANDAAI']
  5272. TargetAdd('p3ai_composite1.obj', opts=OPTS, input='p3ai_composite1.cxx')
  5273. TargetAdd('libpandaai.dll', input='p3ai_composite1.obj')
  5274. TargetAdd('libpandaai.dll', input=COMMON_PANDA_LIBS)
  5275. OPTS=['DIR:contrib/src/ai']
  5276. IGATEFILES=GetDirectoryContents('contrib/src/ai', ["*.h", "*_composite*.cxx"])
  5277. TargetAdd('libpandaai.in', opts=OPTS, input=IGATEFILES)
  5278. TargetAdd('libpandaai.in', opts=['IMOD:panda3d.ai', 'ILIB:libpandaai', 'SRCDIR:contrib/src/ai'])
  5279. PyTargetAdd('ai_module.obj', input='libpandaai.in')
  5280. PyTargetAdd('ai_module.obj', opts=OPTS)
  5281. PyTargetAdd('ai_module.obj', opts=['IMOD:panda3d.ai', 'ILIB:ai', 'IMPORT:panda3d.core'])
  5282. PyTargetAdd('ai.pyd', input='ai_module.obj')
  5283. PyTargetAdd('ai.pyd', input='libpandaai_igate.obj')
  5284. PyTargetAdd('ai.pyd', input='libpandaai.dll')
  5285. PyTargetAdd('ai.pyd', input='libp3interrogatedb.dll')
  5286. PyTargetAdd('ai.pyd', input=COMMON_PANDA_LIBS)
  5287. #
  5288. # DIRECTORY: contrib/src/rplight/
  5289. #
  5290. if not PkgSkip("CONTRIB") and not PkgSkip("PYTHON"):
  5291. OPTS=['DIR:contrib/src/rplight', 'BUILDING:RPLIGHT']
  5292. TargetAdd('p3rplight_composite1.obj', opts=OPTS, input='p3rplight_composite1.cxx')
  5293. IGATEFILES=GetDirectoryContents('contrib/src/rplight', ["*.h", "*_composite*.cxx"])
  5294. TargetAdd('libp3rplight.in', opts=OPTS, input=IGATEFILES)
  5295. TargetAdd('libp3rplight.in', opts=['IMOD:panda3d._rplight', 'ILIB:libp3rplight', 'SRCDIR:contrib/src/rplight'])
  5296. PyTargetAdd('rplight_module.obj', input='libp3rplight.in')
  5297. PyTargetAdd('rplight_module.obj', opts=OPTS)
  5298. PyTargetAdd('rplight_module.obj', opts=['IMOD:panda3d._rplight', 'ILIB:_rplight', 'IMPORT:panda3d.core'])
  5299. PyTargetAdd('_rplight.pyd', input='rplight_module.obj')
  5300. PyTargetAdd('_rplight.pyd', input='libp3rplight_igate.obj')
  5301. PyTargetAdd('_rplight.pyd', input='p3rplight_composite1.obj')
  5302. PyTargetAdd('_rplight.pyd', input='libp3interrogatedb.dll')
  5303. PyTargetAdd('_rplight.pyd', input=COMMON_PANDA_LIBS)
  5304. #
  5305. # DIRECTORY: pandatool/src/deploy-stub
  5306. #
  5307. if PkgSkip("PYTHON") == 0:
  5308. OPTS=['DIR:pandatool/src/deploy-stub', 'BUILDING:DEPLOYSTUB']
  5309. PyTargetAdd('deploy-stub.obj', opts=OPTS, input='deploy-stub.c')
  5310. if GetTarget() == 'windows':
  5311. PyTargetAdd('frozen_dllmain.obj', opts=OPTS, input='frozen_dllmain.c')
  5312. if GetTarget() == 'linux' or GetTarget() == 'freebsd':
  5313. # Setup rpath so libs can be found in the same directory as the deployed game
  5314. LibName('DEPLOYSTUB', "-Wl,-rpath,\\$ORIGIN")
  5315. LibName('DEPLOYSTUB', "-Wl,-z,origin")
  5316. LibName('DEPLOYSTUB', "-rdynamic")
  5317. PyTargetAdd('deploy-stub.exe', input='deploy-stub.obj')
  5318. if GetTarget() == 'windows':
  5319. PyTargetAdd('deploy-stub.exe', input='frozen_dllmain.obj')
  5320. PyTargetAdd('deploy-stub.exe', opts=['WINSHELL', 'DEPLOYSTUB', 'NOICON', 'ANDROID'])
  5321. if GetTarget() == 'windows':
  5322. PyTargetAdd('deploy-stubw.exe', input='deploy-stub.obj')
  5323. PyTargetAdd('deploy-stubw.exe', input='frozen_dllmain.obj')
  5324. PyTargetAdd('deploy-stubw.exe', opts=['SUBSYSTEM:WINDOWS', 'WINSHELL', 'DEPLOYSTUB', 'NOICON'])
  5325. elif GetTarget() == 'darwin':
  5326. DefSymbol('MACOS_APP_BUNDLE', 'MACOS_APP_BUNDLE')
  5327. OPTS = OPTS + ['MACOS_APP_BUNDLE']
  5328. PyTargetAdd('deploy-stubw.obj', opts=OPTS, input='deploy-stub.c')
  5329. PyTargetAdd('deploy-stubw.exe', input='deploy-stubw.obj')
  5330. PyTargetAdd('deploy-stubw.exe', opts=['MACOS_APP_BUNDLE', 'DEPLOYSTUB', 'NOICON'])
  5331. elif GetTarget() == 'android':
  5332. PyTargetAdd('deploy-stubw_android_main.obj', opts=OPTS, input='android_main.cxx')
  5333. PyTargetAdd('deploy-stubw_android_log.obj', opts=OPTS, input='android_log.c')
  5334. PyTargetAdd('libdeploy-stubw.dll', input='android_native_app_glue.obj')
  5335. PyTargetAdd('libdeploy-stubw.dll', input='deploy-stubw_android_main.obj')
  5336. PyTargetAdd('libdeploy-stubw.dll', input='deploy-stubw_android_log.obj')
  5337. PyTargetAdd('libdeploy-stubw.dll', input=COMMON_PANDA_LIBS)
  5338. PyTargetAdd('libdeploy-stubw.dll', input='libp3android.dll')
  5339. PyTargetAdd('libdeploy-stubw.dll', opts=['DEPLOYSTUB', 'ANDROID'])
  5340. #
  5341. # Generate the models directory and samples directory
  5342. #
  5343. if not PkgSkip("DIRECT") and not PkgSkip("EGG"):
  5344. model_extensions = ["*.egg"]
  5345. for model in GetDirectoryContents("models/misc", model_extensions):
  5346. if not PkgSkip("ZLIB") and not PkgSkip("DEPLOYTOOLS"):
  5347. newname = model[:-4] + ".egg.pz"
  5348. else:
  5349. newname = model[:-4] + ".egg"
  5350. TargetAdd(GetOutputDir()+"/models/misc/"+newname, input="models/misc/"+model)
  5351. for model in GetDirectoryContents("models/gui", model_extensions):
  5352. if not PkgSkip("ZLIB") and not PkgSkip("DEPLOYTOOLS"):
  5353. newname = model[:-4] + ".egg.pz"
  5354. else:
  5355. newname = model[:-4] + ".egg"
  5356. TargetAdd(GetOutputDir()+"/models/gui/"+newname, input="models/gui/"+model)
  5357. for model in GetDirectoryContents("models", model_extensions):
  5358. if not PkgSkip("ZLIB") and not PkgSkip("DEPLOYTOOLS"):
  5359. newname = model[:-4] + ".egg.pz"
  5360. else:
  5361. newname = model[:-4] + ".egg"
  5362. TargetAdd(GetOutputDir()+"/models/"+newname, input="models/"+model)
  5363. if not PkgSkip("DIRECT"):
  5364. CopyAllFiles(GetOutputDir()+"/models/audio/sfx/", "models/audio/sfx/", ".wav")
  5365. CopyAllFiles(GetOutputDir()+"/models/icons/", "models/icons/", ".gif")
  5366. CopyAllFiles(GetOutputDir()+"/models/maps/", "models/maps/", ".jpg")
  5367. CopyAllFiles(GetOutputDir()+"/models/maps/", "models/maps/", ".png")
  5368. CopyAllFiles(GetOutputDir()+"/models/maps/", "models/maps/", ".rgb")
  5369. CopyAllFiles(GetOutputDir()+"/models/maps/", "models/maps/", ".rgba")
  5370. ##########################################################################################
  5371. #
  5372. # Dependency-Based Distributed Build System.
  5373. #
  5374. ##########################################################################################
  5375. DEPENDENCYQUEUE=[]
  5376. for target in TARGET_LIST:
  5377. name = target.name
  5378. inputs = target.inputs
  5379. opts = target.opts
  5380. deps = target.deps
  5381. DEPENDENCYQUEUE.append([CompileAnything, [name, inputs, opts], [name], deps, []])
  5382. def BuildWorker(taskqueue, donequeue):
  5383. while True:
  5384. try:
  5385. task = taskqueue.get(timeout=1)
  5386. except:
  5387. ProgressOutput(None, "Waiting for tasks...")
  5388. task = taskqueue.get()
  5389. sys.stdout.flush()
  5390. if task == 0:
  5391. return
  5392. try:
  5393. task[0](*task[1])
  5394. donequeue.put(task)
  5395. except:
  5396. donequeue.put(0)
  5397. def AllSourcesReady(task, pending):
  5398. sources = task[3]
  5399. for x in sources:
  5400. if x in pending:
  5401. return False
  5402. sources = task[1][1]
  5403. for x in sources:
  5404. if x in pending:
  5405. return False
  5406. altsources = task[4]
  5407. for x in altsources:
  5408. if x in pending:
  5409. return False
  5410. return True
  5411. def ParallelMake(tasklist):
  5412. # Create the communication queues.
  5413. donequeue = queue.Queue()
  5414. taskqueue = queue.Queue()
  5415. # Build up a table listing all the pending targets
  5416. #task = [CompileAnything, [name, inputs, opts], [name], deps, []]
  5417. # task[2] = [name]
  5418. # task[3] = deps
  5419. pending = {}
  5420. for task in tasklist:
  5421. for target in task[2]:
  5422. pending[target] = 1
  5423. # Create the workers
  5424. for slave in range(THREADCOUNT):
  5425. th = threading.Thread(target=BuildWorker, args=[taskqueue, donequeue])
  5426. th.daemon = True
  5427. th.start()
  5428. # Feed tasks to the workers.
  5429. tasksqueued = 0
  5430. while True:
  5431. if tasksqueued < THREADCOUNT:
  5432. extras = []
  5433. for task in tasklist:
  5434. if tasksqueued < THREADCOUNT and AllSourcesReady(task, pending):
  5435. if NeedsBuild(task[2], task[3]):
  5436. tasksqueued += 1
  5437. taskqueue.put(task)
  5438. else:
  5439. for target in task[2]:
  5440. del pending[target]
  5441. else:
  5442. extras.append(task)
  5443. tasklist = extras
  5444. sys.stdout.flush()
  5445. if tasksqueued == 0:
  5446. break
  5447. donetask = donequeue.get()
  5448. if donetask == 0:
  5449. exit("Build process aborting.")
  5450. sys.stdout.flush()
  5451. tasksqueued -= 1
  5452. JustBuilt(donetask[2], donetask[3])
  5453. for target in donetask[2]:
  5454. del pending[target]
  5455. # Kill the workers.
  5456. for slave in range(THREADCOUNT):
  5457. taskqueue.put(0)
  5458. # Make sure there aren't any unsatisfied tasks
  5459. if len(tasklist) > 0:
  5460. exit("Dependency problems: {0} tasks not finished. First task unsatisfied: {1}".format(len(tasklist), tasklist[0][2]))
  5461. def SequentialMake(tasklist):
  5462. i = 0
  5463. for task in tasklist:
  5464. if NeedsBuild(task[2], task[3]):
  5465. task[0](*task[1] + [(i * 100.0) / len(tasklist)])
  5466. JustBuilt(task[2], task[3])
  5467. i += 1
  5468. def RunDependencyQueue(tasklist):
  5469. if THREADCOUNT != 0:
  5470. ParallelMake(tasklist)
  5471. else:
  5472. SequentialMake(tasklist)
  5473. try:
  5474. RunDependencyQueue(DEPENDENCYQUEUE)
  5475. finally:
  5476. SaveDependencyCache()
  5477. # Run the test suite.
  5478. if RUNTESTS:
  5479. cmdstr = BracketNameWithQuotes(SDK["PYTHONEXEC"].replace('\\', '/'))
  5480. cmdstr += " -B -m pytest tests"
  5481. if GetVerbose():
  5482. cmdstr += " --verbose"
  5483. oscmd(cmdstr)
  5484. # Write out information about the Python versions in the built dir.
  5485. python_version_info = GetCurrentPythonVersionInfo()
  5486. UpdatePythonVersionInfoFile(python_version_info)
  5487. ##########################################################################################
  5488. #
  5489. # The Installers
  5490. #
  5491. # Under windows, we can build an 'exe' package using NSIS
  5492. # Under linux, we can build a 'deb' package or an 'rpm' package.
  5493. # Under OSX, we can make a 'dmg' package.
  5494. #
  5495. ##########################################################################################
  5496. if INSTALLER:
  5497. ProgressOutput(100.0, "Building installer")
  5498. from makepackage import MakeInstaller
  5499. # When using the --installer flag, only install for the current version.
  5500. python_versions = []
  5501. if python_version_info:
  5502. python_versions.append(python_version_info)
  5503. MakeInstaller(version=VERSION, outputdir=GetOutputDir(),
  5504. optimize=GetOptimize(), compressor=COMPRESSOR,
  5505. debversion=DEBVERSION, rpmversion=RPMVERSION,
  5506. rpmrelease=RPMRELEASE, python_versions=python_versions)
  5507. if WHEEL:
  5508. ProgressOutput(100.0, "Building wheel")
  5509. from makewheel import makewheel
  5510. makewheel(WHLVERSION, GetOutputDir())
  5511. ##########################################################################################
  5512. #
  5513. # Print final status report.
  5514. #
  5515. ##########################################################################################
  5516. WARNINGS.append("Elapsed Time: "+PrettyTime(time.time() - STARTTIME))
  5517. printStatus("Makepanda Final Status Report", WARNINGS)
  5518. print(GetColor("green") + "Build successfully finished, elapsed time: " + PrettyTime(time.time() - STARTTIME) + GetColor())