makepanda.py 266 KB

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