makepanda.py 314 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370237123722373237423752376237723782379238023812382238323842385238623872388238923902391239223932394239523962397239823992400240124022403240424052406240724082409241024112412241324142415241624172418241924202421242224232424242524262427242824292430243124322433243424352436243724382439244024412442244324442445244624472448244924502451245224532454245524562457245824592460246124622463246424652466246724682469247024712472247324742475247624772478247924802481248224832484248524862487248824892490249124922493249424952496249724982499250025012502250325042505250625072508250925102511251225132514251525162517251825192520252125222523252425252526252725282529253025312532253325342535253625372538253925402541254225432544254525462547254825492550255125522553255425552556255725582559256025612562256325642565256625672568256925702571257225732574257525762577257825792580258125822583258425852586258725882589259025912592259325942595259625972598259926002601260226032604260526062607260826092610261126122613261426152616261726182619262026212622262326242625262626272628262926302631263226332634263526362637263826392640264126422643264426452646264726482649265026512652265326542655265626572658265926602661266226632664266526662667266826692670267126722673267426752676267726782679268026812682268326842685268626872688268926902691269226932694269526962697269826992700270127022703270427052706270727082709271027112712271327142715271627172718271927202721272227232724272527262727272827292730273127322733273427352736273727382739274027412742274327442745274627472748274927502751275227532754275527562757275827592760276127622763276427652766276727682769277027712772277327742775277627772778277927802781278227832784278527862787278827892790279127922793279427952796279727982799280028012802280328042805280628072808280928102811281228132814281528162817281828192820282128222823282428252826282728282829283028312832283328342835283628372838283928402841284228432844284528462847284828492850285128522853285428552856285728582859286028612862286328642865286628672868286928702871287228732874287528762877287828792880288128822883288428852886288728882889289028912892289328942895289628972898289929002901290229032904290529062907290829092910291129122913291429152916291729182919292029212922292329242925292629272928292929302931293229332934293529362937293829392940294129422943294429452946294729482949295029512952295329542955295629572958295929602961296229632964296529662967296829692970297129722973297429752976297729782979298029812982298329842985298629872988298929902991299229932994299529962997299829993000300130023003300430053006300730083009301030113012301330143015301630173018301930203021302230233024302530263027302830293030303130323033303430353036303730383039304030413042304330443045304630473048304930503051305230533054305530563057305830593060306130623063306430653066306730683069307030713072307330743075307630773078307930803081308230833084308530863087308830893090309130923093309430953096309730983099310031013102310331043105310631073108310931103111311231133114311531163117311831193120312131223123312431253126312731283129313031313132313331343135313631373138313931403141314231433144314531463147314831493150315131523153315431553156315731583159316031613162316331643165316631673168316931703171317231733174317531763177317831793180318131823183318431853186318731883189319031913192319331943195319631973198319932003201320232033204320532063207320832093210321132123213321432153216321732183219322032213222322332243225322632273228322932303231323232333234323532363237323832393240324132423243324432453246324732483249325032513252325332543255325632573258325932603261326232633264326532663267326832693270327132723273327432753276327732783279328032813282328332843285328632873288328932903291329232933294329532963297329832993300330133023303330433053306330733083309331033113312331333143315331633173318331933203321332233233324332533263327332833293330333133323333333433353336333733383339334033413342334333443345334633473348334933503351335233533354335533563357335833593360336133623363336433653366336733683369337033713372337333743375337633773378337933803381338233833384338533863387338833893390339133923393339433953396339733983399340034013402340334043405340634073408340934103411341234133414341534163417341834193420342134223423342434253426342734283429343034313432343334343435343634373438343934403441344234433444344534463447344834493450345134523453345434553456345734583459346034613462346334643465346634673468346934703471347234733474347534763477347834793480348134823483348434853486348734883489349034913492349334943495349634973498349935003501350235033504350535063507350835093510351135123513351435153516351735183519352035213522352335243525352635273528352935303531353235333534353535363537353835393540354135423543354435453546354735483549355035513552355335543555355635573558355935603561356235633564356535663567356835693570357135723573357435753576357735783579358035813582358335843585358635873588358935903591359235933594359535963597359835993600360136023603360436053606360736083609361036113612361336143615361636173618361936203621362236233624362536263627362836293630363136323633363436353636363736383639364036413642364336443645364636473648364936503651365236533654365536563657365836593660366136623663366436653666366736683669367036713672367336743675367636773678367936803681368236833684368536863687368836893690369136923693369436953696369736983699370037013702370337043705370637073708370937103711371237133714371537163717371837193720372137223723372437253726372737283729373037313732373337343735373637373738373937403741374237433744374537463747374837493750375137523753375437553756375737583759376037613762376337643765376637673768376937703771377237733774377537763777377837793780378137823783378437853786378737883789379037913792379337943795379637973798379938003801380238033804380538063807380838093810381138123813381438153816381738183819382038213822382338243825382638273828382938303831383238333834383538363837383838393840384138423843384438453846384738483849385038513852385338543855385638573858385938603861386238633864386538663867386838693870387138723873387438753876387738783879388038813882388338843885388638873888388938903891389238933894389538963897389838993900390139023903390439053906390739083909391039113912391339143915391639173918391939203921392239233924392539263927392839293930393139323933393439353936393739383939394039413942394339443945394639473948394939503951395239533954395539563957395839593960396139623963396439653966396739683969397039713972397339743975397639773978397939803981398239833984398539863987398839893990399139923993399439953996399739983999400040014002400340044005400640074008400940104011401240134014401540164017401840194020402140224023402440254026402740284029403040314032403340344035403640374038403940404041404240434044404540464047404840494050405140524053405440554056405740584059406040614062406340644065406640674068406940704071407240734074407540764077407840794080408140824083408440854086408740884089409040914092409340944095409640974098409941004101410241034104410541064107410841094110411141124113411441154116411741184119412041214122412341244125412641274128412941304131413241334134413541364137413841394140414141424143414441454146414741484149415041514152415341544155415641574158415941604161416241634164416541664167416841694170417141724173417441754176417741784179418041814182418341844185418641874188418941904191419241934194419541964197419841994200420142024203420442054206420742084209421042114212421342144215421642174218421942204221422242234224422542264227422842294230423142324233423442354236423742384239424042414242424342444245424642474248424942504251425242534254425542564257425842594260426142624263426442654266426742684269427042714272427342744275427642774278427942804281428242834284428542864287428842894290429142924293429442954296429742984299430043014302430343044305430643074308430943104311431243134314431543164317431843194320432143224323432443254326432743284329433043314332433343344335433643374338433943404341434243434344434543464347434843494350435143524353435443554356435743584359436043614362436343644365436643674368436943704371437243734374437543764377437843794380438143824383438443854386438743884389439043914392439343944395439643974398439944004401440244034404440544064407440844094410441144124413441444154416441744184419442044214422442344244425442644274428442944304431443244334434443544364437443844394440444144424443444444454446444744484449445044514452445344544455445644574458445944604461446244634464446544664467446844694470447144724473447444754476447744784479448044814482448344844485448644874488448944904491449244934494449544964497449844994500450145024503450445054506450745084509451045114512451345144515451645174518451945204521452245234524452545264527452845294530453145324533453445354536453745384539454045414542454345444545454645474548454945504551455245534554455545564557455845594560456145624563456445654566456745684569457045714572457345744575457645774578457945804581458245834584458545864587458845894590459145924593459445954596459745984599460046014602460346044605460646074608460946104611461246134614461546164617461846194620462146224623462446254626462746284629463046314632463346344635463646374638463946404641464246434644464546464647464846494650465146524653465446554656465746584659466046614662466346644665466646674668466946704671467246734674467546764677467846794680468146824683468446854686468746884689469046914692469346944695469646974698469947004701470247034704470547064707470847094710471147124713471447154716471747184719472047214722472347244725472647274728472947304731473247334734473547364737473847394740474147424743474447454746474747484749475047514752475347544755475647574758475947604761476247634764476547664767476847694770477147724773477447754776477747784779478047814782478347844785478647874788478947904791479247934794479547964797479847994800480148024803480448054806480748084809481048114812481348144815481648174818481948204821482248234824482548264827482848294830483148324833483448354836483748384839484048414842484348444845484648474848484948504851485248534854485548564857485848594860486148624863486448654866486748684869487048714872487348744875487648774878487948804881488248834884488548864887488848894890489148924893489448954896489748984899490049014902490349044905490649074908490949104911491249134914491549164917491849194920492149224923492449254926492749284929493049314932493349344935493649374938493949404941494249434944494549464947494849494950495149524953495449554956495749584959496049614962496349644965496649674968496949704971497249734974497549764977497849794980498149824983498449854986498749884989499049914992499349944995499649974998499950005001500250035004500550065007500850095010501150125013501450155016501750185019502050215022502350245025502650275028502950305031503250335034503550365037503850395040504150425043504450455046504750485049505050515052505350545055505650575058505950605061506250635064506550665067506850695070507150725073507450755076507750785079508050815082508350845085508650875088508950905091509250935094509550965097509850995100510151025103510451055106510751085109511051115112511351145115511651175118511951205121512251235124512551265127512851295130513151325133513451355136513751385139514051415142514351445145514651475148514951505151515251535154515551565157515851595160516151625163516451655166516751685169517051715172517351745175517651775178517951805181518251835184518551865187518851895190519151925193519451955196519751985199520052015202520352045205520652075208520952105211521252135214521552165217521852195220522152225223522452255226522752285229523052315232523352345235523652375238523952405241524252435244524552465247524852495250525152525253525452555256525752585259526052615262526352645265526652675268526952705271527252735274527552765277527852795280528152825283528452855286528752885289529052915292529352945295529652975298529953005301530253035304530553065307530853095310531153125313531453155316531753185319532053215322532353245325532653275328532953305331533253335334533553365337533853395340534153425343534453455346534753485349535053515352535353545355535653575358535953605361536253635364536553665367536853695370537153725373537453755376537753785379538053815382538353845385538653875388538953905391539253935394539553965397539853995400540154025403540454055406540754085409541054115412541354145415541654175418541954205421542254235424542554265427542854295430543154325433543454355436543754385439544054415442544354445445544654475448544954505451545254535454545554565457545854595460546154625463546454655466546754685469547054715472547354745475547654775478547954805481548254835484548554865487548854895490549154925493549454955496549754985499550055015502550355045505550655075508550955105511551255135514551555165517551855195520552155225523552455255526552755285529553055315532553355345535553655375538553955405541554255435544554555465547554855495550555155525553555455555556555755585559556055615562556355645565556655675568556955705571557255735574557555765577557855795580558155825583558455855586558755885589559055915592559355945595559655975598559956005601560256035604560556065607560856095610561156125613561456155616561756185619562056215622562356245625562656275628562956305631563256335634563556365637563856395640564156425643564456455646564756485649565056515652565356545655565656575658565956605661566256635664566556665667566856695670567156725673567456755676567756785679568056815682568356845685568656875688568956905691569256935694569556965697569856995700570157025703570457055706570757085709571057115712571357145715571657175718571957205721572257235724572557265727572857295730573157325733573457355736573757385739574057415742574357445745574657475748574957505751575257535754575557565757575857595760576157625763576457655766576757685769577057715772577357745775577657775778577957805781578257835784578557865787578857895790579157925793579457955796579757985799580058015802580358045805580658075808580958105811581258135814581558165817581858195820582158225823582458255826582758285829583058315832583358345835583658375838583958405841584258435844584558465847584858495850585158525853585458555856585758585859586058615862586358645865586658675868586958705871587258735874587558765877587858795880588158825883588458855886588758885889589058915892589358945895589658975898589959005901590259035904590559065907590859095910591159125913591459155916591759185919592059215922592359245925592659275928592959305931593259335934593559365937593859395940594159425943594459455946594759485949595059515952595359545955595659575958595959605961596259635964596559665967596859695970597159725973597459755976597759785979598059815982598359845985598659875988598959905991599259935994599559965997599859996000600160026003600460056006600760086009601060116012601360146015601660176018601960206021602260236024602560266027602860296030603160326033603460356036603760386039604060416042604360446045604660476048604960506051605260536054605560566057605860596060606160626063606460656066606760686069607060716072607360746075607660776078607960806081608260836084608560866087608860896090609160926093609460956096609760986099610061016102610361046105610661076108610961106111611261136114611561166117611861196120612161226123612461256126612761286129613061316132613361346135613661376138613961406141614261436144614561466147614861496150615161526153615461556156615761586159616061616162616361646165616661676168616961706171617261736174617561766177617861796180618161826183618461856186618761886189619061916192619361946195619661976198619962006201620262036204620562066207620862096210621162126213621462156216621762186219622062216222622362246225622662276228622962306231623262336234623562366237623862396240624162426243624462456246624762486249625062516252625362546255625662576258625962606261626262636264626562666267626862696270627162726273627462756276627762786279628062816282628362846285628662876288628962906291629262936294629562966297629862996300630163026303630463056306630763086309631063116312631363146315631663176318631963206321632263236324632563266327632863296330633163326333633463356336633763386339634063416342634363446345634663476348634963506351635263536354635563566357635863596360636163626363636463656366636763686369637063716372637363746375637663776378637963806381638263836384638563866387638863896390639163926393639463956396639763986399640064016402640364046405640664076408640964106411641264136414641564166417641864196420642164226423642464256426642764286429643064316432643364346435643664376438643964406441644264436444644564466447644864496450645164526453645464556456645764586459646064616462646364646465646664676468646964706471647264736474647564766477647864796480648164826483648464856486648764886489649064916492649364946495649664976498649965006501650265036504650565066507650865096510651165126513651465156516651765186519652065216522652365246525652665276528652965306531653265336534653565366537653865396540654165426543654465456546654765486549655065516552655365546555655665576558655965606561656265636564656565666567656865696570657165726573657465756576657765786579658065816582658365846585658665876588658965906591659265936594659565966597659865996600660166026603660466056606660766086609661066116612661366146615661666176618661966206621662266236624662566266627662866296630663166326633663466356636663766386639664066416642664366446645664666476648664966506651665266536654665566566657665866596660666166626663666466656666666766686669667066716672667366746675667666776678667966806681668266836684668566866687668866896690669166926693669466956696669766986699670067016702670367046705670667076708670967106711671267136714671567166717671867196720672167226723672467256726672767286729673067316732673367346735673667376738673967406741674267436744674567466747674867496750675167526753675467556756675767586759676067616762676367646765676667676768676967706771677267736774677567766777677867796780678167826783678467856786678767886789679067916792679367946795679667976798679968006801680268036804680568066807680868096810681168126813681468156816681768186819682068216822682368246825682668276828682968306831683268336834683568366837683868396840684168426843684468456846684768486849685068516852685368546855685668576858685968606861686268636864686568666867686868696870687168726873687468756876687768786879688068816882688368846885688668876888688968906891689268936894689568966897689868996900690169026903690469056906690769086909691069116912691369146915691669176918691969206921692269236924692569266927692869296930693169326933693469356936693769386939694069416942694369446945694669476948694969506951695269536954695569566957695869596960696169626963696469656966696769686969697069716972697369746975697669776978697969806981698269836984698569866987698869896990699169926993699469956996699769986999700070017002700370047005700670077008700970107011701270137014701570167017701870197020702170227023702470257026702770287029703070317032703370347035703670377038703970407041704270437044704570467047704870497050705170527053705470557056705770587059706070617062706370647065706670677068706970707071707270737074707570767077707870797080708170827083708470857086708770887089709070917092709370947095709670977098709971007101710271037104710571067107710871097110711171127113711471157116711771187119712071217122712371247125712671277128712971307131713271337134713571367137713871397140714171427143714471457146714771487149715071517152715371547155715671577158715971607161716271637164716571667167716871697170717171727173717471757176717771787179718071817182718371847185718671877188718971907191719271937194719571967197719871997200720172027203720472057206
  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. try:
  11. import sys, os, platform, time, stat, re, getopt, threading, signal, shutil
  12. if sys.platform == "darwin" or sys.version_info >= (2, 6):
  13. import plistlib
  14. if sys.version_info >= (3, 0):
  15. import queue
  16. else:
  17. import Queue as 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. RTDIST=0
  50. RTDIST_VERSION=None
  51. RUNTIME=0
  52. DISTRIBUTOR=""
  53. VERSION=None
  54. DEBVERSION=None
  55. WHLVERSION=None
  56. RPMRELEASE="1"
  57. GIT_COMMIT=None
  58. P3DSUFFIX=None
  59. MAJOR_VERSION=None
  60. COREAPI_VERSION=None
  61. PLUGIN_VERSION=None
  62. OSXTARGET=None
  63. OSX_ARCHS=[]
  64. HOST_URL=None
  65. global STRDXSDKVERSION, BOOUSEINTELCOMPILER
  66. STRDXSDKVERSION = 'default'
  67. WINDOWS_SDK = None
  68. MSVC_VERSION = None
  69. BOOUSEINTELCOMPILER = False
  70. OPENCV_VER_23 = False
  71. PLATFORM = None
  72. COPY_PYTHON = True
  73. if "MACOSX_DEPLOYMENT_TARGET" in os.environ:
  74. OSXTARGET=os.environ["MACOSX_DEPLOYMENT_TARGET"]
  75. PkgListSet(["PYTHON", "DIRECT", # Python support
  76. "GL", "GLES", "GLES2"] + DXVERSIONS + ["TINYDISPLAY", "NVIDIACG", # 3D graphics
  77. "EGL", # OpenGL (ES) integration
  78. "EIGEN", # Linear algebra acceleration
  79. "OPENAL", "FMODEX", # Audio playback
  80. "VORBIS", "OPUS", "FFMPEG", "SWSCALE", "SWRESAMPLE", # Audio decoding
  81. "ODE", "PHYSX", "BULLET", "PANDAPHYSICS", # Physics
  82. "SPEEDTREE", # SpeedTree
  83. "ZLIB", "PNG", "JPEG", "TIFF", "OPENEXR", "SQUISH", # 2D Formats support
  84. ] + MAYAVERSIONS + MAXVERSIONS + [ "FCOLLADA", "ASSIMP", "EGG", # 3D Formats support
  85. "FREETYPE", "HARFBUZZ", # Text rendering
  86. "VRPN", "OPENSSL", # Transport
  87. "FFTW", # Algorithm helpers
  88. "ARTOOLKIT", "OPENCV", "DIRECTCAM", "VISION", # Augmented Reality
  89. "GTK2", # GTK2 is used for PStats on Unix
  90. "MFC", "WX", "FLTK", # Used for web plug-in only
  91. "ROCKET", # GUI libraries
  92. "CARBON", "COCOA", # macOS toolkits
  93. "X11", # Unix platform support
  94. "PANDATOOL", "PVIEW", "DEPLOYTOOLS", # Toolchain
  95. "SKEL", # Example SKEL project
  96. "PANDAFX", # Some distortion special lenses
  97. "PANDAPARTICLESYSTEM", # Built in particle system
  98. "CONTRIB", # Experimental
  99. "SSE2", "NEON", # Compiler features
  100. ])
  101. CheckPandaSourceTree()
  102. def keyboardInterruptHandler(x,y):
  103. exit("keyboard interrupt")
  104. signal.signal(signal.SIGINT, keyboardInterruptHandler)
  105. ########################################################################
  106. ##
  107. ## Command-line parser.
  108. ##
  109. ## You can type "makepanda --help" to see all the options.
  110. ##
  111. ########################################################################
  112. def usage(problem):
  113. if (problem):
  114. print("")
  115. print("Error parsing command-line input: %s" % (problem))
  116. print("")
  117. print("Makepanda generates a 'built' subdirectory containing a")
  118. print("compiled copy of Panda3D. Command-line arguments are:")
  119. print("")
  120. print(" --help (print the help message you're reading now)")
  121. print(" --verbose (print out more information)")
  122. print(" --runtime (build a runtime build instead of an SDK build)")
  123. print(" --tests (run the test suite)")
  124. print(" --installer (build an installer)")
  125. print(" --wheel (build a pip-installable .whl)")
  126. print(" --optimize X (optimization level can be 1,2,3,4)")
  127. print(" --version X (set the panda version number)")
  128. print(" --lzma (use lzma compression when building Windows installer)")
  129. print(" --distributor X (short string identifying the distributor of the build)")
  130. print(" --outputdir X (use the specified directory instead of 'built')")
  131. print(" --host URL (set the host url (runtime build only))")
  132. print(" --threads N (use the multithreaded build system. see manual)")
  133. print(" --osxtarget N (the macOS version number to build for (macOS only))")
  134. print(" --universal (build universal binaries (macOS only))")
  135. print(" --override \"O=V\" (override dtool_config/prc option value)")
  136. print(" --static (builds libraries for static linking)")
  137. print(" --target X (experimental cross-compilation (android only))")
  138. print(" --arch X (target architecture for cross-compilation)")
  139. print("")
  140. for pkg in PkgListGet():
  141. p = pkg.lower()
  142. print(" --use-%-9s --no-%-9s (enable/disable use of %s)"%(p, p, pkg))
  143. if sys.platform != 'win32':
  144. print(" --<PKG>-incdir (custom location for header files of thirdparty package)")
  145. print(" --<PKG>-libdir (custom location for library files of thirdparty package)")
  146. print("")
  147. print(" --nothing (disable every third-party lib)")
  148. print(" --everything (enable every third-party lib)")
  149. print(" --directx-sdk=X (specify version of DirectX SDK to use: jun2010, aug2009, mar2009, aug2006)")
  150. print(" --windows-sdk=X (specify Windows SDK version, eg. 7.0, 7.1 or 10. Default is 7.1)")
  151. print(" --msvc-version=X (specify Visual C++ version, eg. 10, 11, 12, 14, 14.1, 14.2. Default is 14)")
  152. print(" --use-icl (experimental setting to use an intel compiler instead of MSVC on Windows)")
  153. print("")
  154. print("The simplest way to compile panda is to just type:")
  155. print("")
  156. print(" makepanda --everything")
  157. print("")
  158. os._exit(1)
  159. def parseopts(args):
  160. global INSTALLER,WHEEL,RUNTESTS,RTDIST,RUNTIME,GENMAN,DISTRIBUTOR,VERSION
  161. global COMPRESSOR,THREADCOUNT,OSXTARGET,OSX_ARCHS,HOST_URL
  162. global DEBVERSION,WHLVERSION,RPMRELEASE,GIT_COMMIT,P3DSUFFIX,RTDIST_VERSION
  163. global STRDXSDKVERSION, WINDOWS_SDK, MSVC_VERSION, BOOUSEINTELCOMPILER
  164. global COPY_PYTHON
  165. # Options for which to display a deprecation warning.
  166. removedopts = [
  167. "use-touchinput", "no-touchinput", "no-awesomium", "no-directscripts",
  168. ]
  169. # All recognized options.
  170. longopts = [
  171. "help","distributor=","verbose","runtime","osxtarget=","tests",
  172. "optimize=","everything","nothing","installer","wheel","rtdist","nocolor",
  173. "version=","lzma","no-python","threads=","outputdir=","override=",
  174. "static","host=","debversion=","rpmrelease=","p3dsuffix=","rtdist-version=",
  175. "directx-sdk=", "windows-sdk=", "msvc-version=", "clean", "use-icl",
  176. "universal", "target=", "arch=", "git-commit=", "no-copy-python",
  177. "cggl-incdir=", "cggl-libdir=",
  178. ] + removedopts
  179. anything = 0
  180. optimize = ""
  181. target = None
  182. target_archs = []
  183. universal = False
  184. clean_build = False
  185. for pkg in PkgListGet():
  186. longopts.append("use-" + pkg.lower())
  187. longopts.append("no-" + pkg.lower())
  188. longopts.append(pkg.lower() + "-incdir=")
  189. longopts.append(pkg.lower() + "-libdir=")
  190. try:
  191. opts, extras = getopt.getopt(args, "", longopts)
  192. for option, value in opts:
  193. if (option=="--help"): raise Exception
  194. elif (option=="--optimize"): optimize=value
  195. elif (option=="--installer"): INSTALLER=1
  196. elif (option=="--tests"): RUNTESTS=1
  197. elif (option=="--wheel"): WHEEL=1
  198. elif (option=="--verbose"): SetVerbose(True)
  199. elif (option=="--distributor"): DISTRIBUTOR=value
  200. elif (option=="--rtdist"): RTDIST=1
  201. elif (option=="--runtime"): RUNTIME=1
  202. elif (option=="--genman"): GENMAN=1
  203. elif (option=="--everything"): PkgEnableAll()
  204. elif (option=="--nothing"): PkgDisableAll()
  205. elif (option=="--threads"): THREADCOUNT=int(value)
  206. elif (option=="--outputdir"): SetOutputDir(value.strip())
  207. elif (option=="--osxtarget"): OSXTARGET=value.strip()
  208. elif (option=="--universal"): universal = True
  209. elif (option=="--target"): target = value.strip()
  210. elif (option=="--arch"): target_archs.append(value.strip())
  211. elif (option=="--nocolor"): DisableColors()
  212. elif (option=="--version"):
  213. match = re.match(r'^\d+\.\d+(\.\d+)+', value)
  214. if not match:
  215. usage("version requires three digits")
  216. WHLVERSION = value
  217. VERSION = match.group()
  218. elif (option=="--lzma"): COMPRESSOR="lzma"
  219. elif (option=="--override"): AddOverride(value.strip())
  220. elif (option=="--static"): SetLinkAllStatic(True)
  221. elif (option=="--host"): HOST_URL=value
  222. elif (option=="--debversion"): DEBVERSION=value
  223. elif (option=="--rpmrelease"): RPMRELEASE=value
  224. elif (option=="--git-commit"): GIT_COMMIT=value
  225. elif (option=="--p3dsuffix"): P3DSUFFIX=value
  226. elif (option=="--rtdist-version"): RTDIST_VERSION=value
  227. # Backward compatibility, OPENGL was renamed to GL
  228. elif (option=="--use-opengl"): PkgEnable("GL")
  229. elif (option=="--no-opengl"): PkgDisable("GL")
  230. elif (option=="--directx-sdk"):
  231. STRDXSDKVERSION = value.strip().lower()
  232. if STRDXSDKVERSION == '':
  233. print("No DirectX SDK version specified. Using 'default' DirectX SDK search")
  234. STRDXSDKVERSION = 'default'
  235. elif (option=="--windows-sdk"):
  236. WINDOWS_SDK = value.strip().lower()
  237. elif (option=="--msvc-version"):
  238. MSVC_VERSION = value.strip().lower()
  239. elif (option=="--use-icl"): BOOUSEINTELCOMPILER = True
  240. elif (option=="--clean"): clean_build = True
  241. elif (option=="--no-copy-python"): COPY_PYTHON = False
  242. elif (option[2:] in removedopts):
  243. Warn("Ignoring removed option %s" % (option))
  244. else:
  245. for pkg in PkgListGet() + ['CGGL']:
  246. if option == "--use-" + pkg.lower():
  247. PkgEnable(pkg)
  248. break
  249. elif option == "--no-" + pkg.lower():
  250. PkgDisable(pkg)
  251. break
  252. elif option == "--" + pkg.lower() + "-incdir":
  253. PkgSetCustomLocation(pkg)
  254. IncDirectory(pkg, value)
  255. break
  256. elif option == "--" + pkg.lower() + "-libdir":
  257. PkgSetCustomLocation(pkg)
  258. LibDirectory(pkg, value)
  259. break
  260. if (option == "--everything" or option.startswith("--use-")
  261. or option == "--nothing" or option.startswith("--no-")):
  262. anything = 1
  263. except:
  264. usage(sys.exc_info()[1])
  265. if not anything:
  266. if RUNTIME:
  267. PkgEnableAll()
  268. else:
  269. usage("You should specify a list of packages to use or --everything to enable all packages.")
  270. if (RTDIST and RUNTIME):
  271. usage("Options --runtime and --rtdist cannot be specified at the same time!")
  272. if (optimize=="" and (RTDIST or RUNTIME)): optimize = "4"
  273. elif (optimize==""): optimize = "3"
  274. if OSXTARGET:
  275. parts = OSXTARGET.strip().split('.')
  276. try:
  277. assert len(parts) <= 2
  278. maj = int(parts[0])
  279. min = 0
  280. if len(parts) > 1:
  281. min = int(parts[1])
  282. OSXTARGET = maj, min
  283. assert OSXTARGET >= (10, 4)
  284. except:
  285. usage("Invalid setting for --osxtarget")
  286. else:
  287. OSXTARGET = None
  288. if target is not None or target_archs:
  289. SetTarget(target, target_archs[-1] if target_archs else None)
  290. if universal:
  291. if target_archs:
  292. exit("--universal is incompatible with --arch")
  293. if OSXTARGET:
  294. osxver = OSXTARGET
  295. else:
  296. maj, min = platform.mac_ver()[0].split('.')[:2]
  297. osxver = int(maj), int(min)
  298. if osxver < (10, 15):
  299. OSX_ARCHS.append("i386")
  300. if osxver < (10, 6):
  301. OSX_ARCHS.append("ppc")
  302. else:
  303. OSX_ARCHS.append("x86_64")
  304. if osxver >= (11, 0):
  305. OSX_ARCHS.append("arm64")
  306. elif target_archs:
  307. OSX_ARCHS = target_archs
  308. if 'arm64' in target_archs and OSXTARGET and OSXTARGET < (10, 9):
  309. exit("Must have at least --osxtarget 10.9 when targeting arm64")
  310. try:
  311. SetOptimize(int(optimize))
  312. assert GetOptimize() in [1, 2, 3, 4]
  313. except:
  314. usage("Invalid setting for OPTIMIZE")
  315. if GIT_COMMIT is not None and not re.match("^[a-f0-9]{40}$", GIT_COMMIT):
  316. usage("Invalid SHA-1 hash given for --git-commit option!")
  317. if GetTarget() == 'windows':
  318. if not MSVC_VERSION:
  319. print("No MSVC version specified. Defaulting to 14 (Visual Studio 2015).")
  320. MSVC_VERSION = (14, 0)
  321. else:
  322. try:
  323. MSVC_VERSION = tuple(int(d) for d in MSVC_VERSION.split('.'))[:2]
  324. if (len(MSVC_VERSION) == 1):
  325. MSVC_VERSION += (0,)
  326. except:
  327. usage("Invalid setting for --msvc-version")
  328. if MSVC_VERSION < (14, 0):
  329. warn_prefix = "%sERROR:%s " % (GetColor("red"), GetColor())
  330. print("=========================================================================")
  331. print(warn_prefix + "Support for MSVC versions before 2015 has been discontinued.")
  332. print(warn_prefix + "For more information, or any questions, please visit:")
  333. print(warn_prefix + " https://github.com/panda3d/panda3d/issues/288")
  334. print("=========================================================================")
  335. sys.stdout.flush()
  336. time.sleep(1.0)
  337. sys.exit(1)
  338. if not WINDOWS_SDK:
  339. print("No Windows SDK version specified. Defaulting to '7.1'.")
  340. WINDOWS_SDK = '7.1'
  341. if clean_build and os.path.isdir(GetOutputDir()):
  342. print("Deleting %s" % (GetOutputDir()))
  343. shutil.rmtree(GetOutputDir())
  344. parseopts(sys.argv[1:])
  345. ########################################################################
  346. ##
  347. ## Handle environment variables.
  348. ##
  349. ########################################################################
  350. if ("CFLAGS" in os.environ):
  351. CFLAGS = os.environ["CFLAGS"].strip()
  352. if ("CXXFLAGS" in os.environ):
  353. CXXFLAGS = os.environ["CXXFLAGS"].strip()
  354. if ("RPM_OPT_FLAGS" in os.environ):
  355. CFLAGS += " " + os.environ["RPM_OPT_FLAGS"].strip()
  356. CXXFLAGS += " " + os.environ["RPM_OPT_FLAGS"].strip()
  357. if ("LDFLAGS" in os.environ):
  358. LDFLAGS = os.environ["LDFLAGS"].strip()
  359. os.environ["MAKEPANDA"] = os.path.abspath(sys.argv[0])
  360. if GetHost() == "darwin" and OSXTARGET is not None:
  361. os.environ["MACOSX_DEPLOYMENT_TARGET"] = "%d.%d" % OSXTARGET
  362. ########################################################################
  363. ##
  364. ## Configure things based on the command-line parameters.
  365. ##
  366. ########################################################################
  367. PLUGIN_VERSION = ParsePluginVersion("dtool/PandaVersion.pp")
  368. COREAPI_VERSION = PLUGIN_VERSION + "." + ParseCoreapiVersion("dtool/PandaVersion.pp")
  369. if VERSION is None:
  370. if RUNTIME:
  371. VERSION = PLUGIN_VERSION
  372. else:
  373. # Take the value from the setup.cfg file.
  374. VERSION = GetMetadataValue('version')
  375. if WHLVERSION is None:
  376. WHLVERSION = VERSION
  377. print("Version: %s" % VERSION)
  378. if RUNTIME or RTDIST:
  379. print("Core API Version: %s" % COREAPI_VERSION)
  380. if DEBVERSION is None:
  381. DEBVERSION = VERSION
  382. MAJOR_VERSION = '.'.join(VERSION.split('.')[:2])
  383. if P3DSUFFIX is None:
  384. P3DSUFFIX = MAJOR_VERSION
  385. # Now determine the distutils-style platform tag for the target system.
  386. target = GetTarget()
  387. if target == 'windows':
  388. if GetTargetArch() == 'x64':
  389. PLATFORM = 'win-amd64'
  390. else:
  391. PLATFORM = 'win32'
  392. elif target == 'darwin':
  393. if OSXTARGET:
  394. osxver = OSXTARGET
  395. else:
  396. maj, min = platform.mac_ver()[0].split('.')[:2]
  397. osxver = int(maj), int(min)
  398. if osxver[0] == 11:
  399. # I think Python pins minor version to 0 from macOS 11 onward
  400. osxver = (osxver[0], 0)
  401. arch_tag = None
  402. if not OSX_ARCHS:
  403. arch_tag = GetTargetArch()
  404. elif len(OSX_ARCHS) == 1:
  405. arch_tag = OSX_ARCHS[0]
  406. elif frozenset(OSX_ARCHS) == frozenset(('i386', 'ppc')):
  407. arch_tag = 'fat'
  408. elif frozenset(OSX_ARCHS) == frozenset(('x86_64', 'i386')):
  409. arch_tag = 'intel'
  410. elif frozenset(OSX_ARCHS) == frozenset(('x86_64', 'ppc64')):
  411. arch_tag = 'fat64'
  412. elif frozenset(OSX_ARCHS) == frozenset(('x86_64', 'i386', 'ppc')):
  413. arch_tag = 'fat32'
  414. elif frozenset(OSX_ARCHS) == frozenset(('x86_64', 'i386', 'ppc64', 'ppc')):
  415. arch_tag = 'universal'
  416. elif frozenset(OSX_ARCHS) == frozenset(('x86_64', 'arm64')):
  417. arch_tag = 'universal2'
  418. else:
  419. raise RuntimeError('No arch tag for arch combination %s' % OSX_ARCHS)
  420. PLATFORM = 'macosx-{0}.{1}-{2}'.format(osxver[0], osxver[1], arch_tag)
  421. 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"):
  422. # This is manylinux1. A bit of a sloppy check, though.
  423. if GetTargetArch() in ('x86_64', 'amd64'):
  424. PLATFORM = 'manylinux1-x86_64'
  425. else:
  426. PLATFORM = 'manylinux1-i686'
  427. 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"):
  428. # Same sloppy check for manylinux2010.
  429. if GetTargetArch() in ('x86_64', 'amd64'):
  430. PLATFORM = 'manylinux2010-x86_64'
  431. else:
  432. PLATFORM = 'manylinux2010-i686'
  433. 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"):
  434. # Same sloppy check for manylinux2014.
  435. if GetTargetArch() in ('x86_64', 'amd64'):
  436. PLATFORM = 'manylinux2014-x86_64'
  437. else:
  438. PLATFORM = 'manylinux2014-i686'
  439. elif not CrossCompiling():
  440. if HasTargetArch():
  441. # Replace the architecture in the platform string.
  442. platform_parts = get_platform().rsplit('-', 1)
  443. target_arch = GetTargetArch()
  444. if target_arch == 'amd64':
  445. target_arch = 'x86_64'
  446. PLATFORM = platform_parts[0] + '-' + target_arch
  447. else:
  448. # We're not cross-compiling; just take the host arch.
  449. PLATFORM = get_platform()
  450. else:
  451. target_arch = GetTargetArch()
  452. if target_arch == 'amd64':
  453. target_arch = 'x86_64'
  454. PLATFORM = '{0}-{1}'.format(target, target_arch)
  455. print("Platform: %s" % PLATFORM)
  456. outputdir_suffix = ""
  457. if (RUNTIME or RTDIST):
  458. # Compiling Maya/Max is pointless in rtdist build
  459. for ver in MAYAVERSIONS + MAXVERSIONS:
  460. PkgDisable(ver)
  461. if (DISTRIBUTOR.strip() == ""):
  462. exit("You must provide a valid distributor name when making a runtime or rtdist build!")
  463. outputdir_suffix += "_" + DISTRIBUTOR.strip()
  464. if (RUNTIME):
  465. outputdir_suffix += "_rt"
  466. if DISTRIBUTOR == "":
  467. DISTRIBUTOR = "makepanda"
  468. elif not RTDIST_VERSION:
  469. RTDIST_VERSION = DISTRIBUTOR.strip() + "_" + MAJOR_VERSION
  470. if not RTDIST_VERSION:
  471. RTDIST_VERSION = "dev"
  472. if not IsCustomOutputDir():
  473. if GetTarget() == "windows" and GetTargetArch() == 'x64':
  474. outputdir_suffix += '_x64'
  475. SetOutputDir("built" + outputdir_suffix)
  476. if (RUNTIME):
  477. for pkg in PkgListGet():
  478. if pkg in ["GTK2", "MFC"]:
  479. # Optional package(s) for runtime.
  480. pass
  481. elif pkg in ["OPENSSL", "ZLIB"]:
  482. # Required packages for runtime.
  483. if (PkgSkip(pkg)==1):
  484. exit("Runtime must be compiled with OpenSSL and ZLib support!")
  485. else:
  486. # Unused packages for runtime.
  487. PkgDisable(pkg)
  488. if (INSTALLER and RTDIST):
  489. exit("Cannot build an installer for the rtdist build!")
  490. if (WHEEL and RUNTIME):
  491. exit("Cannot build a wheel for the runtime build!")
  492. if (WHEEL and RTDIST):
  493. exit("Cannot build a wheel for the rtdist build!")
  494. if (INSTALLER) and (PkgSkip("PYTHON")) and (not RUNTIME) and GetTarget() == 'windows':
  495. exit("Cannot build installer on Windows without python")
  496. if WHEEL and PkgSkip("PYTHON"):
  497. exit("Cannot build wheel without Python")
  498. if (RTDIST) and (PkgSkip("WX") and PkgSkip("FLTK")):
  499. exit("Cannot build rtdist without wx or fltk")
  500. if (RUNTIME):
  501. SetLinkAllStatic(True)
  502. if not os.path.isdir("contrib"):
  503. PkgDisable("CONTRIB")
  504. ########################################################################
  505. ##
  506. ## Load the dependency cache.
  507. ##
  508. ########################################################################
  509. LoadDependencyCache()
  510. ########################################################################
  511. ##
  512. ## Locate various SDKs.
  513. ##
  514. ########################################################################
  515. MakeBuildTree()
  516. SdkLocateDirectX(STRDXSDKVERSION)
  517. SdkLocateMaya()
  518. SdkLocateMax()
  519. SdkLocateMacOSX(OSXTARGET, OSX_ARCHS)
  520. SdkLocatePython(RTDIST)
  521. SdkLocateWindows(WINDOWS_SDK)
  522. SdkLocatePhysX()
  523. SdkLocateSpeedTree()
  524. SdkLocateAndroid()
  525. SdkAutoDisableDirectX()
  526. SdkAutoDisableMaya()
  527. SdkAutoDisableMax()
  528. SdkAutoDisablePhysX()
  529. SdkAutoDisableSpeedTree()
  530. if RTDIST and DISTRIBUTOR == "cmu":
  531. # Some validation checks for the CMU builds.
  532. if (RTDIST_VERSION == "cmu_1.7" and SDK["PYTHONVERSION"] != "python2.6"):
  533. exit("The CMU 1.7 runtime distribution must be built against Python 2.6!")
  534. elif (RTDIST_VERSION == "cmu_1.8" and SDK["PYTHONVERSION"] != "python2.7"):
  535. exit("The CMU 1.8 runtime distribution must be built against Python 2.7!")
  536. elif (RTDIST_VERSION == "cmu_1.9" and SDK["PYTHONVERSION"] != "python2.7"):
  537. exit("The CMU 1.9 runtime distribution must be built against Python 2.7!")
  538. if RTDIST and not HOST_URL:
  539. exit("You must specify a host URL when building the rtdist!")
  540. if RUNTIME and not HOST_URL:
  541. # Set this to a nice default.
  542. HOST_URL = "https://runtime.panda3d.org/"
  543. if not PkgSkip("PYTHON") and SDK["PYTHONVERSION"] == "python2.7":
  544. warn_prefix = "%sWARNING:%s " % (GetColor("red"), GetColor())
  545. print("==========================================================================")
  546. print(warn_prefix + "Python 2.7 has reached EOL as of January 1, 2020 and is no longer")
  547. print(warn_prefix + "maintained. Panda3D will soon cease to work with this version.")
  548. print(warn_prefix + "Please upgrade to Python 3 now.")
  549. print("==========================================================================")
  550. sys.stdout.flush()
  551. # Give the user some time to contemplate their sins
  552. time.sleep(6.0)
  553. ########################################################################
  554. ##
  555. ## Choose a Compiler.
  556. ##
  557. ## This should also set up any environment variables needed to make
  558. ## the compiler work.
  559. ##
  560. ########################################################################
  561. if GetHost() == 'windows' and GetTarget() == 'windows':
  562. COMPILER = "MSVC"
  563. SdkLocateVisualStudio(MSVC_VERSION)
  564. else:
  565. COMPILER = "GCC"
  566. SetupBuildEnvironment(COMPILER)
  567. ########################################################################
  568. ##
  569. ## External includes, external libraries, and external defsyms.
  570. ##
  571. ########################################################################
  572. IncDirectory("ALWAYS", GetOutputDir()+"/tmp")
  573. IncDirectory("ALWAYS", GetOutputDir()+"/include")
  574. if (COMPILER == "MSVC"):
  575. PkgDisable("X11")
  576. PkgDisable("GLES")
  577. PkgDisable("GLES2")
  578. PkgDisable("EGL")
  579. PkgDisable("CARBON")
  580. PkgDisable("COCOA")
  581. DefSymbol("FLEX", "YY_NO_UNISTD_H")
  582. if (PkgSkip("PYTHON")==0):
  583. IncDirectory("ALWAYS", SDK["PYTHON"] + "/include")
  584. LibDirectory("ALWAYS", SDK["PYTHON"] + "/libs")
  585. SmartPkgEnable("EIGEN", "eigen3", (), ("Eigen/Dense",), target_pkg = 'ALWAYS')
  586. for pkg in PkgListGet():
  587. if (PkgSkip(pkg)==0):
  588. if (pkg[:4]=="MAYA"):
  589. IncDirectory(pkg, SDK[pkg] + "/include")
  590. DefSymbol(pkg, "MAYAVERSION", pkg)
  591. DefSymbol(pkg, "MLIBRARY_DONTUSE_MFC_MANIFEST", "")
  592. elif (pkg[:3]=="MAX"):
  593. IncDirectory(pkg, SDK[pkg] + "/include")
  594. IncDirectory(pkg, SDK[pkg] + "/include/CS")
  595. IncDirectory(pkg, SDK[pkg+"CS"] + "/include")
  596. IncDirectory(pkg, SDK[pkg+"CS"] + "/include/CS")
  597. DefSymbol(pkg, "MAX", pkg)
  598. if (int(pkg[3:]) >= 2013):
  599. DefSymbol(pkg, "UNICODE", "")
  600. DefSymbol(pkg, "_UNICODE", "")
  601. elif (pkg[:2]=="DX"):
  602. IncDirectory(pkg, SDK[pkg] + "/include")
  603. elif GetThirdpartyDir() is not None:
  604. IncDirectory(pkg, GetThirdpartyDir() + pkg.lower() + "/include")
  605. for pkg in DXVERSIONS:
  606. if (PkgSkip(pkg)==0):
  607. vnum=pkg[2:]
  608. if GetTargetArch() == 'x64':
  609. LibDirectory(pkg, SDK[pkg] + '/lib/x64')
  610. else:
  611. LibDirectory(pkg, SDK[pkg] + '/lib/x86')
  612. LibDirectory(pkg, SDK[pkg] + '/lib')
  613. LibName(pkg, 'd3dVNUM.lib'.replace("VNUM", vnum))
  614. LibName(pkg, 'd3dxVNUM.lib'.replace("VNUM", vnum))
  615. if int(vnum) >= 9 and "GENERIC_DXERR_LIBRARY" in SDK:
  616. LibName(pkg, 'dxerr.lib')
  617. else:
  618. LibName(pkg, 'dxerrVNUM.lib'.replace("VNUM", vnum))
  619. #LibName(pkg, 'ddraw.lib')
  620. LibName(pkg, 'dxguid.lib')
  621. if SDK.get("VISUALSTUDIO_VERSION") >= (14,0):
  622. # dxerr needs this for __vsnwprintf definition.
  623. LibName(pkg, 'legacy_stdio_definitions.lib')
  624. if not PkgSkip("FREETYPE") and os.path.isdir(GetThirdpartyDir() + "freetype/include/freetype2"):
  625. IncDirectory("FREETYPE", GetThirdpartyDir() + "freetype/include/freetype2")
  626. IncDirectory("ALWAYS", GetThirdpartyDir() + "extras/include")
  627. LibName("WINSOCK", "wsock32.lib")
  628. LibName("WINSOCK2", "wsock32.lib")
  629. LibName("WINSOCK2", "ws2_32.lib")
  630. LibName("WINCOMCTL", "comctl32.lib")
  631. LibName("WINCOMDLG", "comdlg32.lib")
  632. LibName("WINUSER", "user32.lib")
  633. LibName("WINMM", "winmm.lib")
  634. LibName("WINIMM", "imm32.lib")
  635. LibName("WINKERNEL", "kernel32.lib")
  636. LibName("WINOLE", "ole32.lib")
  637. LibName("WINOLEAUT", "oleaut32.lib")
  638. LibName("WINOLDNAMES", "oldnames.lib")
  639. LibName("WINSHELL", "shell32.lib")
  640. LibName("WINGDI", "gdi32.lib")
  641. LibName("ADVAPI", "advapi32.lib")
  642. LibName("IPHLPAPI", "iphlpapi.lib")
  643. LibName("SETUPAPI", "setupapi.lib")
  644. LibName("GL", "opengl32.lib")
  645. LibName("GLES", "libgles_cm.lib")
  646. LibName("GLES2", "libGLESv2.lib")
  647. LibName("EGL", "libEGL.lib")
  648. LibName("MSIMG", "msimg32.lib")
  649. if (PkgSkip("DIRECTCAM")==0): LibName("DIRECTCAM", "strmiids.lib")
  650. if (PkgSkip("DIRECTCAM")==0): LibName("DIRECTCAM", "quartz.lib")
  651. if (PkgSkip("DIRECTCAM")==0): LibName("DIRECTCAM", "odbc32.lib")
  652. if (PkgSkip("DIRECTCAM")==0): LibName("DIRECTCAM", "odbccp32.lib")
  653. if (PkgSkip("OPENSSL")==0):
  654. if os.path.isfile(GetThirdpartyDir() + "openssl/lib/libpandassl.lib"):
  655. LibName("OPENSSL", GetThirdpartyDir() + "openssl/lib/libpandassl.lib")
  656. LibName("OPENSSL", GetThirdpartyDir() + "openssl/lib/libpandaeay.lib")
  657. else:
  658. LibName("OPENSSL", GetThirdpartyDir() + "openssl/lib/libeay32.lib")
  659. LibName("OPENSSL", GetThirdpartyDir() + "openssl/lib/ssleay32.lib")
  660. if (PkgSkip("PNG")==0):
  661. if os.path.isfile(GetThirdpartyDir() + "png/lib/libpng16_static.lib"):
  662. LibName("PNG", GetThirdpartyDir() + "png/lib/libpng16_static.lib")
  663. else:
  664. LibName("PNG", GetThirdpartyDir() + "png/lib/libpng_static.lib")
  665. if (PkgSkip("TIFF")==0):
  666. if os.path.isfile(GetThirdpartyDir() + "tiff/lib/libtiff.lib"):
  667. LibName("TIFF", GetThirdpartyDir() + "tiff/lib/libtiff.lib")
  668. else:
  669. LibName("TIFF", GetThirdpartyDir() + "tiff/lib/tiff.lib")
  670. if (PkgSkip("OPENEXR")==0):
  671. suffix = ""
  672. if os.path.isfile(GetThirdpartyDir() + "openexr/lib/IlmImf-2_2.lib"):
  673. suffix = "-2_2"
  674. elif os.path.isfile(GetThirdpartyDir() + "openexr/lib/IlmImf-2_3.lib"):
  675. suffix = "-2_3"
  676. elif os.path.isfile(GetThirdpartyDir() + "openexr/lib/IlmImf-2_4.lib"):
  677. suffix = "-2_4"
  678. LibName("OPENEXR", GetThirdpartyDir() + "openexr/lib/Imath" + suffix + ".lib")
  679. if os.path.isfile(GetThirdpartyDir() + "openexr/lib/IlmImf" + suffix + "_s.lib"):
  680. suffix += "_s" # _s suffix observed for OpenEXR 2.3 only so far
  681. LibName("OPENEXR", GetThirdpartyDir() + "openexr/lib/IlmImf" + suffix + ".lib")
  682. LibName("OPENEXR", GetThirdpartyDir() + "openexr/lib/IlmThread" + suffix + ".lib")
  683. LibName("OPENEXR", GetThirdpartyDir() + "openexr/lib/Iex" + suffix + ".lib")
  684. if suffix == "-2_2":
  685. LibName("OPENEXR", GetThirdpartyDir() + "openexr/lib/Half.lib")
  686. else:
  687. LibName("OPENEXR", GetThirdpartyDir() + "openexr/lib/Half" + suffix + ".lib")
  688. IncDirectory("OPENEXR", GetThirdpartyDir() + "openexr/include/OpenEXR")
  689. IncDirectory("OPENEXR", GetThirdpartyDir() + "openexr/include/Imath")
  690. if (PkgSkip("JPEG")==0): LibName("JPEG", GetThirdpartyDir() + "jpeg/lib/jpeg-static.lib")
  691. if (PkgSkip("ZLIB")==0): LibName("ZLIB", GetThirdpartyDir() + "zlib/lib/zlibstatic.lib")
  692. if (PkgSkip("VRPN")==0): LibName("VRPN", GetThirdpartyDir() + "vrpn/lib/vrpn.lib")
  693. if (PkgSkip("VRPN")==0): LibName("VRPN", GetThirdpartyDir() + "vrpn/lib/quat.lib")
  694. if (PkgSkip("NVIDIACG")==0): LibName("CGGL", GetThirdpartyDir() + "nvidiacg/lib/cgGL.lib")
  695. if (PkgSkip("NVIDIACG")==0): LibName("CGDX9", GetThirdpartyDir() + "nvidiacg/lib/cgD3D9.lib")
  696. if (PkgSkip("NVIDIACG")==0): LibName("NVIDIACG", GetThirdpartyDir() + "nvidiacg/lib/cg.lib")
  697. if (PkgSkip("FREETYPE")==0): LibName("FREETYPE", GetThirdpartyDir() + "freetype/lib/freetype.lib")
  698. if (PkgSkip("HARFBUZZ")==0):
  699. LibName("HARFBUZZ", GetThirdpartyDir() + "harfbuzz/lib/harfbuzz.lib")
  700. IncDirectory("HARFBUZZ", GetThirdpartyDir() + "harfbuzz/include/harfbuzz")
  701. if (PkgSkip("FFTW")==0): LibName("FFTW", GetThirdpartyDir() + "fftw/lib/fftw3.lib")
  702. if (PkgSkip("ARTOOLKIT")==0):LibName("ARTOOLKIT",GetThirdpartyDir() + "artoolkit/lib/libAR.lib")
  703. if (PkgSkip("OPENCV")==0): LibName("OPENCV", GetThirdpartyDir() + "opencv/lib/cv.lib")
  704. if (PkgSkip("OPENCV")==0): LibName("OPENCV", GetThirdpartyDir() + "opencv/lib/highgui.lib")
  705. if (PkgSkip("OPENCV")==0): LibName("OPENCV", GetThirdpartyDir() + "opencv/lib/cvaux.lib")
  706. if (PkgSkip("OPENCV")==0): LibName("OPENCV", GetThirdpartyDir() + "opencv/lib/ml.lib")
  707. if (PkgSkip("OPENCV")==0): LibName("OPENCV", GetThirdpartyDir() + "opencv/lib/cxcore.lib")
  708. if (PkgSkip("FFMPEG")==0): LibName("FFMPEG", GetThirdpartyDir() + "ffmpeg/lib/avcodec.lib")
  709. if (PkgSkip("FFMPEG")==0): LibName("FFMPEG", GetThirdpartyDir() + "ffmpeg/lib/avformat.lib")
  710. if (PkgSkip("FFMPEG")==0): LibName("FFMPEG", GetThirdpartyDir() + "ffmpeg/lib/avutil.lib")
  711. if (PkgSkip("SWSCALE")==0): LibName("SWSCALE", GetThirdpartyDir() + "ffmpeg/lib/swscale.lib")
  712. if (PkgSkip("SWRESAMPLE")==0):LibName("SWRESAMPLE",GetThirdpartyDir() + "ffmpeg/lib/swresample.lib")
  713. if (PkgSkip("FCOLLADA")==0):
  714. LibName("FCOLLADA", GetThirdpartyDir() + "fcollada/lib/FCollada.lib")
  715. IncDirectory("FCOLLADA", GetThirdpartyDir() + "fcollada/include/FCollada")
  716. if (PkgSkip("ASSIMP")==0):
  717. LibName("ASSIMP", GetThirdpartyDir() + "assimp/lib/assimp.lib")
  718. if os.path.isfile(GetThirdpartyDir() + "assimp/lib/IrrXML.lib"):
  719. LibName("ASSIMP", GetThirdpartyDir() + "assimp/lib/IrrXML.lib")
  720. IncDirectory("ASSIMP", GetThirdpartyDir() + "assimp/include")
  721. if (PkgSkip("SQUISH")==0):
  722. if GetOptimize() <= 2:
  723. LibName("SQUISH", GetThirdpartyDir() + "squish/lib/squishd.lib")
  724. else:
  725. LibName("SQUISH", GetThirdpartyDir() + "squish/lib/squish.lib")
  726. if (PkgSkip("ROCKET")==0):
  727. LibName("ROCKET", GetThirdpartyDir() + "rocket/lib/RocketCore.lib")
  728. LibName("ROCKET", GetThirdpartyDir() + "rocket/lib/RocketControls.lib")
  729. if (PkgSkip("PYTHON")==0):
  730. LibName("ROCKET", GetThirdpartyDir() + "rocket/lib/" + SDK["PYTHONVERSION"] + "/boost_python-vc100-mt-1_54.lib")
  731. if (GetOptimize() <= 3):
  732. LibName("ROCKET", GetThirdpartyDir() + "rocket/lib/RocketDebugger.lib")
  733. if (PkgSkip("OPENAL")==0):
  734. LibName("OPENAL", GetThirdpartyDir() + "openal/lib/OpenAL32.lib")
  735. if not os.path.isfile(GetThirdpartyDir() + "openal/bin/OpenAL32.dll"):
  736. # Link OpenAL Soft statically.
  737. DefSymbol("OPENAL", "AL_LIBTYPE_STATIC")
  738. if (PkgSkip("ODE")==0):
  739. LibName("ODE", GetThirdpartyDir() + "ode/lib/ode_single.lib")
  740. DefSymbol("ODE", "dSINGLE", "")
  741. if (PkgSkip("FMODEX")==0):
  742. if (GetTargetArch() == 'x64'):
  743. LibName("FMODEX", GetThirdpartyDir() + "fmodex/lib/fmodex64_vc.lib")
  744. else:
  745. LibName("FMODEX", GetThirdpartyDir() + "fmodex/lib/fmodex_vc.lib")
  746. if (PkgSkip("FLTK")==0 and RTDIST):
  747. LibName("FLTK", GetThirdpartyDir() + "fltk/lib/fltk.lib")
  748. if not PkgSkip("FLTK"):
  749. # If we have fltk, we don't need wx
  750. PkgDisable("WX")
  751. if (PkgSkip("WX")==0 and RTDIST):
  752. LibName("WX", GetThirdpartyDir() + "wx/lib/wxbase28u.lib")
  753. LibName("WX", GetThirdpartyDir() + "wx/lib/wxmsw28u_core.lib")
  754. DefSymbol("WX", "__WXMSW__", "")
  755. DefSymbol("WX", "_UNICODE", "")
  756. DefSymbol("WX", "UNICODE", "")
  757. if (PkgSkip("VORBIS")==0):
  758. for lib in ('ogg', 'vorbis', 'vorbisfile'):
  759. path = GetThirdpartyDir() + "vorbis/lib/lib{0}_static.lib".format(lib)
  760. if not os.path.isfile(path):
  761. path = GetThirdpartyDir() + "vorbis/lib/{0}.lib".format(lib)
  762. LibName("VORBIS", path)
  763. if (PkgSkip("OPUS")==0):
  764. IncDirectory("OPUS", GetThirdpartyDir() + "opus/include/opus")
  765. for lib in ('ogg', 'opus', 'opusfile'):
  766. path = GetThirdpartyDir() + "opus/lib/lib{0}_static.lib".format(lib)
  767. if not os.path.isfile(path):
  768. path = GetThirdpartyDir() + "opus/lib/{0}.lib".format(lib)
  769. LibName("OPUS", path)
  770. for pkg in MAYAVERSIONS:
  771. if (PkgSkip(pkg)==0):
  772. LibName(pkg, '"' + SDK[pkg] + '/lib/Foundation.lib"')
  773. LibName(pkg, '"' + SDK[pkg] + '/lib/OpenMaya.lib"')
  774. LibName(pkg, '"' + SDK[pkg] + '/lib/OpenMayaAnim.lib"')
  775. LibName(pkg, '"' + SDK[pkg] + '/lib/OpenMayaUI.lib"')
  776. for pkg in MAXVERSIONS:
  777. if (PkgSkip(pkg)==0):
  778. LibName(pkg, SDK[pkg] + '/lib/core.lib')
  779. LibName(pkg, SDK[pkg] + '/lib/edmodel.lib')
  780. LibName(pkg, SDK[pkg] + '/lib/gfx.lib')
  781. LibName(pkg, SDK[pkg] + '/lib/geom.lib')
  782. LibName(pkg, SDK[pkg] + '/lib/mesh.lib')
  783. LibName(pkg, SDK[pkg] + '/lib/maxutil.lib')
  784. LibName(pkg, SDK[pkg] + '/lib/paramblk2.lib')
  785. if (PkgSkip("PHYSX")==0):
  786. if GetTargetArch() == 'x64':
  787. LibName("PHYSX", SDK["PHYSXLIBS"] + "/PhysXLoader64.lib")
  788. LibName("PHYSX", SDK["PHYSXLIBS"] + "/NxCharacter64.lib")
  789. else:
  790. LibName("PHYSX", SDK["PHYSXLIBS"] + "/PhysXLoader.lib")
  791. LibName("PHYSX", SDK["PHYSXLIBS"] + "/NxCharacter.lib")
  792. IncDirectory("PHYSX", SDK["PHYSX"] + "/Physics/include")
  793. IncDirectory("PHYSX", SDK["PHYSX"] + "/PhysXLoader/include")
  794. IncDirectory("PHYSX", SDK["PHYSX"] + "/NxCharacter/include")
  795. IncDirectory("PHYSX", SDK["PHYSX"] + "/NxExtensions/include")
  796. IncDirectory("PHYSX", SDK["PHYSX"] + "/Foundation/include")
  797. IncDirectory("PHYSX", SDK["PHYSX"] + "/Cooking/include")
  798. if (PkgSkip("SPEEDTREE")==0):
  799. if GetTargetArch() == 'x64':
  800. libdir = SDK["SPEEDTREE"] + "/Lib/Windows/VC10.x64/"
  801. p64ext = '64'
  802. else:
  803. libdir = SDK["SPEEDTREE"] + "/Lib/Windows/VC10/"
  804. p64ext = ''
  805. debugext = ''
  806. if (GetOptimize() <= 2): debugext = "_d"
  807. libsuffix = "_v%s_VC100MT%s_Static%s.lib" % (
  808. SDK["SPEEDTREEVERSION"], p64ext, debugext)
  809. LibName("SPEEDTREE", "%sSpeedTreeCore%s" % (libdir, libsuffix))
  810. LibName("SPEEDTREE", "%sSpeedTreeForest%s" % (libdir, libsuffix))
  811. LibName("SPEEDTREE", "%sSpeedTree%sRenderer%s" % (libdir, SDK["SPEEDTREEAPI"], libsuffix))
  812. LibName("SPEEDTREE", "%sSpeedTreeRenderInterface%s" % (libdir, libsuffix))
  813. if (SDK["SPEEDTREEAPI"] == "OpenGL"):
  814. LibName("SPEEDTREE", "%sglew32.lib" % (libdir))
  815. LibName("SPEEDTREE", "glu32.lib")
  816. IncDirectory("SPEEDTREE", SDK["SPEEDTREE"] + "/Include")
  817. if (PkgSkip("BULLET")==0):
  818. suffix = '.lib'
  819. if GetTargetArch() == 'x64' and os.path.isfile(GetThirdpartyDir() + "bullet/lib/BulletCollision_x64.lib"):
  820. suffix = '_x64.lib'
  821. LibName("BULLET", GetThirdpartyDir() + "bullet/lib/LinearMath" + suffix)
  822. LibName("BULLET", GetThirdpartyDir() + "bullet/lib/BulletCollision" + suffix)
  823. LibName("BULLET", GetThirdpartyDir() + "bullet/lib/BulletDynamics" + suffix)
  824. LibName("BULLET", GetThirdpartyDir() + "bullet/lib/BulletSoftBody" + suffix)
  825. if (COMPILER=="GCC"):
  826. if GetTarget() != "darwin":
  827. PkgDisable("CARBON")
  828. PkgDisable("COCOA")
  829. elif RUNTIME:
  830. # We don't support Cocoa in the runtime yet.
  831. PkgDisable("COCOA")
  832. if 'x86_64' in OSX_ARCHS or 'arm64' in OSX_ARCHS:
  833. # 64-bits macOS doesn't have Carbon.
  834. PkgDisable("CARBON")
  835. if GetTarget() == 'darwin':
  836. if OSX_ARCHS and 'x86_64' not in OSX_ARCHS and 'i386' not in OSX_ARCHS:
  837. # These support only these archs, so don't build them if we're not
  838. # targeting any of the supported archs.
  839. PkgDisable("FMODEX")
  840. PkgDisable("NVIDIACG")
  841. PkgDisable("ROCKET")
  842. elif (OSX_ARCHS and 'arm64' in OSX_ARCHS) or \
  843. (OSXTARGET and OSXTARGET >= (10, 14)) or \
  844. (not OSXTARGET and not os.path.isfile('/usr/lib/libstdc++.6.0.9.dylib')):
  845. # Also, we can't target FMOD Ex with the 10.14 SDK
  846. PkgDisable("FMODEX")
  847. #if (PkgSkip("PYTHON")==0):
  848. # IncDirectory("PYTHON", SDK["PYTHON"])
  849. if (GetHost() == "darwin"):
  850. if (PkgSkip("FREETYPE")==0 and not os.path.isdir(GetThirdpartyDir() + 'freetype')):
  851. IncDirectory("FREETYPE", "/usr/X11/include")
  852. IncDirectory("FREETYPE", "/usr/X11/include/freetype2")
  853. LibDirectory("FREETYPE", "/usr/X11/lib")
  854. if (GetHost() == "freebsd"):
  855. IncDirectory("ALWAYS", "/usr/local/include")
  856. LibDirectory("ALWAYS", "/usr/local/lib")
  857. if (os.path.isdir("/usr/PCBSD")):
  858. IncDirectory("ALWAYS", "/usr/PCBSD/local/include")
  859. LibDirectory("ALWAYS", "/usr/PCBSD/local/lib")
  860. SmartPkgEnable("INOTIFY", "libinotify", ("inotify"), "sys/inotify.h")
  861. if GetTarget() != "windows":
  862. PkgDisable("DIRECTCAM")
  863. fcollada_libs = ("FColladaD", "FColladaSD", "FColladaS")
  864. # WARNING! The order of the ffmpeg libraries matters!
  865. ffmpeg_libs = ("libavformat", "libavcodec", "libavutil")
  866. assimp_libs = ("libassimp", "libassimpd")
  867. # Name pkg-config libs, include(dir)s
  868. if (not RUNTIME):
  869. SmartPkgEnable("EIGEN", "eigen3", (), ("Eigen/Dense",), target_pkg = 'ALWAYS')
  870. SmartPkgEnable("ARTOOLKIT", "", ("AR"), "AR/ar.h")
  871. SmartPkgEnable("FCOLLADA", "", ChooseLib(fcollada_libs, "FCOLLADA"), ("FCollada", "FCollada/FCollada.h"))
  872. SmartPkgEnable("ASSIMP", "assimp", ChooseLib(assimp_libs, "ASSIMP"), "assimp/Importer.hpp")
  873. SmartPkgEnable("FFMPEG", ffmpeg_libs, ffmpeg_libs, ("libavformat/avformat.h", "libavcodec/avcodec.h", "libavutil/avutil.h"))
  874. SmartPkgEnable("SWSCALE", "libswscale", "libswscale", ("libswscale/swscale.h"), target_pkg = "FFMPEG", thirdparty_dir = "ffmpeg")
  875. SmartPkgEnable("SWRESAMPLE","libswresample", "libswresample", ("libswresample/swresample.h"), target_pkg = "FFMPEG", thirdparty_dir = "ffmpeg")
  876. SmartPkgEnable("FFTW", "", ("fftw3"), ("fftw.h"))
  877. SmartPkgEnable("FMODEX", "", ("fmodex"), ("fmodex", "fmodex/fmod.h"))
  878. SmartPkgEnable("FREETYPE", "freetype2", ("freetype"), ("freetype2", "freetype2/freetype/freetype.h"))
  879. SmartPkgEnable("HARFBUZZ", "harfbuzz", ("harfbuzz"), ("harfbuzz", "harfbuzz/hb-ft.h"))
  880. SmartPkgEnable("GL", "gl", ("GL"), ("GL/gl.h"), framework = "OpenGL")
  881. SmartPkgEnable("GLES", "glesv1_cm", ("GLESv1_CM"), ("GLES/gl.h"), framework = "OpenGLES")
  882. SmartPkgEnable("GLES2", "glesv2", ("GLESv2"), ("GLES2/gl2.h")) #framework = "OpenGLES"?
  883. SmartPkgEnable("EGL", "egl", ("EGL"), ("EGL/egl.h"))
  884. SmartPkgEnable("NVIDIACG", "", ("Cg"), "Cg/cg.h", framework = "Cg")
  885. SmartPkgEnable("ODE", "", ("ode"), "ode/ode.h", tool = "ode-config")
  886. SmartPkgEnable("OPENAL", "openal", ("openal"), "AL/al.h", framework = "OpenAL")
  887. SmartPkgEnable("SQUISH", "", ("squish"), "squish.h")
  888. SmartPkgEnable("TIFF", "libtiff-4", ("tiff"), "tiff.h")
  889. SmartPkgEnable("OPENEXR", "OpenEXR", ("IlmImf", "Imath", "Half", "Iex", "IexMath", "IlmThread"), ("OpenEXR", "Imath", "OpenEXR/ImfOutputFile.h"))
  890. SmartPkgEnable("VRPN", "", ("vrpn", "quat"), ("vrpn", "quat.h", "vrpn/vrpn_Types.h"))
  891. SmartPkgEnable("BULLET", "bullet", ("BulletSoftBody", "BulletDynamics", "BulletCollision", "LinearMath"), ("bullet", "bullet/btBulletDynamicsCommon.h"))
  892. SmartPkgEnable("VORBIS", "vorbisfile",("vorbisfile", "vorbis", "ogg"), ("ogg/ogg.h", "vorbis/vorbisfile.h"))
  893. SmartPkgEnable("OPUS", "opusfile", ("opusfile", "opus", "ogg"), ("ogg/ogg.h", "opus/opusfile.h", "opus"))
  894. SmartPkgEnable("JPEG", "", ("jpeg"), "jpeglib.h")
  895. SmartPkgEnable("PNG", "libpng", ("png"), "png.h", tool = "libpng-config")
  896. # Copy freetype libraries to be specified after harfbuzz libraries as well,
  897. # because there's a circular dependency between the two libraries.
  898. if not PkgSkip("FREETYPE") and not PkgSkip("HARFBUZZ"):
  899. for (opt, name) in LIBNAMES:
  900. if opt == "FREETYPE":
  901. LibName("HARFBUZZ", name)
  902. if not PkgSkip("FFMPEG"):
  903. if GetTarget() == "darwin":
  904. if 'i386' in OSX_ARCHS or 'ppc' in OSX_ARCHS:
  905. LibName("FFMPEG", "-Wl,-read_only_relocs,suppress")
  906. LibName("FFMPEG", "-framework VideoDecodeAcceleration")
  907. elif os.path.isfile(GetThirdpartyDir() + "ffmpeg/lib/libavcodec.a"):
  908. # Needed when linking ffmpeg statically on Linux.
  909. LibName("FFMPEG", "-Wl,-Bsymbolic")
  910. # Don't export ffmpeg symbols from libp3ffmpeg when linking statically.
  911. for ffmpeg_lib in ffmpeg_libs:
  912. LibName("FFMPEG", "-Wl,--exclude-libs,%s.a" % (ffmpeg_lib))
  913. if GetTarget() != "darwin":
  914. for fcollada_lib in fcollada_libs:
  915. LibName("FCOLLADA", "-Wl,--exclude-libs,lib%s.a" % (fcollada_lib))
  916. if not PkgSkip("SWSCALE"):
  917. LibName("SWSCALE", "-Wl,--exclude-libs,libswscale.a")
  918. if not PkgSkip("SWRESAMPLE"):
  919. LibName("SWRESAMPLE", "-Wl,--exclude-libs,libswresample.a")
  920. if not PkgSkip("JPEG"):
  921. LibName("JPEG", "-Wl,--exclude-libs,libjpeg.a")
  922. if not PkgSkip("TIFF"):
  923. LibName("TIFF", "-Wl,--exclude-libs,libtiff.a")
  924. if not PkgSkip("PNG"):
  925. LibName("PNG", "-Wl,--exclude-libs,libpng.a")
  926. LibName("PNG", "-Wl,--exclude-libs,libpng16.a")
  927. if not PkgSkip("SQUISH"):
  928. LibName("SQUISH", "-Wl,--exclude-libs,libsquish.a")
  929. if not PkgSkip("OPENEXR"):
  930. LibName("OPENEXR", "-Wl,--exclude-libs,libHalf.a")
  931. LibName("OPENEXR", "-Wl,--exclude-libs,libIex.a")
  932. LibName("OPENEXR", "-Wl,--exclude-libs,libIexMath.a")
  933. LibName("OPENEXR", "-Wl,--exclude-libs,libIlmImf.a")
  934. LibName("OPENEXR", "-Wl,--exclude-libs,libIlmImfUtil.a")
  935. LibName("OPENEXR", "-Wl,--exclude-libs,libIlmThread.a")
  936. LibName("OPENEXR", "-Wl,--exclude-libs,libImath.a")
  937. if not PkgSkip("VORBIS"):
  938. LibName("VORBIS", "-Wl,--exclude-libs,libogg.a")
  939. LibName("VORBIS", "-Wl,--exclude-libs,libvorbis.a")
  940. LibName("VORBIS", "-Wl,--exclude-libs,libvorbisenc.a")
  941. LibName("VORBIS", "-Wl,--exclude-libs,libvorbisfile.a")
  942. if not PkgSkip("OPUS"):
  943. LibName("OPUS", "-Wl,--exclude-libs,libogg.a")
  944. LibName("OPUS", "-Wl,--exclude-libs,libopus.a")
  945. LibName("OPUS", "-Wl,--exclude-libs,libopusfile.a")
  946. if not PkgSkip("VRPN"):
  947. LibName("VRPN", "-Wl,--exclude-libs,libvrpn.a")
  948. LibName("VRPN", "-Wl,--exclude-libs,libquat.a")
  949. if not PkgSkip("ARTOOLKIT"):
  950. LibName("ARTOOLKIT", "-Wl,--exclude-libs,libAR.a")
  951. LibName("ARTOOLKIT", "-Wl,--exclude-libs,libARMulti.a")
  952. if PkgSkip("FFMPEG") or GetTarget() == "darwin":
  953. cv_lib = ChooseLib(("opencv_core", "cv"), "OPENCV")
  954. if cv_lib == "opencv_core":
  955. OPENCV_VER_23 = True
  956. SmartPkgEnable("OPENCV", "opencv", ("opencv_core", "opencv_highgui"), ("opencv2/core/core.hpp"))
  957. else:
  958. SmartPkgEnable("OPENCV", "opencv", ("cv", "highgui", "cvaux", "ml", "cxcore"),
  959. ("opencv", "opencv/cv.h", "opencv/cxcore.h", "opencv/highgui.h"))
  960. else:
  961. PkgDisable("OPENCV")
  962. if not PkgSkip("OPENAL"):
  963. if GetTarget() == "darwin":
  964. LibName("OPENAL", "-framework AudioUnit")
  965. LibName("OPENAL", "-framework AudioToolbox")
  966. LibName("OPENAL", "-framework CoreAudio")
  967. else:
  968. LibName("OPENAL", "-Wl,--exclude-libs,libopenal.a")
  969. if not PkgSkip("ASSIMP") and \
  970. os.path.isfile(GetThirdpartyDir() + "assimp/lib/libassimp.a"):
  971. # Also pick up IrrXML, which is needed when linking statically.
  972. irrxml = GetThirdpartyDir() + "assimp/lib/libIrrXML.a"
  973. if os.path.isfile(irrxml):
  974. LibName("ASSIMP", irrxml)
  975. if GetTarget() != "darwin":
  976. LibName("ASSIMP", "-Wl,--exclude-libs,libassimp.a")
  977. LibName("ASSIMP", "-Wl,--exclude-libs,libIrrXML.a")
  978. rocket_libs = ("RocketCore", "RocketControls")
  979. if (GetOptimize() <= 3):
  980. rocket_libs += ("RocketDebugger",)
  981. rocket_libs += ("boost_python",)
  982. SmartPkgEnable("ROCKET", "", rocket_libs, "Rocket/Core.h")
  983. if not PkgSkip("PYTHON"):
  984. python_lib = SDK["PYTHONVERSION"]
  985. SmartPkgEnable("PYTHON", "", python_lib, (SDK["PYTHONVERSION"], SDK["PYTHONVERSION"] + "/Python.h"))
  986. if GetTarget() == "linux":
  987. LibName("PYTHON", "-lutil")
  988. LibName("PYTHON", "-lrt")
  989. SmartPkgEnable("OPENSSL", "openssl", ("ssl", "crypto"), ("openssl/ssl.h", "openssl/crypto.h"))
  990. SmartPkgEnable("ZLIB", "zlib", ("z"), "zlib.h")
  991. SmartPkgEnable("GTK2", "gtk+-2.0")
  992. if not PkgSkip("OPENSSL") and GetTarget() != "darwin":
  993. LibName("OPENSSL", "-Wl,--exclude-libs,libssl.a")
  994. LibName("OPENSSL", "-Wl,--exclude-libs,libcrypto.a")
  995. if (RTDIST):
  996. SmartPkgEnable("WX", tool = "wx-config")
  997. SmartPkgEnable("FLTK", "", ("fltk"), ("FL/Fl.H"), tool = "fltk-config")
  998. if GetTarget() != 'darwin':
  999. # CgGL is covered by the Cg framework, and we don't need X11 components on OSX
  1000. if not PkgSkip("NVIDIACG") and not RUNTIME:
  1001. SmartPkgEnable("CGGL", "", ("CgGL"), "Cg/cgGL.h", thirdparty_dir = "nvidiacg")
  1002. if not RUNTIME and GetTarget() != "android":
  1003. SmartPkgEnable("X11", "x11", "X11", ("X11", "X11/Xlib.h", "X11/XKBlib.h"))
  1004. if GetHost() != "darwin":
  1005. # Workaround for an issue where pkg-config does not include this path
  1006. if GetTargetArch() in ("x86_64", "amd64"):
  1007. if (os.path.isdir("/usr/lib64/glib-2.0/include")):
  1008. IncDirectory("GTK2", "/usr/lib64/glib-2.0/include")
  1009. if (os.path.isdir("/usr/lib64/gtk-2.0/include")):
  1010. IncDirectory("GTK2", "/usr/lib64/gtk-2.0/include")
  1011. if not PkgSkip("X11"):
  1012. if (os.path.isdir("/usr/X11R6/lib64")):
  1013. LibDirectory("ALWAYS", "/usr/X11R6/lib64")
  1014. else:
  1015. LibDirectory("ALWAYS", "/usr/X11R6/lib")
  1016. elif not PkgSkip("X11"):
  1017. LibDirectory("ALWAYS", "/usr/X11R6/lib")
  1018. if RUNTIME:
  1019. # For the runtime, these packages are required
  1020. for pkg in ["OPENSSL", "ZLIB"]:
  1021. skips = []
  1022. if (pkg in PkgListGet() and PkgSkip(pkg)==1):
  1023. skips.append(pkg)
  1024. if skips:
  1025. exit("Runtime must be compiled with OpenSSL and ZLib support (missing %s)" % (', '.join(skips)))
  1026. for pkg in MAYAVERSIONS:
  1027. if (PkgSkip(pkg)==0 and (pkg in SDK)):
  1028. if (GetHost() == "darwin"):
  1029. # Sheesh, Autodesk really can't make up their mind
  1030. # regarding the location of the Maya devkit on macOS.
  1031. if (os.path.isdir(SDK[pkg] + "/Maya.app/Contents/lib")):
  1032. LibDirectory(pkg, SDK[pkg] + "/Maya.app/Contents/lib")
  1033. if (os.path.isdir(SDK[pkg] + "/Maya.app/Contents/MacOS")):
  1034. LibDirectory(pkg, SDK[pkg] + "/Maya.app/Contents/MacOS")
  1035. if (os.path.isdir(SDK[pkg] + "/lib")):
  1036. LibDirectory(pkg, SDK[pkg] + "/lib")
  1037. if (os.path.isdir(SDK[pkg] + "/Maya.app/Contents/include/maya")):
  1038. IncDirectory(pkg, SDK[pkg] + "/Maya.app/Contents/include")
  1039. if (os.path.isdir(SDK[pkg] + "/devkit/include/maya")):
  1040. IncDirectory(pkg, SDK[pkg] + "/devkit/include")
  1041. if (os.path.isdir(SDK[pkg] + "/include/maya")):
  1042. IncDirectory(pkg, SDK[pkg] + "/include")
  1043. else:
  1044. LibDirectory(pkg, SDK[pkg] + "/lib")
  1045. IncDirectory(pkg, SDK[pkg] + "/include")
  1046. DefSymbol(pkg, "MAYAVERSION", pkg)
  1047. if GetTarget() == 'darwin':
  1048. LibName("ALWAYS", "-framework AppKit")
  1049. LibName("AGL", "-framework AGL")
  1050. LibName("CARBON", "-framework Carbon")
  1051. LibName("COCOA", "-framework Cocoa")
  1052. # Fix for a bug in OSX Leopard:
  1053. LibName("GL", "-dylib_file /System/Library/Frameworks/OpenGL.framework/Versions/A/Libraries/libGL.dylib:/System/Library/Frameworks/OpenGL.framework/Versions/A/Libraries/libGL.dylib")
  1054. if GetTarget() == 'android':
  1055. LibName("ALWAYS", '-llog')
  1056. LibName("ANDROID", '-landroid')
  1057. LibName("JNIGRAPHICS", '-ljnigraphics')
  1058. for pkg in MAYAVERSIONS:
  1059. if (PkgSkip(pkg)==0 and (pkg in SDK)):
  1060. if GetTarget() == 'darwin':
  1061. LibName(pkg, "-Wl,-rpath,/Applications/Autodesk/" + pkg.lower() + "/Maya.app/Contents/MacOS")
  1062. else:
  1063. LibName(pkg, "-Wl,-rpath," + SDK[pkg] + "/lib")
  1064. LibName(pkg, "-lOpenMaya")
  1065. LibName(pkg, "-lOpenMayaAnim")
  1066. LibName(pkg, "-lOpenMayaUI")
  1067. LibName(pkg, "-lAnimSlice")
  1068. LibName(pkg, "-lDeformSlice")
  1069. LibName(pkg, "-lModifiers")
  1070. LibName(pkg, "-lDynSlice")
  1071. LibName(pkg, "-lKinSlice")
  1072. LibName(pkg, "-lModelSlice")
  1073. LibName(pkg, "-lNurbsSlice")
  1074. LibName(pkg, "-lPolySlice")
  1075. LibName(pkg, "-lProjectSlice")
  1076. LibName(pkg, "-lImage")
  1077. LibName(pkg, "-lShared")
  1078. LibName(pkg, "-lTranslators")
  1079. LibName(pkg, "-lDataModel")
  1080. LibName(pkg, "-lRenderModel")
  1081. LibName(pkg, "-lNurbsEngine")
  1082. LibName(pkg, "-lDependEngine")
  1083. LibName(pkg, "-lCommandEngine")
  1084. LibName(pkg, "-lFoundation")
  1085. if pkg != "MAYA2020":
  1086. LibName(pkg, "-lIMFbase")
  1087. if GetTarget() != 'darwin':
  1088. LibName(pkg, "-lOpenMayalib")
  1089. else:
  1090. LibName(pkg, "-dylib_file /System/Library/Frameworks/OpenGL.framework/Versions/A/Libraries/libGL.dylib:/System/Library/Frameworks/OpenGL.framework/Versions/A/Libraries/libGL.dylib")
  1091. if (PkgSkip("PHYSX")==0):
  1092. IncDirectory("PHYSX", SDK["PHYSX"] + "/Physics/include")
  1093. IncDirectory("PHYSX", SDK["PHYSX"] + "/PhysXLoader/include")
  1094. IncDirectory("PHYSX", SDK["PHYSX"] + "/NxCharacter/include")
  1095. IncDirectory("PHYSX", SDK["PHYSX"] + "/NxExtensions/include")
  1096. IncDirectory("PHYSX", SDK["PHYSX"] + "/Foundation/include")
  1097. IncDirectory("PHYSX", SDK["PHYSX"] + "/Cooking/include")
  1098. LibDirectory("PHYSX", SDK["PHYSXLIBS"])
  1099. if (GetHost() == "darwin"):
  1100. LibName("PHYSX", SDK["PHYSXLIBS"] + "/osxstatic/PhysXCooking.a")
  1101. LibName("PHYSX", SDK["PHYSXLIBS"] + "/osxstatic/PhysXCore.a")
  1102. else:
  1103. LibName("PHYSX", "-lPhysXLoader")
  1104. LibName("PHYSX", "-lNxCharacter")
  1105. DefSymbol("WITHINPANDA", "WITHIN_PANDA", "1")
  1106. if GetLinkAllStatic():
  1107. DefSymbol("ALWAYS", "LINK_ALL_STATIC")
  1108. if GetTarget() == 'android':
  1109. DefSymbol("ALWAYS", "ANDROID")
  1110. if not PkgSkip("EIGEN"):
  1111. if GetOptimize() >= 3:
  1112. if COMPILER == "MSVC":
  1113. # Squeeze out a bit more performance on MSVC builds...
  1114. # Only do this if EIGEN_NO_DEBUG is also set, otherwise it
  1115. # will turn them into runtime assertions.
  1116. DefSymbol("ALWAYS", "EIGEN_NO_STATIC_ASSERT")
  1117. if not PkgSkip("EGL"):
  1118. DefSymbol('EGL', 'HAVE_EGL', '')
  1119. if PkgSkip("X11"):
  1120. DefSymbol('EGL', 'EGL_NO_X11', '')
  1121. if not PkgSkip("X11"):
  1122. DefSymbol('X11', 'USE_X11', '')
  1123. ########################################################################
  1124. ##
  1125. ## Give a Status Report on Command-Line Options
  1126. ##
  1127. ########################################################################
  1128. def printStatus(header,warnings):
  1129. if GetVerbose():
  1130. print("")
  1131. print("-------------------------------------------------------------------")
  1132. print(header)
  1133. tkeep = ""
  1134. tomit = ""
  1135. for x in PkgListGet():
  1136. if PkgSkip(x):
  1137. tomit = tomit + x + " "
  1138. else:
  1139. tkeep = tkeep + x + " "
  1140. if RTDIST:
  1141. print("Makepanda: Runtime distribution build")
  1142. elif RUNTIME:
  1143. print("Makepanda: Runtime build")
  1144. else:
  1145. print("Makepanda: Regular build")
  1146. print("Makepanda: Compiler: %s" % (COMPILER))
  1147. print("Makepanda: Optimize: %d" % (GetOptimize()))
  1148. print("Makepanda: Keep Pkg: %s" % (tkeep))
  1149. print("Makepanda: Omit Pkg: %s" % (tomit))
  1150. if GENMAN:
  1151. print("Makepanda: Generate API reference manual")
  1152. else:
  1153. print("Makepanda: Don't generate API reference manual")
  1154. if GetHost() == "windows" and not RTDIST:
  1155. if INSTALLER:
  1156. print("Makepanda: Build installer, using %s" % (COMPRESSOR))
  1157. else:
  1158. print("Makepanda: Don't build installer")
  1159. print("Makepanda: Version ID: %s" % (VERSION))
  1160. for x in warnings:
  1161. print("Makepanda: %s" % (x))
  1162. print("-------------------------------------------------------------------")
  1163. print("")
  1164. sys.stdout.flush()
  1165. ########################################################################
  1166. ##
  1167. ## BracketNameWithQuotes
  1168. ##
  1169. ########################################################################
  1170. def BracketNameWithQuotes(name):
  1171. # Workaround for OSX bug - compiler doesn't like those flags quoted.
  1172. if (name.startswith("-framework")): return name
  1173. if (name.startswith("-dylib_file")): return name
  1174. # Don't add quotes when it's not necessary.
  1175. if " " not in name: return name
  1176. # Account for quoted name (leave as is) but quote everything else (e.g., to protect spaces within paths from improper parsing)
  1177. if (name.startswith('"') and name.endswith('"')): return name
  1178. else: return '"' + name + '"'
  1179. ########################################################################
  1180. ##
  1181. ## CompileCxx
  1182. ##
  1183. ########################################################################
  1184. def CompileCxx(obj,src,opts):
  1185. ipath = GetListOption(opts, "DIR:")
  1186. optlevel = GetOptimizeOption(opts)
  1187. if (COMPILER=="MSVC"):
  1188. if not BOOUSEINTELCOMPILER:
  1189. cmd = "cl "
  1190. if GetTargetArch() == 'x64':
  1191. cmd += "/favor:blend "
  1192. cmd += "/wd4996 /wd4275 /wd4273 "
  1193. # We still target Windows XP.
  1194. cmd += "/DWINVER=0x501 "
  1195. # Work around a WinXP/2003 bug when using VS 2015+.
  1196. if SDK.get("VISUALSTUDIO_VERSION") >= (14,0):
  1197. cmd += "/Zc:threadSafeInit- "
  1198. cmd += "/Fo" + obj + " /nologo /c"
  1199. if GetTargetArch() == 'x86':
  1200. # x86 (32 bit) MSVC 2015+ defaults to /arch:SSE2
  1201. if not PkgSkip("SSE2") or 'SSE2' in opts: # x86 with SSE2
  1202. cmd += " /arch:SSE2" # let's still be explicit and pass in /arch:SSE2
  1203. else: # x86 without SSE2
  1204. cmd += " /arch:IA32"
  1205. for x in ipath: cmd += " /I" + x
  1206. for (opt,dir) in INCDIRECTORIES:
  1207. if (opt=="ALWAYS") or (opt in opts): cmd += " /I" + BracketNameWithQuotes(dir)
  1208. for (opt,var,val) in DEFSYMBOLS:
  1209. if (opt=="ALWAYS") or (opt in opts): cmd += " /D" + var + "=" + val
  1210. if (opts.count('MSFORSCOPE')): cmd += ' /Zc:forScope-'
  1211. if (optlevel==1): cmd += " /MDd /Zi /RTCs /GS"
  1212. if (optlevel==2): cmd += " /MDd /Zi"
  1213. if (optlevel==3): cmd += " /MD /Zi /GS- /O2 /Ob2 /Oi /Ot /fp:fast"
  1214. if (optlevel==4):
  1215. cmd += " /MD /Zi /GS- /Ox /Ob2 /Oi /Ot /fp:fast /DFORCE_INLINING /DNDEBUG /GL"
  1216. cmd += " /Oy /Zp16" # jean-claude add /Zp16 insures correct static alignment for SSEx
  1217. cmd += " /Fd" + os.path.splitext(obj)[0] + ".pdb"
  1218. building = GetValueOption(opts, "BUILDING:")
  1219. if (building):
  1220. cmd += " /DBUILDING_" + building
  1221. if ("BIGOBJ" in opts) or GetTargetArch() == 'x64':
  1222. cmd += " /bigobj"
  1223. cmd += " /Zm300 /DWIN32_VC /DWIN32"
  1224. if 'EXCEPTIONS' in opts:
  1225. cmd += " /EHsc"
  1226. else:
  1227. cmd += " /D_HAS_EXCEPTIONS=0"
  1228. if 'RTTI' not in opts:
  1229. cmd += " /GR-"
  1230. if GetTargetArch() == 'x64':
  1231. cmd += " /DWIN64_VC /DWIN64"
  1232. if WINDOWS_SDK.startswith('7.') and MSVC_VERSION > (10,):
  1233. # To preserve Windows XP compatibility.
  1234. cmd += " /D_USING_V110_SDK71_"
  1235. cmd += " /W3 " + BracketNameWithQuotes(src)
  1236. oscmd(cmd)
  1237. else:
  1238. cmd = "icl "
  1239. if GetTargetArch() == 'x64':
  1240. cmd += "/favor:blend "
  1241. cmd += "/wd4996 /wd4275 /wd4267 /wd4101 /wd4273 "
  1242. cmd += "/DWINVER=0x501 "
  1243. cmd += "/Fo" + obj + " /c"
  1244. for x in ipath: cmd += " /I" + x
  1245. for (opt,dir) in INCDIRECTORIES:
  1246. if (opt=="ALWAYS") or (opt in opts): cmd += " /I" + BracketNameWithQuotes(dir)
  1247. for (opt,var,val) in DEFSYMBOLS:
  1248. if (opt=="ALWAYS") or (opt in opts): cmd += " /D" + var + "=" + val
  1249. if (opts.count('MSFORSCOPE')): cmd += ' /Zc:forScope-'
  1250. if (optlevel==1): cmd += " /MDd /Zi /RTCs /GS"
  1251. if (optlevel==2): cmd += " /MDd /Zi /arch:SSE3"
  1252. # core changes from jean-claude (dec 2011)
  1253. # ----------------------------------------
  1254. # performance will be seeked at level 3 & 4
  1255. # -----------------------------------------
  1256. if (optlevel==3):
  1257. cmd += " /MD /Zi /O2 /Oi /Ot /arch:SSE3"
  1258. cmd += " /Ob0"
  1259. cmd += " /Qipo-" # beware of IPO !!!
  1260. ## Lesson learned: Don't use /GL flag -> end result is MESSY
  1261. ## ----------------------------------------------------------------
  1262. if (optlevel==4):
  1263. cmd += " /MD /Zi /O3 /Oi /Ot /Ob0 /Yc /DNDEBUG" # /Ob0 a ete rajoute en cours de route a 47%
  1264. cmd += " /Qipo" # optimization multi file
  1265. # for 3 & 4 optimization levels
  1266. # -----------------------------
  1267. if (optlevel>=3):
  1268. cmd += " /fp:fast=2"
  1269. cmd += " /Qftz"
  1270. cmd += " /Qfp-speculation:fast"
  1271. cmd += " /Qopt-matmul" # needs /O2 or /O3
  1272. cmd += " /Qprec-div-"
  1273. cmd += " /Qsimd"
  1274. cmd += " /QxHost" # compile for target host; Compiling for distribs should probably strictly enforce /arch:..
  1275. cmd += " /Quse-intel-optimized-headers" # use intel optimized headers
  1276. cmd += " /Qparallel" # enable parallelization
  1277. cmd += " /Qvc10" # for Microsoft Visual C++ 2010
  1278. ## PCH files coexistence: the /Qpchi option causes the Intel C++ Compiler to name its
  1279. ## PCH files with a .pchi filename suffix and reduce build time.
  1280. ## The /Qpchi option is on by default but interferes with Microsoft libs; so use /Qpchi- to turn it off.
  1281. ## I need to have a deeper look at this since the compile time is quite influenced by this setting !!!
  1282. cmd += " /Qpchi-" # keep it this way!
  1283. ## Inlining seems to be an issue here ! (the linker doesn't find necessary info later on)
  1284. ## ------------------------------------
  1285. ## so don't use cmd += " /DFORCE_INLINING" (need to check why with Panda developpers!)
  1286. ## Inline expansion /Ob1 : Allow functions marked inline to be inlined.
  1287. ## Inline any /Ob2 : Inline functions deemed appropriate by compiler.
  1288. ## Ctor displacement /vd0 : Disable constructor displacement.
  1289. ## Choose this option only if no class constructors or destructors call virtual functions.
  1290. ## Use /vd1 (default) to enable. Alternate: #pragma vtordisp
  1291. ## Best case ptrs /vmb : Use best case "pointer to class member" representation.
  1292. ## Use this option if you always define a class before you declare a pointer to a member of the class.
  1293. ## The compiler will issue an error if it encounters a pointer declaration before the class is defined.
  1294. ## Alternate: #pragma pointers_to_members
  1295. cmd += " /Fd" + os.path.splitext(obj)[0] + ".pdb"
  1296. building = GetValueOption(opts, "BUILDING:")
  1297. if (building): cmd += " /DBUILDING_" + building
  1298. if ("BIGOBJ" in opts) or GetTargetArch() == 'x64':
  1299. cmd += " /bigobj"
  1300. # level of warnings and optimization reports
  1301. if GetVerbose():
  1302. cmd += " /W3 " # or /W4 or /Wall
  1303. cmd += " /Qopt-report:2 /Qopt-report-phase:hlo /Qopt-report-phase:hpo" # some optimization reports
  1304. else:
  1305. cmd += " /W1 "
  1306. cmd += " /EHa /Zm300 /DWIN32_VC /DWIN32"
  1307. if GetTargetArch() == 'x64':
  1308. cmd += " /DWIN64_VC /DWIN64"
  1309. cmd += " " + BracketNameWithQuotes(src)
  1310. oscmd(cmd)
  1311. if (COMPILER=="GCC"):
  1312. if (src.endswith(".c")): cmd = GetCC() +' -fPIC -c -o ' + obj
  1313. else: cmd = GetCXX()+' -std=gnu++11 -ftemplate-depth-70 -fPIC -c -o ' + obj
  1314. for (opt, dir) in INCDIRECTORIES:
  1315. if (opt=="ALWAYS") or (opt in opts): cmd += ' -I' + BracketNameWithQuotes(dir)
  1316. for (opt, dir) in FRAMEWORKDIRECTORIES:
  1317. if (opt=="ALWAYS") or (opt in opts): cmd += ' -F' + BracketNameWithQuotes(dir)
  1318. for (opt,var,val) in DEFSYMBOLS:
  1319. if (opt=="ALWAYS") or (opt in opts): cmd += ' -D' + var + '=' + val
  1320. for x in ipath: cmd += ' -I' + x
  1321. if not GetLinkAllStatic() and 'NOHIDDEN' not in opts:
  1322. cmd += ' -fvisibility=hidden'
  1323. # Mac-specific flags.
  1324. if GetTarget() == "darwin":
  1325. cmd += " -Wno-deprecated-declarations"
  1326. if OSXTARGET is not None:
  1327. cmd += " -isysroot " + SDK["MACOSX"]
  1328. cmd += " -mmacosx-version-min=%d.%d" % (OSXTARGET)
  1329. elif platform.mac_ver()[0].startswith('11.'):
  1330. cmd += " -mmacosx-version-min=11.0"
  1331. for arch in OSX_ARCHS:
  1332. if 'NOARCH:' + arch.upper() not in opts:
  1333. cmd += " -arch %s" % arch
  1334. if "SYSROOT" in SDK:
  1335. if GetTarget() != "android":
  1336. cmd += ' --sysroot=%s' % (SDK["SYSROOT"])
  1337. else:
  1338. ndk_dir = SDK["ANDROID_NDK"].replace('\\', '/')
  1339. cmd += ' -isystem %s/sysroot/usr/include' % (ndk_dir)
  1340. cmd += ' -isystem %s/sysroot/usr/include/%s' % (ndk_dir, SDK["ANDROID_TRIPLE"])
  1341. cmd += ' -no-canonical-prefixes'
  1342. # Android-specific flags.
  1343. arch = GetTargetArch()
  1344. if GetTarget() == "android":
  1345. # Most of the specific optimization flags here were
  1346. # just copied from the default Android Makefiles.
  1347. if "ANDROID_API" in SDK:
  1348. cmd += ' -D__ANDROID_API__=' + str(SDK["ANDROID_API"])
  1349. if "ANDROID_GCC_TOOLCHAIN" in SDK:
  1350. cmd += ' -gcc-toolchain ' + SDK["ANDROID_GCC_TOOLCHAIN"].replace('\\', '/')
  1351. cmd += ' -ffunction-sections -funwind-tables'
  1352. if arch == 'armv7a':
  1353. cmd += ' -target armv7-none-linux-androideabi'
  1354. cmd += ' -march=armv7-a -mfloat-abi=softfp -mfpu=vfpv3-d16'
  1355. cmd += ' -fno-integrated-as'
  1356. elif arch == 'arm':
  1357. cmd += ' -target armv5te-none-linux-androideabi'
  1358. cmd += ' -march=armv5te -mtune=xscale -msoft-float'
  1359. cmd += ' -fno-integrated-as'
  1360. elif arch == 'aarch64':
  1361. cmd += ' -target aarch64-none-linux-android'
  1362. elif arch == 'mips':
  1363. cmd += ' -target mipsel-none-linux-android'
  1364. cmd += ' -mips32'
  1365. elif arch == 'mips64':
  1366. cmd += ' -target mips64el-none-linux-android'
  1367. cmd += ' -fintegrated-as'
  1368. elif arch == 'x86':
  1369. cmd += ' -target i686-none-linux-android'
  1370. cmd += ' -march=i686 -mtune=intel -mssse3 -mfpmath=sse -m32'
  1371. cmd += ' -mstackrealign'
  1372. elif arch == 'x86_64':
  1373. cmd += ' -target x86_64-none-linux-android'
  1374. cmd += ' -march=x86-64 -msse4.2 -mpopcnt -m64 -mtune=intel'
  1375. cmd += " -Wa,--noexecstack"
  1376. # Do we want thumb or arm instructions?
  1377. if arch.startswith('arm'):
  1378. if optlevel >= 3:
  1379. cmd += ' -mthumb'
  1380. else:
  1381. cmd += ' -marm'
  1382. # Enable SIMD instructions if requested
  1383. if arch.startswith('arm') and PkgSkip("NEON") == 0:
  1384. cmd += ' -mfpu=neon'
  1385. else:
  1386. cmd += " -pthread"
  1387. if not src.endswith(".c"):
  1388. # We don't use exceptions for most modules.
  1389. if 'EXCEPTIONS' in opts:
  1390. cmd += " -fexceptions"
  1391. else:
  1392. cmd += " -fno-exceptions"
  1393. if src.endswith(".mm"):
  1394. # Work around Apple compiler bug.
  1395. cmd += " -U__EXCEPTIONS"
  1396. target = GetTarget()
  1397. if 'RTTI' not in opts and target != "darwin":
  1398. # We always disable RTTI on Android for memory usage reasons.
  1399. if optlevel >= 4 or target == "android":
  1400. cmd += " -fno-rtti"
  1401. if ('SSE2' in opts or not PkgSkip("SSE2")) and not arch.startswith("arm") and arch != 'aarch64':
  1402. cmd += " -msse2"
  1403. # Needed by both Python, Panda, Eigen, all of which break aliasing rules.
  1404. cmd += " -fno-strict-aliasing"
  1405. if optlevel >= 3:
  1406. cmd += " -ffast-math -fno-stack-protector"
  1407. if optlevel == 3:
  1408. # Fast math is nice, but we'd like to see NaN in dev builds.
  1409. cmd += " -fno-finite-math-only"
  1410. # Make sure this is off to avoid GCC/Eigen bug (see GitHub #228)
  1411. cmd += " -fno-unsafe-math-optimizations"
  1412. if (optlevel==1): cmd += " -ggdb -D_DEBUG"
  1413. if (optlevel==2): cmd += " -O1 -D_DEBUG"
  1414. if (optlevel==3): cmd += " -O2"
  1415. if (optlevel==4): cmd += " -O3 -DNDEBUG"
  1416. # Enable more warnings.
  1417. cmd += " -Wall -Wno-unused-function"
  1418. if not src.endswith(".c"):
  1419. cmd += " -Wno-reorder"
  1420. # Ignore unused variables in NDEBUG builds, often used in asserts.
  1421. if optlevel == 4:
  1422. cmd += " -Wno-unused-variable"
  1423. if src.endswith(".c"):
  1424. cmd += ' ' + CFLAGS
  1425. else:
  1426. cmd += ' ' + CXXFLAGS
  1427. cmd = cmd.rstrip()
  1428. building = GetValueOption(opts, "BUILDING:")
  1429. if (building): cmd += " -DBUILDING_" + building
  1430. cmd += ' ' + BracketNameWithQuotes(src)
  1431. oscmd(cmd)
  1432. ########################################################################
  1433. ##
  1434. ## CompileBison
  1435. ##
  1436. ########################################################################
  1437. def CompileBison(wobj, wsrc, opts):
  1438. ifile = os.path.basename(wsrc)
  1439. wdsth = GetOutputDir()+"/include/" + ifile[:-4] + ".h"
  1440. wdstc = GetOutputDir()+"/tmp/" + ifile + ".cxx"
  1441. pre = GetValueOption(opts, "BISONPREFIX_")
  1442. bison = GetBison()
  1443. if bison is None:
  1444. # We don't have bison. See if there is a prebuilt file.
  1445. base, ext = os.path.splitext(wsrc)
  1446. if os.path.isfile(base + '.h.prebuilt') and \
  1447. os.path.isfile(base + '.cxx.prebuilt'):
  1448. CopyFile(wdstc, base + '.cxx.prebuilt')
  1449. CopyFile(wdsth, base + '.h.prebuilt')
  1450. else:
  1451. exit('Could not find bison!')
  1452. else:
  1453. oscmd(bison + ' -y -d -o'+GetOutputDir()+'/tmp/'+ifile+'.c -p '+pre+' '+wsrc)
  1454. CopyFile(wdstc, GetOutputDir()+"/tmp/"+ifile+".c")
  1455. CopyFile(wdsth, GetOutputDir()+"/tmp/"+ifile+".h")
  1456. # Finally, compile the generated source file.
  1457. CompileCxx(wobj, wdstc, opts + ["FLEX"])
  1458. ########################################################################
  1459. ##
  1460. ## CompileFlex
  1461. ##
  1462. ########################################################################
  1463. def CompileFlex(wobj,wsrc,opts):
  1464. ifile = os.path.basename(wsrc)
  1465. wdst = GetOutputDir()+"/tmp/"+ifile+".cxx"
  1466. pre = GetValueOption(opts, "BISONPREFIX_")
  1467. dashi = opts.count("FLEXDASHI")
  1468. flex = GetFlex()
  1469. want_version = GetValueOption(opts, "FLEXVERSION:")
  1470. if flex and want_version:
  1471. # Is flex at the required version for this file?
  1472. want_version = tuple(map(int, want_version.split('.')))
  1473. have_version = GetFlexVersion()
  1474. if want_version > have_version:
  1475. Warn("Skipping flex %s for file %s, need at least %s" % (
  1476. '.'.join(map(str, have_version)),
  1477. ifile,
  1478. '.'.join(map(str, want_version)),
  1479. ))
  1480. flex = None
  1481. if flex is None:
  1482. # We don't have flex. See if there is a prebuilt file.
  1483. base, ext = os.path.splitext(wsrc)
  1484. if os.path.isfile(base + '.cxx.prebuilt'):
  1485. CopyFile(wdst, base + '.cxx.prebuilt')
  1486. else:
  1487. exit('Could not find flex!')
  1488. else:
  1489. if (dashi):
  1490. oscmd(flex + " -i -P" + pre + " -o"+wdst+" "+wsrc)
  1491. else:
  1492. oscmd(flex + " -P" + pre + " -o"+wdst+" "+wsrc)
  1493. # Finally, compile the generated source file.
  1494. CompileCxx(wobj, wdst, opts + ["FLEX"])
  1495. ########################################################################
  1496. ##
  1497. ## CompileIgate
  1498. ##
  1499. ########################################################################
  1500. def CompileIgate(woutd,wsrc,opts):
  1501. outbase = os.path.basename(woutd)[:-3]
  1502. woutc = GetOutputDir()+"/tmp/"+outbase+"_igate.cxx"
  1503. srcdir = GetValueOption(opts, "SRCDIR:")
  1504. module = GetValueOption(opts, "IMOD:")
  1505. library = GetValueOption(opts, "ILIB:")
  1506. ipath = GetListOption(opts, "DIR:")
  1507. if (PkgSkip("PYTHON")):
  1508. WriteFile(woutc, "")
  1509. WriteFile(woutd, "")
  1510. ConditionalWriteFile(woutd, "")
  1511. return
  1512. if not CrossCompiling():
  1513. # If we're compiling for this platform, we can use the one we've built.
  1514. cmd = os.path.join(GetOutputDir(), 'bin', 'interrogate')
  1515. else:
  1516. # Assume that interrogate is on the PATH somewhere.
  1517. cmd = 'interrogate'
  1518. if GetVerbose():
  1519. cmd += ' -v'
  1520. cmd += ' -srcdir %s -I%s' % (srcdir, srcdir)
  1521. cmd += ' -DCPPPARSER -D__STDC__=1 -D__cplusplus=201103L'
  1522. if (COMPILER=="MSVC"):
  1523. cmd += ' -DWIN32_VC -DWIN32 -D_WIN32'
  1524. if GetTargetArch() == 'x64':
  1525. cmd += ' -DWIN64_VC -DWIN64 -D_WIN64 -D_M_X64 -D_M_AMD64'
  1526. else:
  1527. cmd += ' -D_M_IX86'
  1528. # NOTE: this 1600 value is the version number for VC2010.
  1529. cmd += ' -D_MSC_VER=1600 -D"__declspec(param)=" -D__cdecl -D_near -D_far -D__near -D__far -D__stdcall'
  1530. if (COMPILER=="GCC"):
  1531. cmd += ' -D__attribute__\\(x\\)='
  1532. target_arch = GetTargetArch()
  1533. if target_arch in ("x86_64", "amd64"):
  1534. cmd += ' -D_LP64'
  1535. elif target_arch in ('aarch64', 'arm64'):
  1536. cmd += ' -D_LP64 -D__LP64__ -D__aarch64__'
  1537. else:
  1538. cmd += ' -D__i386__'
  1539. target = GetTarget()
  1540. if target == 'darwin':
  1541. cmd += ' -D__APPLE__'
  1542. elif target == 'android':
  1543. cmd += ' -D__ANDROID__'
  1544. optlevel = GetOptimizeOption(opts)
  1545. if (optlevel==1): cmd += ' -D_DEBUG'
  1546. if (optlevel==2): cmd += ' -D_DEBUG'
  1547. if (optlevel==3): pass
  1548. if (optlevel==4): cmd += ' -DNDEBUG'
  1549. cmd += ' -oc ' + woutc + ' -od ' + woutd
  1550. cmd += ' -fnames -string -refcount -assert -python-native'
  1551. cmd += ' -S' + GetOutputDir() + '/include/parser-inc'
  1552. # Add -I, -S and -D flags
  1553. for x in ipath:
  1554. cmd += ' -I' + BracketNameWithQuotes(x)
  1555. for (opt,dir) in INCDIRECTORIES:
  1556. if (opt=="ALWAYS") or (opt in opts):
  1557. cmd += ' -S' + BracketNameWithQuotes(dir)
  1558. for (opt,var,val) in DEFSYMBOLS:
  1559. if (opt=="ALWAYS") or (opt in opts):
  1560. cmd += ' -D' + var + '=' + val
  1561. #building = GetValueOption(opts, "BUILDING:")
  1562. #if (building): cmd += " -DBUILDING_"+building
  1563. cmd += ' -module ' + module + ' -library ' + library
  1564. for x in wsrc:
  1565. if (x.startswith("/")):
  1566. cmd += ' ' + BracketNameWithQuotes(x)
  1567. else:
  1568. cmd += ' ' + BracketNameWithQuotes(os.path.basename(x))
  1569. oscmd(cmd)
  1570. ########################################################################
  1571. ##
  1572. ## CompileImod
  1573. ##
  1574. ########################################################################
  1575. def CompileImod(wobj, wsrc, opts):
  1576. module = GetValueOption(opts, "IMOD:")
  1577. library = GetValueOption(opts, "ILIB:")
  1578. if (COMPILER=="MSVC"):
  1579. woutc = wobj[:-4]+".cxx"
  1580. if (COMPILER=="GCC"):
  1581. woutc = wobj[:-2]+".cxx"
  1582. if (PkgSkip("PYTHON")):
  1583. WriteFile(woutc, "")
  1584. CompileCxx(wobj, woutc, opts)
  1585. return
  1586. if not CrossCompiling():
  1587. # If we're compiling for this platform, we can use the one we've built.
  1588. cmd = os.path.join(GetOutputDir(), 'bin', 'interrogate_module')
  1589. else:
  1590. # Assume that interrogate_module is on the PATH somewhere.
  1591. cmd = 'interrogate_module'
  1592. cmd += ' -oc ' + woutc + ' -module ' + module + ' -library ' + library + ' -python-native'
  1593. importmod = GetValueOption(opts, "IMPORT:")
  1594. if importmod:
  1595. cmd += ' -import ' + importmod
  1596. for x in wsrc: cmd += ' ' + BracketNameWithQuotes(x)
  1597. oscmd(cmd)
  1598. CompileCxx(wobj,woutc,opts)
  1599. return
  1600. ########################################################################
  1601. ##
  1602. ## CompileLib
  1603. ##
  1604. ########################################################################
  1605. def CompileLib(lib, obj, opts):
  1606. if (COMPILER=="MSVC"):
  1607. if not BOOUSEINTELCOMPILER:
  1608. #Use MSVC Linker
  1609. cmd = 'link /lib /nologo'
  1610. if GetOptimizeOption(opts) == 4:
  1611. cmd += " /LTCG"
  1612. if HasTargetArch():
  1613. cmd += " /MACHINE:" + GetTargetArch().upper()
  1614. cmd += ' /OUT:' + BracketNameWithQuotes(lib)
  1615. for x in obj:
  1616. if not x.endswith('.lib'):
  1617. cmd += ' ' + BracketNameWithQuotes(x)
  1618. oscmd(cmd)
  1619. else:
  1620. # Choose Intel linker; from Jean-Claude
  1621. cmd = 'xilink /verbose:lib /lib '
  1622. if HasTargetArch():
  1623. cmd += " /MACHINE:" + GetTargetArch().upper()
  1624. cmd += ' /OUT:' + BracketNameWithQuotes(lib)
  1625. for x in obj: cmd += ' ' + BracketNameWithQuotes(x)
  1626. cmd += ' /LIBPATH:"C:\\Program Files (x86)\\Intel\\Composer XE 2011 SP1\\ipp\\lib\\ia32"'
  1627. cmd += ' /LIBPATH:"C:\\Program Files (x86)\\Intel\\Composer XE 2011 SP1\\TBB\\Lib\\ia32\\vc10"'
  1628. cmd += ' /LIBPATH:"C:\\Program Files (x86)\\Intel\\Composer XE 2011 SP1\\compiler\\lib\\ia32"'
  1629. oscmd(cmd)
  1630. if (COMPILER=="GCC"):
  1631. if GetTarget() == 'darwin':
  1632. cmd = 'libtool -static -o ' + BracketNameWithQuotes(lib)
  1633. else:
  1634. cmd = GetAR() + ' cru ' + BracketNameWithQuotes(lib)
  1635. for x in obj:
  1636. if GetLinkAllStatic() and x.endswith('.a'):
  1637. continue
  1638. cmd += ' ' + BracketNameWithQuotes(x)
  1639. oscmd(cmd)
  1640. oscmd(GetRanlib() + ' ' + BracketNameWithQuotes(lib))
  1641. ########################################################################
  1642. ##
  1643. ## CompileLink
  1644. ##
  1645. ########################################################################
  1646. def CompileLink(dll, obj, opts):
  1647. if (COMPILER=="MSVC"):
  1648. if not BOOUSEINTELCOMPILER:
  1649. cmd = "link /nologo "
  1650. if HasTargetArch():
  1651. cmd += " /MACHINE:" + GetTargetArch().upper()
  1652. if ("MFC" not in opts):
  1653. cmd += " /NOD:MFC90.LIB /NOD:MFC80.LIB /NOD:LIBCMT"
  1654. cmd += " /NOD:LIBCI.LIB /DEBUG"
  1655. cmd += " /nod:libc /nod:libcmtd /nod:atlthunk /nod:atls /nod:atlsd"
  1656. if (GetOrigExt(dll) != ".exe"): cmd += " /DLL"
  1657. optlevel = GetOptimizeOption(opts)
  1658. if (optlevel==1): cmd += " /MAP /MAPINFO:EXPORTS /NOD:MSVCRT.LIB /NOD:MSVCPRT.LIB /NOD:MSVCIRT.LIB"
  1659. if (optlevel==2): cmd += " /MAP:NUL /NOD:MSVCRT.LIB /NOD:MSVCPRT.LIB /NOD:MSVCIRT.LIB"
  1660. if (optlevel==3): cmd += " /MAP:NUL /NOD:MSVCRTD.LIB /NOD:MSVCPRTD.LIB /NOD:MSVCIRTD.LIB"
  1661. if (optlevel==4): cmd += " /MAP:NUL /LTCG /NOD:MSVCRTD.LIB /NOD:MSVCPRTD.LIB /NOD:MSVCIRTD.LIB"
  1662. if ("MFC" in opts):
  1663. if (optlevel<=2): cmd += " /NOD:MSVCRTD.LIB mfcs100d.lib MSVCRTD.lib"
  1664. else: cmd += " /NOD:MSVCRT.LIB mfcs100.lib MSVCRT.lib"
  1665. cmd += " /FIXED:NO /OPT:REF /STACK:4194304 /INCREMENTAL:NO "
  1666. cmd += ' /OUT:' + BracketNameWithQuotes(dll)
  1667. if not PkgSkip("PYTHON"):
  1668. # If we're building without Python, don't pick it up implicitly.
  1669. if "PYTHON" not in opts:
  1670. pythonv = SDK["PYTHONVERSION"].replace('.', '')
  1671. if optlevel <= 2:
  1672. cmd += ' /NOD:{}d.lib'.format(pythonv)
  1673. else:
  1674. cmd += ' /NOD:{}.lib'.format(pythonv)
  1675. # Yes, we know we are importing "locally defined symbols".
  1676. for x in obj:
  1677. if x.endswith('libp3pystub.lib'):
  1678. cmd += ' /ignore:4049,4217'
  1679. break
  1680. # Set the subsystem. Specify that we want to target Windows XP.
  1681. subsystem = GetValueOption(opts, "SUBSYSTEM:") or "CONSOLE"
  1682. cmd += " /SUBSYSTEM:" + subsystem
  1683. if GetTargetArch() == 'x64':
  1684. cmd += ",5.02"
  1685. else:
  1686. cmd += ",5.01"
  1687. if dll.endswith(".dll") or dll.endswith(".pyd"):
  1688. cmd += ' /IMPLIB:' + GetOutputDir() + '/lib/' + os.path.splitext(os.path.basename(dll))[0] + ".lib"
  1689. for (opt, dir) in LIBDIRECTORIES:
  1690. if (opt=="ALWAYS") or (opt in opts):
  1691. cmd += ' /LIBPATH:' + BracketNameWithQuotes(dir)
  1692. for x in obj:
  1693. if x.endswith(".dll") or x.endswith(".pyd"):
  1694. cmd += ' ' + GetOutputDir() + '/lib/' + os.path.splitext(os.path.basename(x))[0] + ".lib"
  1695. elif x.endswith(".lib"):
  1696. dname = os.path.splitext(os.path.basename(x))[0] + ".dll"
  1697. if (GetOrigExt(x) != ".ilb" and os.path.exists(GetOutputDir()+"/bin/" + dname)):
  1698. exit("Error: in makepanda, specify "+dname+", not "+x)
  1699. cmd += ' ' + BracketNameWithQuotes(x)
  1700. elif x.endswith(".def"):
  1701. cmd += ' /DEF:' + BracketNameWithQuotes(x)
  1702. elif x.endswith(".dat"):
  1703. pass
  1704. else:
  1705. cmd += ' ' + BracketNameWithQuotes(x)
  1706. if (GetOrigExt(dll)==".exe" and "NOICON" not in opts):
  1707. cmd += " " + GetOutputDir() + "/tmp/pandaIcon.res"
  1708. for (opt, name) in LIBNAMES:
  1709. if (opt=="ALWAYS") or (opt in opts):
  1710. cmd += " " + BracketNameWithQuotes(name)
  1711. oscmd(cmd)
  1712. else:
  1713. cmd = "xilink"
  1714. if GetVerbose(): cmd += " /verbose:lib"
  1715. if HasTargetArch():
  1716. cmd += " /MACHINE:" + GetTargetArch().upper()
  1717. if ("MFC" not in opts):
  1718. cmd += " /NOD:MFC90.LIB /NOD:MFC80.LIB /NOD:LIBCMT"
  1719. cmd += " /NOD:LIBCI.LIB /DEBUG"
  1720. cmd += " /nod:libc /nod:libcmtd /nod:atlthunk /nod:atls"
  1721. cmd += ' /LIBPATH:"C:\\Program Files (x86)\\Intel\\Composer XE 2011 SP1\\ipp\\lib\\ia32"'
  1722. cmd += ' /LIBPATH:"C:\\Program Files (x86)\\Intel\\Composer XE 2011 SP1\\TBB\\Lib\\ia32\\vc10"'
  1723. cmd += ' /LIBPATH:"C:\\Program Files (x86)\\Intel\\Composer XE 2011 SP1\\compiler\\lib\\ia32"'
  1724. if (GetOrigExt(dll) != ".exe"): cmd += " /DLL"
  1725. optlevel = GetOptimizeOption(opts)
  1726. if (optlevel==1): cmd += " /MAP /MAPINFO:EXPORTS /NOD:MSVCRT.LIB /NOD:MSVCPRT.LIB /NOD:MSVCIRT.LIB"
  1727. if (optlevel==2): cmd += " /MAP:NUL /NOD:MSVCRT.LIB /NOD:MSVCPRT.LIB /NOD:MSVCIRT.LIB"
  1728. if (optlevel==3): cmd += " /MAP:NUL /NOD:MSVCRTD.LIB /NOD:MSVCPRTD.LIB /NOD:MSVCIRTD.LIB"
  1729. if (optlevel==4): cmd += " /MAP:NUL /LTCG /NOD:MSVCRTD.LIB /NOD:MSVCPRTD.LIB /NOD:MSVCIRTD.LIB"
  1730. if ("MFC" in opts):
  1731. if (optlevel<=2): cmd += " /NOD:MSVCRTD.LIB mfcs100d.lib MSVCRTD.lib"
  1732. else: cmd += " /NOD:MSVCRT.LIB mfcs100.lib MSVCRT.lib"
  1733. cmd += " /FIXED:NO /OPT:REF /STACK:4194304 /INCREMENTAL:NO "
  1734. cmd += ' /OUT:' + BracketNameWithQuotes(dll)
  1735. subsystem = GetValueOption(opts, "SUBSYSTEM:")
  1736. if subsystem:
  1737. cmd += " /SUBSYSTEM:" + subsystem
  1738. if dll.endswith(".dll"):
  1739. cmd += ' /IMPLIB:' + GetOutputDir() + '/lib/' + os.path.splitext(os.path.basename(dll))[0] + ".lib"
  1740. for (opt, dir) in LIBDIRECTORIES:
  1741. if (opt=="ALWAYS") or (opt in opts):
  1742. cmd += ' /LIBPATH:' + BracketNameWithQuotes(dir)
  1743. for x in obj:
  1744. if x.endswith(".dll") or x.endswith(".pyd"):
  1745. cmd += ' ' + GetOutputDir() + '/lib/' + os.path.splitext(os.path.basename(x))[0] + ".lib"
  1746. elif x.endswith(".lib"):
  1747. dname = os.path.splitext(dll)[0]+".dll"
  1748. if (GetOrigExt(x) != ".ilb" and os.path.exists(GetOutputDir()+"/bin/" + os.path.splitext(os.path.basename(x))[0] + ".dll")):
  1749. exit("Error: in makepanda, specify "+dname+", not "+x)
  1750. cmd += ' ' + BracketNameWithQuotes(x)
  1751. elif x.endswith(".def"):
  1752. cmd += ' /DEF:' + BracketNameWithQuotes(x)
  1753. elif x.endswith(".dat"):
  1754. pass
  1755. else:
  1756. cmd += ' ' + BracketNameWithQuotes(x)
  1757. if (GetOrigExt(dll)==".exe" and "NOICON" not in opts):
  1758. cmd += " " + GetOutputDir() + "/tmp/pandaIcon.res"
  1759. for (opt, name) in LIBNAMES:
  1760. if (opt=="ALWAYS") or (opt in opts):
  1761. cmd += " " + BracketNameWithQuotes(name)
  1762. oscmd(cmd)
  1763. if COMPILER == "GCC":
  1764. cxx = GetCXX()
  1765. if GetOrigExt(dll) == ".exe":
  1766. cmd = cxx + ' -o ' + dll + ' -L' + GetOutputDir() + '/lib -L' + GetOutputDir() + '/tmp'
  1767. if GetTarget() == "android":
  1768. # Necessary to work around an issue with libandroid depending on vendor libraries
  1769. cmd += ' -Wl,--allow-shlib-undefined'
  1770. else:
  1771. if (GetTarget() == "darwin"):
  1772. cmd = cxx + ' -undefined dynamic_lookup'
  1773. if ("BUNDLE" in opts or GetOrigExt(dll) == ".pyd"):
  1774. cmd += ' -bundle '
  1775. else:
  1776. install_name = '@loader_path/../lib/' + os.path.basename(dll)
  1777. cmd += ' -dynamiclib -install_name ' + install_name
  1778. cmd += ' -compatibility_version ' + MAJOR_VERSION + ' -current_version ' + VERSION
  1779. cmd += ' -o ' + dll + ' -L' + GetOutputDir() + '/lib -L' + GetOutputDir() + '/tmp'
  1780. else:
  1781. cmd = cxx + ' -shared'
  1782. # Always set soname on Android to avoid a linker warning when loading the library.
  1783. if "MODULE" not in opts or GetTarget() == 'android':
  1784. cmd += " -Wl,-soname=" + os.path.basename(dll)
  1785. cmd += ' -o ' + dll + ' -L' + GetOutputDir() + '/lib -L' + GetOutputDir() + '/tmp'
  1786. for x in obj:
  1787. if GetOrigExt(x) != ".dat":
  1788. cmd += ' ' + x
  1789. if (GetOrigExt(dll) == ".exe" and GetTarget() == 'windows' and "NOICON" not in opts):
  1790. cmd += " " + GetOutputDir() + "/tmp/pandaIcon.res"
  1791. # macOS specific flags.
  1792. if GetTarget() == 'darwin':
  1793. cmd += " -headerpad_max_install_names"
  1794. if OSXTARGET is not None:
  1795. cmd += " -isysroot " + SDK["MACOSX"] + " -Wl,-syslibroot," + SDK["MACOSX"]
  1796. cmd += " -mmacosx-version-min=%d.%d" % (OSXTARGET)
  1797. elif platform.mac_ver()[0].startswith('11.'):
  1798. cmd += " -mmacosx-version-min=11.0"
  1799. for arch in OSX_ARCHS:
  1800. if 'NOARCH:' + arch.upper() not in opts:
  1801. cmd += " -arch %s" % arch
  1802. elif GetTarget() == 'android':
  1803. arch = GetTargetArch()
  1804. if "ANDROID_GCC_TOOLCHAIN" in SDK:
  1805. cmd += ' -gcc-toolchain ' + SDK["ANDROID_GCC_TOOLCHAIN"].replace('\\', '/')
  1806. cmd += " -Wl,-z,noexecstack -Wl,-z,relro -Wl,-z,now"
  1807. if arch == 'armv7a':
  1808. cmd += ' -target armv7-none-linux-androideabi'
  1809. cmd += " -march=armv7-a -Wl,--fix-cortex-a8"
  1810. elif arch == 'arm':
  1811. cmd += ' -target armv5te-none-linux-androideabi'
  1812. elif arch == 'aarch64':
  1813. cmd += ' -target aarch64-none-linux-android'
  1814. elif arch == 'mips':
  1815. cmd += ' -target mipsel-none-linux-android'
  1816. cmd += ' -mips32'
  1817. elif arch == 'mips64':
  1818. cmd += ' -target mips64el-none-linux-android'
  1819. elif arch == 'x86':
  1820. cmd += ' -target i686-none-linux-android'
  1821. elif arch == 'x86_64':
  1822. cmd += ' -target x86_64-none-linux-android'
  1823. cmd += ' -lc -lm'
  1824. else:
  1825. cmd += " -pthread"
  1826. if "SYSROOT" in SDK:
  1827. cmd += " --sysroot=%s -no-canonical-prefixes" % (SDK["SYSROOT"])
  1828. if LDFLAGS != "":
  1829. cmd += " " + LDFLAGS
  1830. # Don't link libraries with Python, except on Android.
  1831. if "PYTHON" in opts and GetOrigExt(dll) != ".exe" and not RTDIST and GetTarget() != 'android':
  1832. opts = opts[:]
  1833. opts.remove("PYTHON")
  1834. for (opt, dir) in LIBDIRECTORIES:
  1835. if (opt=="ALWAYS") or (opt in opts):
  1836. cmd += ' -L' + BracketNameWithQuotes(dir)
  1837. for (opt, dir) in FRAMEWORKDIRECTORIES:
  1838. if (opt=="ALWAYS") or (opt in opts):
  1839. cmd += ' -F' + BracketNameWithQuotes(dir)
  1840. for (opt, name) in LIBNAMES:
  1841. if (opt=="ALWAYS") or (opt in opts):
  1842. cmd += ' ' + BracketNameWithQuotes(name)
  1843. if GetTarget() != 'freebsd':
  1844. cmd += " -ldl"
  1845. oscmd(cmd)
  1846. if GetOptimizeOption(opts) == 4 and GetTarget() in ('linux', 'android'):
  1847. oscmd(GetStrip() + " --strip-unneeded " + BracketNameWithQuotes(dll))
  1848. os.system("chmod +x " + BracketNameWithQuotes(dll))
  1849. if dll.endswith("." + MAJOR_VERSION + ".dylib"):
  1850. newdll = dll[:-6-len(MAJOR_VERSION)] + "dylib"
  1851. if os.path.isfile(newdll):
  1852. os.remove(newdll)
  1853. oscmd("ln -s " + BracketNameWithQuotes(os.path.basename(dll)) + " " + BracketNameWithQuotes(newdll))
  1854. elif dll.endswith("." + MAJOR_VERSION):
  1855. newdll = dll[:-len(MAJOR_VERSION)-1]
  1856. if os.path.isfile(newdll):
  1857. os.remove(newdll)
  1858. oscmd("ln -s " + BracketNameWithQuotes(os.path.basename(dll)) + " " + BracketNameWithQuotes(newdll))
  1859. ##########################################################################################
  1860. #
  1861. # CompileEgg
  1862. #
  1863. ##########################################################################################
  1864. def CompileEgg(eggfile, src, opts):
  1865. pz = False
  1866. if eggfile.endswith(".pz"):
  1867. pz = True
  1868. eggfile = eggfile[:-3]
  1869. # Determine the location of the pzip and flt2egg tools.
  1870. if CrossCompiling():
  1871. # We may not be able to use our generated versions of these tools,
  1872. # so we'll expect them to already be present in the PATH.
  1873. pzip = 'pzip'
  1874. flt2egg = 'flt2egg'
  1875. else:
  1876. # If we're compiling for this machine, we can use the binaries we've built.
  1877. pzip = os.path.join(GetOutputDir(), 'bin', 'pzip')
  1878. flt2egg = os.path.join(GetOutputDir(), 'bin', 'flt2egg')
  1879. if not os.path.isfile(pzip):
  1880. pzip = 'pzip'
  1881. if not os.path.isfile(flt2egg):
  1882. flt2egg = 'flt2egg'
  1883. if src.endswith(".egg"):
  1884. CopyFile(eggfile, src)
  1885. elif src.endswith(".flt"):
  1886. oscmd(flt2egg + ' -ps keep -o ' + BracketNameWithQuotes(eggfile) + ' ' + BracketNameWithQuotes(src))
  1887. if pz:
  1888. oscmd(pzip + ' ' + BracketNameWithQuotes(eggfile))
  1889. ##########################################################################################
  1890. #
  1891. # CompileRes, CompileRsrc
  1892. #
  1893. ##########################################################################################
  1894. def CompileRes(target, src, opts):
  1895. """Compiles a Windows .rc file into a .res file."""
  1896. ipath = GetListOption(opts, "DIR:")
  1897. if (COMPILER == "MSVC"):
  1898. cmd = "rc"
  1899. cmd += " /Fo" + BracketNameWithQuotes(target)
  1900. for x in ipath: cmd += " /I" + x
  1901. for (opt,dir) in INCDIRECTORIES:
  1902. if (opt=="ALWAYS") or (opt in opts):
  1903. cmd += " /I" + BracketNameWithQuotes(dir)
  1904. for (opt,var,val) in DEFSYMBOLS:
  1905. if (opt=="ALWAYS") or (opt in opts):
  1906. cmd += " /D" + var + "=" + val
  1907. cmd += " " + BracketNameWithQuotes(src)
  1908. else:
  1909. cmd = "windres"
  1910. for x in ipath: cmd += " -I" + x
  1911. for (opt,dir) in INCDIRECTORIES:
  1912. if (opt=="ALWAYS") or (opt in opts):
  1913. cmd += " -I" + BracketNameWithQuotes(dir)
  1914. for (opt,var,val) in DEFSYMBOLS:
  1915. if (opt=="ALWAYS") or (opt in opts):
  1916. cmd += " -D" + var + "=" + val
  1917. cmd += " -i " + BracketNameWithQuotes(src)
  1918. cmd += " -o " + BracketNameWithQuotes(target)
  1919. oscmd(cmd)
  1920. def CompileRsrc(target, src, opts):
  1921. """Compiles a Mac OS .r file into an .rsrc file."""
  1922. ipath = GetListOption(opts, "DIR:")
  1923. if os.path.isfile("/usr/bin/Rez"):
  1924. cmd = "Rez -useDF"
  1925. elif os.path.isfile("/Library/Developer/CommandLineTools/usr/bin/Rez"):
  1926. cmd = "/Library/Developer/CommandLineTools/usr/bin/Rez -useDF"
  1927. else:
  1928. cmd = "/Developer/Tools/Rez -useDF"
  1929. cmd += " -o " + BracketNameWithQuotes(target)
  1930. for x in ipath:
  1931. cmd += " -i " + x
  1932. for (opt,dir) in INCDIRECTORIES:
  1933. if (opt=="ALWAYS") or (opt in opts):
  1934. cmd += " -i " + BracketNameWithQuotes(dir)
  1935. for (opt,var,val) in DEFSYMBOLS:
  1936. if (opt=="ALWAYS") or (opt in opts):
  1937. if (val == ""):
  1938. cmd += " -d " + var
  1939. else:
  1940. cmd += " -d " + var + " = " + val
  1941. cmd += " " + BracketNameWithQuotes(src)
  1942. oscmd(cmd)
  1943. ##########################################################################################
  1944. #
  1945. # CompileJava (Android only)
  1946. #
  1947. ##########################################################################################
  1948. def CompileJava(target, src, opts):
  1949. """Compiles a .java file into a .class file."""
  1950. if GetHost() == 'android':
  1951. cmd = "ecj "
  1952. else:
  1953. cmd = "javac -bootclasspath " + BracketNameWithQuotes(SDK["ANDROID_JAR"]) + " "
  1954. optlevel = GetOptimizeOption(opts)
  1955. if optlevel >= 4:
  1956. cmd += "-debug:none "
  1957. cmd += "-cp " + GetOutputDir() + "/classes "
  1958. cmd += "-d " + GetOutputDir() + "/classes "
  1959. cmd += BracketNameWithQuotes(src)
  1960. oscmd(cmd)
  1961. ##########################################################################################
  1962. #
  1963. # FreezePy
  1964. #
  1965. ##########################################################################################
  1966. def FreezePy(target, inputs, opts):
  1967. assert len(inputs) > 0
  1968. cmdstr = BracketNameWithQuotes(SDK["PYTHONEXEC"].replace('\\', '/')) + " "
  1969. if sys.version_info >= (2, 6):
  1970. cmdstr += "-B "
  1971. cmdstr += os.path.join(GetOutputDir(), "direct", "dist", "pfreeze.py")
  1972. if 'FREEZE_STARTUP' in opts:
  1973. cmdstr += " -s"
  1974. if GetOrigExt(target) == '.exe':
  1975. src = inputs.pop(0)
  1976. else:
  1977. src = ""
  1978. for i in inputs:
  1979. i = os.path.splitext(i)[0]
  1980. i = i.replace('/', '.')
  1981. if i.startswith('direct.src'):
  1982. i = i.replace('.src.', '.')
  1983. cmdstr += " -i " + i
  1984. cmdstr += " -o " + target + " " + src
  1985. if ("LINK_PYTHON_STATIC" in opts):
  1986. os.environ["LINK_PYTHON_STATIC"] = "1"
  1987. oscmd(cmdstr)
  1988. if ("LINK_PYTHON_STATIC" in os.environ):
  1989. del os.environ["LINK_PYTHON_STATIC"]
  1990. if (not os.path.exists(target)):
  1991. exit("FREEZER_ERROR")
  1992. ##########################################################################################
  1993. #
  1994. # Package
  1995. #
  1996. ##########################################################################################
  1997. def Package(target, inputs, opts):
  1998. assert len(inputs) == 1
  1999. # Invoke the ppackage script.
  2000. command = BracketNameWithQuotes(SDK["PYTHONEXEC"]) + " "
  2001. if GetOptimizeOption(opts) >= 4:
  2002. command += "-OO "
  2003. if sys.version_info >= (2, 6):
  2004. command += "-B "
  2005. command += "direct/src/p3d/ppackage.py"
  2006. if not RTDIST:
  2007. # Don't compile Python sources, because we might not running in the same
  2008. # Python version as the selected host.
  2009. command += " -N"
  2010. if GetTarget() == "darwin":
  2011. if SDK.get("MACOSX"):
  2012. command += " -R \"%s\"" % SDK["MACOSX"]
  2013. for arch in OSX_ARCHS:
  2014. if arch == "x86_64":
  2015. arch = "amd64"
  2016. command += " -P osx_%s" % arch
  2017. command += " -i \"" + GetOutputDir() + "/stage\""
  2018. if (P3DSUFFIX):
  2019. command += ' -a "' + P3DSUFFIX + '"'
  2020. command += " " + inputs[0]
  2021. if GetOrigExt(target) == '.p3d':
  2022. # Build a specific .p3d file.
  2023. basename = os.path.basename(os.path.splitext(target)[0])
  2024. command += " " + basename
  2025. oscmd(command)
  2026. if GetTarget() == 'windows':
  2027. # Make an .exe that calls this .p3d.
  2028. objfile = FindLocation('p3dWrapper_' + basename + '.obj', [])
  2029. CompileCxx(objfile, 'direct/src/p3d/p3dWrapper.c', [])
  2030. exefile = FindLocation(basename + '.exe', [])
  2031. CompileLink(exefile, [objfile], ['ADVAPI'])
  2032. # Move it to the bin directory.
  2033. os.rename(GetOutputDir() + '/stage/' + basename + P3DSUFFIX + '.p3d', target)
  2034. if sys.platform != 'win32':
  2035. oscmd('chmod +x ' + BracketNameWithQuotes(target))
  2036. else:
  2037. # This is presumably a package or set of packages.
  2038. oscmd(command)
  2039. ##########################################################################################
  2040. #
  2041. # CompileBundle
  2042. #
  2043. ##########################################################################################
  2044. def CompileBundle(target, inputs, opts):
  2045. assert GetTarget() == "darwin", 'bundles can only be made for macOS'
  2046. plist = None
  2047. resources = []
  2048. objects = []
  2049. for i in inputs:
  2050. if (i.endswith(".plist")):
  2051. if (plist != None): exit("Only one plist file can be used when creating a bundle!")
  2052. plist = i
  2053. elif (i.endswith(".rsrc") or i.endswith(".icns")):
  2054. resources.append(i)
  2055. elif (GetOrigExt(i) == ".obj" or GetOrigExt(i) in SUFFIX_LIB or GetOrigExt(i) in SUFFIX_DLL):
  2056. objects.append(i)
  2057. else:
  2058. exit("Don't know how to bundle file %s" % i)
  2059. # Now link the object files to form the bundle.
  2060. if (plist == None): exit("One plist file must be used when creating a bundle!")
  2061. bundleName = plistlib.readPlist(plist)["CFBundleExecutable"]
  2062. oscmd("rm -rf %s" % target)
  2063. oscmd("mkdir -p %s/Contents/MacOS/" % target)
  2064. oscmd("mkdir -p %s/Contents/Resources/" % target)
  2065. if target.endswith(".app"):
  2066. SetOrigExt("%s/Contents/MacOS/%s" % (target, bundleName), ".exe")
  2067. else:
  2068. SetOrigExt("%s/Contents/MacOS/%s" % (target, bundleName), ".dll")
  2069. CompileLink("%s/Contents/MacOS/%s" % (target, bundleName), objects, opts + ["BUNDLE"])
  2070. oscmd("cp %s %s/Contents/Info.plist" % (plist, target))
  2071. for r in resources:
  2072. oscmd("cp %s %s/Contents/Resources/" % (r, target))
  2073. ##########################################################################################
  2074. #
  2075. # CompileMIDL
  2076. #
  2077. ##########################################################################################
  2078. def CompileMIDL(target, src, opts):
  2079. ipath = GetListOption(opts, "DIR:")
  2080. if (COMPILER=="MSVC"):
  2081. cmd = "midl"
  2082. cmd += " /out" + BracketNameWithQuotes(os.path.dirname(target))
  2083. for x in ipath: cmd += " /I" + x
  2084. for (opt,dir) in INCDIRECTORIES:
  2085. if (opt=="ALWAYS") or (opt in opts): cmd += " /I" + BracketNameWithQuotes(dir)
  2086. for (opt,var,val) in DEFSYMBOLS:
  2087. if (opt=="ALWAYS") or (opt in opts): cmd += " /D" + var + "=" + val
  2088. cmd += " " + BracketNameWithQuotes(src)
  2089. oscmd(cmd)
  2090. ##########################################################################################
  2091. #
  2092. # CompileAnything
  2093. #
  2094. ##########################################################################################
  2095. def CompileAnything(target, inputs, opts, progress = None):
  2096. if (opts.count("DEPENDENCYONLY")):
  2097. return
  2098. if (len(inputs)==0):
  2099. exit("No input files for target "+target)
  2100. infile = inputs[0]
  2101. origsuffix = GetOrigExt(target)
  2102. if (len(inputs) == 1 and origsuffix == GetOrigExt(infile)):
  2103. # It must be a simple copy operation.
  2104. ProgressOutput(progress, "Copying file", target)
  2105. CopyFile(target, infile)
  2106. if (origsuffix==".exe" and GetHost() != "windows"):
  2107. os.system("chmod +x \"%s\"" % target)
  2108. return
  2109. elif (infile.endswith(".py")):
  2110. if origsuffix == ".obj":
  2111. source = os.path.splitext(target)[0] + ".c"
  2112. SetOrigExt(source, ".c")
  2113. ProgressOutput(progress, "Building frozen source", source)
  2114. FreezePy(source, inputs, opts)
  2115. ProgressOutput(progress, "Building C++ object", target)
  2116. return CompileCxx(target, source, opts)
  2117. if origsuffix == ".exe":
  2118. ProgressOutput(progress, "Building frozen executable", target)
  2119. else:
  2120. ProgressOutput(progress, "Building frozen library", target)
  2121. return FreezePy(target, inputs, opts)
  2122. elif (infile.endswith(".idl")):
  2123. ProgressOutput(progress, "Compiling MIDL file", infile)
  2124. return CompileMIDL(target, infile, opts)
  2125. elif (infile.endswith(".pdef")):
  2126. if origsuffix == '.p3d':
  2127. ProgressOutput(progress, "Building package", target)
  2128. else:
  2129. ProgressOutput(progress, "Building package from pdef file", infile)
  2130. return Package(target, inputs, opts)
  2131. elif origsuffix in SUFFIX_LIB:
  2132. ProgressOutput(progress, "Linking static library", target)
  2133. return CompileLib(target, inputs, opts)
  2134. elif origsuffix in SUFFIX_DLL or (origsuffix==".plugin" and GetTarget() != "darwin"):
  2135. if (origsuffix==".exe"):
  2136. ProgressOutput(progress, "Linking executable", target)
  2137. else:
  2138. ProgressOutput(progress, "Linking dynamic library", target)
  2139. # Add version number to the dynamic library, on unix
  2140. if origsuffix == ".dll" and "MODULE" not in opts and not RTDIST:
  2141. tplatform = GetTarget()
  2142. if tplatform == "darwin":
  2143. # On Mac, libraries are named like libpanda.1.2.dylib
  2144. if target.lower().endswith(".dylib"):
  2145. target = target[:-5] + MAJOR_VERSION + ".dylib"
  2146. SetOrigExt(target, origsuffix)
  2147. elif tplatform != "windows" and tplatform != "android":
  2148. # On Linux, libraries are named like libpanda.so.1.2
  2149. target += "." + MAJOR_VERSION
  2150. SetOrigExt(target, origsuffix)
  2151. return CompileLink(target, inputs, opts)
  2152. elif (origsuffix==".in"):
  2153. ProgressOutput(progress, "Building Interrogate database", target)
  2154. return CompileIgate(target, inputs, opts)
  2155. elif (origsuffix==".plugin" and GetTarget() == "darwin"):
  2156. ProgressOutput(progress, "Building plugin bundle", target)
  2157. return CompileBundle(target, inputs, opts)
  2158. elif (origsuffix==".app"):
  2159. ProgressOutput(progress, "Building application bundle", target)
  2160. return CompileBundle(target, inputs, opts)
  2161. elif (origsuffix==".pz"):
  2162. ProgressOutput(progress, "Compressing", target)
  2163. return CompileEgg(target, infile, opts)
  2164. elif (origsuffix==".egg"):
  2165. ProgressOutput(progress, "Converting", target)
  2166. return CompileEgg(target, infile, opts)
  2167. elif (origsuffix==".res"):
  2168. ProgressOutput(progress, "Building resource object", target)
  2169. return CompileRes(target, infile, opts)
  2170. elif (origsuffix==".rsrc"):
  2171. ProgressOutput(progress, "Building resource object", target)
  2172. return CompileRsrc(target, infile, opts)
  2173. elif (origsuffix==".class"):
  2174. ProgressOutput(progress, "Building Java class", target)
  2175. return CompileJava(target, infile, opts)
  2176. elif (origsuffix==".obj"):
  2177. if (infile.endswith(".cxx")):
  2178. ProgressOutput(progress, "Building C++ object", target)
  2179. return CompileCxx(target, infile, opts)
  2180. elif (infile.endswith(".c")):
  2181. ProgressOutput(progress, "Building C object", target)
  2182. return CompileCxx(target, infile, opts)
  2183. elif (infile.endswith(".mm")):
  2184. ProgressOutput(progress, "Building Objective-C++ object", target)
  2185. return CompileCxx(target, infile, opts)
  2186. elif (infile.endswith(".yxx")):
  2187. ProgressOutput(progress, "Building Bison object", target)
  2188. return CompileBison(target, infile, opts)
  2189. elif (infile.endswith(".lxx")):
  2190. ProgressOutput(progress, "Building Flex object", target)
  2191. return CompileFlex(target, infile, opts)
  2192. elif (infile.endswith(".in")):
  2193. ProgressOutput(progress, "Building Interrogate object", target)
  2194. return CompileImod(target, inputs, opts)
  2195. elif (infile.endswith(".rc")):
  2196. ProgressOutput(progress, "Building resource object", target)
  2197. return CompileRes(target, infile, opts)
  2198. elif (infile.endswith(".r")):
  2199. ProgressOutput(progress, "Building resource object", target)
  2200. return CompileRsrc(target, infile, opts)
  2201. exit("Don't know how to compile: %s from %s" % (target, inputs))
  2202. ##########################################################################################
  2203. #
  2204. # Generate dtool_config.h, prc_parameters.h, and dtool_have_xxx.dat
  2205. #
  2206. ##########################################################################################
  2207. DTOOL_CONFIG=[
  2208. #_Variable_________________________Windows___________________Unix__________
  2209. ("HAVE_PYTHON", '1', '1'),
  2210. ("USE_DEBUG_PYTHON", 'UNDEF', 'UNDEF'),
  2211. ("PYTHON_FRAMEWORK", 'UNDEF', 'UNDEF'),
  2212. ("COMPILE_IN_DEFAULT_FONT", '1', '1'),
  2213. ("STDFLOAT_DOUBLE", 'UNDEF', 'UNDEF'),
  2214. ("HAVE_MAYA", '1', '1'),
  2215. ("REPORT_OPENSSL_ERRORS", '1', '1'),
  2216. ("USE_PANDAFILESTREAM", '1', '1'),
  2217. ("USE_DELETED_CHAIN", '1', '1'),
  2218. ("HAVE_WGL", '1', 'UNDEF'),
  2219. ("HAVE_DX9", 'UNDEF', 'UNDEF'),
  2220. ("HAVE_THREADS", '1', '1'),
  2221. ("SIMPLE_THREADS", 'UNDEF', 'UNDEF'),
  2222. ("OS_SIMPLE_THREADS", '1', '1'),
  2223. ("DEBUG_THREADS", 'UNDEF', 'UNDEF'),
  2224. ("HAVE_POSIX_THREADS", 'UNDEF', '1'),
  2225. ("MUTEX_SPINLOCK", 'UNDEF', 'UNDEF'),
  2226. ("HAVE_AUDIO", '1', '1'),
  2227. ("NOTIFY_DEBUG", 'UNDEF', 'UNDEF'),
  2228. ("DO_PSTATS", 'UNDEF', 'UNDEF'),
  2229. ("DO_DCAST", 'UNDEF', 'UNDEF'),
  2230. ("DO_COLLISION_RECORDING", 'UNDEF', 'UNDEF'),
  2231. ("SUPPORT_IMMEDIATE_MODE", 'UNDEF', 'UNDEF'),
  2232. ("SUPPORT_FIXED_FUNCTION", '1', '1'),
  2233. ("DO_MEMORY_USAGE", 'UNDEF', 'UNDEF'),
  2234. ("DO_PIPELINING", '1', '1'),
  2235. ("DEFAULT_PATHSEP", '";"', '":"'),
  2236. ("WORDS_BIGENDIAN", 'UNDEF', 'UNDEF'),
  2237. ("PHAVE_LOCKF", '1', '1'),
  2238. ("SIMPLE_STRUCT_POINTERS", '1', 'UNDEF'),
  2239. ("HAVE_DINKUM", 'UNDEF', 'UNDEF'),
  2240. ("HAVE_STL_HASH", 'UNDEF', 'UNDEF'),
  2241. ("GETTIMEOFDAY_ONE_PARAM", 'UNDEF', 'UNDEF'),
  2242. ("HAVE_GETOPT", 'UNDEF', '1'),
  2243. ("HAVE_GETOPT_LONG_ONLY", 'UNDEF', '1'),
  2244. ("PHAVE_GETOPT_H", 'UNDEF', '1'),
  2245. ("PHAVE_LINUX_INPUT_H", 'UNDEF', '1'),
  2246. ("IOCTL_TERMINAL_WIDTH", 'UNDEF', '1'),
  2247. ("HAVE_IOS_TYPEDEFS", '1', '1'),
  2248. ("HAVE_IOS_BINARY", '1', '1'),
  2249. ("STATIC_INIT_GETENV", '1', 'UNDEF'),
  2250. ("HAVE_PROC_SELF_EXE", 'UNDEF', '1'),
  2251. ("HAVE_PROC_SELF_MAPS", 'UNDEF', '1'),
  2252. ("HAVE_PROC_SELF_ENVIRON", 'UNDEF', '1'),
  2253. ("HAVE_PROC_SELF_CMDLINE", 'UNDEF', '1'),
  2254. ("HAVE_PROC_CURPROC_FILE", 'UNDEF', 'UNDEF'),
  2255. ("HAVE_PROC_CURPROC_MAP", 'UNDEF', 'UNDEF'),
  2256. ("HAVE_PROC_SELF_CMDLINE", 'UNDEF', 'UNDEF'),
  2257. ("HAVE_GLOBAL_ARGV", '1', 'UNDEF'),
  2258. ("PROTOTYPE_GLOBAL_ARGV", 'UNDEF', 'UNDEF'),
  2259. ("GLOBAL_ARGV", '__argv', 'UNDEF'),
  2260. ("GLOBAL_ARGC", '__argc', 'UNDEF'),
  2261. ("PHAVE_IO_H", '1', 'UNDEF'),
  2262. ("PHAVE_IOSTREAM", '1', '1'),
  2263. ("PHAVE_STRING_H", 'UNDEF', '1'),
  2264. ("PHAVE_LIMITS_H", 'UNDEF', '1'),
  2265. ("PHAVE_STDLIB_H", 'UNDEF', '1'),
  2266. ("PHAVE_MALLOC_H", '1', '1'),
  2267. ("PHAVE_SYS_MALLOC_H", 'UNDEF', 'UNDEF'),
  2268. ("PHAVE_ALLOCA_H", 'UNDEF', '1'),
  2269. ("PHAVE_LOCALE_H", 'UNDEF', '1'),
  2270. ("PHAVE_SSTREAM", '1', '1'),
  2271. ("PHAVE_NEW", '1', '1'),
  2272. ("PHAVE_SYS_TYPES_H", '1', '1'),
  2273. ("PHAVE_SYS_TIME_H", 'UNDEF', '1'),
  2274. ("PHAVE_UNISTD_H", 'UNDEF', '1'),
  2275. ("PHAVE_UTIME_H", 'UNDEF', '1'),
  2276. ("PHAVE_GLOB_H", 'UNDEF', '1'),
  2277. ("PHAVE_DIRENT_H", 'UNDEF', '1'),
  2278. ("PHAVE_UCONTEXT_H", 'UNDEF', '1'),
  2279. ("PHAVE_STDINT_H", '1', '1'),
  2280. ("HAVE_RTTI", '1', '1'),
  2281. ("HAVE_X11", 'UNDEF', '1'),
  2282. ("IS_LINUX", 'UNDEF', '1'),
  2283. ("IS_OSX", 'UNDEF', 'UNDEF'),
  2284. ("IS_FREEBSD", 'UNDEF', 'UNDEF'),
  2285. ("HAVE_EIGEN", 'UNDEF', 'UNDEF'),
  2286. ("LINMATH_ALIGN", '1', '1'),
  2287. ("HAVE_ZLIB", 'UNDEF', 'UNDEF'),
  2288. ("HAVE_PNG", 'UNDEF', 'UNDEF'),
  2289. ("HAVE_JPEG", 'UNDEF', 'UNDEF'),
  2290. ("HAVE_VIDEO4LINUX", 'UNDEF', '1'),
  2291. ("HAVE_TIFF", 'UNDEF', 'UNDEF'),
  2292. ("HAVE_OPENEXR", 'UNDEF', 'UNDEF'),
  2293. ("HAVE_SGI_RGB", '1', '1'),
  2294. ("HAVE_TGA", '1', '1'),
  2295. ("HAVE_IMG", '1', '1'),
  2296. ("HAVE_SOFTIMAGE_PIC", '1', '1'),
  2297. ("HAVE_BMP", '1', '1'),
  2298. ("HAVE_PNM", '1', '1'),
  2299. ("HAVE_STB_IMAGE", '1', '1'),
  2300. ("HAVE_VORBIS", 'UNDEF', 'UNDEF'),
  2301. ("HAVE_OPUS", 'UNDEF', 'UNDEF'),
  2302. ("HAVE_FREETYPE", 'UNDEF', 'UNDEF'),
  2303. ("HAVE_FFTW", 'UNDEF', 'UNDEF'),
  2304. ("HAVE_OPENSSL", 'UNDEF', 'UNDEF'),
  2305. ("HAVE_NET", 'UNDEF', 'UNDEF'),
  2306. ("WANT_NATIVE_NET", '1', '1'),
  2307. ("SIMULATE_NETWORK_DELAY", 'UNDEF', 'UNDEF'),
  2308. ("HAVE_CG", 'UNDEF', 'UNDEF'),
  2309. ("HAVE_CGGL", 'UNDEF', 'UNDEF'),
  2310. ("HAVE_CGDX9", 'UNDEF', 'UNDEF'),
  2311. ("HAVE_ARTOOLKIT", 'UNDEF', 'UNDEF'),
  2312. ("HAVE_DIRECTCAM", 'UNDEF', 'UNDEF'),
  2313. ("HAVE_SQUISH", 'UNDEF', 'UNDEF'),
  2314. ("HAVE_CARBON", 'UNDEF', 'UNDEF'),
  2315. ("HAVE_COCOA", 'UNDEF', 'UNDEF'),
  2316. ("HAVE_OPENAL_FRAMEWORK", 'UNDEF', 'UNDEF'),
  2317. ("HAVE_ROCKET_PYTHON", '1', '1'),
  2318. ("HAVE_ROCKET_DEBUGGER", 'UNDEF', 'UNDEF'),
  2319. ("USE_TAU", 'UNDEF', 'UNDEF'),
  2320. ("PRC_SAVE_DESCRIPTIONS", '1', '1'),
  2321. # ("_SECURE_SCL", '0', 'UNDEF'),
  2322. # ("_SECURE_SCL_THROWS", '0', 'UNDEF'),
  2323. ("HAVE_P3D_PLUGIN", 'UNDEF', 'UNDEF'),
  2324. ]
  2325. PRC_PARAMETERS=[
  2326. ("DEFAULT_PRC_DIR", '"<auto>etc"', '"<auto>etc"'),
  2327. ("PRC_DIR_ENVVARS", '"PANDA_PRC_DIR"', '"PANDA_PRC_DIR"'),
  2328. ("PRC_PATH_ENVVARS", '"PANDA_PRC_PATH"', '"PANDA_PRC_PATH"'),
  2329. ("PRC_PATH2_ENVVARS", '""', '""'),
  2330. ("PRC_PATTERNS", '"*.prc"', '"*.prc"'),
  2331. ("PRC_ENCRYPTED_PATTERNS", '"*.prc.pe"', '"*.prc.pe"'),
  2332. ("PRC_ENCRYPTION_KEY", '""', '""'),
  2333. ("PRC_EXECUTABLE_PATTERNS", '""', '""'),
  2334. ("PRC_EXECUTABLE_ARGS_ENVVAR", '"PANDA_PRC_XARGS"', '"PANDA_PRC_XARGS"'),
  2335. ("PRC_PUBLIC_KEYS_FILENAME", '""', '""'),
  2336. ("PRC_RESPECT_TRUST_LEVEL", 'UNDEF', 'UNDEF'),
  2337. ("PRC_DCONFIG_TRUST_LEVEL", '0', '0'),
  2338. ("PRC_INC_TRUST_LEVEL", '0', '0'),
  2339. ]
  2340. def WriteConfigSettings():
  2341. dtool_config={}
  2342. prc_parameters={}
  2343. speedtree_parameters={}
  2344. plugin_config={}
  2345. if (GetTarget() == 'windows'):
  2346. for key,win,unix in DTOOL_CONFIG:
  2347. dtool_config[key] = win
  2348. for key,win,unix in PRC_PARAMETERS:
  2349. prc_parameters[key] = win
  2350. else:
  2351. for key,win,unix in DTOOL_CONFIG:
  2352. dtool_config[key] = unix
  2353. for key,win,unix in PRC_PARAMETERS:
  2354. prc_parameters[key] = unix
  2355. for x in PkgListGet():
  2356. if ("HAVE_"+x in dtool_config):
  2357. if (PkgSkip(x)==0):
  2358. dtool_config["HAVE_"+x] = '1'
  2359. else:
  2360. dtool_config["HAVE_"+x] = 'UNDEF'
  2361. dtool_config["HAVE_NET"] = '1'
  2362. if (PkgSkip("NVIDIACG")==0):
  2363. dtool_config["HAVE_CG"] = '1'
  2364. dtool_config["HAVE_CGGL"] = '1'
  2365. dtool_config["HAVE_CGDX9"] = '1'
  2366. if GetTarget() not in ("linux", "android"):
  2367. dtool_config["HAVE_PROC_SELF_EXE"] = 'UNDEF'
  2368. dtool_config["HAVE_PROC_SELF_MAPS"] = 'UNDEF'
  2369. dtool_config["HAVE_PROC_SELF_CMDLINE"] = 'UNDEF'
  2370. dtool_config["HAVE_PROC_SELF_ENVIRON"] = 'UNDEF'
  2371. if (GetTarget() == "darwin"):
  2372. dtool_config["PYTHON_FRAMEWORK"] = 'Python'
  2373. dtool_config["PHAVE_MALLOC_H"] = 'UNDEF'
  2374. dtool_config["PHAVE_SYS_MALLOC_H"] = '1'
  2375. dtool_config["HAVE_OPENAL_FRAMEWORK"] = '1'
  2376. dtool_config["HAVE_X11"] = 'UNDEF' # We might have X11, but we don't need it.
  2377. dtool_config["IS_LINUX"] = 'UNDEF'
  2378. dtool_config["HAVE_VIDEO4LINUX"] = 'UNDEF'
  2379. dtool_config["PHAVE_LINUX_INPUT_H"] = 'UNDEF'
  2380. dtool_config["IS_OSX"] = '1'
  2381. if (GetTarget() == "freebsd"):
  2382. dtool_config["IS_LINUX"] = 'UNDEF'
  2383. dtool_config["HAVE_VIDEO4LINUX"] = 'UNDEF'
  2384. dtool_config["IS_FREEBSD"] = '1'
  2385. dtool_config["PHAVE_ALLOCA_H"] = 'UNDEF'
  2386. dtool_config["PHAVE_MALLOC_H"] = 'UNDEF'
  2387. dtool_config["HAVE_PROC_CURPROC_FILE"] = '1'
  2388. dtool_config["HAVE_PROC_CURPROC_MAP"] = '1'
  2389. dtool_config["HAVE_PROC_CURPROC_CMDLINE"] = '1'
  2390. if (GetTarget() == "android"):
  2391. # Android does have RTTI, but we disable it anyway.
  2392. dtool_config["HAVE_RTTI"] = 'UNDEF'
  2393. dtool_config["PHAVE_GLOB_H"] = 'UNDEF'
  2394. dtool_config["PHAVE_LOCKF"] = 'UNDEF'
  2395. dtool_config["HAVE_VIDEO4LINUX"] = 'UNDEF'
  2396. if (GetOptimize() <= 2 and GetTarget() == "windows"):
  2397. dtool_config["USE_DEBUG_PYTHON"] = '1'
  2398. # This should probably be more sophisticated, such as based
  2399. # on whether the libRocket Python modules are available.
  2400. if (PkgSkip("PYTHON") != 0):
  2401. dtool_config["HAVE_ROCKET_PYTHON"] = 'UNDEF'
  2402. if (GetOptimize() <= 3):
  2403. dtool_config["HAVE_ROCKET_DEBUGGER"] = '1'
  2404. if (GetOptimize() <= 3):
  2405. if (dtool_config["HAVE_NET"] != 'UNDEF'):
  2406. dtool_config["DO_PSTATS"] = '1'
  2407. if (GetOptimize() <= 3):
  2408. dtool_config["DO_DCAST"] = '1'
  2409. if (GetOptimize() <= 3):
  2410. dtool_config["DO_COLLISION_RECORDING"] = '1'
  2411. if (GetOptimize() <= 3):
  2412. dtool_config["DO_MEMORY_USAGE"] = '1'
  2413. if (GetOptimize() <= 3):
  2414. dtool_config["NOTIFY_DEBUG"] = '1'
  2415. if (GetOptimize() >= 4):
  2416. dtool_config["PRC_SAVE_DESCRIPTIONS"] = 'UNDEF'
  2417. if (GetOptimize() >= 4):
  2418. # Disable RTTI on release builds.
  2419. dtool_config["HAVE_RTTI"] = 'UNDEF'
  2420. # Now that we have OS_SIMPLE_THREADS, we can support
  2421. # SIMPLE_THREADS on exotic architectures like win64, so we no
  2422. # longer need to disable it for this platform.
  2423. ## if GetTarget() == 'windows' and GetTargetArch() == 'x64':
  2424. ## dtool_config["SIMPLE_THREADS"] = 'UNDEF'
  2425. if (RTDIST or RUNTIME):
  2426. prc_parameters["DEFAULT_PRC_DIR"] = '""'
  2427. if HOST_URL:
  2428. plugin_config["PANDA_PACKAGE_HOST_URL"] = HOST_URL
  2429. #plugin_config["P3D_PLUGIN_LOG_DIRECTORY"] = ""
  2430. plugin_config["P3D_PLUGIN_LOG_BASENAME1"] = ""
  2431. plugin_config["P3D_PLUGIN_LOG_BASENAME2"] = ""
  2432. plugin_config["P3D_PLUGIN_LOG_BASENAME3"] = ""
  2433. plugin_config["P3D_PLUGIN_P3D_PLUGIN"] = ""
  2434. plugin_config["P3D_PLUGIN_P3DPYTHON"] = ""
  2435. plugin_config["P3D_COREAPI_VERSION_STR"] = COREAPI_VERSION
  2436. plugin_config["P3D_PLUGIN_VERSION_STR"] = PLUGIN_VERSION
  2437. if PkgSkip("GTK2") == 0:
  2438. plugin_config["HAVE_GTK"] = '1'
  2439. if (RUNTIME):
  2440. dtool_config["HAVE_P3D_PLUGIN"] = '1'
  2441. # Whether it's present on the system doesn't matter here,
  2442. # as the runtime itself doesn't include or link with X11.
  2443. if (RUNTIME and GetTarget() == 'linux'):
  2444. dtool_config["HAVE_X11"] = '1'
  2445. if ("GENERIC_DXERR_LIBRARY" in SDK):
  2446. dtool_config["USE_GENERIC_DXERR_LIBRARY"] = "1"
  2447. else:
  2448. dtool_config["USE_GENERIC_DXERR_LIBRARY"] = "UNDEF"
  2449. if (PkgSkip("SPEEDTREE")==0):
  2450. speedtree_parameters["SPEEDTREE_OPENGL"] = "UNDEF"
  2451. speedtree_parameters["SPEEDTREE_DIRECTX9"] = "UNDEF"
  2452. if SDK["SPEEDTREEAPI"] == "OpenGL":
  2453. speedtree_parameters["SPEEDTREE_OPENGL"] = "1"
  2454. elif SDK["SPEEDTREEAPI"] == "DirectX9":
  2455. speedtree_parameters["SPEEDTREE_DIRECTX9"] = "1"
  2456. speedtree_parameters["SPEEDTREE_BIN_DIR"] = (SDK["SPEEDTREE"] + "/Bin")
  2457. conf = "/* prc_parameters.h. Generated automatically by makepanda.py */\n"
  2458. for key in sorted(prc_parameters.keys()):
  2459. if ((key == "DEFAULT_PRC_DIR") or (key[:4]=="PRC_")):
  2460. val = OverrideValue(key, prc_parameters[key])
  2461. if (val == 'UNDEF'): conf = conf + "#undef " + key + "\n"
  2462. else: conf = conf + "#define " + key + " " + val + "\n"
  2463. ConditionalWriteFile(GetOutputDir() + '/include/prc_parameters.h', conf)
  2464. conf = "/* dtool_config.h. Generated automatically by makepanda.py */\n"
  2465. for key in sorted(dtool_config.keys()):
  2466. val = OverrideValue(key, dtool_config[key])
  2467. if key in ('HAVE_CG', 'HAVE_CGGL', 'HAVE_CGDX9') and val != 'UNDEF':
  2468. # These are not available for ARM, period.
  2469. conf = conf + "#ifdef __aarch64__\n"
  2470. conf = conf + "#undef " + key + "\n"
  2471. conf = conf + "#else\n"
  2472. conf = conf + "#define " + key + " " + val + "\n"
  2473. conf = conf + "#endif\n"
  2474. elif val == 'UNDEF':
  2475. conf = conf + "#undef " + key + "\n"
  2476. else:
  2477. conf = conf + "#define " + key + " " + val + "\n"
  2478. ConditionalWriteFile(GetOutputDir() + '/include/dtool_config.h', conf)
  2479. if (RTDIST or RUNTIME):
  2480. conf = "/* p3d_plugin_config.h. Generated automatically by makepanda.py */\n"
  2481. for key in sorted(plugin_config.keys()):
  2482. val = plugin_config[key]
  2483. if (val == 'UNDEF'): conf = conf + "#undef " + key + "\n"
  2484. else: conf = conf + "#define " + key + " \"" + val.replace("\\", "\\\\") + "\"\n"
  2485. ConditionalWriteFile(GetOutputDir() + '/include/p3d_plugin_config.h', conf)
  2486. if (PkgSkip("SPEEDTREE")==0):
  2487. conf = "/* speedtree_parameters.h. Generated automatically by makepanda.py */\n"
  2488. for key in sorted(speedtree_parameters.keys()):
  2489. val = OverrideValue(key, speedtree_parameters[key])
  2490. if (val == 'UNDEF'): conf = conf + "#undef " + key + "\n"
  2491. else: conf = conf + "#define " + key + " \"" + val.replace("\\", "\\\\") + "\"\n"
  2492. ConditionalWriteFile(GetOutputDir() + '/include/speedtree_parameters.h', conf)
  2493. for x in PkgListGet():
  2494. if (PkgSkip(x)): ConditionalWriteFile(GetOutputDir() + '/tmp/dtool_have_'+x.lower()+'.dat', "0\n")
  2495. else: ConditionalWriteFile(GetOutputDir() + '/tmp/dtool_have_'+x.lower()+'.dat', "1\n")
  2496. # Finally, write a platform.dat with the platform we are compiling for.
  2497. ConditionalWriteFile(GetOutputDir() + '/tmp/platform.dat', PLATFORM)
  2498. # This is useful for tools like makepackage that need to know things about
  2499. # the build parameters.
  2500. ConditionalWriteFile(GetOutputDir() + '/tmp/optimize.dat', str(GetOptimize()))
  2501. WriteConfigSettings()
  2502. WarnConflictingFiles()
  2503. if SystemLibraryExists("dtoolbase"):
  2504. Warn("Found conflicting Panda3D libraries from other ppremake build!")
  2505. if SystemLibraryExists("p3dtoolconfig"):
  2506. Warn("Found conflicting Panda3D libraries from other makepanda build!")
  2507. ##########################################################################################
  2508. #
  2509. # Generate pandaVersion.h, pythonversion, null.cxx, etc.
  2510. #
  2511. ##########################################################################################
  2512. PANDAVERSION_H="""
  2513. #define PANDA_MAJOR_VERSION $VERSION1
  2514. #define PANDA_MINOR_VERSION $VERSION2
  2515. #define PANDA_SEQUENCE_VERSION $VERSION3
  2516. #define PANDA_VERSION $NVERSION
  2517. #define PANDA_NUMERIC_VERSION $NVERSION
  2518. #define PANDA_VERSION_STR "$VERSION"
  2519. #define PANDA_ABI_VERSION_STR "$VERSION1.$VERSION2"
  2520. #define PANDA_DISTRIBUTOR "$DISTRIBUTOR"
  2521. #define PANDA_PACKAGE_VERSION_STR "$RTDIST_VERSION"
  2522. #define PANDA_PACKAGE_HOST_URL "$HOST_URL"
  2523. """
  2524. PANDAVERSION_H_RUNTIME="""
  2525. #define PANDA_MAJOR_VERSION 0
  2526. #define PANDA_MINOR_VERSION 0
  2527. #define PANDA_SEQUENCE_VERSION 0
  2528. #define PANDA_VERSION_STR "0.0.0"
  2529. #define PANDA_ABI_VERSION_STR "0.0"
  2530. #define P3D_PLUGIN_MAJOR_VERSION $VERSION1
  2531. #define P3D_PLUGIN_MINOR_VERSION $VERSION2
  2532. #define P3D_PLUGIN_SEQUENCE_VERSION $VERSION3
  2533. #define P3D_PLUGIN_VERSION_STR "$VERSION1.$VERSION2.$VERSION3"
  2534. #define P3D_COREAPI_VERSION_STR "$COREAPI_VERSION"
  2535. #define PANDA_DISTRIBUTOR "$DISTRIBUTOR"
  2536. #define PANDA_PACKAGE_VERSION_STR ""
  2537. #define PANDA_PACKAGE_HOST_URL "$HOST_URL"
  2538. """
  2539. CHECKPANDAVERSION_CXX="""
  2540. # include "dtoolbase.h"
  2541. EXPCL_DTOOL_DTOOLBASE int panda_version_$VERSION1_$VERSION2 = 0;
  2542. """
  2543. CHECKPANDAVERSION_H="""
  2544. # ifndef CHECKPANDAVERSION_H
  2545. # define CHECKPANDAVERSION_H
  2546. # include "dtoolbase.h"
  2547. extern EXPCL_DTOOL_DTOOLBASE int panda_version_$VERSION1_$VERSION2;
  2548. // Hack to forcibly depend on the check
  2549. template<typename T>
  2550. class CheckPandaVersion {
  2551. public:
  2552. int check_version() { return panda_version_$VERSION1_$VERSION2; }
  2553. };
  2554. template class CheckPandaVersion<void>;
  2555. # endif
  2556. """
  2557. P3DACTIVEX_RC="""#include "resource.h"
  2558. #define APSTUDIO_READONLY_SYMBOLS
  2559. #include "afxres.h"
  2560. #undef APSTUDIO_READONLY_SYMBOLS
  2561. #if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU)
  2562. #ifdef _WIN32
  2563. LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US
  2564. #pragma code_page(1252)
  2565. #endif
  2566. #ifdef APSTUDIO_INVOKED
  2567. 1 TEXTINCLUDE
  2568. BEGIN
  2569. "resource.h\\0"
  2570. END
  2571. 2 TEXTINCLUDE
  2572. BEGIN
  2573. "#include ""afxres.h""\\r\\n"
  2574. "\\0"
  2575. END
  2576. 3 TEXTINCLUDE
  2577. BEGIN
  2578. "1 TYPELIB ""P3DActiveX.tlb""\\r\\n"
  2579. "\\0"
  2580. END
  2581. #endif
  2582. %s
  2583. IDB_P3DACTIVEX BITMAP "P3DActiveXCtrl.bmp"
  2584. IDD_PROPPAGE_P3DACTIVEX DIALOG 0, 0, 250, 62
  2585. STYLE DS_SETFONT | WS_CHILD
  2586. FONT 8, "MS Sans Serif"
  2587. BEGIN
  2588. LTEXT "TODO: Place controls to manipulate properties of P3DActiveX Control on this dialog.",
  2589. IDC_STATIC,7,25,229,16
  2590. END
  2591. #ifdef APSTUDIO_INVOKED
  2592. GUIDELINES DESIGNINFO
  2593. BEGIN
  2594. IDD_PROPPAGE_P3DACTIVEX, DIALOG
  2595. BEGIN
  2596. LEFTMARGIN, 7
  2597. RIGHTMARGIN, 243
  2598. TOPMARGIN, 7
  2599. BOTTOMMARGIN, 55
  2600. END
  2601. END
  2602. #endif
  2603. STRINGTABLE
  2604. BEGIN
  2605. IDS_P3DACTIVEX "P3DActiveX Control"
  2606. IDS_P3DACTIVEX_PPG "P3DActiveX Property Page"
  2607. END
  2608. STRINGTABLE
  2609. BEGIN
  2610. IDS_P3DACTIVEX_PPG_CAPTION "General"
  2611. END
  2612. #endif
  2613. #ifndef APSTUDIO_INVOKED
  2614. 1 TYPELIB "P3DActiveX.tlb"
  2615. #endif"""
  2616. def CreatePandaVersionFiles():
  2617. version1=int(VERSION.split(".")[0])
  2618. version2=int(VERSION.split(".")[1])
  2619. version3=int(VERSION.split(".")[2])
  2620. nversion=version1*1000000+version2*1000+version3
  2621. if (DISTRIBUTOR != "cmu"):
  2622. # Subtract 1 if we are not an official version.
  2623. nversion -= 1
  2624. if (RUNTIME):
  2625. pandaversion_h = PANDAVERSION_H_RUNTIME
  2626. else:
  2627. pandaversion_h = PANDAVERSION_H
  2628. pandaversion_h = pandaversion_h.replace("$VERSION1",str(version1))
  2629. pandaversion_h = pandaversion_h.replace("$VERSION2",str(version2))
  2630. pandaversion_h = pandaversion_h.replace("$VERSION3",str(version3))
  2631. pandaversion_h = pandaversion_h.replace("$VERSION",VERSION)
  2632. pandaversion_h = pandaversion_h.replace("$NVERSION",str(nversion))
  2633. pandaversion_h = pandaversion_h.replace("$DISTRIBUTOR",DISTRIBUTOR)
  2634. pandaversion_h = pandaversion_h.replace("$RTDIST_VERSION",RTDIST_VERSION)
  2635. pandaversion_h = pandaversion_h.replace("$COREAPI_VERSION",COREAPI_VERSION)
  2636. pandaversion_h = pandaversion_h.replace("$HOST_URL",(HOST_URL or ""))
  2637. if (DISTRIBUTOR == "cmu"):
  2638. pandaversion_h += "\n#define PANDA_OFFICIAL_VERSION\n"
  2639. else:
  2640. pandaversion_h += "\n#undef PANDA_OFFICIAL_VERSION\n"
  2641. if GIT_COMMIT:
  2642. pandaversion_h += "\n#define PANDA_GIT_COMMIT_STR \"%s\"\n" % (GIT_COMMIT)
  2643. # Allow creating a deterministic build by setting this.
  2644. source_date = os.environ.get("SOURCE_DATE_EPOCH")
  2645. if source_date:
  2646. # This matches the GCC / Clang format for __DATE__ __TIME__
  2647. source_date = time.gmtime(int(source_date))
  2648. try:
  2649. source_date = time.strftime('%b %e %Y %H:%M:%S', source_date)
  2650. except ValueError:
  2651. source_date = time.strftime('%b %d %Y %H:%M:%S', source_date)
  2652. if source_date[3:5] == ' 0':
  2653. source_date = source_date[:3] + ' ' + source_date[5:]
  2654. pandaversion_h += "\n#define PANDA_BUILD_DATE_STR \"%s\"\n" % (source_date)
  2655. if not RUNTIME:
  2656. checkpandaversion_cxx = CHECKPANDAVERSION_CXX.replace("$VERSION1",str(version1))
  2657. checkpandaversion_cxx = checkpandaversion_cxx.replace("$VERSION2",str(version2))
  2658. checkpandaversion_cxx = checkpandaversion_cxx.replace("$VERSION3",str(version3))
  2659. checkpandaversion_cxx = checkpandaversion_cxx.replace("$NVERSION",str(nversion))
  2660. checkpandaversion_h = CHECKPANDAVERSION_H.replace("$VERSION1",str(version1))
  2661. checkpandaversion_h = checkpandaversion_h.replace("$VERSION2",str(version2))
  2662. checkpandaversion_h = checkpandaversion_h.replace("$VERSION3",str(version3))
  2663. checkpandaversion_h = checkpandaversion_h.replace("$NVERSION",str(nversion))
  2664. ConditionalWriteFile(GetOutputDir()+'/include/pandaVersion.h', pandaversion_h)
  2665. if RUNTIME:
  2666. ConditionalWriteFile(GetOutputDir()+'/include/checkPandaVersion.cxx', '')
  2667. ConditionalWriteFile(GetOutputDir()+'/include/checkPandaVersion.h', '')
  2668. else:
  2669. ConditionalWriteFile(GetOutputDir()+'/include/checkPandaVersion.cxx', checkpandaversion_cxx)
  2670. ConditionalWriteFile(GetOutputDir()+'/include/checkPandaVersion.h', checkpandaversion_h)
  2671. ConditionalWriteFile(GetOutputDir()+"/tmp/null.cxx","")
  2672. if RUNTIME:
  2673. p3dactivex_rc = {"name" : "Panda3D Game Engine Plug-in",
  2674. "version" : VERSION,
  2675. "description" : "Runs 3-D games and interactive applets",
  2676. "filename" : "p3dactivex.ocx",
  2677. "mimetype" : "application/x-panda3d",
  2678. "extension" : "p3d",
  2679. "filedesc" : "Panda3D applet"}
  2680. ConditionalWriteFile(GetOutputDir()+"/include/P3DActiveX.rc", P3DACTIVEX_RC % GenerateResourceFile(**p3dactivex_rc))
  2681. CreatePandaVersionFiles()
  2682. ##########################################################################################
  2683. #
  2684. # Copy the "direct" tree
  2685. #
  2686. ##########################################################################################
  2687. if (PkgSkip("DIRECT")==0):
  2688. CopyPythonTree(GetOutputDir() + '/direct', 'direct/src', threads=THREADCOUNT)
  2689. ConditionalWriteFile(GetOutputDir() + '/direct/__init__.py', "")
  2690. # This file used to be copied, but would nowadays cause conflicts.
  2691. # Let's get it out of the way in case someone hasn't cleaned their build since.
  2692. if os.path.isfile(GetOutputDir() + '/bin/panda3d.py'):
  2693. os.remove(GetOutputDir() + '/bin/panda3d.py')
  2694. if os.path.isfile(GetOutputDir() + '/lib/panda3d.py'):
  2695. os.remove(GetOutputDir() + '/lib/panda3d.py')
  2696. # This directory doesn't exist at all any more.
  2697. if os.path.isdir(os.path.join(GetOutputDir(), 'direct', 'ffi')):
  2698. shutil.rmtree(os.path.join(GetOutputDir(), 'direct', 'ffi'))
  2699. # These files used to exist; remove them to avoid conflicts.
  2700. del_files = ['core.py', 'core.pyc', 'core.pyo',
  2701. '_core.pyd', '_core.so',
  2702. 'direct.py', 'direct.pyc', 'direct.pyo',
  2703. '_direct.pyd', '_direct.so',
  2704. 'dtoolconfig.pyd', 'dtoolconfig.so']
  2705. for basename in del_files:
  2706. path = os.path.join(GetOutputDir(), 'panda3d', basename)
  2707. if os.path.isfile(path):
  2708. print("Removing %s" % (path))
  2709. os.remove(path)
  2710. # Write an appropriate panda3d/__init__.py
  2711. p3d_init = """"Python bindings for the Panda3D libraries"
  2712. __version__ = '%s'
  2713. """ % (WHLVERSION)
  2714. if GetTarget() == 'windows':
  2715. p3d_init += """
  2716. if '__file__' in locals():
  2717. import os
  2718. bindir = os.path.join(os.path.dirname(__file__), '..', 'bin')
  2719. if os.path.isdir(bindir):
  2720. if hasattr(os, 'add_dll_directory'):
  2721. os.add_dll_directory(bindir)
  2722. elif not os.environ.get('PATH'):
  2723. os.environ['PATH'] = bindir
  2724. else:
  2725. os.environ['PATH'] = bindir + os.pathsep + os.environ['PATH']
  2726. del os, bindir
  2727. """
  2728. if not PkgSkip("PYTHON"):
  2729. ConditionalWriteFile(GetOutputDir() + '/panda3d/__init__.py', p3d_init)
  2730. # Also add this file, for backward compatibility.
  2731. ConditionalWriteFile(GetOutputDir() + '/panda3d/dtoolconfig.py', """\
  2732. '''Alias of :mod:`panda3d.interrogatedb`.
  2733. .. deprecated:: 1.10.0
  2734. This module has been renamed to :mod:`panda3d.interrogatedb`.
  2735. '''
  2736. if __debug__:
  2737. print("Warning: panda3d.dtoolconfig is deprecated, use panda3d.interrogatedb instead.")
  2738. from .interrogatedb import *
  2739. """)
  2740. # PandaModules is now deprecated; generate a shim for backward compatibility.
  2741. for fn in glob.glob(GetOutputDir() + '/pandac/*.py') + glob.glob(GetOutputDir() + '/pandac/*.py[co]'):
  2742. if os.path.basename(fn) not in ('PandaModules.py', '__init__.py'):
  2743. os.remove(fn)
  2744. panda_modules = ['core']
  2745. if not PkgSkip("PANDAPHYSICS"):
  2746. panda_modules.append('physics')
  2747. if not PkgSkip('PANDAFX'):
  2748. panda_modules.append('fx')
  2749. if not PkgSkip("DIRECT"):
  2750. panda_modules.append('direct')
  2751. if not PkgSkip("VISION"):
  2752. panda_modules.append('vision')
  2753. if not PkgSkip("SKEL"):
  2754. panda_modules.append('skel')
  2755. if not PkgSkip("EGG"):
  2756. panda_modules.append('egg')
  2757. if not PkgSkip("ODE"):
  2758. panda_modules.append('ode')
  2759. if not PkgSkip("VRPN"):
  2760. panda_modules.append('vrpn')
  2761. panda_modules_code = """
  2762. "This module is deprecated. Import from panda3d.core and other panda3d.* modules instead."
  2763. if __debug__:
  2764. print("Warning: pandac.PandaModules is deprecated, import from panda3d.core instead")
  2765. """
  2766. for module in panda_modules:
  2767. panda_modules_code += """
  2768. try:
  2769. from panda3d.%s import *
  2770. except ImportError as err:
  2771. if "No module named %s" not in str(err):
  2772. raise""" % (module, module)
  2773. panda_modules_code += """
  2774. from direct.showbase import DConfig
  2775. def get_config_showbase():
  2776. return DConfig
  2777. def get_config_express():
  2778. return DConfig
  2779. getConfigShowbase = get_config_showbase
  2780. getConfigExpress = get_config_express
  2781. """
  2782. exthelpers_code = """
  2783. "This module is deprecated. Import from direct.extensions_native.extension_native_helpers instead."
  2784. from direct.extensions_native.extension_native_helpers import *
  2785. """
  2786. if not PkgSkip("PYTHON"):
  2787. ConditionalWriteFile(GetOutputDir() + '/pandac/PandaModules.py', panda_modules_code)
  2788. ConditionalWriteFile(GetOutputDir() + '/pandac/extension_native_helpers.py', exthelpers_code)
  2789. ConditionalWriteFile(GetOutputDir() + '/pandac/__init__.py', '')
  2790. ##########################################################################################
  2791. #
  2792. # Write the dist-info directory.
  2793. #
  2794. ##########################################################################################
  2795. # This is just some basic stuff since setuptools just needs this file to
  2796. # exist, otherwise it will not read the entry_points.txt file. Maybe we will
  2797. # eventually want to merge this with the metadata generator in makewheel.py.
  2798. METADATA = """Metadata-Version: 2.0
  2799. Name: Panda3D
  2800. Version: {version}
  2801. License: BSD
  2802. Home-page: https://www.panda3d.org/
  2803. Author: Panda3D Team
  2804. Author-email: [email protected]
  2805. """
  2806. ENTRY_POINTS = """[distutils.commands]
  2807. build_apps = direct.dist.commands:build_apps
  2808. bdist_apps = direct.dist.commands:bdist_apps
  2809. """
  2810. if not PkgSkip("DIRECT"):
  2811. dist_dir = os.path.join(GetOutputDir(), 'panda3d.dist-info')
  2812. MakeDirectory(dist_dir)
  2813. ConditionalWriteFile(os.path.join(dist_dir, 'METADATA'), METADATA.format(version=VERSION))
  2814. ConditionalWriteFile(os.path.join(dist_dir, 'entry_points.txt'), ENTRY_POINTS)
  2815. ##########################################################################################
  2816. #
  2817. # Generate the PRC files into the ETC directory.
  2818. #
  2819. ##########################################################################################
  2820. confautoprc = ReadFile("makepanda/confauto.in")
  2821. if (PkgSkip("SPEEDTREE")==0):
  2822. # If SpeedTree is available, enable it in the config file
  2823. confautoprc = confautoprc.replace('#st#', '')
  2824. else:
  2825. # otherwise, disable it.
  2826. confautoprc = confautoprc.replace('#st#', '#')
  2827. confautoprc = confautoprc.replace('\r\n', '\n')
  2828. if PkgSkip("ASSIMP") or GetLinkAllStatic():
  2829. confautoprc = confautoprc.replace("load-file-type p3assimp", "#load-file-type p3assimp")
  2830. if PkgSkip("EGG") or GetLinkAllStatic():
  2831. confautoprc = confautoprc.replace("load-file-type egg pandaegg", "#load-file-type egg pandaegg")
  2832. if PkgSkip("PANDATOOL") or PkgSkip("EGG") or GetLinkAllStatic():
  2833. confautoprc = confautoprc.replace("load-file-type p3ptloader", "#load-file-type p3ptloader")
  2834. if PkgSkip("FFMPEG") or GetLinkAllStatic():
  2835. confautoprc = confautoprc.replace("load-audio-type * p3ffmpeg", "#load-audio-type * p3ffmpeg")
  2836. confautoprc = confautoprc.replace("load-video-type * p3ffmpeg", "#load-video-type * p3ffmpeg")
  2837. if (os.path.isfile("makepanda/myconfig.in")):
  2838. configprc = ReadFile("makepanda/myconfig.in")
  2839. else:
  2840. configprc = ReadFile("makepanda/config.in")
  2841. configprc = configprc.replace('\r\n', '\n')
  2842. if (GetTarget() == 'windows'):
  2843. configprc = configprc.replace("$XDG_CACHE_HOME/panda3d", "$USER_APPDATA/Panda3D-%s" % MAJOR_VERSION)
  2844. elif not PkgSkip("X11") and not PkgSkip("GL") and not PkgSkip("EGL") and not GetLinkAllStatic():
  2845. configprc = configprc.replace("#load-display pandadx9", "aux-display p3headlessgl")
  2846. else:
  2847. configprc = configprc.replace("aux-display pandadx9", "")
  2848. if (GetTarget() == 'darwin'):
  2849. configprc = configprc.replace("$XDG_CACHE_HOME/panda3d", "$HOME/Library/Caches/Panda3D-%s" % MAJOR_VERSION)
  2850. # OpenAL is not yet working well on OSX for us, so let's do this for now.
  2851. if not PkgSkip("FMODEX"):
  2852. configprc = configprc.replace("p3openal_audio", "p3fmod_audio")
  2853. if PkgSkip("GL") or GetLinkAllStatic():
  2854. configprc = configprc.replace("\nload-display pandagl", "\n#load-display pandagl")
  2855. if PkgSkip("GLES") or GetLinkAllStatic():
  2856. configprc = configprc.replace("\n#load-display pandagles", "")
  2857. if PkgSkip("DX9") or GetLinkAllStatic():
  2858. configprc = configprc.replace("\n#load-display pandadx9", "")
  2859. if PkgSkip("TINYDISPLAY") or GetLinkAllStatic():
  2860. configprc = configprc.replace("\n#load-display p3tinydisplay", "")
  2861. if PkgSkip("OPENAL") or GetLinkAllStatic():
  2862. configprc = configprc.replace("audio-library-name p3openal_audio", "#audio-library-name p3openal_audio")
  2863. if GetTarget() == 'windows':
  2864. # Convert to Windows newlines.
  2865. ConditionalWriteFile(GetOutputDir()+"/etc/Config.prc", configprc, newline='\r\n')
  2866. ConditionalWriteFile(GetOutputDir()+"/etc/Confauto.prc", confautoprc, newline='\r\n')
  2867. else:
  2868. ConditionalWriteFile(GetOutputDir()+"/etc/Config.prc", configprc)
  2869. ConditionalWriteFile(GetOutputDir()+"/etc/Confauto.prc", confautoprc)
  2870. ##########################################################################################
  2871. #
  2872. # Copy the precompiled binaries and DLLs into the build.
  2873. #
  2874. ##########################################################################################
  2875. tp_dir = GetThirdpartyDir()
  2876. if tp_dir is not None:
  2877. dylibs = {}
  2878. if GetTarget() == 'darwin':
  2879. # Make a list of all the dylibs we ship, to figure out whether we should use
  2880. # install_name_tool to correct the library reference to point to our copy.
  2881. for pkg in PkgListGet():
  2882. if PkgSkip(pkg):
  2883. continue
  2884. tp_libdir = GetThirdpartyLibDir(pkg)
  2885. for lib in glob.glob(os.path.join(tp_libdir, "*.dylib")):
  2886. dylibs[os.path.basename(lib)] = os.path.basename(os.path.realpath(lib))
  2887. if not PkgSkip("PYTHON"):
  2888. for lib in glob.glob(os.path.join(tp_libdir, SDK["PYTHONVERSION"], "*.dylib")):
  2889. dylibs[os.path.basename(lib)] = os.path.basename(os.path.realpath(lib))
  2890. for pkg in PkgListGet():
  2891. if PkgSkip(pkg):
  2892. continue
  2893. tp_pkg = tp_dir + pkg.lower()
  2894. if GetTarget() == 'windows':
  2895. if os.path.exists(tp_pkg + "/bin"):
  2896. CopyAllFiles(GetOutputDir() + "/bin/", tp_pkg + "/bin/")
  2897. if (PkgSkip("PYTHON")==0 and os.path.exists(tp_pkg + "/bin/" + SDK["PYTHONVERSION"])):
  2898. CopyAllFiles(GetOutputDir() + "/bin/", tp_pkg + "/bin/" + SDK["PYTHONVERSION"] + "/")
  2899. elif GetTarget() == 'darwin':
  2900. tp_libdir = GetThirdpartyLibDir(pkg)
  2901. tp_libs = glob.glob(os.path.join(tp_libdir, "*.dylib"))
  2902. if not PkgSkip("PYTHON"):
  2903. tp_libs += glob.glob(os.path.join(tp_libdir, SDK["PYTHONVERSION"], "*.dylib"))
  2904. tp_libs += glob.glob(os.path.join(tp_libdir, SDK["PYTHONVERSION"], "*.so"))
  2905. if pkg != 'PYTHON':
  2906. tp_libs += glob.glob(os.path.join(tp_libdir, SDK["PYTHONVERSION"], "*.py"))
  2907. for tp_lib in tp_libs:
  2908. basename = os.path.basename(tp_lib)
  2909. if basename.endswith('.dylib'):
  2910. # It's a dynamic link library. Put it in the lib directory.
  2911. target = GetOutputDir() + "/lib/" + basename
  2912. dep_prefix = "@loader_path/../lib/"
  2913. lib_id = dep_prefix + basename
  2914. else:
  2915. # It's a Python module, like _rocketcore.so. Copy it to the root, because
  2916. # nowadays the 'lib' directory may no longer be on the PYTHONPATH.
  2917. target = GetOutputDir() + "/" + basename
  2918. dep_prefix = "@loader_path/lib/"
  2919. lib_id = basename
  2920. if not NeedsBuild([target], [tp_lib]):
  2921. continue
  2922. CopyFile(target, tp_lib)
  2923. if os.path.islink(target) or target.endswith('.py'):
  2924. continue
  2925. # Correct the inter-library dependencies so that the build is relocatable.
  2926. oscmd('install_name_tool -id %s %s' % (lib_id, target))
  2927. oscmd("otool -L %s | grep .dylib > %s/tmp/otool-libs.txt" % (target, GetOutputDir()), True)
  2928. for line in open(GetOutputDir() + "/tmp/otool-libs.txt", "r"):
  2929. line = line.strip()
  2930. if not line or line.startswith(dep_prefix) or line.endswith(":"):
  2931. continue
  2932. libdep = line.split(" ", 1)[0]
  2933. dep_basename = os.path.basename(libdep)
  2934. if dep_basename in dylibs:
  2935. dep_target = dylibs[dep_basename]
  2936. oscmd("install_name_tool -change %s %s%s %s" % (libdep, dep_prefix, dep_target, target), True)
  2937. JustBuilt([target], [tp_lib])
  2938. for fwx in glob.glob(tp_pkg + "/*.framework"):
  2939. MakeDirectory(GetOutputDir() + "/Frameworks")
  2940. CopyTree(GetOutputDir() + "/Frameworks/" + os.path.basename(fwx), fwx)
  2941. else: # Linux / FreeBSD case.
  2942. for tp_lib in glob.glob(tp_pkg + "/lib/*.so*"):
  2943. CopyFile(GetOutputDir() + "/lib/" + os.path.basename(tp_lib), tp_lib)
  2944. if not PkgSkip("PYTHON"):
  2945. for tp_lib in glob.glob(os.path.join(tp_pkg, "lib", SDK["PYTHONVERSION"], "*.so*")):
  2946. base = os.path.basename(tp_lib)
  2947. if base.startswith('lib'):
  2948. CopyFile(GetOutputDir() + "/lib/" + base, tp_lib)
  2949. else:
  2950. # It's a Python module, like _rocketcore.so.
  2951. CopyFile(GetOutputDir() + "/" + base, tp_lib)
  2952. if GetTarget() == 'windows':
  2953. if os.path.isdir(os.path.join(tp_dir, "extras", "bin")):
  2954. CopyAllFiles(GetOutputDir() + "/bin/", tp_dir + "extras/bin/")
  2955. if not PkgSkip("PYTHON") and not RTDIST:
  2956. # We need to copy the Python DLL to the bin directory for now.
  2957. pydll = "/" + SDK["PYTHONVERSION"].replace(".", "")
  2958. if GetOptimize() <= 2:
  2959. pydll += "_d.dll"
  2960. else:
  2961. pydll += ".dll"
  2962. CopyFile(GetOutputDir() + "/bin" + pydll, SDK["PYTHON"] + pydll)
  2963. for fn in glob.glob(SDK["PYTHON"] + "/vcruntime*.dll"):
  2964. CopyFile(GetOutputDir() + "/bin/", fn)
  2965. # Copy the whole Python directory.
  2966. if COPY_PYTHON:
  2967. CopyTree(GetOutputDir() + "/python", SDK["PYTHON"])
  2968. # NB: Python does not always ship with the correct manifest/dll.
  2969. # Figure out the correct one to ship, and grab it from WinSxS dir.
  2970. manifest = GetOutputDir() + '/tmp/python.manifest'
  2971. if os.path.isfile(manifest):
  2972. os.unlink(manifest)
  2973. oscmd('mt -inputresource:"%s\\python.exe";#1 -out:"%s" -nologo' % (SDK["PYTHON"], manifest), True)
  2974. if COPY_PYTHON and os.path.isfile(manifest):
  2975. import xml.etree.ElementTree as ET
  2976. tree = ET.parse(manifest)
  2977. idents = tree.findall('./{urn:schemas-microsoft-com:asm.v1}dependency/{urn:schemas-microsoft-com:asm.v1}dependentAssembly/{urn:schemas-microsoft-com:asm.v1}assemblyIdentity')
  2978. else:
  2979. idents = ()
  2980. for ident in idents:
  2981. sxs_name = '_'.join([
  2982. ident.get('processorArchitecture'),
  2983. ident.get('name').lower(),
  2984. ident.get('publicKeyToken'),
  2985. ident.get('version'),
  2986. ])
  2987. # Find the manifest matching these parameters.
  2988. pattern = os.path.join('C:' + os.sep, 'Windows', 'WinSxS', 'Manifests', sxs_name + '_*.manifest')
  2989. manifests = glob.glob(pattern)
  2990. if not manifests:
  2991. Warn("Could not locate manifest %s. You may need to reinstall the Visual C++ Redistributable." % (pattern))
  2992. continue
  2993. CopyFile(GetOutputDir() + "/python/" + ident.get('name') + ".manifest", manifests[0])
  2994. # Also copy the corresponding msvcr dll.
  2995. pattern = os.path.join('C:' + os.sep, 'Windows', 'WinSxS', sxs_name + '_*', 'msvcr*.dll')
  2996. for file in glob.glob(pattern):
  2997. CopyFile(GetOutputDir() + "/python/", file)
  2998. # Copy python.exe to ppython.exe.
  2999. if COPY_PYTHON:
  3000. if not os.path.isfile(SDK["PYTHON"] + "/ppython.exe") and os.path.isfile(SDK["PYTHON"] + "/python.exe"):
  3001. CopyFile(GetOutputDir() + "/python/ppython.exe", SDK["PYTHON"] + "/python.exe")
  3002. if not os.path.isfile(SDK["PYTHON"] + "/ppythonw.exe") and os.path.isfile(SDK["PYTHON"] + "/pythonw.exe"):
  3003. CopyFile(GetOutputDir() + "/python/ppythonw.exe", SDK["PYTHON"] + "/pythonw.exe")
  3004. ConditionalWriteFile(GetOutputDir() + "/python/panda.pth", "..\n../bin\n")
  3005. # Copy over the MSVC runtime.
  3006. if GetTarget() == 'windows' and "VISUALSTUDIO" in SDK:
  3007. vcver = "%s%s" % (SDK["MSVC_VERSION"][0], 0) # ignore minor version.
  3008. crtname = "Microsoft.VC%s.CRT" % (vcver)
  3009. if ("VCTOOLSVERSION" in SDK):
  3010. dir = os.path.join(SDK["VISUALSTUDIO"], "VC", "Redist", "MSVC", SDK["VCTOOLSVERSION"], "onecore", GetTargetArch(), crtname)
  3011. else:
  3012. dir = os.path.join(SDK["VISUALSTUDIO"], "VC", "redist", GetTargetArch(), crtname)
  3013. if os.path.isfile(os.path.join(dir, "msvcr" + vcver + ".dll")):
  3014. CopyFile(GetOutputDir() + "/bin/", os.path.join(dir, "msvcr" + vcver + ".dll"))
  3015. if os.path.isfile(os.path.join(dir, "msvcp" + vcver + ".dll")):
  3016. CopyFile(GetOutputDir() + "/bin/", os.path.join(dir, "msvcp" + vcver + ".dll"))
  3017. if os.path.isfile(os.path.join(dir, "vcruntime" + vcver + ".dll")):
  3018. CopyFile(GetOutputDir() + "/bin/", os.path.join(dir, "vcruntime" + vcver + ".dll"))
  3019. ########################################################################
  3020. ##
  3021. ## Copy various stuff into the build.
  3022. ##
  3023. ########################################################################
  3024. if GetTarget() == 'windows':
  3025. # Convert to Windows newlines so they can be opened by notepad.
  3026. WriteFile(GetOutputDir() + "/LICENSE", ReadFile("doc/LICENSE"), newline='\r\n')
  3027. WriteFile(GetOutputDir() + "/ReleaseNotes", ReadFile("doc/ReleaseNotes"), newline='\r\n')
  3028. CopyFile(GetOutputDir() + "/pandaIcon.ico", "panda/src/configfiles/pandaIcon.ico")
  3029. else:
  3030. CopyFile(GetOutputDir()+"/", "doc/LICENSE")
  3031. CopyFile(GetOutputDir()+"/", "doc/ReleaseNotes")
  3032. if (PkgSkip("PANDATOOL")==0):
  3033. CopyAllFiles(GetOutputDir()+"/plugins/", "pandatool/src/scripts/", ".mel")
  3034. CopyAllFiles(GetOutputDir()+"/plugins/", "pandatool/src/scripts/", ".ms")
  3035. if (PkgSkip("PYTHON")==0 and os.path.isdir(GetThirdpartyBase()+"/Pmw")):
  3036. CopyTree(GetOutputDir()+'/Pmw', GetThirdpartyBase()+'/Pmw')
  3037. ConditionalWriteFile(GetOutputDir()+'/include/ctl3d.h', '/* dummy file to make MAX happy */')
  3038. # Since Eigen is included by all sorts of core headers, as a convenience
  3039. # to C++ users on Win and Mac, we include it in the Panda include directory.
  3040. if not PkgSkip("EIGEN") and GetTarget() in ("windows", "darwin") and GetThirdpartyDir():
  3041. CopyTree(GetOutputDir()+'/include/Eigen', GetThirdpartyDir()+'eigen/include/Eigen')
  3042. ########################################################################
  3043. #
  3044. # Copy header files to the built/include/parser-inc directory.
  3045. #
  3046. ########################################################################
  3047. CopyTree(GetOutputDir()+'/include/parser-inc','dtool/src/parser-inc')
  3048. DeleteVCS(GetOutputDir()+'/include/parser-inc')
  3049. ########################################################################
  3050. #
  3051. # Transfer all header files to the built/include directory.
  3052. #
  3053. ########################################################################
  3054. CopyAllHeaders('dtool/src/dtoolbase')
  3055. CopyAllHeaders('dtool/src/dtoolutil', skip=["pandaVersion.h", "checkPandaVersion.h"])
  3056. CopyFile(GetOutputDir()+'/include/','dtool/src/dtoolutil/vector_src.cxx')
  3057. CopyAllHeaders('dtool/metalibs/dtool')
  3058. CopyAllHeaders('dtool/src/cppparser')
  3059. CopyAllHeaders('dtool/src/prc', skip=["prc_parameters.h"])
  3060. CopyAllHeaders('dtool/src/dconfig')
  3061. CopyAllHeaders('dtool/src/interrogatedb')
  3062. CopyAllHeaders('dtool/metalibs/dtoolconfig')
  3063. CopyAllHeaders('dtool/src/pystub')
  3064. CopyAllHeaders('dtool/src/interrogate')
  3065. CopyAllHeaders('dtool/src/test_interrogate')
  3066. CopyAllHeaders('panda/src/putil')
  3067. CopyAllHeaders('panda/src/pandabase')
  3068. CopyAllHeaders('panda/src/express')
  3069. CopyAllHeaders('panda/src/downloader')
  3070. CopyAllHeaders('panda/metalibs/pandaexpress')
  3071. CopyAllHeaders('panda/src/pipeline')
  3072. CopyAllHeaders('panda/src/linmath')
  3073. CopyAllHeaders('panda/src/putil')
  3074. CopyAllHeaders('dtool/src/prckeys')
  3075. CopyAllHeaders('panda/src/audio')
  3076. CopyAllHeaders('panda/src/event')
  3077. CopyAllHeaders('panda/src/mathutil')
  3078. CopyAllHeaders('panda/src/gsgbase')
  3079. CopyAllHeaders('panda/src/pnmimage')
  3080. CopyAllHeaders('panda/src/nativenet')
  3081. CopyAllHeaders('panda/src/net')
  3082. CopyAllHeaders('panda/src/pstatclient')
  3083. CopyAllHeaders('panda/src/gobj')
  3084. CopyAllHeaders('panda/src/movies')
  3085. CopyAllHeaders('panda/src/pgraphnodes')
  3086. CopyAllHeaders('panda/src/pgraph')
  3087. CopyAllHeaders('panda/src/cull')
  3088. CopyAllHeaders('panda/src/display')
  3089. CopyAllHeaders('panda/src/chan')
  3090. CopyAllHeaders('panda/src/char')
  3091. CopyAllHeaders('panda/src/dgraph')
  3092. CopyAllHeaders('panda/src/device')
  3093. CopyAllHeaders('panda/src/pnmtext')
  3094. CopyAllHeaders('panda/src/text')
  3095. CopyAllHeaders('panda/src/grutil')
  3096. if (PkgSkip("VISION")==0):
  3097. CopyAllHeaders('panda/src/vision')
  3098. if (PkgSkip("FFMPEG")==0):
  3099. CopyAllHeaders('panda/src/ffmpeg')
  3100. CopyAllHeaders('panda/src/tform')
  3101. CopyAllHeaders('panda/src/collide')
  3102. CopyAllHeaders('panda/src/parametrics')
  3103. CopyAllHeaders('panda/src/pgui')
  3104. CopyAllHeaders('panda/src/pnmimagetypes')
  3105. CopyAllHeaders('panda/src/recorder')
  3106. if (PkgSkip("ROCKET")==0):
  3107. CopyAllHeaders('panda/src/rocket')
  3108. if (PkgSkip("VRPN")==0):
  3109. CopyAllHeaders('panda/src/vrpn')
  3110. CopyAllHeaders('panda/src/wgldisplay')
  3111. CopyAllHeaders('panda/src/ode')
  3112. CopyAllHeaders('panda/metalibs/pandaode')
  3113. if (PkgSkip("PANDAPHYSICS")==0):
  3114. CopyAllHeaders('panda/src/physics')
  3115. if (PkgSkip("PANDAPARTICLESYSTEM")==0):
  3116. CopyAllHeaders('panda/src/particlesystem')
  3117. CopyAllHeaders('panda/src/dxml')
  3118. CopyAllHeaders('panda/metalibs/panda')
  3119. CopyAllHeaders('panda/src/audiotraits')
  3120. CopyAllHeaders('panda/src/audiotraits')
  3121. CopyAllHeaders('panda/src/distort')
  3122. CopyAllHeaders('panda/src/downloadertools')
  3123. CopyAllHeaders('panda/src/windisplay')
  3124. CopyAllHeaders('panda/src/dxgsg9')
  3125. CopyAllHeaders('panda/metalibs/pandadx9')
  3126. if not PkgSkip("EGG"):
  3127. CopyAllHeaders('panda/src/egg')
  3128. CopyAllHeaders('panda/src/egg2pg')
  3129. CopyAllHeaders('panda/src/framework')
  3130. CopyAllHeaders('panda/metalibs/pandafx')
  3131. CopyAllHeaders('panda/src/glstuff')
  3132. CopyAllHeaders('panda/src/glgsg')
  3133. CopyAllHeaders('panda/src/glesgsg')
  3134. CopyAllHeaders('panda/src/gles2gsg')
  3135. if not PkgSkip("EGG"):
  3136. CopyAllHeaders('panda/metalibs/pandaegg')
  3137. if GetTarget() == 'windows':
  3138. CopyAllHeaders('panda/src/wgldisplay')
  3139. elif GetTarget() == 'darwin':
  3140. CopyAllHeaders('panda/src/osxdisplay')
  3141. CopyAllHeaders('panda/src/cocoadisplay')
  3142. elif GetTarget() == 'android':
  3143. CopyAllHeaders('panda/src/android')
  3144. CopyAllHeaders('panda/src/androiddisplay')
  3145. if not PkgSkip('X11'):
  3146. CopyAllHeaders('panda/src/x11display')
  3147. if not PkgSkip('GL'):
  3148. CopyAllHeaders('panda/src/glxdisplay')
  3149. CopyAllHeaders('panda/src/egldisplay')
  3150. CopyAllHeaders('panda/metalibs/pandagl')
  3151. CopyAllHeaders('panda/metalibs/pandagles')
  3152. CopyAllHeaders('panda/metalibs/pandagles2')
  3153. CopyAllHeaders('panda/metalibs/pandaphysics')
  3154. CopyAllHeaders('panda/src/testbed')
  3155. if (PkgSkip("PHYSX")==0):
  3156. CopyAllHeaders('panda/src/physx')
  3157. CopyAllHeaders('panda/metalibs/pandaphysx')
  3158. if (PkgSkip("BULLET")==0):
  3159. CopyAllHeaders('panda/src/bullet')
  3160. CopyAllHeaders('panda/metalibs/pandabullet')
  3161. if (PkgSkip("SPEEDTREE")==0):
  3162. CopyAllHeaders('panda/src/speedtree')
  3163. if (PkgSkip("DIRECT")==0):
  3164. CopyAllHeaders('direct/src/directbase')
  3165. CopyAllHeaders('direct/src/dcparser')
  3166. CopyAllHeaders('direct/src/deadrec')
  3167. CopyAllHeaders('direct/src/distributed')
  3168. CopyAllHeaders('direct/src/interval')
  3169. CopyAllHeaders('direct/src/showbase')
  3170. CopyAllHeaders('direct/src/dcparse')
  3171. if (RUNTIME or RTDIST):
  3172. CopyAllHeaders('direct/src/plugin', skip=["p3d_plugin_config.h"])
  3173. if (RUNTIME):
  3174. CopyAllHeaders('direct/src/plugin_npapi')
  3175. CopyAllHeaders('direct/src/plugin_standalone')
  3176. if (PkgSkip("PANDATOOL")==0):
  3177. CopyAllHeaders('pandatool/src/pandatoolbase')
  3178. CopyAllHeaders('pandatool/src/converter')
  3179. CopyAllHeaders('pandatool/src/progbase')
  3180. CopyAllHeaders('pandatool/src/eggbase')
  3181. CopyAllHeaders('pandatool/src/bam')
  3182. CopyAllHeaders('pandatool/src/cvscopy')
  3183. CopyAllHeaders('pandatool/src/daeegg')
  3184. CopyAllHeaders('pandatool/src/daeprogs')
  3185. CopyAllHeaders('pandatool/src/dxf')
  3186. CopyAllHeaders('pandatool/src/dxfegg')
  3187. CopyAllHeaders('pandatool/src/dxfprogs')
  3188. CopyAllHeaders('pandatool/src/palettizer')
  3189. CopyAllHeaders('pandatool/src/egg-mkfont')
  3190. CopyAllHeaders('pandatool/src/eggcharbase')
  3191. CopyAllHeaders('pandatool/src/egg-optchar')
  3192. CopyAllHeaders('pandatool/src/egg-palettize')
  3193. CopyAllHeaders('pandatool/src/egg-qtess')
  3194. CopyAllHeaders('pandatool/src/eggprogs')
  3195. CopyAllHeaders('pandatool/src/flt')
  3196. CopyAllHeaders('pandatool/src/fltegg')
  3197. CopyAllHeaders('pandatool/src/fltprogs')
  3198. CopyAllHeaders('pandatool/src/imagebase')
  3199. CopyAllHeaders('pandatool/src/imageprogs')
  3200. CopyAllHeaders('pandatool/src/pfmprogs')
  3201. CopyAllHeaders('pandatool/src/lwo')
  3202. CopyAllHeaders('pandatool/src/lwoegg')
  3203. CopyAllHeaders('pandatool/src/lwoprogs')
  3204. CopyAllHeaders('pandatool/src/maya')
  3205. CopyAllHeaders('pandatool/src/mayaegg')
  3206. CopyAllHeaders('pandatool/src/maxegg')
  3207. CopyAllHeaders('pandatool/src/maxprogs')
  3208. CopyAllHeaders('pandatool/src/objegg')
  3209. CopyAllHeaders('pandatool/src/objprogs')
  3210. CopyAllHeaders('pandatool/src/vrml')
  3211. CopyAllHeaders('pandatool/src/vrmlegg')
  3212. CopyAllHeaders('pandatool/src/xfile')
  3213. CopyAllHeaders('pandatool/src/xfileegg')
  3214. CopyAllHeaders('pandatool/src/ptloader')
  3215. CopyAllHeaders('pandatool/src/miscprogs')
  3216. CopyAllHeaders('pandatool/src/pstatserver')
  3217. CopyAllHeaders('pandatool/src/text-stats')
  3218. CopyAllHeaders('pandatool/src/vrmlprogs')
  3219. CopyAllHeaders('pandatool/src/win-stats')
  3220. CopyAllHeaders('pandatool/src/xfileprogs')
  3221. if (PkgSkip("CONTRIB")==0):
  3222. CopyAllHeaders('contrib/src/contribbase')
  3223. CopyAllHeaders('contrib/src/ai')
  3224. ########################################################################
  3225. #
  3226. # These definitions are syntactic shorthand. They make it easy
  3227. # to link with the usual libraries without listing them all.
  3228. #
  3229. ########################################################################
  3230. COMMON_DTOOL_LIBS=[
  3231. 'libp3dtool.dll',
  3232. 'libp3dtoolconfig.dll',
  3233. ]
  3234. COMMON_PANDA_LIBS=[
  3235. 'libpanda.dll',
  3236. 'libpandaexpress.dll'
  3237. ] + COMMON_DTOOL_LIBS
  3238. COMMON_EGG2X_LIBS=[
  3239. 'libp3eggbase.lib',
  3240. 'libp3progbase.lib',
  3241. 'libp3converter.lib',
  3242. 'libp3pandatoolbase.lib',
  3243. 'libpandaegg.dll',
  3244. ] + COMMON_PANDA_LIBS
  3245. ########################################################################
  3246. #
  3247. # This section contains a list of all the files that need to be compiled.
  3248. #
  3249. ########################################################################
  3250. print("Generating dependencies...")
  3251. sys.stdout.flush()
  3252. #
  3253. # Compile Panda icon resource file.
  3254. # We do it first because we need it at
  3255. # the time we compile an executable.
  3256. #
  3257. if GetTarget() == 'windows':
  3258. OPTS=['DIR:panda/src/configfiles']
  3259. TargetAdd('pandaIcon.res', opts=OPTS, input='pandaIcon.rc')
  3260. #
  3261. # DIRECTORY: dtool/src/dtoolbase/
  3262. #
  3263. OPTS=['DIR:dtool/src/dtoolbase', 'BUILDING:DTOOL']
  3264. TargetAdd('p3dtoolbase_composite1.obj', opts=OPTS, input='p3dtoolbase_composite1.cxx')
  3265. TargetAdd('p3dtoolbase_composite2.obj', opts=OPTS, input='p3dtoolbase_composite2.cxx')
  3266. TargetAdd('p3dtoolbase_lookup3.obj', opts=OPTS, input='lookup3.c')
  3267. TargetAdd('p3dtoolbase_indent.obj', opts=OPTS, input='indent.cxx')
  3268. #
  3269. # DIRECTORY: dtool/src/dtoolutil/
  3270. #
  3271. OPTS=['DIR:dtool/src/dtoolutil', 'BUILDING:DTOOL']
  3272. TargetAdd('p3dtoolutil_composite1.obj', opts=OPTS, input='p3dtoolutil_composite1.cxx')
  3273. TargetAdd('p3dtoolutil_composite2.obj', opts=OPTS, input='p3dtoolutil_composite2.cxx')
  3274. if GetTarget() == 'darwin':
  3275. TargetAdd('p3dtoolutil_filename_assist.obj', opts=OPTS, input='filename_assist.mm')
  3276. #
  3277. # DIRECTORY: dtool/metalibs/dtool/
  3278. #
  3279. OPTS=['DIR:dtool/metalibs/dtool', 'BUILDING:DTOOL']
  3280. TargetAdd('p3dtool_dtool.obj', opts=OPTS, input='dtool.cxx')
  3281. TargetAdd('libp3dtool.dll', input='p3dtool_dtool.obj')
  3282. TargetAdd('libp3dtool.dll', input='p3dtoolutil_composite1.obj')
  3283. TargetAdd('libp3dtool.dll', input='p3dtoolutil_composite2.obj')
  3284. if GetTarget() == 'darwin':
  3285. TargetAdd('libp3dtool.dll', input='p3dtoolutil_filename_assist.obj')
  3286. TargetAdd('libp3dtool.dll', input='p3dtoolbase_composite1.obj')
  3287. TargetAdd('libp3dtool.dll', input='p3dtoolbase_composite2.obj')
  3288. TargetAdd('libp3dtool.dll', input='p3dtoolbase_indent.obj')
  3289. TargetAdd('libp3dtool.dll', input='p3dtoolbase_lookup3.obj')
  3290. TargetAdd('libp3dtool.dll', opts=['ADVAPI','WINSHELL','WINKERNEL'])
  3291. #
  3292. # DIRECTORY: dtool/src/cppparser/
  3293. #
  3294. if (not RUNTIME):
  3295. OPTS=['DIR:dtool/src/cppparser', 'BISONPREFIX_cppyy']
  3296. CreateFile(GetOutputDir()+"/include/cppBison.h")
  3297. TargetAdd('p3cppParser_cppBison.obj', opts=OPTS, input='cppBison.yxx')
  3298. TargetAdd('cppBison.h', input='p3cppParser_cppBison.obj', opts=['DEPENDENCYONLY'])
  3299. TargetAdd('p3cppParser_composite1.obj', opts=OPTS, input='p3cppParser_composite1.cxx')
  3300. TargetAdd('p3cppParser_composite2.obj', opts=OPTS, input='p3cppParser_composite2.cxx')
  3301. TargetAdd('libp3cppParser.ilb', input='p3cppParser_composite1.obj')
  3302. TargetAdd('libp3cppParser.ilb', input='p3cppParser_composite2.obj')
  3303. TargetAdd('libp3cppParser.ilb', input='p3cppParser_cppBison.obj')
  3304. #
  3305. # DIRECTORY: dtool/src/prc/
  3306. #
  3307. OPTS=['DIR:dtool/src/prc', 'BUILDING:DTOOLCONFIG', 'OPENSSL']
  3308. TargetAdd('p3prc_composite1.obj', opts=OPTS, input='p3prc_composite1.cxx')
  3309. TargetAdd('p3prc_composite2.obj', opts=OPTS, input='p3prc_composite2.cxx')
  3310. #
  3311. # DIRECTORY: dtool/metalibs/dtoolconfig/
  3312. #
  3313. OPTS=['DIR:dtool/metalibs/dtoolconfig', 'BUILDING:DTOOLCONFIG']
  3314. TargetAdd('p3dtoolconfig_dtoolconfig.obj', opts=OPTS, input='dtoolconfig.cxx')
  3315. TargetAdd('libp3dtoolconfig.dll', input='p3dtoolconfig_dtoolconfig.obj')
  3316. TargetAdd('libp3dtoolconfig.dll', input='p3prc_composite1.obj')
  3317. TargetAdd('libp3dtoolconfig.dll', input='p3prc_composite2.obj')
  3318. TargetAdd('libp3dtoolconfig.dll', input='libp3dtool.dll')
  3319. TargetAdd('libp3dtoolconfig.dll', opts=['ADVAPI', 'OPENSSL', 'WINGDI', 'WINUSER'])
  3320. #
  3321. # DIRECTORY: dtool/src/interrogatedb/
  3322. #
  3323. OPTS=['DIR:dtool/src/interrogatedb', 'BUILDING:INTERROGATEDB']
  3324. TargetAdd('p3interrogatedb_composite1.obj', opts=OPTS, input='p3interrogatedb_composite1.cxx')
  3325. TargetAdd('p3interrogatedb_composite2.obj', opts=OPTS, input='p3interrogatedb_composite2.cxx')
  3326. TargetAdd('libp3interrogatedb.dll', input='p3interrogatedb_composite1.obj')
  3327. TargetAdd('libp3interrogatedb.dll', input='p3interrogatedb_composite2.obj')
  3328. TargetAdd('libp3interrogatedb.dll', input='libp3dtool.dll')
  3329. TargetAdd('libp3interrogatedb.dll', input='libp3dtoolconfig.dll')
  3330. # This used to be called dtoolconfig.pyd, but it just contains the interrogatedb
  3331. # stuff, so it has been renamed appropriately.
  3332. OPTS=['DIR:dtool/metalibs/dtoolconfig']
  3333. PyTargetAdd('interrogatedb_pydtool.obj', opts=OPTS, input="pydtool.cxx")
  3334. PyTargetAdd('interrogatedb.pyd', input='interrogatedb_pydtool.obj')
  3335. PyTargetAdd('interrogatedb.pyd', input='libp3dtool.dll')
  3336. PyTargetAdd('interrogatedb.pyd', input='libp3dtoolconfig.dll')
  3337. PyTargetAdd('interrogatedb.pyd', input='libp3interrogatedb.dll')
  3338. #
  3339. # DIRECTORY: dtool/src/pystub/
  3340. #
  3341. if not RUNTIME and not RTDIST:
  3342. OPTS=['DIR:dtool/src/pystub']
  3343. TargetAdd('p3pystub_pystub.obj', opts=OPTS, input='pystub.cxx')
  3344. TargetAdd('libp3pystub.lib', input='p3pystub_pystub.obj')
  3345. #TargetAdd('libp3pystub.lib', input='libp3dtool.dll')
  3346. TargetAdd('libp3pystub.lib', opts=['ADVAPI'])
  3347. #
  3348. # DIRECTORY: dtool/src/interrogate/
  3349. #
  3350. if (not RUNTIME):
  3351. OPTS=['DIR:dtool/src/interrogate', 'DIR:dtool/src/cppparser', 'DIR:dtool/src/interrogatedb']
  3352. TargetAdd('interrogate_composite1.obj', opts=OPTS, input='interrogate_composite1.cxx')
  3353. TargetAdd('interrogate_composite2.obj', opts=OPTS, input='interrogate_composite2.cxx')
  3354. TargetAdd('interrogate.exe', input='interrogate_composite1.obj')
  3355. TargetAdd('interrogate.exe', input='interrogate_composite2.obj')
  3356. TargetAdd('interrogate.exe', input='libp3cppParser.ilb')
  3357. TargetAdd('interrogate.exe', input=COMMON_DTOOL_LIBS)
  3358. TargetAdd('interrogate.exe', input='libp3interrogatedb.dll')
  3359. TargetAdd('interrogate.exe', opts=['ADVAPI', 'WINSHELL', 'WINGDI', 'WINUSER'])
  3360. preamble = WriteEmbeddedStringFile('interrogate_preamble_python_native', inputs=[
  3361. 'dtool/src/interrogatedb/py_panda.cxx',
  3362. 'dtool/src/interrogatedb/py_compat.cxx',
  3363. 'dtool/src/interrogatedb/py_wrappers.cxx',
  3364. 'dtool/src/interrogatedb/dtool_super_base.cxx',
  3365. ])
  3366. TargetAdd('interrogate_module_preamble_python_native.obj', opts=OPTS, input=preamble)
  3367. TargetAdd('interrogate_module_interrogate_module.obj', opts=OPTS, input='interrogate_module.cxx')
  3368. TargetAdd('interrogate_module.exe', input='interrogate_module_interrogate_module.obj')
  3369. TargetAdd('interrogate_module.exe', input='interrogate_module_preamble_python_native.obj')
  3370. TargetAdd('interrogate_module.exe', input='libp3cppParser.ilb')
  3371. TargetAdd('interrogate_module.exe', input=COMMON_DTOOL_LIBS)
  3372. TargetAdd('interrogate_module.exe', input='libp3interrogatedb.dll')
  3373. TargetAdd('interrogate_module.exe', opts=['ADVAPI', 'WINSHELL', 'WINGDI', 'WINUSER'])
  3374. if (not RTDIST):
  3375. TargetAdd('parse_file_parse_file.obj', opts=OPTS, input='parse_file.cxx')
  3376. TargetAdd('parse_file.exe', input='parse_file_parse_file.obj')
  3377. TargetAdd('parse_file.exe', input='libp3cppParser.ilb')
  3378. TargetAdd('parse_file.exe', input=COMMON_DTOOL_LIBS)
  3379. TargetAdd('parse_file.exe', input='libp3interrogatedb.dll')
  3380. TargetAdd('parse_file.exe', opts=['ADVAPI', 'WINSHELL', 'WINGDI', 'WINUSER'])
  3381. #
  3382. # DIRECTORY: dtool/src/prckeys/
  3383. #
  3384. if (PkgSkip("OPENSSL")==0 and not RUNTIME and not RTDIST):
  3385. OPTS=['DIR:dtool/src/prckeys', 'OPENSSL']
  3386. TargetAdd('make-prc-key_makePrcKey.obj', opts=OPTS, input='makePrcKey.cxx')
  3387. TargetAdd('make-prc-key.exe', input='make-prc-key_makePrcKey.obj')
  3388. TargetAdd('make-prc-key.exe', input=COMMON_DTOOL_LIBS)
  3389. TargetAdd('make-prc-key.exe', opts=['ADVAPI', 'OPENSSL', 'WINSHELL', 'WINGDI', 'WINUSER'])
  3390. #
  3391. # DIRECTORY: dtool/src/test_interrogate/
  3392. #
  3393. if (not RTDIST and not RUNTIME):
  3394. OPTS=['DIR:dtool/src/test_interrogate']
  3395. TargetAdd('test_interrogate_test_interrogate.obj', opts=OPTS, input='test_interrogate.cxx')
  3396. TargetAdd('test_interrogate.exe', input='test_interrogate_test_interrogate.obj')
  3397. TargetAdd('test_interrogate.exe', input='libp3interrogatedb.dll')
  3398. TargetAdd('test_interrogate.exe', input=COMMON_DTOOL_LIBS)
  3399. TargetAdd('test_interrogate.exe', opts=['ADVAPI', 'WINSHELL', 'WINGDI', 'WINUSER'])
  3400. #
  3401. # DIRECTORY: dtool/src/dtoolbase/
  3402. #
  3403. OPTS=['DIR:dtool/src/dtoolbase']
  3404. IGATEFILES=GetDirectoryContents('dtool/src/dtoolbase', ["*_composite*.cxx"])
  3405. IGATEFILES += [
  3406. "typeHandle.h",
  3407. "typeHandle_ext.h",
  3408. "typeRegistry.h",
  3409. "typedObject.h",
  3410. "neverFreeMemory.h",
  3411. ]
  3412. TargetAdd('libp3dtoolbase.in', opts=OPTS, input=IGATEFILES)
  3413. TargetAdd('libp3dtoolbase.in', opts=['IMOD:panda3d.core', 'ILIB:libp3dtoolbase', 'SRCDIR:dtool/src/dtoolbase'])
  3414. PyTargetAdd('p3dtoolbase_typeHandle_ext.obj', opts=OPTS, input='typeHandle_ext.cxx')
  3415. #
  3416. # DIRECTORY: dtool/src/dtoolutil/
  3417. #
  3418. OPTS=['DIR:dtool/src/dtoolutil']
  3419. IGATEFILES=GetDirectoryContents('dtool/src/dtoolutil', ["*_composite*.cxx"])
  3420. IGATEFILES += [
  3421. "config_dtoolutil.h",
  3422. "pandaSystem.h",
  3423. "dSearchPath.h",
  3424. "executionEnvironment.h",
  3425. "textEncoder.h",
  3426. "textEncoder_ext.h",
  3427. "filename.h",
  3428. "filename_ext.h",
  3429. "globPattern.h",
  3430. "globPattern_ext.h",
  3431. "pandaFileStream.h",
  3432. "lineStream.h",
  3433. ]
  3434. TargetAdd('libp3dtoolutil.in', opts=OPTS, input=IGATEFILES)
  3435. TargetAdd('libp3dtoolutil.in', opts=['IMOD:panda3d.core', 'ILIB:libp3dtoolutil', 'SRCDIR:dtool/src/dtoolutil'])
  3436. PyTargetAdd('p3dtoolutil_ext_composite.obj', opts=OPTS, input='p3dtoolutil_ext_composite.cxx')
  3437. #
  3438. # DIRECTORY: dtool/src/prc/
  3439. #
  3440. OPTS=['DIR:dtool/src/prc']
  3441. IGATEFILES=GetDirectoryContents('dtool/src/prc', ["*.h", "*_composite*.cxx"])
  3442. TargetAdd('libp3prc.in', opts=OPTS, input=IGATEFILES)
  3443. TargetAdd('libp3prc.in', opts=['IMOD:panda3d.core', 'ILIB:libp3prc', 'SRCDIR:dtool/src/prc'])
  3444. PyTargetAdd('p3prc_ext_composite.obj', opts=OPTS, input='p3prc_ext_composite.cxx')
  3445. #
  3446. # DIRECTORY: panda/src/pandabase/
  3447. #
  3448. OPTS=['DIR:panda/src/pandabase', 'BUILDING:PANDAEXPRESS']
  3449. TargetAdd('p3pandabase_pandabase.obj', opts=OPTS, input='pandabase.cxx')
  3450. #
  3451. # DIRECTORY: panda/src/express/
  3452. #
  3453. OPTS=['DIR:panda/src/express', 'BUILDING:PANDAEXPRESS', 'OPENSSL', 'ZLIB']
  3454. TargetAdd('p3express_composite1.obj', opts=OPTS, input='p3express_composite1.cxx')
  3455. TargetAdd('p3express_composite2.obj', opts=OPTS, input='p3express_composite2.cxx')
  3456. OPTS=['DIR:panda/src/express', 'OPENSSL', 'ZLIB']
  3457. IGATEFILES=GetDirectoryContents('panda/src/express', ["*.h", "*_composite*.cxx"])
  3458. TargetAdd('libp3express.in', opts=OPTS, input=IGATEFILES)
  3459. TargetAdd('libp3express.in', opts=['IMOD:panda3d.core', 'ILIB:libp3express', 'SRCDIR:panda/src/express'])
  3460. PyTargetAdd('p3express_ext_composite.obj', opts=OPTS, input='p3express_ext_composite.cxx')
  3461. #
  3462. # DIRECTORY: panda/src/downloader/
  3463. #
  3464. OPTS=['DIR:panda/src/downloader', 'BUILDING:PANDAEXPRESS', 'OPENSSL', 'ZLIB']
  3465. TargetAdd('p3downloader_composite1.obj', opts=OPTS, input='p3downloader_composite1.cxx')
  3466. TargetAdd('p3downloader_composite2.obj', opts=OPTS, input='p3downloader_composite2.cxx')
  3467. OPTS=['DIR:panda/src/downloader', 'OPENSSL', 'ZLIB']
  3468. IGATEFILES=GetDirectoryContents('panda/src/downloader', ["*.h", "*_composite*.cxx"])
  3469. TargetAdd('libp3downloader.in', opts=OPTS, input=IGATEFILES)
  3470. TargetAdd('libp3downloader.in', opts=['IMOD:panda3d.core', 'ILIB:libp3downloader', 'SRCDIR:panda/src/downloader'])
  3471. PyTargetAdd('p3downloader_stringStream_ext.obj', opts=OPTS, input='stringStream_ext.cxx')
  3472. #
  3473. # DIRECTORY: panda/metalibs/pandaexpress/
  3474. #
  3475. OPTS=['DIR:panda/metalibs/pandaexpress', 'BUILDING:PANDAEXPRESS', 'ZLIB']
  3476. TargetAdd('pandaexpress_pandaexpress.obj', opts=OPTS, input='pandaexpress.cxx')
  3477. TargetAdd('libpandaexpress.dll', input='pandaexpress_pandaexpress.obj')
  3478. TargetAdd('libpandaexpress.dll', input='p3downloader_composite1.obj')
  3479. TargetAdd('libpandaexpress.dll', input='p3downloader_composite2.obj')
  3480. TargetAdd('libpandaexpress.dll', input='p3express_composite1.obj')
  3481. TargetAdd('libpandaexpress.dll', input='p3express_composite2.obj')
  3482. TargetAdd('libpandaexpress.dll', input='p3pandabase_pandabase.obj')
  3483. TargetAdd('libpandaexpress.dll', input=COMMON_DTOOL_LIBS)
  3484. TargetAdd('libpandaexpress.dll', opts=['ADVAPI', 'WINSOCK2', 'OPENSSL', 'ZLIB', 'WINGDI', 'WINUSER', 'ANDROID'])
  3485. #
  3486. # DIRECTORY: panda/src/pipeline/
  3487. #
  3488. if (not RUNTIME):
  3489. OPTS=['DIR:panda/src/pipeline', 'BUILDING:PANDA']
  3490. TargetAdd('p3pipeline_composite1.obj', opts=OPTS, input='p3pipeline_composite1.cxx')
  3491. TargetAdd('p3pipeline_composite2.obj', opts=OPTS, input='p3pipeline_composite2.cxx')
  3492. TargetAdd('p3pipeline_contextSwitch.obj', opts=OPTS, input='contextSwitch.c')
  3493. OPTS=['DIR:panda/src/pipeline']
  3494. IGATEFILES=GetDirectoryContents('panda/src/pipeline', ["*.h", "*_composite*.cxx"])
  3495. TargetAdd('libp3pipeline.in', opts=OPTS, input=IGATEFILES)
  3496. TargetAdd('libp3pipeline.in', opts=['IMOD:panda3d.core', 'ILIB:libp3pipeline', 'SRCDIR:panda/src/pipeline'])
  3497. PyTargetAdd('p3pipeline_pythonThread.obj', opts=OPTS, input='pythonThread.cxx')
  3498. #
  3499. # DIRECTORY: panda/src/linmath/
  3500. #
  3501. if (not RUNTIME):
  3502. OPTS=['DIR:panda/src/linmath', 'BUILDING:PANDA']
  3503. TargetAdd('p3linmath_composite1.obj', opts=OPTS, input='p3linmath_composite1.cxx')
  3504. TargetAdd('p3linmath_composite2.obj', opts=OPTS, input='p3linmath_composite2.cxx')
  3505. OPTS=['DIR:panda/src/linmath']
  3506. IGATEFILES=GetDirectoryContents('panda/src/linmath', ["*.h", "*_composite*.cxx"])
  3507. for ifile in IGATEFILES[:]:
  3508. if "_src." in ifile:
  3509. IGATEFILES.remove(ifile)
  3510. IGATEFILES.remove('cast_to_double.h')
  3511. IGATEFILES.remove('lmat_ops.h')
  3512. IGATEFILES.remove('cast_to_float.h')
  3513. TargetAdd('libp3linmath.in', opts=OPTS, input=IGATEFILES)
  3514. TargetAdd('libp3linmath.in', opts=['IMOD:panda3d.core', 'ILIB:libp3linmath', 'SRCDIR:panda/src/linmath'])
  3515. #
  3516. # DIRECTORY: panda/src/putil/
  3517. #
  3518. if (not RUNTIME):
  3519. OPTS=['DIR:panda/src/putil', 'BUILDING:PANDA', 'ZLIB']
  3520. TargetAdd('p3putil_composite1.obj', opts=OPTS, input='p3putil_composite1.cxx')
  3521. TargetAdd('p3putil_composite2.obj', opts=OPTS, input='p3putil_composite2.cxx')
  3522. OPTS=['DIR:panda/src/putil', 'ZLIB']
  3523. IGATEFILES=GetDirectoryContents('panda/src/putil', ["*.h", "*_composite*.cxx"])
  3524. IGATEFILES.remove("test_bam.h")
  3525. IGATEFILES.remove("config_util.h")
  3526. TargetAdd('libp3putil.in', opts=OPTS, input=IGATEFILES)
  3527. TargetAdd('libp3putil.in', opts=['IMOD:panda3d.core', 'ILIB:libp3putil', 'SRCDIR:panda/src/putil'])
  3528. PyTargetAdd('p3putil_ext_composite.obj', opts=OPTS, input='p3putil_ext_composite.cxx')
  3529. #
  3530. # DIRECTORY: panda/src/audio/
  3531. #
  3532. if (not RUNTIME):
  3533. OPTS=['DIR:panda/src/audio', 'BUILDING:PANDA']
  3534. TargetAdd('p3audio_composite1.obj', opts=OPTS, input='p3audio_composite1.cxx')
  3535. OPTS=['DIR:panda/src/audio']
  3536. IGATEFILES=["audio.h"]
  3537. TargetAdd('libp3audio.in', opts=OPTS, input=IGATEFILES)
  3538. TargetAdd('libp3audio.in', opts=['IMOD:panda3d.core', 'ILIB:libp3audio', 'SRCDIR:panda/src/audio'])
  3539. #
  3540. # DIRECTORY: panda/src/event/
  3541. #
  3542. if (not RUNTIME):
  3543. OPTS=['DIR:panda/src/event', 'BUILDING:PANDA']
  3544. TargetAdd('p3event_composite1.obj', opts=OPTS, input='p3event_composite1.cxx')
  3545. TargetAdd('p3event_composite2.obj', opts=OPTS, input='p3event_composite2.cxx')
  3546. OPTS=['DIR:panda/src/event']
  3547. PyTargetAdd('p3event_asyncFuture_ext.obj', opts=OPTS, input='asyncFuture_ext.cxx')
  3548. PyTargetAdd('p3event_pythonTask.obj', opts=OPTS, input='pythonTask.cxx')
  3549. IGATEFILES=GetDirectoryContents('panda/src/event', ["*.h", "*_composite*.cxx"])
  3550. TargetAdd('libp3event.in', opts=OPTS, input=IGATEFILES)
  3551. TargetAdd('libp3event.in', opts=['IMOD:panda3d.core', 'ILIB:libp3event', 'SRCDIR:panda/src/event'])
  3552. #
  3553. # DIRECTORY: panda/src/mathutil/
  3554. #
  3555. if (not RUNTIME):
  3556. OPTS=['DIR:panda/src/mathutil', 'BUILDING:PANDA', 'FFTW']
  3557. TargetAdd('p3mathutil_composite1.obj', opts=OPTS, input='p3mathutil_composite1.cxx')
  3558. TargetAdd('p3mathutil_composite2.obj', opts=OPTS, input='p3mathutil_composite2.cxx')
  3559. OPTS=['DIR:panda/src/mathutil', 'FFTW']
  3560. IGATEFILES=GetDirectoryContents('panda/src/mathutil', ["*.h", "*_composite*.cxx"])
  3561. for ifile in IGATEFILES[:]:
  3562. if "_src." in ifile:
  3563. IGATEFILES.remove(ifile)
  3564. TargetAdd('libp3mathutil.in', opts=OPTS, input=IGATEFILES)
  3565. TargetAdd('libp3mathutil.in', opts=['IMOD:panda3d.core', 'ILIB:libp3mathutil', 'SRCDIR:panda/src/mathutil'])
  3566. #
  3567. # DIRECTORY: panda/src/gsgbase/
  3568. #
  3569. if (not RUNTIME):
  3570. OPTS=['DIR:panda/src/gsgbase', 'BUILDING:PANDA']
  3571. TargetAdd('p3gsgbase_composite1.obj', opts=OPTS, input='p3gsgbase_composite1.cxx')
  3572. OPTS=['DIR:panda/src/gsgbase']
  3573. IGATEFILES=GetDirectoryContents('panda/src/gsgbase', ["*.h", "*_composite*.cxx"])
  3574. TargetAdd('libp3gsgbase.in', opts=OPTS, input=IGATEFILES)
  3575. TargetAdd('libp3gsgbase.in', opts=['IMOD:panda3d.core', 'ILIB:libp3gsgbase', 'SRCDIR:panda/src/gsgbase'])
  3576. #
  3577. # DIRECTORY: panda/src/pnmimage/
  3578. #
  3579. if (not RUNTIME):
  3580. OPTS=['DIR:panda/src/pnmimage', 'BUILDING:PANDA', 'ZLIB']
  3581. TargetAdd('p3pnmimage_composite1.obj', opts=OPTS, input='p3pnmimage_composite1.cxx')
  3582. TargetAdd('p3pnmimage_composite2.obj', opts=OPTS, input='p3pnmimage_composite2.cxx')
  3583. TargetAdd('p3pnmimage_convert_srgb_sse2.obj', opts=OPTS+['SSE2'], input='convert_srgb_sse2.cxx')
  3584. OPTS=['DIR:panda/src/pnmimage', 'ZLIB']
  3585. IGATEFILES=GetDirectoryContents('panda/src/pnmimage', ["*.h", "*_composite*.cxx"])
  3586. TargetAdd('libp3pnmimage.in', opts=OPTS, input=IGATEFILES)
  3587. TargetAdd('libp3pnmimage.in', opts=['IMOD:panda3d.core', 'ILIB:libp3pnmimage', 'SRCDIR:panda/src/pnmimage'])
  3588. PyTargetAdd('p3pnmimage_pfmFile_ext.obj', opts=OPTS, input='pfmFile_ext.cxx')
  3589. #
  3590. # DIRECTORY: panda/src/nativenet/
  3591. #
  3592. if (not RUNTIME):
  3593. OPTS=['DIR:panda/src/nativenet', 'OPENSSL', 'BUILDING:PANDA']
  3594. TargetAdd('p3nativenet_composite1.obj', opts=OPTS, input='p3nativenet_composite1.cxx')
  3595. OPTS=['DIR:panda/src/nativenet', 'OPENSSL']
  3596. IGATEFILES=GetDirectoryContents('panda/src/nativenet', ["*.h", "*_composite*.cxx"])
  3597. TargetAdd('libp3nativenet.in', opts=OPTS, input=IGATEFILES)
  3598. TargetAdd('libp3nativenet.in', opts=['IMOD:panda3d.core', 'ILIB:libp3nativenet', 'SRCDIR:panda/src/nativenet'])
  3599. #
  3600. # DIRECTORY: panda/src/net/
  3601. #
  3602. if (not RUNTIME):
  3603. OPTS=['DIR:panda/src/net', 'BUILDING:PANDA']
  3604. TargetAdd('p3net_composite1.obj', opts=OPTS, input='p3net_composite1.cxx')
  3605. TargetAdd('p3net_composite2.obj', opts=OPTS, input='p3net_composite2.cxx')
  3606. OPTS=['DIR:panda/src/net']
  3607. IGATEFILES=GetDirectoryContents('panda/src/net', ["*.h", "*_composite*.cxx"])
  3608. IGATEFILES.remove("datagram_ui.h")
  3609. TargetAdd('libp3net.in', opts=OPTS, input=IGATEFILES)
  3610. TargetAdd('libp3net.in', opts=['IMOD:panda3d.core', 'ILIB:libp3net', 'SRCDIR:panda/src/net'])
  3611. #
  3612. # DIRECTORY: panda/src/pstatclient/
  3613. #
  3614. if (not RUNTIME):
  3615. OPTS=['DIR:panda/src/pstatclient', 'BUILDING:PANDA']
  3616. TargetAdd('p3pstatclient_composite1.obj', opts=OPTS, input='p3pstatclient_composite1.cxx')
  3617. TargetAdd('p3pstatclient_composite2.obj', opts=OPTS, input='p3pstatclient_composite2.cxx')
  3618. OPTS=['DIR:panda/src/pstatclient']
  3619. IGATEFILES=GetDirectoryContents('panda/src/pstatclient', ["*.h", "*_composite*.cxx"])
  3620. IGATEFILES.remove("config_pstats.h")
  3621. TargetAdd('libp3pstatclient.in', opts=OPTS, input=IGATEFILES)
  3622. TargetAdd('libp3pstatclient.in', opts=['IMOD:panda3d.core', 'ILIB:libp3pstatclient', 'SRCDIR:panda/src/pstatclient'])
  3623. #
  3624. # DIRECTORY: panda/src/gobj/
  3625. #
  3626. if (not RUNTIME):
  3627. OPTS=['DIR:panda/src/gobj', 'BUILDING:PANDA', 'NVIDIACG', 'ZLIB', 'SQUISH']
  3628. TargetAdd('p3gobj_composite1.obj', opts=OPTS, input='p3gobj_composite1.cxx')
  3629. TargetAdd('p3gobj_composite2.obj', opts=OPTS+['BIGOBJ'], input='p3gobj_composite2.cxx')
  3630. OPTS=['DIR:panda/src/gobj', 'NVIDIACG', 'ZLIB', 'SQUISH']
  3631. IGATEFILES=GetDirectoryContents('panda/src/gobj', ["*.h", "*_composite*.cxx"])
  3632. if ("cgfx_states.h" in IGATEFILES): IGATEFILES.remove("cgfx_states.h")
  3633. TargetAdd('libp3gobj.in', opts=OPTS, input=IGATEFILES)
  3634. TargetAdd('libp3gobj.in', opts=['IMOD:panda3d.core', 'ILIB:libp3gobj', 'SRCDIR:panda/src/gobj'])
  3635. PyTargetAdd('p3gobj_ext_composite.obj', opts=OPTS, input='p3gobj_ext_composite.cxx')
  3636. #
  3637. # DIRECTORY: panda/src/pgraphnodes/
  3638. #
  3639. if (not RUNTIME):
  3640. OPTS=['DIR:panda/src/pgraphnodes', 'BUILDING:PANDA']
  3641. TargetAdd('p3pgraphnodes_composite1.obj', opts=OPTS, input='p3pgraphnodes_composite1.cxx')
  3642. TargetAdd('p3pgraphnodes_composite2.obj', opts=OPTS, input='p3pgraphnodes_composite2.cxx')
  3643. OPTS=['DIR:panda/src/pgraphnodes']
  3644. IGATEFILES=GetDirectoryContents('panda/src/pgraphnodes', ["*.h", "*_composite*.cxx"])
  3645. TargetAdd('libp3pgraphnodes.in', opts=OPTS, input=IGATEFILES)
  3646. TargetAdd('libp3pgraphnodes.in', opts=['IMOD:panda3d.core', 'ILIB:libp3pgraphnodes', 'SRCDIR:panda/src/pgraphnodes'])
  3647. #
  3648. # DIRECTORY: panda/src/pgraph/
  3649. #
  3650. if (not RUNTIME):
  3651. OPTS=['DIR:panda/src/pgraph', 'BUILDING:PANDA']
  3652. TargetAdd('p3pgraph_nodePath.obj', opts=OPTS, input='nodePath.cxx')
  3653. TargetAdd('p3pgraph_composite1.obj', opts=OPTS, input='p3pgraph_composite1.cxx')
  3654. TargetAdd('p3pgraph_composite2.obj', opts=OPTS, input='p3pgraph_composite2.cxx')
  3655. TargetAdd('p3pgraph_composite3.obj', opts=OPTS, input='p3pgraph_composite3.cxx')
  3656. TargetAdd('p3pgraph_composite4.obj', opts=OPTS, input='p3pgraph_composite4.cxx')
  3657. OPTS=['DIR:panda/src/pgraph']
  3658. IGATEFILES=GetDirectoryContents('panda/src/pgraph', ["*.h", "nodePath.cxx", "*_composite*.cxx"])
  3659. TargetAdd('libp3pgraph.in', opts=OPTS, input=IGATEFILES)
  3660. TargetAdd('libp3pgraph.in', opts=['IMOD:panda3d.core', 'ILIB:libp3pgraph', 'SRCDIR:panda/src/pgraph'])
  3661. PyTargetAdd('p3pgraph_ext_composite.obj', opts=OPTS, input='p3pgraph_ext_composite.cxx')
  3662. #
  3663. # DIRECTORY: panda/src/cull/
  3664. #
  3665. if (not RUNTIME):
  3666. OPTS=['DIR:panda/src/cull', 'BUILDING:PANDA']
  3667. TargetAdd('p3cull_composite1.obj', opts=OPTS, input='p3cull_composite1.cxx')
  3668. TargetAdd('p3cull_composite2.obj', opts=OPTS, input='p3cull_composite2.cxx')
  3669. OPTS=['DIR:panda/src/cull']
  3670. IGATEFILES=GetDirectoryContents('panda/src/cull', ["*.h", "*_composite*.cxx"])
  3671. TargetAdd('libp3cull.in', opts=OPTS, input=IGATEFILES)
  3672. TargetAdd('libp3cull.in', opts=['IMOD:panda3d.core', 'ILIB:libp3cull', 'SRCDIR:panda/src/cull'])
  3673. #
  3674. # DIRECTORY: panda/src/dgraph/
  3675. #
  3676. if (not RUNTIME):
  3677. OPTS=['DIR:panda/src/dgraph', 'BUILDING:PANDA']
  3678. TargetAdd('p3dgraph_composite1.obj', opts=OPTS, input='p3dgraph_composite1.cxx')
  3679. TargetAdd('p3dgraph_composite2.obj', opts=OPTS, input='p3dgraph_composite2.cxx')
  3680. OPTS=['DIR:panda/src/dgraph']
  3681. IGATEFILES=GetDirectoryContents('panda/src/dgraph', ["*.h", "*_composite*.cxx"])
  3682. TargetAdd('libp3dgraph.in', opts=OPTS, input=IGATEFILES)
  3683. TargetAdd('libp3dgraph.in', opts=['IMOD:panda3d.core', 'ILIB:libp3dgraph', 'SRCDIR:panda/src/dgraph'])
  3684. #
  3685. # DIRECTORY: panda/src/device/
  3686. #
  3687. if (not RUNTIME):
  3688. OPTS=['DIR:panda/src/device', 'BUILDING:PANDA']
  3689. TargetAdd('p3device_composite1.obj', opts=OPTS, input='p3device_composite1.cxx')
  3690. TargetAdd('p3device_composite2.obj', opts=OPTS, input='p3device_composite2.cxx')
  3691. OPTS=['DIR:panda/src/device']
  3692. IGATEFILES=GetDirectoryContents('panda/src/device', ["*.h", "*_composite*.cxx"])
  3693. TargetAdd('libp3device.in', opts=OPTS, input=IGATEFILES)
  3694. TargetAdd('libp3device.in', opts=['IMOD:panda3d.core', 'ILIB:libp3device', 'SRCDIR:panda/src/device'])
  3695. #
  3696. # DIRECTORY: panda/src/display/
  3697. #
  3698. if (not RUNTIME):
  3699. OPTS=['DIR:panda/src/display', 'BUILDING:PANDA', 'X11']
  3700. TargetAdd('p3display_graphicsStateGuardian.obj', opts=OPTS, input='graphicsStateGuardian.cxx')
  3701. TargetAdd('p3display_composite1.obj', opts=OPTS, input='p3display_composite1.cxx')
  3702. TargetAdd('p3display_composite2.obj', opts=OPTS, input='p3display_composite2.cxx')
  3703. OPTS=['DIR:panda/src/display', 'X11']
  3704. IGATEFILES=GetDirectoryContents('panda/src/display', ["*.h", "*_composite*.cxx"])
  3705. IGATEFILES.remove("renderBuffer.h")
  3706. TargetAdd('libp3display.in', opts=OPTS, input=IGATEFILES)
  3707. TargetAdd('libp3display.in', opts=['IMOD:panda3d.core', 'ILIB:libp3display', 'SRCDIR:panda/src/display'])
  3708. PyTargetAdd('p3display_ext_composite.obj', opts=OPTS, input='p3display_ext_composite.cxx')
  3709. if RTDIST and GetTarget() == 'darwin':
  3710. OPTS=['DIR:panda/src/display']
  3711. TargetAdd('subprocessWindowBuffer.obj', opts=OPTS, input='subprocessWindowBuffer.cxx')
  3712. TargetAdd('libp3subprocbuffer.ilb', input='subprocessWindowBuffer.obj')
  3713. #
  3714. # DIRECTORY: panda/src/chan/
  3715. #
  3716. if (not RUNTIME):
  3717. OPTS=['DIR:panda/src/chan', 'BUILDING:PANDA']
  3718. TargetAdd('p3chan_composite1.obj', opts=OPTS, input='p3chan_composite1.cxx')
  3719. TargetAdd('p3chan_composite2.obj', opts=OPTS, input='p3chan_composite2.cxx')
  3720. OPTS=['DIR:panda/src/chan']
  3721. IGATEFILES=GetDirectoryContents('panda/src/chan', ["*.h", "*_composite*.cxx"])
  3722. IGATEFILES.remove('movingPart.h')
  3723. IGATEFILES.remove('animChannelFixed.h')
  3724. TargetAdd('libp3chan.in', opts=OPTS, input=IGATEFILES)
  3725. TargetAdd('libp3chan.in', opts=['IMOD:panda3d.core', 'ILIB:libp3chan', 'SRCDIR:panda/src/chan'])
  3726. # DIRECTORY: panda/src/char/
  3727. #
  3728. if (not RUNTIME):
  3729. OPTS=['DIR:panda/src/char', 'BUILDING:PANDA']
  3730. TargetAdd('p3char_composite1.obj', opts=OPTS, input='p3char_composite1.cxx')
  3731. TargetAdd('p3char_composite2.obj', opts=OPTS, input='p3char_composite2.cxx')
  3732. OPTS=['DIR:panda/src/char']
  3733. IGATEFILES=GetDirectoryContents('panda/src/char', ["*.h", "*_composite*.cxx"])
  3734. TargetAdd('libp3char.in', opts=OPTS, input=IGATEFILES)
  3735. TargetAdd('libp3char.in', opts=['IMOD:panda3d.core', 'ILIB:libp3char', 'SRCDIR:panda/src/char'])
  3736. #
  3737. # DIRECTORY: panda/src/pnmtext/
  3738. #
  3739. if (PkgSkip("FREETYPE")==0 and not RUNTIME):
  3740. OPTS=['DIR:panda/src/pnmtext', 'BUILDING:PANDA', 'FREETYPE']
  3741. TargetAdd('p3pnmtext_composite1.obj', opts=OPTS, input='p3pnmtext_composite1.cxx')
  3742. OPTS=['DIR:panda/src/pnmtext', 'FREETYPE']
  3743. IGATEFILES=GetDirectoryContents('panda/src/pnmtext', ["*.h", "*_composite*.cxx"])
  3744. TargetAdd('libp3pnmtext.in', opts=OPTS, input=IGATEFILES)
  3745. TargetAdd('libp3pnmtext.in', opts=['IMOD:panda3d.core', 'ILIB:libp3pnmtext', 'SRCDIR:panda/src/pnmtext'])
  3746. #
  3747. # DIRECTORY: panda/src/text/
  3748. #
  3749. if (not RUNTIME):
  3750. if not PkgSkip("HARFBUZZ"):
  3751. DefSymbol("HARFBUZZ", "HAVE_HARFBUZZ")
  3752. OPTS=['DIR:panda/src/text', 'BUILDING:PANDA', 'ZLIB', 'FREETYPE', 'HARFBUZZ']
  3753. TargetAdd('p3text_composite1.obj', opts=OPTS, input='p3text_composite1.cxx')
  3754. TargetAdd('p3text_composite2.obj', opts=OPTS, input='p3text_composite2.cxx')
  3755. OPTS=['DIR:panda/src/text', 'ZLIB', 'FREETYPE']
  3756. IGATEFILES=GetDirectoryContents('panda/src/text', ["*.h", "*_composite*.cxx"])
  3757. TargetAdd('libp3text.in', opts=OPTS, input=IGATEFILES)
  3758. TargetAdd('libp3text.in', opts=['IMOD:panda3d.core', 'ILIB:libp3text', 'SRCDIR:panda/src/text'])
  3759. #
  3760. # DIRECTORY: panda/src/movies/
  3761. #
  3762. if (not RUNTIME):
  3763. OPTS=['DIR:panda/src/movies', 'BUILDING:PANDA', 'VORBIS', 'OPUS']
  3764. TargetAdd('p3movies_composite1.obj', opts=OPTS, input='p3movies_composite1.cxx')
  3765. OPTS=['DIR:panda/src/movies', 'VORBIS', 'OPUS']
  3766. IGATEFILES=GetDirectoryContents('panda/src/movies', ["*.h", "*_composite*.cxx"])
  3767. TargetAdd('libp3movies.in', opts=OPTS, input=IGATEFILES)
  3768. TargetAdd('libp3movies.in', opts=['IMOD:panda3d.core', 'ILIB:libp3movies', 'SRCDIR:panda/src/movies'])
  3769. #
  3770. # DIRECTORY: panda/src/grutil/
  3771. #
  3772. if (not RUNTIME):
  3773. OPTS=['DIR:panda/src/grutil', 'BUILDING:PANDA']
  3774. TargetAdd('p3grutil_multitexReducer.obj', opts=OPTS, input='multitexReducer.cxx')
  3775. TargetAdd('p3grutil_composite1.obj', opts=OPTS, input='p3grutil_composite1.cxx')
  3776. TargetAdd('p3grutil_composite2.obj', opts=OPTS, input='p3grutil_composite2.cxx')
  3777. OPTS=['DIR:panda/src/grutil']
  3778. IGATEFILES=GetDirectoryContents('panda/src/grutil', ["*.h", "*_composite*.cxx"])
  3779. if 'convexHull.h' in IGATEFILES: IGATEFILES.remove('convexHull.h')
  3780. TargetAdd('libp3grutil.in', opts=OPTS, input=IGATEFILES)
  3781. TargetAdd('libp3grutil.in', opts=['IMOD:panda3d.core', 'ILIB:libp3grutil', 'SRCDIR:panda/src/grutil'])
  3782. #
  3783. # DIRECTORY: panda/src/tform/
  3784. #
  3785. if (not RUNTIME):
  3786. OPTS=['DIR:panda/src/tform', 'BUILDING:PANDA']
  3787. TargetAdd('p3tform_composite1.obj', opts=OPTS, input='p3tform_composite1.cxx')
  3788. TargetAdd('p3tform_composite2.obj', opts=OPTS, input='p3tform_composite2.cxx')
  3789. OPTS=['DIR:panda/src/tform']
  3790. IGATEFILES=GetDirectoryContents('panda/src/tform', ["*.h", "*_composite*.cxx"])
  3791. TargetAdd('libp3tform.in', opts=OPTS, input=IGATEFILES)
  3792. TargetAdd('libp3tform.in', opts=['IMOD:panda3d.core', 'ILIB:libp3tform', 'SRCDIR:panda/src/tform'])
  3793. #
  3794. # DIRECTORY: panda/src/collide/
  3795. #
  3796. if (not RUNTIME):
  3797. OPTS=['DIR:panda/src/collide', 'BUILDING:PANDA']
  3798. TargetAdd('p3collide_composite1.obj', opts=OPTS, input='p3collide_composite1.cxx')
  3799. TargetAdd('p3collide_composite2.obj', opts=OPTS, input='p3collide_composite2.cxx')
  3800. OPTS=['DIR:panda/src/collide']
  3801. IGATEFILES=GetDirectoryContents('panda/src/collide', ["*.h", "*_composite*.cxx"])
  3802. TargetAdd('libp3collide.in', opts=OPTS, input=IGATEFILES)
  3803. TargetAdd('libp3collide.in', opts=['IMOD:panda3d.core', 'ILIB:libp3collide', 'SRCDIR:panda/src/collide'])
  3804. PyTargetAdd('p3collide_ext_composite.obj', opts=OPTS, input='p3collide_ext_composite.cxx')
  3805. #
  3806. # DIRECTORY: panda/src/parametrics/
  3807. #
  3808. if (not RUNTIME):
  3809. OPTS=['DIR:panda/src/parametrics', 'BUILDING:PANDA']
  3810. TargetAdd('p3parametrics_composite1.obj', opts=OPTS, input='p3parametrics_composite1.cxx')
  3811. TargetAdd('p3parametrics_composite2.obj', opts=OPTS, input='p3parametrics_composite2.cxx')
  3812. OPTS=['DIR:panda/src/parametrics']
  3813. IGATEFILES=GetDirectoryContents('panda/src/parametrics', ["*.h", "*_composite*.cxx"])
  3814. TargetAdd('libp3parametrics.in', opts=OPTS, input=IGATEFILES)
  3815. TargetAdd('libp3parametrics.in', opts=['IMOD:panda3d.core', 'ILIB:libp3parametrics', 'SRCDIR:panda/src/parametrics'])
  3816. #
  3817. # DIRECTORY: panda/src/pgui/
  3818. #
  3819. if (not RUNTIME):
  3820. OPTS=['DIR:panda/src/pgui', 'BUILDING:PANDA']
  3821. TargetAdd('p3pgui_composite1.obj', opts=OPTS, input='p3pgui_composite1.cxx')
  3822. TargetAdd('p3pgui_composite2.obj', opts=OPTS, input='p3pgui_composite2.cxx')
  3823. OPTS=['DIR:panda/src/pgui']
  3824. IGATEFILES=GetDirectoryContents('panda/src/pgui', ["*.h", "*_composite*.cxx"])
  3825. TargetAdd('libp3pgui.in', opts=OPTS, input=IGATEFILES)
  3826. TargetAdd('libp3pgui.in', opts=['IMOD:panda3d.core', 'ILIB:libp3pgui', 'SRCDIR:panda/src/pgui'])
  3827. #
  3828. # DIRECTORY: panda/src/pnmimagetypes/
  3829. #
  3830. if (not RUNTIME):
  3831. OPTS=['DIR:panda/src/pnmimagetypes', 'DIR:panda/src/pnmimage', 'BUILDING:PANDA', 'PNG', 'ZLIB', 'JPEG', 'TIFF', 'OPENEXR', 'EXCEPTIONS']
  3832. TargetAdd('p3pnmimagetypes_composite1.obj', opts=OPTS, input='p3pnmimagetypes_composite1.cxx')
  3833. TargetAdd('p3pnmimagetypes_composite2.obj', opts=OPTS, input='p3pnmimagetypes_composite2.cxx')
  3834. #
  3835. # DIRECTORY: panda/src/recorder/
  3836. #
  3837. if (not RUNTIME):
  3838. OPTS=['DIR:panda/src/recorder', 'BUILDING:PANDA']
  3839. TargetAdd('p3recorder_composite1.obj', opts=OPTS, input='p3recorder_composite1.cxx')
  3840. TargetAdd('p3recorder_composite2.obj', opts=OPTS, input='p3recorder_composite2.cxx')
  3841. OPTS=['DIR:panda/src/recorder']
  3842. IGATEFILES=GetDirectoryContents('panda/src/recorder', ["*.h", "*_composite*.cxx"])
  3843. TargetAdd('libp3recorder.in', opts=OPTS, input=IGATEFILES)
  3844. TargetAdd('libp3recorder.in', opts=['IMOD:panda3d.core', 'ILIB:libp3recorder', 'SRCDIR:panda/src/recorder'])
  3845. #
  3846. # DIRECTORY: panda/src/dxml/
  3847. #
  3848. DefSymbol("TINYXML", "TIXML_USE_STL", "")
  3849. OPTS=['DIR:panda/src/dxml', 'TINYXML']
  3850. TargetAdd('tinyxml_composite1.obj', opts=OPTS, input='tinyxml_composite1.cxx')
  3851. TargetAdd('libp3tinyxml.ilb', input='tinyxml_composite1.obj')
  3852. if (not RUNTIME):
  3853. OPTS=['DIR:panda/src/dxml', 'BUILDING:PANDA', 'TINYXML']
  3854. TargetAdd('p3dxml_composite1.obj', opts=OPTS, input='p3dxml_composite1.cxx')
  3855. OPTS=['DIR:panda/src/dxml', 'TINYXML']
  3856. IGATEFILES=GetDirectoryContents('panda/src/dxml', ["*.h", "p3dxml_composite1.cxx"])
  3857. TargetAdd('libp3dxml.in', opts=OPTS, input=IGATEFILES)
  3858. TargetAdd('libp3dxml.in', opts=['IMOD:panda3d.core', 'ILIB:libp3dxml', 'SRCDIR:panda/src/dxml'])
  3859. #
  3860. # DIRECTORY: panda/metalibs/panda/
  3861. #
  3862. if (not RUNTIME):
  3863. OPTS=['DIR:panda/metalibs/panda', 'BUILDING:PANDA', 'JPEG', 'PNG', 'HARFBUZZ',
  3864. 'TIFF', 'OPENEXR', 'ZLIB', 'OPENSSL', 'FREETYPE', 'FFTW', 'ADVAPI', 'WINSOCK2',
  3865. 'SQUISH', 'NVIDIACG', 'VORBIS', 'OPUS', 'WINUSER', 'WINMM', 'WINGDI', 'IPHLPAPI',
  3866. 'SETUPAPI', 'INOTIFY']
  3867. TargetAdd('panda_panda.obj', opts=OPTS, input='panda.cxx')
  3868. TargetAdd('libpanda.dll', input='panda_panda.obj')
  3869. TargetAdd('libpanda.dll', input='p3recorder_composite1.obj')
  3870. TargetAdd('libpanda.dll', input='p3recorder_composite2.obj')
  3871. TargetAdd('libpanda.dll', input='p3pgraphnodes_composite1.obj')
  3872. TargetAdd('libpanda.dll', input='p3pgraphnodes_composite2.obj')
  3873. TargetAdd('libpanda.dll', input='p3pgraph_nodePath.obj')
  3874. TargetAdd('libpanda.dll', input='p3pgraph_composite1.obj')
  3875. TargetAdd('libpanda.dll', input='p3pgraph_composite2.obj')
  3876. TargetAdd('libpanda.dll', input='p3pgraph_composite3.obj')
  3877. TargetAdd('libpanda.dll', input='p3pgraph_composite4.obj')
  3878. TargetAdd('libpanda.dll', input='p3cull_composite1.obj')
  3879. TargetAdd('libpanda.dll', input='p3cull_composite2.obj')
  3880. TargetAdd('libpanda.dll', input='p3movies_composite1.obj')
  3881. TargetAdd('libpanda.dll', input='p3grutil_multitexReducer.obj')
  3882. TargetAdd('libpanda.dll', input='p3grutil_composite1.obj')
  3883. TargetAdd('libpanda.dll', input='p3grutil_composite2.obj')
  3884. TargetAdd('libpanda.dll', input='p3chan_composite1.obj')
  3885. TargetAdd('libpanda.dll', input='p3chan_composite2.obj')
  3886. TargetAdd('libpanda.dll', input='p3pstatclient_composite1.obj')
  3887. TargetAdd('libpanda.dll', input='p3pstatclient_composite2.obj')
  3888. TargetAdd('libpanda.dll', input='p3char_composite1.obj')
  3889. TargetAdd('libpanda.dll', input='p3char_composite2.obj')
  3890. TargetAdd('libpanda.dll', input='p3collide_composite1.obj')
  3891. TargetAdd('libpanda.dll', input='p3collide_composite2.obj')
  3892. TargetAdd('libpanda.dll', input='p3device_composite1.obj')
  3893. TargetAdd('libpanda.dll', input='p3device_composite2.obj')
  3894. TargetAdd('libpanda.dll', input='p3dgraph_composite1.obj')
  3895. TargetAdd('libpanda.dll', input='p3dgraph_composite2.obj')
  3896. TargetAdd('libpanda.dll', input='p3display_graphicsStateGuardian.obj')
  3897. TargetAdd('libpanda.dll', input='p3display_composite1.obj')
  3898. TargetAdd('libpanda.dll', input='p3display_composite2.obj')
  3899. TargetAdd('libpanda.dll', input='p3pipeline_composite1.obj')
  3900. TargetAdd('libpanda.dll', input='p3pipeline_composite2.obj')
  3901. TargetAdd('libpanda.dll', input='p3pipeline_contextSwitch.obj')
  3902. TargetAdd('libpanda.dll', input='p3event_composite1.obj')
  3903. TargetAdd('libpanda.dll', input='p3event_composite2.obj')
  3904. TargetAdd('libpanda.dll', input='p3gobj_composite1.obj')
  3905. TargetAdd('libpanda.dll', input='p3gobj_composite2.obj')
  3906. TargetAdd('libpanda.dll', input='p3gsgbase_composite1.obj')
  3907. TargetAdd('libpanda.dll', input='p3linmath_composite1.obj')
  3908. TargetAdd('libpanda.dll', input='p3linmath_composite2.obj')
  3909. TargetAdd('libpanda.dll', input='p3mathutil_composite1.obj')
  3910. TargetAdd('libpanda.dll', input='p3mathutil_composite2.obj')
  3911. TargetAdd('libpanda.dll', input='p3parametrics_composite1.obj')
  3912. TargetAdd('libpanda.dll', input='p3parametrics_composite2.obj')
  3913. TargetAdd('libpanda.dll', input='p3pnmimagetypes_composite1.obj')
  3914. TargetAdd('libpanda.dll', input='p3pnmimagetypes_composite2.obj')
  3915. TargetAdd('libpanda.dll', input='p3pnmimage_composite1.obj')
  3916. TargetAdd('libpanda.dll', input='p3pnmimage_composite2.obj')
  3917. TargetAdd('libpanda.dll', input='p3pnmimage_convert_srgb_sse2.obj')
  3918. TargetAdd('libpanda.dll', input='p3text_composite1.obj')
  3919. TargetAdd('libpanda.dll', input='p3text_composite2.obj')
  3920. TargetAdd('libpanda.dll', input='p3tform_composite1.obj')
  3921. TargetAdd('libpanda.dll', input='p3tform_composite2.obj')
  3922. TargetAdd('libpanda.dll', input='p3putil_composite1.obj')
  3923. TargetAdd('libpanda.dll', input='p3putil_composite2.obj')
  3924. TargetAdd('libpanda.dll', input='p3audio_composite1.obj')
  3925. TargetAdd('libpanda.dll', input='p3pgui_composite1.obj')
  3926. TargetAdd('libpanda.dll', input='p3pgui_composite2.obj')
  3927. TargetAdd('libpanda.dll', input='p3net_composite1.obj')
  3928. TargetAdd('libpanda.dll', input='p3net_composite2.obj')
  3929. TargetAdd('libpanda.dll', input='p3nativenet_composite1.obj')
  3930. TargetAdd('libpanda.dll', input='p3pandabase_pandabase.obj')
  3931. TargetAdd('libpanda.dll', input='libpandaexpress.dll')
  3932. TargetAdd('libpanda.dll', input='p3dxml_composite1.obj')
  3933. TargetAdd('libpanda.dll', input='libp3dtoolconfig.dll')
  3934. TargetAdd('libpanda.dll', input='libp3dtool.dll')
  3935. if PkgSkip("FREETYPE")==0:
  3936. TargetAdd('libpanda.dll', input="p3pnmtext_composite1.obj")
  3937. TargetAdd('libpanda.dll', dep='dtool_have_freetype.dat')
  3938. TargetAdd('libpanda.dll', opts=OPTS)
  3939. PyTargetAdd('core_module.obj', input='libp3dtoolbase.in')
  3940. PyTargetAdd('core_module.obj', input='libp3dtoolutil.in')
  3941. PyTargetAdd('core_module.obj', input='libp3prc.in')
  3942. PyTargetAdd('core_module.obj', input='libp3downloader.in')
  3943. PyTargetAdd('core_module.obj', input='libp3express.in')
  3944. PyTargetAdd('core_module.obj', input='libp3recorder.in')
  3945. PyTargetAdd('core_module.obj', input='libp3pgraphnodes.in')
  3946. PyTargetAdd('core_module.obj', input='libp3pgraph.in')
  3947. PyTargetAdd('core_module.obj', input='libp3cull.in')
  3948. PyTargetAdd('core_module.obj', input='libp3grutil.in')
  3949. PyTargetAdd('core_module.obj', input='libp3chan.in')
  3950. PyTargetAdd('core_module.obj', input='libp3pstatclient.in')
  3951. PyTargetAdd('core_module.obj', input='libp3char.in')
  3952. PyTargetAdd('core_module.obj', input='libp3collide.in')
  3953. PyTargetAdd('core_module.obj', input='libp3device.in')
  3954. PyTargetAdd('core_module.obj', input='libp3dgraph.in')
  3955. PyTargetAdd('core_module.obj', input='libp3display.in')
  3956. PyTargetAdd('core_module.obj', input='libp3pipeline.in')
  3957. PyTargetAdd('core_module.obj', input='libp3event.in')
  3958. PyTargetAdd('core_module.obj', input='libp3gobj.in')
  3959. PyTargetAdd('core_module.obj', input='libp3gsgbase.in')
  3960. PyTargetAdd('core_module.obj', input='libp3linmath.in')
  3961. PyTargetAdd('core_module.obj', input='libp3mathutil.in')
  3962. PyTargetAdd('core_module.obj', input='libp3parametrics.in')
  3963. PyTargetAdd('core_module.obj', input='libp3pnmimage.in')
  3964. PyTargetAdd('core_module.obj', input='libp3text.in')
  3965. PyTargetAdd('core_module.obj', input='libp3tform.in')
  3966. PyTargetAdd('core_module.obj', input='libp3putil.in')
  3967. PyTargetAdd('core_module.obj', input='libp3audio.in')
  3968. PyTargetAdd('core_module.obj', input='libp3nativenet.in')
  3969. PyTargetAdd('core_module.obj', input='libp3net.in')
  3970. PyTargetAdd('core_module.obj', input='libp3pgui.in')
  3971. PyTargetAdd('core_module.obj', input='libp3movies.in')
  3972. PyTargetAdd('core_module.obj', input='libp3dxml.in')
  3973. if PkgSkip("FREETYPE")==0:
  3974. PyTargetAdd('core_module.obj', input='libp3pnmtext.in')
  3975. PyTargetAdd('core_module.obj', opts=['IMOD:panda3d.core', 'ILIB:core'])
  3976. PyTargetAdd('core.pyd', input='libp3dtoolbase_igate.obj')
  3977. PyTargetAdd('core.pyd', input='p3dtoolbase_typeHandle_ext.obj')
  3978. PyTargetAdd('core.pyd', input='libp3dtoolutil_igate.obj')
  3979. PyTargetAdd('core.pyd', input='p3dtoolutil_ext_composite.obj')
  3980. PyTargetAdd('core.pyd', input='libp3prc_igate.obj')
  3981. PyTargetAdd('core.pyd', input='p3prc_ext_composite.obj')
  3982. PyTargetAdd('core.pyd', input='libp3downloader_igate.obj')
  3983. PyTargetAdd('core.pyd', input='p3downloader_stringStream_ext.obj')
  3984. PyTargetAdd('core.pyd', input='p3express_ext_composite.obj')
  3985. PyTargetAdd('core.pyd', input='libp3express_igate.obj')
  3986. PyTargetAdd('core.pyd', input='libp3recorder_igate.obj')
  3987. PyTargetAdd('core.pyd', input='libp3pgraphnodes_igate.obj')
  3988. PyTargetAdd('core.pyd', input='libp3pgraph_igate.obj')
  3989. PyTargetAdd('core.pyd', input='libp3movies_igate.obj')
  3990. PyTargetAdd('core.pyd', input='libp3grutil_igate.obj')
  3991. PyTargetAdd('core.pyd', input='libp3chan_igate.obj')
  3992. PyTargetAdd('core.pyd', input='libp3pstatclient_igate.obj')
  3993. PyTargetAdd('core.pyd', input='libp3char_igate.obj')
  3994. PyTargetAdd('core.pyd', input='libp3collide_igate.obj')
  3995. PyTargetAdd('core.pyd', input='libp3device_igate.obj')
  3996. PyTargetAdd('core.pyd', input='libp3dgraph_igate.obj')
  3997. PyTargetAdd('core.pyd', input='libp3display_igate.obj')
  3998. PyTargetAdd('core.pyd', input='libp3pipeline_igate.obj')
  3999. PyTargetAdd('core.pyd', input='libp3event_igate.obj')
  4000. PyTargetAdd('core.pyd', input='libp3gobj_igate.obj')
  4001. PyTargetAdd('core.pyd', input='libp3gsgbase_igate.obj')
  4002. PyTargetAdd('core.pyd', input='libp3linmath_igate.obj')
  4003. PyTargetAdd('core.pyd', input='libp3mathutil_igate.obj')
  4004. PyTargetAdd('core.pyd', input='libp3parametrics_igate.obj')
  4005. PyTargetAdd('core.pyd', input='libp3pnmimage_igate.obj')
  4006. PyTargetAdd('core.pyd', input='libp3text_igate.obj')
  4007. PyTargetAdd('core.pyd', input='libp3tform_igate.obj')
  4008. PyTargetAdd('core.pyd', input='libp3putil_igate.obj')
  4009. PyTargetAdd('core.pyd', input='libp3audio_igate.obj')
  4010. PyTargetAdd('core.pyd', input='libp3pgui_igate.obj')
  4011. PyTargetAdd('core.pyd', input='libp3net_igate.obj')
  4012. PyTargetAdd('core.pyd', input='libp3nativenet_igate.obj')
  4013. PyTargetAdd('core.pyd', input='libp3dxml_igate.obj')
  4014. if PkgSkip("FREETYPE")==0:
  4015. PyTargetAdd('core.pyd', input="libp3pnmtext_igate.obj")
  4016. PyTargetAdd('core.pyd', input='p3collide_ext_composite.obj')
  4017. PyTargetAdd('core.pyd', input='p3pipeline_pythonThread.obj')
  4018. PyTargetAdd('core.pyd', input='p3putil_ext_composite.obj')
  4019. PyTargetAdd('core.pyd', input='p3pnmimage_pfmFile_ext.obj')
  4020. PyTargetAdd('core.pyd', input='p3event_asyncFuture_ext.obj')
  4021. PyTargetAdd('core.pyd', input='p3event_pythonTask.obj')
  4022. PyTargetAdd('core.pyd', input='p3gobj_ext_composite.obj')
  4023. PyTargetAdd('core.pyd', input='p3pgraph_ext_composite.obj')
  4024. PyTargetAdd('core.pyd', input='p3display_ext_composite.obj')
  4025. PyTargetAdd('core.pyd', input='core_module.obj')
  4026. if not GetLinkAllStatic() and GetTarget() != 'emscripten':
  4027. PyTargetAdd('core.pyd', input='libp3tinyxml.ilb')
  4028. PyTargetAdd('core.pyd', input='libp3interrogatedb.dll')
  4029. PyTargetAdd('core.pyd', input=COMMON_PANDA_LIBS)
  4030. PyTargetAdd('core.pyd', opts=['WINSOCK2'])
  4031. #
  4032. # DIRECTORY: panda/src/vision/
  4033. #
  4034. if (PkgSkip("VISION") == 0) and (not RUNTIME):
  4035. # We want to know whether we have ffmpeg so that we can override the .avi association.
  4036. if not PkgSkip("FFMPEG"):
  4037. DefSymbol("OPENCV", "HAVE_FFMPEG")
  4038. if not PkgSkip("OPENCV"):
  4039. DefSymbol("OPENCV", "HAVE_OPENCV")
  4040. if OPENCV_VER_23:
  4041. DefSymbol("OPENCV", "OPENCV_VER_23")
  4042. OPTS=['DIR:panda/src/vision', 'BUILDING:VISION', 'ARTOOLKIT', 'OPENCV', 'DX9', 'DIRECTCAM', 'JPEG', 'EXCEPTIONS']
  4043. TargetAdd('p3vision_composite1.obj', opts=OPTS, input='p3vision_composite1.cxx', dep=[
  4044. 'dtool_have_ffmpeg.dat',
  4045. 'dtool_have_opencv.dat',
  4046. 'dtool_have_directcam.dat',
  4047. ])
  4048. TargetAdd('libp3vision.dll', input='p3vision_composite1.obj')
  4049. TargetAdd('libp3vision.dll', input=COMMON_PANDA_LIBS)
  4050. TargetAdd('libp3vision.dll', opts=OPTS)
  4051. OPTS=['DIR:panda/src/vision', 'ARTOOLKIT', 'OPENCV', 'DX9', 'DIRECTCAM', 'JPEG', 'EXCEPTIONS']
  4052. IGATEFILES=GetDirectoryContents('panda/src/vision', ["*.h", "*_composite*.cxx"])
  4053. TargetAdd('libp3vision.in', opts=OPTS, input=IGATEFILES)
  4054. TargetAdd('libp3vision.in', opts=['IMOD:panda3d.vision', 'ILIB:libp3vision', 'SRCDIR:panda/src/vision'])
  4055. PyTargetAdd('vision_module.obj', input='libp3vision.in')
  4056. PyTargetAdd('vision_module.obj', opts=OPTS)
  4057. PyTargetAdd('vision_module.obj', opts=['IMOD:panda3d.vision', 'ILIB:vision', 'IMPORT:panda3d.core'])
  4058. PyTargetAdd('vision.pyd', input='vision_module.obj')
  4059. PyTargetAdd('vision.pyd', input='libp3vision_igate.obj')
  4060. PyTargetAdd('vision.pyd', input='libp3vision.dll')
  4061. PyTargetAdd('vision.pyd', input='libp3interrogatedb.dll')
  4062. PyTargetAdd('vision.pyd', input=COMMON_PANDA_LIBS)
  4063. #
  4064. # DIRECTORY: panda/src/rocket/
  4065. #
  4066. if (PkgSkip("ROCKET") == 0) and (not RUNTIME):
  4067. OPTS=['DIR:panda/src/rocket', 'BUILDING:ROCKET', 'ROCKET', 'PYTHON', 'NOARCH:ARM64']
  4068. TargetAdd('p3rocket_composite1.obj', opts=OPTS, input='p3rocket_composite1.cxx')
  4069. TargetAdd('libp3rocket.dll', input='p3rocket_composite1.obj')
  4070. TargetAdd('libp3rocket.dll', input=COMMON_PANDA_LIBS)
  4071. TargetAdd('libp3rocket.dll', opts=OPTS)
  4072. OPTS=['DIR:panda/src/rocket', 'ROCKET', 'RTTI', 'EXCEPTIONS', 'NOARCH:ARM64']
  4073. IGATEFILES=GetDirectoryContents('panda/src/rocket', ["rocketInputHandler.h",
  4074. "rocketInputHandler.cxx", "rocketRegion.h", "rocketRegion.cxx", "rocketRegion_ext.h"])
  4075. TargetAdd('libp3rocket.in', opts=OPTS, input=IGATEFILES)
  4076. TargetAdd('libp3rocket.in', opts=['IMOD:panda3d.rocket', 'ILIB:libp3rocket', 'SRCDIR:panda/src/rocket'])
  4077. PyTargetAdd('p3rocket_rocketRegion_ext.obj', opts=OPTS, input='rocketRegion_ext.cxx')
  4078. PyTargetAdd('rocket_module.obj', input='libp3rocket.in')
  4079. PyTargetAdd('rocket_module.obj', opts=OPTS)
  4080. PyTargetAdd('rocket_module.obj', opts=['IMOD:panda3d.rocket', 'ILIB:rocket', 'IMPORT:panda3d.core'])
  4081. PyTargetAdd('rocket.pyd', input='rocket_module.obj')
  4082. PyTargetAdd('rocket.pyd', input='libp3rocket_igate.obj')
  4083. PyTargetAdd('rocket.pyd', input='p3rocket_rocketRegion_ext.obj')
  4084. PyTargetAdd('rocket.pyd', input='libp3rocket.dll')
  4085. PyTargetAdd('rocket.pyd', input='libp3interrogatedb.dll')
  4086. PyTargetAdd('rocket.pyd', input=COMMON_PANDA_LIBS)
  4087. PyTargetAdd('rocket.pyd', opts=['ROCKET', 'NOARCH:ARM64'])
  4088. #
  4089. # DIRECTORY: panda/src/p3skel
  4090. #
  4091. if (PkgSkip('SKEL')==0) and (not RUNTIME):
  4092. OPTS=['DIR:panda/src/skel', 'BUILDING:PANDASKEL', 'ADVAPI']
  4093. TargetAdd('p3skel_composite1.obj', opts=OPTS, input='p3skel_composite1.cxx')
  4094. OPTS=['DIR:panda/src/skel', 'ADVAPI']
  4095. IGATEFILES=GetDirectoryContents("panda/src/skel", ["*.h", "*_composite*.cxx"])
  4096. TargetAdd('libp3skel.in', opts=OPTS, input=IGATEFILES)
  4097. TargetAdd('libp3skel.in', opts=['IMOD:panda3d.skel', 'ILIB:libp3skel', 'SRCDIR:panda/src/skel'])
  4098. #
  4099. # DIRECTORY: panda/src/p3skel
  4100. #
  4101. if (PkgSkip('SKEL')==0) and (not RUNTIME):
  4102. OPTS=['BUILDING:PANDASKEL', 'ADVAPI']
  4103. TargetAdd('libpandaskel.dll', input='p3skel_composite1.obj')
  4104. TargetAdd('libpandaskel.dll', input=COMMON_PANDA_LIBS)
  4105. TargetAdd('libpandaskel.dll', opts=OPTS)
  4106. PyTargetAdd('skel_module.obj', input='libp3skel.in')
  4107. PyTargetAdd('skel_module.obj', opts=['IMOD:panda3d.skel', 'ILIB:skel', 'IMPORT:panda3d.core'])
  4108. PyTargetAdd('skel.pyd', input='skel_module.obj')
  4109. PyTargetAdd('skel.pyd', input='libp3skel_igate.obj')
  4110. PyTargetAdd('skel.pyd', input='libpandaskel.dll')
  4111. PyTargetAdd('skel.pyd', input='libp3interrogatedb.dll')
  4112. PyTargetAdd('skel.pyd', input=COMMON_PANDA_LIBS)
  4113. #
  4114. # DIRECTORY: panda/src/distort/
  4115. #
  4116. if (PkgSkip('PANDAFX')==0) and (not RUNTIME):
  4117. OPTS=['DIR:panda/src/distort', 'BUILDING:PANDAFX']
  4118. TargetAdd('p3distort_composite1.obj', opts=OPTS, input='p3distort_composite1.cxx')
  4119. OPTS=['DIR:panda/metalibs/pandafx', 'DIR:panda/src/distort', 'NVIDIACG']
  4120. IGATEFILES=GetDirectoryContents('panda/src/distort', ["*.h", "*_composite*.cxx"])
  4121. TargetAdd('libp3distort.in', opts=OPTS, input=IGATEFILES)
  4122. TargetAdd('libp3distort.in', opts=['IMOD:panda3d.fx', 'ILIB:libp3distort', 'SRCDIR:panda/src/distort'])
  4123. #
  4124. # DIRECTORY: panda/metalibs/pandafx/
  4125. #
  4126. if (PkgSkip('PANDAFX')==0) and (not RUNTIME):
  4127. OPTS=['DIR:panda/metalibs/pandafx', 'DIR:panda/src/distort', 'BUILDING:PANDAFX', 'NVIDIACG']
  4128. TargetAdd('pandafx_pandafx.obj', opts=OPTS, input='pandafx.cxx')
  4129. TargetAdd('libpandafx.dll', input='pandafx_pandafx.obj')
  4130. TargetAdd('libpandafx.dll', input='p3distort_composite1.obj')
  4131. TargetAdd('libpandafx.dll', input=COMMON_PANDA_LIBS)
  4132. TargetAdd('libpandafx.dll', opts=['ADVAPI', 'NVIDIACG'])
  4133. OPTS=['DIR:panda/metalibs/pandafx', 'DIR:panda/src/distort', 'NVIDIACG']
  4134. PyTargetAdd('fx_module.obj', input='libp3distort.in')
  4135. PyTargetAdd('fx_module.obj', opts=OPTS)
  4136. PyTargetAdd('fx_module.obj', opts=['IMOD:panda3d.fx', 'ILIB:fx', 'IMPORT:panda3d.core'])
  4137. PyTargetAdd('fx.pyd', input='fx_module.obj')
  4138. PyTargetAdd('fx.pyd', input='libp3distort_igate.obj')
  4139. PyTargetAdd('fx.pyd', input='libpandafx.dll')
  4140. PyTargetAdd('fx.pyd', input='libp3interrogatedb.dll')
  4141. PyTargetAdd('fx.pyd', input=COMMON_PANDA_LIBS)
  4142. #
  4143. # DIRECTORY: panda/src/vrpn/
  4144. #
  4145. if (PkgSkip("VRPN")==0 and not RUNTIME):
  4146. OPTS=['DIR:panda/src/vrpn', 'BUILDING:VRPN', 'VRPN']
  4147. TargetAdd('p3vrpn_composite1.obj', opts=OPTS, input='p3vrpn_composite1.cxx')
  4148. TargetAdd('libp3vrpn.dll', input='p3vrpn_composite1.obj')
  4149. TargetAdd('libp3vrpn.dll', input=COMMON_PANDA_LIBS)
  4150. TargetAdd('libp3vrpn.dll', opts=['VRPN'])
  4151. OPTS=['DIR:panda/src/vrpn', 'VRPN']
  4152. IGATEFILES=GetDirectoryContents('panda/src/vrpn', ["*.h", "*_composite*.cxx"])
  4153. TargetAdd('libp3vrpn.in', opts=OPTS, input=IGATEFILES)
  4154. TargetAdd('libp3vrpn.in', opts=['IMOD:panda3d.vrpn', 'ILIB:libp3vrpn', 'SRCDIR:panda/src/vrpn'])
  4155. PyTargetAdd('vrpn_module.obj', input='libp3vrpn.in')
  4156. PyTargetAdd('vrpn_module.obj', opts=OPTS)
  4157. PyTargetAdd('vrpn_module.obj', opts=['IMOD:panda3d.vrpn', 'ILIB:vrpn', 'IMPORT:panda3d.core'])
  4158. PyTargetAdd('vrpn.pyd', input='vrpn_module.obj')
  4159. PyTargetAdd('vrpn.pyd', input='libp3vrpn_igate.obj')
  4160. PyTargetAdd('vrpn.pyd', input='libp3vrpn.dll')
  4161. PyTargetAdd('vrpn.pyd', input='libp3interrogatedb.dll')
  4162. PyTargetAdd('vrpn.pyd', input=COMMON_PANDA_LIBS)
  4163. #
  4164. # DIRECTORY: panda/src/ffmpeg
  4165. #
  4166. if PkgSkip("FFMPEG") == 0 and not RUNTIME:
  4167. if not PkgSkip("SWSCALE"):
  4168. DefSymbol("FFMPEG", "HAVE_SWSCALE")
  4169. if not PkgSkip("SWRESAMPLE"):
  4170. DefSymbol("FFMPEG", "HAVE_SWRESAMPLE")
  4171. OPTS=['DIR:panda/src/ffmpeg', 'BUILDING:FFMPEG', 'FFMPEG', 'SWSCALE', 'SWRESAMPLE']
  4172. TargetAdd('p3ffmpeg_composite1.obj', opts=OPTS, input='p3ffmpeg_composite1.cxx', dep=[
  4173. 'dtool_have_swscale.dat', 'dtool_have_swresample.dat'])
  4174. TargetAdd('libp3ffmpeg.dll', input='p3ffmpeg_composite1.obj')
  4175. TargetAdd('libp3ffmpeg.dll', input=COMMON_PANDA_LIBS)
  4176. TargetAdd('libp3ffmpeg.dll', opts=OPTS)
  4177. #
  4178. # DIRECTORY: panda/src/audiotraits/
  4179. #
  4180. if PkgSkip("FMODEX") == 0 and not RUNTIME:
  4181. OPTS=['DIR:panda/src/audiotraits', 'BUILDING:FMOD_AUDIO', 'FMODEX']
  4182. TargetAdd('fmod_audio_fmod_audio_composite1.obj', opts=OPTS, input='fmod_audio_composite1.cxx')
  4183. TargetAdd('libp3fmod_audio.dll', input='fmod_audio_fmod_audio_composite1.obj')
  4184. TargetAdd('libp3fmod_audio.dll', input=COMMON_PANDA_LIBS)
  4185. TargetAdd('libp3fmod_audio.dll', opts=['MODULE', 'ADVAPI', 'WINUSER', 'WINMM', 'FMODEX'])
  4186. if PkgSkip("OPENAL") == 0 and not RUNTIME:
  4187. OPTS=['DIR:panda/src/audiotraits', 'BUILDING:OPENAL_AUDIO', 'OPENAL']
  4188. TargetAdd('openal_audio_openal_audio_composite1.obj', opts=OPTS, input='openal_audio_composite1.cxx')
  4189. TargetAdd('libp3openal_audio.dll', input='openal_audio_openal_audio_composite1.obj')
  4190. TargetAdd('libp3openal_audio.dll', input=COMMON_PANDA_LIBS)
  4191. TargetAdd('libp3openal_audio.dll', opts=['MODULE', 'ADVAPI', 'WINUSER', 'WINMM', 'WINSHELL', 'WINOLE', 'OPENAL'])
  4192. #
  4193. # DIRECTORY: panda/src/downloadertools/
  4194. #
  4195. if (PkgSkip("OPENSSL")==0 and not RTDIST and not RUNTIME and PkgSkip("DEPLOYTOOLS")==0):
  4196. OPTS=['DIR:panda/src/downloadertools', 'ZLIB', 'ADVAPI', 'WINSOCK2', 'WINSHELL', 'WINGDI', 'WINUSER']
  4197. TargetAdd('apply_patch_apply_patch.obj', opts=OPTS, input='apply_patch.cxx')
  4198. TargetAdd('apply_patch.exe', input=['apply_patch_apply_patch.obj'])
  4199. TargetAdd('apply_patch.exe', input=COMMON_PANDA_LIBS)
  4200. TargetAdd('apply_patch.exe', opts=OPTS)
  4201. TargetAdd('build_patch_build_patch.obj', opts=OPTS, input='build_patch.cxx')
  4202. TargetAdd('build_patch.exe', input=['build_patch_build_patch.obj'])
  4203. TargetAdd('build_patch.exe', input=COMMON_PANDA_LIBS)
  4204. TargetAdd('build_patch.exe', opts=OPTS)
  4205. if not PkgSkip("ZLIB"):
  4206. TargetAdd('check_adler_check_adler.obj', opts=OPTS, input='check_adler.cxx')
  4207. TargetAdd('check_adler.exe', input=['check_adler_check_adler.obj'])
  4208. TargetAdd('check_adler.exe', input=COMMON_PANDA_LIBS)
  4209. TargetAdd('check_adler.exe', opts=OPTS)
  4210. TargetAdd('check_crc_check_crc.obj', opts=OPTS, input='check_crc.cxx')
  4211. TargetAdd('check_crc.exe', input=['check_crc_check_crc.obj'])
  4212. TargetAdd('check_crc.exe', input=COMMON_PANDA_LIBS)
  4213. TargetAdd('check_crc.exe', opts=OPTS)
  4214. TargetAdd('check_md5_check_md5.obj', opts=OPTS, input='check_md5.cxx')
  4215. TargetAdd('check_md5.exe', input=['check_md5_check_md5.obj'])
  4216. TargetAdd('check_md5.exe', input=COMMON_PANDA_LIBS)
  4217. TargetAdd('check_md5.exe', opts=OPTS)
  4218. TargetAdd('pdecrypt_pdecrypt.obj', opts=OPTS, input='pdecrypt.cxx')
  4219. TargetAdd('pdecrypt.exe', input=['pdecrypt_pdecrypt.obj'])
  4220. TargetAdd('pdecrypt.exe', input=COMMON_PANDA_LIBS)
  4221. TargetAdd('pdecrypt.exe', opts=OPTS)
  4222. TargetAdd('pencrypt_pencrypt.obj', opts=OPTS, input='pencrypt.cxx')
  4223. TargetAdd('pencrypt.exe', input=['pencrypt_pencrypt.obj'])
  4224. TargetAdd('pencrypt.exe', input=COMMON_PANDA_LIBS)
  4225. TargetAdd('pencrypt.exe', opts=OPTS)
  4226. TargetAdd('show_ddb_show_ddb.obj', opts=OPTS, input='show_ddb.cxx')
  4227. TargetAdd('show_ddb.exe', input=['show_ddb_show_ddb.obj'])
  4228. TargetAdd('show_ddb.exe', input=COMMON_PANDA_LIBS)
  4229. TargetAdd('show_ddb.exe', opts=OPTS)
  4230. #
  4231. # DIRECTORY: panda/src/downloadertools/
  4232. #
  4233. if (PkgSkip("ZLIB")==0 and not RTDIST and not RUNTIME and PkgSkip("DEPLOYTOOLS")==0):
  4234. OPTS=['DIR:panda/src/downloadertools', 'ZLIB', 'ADVAPI', 'WINSOCK2', 'WINSHELL', 'WINGDI', 'WINUSER']
  4235. TargetAdd('multify_multify.obj', opts=OPTS, input='multify.cxx')
  4236. TargetAdd('multify.exe', input=['multify_multify.obj'])
  4237. TargetAdd('multify.exe', input=COMMON_PANDA_LIBS)
  4238. TargetAdd('multify.exe', opts=OPTS)
  4239. TargetAdd('pzip_pzip.obj', opts=OPTS, input='pzip.cxx')
  4240. TargetAdd('pzip.exe', input=['pzip_pzip.obj'])
  4241. TargetAdd('pzip.exe', input=COMMON_PANDA_LIBS)
  4242. TargetAdd('pzip.exe', opts=OPTS)
  4243. TargetAdd('punzip_punzip.obj', opts=OPTS, input='punzip.cxx')
  4244. TargetAdd('punzip.exe', input=['punzip_punzip.obj'])
  4245. TargetAdd('punzip.exe', input=COMMON_PANDA_LIBS)
  4246. TargetAdd('punzip.exe', opts=OPTS)
  4247. #
  4248. # DIRECTORY: panda/src/windisplay/
  4249. #
  4250. if (GetTarget() == 'windows' and not RUNTIME):
  4251. OPTS=['DIR:panda/src/windisplay', 'BUILDING:PANDAWIN']
  4252. TargetAdd('p3windisplay_composite1.obj', opts=OPTS+["BIGOBJ"], input='p3windisplay_composite1.cxx')
  4253. TargetAdd('p3windisplay_windetectdx9.obj', opts=OPTS + ["DX9"], input='winDetectDx9.cxx')
  4254. TargetAdd('libp3windisplay.dll', input='p3windisplay_composite1.obj')
  4255. TargetAdd('libp3windisplay.dll', input='p3windisplay_windetectdx9.obj')
  4256. TargetAdd('libp3windisplay.dll', input=COMMON_PANDA_LIBS)
  4257. TargetAdd('libp3windisplay.dll', opts=['WINIMM', 'WINGDI', 'WINKERNEL', 'WINOLDNAMES', 'WINUSER', 'WINMM',"BIGOBJ"])
  4258. #
  4259. # DIRECTORY: panda/metalibs/pandadx9/
  4260. #
  4261. if GetTarget() == 'windows' and PkgSkip("DX9")==0 and not RUNTIME:
  4262. OPTS=['DIR:panda/src/dxgsg9', 'BUILDING:PANDADX', 'DX9', 'NVIDIACG', 'CGDX9']
  4263. TargetAdd('p3dxgsg9_dxGraphicsStateGuardian9.obj', opts=OPTS, input='dxGraphicsStateGuardian9.cxx')
  4264. TargetAdd('p3dxgsg9_composite1.obj', opts=OPTS, input='p3dxgsg9_composite1.cxx')
  4265. OPTS=['DIR:panda/metalibs/pandadx9', 'BUILDING:PANDADX', 'DX9', 'NVIDIACG', 'CGDX9']
  4266. TargetAdd('pandadx9_pandadx9.obj', opts=OPTS, input='pandadx9.cxx')
  4267. TargetAdd('libpandadx9.dll', input='pandadx9_pandadx9.obj')
  4268. TargetAdd('libpandadx9.dll', input='p3dxgsg9_dxGraphicsStateGuardian9.obj')
  4269. TargetAdd('libpandadx9.dll', input='p3dxgsg9_composite1.obj')
  4270. TargetAdd('libpandadx9.dll', input='libp3windisplay.dll')
  4271. TargetAdd('libpandadx9.dll', input=COMMON_PANDA_LIBS)
  4272. TargetAdd('libpandadx9.dll', opts=['MODULE', 'ADVAPI', 'WINGDI', 'WINKERNEL', 'WINUSER', 'WINMM', 'DX9', 'NVIDIACG', 'CGDX9'])
  4273. #
  4274. # DIRECTORY: panda/src/egg/
  4275. #
  4276. if not RUNTIME and not PkgSkip("EGG"):
  4277. OPTS=['DIR:panda/src/egg', 'BUILDING:PANDAEGG', 'ZLIB', 'BISONPREFIX_eggyy', 'FLEXDASHI', 'FLEXVERSION:2.5.9']
  4278. CreateFile(GetOutputDir()+"/include/parser.h")
  4279. TargetAdd('p3egg_parser.obj', opts=OPTS, input='parser.yxx')
  4280. TargetAdd('parser.h', input='p3egg_parser.obj', opts=['DEPENDENCYONLY'])
  4281. TargetAdd('p3egg_lexer.obj', opts=OPTS, input='lexer.lxx')
  4282. TargetAdd('p3egg_composite1.obj', opts=OPTS, input='p3egg_composite1.cxx')
  4283. TargetAdd('p3egg_composite2.obj', opts=OPTS, input='p3egg_composite2.cxx')
  4284. OPTS=['DIR:panda/src/egg', 'ZLIB']
  4285. IGATEFILES=GetDirectoryContents('panda/src/egg', ["*.h", "*_composite*.cxx"])
  4286. if "parser.h" in IGATEFILES: IGATEFILES.remove("parser.h")
  4287. TargetAdd('libp3egg.in', opts=OPTS, input=IGATEFILES)
  4288. TargetAdd('libp3egg.in', opts=['IMOD:panda3d.egg', 'ILIB:libp3egg', 'SRCDIR:panda/src/egg'])
  4289. PyTargetAdd('p3egg_ext_composite.obj', opts=OPTS, input='p3egg_ext_composite.cxx')
  4290. #
  4291. # DIRECTORY: panda/src/egg2pg/
  4292. #
  4293. if not RUNTIME and not PkgSkip("EGG"):
  4294. OPTS=['DIR:panda/src/egg2pg', 'BUILDING:PANDAEGG']
  4295. TargetAdd('p3egg2pg_composite1.obj', opts=OPTS, input='p3egg2pg_composite1.cxx')
  4296. TargetAdd('p3egg2pg_composite2.obj', opts=OPTS, input='p3egg2pg_composite2.cxx')
  4297. OPTS=['DIR:panda/src/egg2pg']
  4298. IGATEFILES=['load_egg_file.h', 'save_egg_file.h']
  4299. TargetAdd('libp3egg2pg.in', opts=OPTS, input=IGATEFILES)
  4300. TargetAdd('libp3egg2pg.in', opts=['IMOD:panda3d.egg', 'ILIB:libp3egg2pg', 'SRCDIR:panda/src/egg2pg'])
  4301. #
  4302. # DIRECTORY: panda/src/framework/
  4303. #
  4304. if (not RUNTIME):
  4305. deps = []
  4306. # Framework wants to link in a renderer when building statically, so tell it what is available.
  4307. if GetLinkAllStatic():
  4308. deps = ['dtool_have_gl.dat', 'dtool_have_tinydisplay.dat', 'dtool_have_egg.dat']
  4309. if not PkgSkip("GL"):
  4310. DefSymbol("FRAMEWORK", "HAVE_GL")
  4311. if not PkgSkip("TINYDISPLAY"):
  4312. DefSymbol("FRAMEWORK", "HAVE_TINYDISPLAY")
  4313. if not PkgSkip("EGG"):
  4314. DefSymbol("FRAMEWORK", "HAVE_EGG")
  4315. OPTS=['DIR:panda/src/framework', 'BUILDING:FRAMEWORK', 'FRAMEWORK']
  4316. TargetAdd('p3framework_composite1.obj', opts=OPTS, input='p3framework_composite1.cxx', dep=deps)
  4317. TargetAdd('libp3framework.dll', input='p3framework_composite1.obj')
  4318. TargetAdd('libp3framework.dll', input=COMMON_PANDA_LIBS)
  4319. TargetAdd('libp3framework.dll', opts=['ADVAPI'])
  4320. #
  4321. # DIRECTORY: panda/src/glgsg/
  4322. #
  4323. if (not RUNTIME and PkgSkip("GL")==0):
  4324. OPTS=['DIR:panda/src/glgsg', 'DIR:panda/src/glstuff', 'BUILDING:PANDAGL', 'GL', 'NVIDIACG']
  4325. TargetAdd('p3glgsg_config_glgsg.obj', opts=OPTS, input='config_glgsg.cxx')
  4326. TargetAdd('p3glgsg_glgsg.obj', opts=OPTS, input='glgsg.cxx')
  4327. #
  4328. # DIRECTORY: panda/src/glesgsg/
  4329. #
  4330. if (not RUNTIME and PkgSkip("GLES")==0):
  4331. OPTS=['DIR:panda/src/glesgsg', 'DIR:panda/src/glstuff', 'BUILDING:PANDAGLES', 'GLES']
  4332. TargetAdd('p3glesgsg_config_glesgsg.obj', opts=OPTS, input='config_glesgsg.cxx')
  4333. TargetAdd('p3glesgsg_glesgsg.obj', opts=OPTS, input='glesgsg.cxx')
  4334. #
  4335. # DIRECTORY: panda/src/gles2gsg/
  4336. #
  4337. if (not RUNTIME and PkgSkip("GLES2")==0):
  4338. OPTS=['DIR:panda/src/gles2gsg', 'DIR:panda/src/glstuff', 'BUILDING:PANDAGLES2', 'GLES2']
  4339. TargetAdd('p3gles2gsg_config_gles2gsg.obj', opts=OPTS, input='config_gles2gsg.cxx')
  4340. TargetAdd('p3gles2gsg_gles2gsg.obj', opts=OPTS, input='gles2gsg.cxx')
  4341. #
  4342. # DIRECTORY: panda/metalibs/pandaegg/
  4343. #
  4344. if not RUNTIME and not PkgSkip("EGG"):
  4345. OPTS=['DIR:panda/metalibs/pandaegg', 'DIR:panda/src/egg', 'BUILDING:PANDAEGG']
  4346. TargetAdd('pandaegg_pandaegg.obj', opts=OPTS, input='pandaegg.cxx')
  4347. TargetAdd('libpandaegg.dll', input='pandaegg_pandaegg.obj')
  4348. TargetAdd('libpandaegg.dll', input='p3egg2pg_composite1.obj')
  4349. TargetAdd('libpandaegg.dll', input='p3egg2pg_composite2.obj')
  4350. TargetAdd('libpandaegg.dll', input='p3egg_composite1.obj')
  4351. TargetAdd('libpandaegg.dll', input='p3egg_composite2.obj')
  4352. TargetAdd('libpandaegg.dll', input='p3egg_parser.obj')
  4353. TargetAdd('libpandaegg.dll', input='p3egg_lexer.obj')
  4354. TargetAdd('libpandaegg.dll', input=COMMON_PANDA_LIBS)
  4355. TargetAdd('libpandaegg.dll', opts=['ADVAPI'])
  4356. OPTS=['DIR:panda/metalibs/pandaegg', 'DIR:panda/src/egg']
  4357. PyTargetAdd('egg_module.obj', input='libp3egg2pg.in')
  4358. PyTargetAdd('egg_module.obj', input='libp3egg.in')
  4359. PyTargetAdd('egg_module.obj', opts=OPTS)
  4360. PyTargetAdd('egg_module.obj', opts=['IMOD:panda3d.egg', 'ILIB:egg', 'IMPORT:panda3d.core'])
  4361. PyTargetAdd('egg.pyd', input='egg_module.obj')
  4362. PyTargetAdd('egg.pyd', input='p3egg_ext_composite.obj')
  4363. PyTargetAdd('egg.pyd', input='libp3egg_igate.obj')
  4364. PyTargetAdd('egg.pyd', input='libp3egg2pg_igate.obj')
  4365. PyTargetAdd('egg.pyd', input='libpandaegg.dll')
  4366. PyTargetAdd('egg.pyd', input='libp3interrogatedb.dll')
  4367. PyTargetAdd('egg.pyd', input=COMMON_PANDA_LIBS)
  4368. #
  4369. # DIRECTORY: panda/src/x11display/
  4370. #
  4371. if (GetTarget() not in ['windows', 'darwin'] and PkgSkip("X11")==0 and not RUNTIME):
  4372. OPTS=['DIR:panda/src/x11display', 'BUILDING:PANDAX11', 'X11']
  4373. TargetAdd('p3x11display_composite1.obj', opts=OPTS, input='p3x11display_composite1.cxx')
  4374. #
  4375. # DIRECTORY: panda/src/glxdisplay/
  4376. #
  4377. if (GetTarget() not in ['windows', 'darwin'] and PkgSkip("GL")==0 and PkgSkip("X11")==0 and not RUNTIME):
  4378. DefSymbol('GLX', 'HAVE_GLX', '')
  4379. OPTS=['DIR:panda/src/glxdisplay', 'BUILDING:PANDAGL', 'GL', 'NVIDIACG', 'CGGL', 'GLX']
  4380. TargetAdd('p3glxdisplay_composite1.obj', opts=OPTS, input='p3glxdisplay_composite1.cxx')
  4381. OPTS=['DIR:panda/metalibs/pandagl', 'BUILDING:PANDAGL', 'GL', 'NVIDIACG', 'CGGL', 'GLX']
  4382. TargetAdd('pandagl_pandagl.obj', opts=OPTS, input='pandagl.cxx')
  4383. TargetAdd('libpandagl.dll', input='p3x11display_composite1.obj')
  4384. TargetAdd('libpandagl.dll', input='pandagl_pandagl.obj')
  4385. TargetAdd('libpandagl.dll', input='p3glgsg_config_glgsg.obj')
  4386. TargetAdd('libpandagl.dll', input='p3glgsg_glgsg.obj')
  4387. TargetAdd('libpandagl.dll', input='p3glxdisplay_composite1.obj')
  4388. TargetAdd('libpandagl.dll', input=COMMON_PANDA_LIBS)
  4389. TargetAdd('libpandagl.dll', opts=['MODULE', 'GL', 'NVIDIACG', 'CGGL', 'X11'])
  4390. #
  4391. # DIRECTORY: panda/src/cocoadisplay/
  4392. #
  4393. if (GetTarget() == 'darwin' and PkgSkip("COCOA")==0 and PkgSkip("GL")==0 and not RUNTIME):
  4394. OPTS=['DIR:panda/src/cocoadisplay', 'BUILDING:PANDAGL', 'GL', 'NVIDIACG', 'CGGL']
  4395. TargetAdd('p3cocoadisplay_composite1.obj', opts=OPTS, input='p3cocoadisplay_composite1.mm')
  4396. OPTS=['DIR:panda/metalibs/pandagl', 'BUILDING:PANDAGL', 'GL', 'NVIDIACG', 'CGGL']
  4397. TargetAdd('pandagl_pandagl.obj', opts=OPTS, input='pandagl.cxx')
  4398. TargetAdd('libpandagl.dll', input='pandagl_pandagl.obj')
  4399. TargetAdd('libpandagl.dll', input='p3glgsg_config_glgsg.obj')
  4400. TargetAdd('libpandagl.dll', input='p3glgsg_glgsg.obj')
  4401. TargetAdd('libpandagl.dll', input='p3cocoadisplay_composite1.obj')
  4402. if (PkgSkip('PANDAFX')==0):
  4403. TargetAdd('libpandagl.dll', input='libpandafx.dll')
  4404. TargetAdd('libpandagl.dll', input=COMMON_PANDA_LIBS)
  4405. TargetAdd('libpandagl.dll', opts=['MODULE', 'GL', 'NVIDIACG', 'CGGL', 'COCOA', 'CARBON'])
  4406. #
  4407. # DIRECTORY: panda/src/osxdisplay/
  4408. #
  4409. elif (GetTarget() == 'darwin' and PkgSkip("CARBON")==0 and PkgSkip("GL")==0 and not RUNTIME):
  4410. OPTS=['DIR:panda/src/osxdisplay', 'BUILDING:PANDAGL', 'GL', 'NVIDIACG', 'CGGL']
  4411. TargetAdd('p3osxdisplay_composite1.obj', opts=OPTS, input='p3osxdisplay_composite1.cxx')
  4412. TargetAdd('p3osxdisplay_osxGraphicsWindow.obj', opts=OPTS, input='osxGraphicsWindow.mm')
  4413. OPTS=['DIR:panda/metalibs/pandagl', 'BUILDING:PANDAGL', 'GL', 'NVIDIACG', 'CGGL']
  4414. TargetAdd('pandagl_pandagl.obj', opts=OPTS, input='pandagl.cxx')
  4415. TargetAdd('libpandagl.dll', input='pandagl_pandagl.obj')
  4416. TargetAdd('libpandagl.dll', input='p3glgsg_config_glgsg.obj')
  4417. TargetAdd('libpandagl.dll', input='p3glgsg_glgsg.obj')
  4418. TargetAdd('libpandagl.dll', input='p3osxdisplay_composite1.obj')
  4419. TargetAdd('libpandagl.dll', input='p3osxdisplay_osxGraphicsWindow.obj')
  4420. if (PkgSkip('PANDAFX')==0):
  4421. TargetAdd('libpandagl.dll', input='libpandafx.dll')
  4422. TargetAdd('libpandagl.dll', input=COMMON_PANDA_LIBS)
  4423. TargetAdd('libpandagl.dll', opts=['MODULE', 'GL', 'NVIDIACG', 'CGGL', 'CARBON', 'AGL', 'COCOA'])
  4424. #
  4425. # DIRECTORY: panda/src/wgldisplay/
  4426. #
  4427. if (GetTarget() == 'windows' and PkgSkip("GL")==0 and not RUNTIME):
  4428. OPTS=['DIR:panda/src/wgldisplay', 'DIR:panda/src/glstuff', 'BUILDING:PANDAGL', 'NVIDIACG', 'CGGL']
  4429. TargetAdd('p3wgldisplay_composite1.obj', opts=OPTS, input='p3wgldisplay_composite1.cxx')
  4430. OPTS=['DIR:panda/metalibs/pandagl', 'BUILDING:PANDAGL', 'NVIDIACG', 'CGGL']
  4431. TargetAdd('pandagl_pandagl.obj', opts=OPTS, input='pandagl.cxx')
  4432. TargetAdd('libpandagl.dll', input='pandagl_pandagl.obj')
  4433. TargetAdd('libpandagl.dll', input='p3glgsg_config_glgsg.obj')
  4434. TargetAdd('libpandagl.dll', input='p3glgsg_glgsg.obj')
  4435. TargetAdd('libpandagl.dll', input='p3wgldisplay_composite1.obj')
  4436. TargetAdd('libpandagl.dll', input='libp3windisplay.dll')
  4437. if (PkgSkip('PANDAFX')==0):
  4438. TargetAdd('libpandagl.dll', input='libpandafx.dll')
  4439. TargetAdd('libpandagl.dll', input=COMMON_PANDA_LIBS)
  4440. TargetAdd('libpandagl.dll', opts=['MODULE', 'WINGDI', 'GL', 'WINKERNEL', 'WINOLDNAMES', 'WINUSER', 'WINMM', 'NVIDIACG', 'CGGL'])
  4441. #
  4442. # DIRECTORY: panda/src/egldisplay/
  4443. #
  4444. # If we're not compiling with any windowing system at all, but we do have EGL,
  4445. # we can use that to create a headless libpandagl instead.
  4446. if not PkgSkip("EGL") and not PkgSkip("GL") and PkgSkip("X11") and GetTarget() not in ('windows', 'darwin') and not RUNTIME:
  4447. OPTS=['DIR:panda/src/egldisplay', 'DIR:panda/src/glstuff', 'BUILDING:PANDAGL', 'GL', 'EGL']
  4448. TargetAdd('pandagl_egldisplay_composite1.obj', opts=OPTS, input='p3egldisplay_composite1.cxx')
  4449. OPTS=['DIR:panda/metalibs/pandagl', 'BUILDING:PANDAGL', 'GL', 'EGL']
  4450. TargetAdd('pandagl_pandagl.obj', opts=OPTS, input='pandagl.cxx')
  4451. TargetAdd('libpandagl.dll', input='pandagl_pandagl.obj')
  4452. TargetAdd('libpandagl.dll', input='p3glgsg_config_glgsg.obj')
  4453. TargetAdd('libpandagl.dll', input='p3glgsg_glgsg.obj')
  4454. TargetAdd('libpandagl.dll', input='pandagl_egldisplay_composite1.obj')
  4455. TargetAdd('libpandagl.dll', input=COMMON_PANDA_LIBS)
  4456. TargetAdd('libpandagl.dll', opts=['MODULE', 'GL', 'EGL', 'CGGL'])
  4457. elif not PkgSkip("EGL") and not PkgSkip("GL") and GetTarget() not in ('windows', 'darwin') and not RUNTIME:
  4458. # As a temporary solution for #1086, build this module, which we can use as a
  4459. # fallback to OpenGL for headless systems.
  4460. DefSymbol('EGL', 'HAVE_EGL', '')
  4461. OPTS=['DIR:panda/src/egldisplay', 'DIR:panda/src/glstuff', 'BUILDING:PANDAGL', 'GL', 'EGL']
  4462. TargetAdd('p3headlessgl_egldisplay_composite1.obj', opts=OPTS, input='p3egldisplay_composite1.cxx')
  4463. OPTS=['DIR:panda/metalibs/pandagl', 'BUILDING:PANDAGL', 'GL', 'EGL']
  4464. TargetAdd('p3headlessgl_pandagl.obj', opts=OPTS, input='pandagl.cxx')
  4465. TargetAdd('libp3headlessgl.dll', input='p3headlessgl_pandagl.obj')
  4466. TargetAdd('libp3headlessgl.dll', input='p3glgsg_config_glgsg.obj')
  4467. TargetAdd('libp3headlessgl.dll', input='p3glgsg_glgsg.obj')
  4468. TargetAdd('libp3headlessgl.dll', input='p3headlessgl_egldisplay_composite1.obj')
  4469. TargetAdd('libp3headlessgl.dll', input=COMMON_PANDA_LIBS)
  4470. TargetAdd('libp3headlessgl.dll', opts=['MODULE', 'GL', 'EGL', 'CGGL'])
  4471. #
  4472. # DIRECTORY: panda/src/egldisplay/
  4473. #
  4474. if (PkgSkip("EGL")==0 and PkgSkip("GLES")==0 and not RUNTIME):
  4475. DefSymbol('GLES', 'OPENGLES_1', '')
  4476. OPTS=['DIR:panda/src/egldisplay', 'DIR:panda/src/glstuff', 'BUILDING:PANDAGLES', 'GLES', 'EGL', 'X11']
  4477. TargetAdd('pandagles_egldisplay_composite1.obj', opts=OPTS, input='p3egldisplay_composite1.cxx')
  4478. OPTS=['DIR:panda/metalibs/pandagles', 'BUILDING:PANDAGLES', 'GLES', 'EGL']
  4479. TargetAdd('pandagles_pandagles.obj', opts=OPTS, input='pandagles.cxx')
  4480. if not PkgSkip("X11"):
  4481. TargetAdd('libpandagles.dll', input='p3x11display_composite1.obj')
  4482. TargetAdd('libpandagles.dll', input='pandagles_pandagles.obj')
  4483. TargetAdd('libpandagles.dll', input='p3glesgsg_config_glesgsg.obj')
  4484. TargetAdd('libpandagles.dll', input='p3glesgsg_glesgsg.obj')
  4485. TargetAdd('libpandagles.dll', input='pandagles_egldisplay_composite1.obj')
  4486. TargetAdd('libpandagles.dll', input=COMMON_PANDA_LIBS)
  4487. TargetAdd('libpandagles.dll', opts=['MODULE', 'GLES', 'EGL', 'X11'])
  4488. #
  4489. # DIRECTORY: panda/src/egldisplay/
  4490. #
  4491. if (PkgSkip("EGL")==0 and PkgSkip("GLES2")==0 and not RUNTIME):
  4492. DefSymbol('GLES2', 'OPENGLES_2', '')
  4493. OPTS=['DIR:panda/src/egldisplay', 'DIR:panda/src/glstuff', 'BUILDING:PANDAGLES2', 'GLES2', 'EGL', 'X11']
  4494. TargetAdd('pandagles2_egldisplay_composite1.obj', opts=OPTS, input='p3egldisplay_composite1.cxx')
  4495. OPTS=['DIR:panda/metalibs/pandagles2', 'BUILDING:PANDAGLES2', 'GLES2', 'EGL']
  4496. TargetAdd('pandagles2_pandagles2.obj', opts=OPTS, input='pandagles2.cxx')
  4497. if not PkgSkip("X11"):
  4498. TargetAdd('libpandagles2.dll', input='p3x11display_composite1.obj')
  4499. TargetAdd('libpandagles2.dll', input='pandagles2_pandagles2.obj')
  4500. TargetAdd('libpandagles2.dll', input='p3gles2gsg_config_gles2gsg.obj')
  4501. TargetAdd('libpandagles2.dll', input='p3gles2gsg_gles2gsg.obj')
  4502. TargetAdd('libpandagles2.dll', input='pandagles2_egldisplay_composite1.obj')
  4503. TargetAdd('libpandagles2.dll', input=COMMON_PANDA_LIBS)
  4504. TargetAdd('libpandagles2.dll', opts=['MODULE', 'GLES2', 'EGL', 'X11'])
  4505. #
  4506. # DIRECTORY: panda/src/ode/
  4507. #
  4508. if (PkgSkip("ODE")==0 and not RUNTIME):
  4509. OPTS=['DIR:panda/src/ode', 'BUILDING:PANDAODE', 'ODE']
  4510. TargetAdd('p3ode_composite1.obj', opts=OPTS, input='p3ode_composite1.cxx')
  4511. TargetAdd('p3ode_composite2.obj', opts=OPTS, input='p3ode_composite2.cxx')
  4512. TargetAdd('p3ode_composite3.obj', opts=OPTS, input='p3ode_composite3.cxx')
  4513. OPTS=['DIR:panda/src/ode', 'ODE']
  4514. IGATEFILES=GetDirectoryContents('panda/src/ode', ["*.h", "*_composite*.cxx"])
  4515. IGATEFILES.remove("odeConvexGeom.h")
  4516. IGATEFILES.remove("odeHelperStructs.h")
  4517. TargetAdd('libpandaode.in', opts=OPTS, input=IGATEFILES)
  4518. TargetAdd('libpandaode.in', opts=['IMOD:panda3d.ode', 'ILIB:libpandaode', 'SRCDIR:panda/src/ode'])
  4519. PyTargetAdd('p3ode_ext_composite.obj', opts=OPTS, input='p3ode_ext_composite.cxx')
  4520. #
  4521. # DIRECTORY: panda/metalibs/pandaode/
  4522. #
  4523. if (PkgSkip("ODE")==0 and not RUNTIME):
  4524. OPTS=['DIR:panda/metalibs/pandaode', 'BUILDING:PANDAODE', 'ODE']
  4525. TargetAdd('pandaode_pandaode.obj', opts=OPTS, input='pandaode.cxx')
  4526. TargetAdd('libpandaode.dll', input='pandaode_pandaode.obj')
  4527. TargetAdd('libpandaode.dll', input='p3ode_composite1.obj')
  4528. TargetAdd('libpandaode.dll', input='p3ode_composite2.obj')
  4529. TargetAdd('libpandaode.dll', input='p3ode_composite3.obj')
  4530. TargetAdd('libpandaode.dll', input=COMMON_PANDA_LIBS)
  4531. TargetAdd('libpandaode.dll', opts=['WINUSER', 'ODE'])
  4532. OPTS=['DIR:panda/metalibs/pandaode', 'ODE']
  4533. PyTargetAdd('ode_module.obj', input='libpandaode.in')
  4534. PyTargetAdd('ode_module.obj', opts=OPTS)
  4535. PyTargetAdd('ode_module.obj', opts=['IMOD:panda3d.ode', 'ILIB:ode', 'IMPORT:panda3d.core'])
  4536. PyTargetAdd('ode.pyd', input='ode_module.obj')
  4537. PyTargetAdd('ode.pyd', input='libpandaode_igate.obj')
  4538. PyTargetAdd('ode.pyd', input='p3ode_ext_composite.obj')
  4539. PyTargetAdd('ode.pyd', input='libpandaode.dll')
  4540. PyTargetAdd('ode.pyd', input='libp3interrogatedb.dll')
  4541. PyTargetAdd('ode.pyd', input=COMMON_PANDA_LIBS)
  4542. PyTargetAdd('ode.pyd', opts=['WINUSER', 'ODE'])
  4543. #
  4544. # DIRECTORY: panda/src/bullet/
  4545. #
  4546. if (PkgSkip("BULLET")==0 and not RUNTIME):
  4547. OPTS=['DIR:panda/src/bullet', 'BUILDING:PANDABULLET', 'BULLET']
  4548. TargetAdd('p3bullet_composite.obj', opts=OPTS, input='p3bullet_composite.cxx')
  4549. OPTS=['DIR:panda/src/bullet', 'BULLET']
  4550. IGATEFILES=GetDirectoryContents('panda/src/bullet', ["*.h", "*_composite*.cxx"])
  4551. TargetAdd('libpandabullet.in', opts=OPTS, input=IGATEFILES)
  4552. TargetAdd('libpandabullet.in', opts=['IMOD:panda3d.bullet', 'ILIB:libpandabullet', 'SRCDIR:panda/src/bullet'])
  4553. #
  4554. # DIRECTORY: panda/metalibs/pandabullet/
  4555. #
  4556. if (PkgSkip("BULLET")==0 and not RUNTIME):
  4557. OPTS=['DIR:panda/metalibs/pandabullet', 'BUILDING:PANDABULLET', 'BULLET']
  4558. TargetAdd('pandabullet_pandabullet.obj', opts=OPTS, input='pandabullet.cxx')
  4559. TargetAdd('libpandabullet.dll', input='pandabullet_pandabullet.obj')
  4560. TargetAdd('libpandabullet.dll', input='p3bullet_composite.obj')
  4561. TargetAdd('libpandabullet.dll', input=COMMON_PANDA_LIBS)
  4562. TargetAdd('libpandabullet.dll', opts=['WINUSER', 'BULLET'])
  4563. OPTS=['DIR:panda/metalibs/pandabullet', 'BULLET']
  4564. PyTargetAdd('bullet_module.obj', input='libpandabullet.in')
  4565. PyTargetAdd('bullet_module.obj', opts=OPTS)
  4566. PyTargetAdd('bullet_module.obj', opts=['IMOD:panda3d.bullet', 'ILIB:bullet', 'IMPORT:panda3d.core'])
  4567. PyTargetAdd('bullet.pyd', input='bullet_module.obj')
  4568. PyTargetAdd('bullet.pyd', input='libpandabullet_igate.obj')
  4569. PyTargetAdd('bullet.pyd', input='libpandabullet.dll')
  4570. PyTargetAdd('bullet.pyd', input='libp3interrogatedb.dll')
  4571. PyTargetAdd('bullet.pyd', input=COMMON_PANDA_LIBS)
  4572. PyTargetAdd('bullet.pyd', opts=['WINUSER', 'BULLET'])
  4573. #
  4574. # DIRECTORY: panda/src/physx/
  4575. #
  4576. if (PkgSkip("PHYSX")==0):
  4577. OPTS=['DIR:panda/src/physx', 'BUILDING:PANDAPHYSX', 'PHYSX', 'NOARCH:PPC', 'NOARCH:ARM64']
  4578. TargetAdd('p3physx_composite.obj', opts=OPTS, input='p3physx_composite.cxx')
  4579. OPTS=['DIR:panda/src/physx', 'PHYSX', 'NOARCH:PPC', 'NOARCH:ARM64']
  4580. IGATEFILES=GetDirectoryContents('panda/src/physx', ["*.h", "*_composite*.cxx"])
  4581. TargetAdd('libpandaphysx.in', opts=OPTS, input=IGATEFILES)
  4582. TargetAdd('libpandaphysx.in', opts=['IMOD:panda3d.physx', 'ILIB:libpandaphysx', 'SRCDIR:panda/src/physx'])
  4583. #
  4584. # DIRECTORY: panda/metalibs/pandaphysx/
  4585. #
  4586. if (PkgSkip("PHYSX")==0):
  4587. OPTS=['DIR:panda/metalibs/pandaphysx', 'BUILDING:PANDAPHYSX', 'PHYSX', 'NOARCH:PPC', 'NOARCH:ARM64', 'PYTHON']
  4588. TargetAdd('pandaphysx_pandaphysx.obj', opts=OPTS, input='pandaphysx.cxx')
  4589. TargetAdd('libpandaphysx.dll', input='pandaphysx_pandaphysx.obj')
  4590. TargetAdd('libpandaphysx.dll', input='p3physx_composite.obj')
  4591. TargetAdd('libpandaphysx.dll', input=COMMON_PANDA_LIBS)
  4592. TargetAdd('libpandaphysx.dll', opts=['WINUSER', 'PHYSX', 'NOARCH:PPC', 'NOARCH:ARM64', 'PYTHON'])
  4593. OPTS=['DIR:panda/metalibs/pandaphysx', 'PHYSX', 'NOARCH:PPC', 'NOARCH:ARM64']
  4594. PyTargetAdd('physx_module.obj', input='libpandaphysx.in')
  4595. PyTargetAdd('physx_module.obj', opts=OPTS)
  4596. PyTargetAdd('physx_module.obj', opts=['IMOD:panda3d.physx', 'ILIB:physx', 'IMPORT:panda3d.core'])
  4597. PyTargetAdd('physx.pyd', input='physx_module.obj')
  4598. PyTargetAdd('physx.pyd', input='libpandaphysx_igate.obj')
  4599. PyTargetAdd('physx.pyd', input='libpandaphysx.dll')
  4600. PyTargetAdd('physx.pyd', input='libp3interrogatedb.dll')
  4601. PyTargetAdd('physx.pyd', input=COMMON_PANDA_LIBS)
  4602. PyTargetAdd('physx.pyd', opts=['WINUSER', 'PHYSX', 'NOARCH:PPC', 'NOARCH:ARM64'])
  4603. #
  4604. # DIRECTORY: panda/src/physics/
  4605. #
  4606. if (PkgSkip("PANDAPHYSICS")==0) and (not RUNTIME):
  4607. OPTS=['DIR:panda/src/physics', 'BUILDING:PANDAPHYSICS']
  4608. TargetAdd('p3physics_composite1.obj', opts=OPTS, input='p3physics_composite1.cxx')
  4609. TargetAdd('p3physics_composite2.obj', opts=OPTS, input='p3physics_composite2.cxx')
  4610. OPTS=['DIR:panda/src/physics']
  4611. IGATEFILES=GetDirectoryContents('panda/src/physics', ["*.h", "*_composite*.cxx"])
  4612. IGATEFILES.remove("forces.h")
  4613. TargetAdd('libp3physics.in', opts=OPTS, input=IGATEFILES)
  4614. TargetAdd('libp3physics.in', opts=['IMOD:panda3d.physics', 'ILIB:libp3physics', 'SRCDIR:panda/src/physics'])
  4615. #
  4616. # DIRECTORY: panda/src/particlesystem/
  4617. #
  4618. if (PkgSkip("PANDAPHYSICS")==0) and (PkgSkip("PANDAPARTICLESYSTEM")==0) and (not RUNTIME):
  4619. OPTS=['DIR:panda/src/particlesystem', 'BUILDING:PANDAPHYSICS']
  4620. TargetAdd('p3particlesystem_composite1.obj', opts=OPTS, input='p3particlesystem_composite1.cxx')
  4621. TargetAdd('p3particlesystem_composite2.obj', opts=OPTS, input='p3particlesystem_composite2.cxx')
  4622. OPTS=['DIR:panda/src/particlesystem']
  4623. IGATEFILES=GetDirectoryContents('panda/src/particlesystem', ["*.h", "*_composite*.cxx"])
  4624. IGATEFILES.remove('orientedParticle.h')
  4625. IGATEFILES.remove('orientedParticleFactory.h')
  4626. IGATEFILES.remove('particlefactories.h')
  4627. IGATEFILES.remove('emitters.h')
  4628. IGATEFILES.remove('particles.h')
  4629. TargetAdd('libp3particlesystem.in', opts=OPTS, input=IGATEFILES)
  4630. TargetAdd('libp3particlesystem.in', opts=['IMOD:panda3d.physics', 'ILIB:libp3particlesystem', 'SRCDIR:panda/src/particlesystem'])
  4631. #
  4632. # DIRECTORY: panda/metalibs/pandaphysics/
  4633. #
  4634. if (PkgSkip("PANDAPHYSICS")==0) and (not RUNTIME):
  4635. OPTS=['DIR:panda/metalibs/pandaphysics', 'BUILDING:PANDAPHYSICS']
  4636. TargetAdd('pandaphysics_pandaphysics.obj', opts=OPTS, input='pandaphysics.cxx')
  4637. TargetAdd('libpandaphysics.dll', input='pandaphysics_pandaphysics.obj')
  4638. TargetAdd('libpandaphysics.dll', input='p3physics_composite1.obj')
  4639. TargetAdd('libpandaphysics.dll', input='p3physics_composite2.obj')
  4640. TargetAdd('libpandaphysics.dll', input='p3particlesystem_composite1.obj')
  4641. TargetAdd('libpandaphysics.dll', input='p3particlesystem_composite2.obj')
  4642. TargetAdd('libpandaphysics.dll', input=COMMON_PANDA_LIBS)
  4643. TargetAdd('libpandaphysics.dll', opts=['ADVAPI'])
  4644. OPTS=['DIR:panda/metalibs/pandaphysics']
  4645. PyTargetAdd('physics_module.obj', input='libp3physics.in')
  4646. if (PkgSkip("PANDAPARTICLESYSTEM")==0):
  4647. PyTargetAdd('physics_module.obj', input='libp3particlesystem.in')
  4648. PyTargetAdd('physics_module.obj', opts=OPTS)
  4649. PyTargetAdd('physics_module.obj', opts=['IMOD:panda3d.physics', 'ILIB:physics', 'IMPORT:panda3d.core'])
  4650. PyTargetAdd('physics.pyd', input='physics_module.obj')
  4651. PyTargetAdd('physics.pyd', input='libp3physics_igate.obj')
  4652. if (PkgSkip("PANDAPARTICLESYSTEM")==0):
  4653. PyTargetAdd('physics.pyd', input='libp3particlesystem_igate.obj')
  4654. PyTargetAdd('physics.pyd', input='libpandaphysics.dll')
  4655. PyTargetAdd('physics.pyd', input='libp3interrogatedb.dll')
  4656. PyTargetAdd('physics.pyd', input=COMMON_PANDA_LIBS)
  4657. #
  4658. # DIRECTORY: panda/src/speedtree/
  4659. #
  4660. if (PkgSkip("SPEEDTREE")==0):
  4661. OPTS=['DIR:panda/src/speedtree', 'BUILDING:PANDASPEEDTREE', 'SPEEDTREE']
  4662. TargetAdd('pandaspeedtree_composite1.obj', opts=OPTS, input='pandaspeedtree_composite1.cxx')
  4663. IGATEFILES=GetDirectoryContents('panda/src/speedtree', ["*.h", "*_composite*.cxx"])
  4664. TargetAdd('libpandaspeedtree.in', opts=OPTS, input=IGATEFILES)
  4665. TargetAdd('libpandaspeedtree.in', opts=['IMOD:libpandaspeedtree', 'ILIB:libpandaspeedtree', 'SRCDIR:panda/src/speedtree'])
  4666. PyTargetAdd('libpandaspeedtree_module.obj', input='libpandaspeedtree.in')
  4667. PyTargetAdd('libpandaspeedtree_module.obj', opts=OPTS)
  4668. PyTargetAdd('libpandaspeedtree_module.obj', opts=['IMOD:libpandaspeedtree', 'ILIB:libpandaspeedtree'])
  4669. TargetAdd('libpandaspeedtree.dll', input='pandaspeedtree_composite1.obj')
  4670. PyTargetAdd('libpandaspeedtree.dll', input='libpandaspeedtree_igate.obj')
  4671. TargetAdd('libpandaspeedtree.dll', input='libpandaspeedtree_module.obj')
  4672. TargetAdd('libpandaspeedtree.dll', input=COMMON_PANDA_LIBS)
  4673. TargetAdd('libpandaspeedtree.dll', opts=['SPEEDTREE'])
  4674. if SDK["SPEEDTREEAPI"] == 'OpenGL':
  4675. TargetAdd('libpandaspeedtree.dll', opts=['GL', 'NVIDIACG', 'CGGL'])
  4676. elif SDK["SPEEDTREEAPI"] == 'DirectX9':
  4677. TargetAdd('libpandaspeedtree.dll', opts=['DX9', 'NVIDIACG', 'CGDX9'])
  4678. #
  4679. # DIRECTORY: panda/src/testbed/
  4680. #
  4681. if (not RTDIST and not RUNTIME and PkgSkip("PVIEW")==0):
  4682. OPTS=['DIR:panda/src/testbed']
  4683. TargetAdd('pview_pview.obj', opts=OPTS, input='pview.cxx')
  4684. TargetAdd('pview.exe', input='pview_pview.obj')
  4685. TargetAdd('pview.exe', input='libp3framework.dll')
  4686. if not PkgSkip("EGG"):
  4687. TargetAdd('pview.exe', input='libpandaegg.dll')
  4688. TargetAdd('pview.exe', input=COMMON_PANDA_LIBS)
  4689. TargetAdd('pview.exe', opts=['ADVAPI', 'WINSOCK2', 'WINSHELL'])
  4690. if GetLinkAllStatic() and not PkgSkip("GL"):
  4691. TargetAdd('pview.exe', input='libpandagl.dll')
  4692. #
  4693. # DIRECTORY: panda/src/android/
  4694. #
  4695. if (not RUNTIME and GetTarget() == 'android'):
  4696. OPTS=['DIR:panda/src/android']
  4697. TargetAdd('org/panda3d/android/NativeIStream.class', opts=OPTS, input='NativeIStream.java')
  4698. TargetAdd('org/panda3d/android/NativeOStream.class', opts=OPTS, input='NativeOStream.java')
  4699. TargetAdd('org/panda3d/android/PandaActivity.class', opts=OPTS, input='PandaActivity.java')
  4700. TargetAdd('org/panda3d/android/PythonActivity.class', opts=OPTS, input='PythonActivity.java')
  4701. TargetAdd('p3android_composite1.obj', opts=OPTS, input='p3android_composite1.cxx')
  4702. TargetAdd('libp3android.dll', input='p3android_composite1.obj')
  4703. TargetAdd('libp3android.dll', input=COMMON_PANDA_LIBS)
  4704. TargetAdd('libp3android.dll', opts=['JNIGRAPHICS'])
  4705. TargetAdd('android_native_app_glue.obj', opts=OPTS + ['NOHIDDEN'], input='android_native_app_glue.c')
  4706. TargetAdd('android_main.obj', opts=OPTS, input='android_main.cxx')
  4707. if (not RTDIST and PkgSkip("PVIEW")==0):
  4708. TargetAdd('libpview_pview.obj', opts=OPTS, input='pview.cxx')
  4709. TargetAdd('libpview.dll', input='android_native_app_glue.obj')
  4710. TargetAdd('libpview.dll', input='android_main.obj')
  4711. TargetAdd('libpview.dll', input='libpview_pview.obj')
  4712. TargetAdd('libpview.dll', input='libp3framework.dll')
  4713. if not PkgSkip("EGG"):
  4714. TargetAdd('libpview.dll', input='libpandaegg.dll')
  4715. TargetAdd('libpview.dll', input='libp3android.dll')
  4716. TargetAdd('libpview.dll', input=COMMON_PANDA_LIBS)
  4717. TargetAdd('libpview.dll', opts=['MODULE', 'ANDROID'])
  4718. if (not RTDIST and PkgSkip("PYTHON")==0):
  4719. OPTS += ['PYTHON']
  4720. TargetAdd('ppython_ppython.obj', opts=OPTS, input='python_main.cxx')
  4721. TargetAdd('libppython.dll', input='android_native_app_glue.obj')
  4722. TargetAdd('libppython.dll', input='android_main.obj')
  4723. TargetAdd('libppython.dll', input='ppython_ppython.obj')
  4724. TargetAdd('libppython.dll', input='libp3framework.dll')
  4725. TargetAdd('libppython.dll', input='libp3android.dll')
  4726. TargetAdd('libppython.dll', input=COMMON_PANDA_LIBS)
  4727. TargetAdd('libppython.dll', opts=['MODULE', 'ANDROID', 'PYTHON'])
  4728. #
  4729. # DIRECTORY: panda/src/androiddisplay/
  4730. #
  4731. if (GetTarget() == 'android' and PkgSkip("EGL")==0 and PkgSkip("GLES")==0 and not RUNTIME):
  4732. DefSymbol('GLES', 'OPENGLES_1', '')
  4733. OPTS=['DIR:panda/src/androiddisplay', 'DIR:panda/src/glstuff', 'BUILDING:PANDAGLES', 'GLES', 'EGL']
  4734. TargetAdd('pandagles_androiddisplay_composite1.obj', opts=OPTS, input='p3androiddisplay_composite1.cxx')
  4735. OPTS=['DIR:panda/metalibs/pandagles', 'BUILDING:PANDAGLES', 'GLES', 'EGL']
  4736. TargetAdd('pandagles_pandagles.obj', opts=OPTS, input='pandagles.cxx')
  4737. TargetAdd('libpandagles.dll', input='pandagles_pandagles.obj')
  4738. TargetAdd('libpandagles.dll', input='p3glesgsg_config_glesgsg.obj')
  4739. TargetAdd('libpandagles.dll', input='p3glesgsg_glesgsg.obj')
  4740. TargetAdd('libpandagles.dll', input='pandagles_androiddisplay_composite1.obj')
  4741. TargetAdd('libpandagles.dll', input='libp3android.dll')
  4742. TargetAdd('libpandagles.dll', input=COMMON_PANDA_LIBS)
  4743. TargetAdd('libpandagles.dll', opts=['MODULE', 'GLES', 'EGL'])
  4744. #
  4745. # DIRECTORY: panda/src/tinydisplay/
  4746. #
  4747. if (not RUNTIME and (GetTarget() in ('windows', 'darwin') or PkgSkip("X11")==0) and PkgSkip("TINYDISPLAY")==0):
  4748. OPTS=['DIR:panda/src/tinydisplay', 'BUILDING:TINYDISPLAY', 'X11']
  4749. TargetAdd('p3tinydisplay_composite1.obj', opts=OPTS, input='p3tinydisplay_composite1.cxx')
  4750. TargetAdd('p3tinydisplay_composite2.obj', opts=OPTS, input='p3tinydisplay_composite2.cxx')
  4751. TargetAdd('p3tinydisplay_ztriangle_1.obj', opts=OPTS, input='ztriangle_1.cxx')
  4752. TargetAdd('p3tinydisplay_ztriangle_2.obj', opts=OPTS, input='ztriangle_2.cxx')
  4753. TargetAdd('p3tinydisplay_ztriangle_3.obj', opts=OPTS, input='ztriangle_3.cxx')
  4754. TargetAdd('p3tinydisplay_ztriangle_4.obj', opts=OPTS, input='ztriangle_4.cxx')
  4755. TargetAdd('p3tinydisplay_ztriangle_table.obj', opts=OPTS, input='ztriangle_table.cxx')
  4756. if GetTarget() == 'darwin':
  4757. TargetAdd('p3tinydisplay_tinyOsxGraphicsWindow.obj', opts=OPTS, input='tinyOsxGraphicsWindow.mm')
  4758. TargetAdd('libp3tinydisplay.dll', input='p3tinydisplay_tinyOsxGraphicsWindow.obj')
  4759. TargetAdd('libp3tinydisplay.dll', opts=['CARBON', 'AGL', 'COCOA'])
  4760. elif GetTarget() == 'windows':
  4761. TargetAdd('libp3tinydisplay.dll', input='libp3windisplay.dll')
  4762. TargetAdd('libp3tinydisplay.dll', opts=['WINIMM', 'WINGDI', 'WINKERNEL', 'WINOLDNAMES', 'WINUSER', 'WINMM'])
  4763. else:
  4764. TargetAdd('libp3tinydisplay.dll', input='p3x11display_composite1.obj')
  4765. TargetAdd('libp3tinydisplay.dll', opts=['X11'])
  4766. TargetAdd('libp3tinydisplay.dll', input='p3tinydisplay_composite1.obj')
  4767. TargetAdd('libp3tinydisplay.dll', input='p3tinydisplay_composite2.obj')
  4768. TargetAdd('libp3tinydisplay.dll', input='p3tinydisplay_ztriangle_1.obj')
  4769. TargetAdd('libp3tinydisplay.dll', input='p3tinydisplay_ztriangle_2.obj')
  4770. TargetAdd('libp3tinydisplay.dll', input='p3tinydisplay_ztriangle_3.obj')
  4771. TargetAdd('libp3tinydisplay.dll', input='p3tinydisplay_ztriangle_4.obj')
  4772. TargetAdd('libp3tinydisplay.dll', input='p3tinydisplay_ztriangle_table.obj')
  4773. TargetAdd('libp3tinydisplay.dll', input=COMMON_PANDA_LIBS)
  4774. #
  4775. # DIRECTORY: direct/src/directbase/
  4776. #
  4777. if (PkgSkip("DIRECT")==0):
  4778. OPTS=['DIR:direct/src/directbase']
  4779. TargetAdd('p3directbase_directbase.obj', opts=OPTS+['BUILDING:DIRECT'], input='directbase.cxx')
  4780. #
  4781. # DIRECTORY: direct/src/dcparser/
  4782. #
  4783. if (PkgSkip("DIRECT")==0):
  4784. OPTS=['DIR:direct/src/dcparser', 'BUILDING:DIRECT_DCPARSER', 'WITHINPANDA', 'BISONPREFIX_dcyy']
  4785. CreateFile(GetOutputDir()+"/include/dcParser.h")
  4786. PyTargetAdd('p3dcparser_dcParser.obj', opts=OPTS, input='dcParser.yxx')
  4787. #TargetAdd('dcParser.h', input='p3dcparser_dcParser.obj', opts=['DEPENDENCYONLY'])
  4788. PyTargetAdd('p3dcparser_dcLexer.obj', opts=OPTS, input='dcLexer.lxx', dep='p3dcparser_dcParser.obj')
  4789. PyTargetAdd('p3dcparser_composite1.obj', opts=OPTS, input='p3dcparser_composite1.cxx')
  4790. PyTargetAdd('p3dcparser_composite2.obj', opts=OPTS, input='p3dcparser_composite2.cxx')
  4791. OPTS=['DIR:direct/src/dcparser', 'WITHINPANDA']
  4792. IGATEFILES=GetDirectoryContents('direct/src/dcparser', ["*.h", "*_composite*.cxx"])
  4793. if "dcParser.h" in IGATEFILES: IGATEFILES.remove("dcParser.h")
  4794. if "dcmsgtypes.h" in IGATEFILES: IGATEFILES.remove('dcmsgtypes.h')
  4795. TargetAdd('libp3dcparser.in', opts=OPTS, input=IGATEFILES)
  4796. TargetAdd('libp3dcparser.in', opts=['IMOD:panda3d.direct', 'ILIB:libp3dcparser', 'SRCDIR:direct/src/dcparser'])
  4797. #
  4798. # DIRECTORY: direct/src/deadrec/
  4799. #
  4800. if (PkgSkip("DIRECT")==0):
  4801. OPTS=['DIR:direct/src/deadrec', 'BUILDING:DIRECT']
  4802. TargetAdd('p3deadrec_composite1.obj', opts=OPTS, input='p3deadrec_composite1.cxx')
  4803. OPTS=['DIR:direct/src/deadrec']
  4804. IGATEFILES=GetDirectoryContents('direct/src/deadrec', ["*.h", "*_composite*.cxx"])
  4805. TargetAdd('libp3deadrec.in', opts=OPTS, input=IGATEFILES)
  4806. TargetAdd('libp3deadrec.in', opts=['IMOD:panda3d.direct', 'ILIB:libp3deadrec', 'SRCDIR:direct/src/deadrec'])
  4807. #
  4808. # DIRECTORY: direct/src/distributed/
  4809. #
  4810. if (PkgSkip("DIRECT")==0):
  4811. OPTS=['DIR:direct/src/distributed', 'DIR:direct/src/dcparser', 'WITHINPANDA', 'BUILDING:DIRECT']
  4812. TargetAdd('p3distributed_config_distributed.obj', opts=OPTS, input='config_distributed.cxx')
  4813. PyTargetAdd('p3distributed_cConnectionRepository.obj', opts=OPTS, input='cConnectionRepository.cxx')
  4814. PyTargetAdd('p3distributed_cDistributedSmoothNodeBase.obj', opts=OPTS, input='cDistributedSmoothNodeBase.cxx')
  4815. OPTS=['DIR:direct/src/distributed', 'WITHINPANDA']
  4816. IGATEFILES=GetDirectoryContents('direct/src/distributed', ["*.h", "*.cxx"])
  4817. TargetAdd('libp3distributed.in', opts=OPTS, input=IGATEFILES)
  4818. TargetAdd('libp3distributed.in', opts=['IMOD:panda3d.direct', 'ILIB:libp3distributed', 'SRCDIR:direct/src/distributed'])
  4819. #
  4820. # DIRECTORY: direct/src/interval/
  4821. #
  4822. if (PkgSkip("DIRECT")==0):
  4823. OPTS=['DIR:direct/src/interval', 'BUILDING:DIRECT']
  4824. TargetAdd('p3interval_composite1.obj', opts=OPTS, input='p3interval_composite1.cxx')
  4825. OPTS=['DIR:direct/src/interval']
  4826. IGATEFILES=GetDirectoryContents('direct/src/interval', ["*.h", "*_composite*.cxx"])
  4827. TargetAdd('libp3interval.in', opts=OPTS, input=IGATEFILES)
  4828. TargetAdd('libp3interval.in', opts=['IMOD:panda3d.direct', 'ILIB:libp3interval', 'SRCDIR:direct/src/interval'])
  4829. PyTargetAdd('p3interval_cInterval_ext.obj', opts=OPTS, input='cInterval_ext.cxx')
  4830. #
  4831. # DIRECTORY: direct/src/showbase/
  4832. #
  4833. if (PkgSkip("DIRECT")==0):
  4834. OPTS=['DIR:direct/src/showbase', 'BUILDING:DIRECT']
  4835. TargetAdd('p3showbase_showBase.obj', opts=OPTS, input='showBase.cxx')
  4836. if GetTarget() == 'darwin':
  4837. TargetAdd('p3showbase_showBase_assist.obj', opts=OPTS, input='showBase_assist.mm')
  4838. OPTS=['DIR:direct/src/showbase']
  4839. IGATEFILES=GetDirectoryContents('direct/src/showbase', ["*.h", "showBase.cxx"])
  4840. TargetAdd('libp3showbase.in', opts=OPTS, input=IGATEFILES)
  4841. TargetAdd('libp3showbase.in', opts=['IMOD:panda3d.direct', 'ILIB:libp3showbase', 'SRCDIR:direct/src/showbase'])
  4842. #
  4843. # DIRECTORY: direct/src/motiontrail/
  4844. #
  4845. if (PkgSkip("DIRECT")==0):
  4846. OPTS=['DIR:direct/src/motiontrail', 'BUILDING:DIRECT']
  4847. TargetAdd('p3motiontrail_cMotionTrail.obj', opts=OPTS, input='cMotionTrail.cxx')
  4848. TargetAdd('p3motiontrail_config_motiontrail.obj', opts=OPTS, input='config_motiontrail.cxx')
  4849. OPTS=['DIR:direct/src/motiontrail']
  4850. IGATEFILES=GetDirectoryContents('direct/src/motiontrail', ["*.h", "cMotionTrail.cxx"])
  4851. TargetAdd('libp3motiontrail.in', opts=OPTS, input=IGATEFILES)
  4852. TargetAdd('libp3motiontrail.in', opts=['IMOD:panda3d.direct', 'ILIB:libp3motiontrail', 'SRCDIR:direct/src/motiontrail'])
  4853. #
  4854. # DIRECTORY: direct/metalibs/direct/
  4855. #
  4856. if (PkgSkip("DIRECT")==0):
  4857. TargetAdd('libp3direct.dll', input='p3directbase_directbase.obj')
  4858. TargetAdd('libp3direct.dll', input='p3showbase_showBase.obj')
  4859. if GetTarget() == 'darwin':
  4860. TargetAdd('libp3direct.dll', input='p3showbase_showBase_assist.obj')
  4861. TargetAdd('libp3direct.dll', input='p3deadrec_composite1.obj')
  4862. TargetAdd('libp3direct.dll', input='p3interval_composite1.obj')
  4863. TargetAdd('libp3direct.dll', input='p3motiontrail_config_motiontrail.obj')
  4864. TargetAdd('libp3direct.dll', input='p3motiontrail_cMotionTrail.obj')
  4865. TargetAdd('libp3direct.dll', input=COMMON_PANDA_LIBS)
  4866. TargetAdd('libp3direct.dll', opts=['ADVAPI', 'WINUSER', 'WINGDI'])
  4867. PyTargetAdd('direct_module.obj', input='libp3dcparser.in')
  4868. PyTargetAdd('direct_module.obj', input='libp3showbase.in')
  4869. PyTargetAdd('direct_module.obj', input='libp3deadrec.in')
  4870. PyTargetAdd('direct_module.obj', input='libp3interval.in')
  4871. PyTargetAdd('direct_module.obj', input='libp3distributed.in')
  4872. PyTargetAdd('direct_module.obj', input='libp3motiontrail.in')
  4873. PyTargetAdd('direct_module.obj', opts=['IMOD:panda3d.direct', 'ILIB:direct', 'IMPORT:panda3d.core'])
  4874. PyTargetAdd('direct.pyd', input='libp3dcparser_igate.obj')
  4875. PyTargetAdd('direct.pyd', input='libp3showbase_igate.obj')
  4876. PyTargetAdd('direct.pyd', input='libp3deadrec_igate.obj')
  4877. PyTargetAdd('direct.pyd', input='libp3interval_igate.obj')
  4878. PyTargetAdd('direct.pyd', input='p3interval_cInterval_ext.obj')
  4879. PyTargetAdd('direct.pyd', input='libp3distributed_igate.obj')
  4880. PyTargetAdd('direct.pyd', input='libp3motiontrail_igate.obj')
  4881. # These are part of direct.pyd, not libp3direct.dll, because they rely on
  4882. # the Python libraries. If a C++ user needs these modules, we can move them
  4883. # back and filter out the Python-specific code.
  4884. PyTargetAdd('direct.pyd', input='p3dcparser_composite1.obj')
  4885. PyTargetAdd('direct.pyd', input='p3dcparser_composite2.obj')
  4886. PyTargetAdd('direct.pyd', input='p3dcparser_dcParser.obj')
  4887. PyTargetAdd('direct.pyd', input='p3dcparser_dcLexer.obj')
  4888. PyTargetAdd('direct.pyd', input='p3distributed_config_distributed.obj')
  4889. PyTargetAdd('direct.pyd', input='p3distributed_cConnectionRepository.obj')
  4890. PyTargetAdd('direct.pyd', input='p3distributed_cDistributedSmoothNodeBase.obj')
  4891. PyTargetAdd('direct.pyd', input='direct_module.obj')
  4892. PyTargetAdd('direct.pyd', input='libp3direct.dll')
  4893. PyTargetAdd('direct.pyd', input='libp3interrogatedb.dll')
  4894. PyTargetAdd('direct.pyd', input=COMMON_PANDA_LIBS)
  4895. PyTargetAdd('direct.pyd', opts=['WINUSER', 'WINGDI', 'WINSOCK2'])
  4896. #
  4897. # DIRECTORY: direct/src/dcparse/
  4898. #
  4899. if (PkgSkip("PYTHON")==0 and PkgSkip("DIRECT")==0 and not RTDIST and not RUNTIME):
  4900. OPTS=['DIR:direct/src/dcparse', 'DIR:direct/src/dcparser', 'WITHINPANDA', 'ADVAPI']
  4901. PyTargetAdd('dcparse_dcparse.obj', opts=OPTS, input='dcparse.cxx')
  4902. PyTargetAdd('p3dcparse.exe', input='p3dcparser_composite1.obj')
  4903. PyTargetAdd('p3dcparse.exe', input='p3dcparser_composite2.obj')
  4904. PyTargetAdd('p3dcparse.exe', input='p3dcparser_dcParser.obj')
  4905. PyTargetAdd('p3dcparse.exe', input='p3dcparser_dcLexer.obj')
  4906. PyTargetAdd('p3dcparse.exe', input='dcparse_dcparse.obj')
  4907. PyTargetAdd('p3dcparse.exe', input='libp3direct.dll')
  4908. PyTargetAdd('p3dcparse.exe', input=COMMON_PANDA_LIBS)
  4909. PyTargetAdd('p3dcparse.exe', input='libp3pystub.lib')
  4910. PyTargetAdd('p3dcparse.exe', opts=['ADVAPI'])
  4911. #
  4912. # DIRECTORY: direct/src/plugin/
  4913. #
  4914. if (RTDIST or RUNTIME):
  4915. # Explicitly define this as we don't include dtool_config.h here.
  4916. if GetTarget() not in ('windows', 'darwin'):
  4917. DefSymbol("RUNTIME", "HAVE_X11", "1")
  4918. OPTS=['DIR:direct/src/plugin', 'BUILDING:P3D_PLUGIN', 'RUNTIME', 'OPENSSL']
  4919. TargetAdd('plugin_common.obj', opts=OPTS, input='plugin_common_composite1.cxx')
  4920. OPTS += ['ZLIB', 'MSIMG']
  4921. TargetAdd('plugin_plugin.obj', opts=OPTS, input='p3d_plugin_composite1.cxx')
  4922. TargetAdd('plugin_mkdir_complete.obj', opts=OPTS, input='mkdir_complete.cxx')
  4923. TargetAdd('plugin_wstring_encode.obj', opts=OPTS, input='wstring_encode.cxx')
  4924. TargetAdd('plugin_parse_color.obj', opts=OPTS, input='parse_color.cxx')
  4925. TargetAdd('plugin_get_twirl_data.obj', opts=OPTS, input='get_twirl_data.cxx')
  4926. TargetAdd('plugin_find_root_dir.obj', opts=OPTS, input='find_root_dir.cxx')
  4927. if GetTarget() == 'darwin':
  4928. TargetAdd('plugin_find_root_dir_assist.obj', opts=OPTS, input='find_root_dir_assist.mm')
  4929. TargetAdd('plugin_binaryXml.obj', opts=OPTS, input='binaryXml.cxx')
  4930. TargetAdd('plugin_fileSpec.obj', opts=OPTS, input='fileSpec.cxx')
  4931. TargetAdd('plugin_handleStream.obj', opts=OPTS, input='handleStream.cxx')
  4932. TargetAdd('plugin_handleStreamBuf.obj', opts=OPTS, input='handleStreamBuf.cxx')
  4933. if (RTDIST):
  4934. for fname in ("p3d_plugin.dll", "libp3d_plugin_static.ilb"):
  4935. TargetAdd(fname, input='plugin_plugin.obj')
  4936. TargetAdd(fname, input='plugin_mkdir_complete.obj')
  4937. TargetAdd(fname, input='plugin_wstring_encode.obj')
  4938. TargetAdd(fname, input='plugin_parse_color.obj')
  4939. TargetAdd(fname, input='plugin_find_root_dir.obj')
  4940. if GetTarget() == 'darwin':
  4941. TargetAdd(fname, input='plugin_find_root_dir_assist.obj')
  4942. TargetAdd(fname, input='plugin_fileSpec.obj')
  4943. TargetAdd(fname, input='plugin_binaryXml.obj')
  4944. TargetAdd(fname, input='plugin_handleStream.obj')
  4945. TargetAdd(fname, input='plugin_handleStreamBuf.obj')
  4946. TargetAdd(fname, input='libp3tinyxml.ilb')
  4947. if GetTarget() == 'darwin':
  4948. TargetAdd(fname, input='libp3subprocbuffer.ilb')
  4949. TargetAdd(fname, opts=['OPENSSL', 'ZLIB', 'X11', 'ADVAPI', 'WINUSER', 'WINGDI', 'WINSHELL', 'WINCOMCTL', 'WINOLE', 'MSIMG'])
  4950. TargetAdd("libp3d_plugin_static.ilb", input='plugin_get_twirl_data.obj')
  4951. if (PkgSkip("PYTHON")==0 and RTDIST):
  4952. # Freeze VFSImporter and its dependency modules into p3dpython.
  4953. # Mark panda3d.core as a dependency to make sure to build that first.
  4954. TargetAdd('p3dpython_frozen.obj', input='VFSImporter.py', opts=['DIR:direct/src/showbase', 'FREEZE_STARTUP'])
  4955. TargetAdd('p3dpython_frozen.obj', dep='core.pyd')
  4956. OPTS += ['PYTHON']
  4957. TargetAdd('p3dpython_p3dpython_composite1.obj', opts=OPTS, input='p3dpython_composite1.cxx')
  4958. TargetAdd('p3dpython_p3dPythonMain.obj', opts=OPTS, input='p3dPythonMain.cxx')
  4959. TargetAdd('p3dpython.exe', input='p3dpython_p3dpython_composite1.obj')
  4960. TargetAdd('p3dpython.exe', input='p3dpython_p3dPythonMain.obj')
  4961. TargetAdd('p3dpython.exe', input='p3dpython_frozen.obj')
  4962. TargetAdd('p3dpython.exe', input=COMMON_PANDA_LIBS)
  4963. TargetAdd('p3dpython.exe', input='libp3tinyxml.ilb')
  4964. TargetAdd('p3dpython.exe', input='libp3interrogatedb.dll')
  4965. TargetAdd('p3dpython.exe', opts=['PYTHON', 'WINUSER'])
  4966. TargetAdd('libp3dpython.dll', input='p3dpython_p3dpython_composite1.obj')
  4967. TargetAdd('libp3dpython.dll', input='p3dpython_frozen.obj')
  4968. TargetAdd('libp3dpython.dll', input=COMMON_PANDA_LIBS)
  4969. TargetAdd('libp3dpython.dll', input='libp3tinyxml.ilb')
  4970. TargetAdd('libp3dpython.dll', input='libp3interrogatedb.dll')
  4971. TargetAdd('libp3dpython.dll', opts=['PYTHON', 'WINUSER'])
  4972. if GetTarget() == 'windows':
  4973. DefSymbol("NON_CONSOLE", "NON_CONSOLE", "")
  4974. OPTS.append("NON_CONSOLE")
  4975. TargetAdd('p3dpythonw_p3dpython_composite1.obj', opts=OPTS, input='p3dpython_composite1.cxx')
  4976. TargetAdd('p3dpythonw_p3dPythonMain.obj', opts=OPTS, input='p3dPythonMain.cxx')
  4977. TargetAdd('p3dpythonw.exe', input='p3dpythonw_p3dpython_composite1.obj')
  4978. TargetAdd('p3dpythonw.exe', input='p3dpythonw_p3dPythonMain.obj')
  4979. TargetAdd('p3dpythonw.exe', input='p3dpython_frozen.obj')
  4980. TargetAdd('p3dpythonw.exe', input=COMMON_PANDA_LIBS)
  4981. TargetAdd('p3dpythonw.exe', input='libp3tinyxml.ilb')
  4982. TargetAdd('p3dpythonw.exe', input='libp3interrogatedb.dll')
  4983. TargetAdd('p3dpythonw.exe', opts=['SUBSYSTEM:WINDOWS', 'WINUSER'])
  4984. if (PkgSkip("OPENSSL")==0 and RTDIST and False):
  4985. OPTS=['DIR:direct/src/plugin', 'DIR:panda/src/express', 'OPENSSL']
  4986. if GetTarget() == 'darwin':
  4987. OPTS += ['OPT:2']
  4988. if (PkgSkip("FLTK")==0):
  4989. OPTS.append("FLTK")
  4990. TargetAdd('plugin_p3dCert.obj', opts=OPTS, input='p3dCert.cxx')
  4991. TargetAdd('plugin_p3dCert_strings.obj', opts=OPTS, input='p3dCert_strings.cxx')
  4992. TargetAdd('p3dcert.exe', input='plugin_mkdir_complete.obj')
  4993. TargetAdd('p3dcert.exe', input='plugin_wstring_encode.obj')
  4994. TargetAdd('p3dcert.exe', input='plugin_p3dCert.obj')
  4995. TargetAdd('p3dcert.exe', input='plugin_p3dCert_strings.obj')
  4996. OPTS=['SUBSYSTEM:WINDOWS', 'OPENSSL', 'FLTK', 'X11', 'WINCOMCTL', 'WINSOCK', 'WINGDI', 'WINUSER', 'ADVAPI', 'WINOLE', 'WINSHELL', 'SUBSYSTEM:WINDOWS']
  4997. if GetTarget() == 'darwin':
  4998. OPTS += ['OPT:2']
  4999. TargetAdd('p3dcert.exe', opts=OPTS)
  5000. elif (PkgSkip("WX")==0):
  5001. OPTS += ["WX", "RTTI"]
  5002. TargetAdd('plugin_p3dCert.obj', opts=OPTS, input='p3dCert_wx.cxx')
  5003. TargetAdd('p3dcert.exe', input='plugin_mkdir_complete.obj')
  5004. TargetAdd('p3dcert.exe', input='plugin_wstring_encode.obj')
  5005. TargetAdd('p3dcert.exe', input='plugin_p3dCert.obj')
  5006. OPTS=['SUBSYSTEM:WINDOWS', 'OPENSSL', 'WX', 'CARBON', 'WINOLE', 'WINOLEAUT', 'WINUSER', 'ADVAPI', 'WINSHELL', 'WINCOMCTL', 'WINGDI', 'WINCOMDLG']
  5007. if GetTarget() == "darwin":
  5008. OPTS += ['GL', 'OPT:2']
  5009. TargetAdd('p3dcert.exe', opts=OPTS)
  5010. #
  5011. # DIRECTORY: direct/src/plugin_npapi/
  5012. #
  5013. if RUNTIME:
  5014. OPTS=['DIR:direct/src/plugin_npapi', 'RUNTIME', 'GTK2']
  5015. if GetTarget() == 'windows':
  5016. nppanda3d_rc = {"name" : "Panda3D Game Engine Plug-in",
  5017. "version" : VERSION,
  5018. "description" : "Runs 3-D games and interactive applets",
  5019. "filename" : "nppanda3d.dll",
  5020. "mimetype" : "application/x-panda3d",
  5021. "extension" : "p3d",
  5022. "filedesc" : "Panda3D applet"}
  5023. TargetAdd('nppanda3d.res', opts=OPTS, winrc=nppanda3d_rc)
  5024. elif GetTarget() == 'darwin':
  5025. TargetAdd('nppanda3d.rsrc', opts=OPTS, input='nppanda3d.r')
  5026. OPTS += ['GTK2']
  5027. TargetAdd('plugin_npapi_nppanda3d_composite1.obj', opts=OPTS, input='nppanda3d_composite1.cxx')
  5028. TargetAdd('nppanda3d.plugin', input='plugin_common.obj')
  5029. TargetAdd('nppanda3d.plugin', input='plugin_parse_color.obj')
  5030. TargetAdd('nppanda3d.plugin', input='plugin_get_twirl_data.obj')
  5031. TargetAdd('nppanda3d.plugin', input='plugin_wstring_encode.obj')
  5032. TargetAdd('nppanda3d.plugin', input='plugin_npapi_nppanda3d_composite1.obj')
  5033. if GetTarget() == 'windows':
  5034. TargetAdd('nppanda3d.plugin', input='nppanda3d.res')
  5035. TargetAdd('nppanda3d.plugin', input='nppanda3d.def', ipath=OPTS)
  5036. elif GetTarget() == 'darwin':
  5037. TargetAdd('nppanda3d.plugin', input='nppanda3d.rsrc')
  5038. TargetAdd('nppanda3d.plugin', input='nppanda3d.plist', ipath=OPTS)
  5039. TargetAdd('nppanda3d.plugin', input='plugin_find_root_dir_assist.obj')
  5040. TargetAdd('nppanda3d.plugin', input='libp3tinyxml.ilb')
  5041. TargetAdd('nppanda3d.plugin', opts=['OPENSSL', 'WINGDI', 'WINUSER', 'WINSHELL', 'WINOLE', 'CARBON'])
  5042. #
  5043. # DIRECTORY: direct/src/plugin_activex/
  5044. #
  5045. if (RUNTIME and GetTarget() == 'windows' and PkgSkip("MFC")==0):
  5046. OPTS=['DIR:direct/src/plugin_activex', 'RUNTIME', 'ACTIVEX', 'MFC']
  5047. DefSymbol('ACTIVEX', '_USRDLL', '')
  5048. DefSymbol('ACTIVEX', '_WINDLL', '')
  5049. DefSymbol('ACTIVEX', '_AFXDLL', '')
  5050. DefSymbol('ACTIVEX', '_MBCS', '')
  5051. TargetAdd('P3DActiveX.tlb', opts=OPTS, input='P3DActiveX.idl')
  5052. TargetAdd('P3DActiveX.res', opts=OPTS, input='P3DActiveX.rc')
  5053. TargetAdd('plugin_activex_p3dactivex_composite1.obj', opts=OPTS, input='p3dactivex_composite1.cxx')
  5054. TargetAdd('p3dactivex.ocx', input='plugin_common.obj')
  5055. TargetAdd('p3dactivex.ocx', input='plugin_parse_color.obj')
  5056. TargetAdd('p3dactivex.ocx', input='plugin_get_twirl_data.obj')
  5057. TargetAdd('p3dactivex.ocx', input='plugin_wstring_encode.obj')
  5058. TargetAdd('p3dactivex.ocx', input='plugin_activex_p3dactivex_composite1.obj')
  5059. TargetAdd('p3dactivex.ocx', input='P3DActiveX.res')
  5060. TargetAdd('p3dactivex.ocx', input='P3DActiveX.def', ipath=OPTS)
  5061. TargetAdd('p3dactivex.ocx', input='libp3tinyxml.ilb')
  5062. TargetAdd('p3dactivex.ocx', opts=['MFC', 'WINSOCK2', 'OPENSSL', 'WINGDI', 'WINUSER'])
  5063. #
  5064. # DIRECTORY: direct/src/plugin_standalone/
  5065. #
  5066. if (RUNTIME):
  5067. OPTS=['DIR:direct/src/plugin_standalone', 'RUNTIME', 'OPENSSL']
  5068. TargetAdd('plugin_standalone_panda3d.obj', opts=OPTS, input='panda3d.cxx')
  5069. TargetAdd('plugin_standalone_panda3dBase.obj', opts=OPTS, input='panda3dBase.cxx')
  5070. if GetTarget() == 'windows':
  5071. panda3d_rc = {"name" : "Panda3D Game Engine Plug-in",
  5072. "version" : VERSION,
  5073. "description" : "Runs 3-D games and interactive applets",
  5074. "filename" : "panda3d.exe",
  5075. "mimetype" : "application/x-panda3d",
  5076. "extension" : "p3d",
  5077. "filedesc" : "Panda3D applet",
  5078. "icon" : "panda3d.ico"}
  5079. TargetAdd('panda3d.res', opts=OPTS, winrc=panda3d_rc)
  5080. TargetAdd('plugin_standalone_panda3dMain.obj', opts=OPTS, input='panda3dMain.cxx')
  5081. TargetAdd('panda3d.exe', input='plugin_standalone_panda3d.obj')
  5082. TargetAdd('panda3d.exe', input='plugin_standalone_panda3dMain.obj')
  5083. TargetAdd('panda3d.exe', input='plugin_standalone_panda3dBase.obj')
  5084. TargetAdd('panda3d.exe', input='plugin_common.obj')
  5085. TargetAdd('panda3d.exe', input='plugin_wstring_encode.obj')
  5086. if GetTarget() == 'darwin':
  5087. TargetAdd('panda3d.exe', input='plugin_find_root_dir_assist.obj')
  5088. elif GetTarget() == 'windows':
  5089. TargetAdd('panda3d.exe', input='panda3d.res')
  5090. TargetAdd('panda3d.exe', input='libpandaexpress.dll')
  5091. TargetAdd('panda3d.exe', input='libp3dtoolconfig.dll')
  5092. TargetAdd('panda3d.exe', input='libp3dtool.dll')
  5093. #TargetAdd('panda3d.exe', input='libp3pystub.lib')
  5094. TargetAdd('panda3d.exe', input='libp3tinyxml.ilb')
  5095. TargetAdd('panda3d.exe', opts=['NOICON', 'OPENSSL', 'ZLIB', 'WINGDI', 'WINUSER', 'WINSHELL', 'ADVAPI', 'WINSOCK2', 'WINOLE', 'CARBON'])
  5096. if (GetTarget() == 'darwin'):
  5097. TargetAdd('plugin_standalone_panda3dMac.obj', opts=OPTS, input='panda3dMac.cxx')
  5098. TargetAdd('Panda3D.app', input='plugin_standalone_panda3d.obj')
  5099. TargetAdd('Panda3D.app', input='plugin_standalone_panda3dMac.obj')
  5100. TargetAdd('Panda3D.app', input='plugin_standalone_panda3dBase.obj')
  5101. TargetAdd('Panda3D.app', input='plugin_common.obj')
  5102. TargetAdd('Panda3D.app', input='plugin_find_root_dir_assist.obj')
  5103. TargetAdd('Panda3D.app', input='libpandaexpress.dll')
  5104. TargetAdd('Panda3D.app', input='libp3dtoolconfig.dll')
  5105. TargetAdd('Panda3D.app', input='libp3dtool.dll')
  5106. #TargetAdd('Panda3D.app', input='libp3pystub.lib')
  5107. TargetAdd('Panda3D.app', input='libp3tinyxml.ilb')
  5108. TargetAdd('Panda3D.app', input='panda3d_mac.plist', ipath=OPTS)
  5109. TargetAdd('Panda3D.app', input='models/plugin_images/panda3d.icns')
  5110. TargetAdd('Panda3D.app', opts=['OPENSSL', 'ZLIB', 'WINGDI', 'WINUSER', 'WINSHELL', 'ADVAPI', 'WINSOCK2', 'WINOLE', 'CARBON'])
  5111. elif (GetTarget() == 'windows'):
  5112. TargetAdd('plugin_standalone_panda3dWinMain.obj', opts=OPTS, input='panda3dWinMain.cxx')
  5113. TargetAdd('panda3dw.exe', input='plugin_standalone_panda3d.obj')
  5114. TargetAdd('panda3dw.exe', input='plugin_standalone_panda3dWinMain.obj')
  5115. TargetAdd('panda3dw.exe', input='plugin_standalone_panda3dBase.obj')
  5116. TargetAdd('panda3dw.exe', input='plugin_wstring_encode.obj')
  5117. TargetAdd('panda3dw.exe', input='plugin_common.obj')
  5118. TargetAdd('panda3dw.exe', input='libpandaexpress.dll')
  5119. TargetAdd('panda3dw.exe', input='libp3dtoolconfig.dll')
  5120. TargetAdd('panda3dw.exe', input='libp3dtool.dll')
  5121. #TargetAdd('panda3dw.exe', input='libp3pystub.lib')
  5122. TargetAdd('panda3dw.exe', input='libp3tinyxml.ilb')
  5123. TargetAdd('panda3dw.exe', opts=['SUBSYSTEM:WINDOWS', 'OPENSSL', 'ZLIB', 'WINGDI', 'WINUSER', 'WINSHELL', 'ADVAPI', 'WINSOCK2', 'WINOLE', 'CARBON'])
  5124. if (RTDIST):
  5125. OPTS=['BUILDING:P3D_PLUGIN', 'DIR:direct/src/plugin_standalone', 'DIR:direct/src/plugin', 'DIR:dtool/src/dtoolbase', 'DIR:dtool/src/dtoolutil', 'DIR:dtool/src/pystub', 'DIR:dtool/src/prc', 'DIR:dtool/src/dconfig', 'DIR:panda/src/express', 'DIR:panda/src/downloader', 'RUNTIME', 'P3DEMBED', 'OPENSSL', 'ZLIB']
  5126. # This is arguably a big fat ugly hack, but doing it otherwise would complicate the build process considerably.
  5127. DefSymbol("P3DEMBED", "LINK_ALL_STATIC", "")
  5128. TargetAdd('plugin_standalone_panda3dBase.obj', opts=OPTS, input='panda3dBase.cxx')
  5129. TargetAdd('plugin_standalone_p3dEmbedMain.obj', opts=OPTS, input='p3dEmbedMain.cxx')
  5130. TargetAdd('plugin_standalone_p3dEmbed.obj', opts=OPTS, input='p3dEmbed.cxx')
  5131. #TargetAdd('plugin_standalone_pystub.obj', opts=OPTS, input='pystub.cxx')
  5132. TargetAdd('plugin_standalone_dtoolbase_composite1.obj', opts=OPTS, input='p3dtoolbase_composite1.cxx')
  5133. TargetAdd('plugin_standalone_dtoolbase_composite2.obj', opts=OPTS, input='p3dtoolbase_composite2.cxx')
  5134. TargetAdd('plugin_standalone_lookup3.obj', opts=OPTS, input='lookup3.c')
  5135. TargetAdd('plugin_standalone_indent.obj', opts=OPTS, input='indent.cxx')
  5136. TargetAdd('plugin_standalone_dtoolutil_composite1.obj', opts=OPTS, input='p3dtoolutil_composite1.cxx')
  5137. TargetAdd('plugin_standalone_dtoolutil_composite2.obj', opts=OPTS, input='p3dtoolutil_composite2.cxx')
  5138. if (GetTarget() == 'darwin'):
  5139. TargetAdd('plugin_standalone_dtoolutil_filename_assist.obj', opts=OPTS, input='filename_assist.mm')
  5140. TargetAdd('plugin_standalone_prc_composite1.obj', opts=OPTS, input='p3prc_composite1.cxx')
  5141. TargetAdd('plugin_standalone_prc_composite2.obj', opts=OPTS, input='p3prc_composite2.cxx')
  5142. TargetAdd('plugin_standalone_express_composite1.obj', opts=OPTS, input='p3express_composite1.cxx')
  5143. TargetAdd('plugin_standalone_express_composite2.obj', opts=OPTS, input='p3express_composite2.cxx')
  5144. TargetAdd('plugin_standalone_downloader_composite1.obj', opts=OPTS, input='p3downloader_composite1.cxx')
  5145. TargetAdd('plugin_standalone_downloader_composite2.obj', opts=OPTS, input='p3downloader_composite2.cxx')
  5146. TargetAdd('p3dembed.exe', input='plugin_standalone_panda3dBase.obj')
  5147. TargetAdd('p3dembed.exe', input='plugin_standalone_p3dEmbedMain.obj')
  5148. TargetAdd('p3dembed.exe', input='plugin_standalone_p3dEmbed.obj')
  5149. #TargetAdd('p3dembed.exe', input='plugin_standalone_pystub.obj')
  5150. TargetAdd('p3dembed.exe', input='plugin_standalone_dtoolbase_composite1.obj')
  5151. TargetAdd('p3dembed.exe', input='plugin_standalone_dtoolbase_composite2.obj')
  5152. TargetAdd('p3dembed.exe', input='plugin_standalone_lookup3.obj')
  5153. TargetAdd('p3dembed.exe', input='plugin_standalone_indent.obj')
  5154. TargetAdd('p3dembed.exe', input='plugin_standalone_dtoolutil_composite1.obj')
  5155. TargetAdd('p3dembed.exe', input='plugin_standalone_dtoolutil_composite2.obj')
  5156. if GetTarget() == 'darwin':
  5157. TargetAdd('p3dembed.exe', input='plugin_standalone_dtoolutil_filename_assist.obj')
  5158. TargetAdd('p3dembed.exe', input='plugin_standalone_prc_composite1.obj')
  5159. TargetAdd('p3dembed.exe', input='plugin_standalone_prc_composite2.obj')
  5160. TargetAdd('p3dembed.exe', input='plugin_standalone_express_composite1.obj')
  5161. TargetAdd('p3dembed.exe', input='plugin_standalone_express_composite2.obj')
  5162. TargetAdd('p3dembed.exe', input='plugin_standalone_downloader_composite1.obj')
  5163. TargetAdd('p3dembed.exe', input='plugin_standalone_downloader_composite2.obj')
  5164. TargetAdd('p3dembed.exe', input='plugin_common.obj')
  5165. if GetTarget() == 'darwin':
  5166. TargetAdd('p3dembed.exe', input='plugin_find_root_dir_assist.obj')
  5167. TargetAdd('p3dembed.exe', input='libp3subprocbuffer.ilb')
  5168. TargetAdd('p3dembed.exe', input='libp3tinyxml.ilb')
  5169. TargetAdd('p3dembed.exe', input='libp3d_plugin_static.ilb')
  5170. TargetAdd('p3dembed.exe', opts=['NOICON', 'WINGDI', 'WINSOCK2', 'ZLIB', 'WINUSER', 'OPENSSL', 'WINOLE', 'CARBON', 'MSIMG', 'WINCOMCTL', 'ADVAPI', 'WINSHELL', 'X11'])
  5171. if GetTarget() == 'windows':
  5172. OPTS.append("P3DEMBEDW")
  5173. DefSymbol("P3DEMBEDW", "P3DEMBEDW", "")
  5174. TargetAdd('plugin_standalone_p3dEmbedWinMain.obj', opts=OPTS, input='p3dEmbedMain.cxx')
  5175. TargetAdd('p3dembedw.exe', input='plugin_standalone_panda3dBase.obj')
  5176. TargetAdd('p3dembedw.exe', input='plugin_standalone_p3dEmbedWinMain.obj')
  5177. TargetAdd('p3dembedw.exe', input='plugin_standalone_p3dEmbed.obj')
  5178. #TargetAdd('p3dembedw.exe', input='plugin_standalone_pystub.obj')
  5179. TargetAdd('p3dembedw.exe', input='plugin_standalone_dtoolbase_composite1.obj')
  5180. TargetAdd('p3dembedw.exe', input='plugin_standalone_dtoolbase_composite2.obj')
  5181. TargetAdd('p3dembedw.exe', input='plugin_standalone_lookup3.obj')
  5182. TargetAdd('p3dembedw.exe', input='plugin_standalone_indent.obj')
  5183. TargetAdd('p3dembedw.exe', input='plugin_standalone_dtoolutil_composite1.obj')
  5184. TargetAdd('p3dembedw.exe', input='plugin_standalone_dtoolutil_composite2.obj')
  5185. TargetAdd('p3dembedw.exe', input='plugin_standalone_prc_composite1.obj')
  5186. TargetAdd('p3dembedw.exe', input='plugin_standalone_prc_composite2.obj')
  5187. TargetAdd('p3dembedw.exe', input='plugin_standalone_express_composite1.obj')
  5188. TargetAdd('p3dembedw.exe', input='plugin_standalone_express_composite2.obj')
  5189. TargetAdd('p3dembedw.exe', input='plugin_standalone_downloader_composite1.obj')
  5190. TargetAdd('p3dembedw.exe', input='plugin_standalone_downloader_composite2.obj')
  5191. TargetAdd('p3dembedw.exe', input='plugin_common.obj')
  5192. TargetAdd('p3dembedw.exe', input='libp3tinyxml.ilb')
  5193. TargetAdd('p3dembedw.exe', input='libp3d_plugin_static.ilb')
  5194. TargetAdd('p3dembedw.exe', opts=['SUBSYSTEM:WINDOWS', 'NOICON', 'WINGDI', 'WINSOCK2', 'ZLIB', 'WINUSER', 'OPENSSL', 'WINOLE', 'MSIMG', 'WINCOMCTL', 'ADVAPI', 'WINSHELL'])
  5195. #
  5196. # DIRECTORY: pandatool/src/pandatoolbase/
  5197. #
  5198. if (PkgSkip("PANDATOOL")==0):
  5199. OPTS=['DIR:pandatool/src/pandatoolbase']
  5200. TargetAdd('p3pandatoolbase_composite1.obj', opts=OPTS, input='p3pandatoolbase_composite1.cxx')
  5201. TargetAdd('libp3pandatoolbase.lib', input='p3pandatoolbase_composite1.obj')
  5202. #
  5203. # DIRECTORY: pandatool/src/converter/
  5204. #
  5205. if not PkgSkip("PANDATOOL") and not PkgSkip("EGG"):
  5206. OPTS=['DIR:pandatool/src/converter']
  5207. TargetAdd('p3converter_somethingToEggConverter.obj', opts=OPTS, input='somethingToEggConverter.cxx')
  5208. TargetAdd('p3converter_eggToSomethingConverter.obj', opts=OPTS, input='eggToSomethingConverter.cxx')
  5209. TargetAdd('libp3converter.lib', input='p3converter_somethingToEggConverter.obj')
  5210. TargetAdd('libp3converter.lib', input='p3converter_eggToSomethingConverter.obj')
  5211. #
  5212. # DIRECTORY: pandatool/src/progbase/
  5213. #
  5214. if not PkgSkip("PANDATOOL"):
  5215. OPTS=['DIR:pandatool/src/progbase', 'ZLIB']
  5216. TargetAdd('p3progbase_composite1.obj', opts=OPTS, input='p3progbase_composite1.cxx')
  5217. TargetAdd('libp3progbase.lib', input='p3progbase_composite1.obj')
  5218. #
  5219. # DIRECTORY: pandatool/src/eggbase/
  5220. #
  5221. if not PkgSkip("PANDATOOL") and not PkgSkip("EGG"):
  5222. OPTS=['DIR:pandatool/src/eggbase']
  5223. TargetAdd('p3eggbase_composite1.obj', opts=OPTS, input='p3eggbase_composite1.cxx')
  5224. TargetAdd('libp3eggbase.lib', input='p3eggbase_composite1.obj')
  5225. #
  5226. # DIRECTORY: pandatool/src/bam/
  5227. #
  5228. if not PkgSkip("PANDATOOL"):
  5229. OPTS=['DIR:pandatool/src/bam']
  5230. TargetAdd('bam-info_bamInfo.obj', opts=OPTS, input='bamInfo.cxx')
  5231. TargetAdd('bam-info.exe', input='bam-info_bamInfo.obj')
  5232. TargetAdd('bam-info.exe', input='libp3progbase.lib')
  5233. TargetAdd('bam-info.exe', input='libp3pandatoolbase.lib')
  5234. TargetAdd('bam-info.exe', input=COMMON_PANDA_LIBS)
  5235. TargetAdd('bam-info.exe', opts=['ADVAPI', 'FFTW'])
  5236. if not PkgSkip("EGG"):
  5237. TargetAdd('bam2egg_bamToEgg.obj', opts=OPTS, input='bamToEgg.cxx')
  5238. TargetAdd('bam2egg.exe', input='bam2egg_bamToEgg.obj')
  5239. TargetAdd('bam2egg.exe', input=COMMON_EGG2X_LIBS)
  5240. TargetAdd('bam2egg.exe', opts=['ADVAPI', 'FFTW'])
  5241. TargetAdd('egg2bam_eggToBam.obj', opts=OPTS, input='eggToBam.cxx')
  5242. TargetAdd('egg2bam.exe', input='egg2bam_eggToBam.obj')
  5243. TargetAdd('egg2bam.exe', input=COMMON_EGG2X_LIBS)
  5244. TargetAdd('egg2bam.exe', opts=['ADVAPI', 'FFTW'])
  5245. #
  5246. # DIRECTORY: pandatool/src/cvscopy/
  5247. #
  5248. if not PkgSkip("PANDATOOL"):
  5249. OPTS=['DIR:pandatool/src/cvscopy']
  5250. TargetAdd('p3cvscopy_composite1.obj', opts=OPTS, input='p3cvscopy_composite1.cxx')
  5251. TargetAdd('libp3cvscopy.lib', input='p3cvscopy_composite1.obj')
  5252. #
  5253. # DIRECTORY: pandatool/src/daeegg/
  5254. #
  5255. if not PkgSkip("PANDATOOL") and not PkgSkip("FCOLLADA") and not PkgSkip("EGG"):
  5256. OPTS=['DIR:pandatool/src/daeegg', 'FCOLLADA']
  5257. TargetAdd('p3daeegg_composite1.obj', opts=OPTS, input='p3daeegg_composite1.cxx')
  5258. TargetAdd('libp3daeegg.lib', input='p3daeegg_composite1.obj')
  5259. TargetAdd('libp3daeegg.lib', opts=['FCOLLADA', 'CARBON'])
  5260. #
  5261. # DIRECTORY: pandatool/src/assimp
  5262. #
  5263. if not PkgSkip("PANDATOOL") and not PkgSkip("ASSIMP"):
  5264. OPTS=['DIR:pandatool/src/assimp', 'BUILDING:ASSIMP', 'ASSIMP', 'MODULE']
  5265. TargetAdd('p3assimp_composite1.obj', opts=OPTS, input='p3assimp_composite1.cxx')
  5266. TargetAdd('libp3assimp.dll', input='p3assimp_composite1.obj')
  5267. TargetAdd('libp3assimp.dll', input=COMMON_PANDA_LIBS)
  5268. TargetAdd('libp3assimp.dll', opts=OPTS+['ZLIB', 'ADVAPI'])
  5269. #
  5270. # DIRECTORY: pandatool/src/daeprogs/
  5271. #
  5272. if not PkgSkip("PANDATOOL") and not PkgSkip("FCOLLADA") and not PkgSkip("EGG"):
  5273. OPTS=['DIR:pandatool/src/daeprogs', 'FCOLLADA']
  5274. TargetAdd('dae2egg_daeToEgg.obj', opts=OPTS, input='daeToEgg.cxx')
  5275. TargetAdd('dae2egg.exe', input='dae2egg_daeToEgg.obj')
  5276. TargetAdd('dae2egg.exe', input='libp3daeegg.lib')
  5277. TargetAdd('dae2egg.exe', input=COMMON_EGG2X_LIBS)
  5278. TargetAdd('dae2egg.exe', opts=['WINUSER', 'FCOLLADA', 'CARBON'])
  5279. #
  5280. # DIRECTORY: pandatool/src/dxf/
  5281. #
  5282. if not PkgSkip("PANDATOOL"):
  5283. OPTS=['DIR:pandatool/src/dxf']
  5284. TargetAdd('p3dxf_composite1.obj', opts=OPTS, input='p3dxf_composite1.cxx')
  5285. TargetAdd('libp3dxf.lib', input='p3dxf_composite1.obj')
  5286. #
  5287. # DIRECTORY: pandatool/src/dxfegg/
  5288. #
  5289. if not PkgSkip("PANDATOOL") and not PkgSkip("EGG"):
  5290. OPTS=['DIR:pandatool/src/dxfegg']
  5291. TargetAdd('p3dxfegg_dxfToEggConverter.obj', opts=OPTS, input='dxfToEggConverter.cxx')
  5292. TargetAdd('p3dxfegg_dxfToEggLayer.obj', opts=OPTS, input='dxfToEggLayer.cxx')
  5293. TargetAdd('libp3dxfegg.lib', input='p3dxfegg_dxfToEggConverter.obj')
  5294. TargetAdd('libp3dxfegg.lib', input='p3dxfegg_dxfToEggLayer.obj')
  5295. #
  5296. # DIRECTORY: pandatool/src/dxfprogs/
  5297. #
  5298. if not PkgSkip("PANDATOOL"):
  5299. OPTS=['DIR:pandatool/src/dxfprogs']
  5300. TargetAdd('dxf-points_dxfPoints.obj', opts=OPTS, input='dxfPoints.cxx')
  5301. TargetAdd('dxf-points.exe', input='dxf-points_dxfPoints.obj')
  5302. TargetAdd('dxf-points.exe', input='libp3progbase.lib')
  5303. TargetAdd('dxf-points.exe', input='libp3dxf.lib')
  5304. TargetAdd('dxf-points.exe', input='libp3pandatoolbase.lib')
  5305. TargetAdd('dxf-points.exe', input=COMMON_PANDA_LIBS)
  5306. TargetAdd('dxf-points.exe', opts=['ADVAPI', 'FFTW'])
  5307. if not PkgSkip("EGG"):
  5308. TargetAdd('dxf2egg_dxfToEgg.obj', opts=OPTS, input='dxfToEgg.cxx')
  5309. TargetAdd('dxf2egg.exe', input='dxf2egg_dxfToEgg.obj')
  5310. TargetAdd('dxf2egg.exe', input='libp3dxfegg.lib')
  5311. TargetAdd('dxf2egg.exe', input='libp3dxf.lib')
  5312. TargetAdd('dxf2egg.exe', input=COMMON_EGG2X_LIBS)
  5313. TargetAdd('dxf2egg.exe', opts=['ADVAPI', 'FFTW'])
  5314. TargetAdd('egg2dxf_eggToDXF.obj', opts=OPTS, input='eggToDXF.cxx')
  5315. TargetAdd('egg2dxf_eggToDXFLayer.obj', opts=OPTS, input='eggToDXFLayer.cxx')
  5316. TargetAdd('egg2dxf.exe', input='egg2dxf_eggToDXF.obj')
  5317. TargetAdd('egg2dxf.exe', input='egg2dxf_eggToDXFLayer.obj')
  5318. TargetAdd('egg2dxf.exe', input='libp3dxf.lib')
  5319. TargetAdd('egg2dxf.exe', input=COMMON_EGG2X_LIBS)
  5320. TargetAdd('egg2dxf.exe', opts=['ADVAPI', 'FFTW'])
  5321. #
  5322. # DIRECTORY: pandatool/src/objegg/
  5323. #
  5324. if not PkgSkip("PANDATOOL") and not PkgSkip("EGG"):
  5325. OPTS=['DIR:pandatool/src/objegg']
  5326. TargetAdd('p3objegg_objToEggConverter.obj', opts=OPTS, input='objToEggConverter.cxx')
  5327. TargetAdd('p3objegg_eggToObjConverter.obj', opts=OPTS, input='eggToObjConverter.cxx')
  5328. TargetAdd('p3objegg_config_objegg.obj', opts=OPTS, input='config_objegg.cxx')
  5329. TargetAdd('libp3objegg.lib', input='p3objegg_objToEggConverter.obj')
  5330. TargetAdd('libp3objegg.lib', input='p3objegg_eggToObjConverter.obj')
  5331. TargetAdd('libp3objegg.lib', input='p3objegg_config_objegg.obj')
  5332. #
  5333. # DIRECTORY: pandatool/src/objprogs/
  5334. #
  5335. if not PkgSkip("PANDATOOL") and not PkgSkip("EGG"):
  5336. OPTS=['DIR:pandatool/src/objprogs']
  5337. TargetAdd('obj2egg_objToEgg.obj', opts=OPTS, input='objToEgg.cxx')
  5338. TargetAdd('obj2egg.exe', input='obj2egg_objToEgg.obj')
  5339. TargetAdd('obj2egg.exe', input='libp3objegg.lib')
  5340. TargetAdd('obj2egg.exe', input=COMMON_EGG2X_LIBS)
  5341. TargetAdd('egg2obj_eggToObj.obj', opts=OPTS, input='eggToObj.cxx')
  5342. TargetAdd('egg2obj.exe', input='egg2obj_eggToObj.obj')
  5343. TargetAdd('egg2obj.exe', input='libp3objegg.lib')
  5344. TargetAdd('egg2obj.exe', input=COMMON_EGG2X_LIBS)
  5345. #
  5346. # DIRECTORY: pandatool/src/palettizer/
  5347. #
  5348. if not PkgSkip("PANDATOOL") and not PkgSkip("EGG"):
  5349. OPTS=['DIR:pandatool/src/palettizer']
  5350. TargetAdd('p3palettizer_composite1.obj', opts=OPTS, input='p3palettizer_composite1.cxx')
  5351. TargetAdd('libp3palettizer.lib', input='p3palettizer_composite1.obj')
  5352. #
  5353. # DIRECTORY: pandatool/src/egg-mkfont/
  5354. #
  5355. if not PkgSkip("FREETYPE") and not PkgSkip("PANDATOOL") and not PkgSkip("EGG"):
  5356. OPTS=['DIR:pandatool/src/egg-mkfont', 'DIR:pandatool/src/palettizer', 'FREETYPE']
  5357. TargetAdd('egg-mkfont_eggMakeFont.obj', opts=OPTS, input='eggMakeFont.cxx')
  5358. TargetAdd('egg-mkfont_rangeDescription.obj', opts=OPTS, input='rangeDescription.cxx')
  5359. TargetAdd('egg-mkfont_rangeIterator.obj', opts=OPTS, input='rangeIterator.cxx')
  5360. TargetAdd('egg-mkfont.exe', input='egg-mkfont_eggMakeFont.obj')
  5361. TargetAdd('egg-mkfont.exe', input='egg-mkfont_rangeDescription.obj')
  5362. TargetAdd('egg-mkfont.exe', input='egg-mkfont_rangeIterator.obj')
  5363. TargetAdd('egg-mkfont.exe', input='libp3palettizer.lib')
  5364. TargetAdd('egg-mkfont.exe', input=COMMON_EGG2X_LIBS)
  5365. TargetAdd('egg-mkfont.exe', opts=['ADVAPI', 'FREETYPE'])
  5366. #
  5367. # DIRECTORY: pandatool/src/eggcharbase/
  5368. #
  5369. if not PkgSkip("PANDATOOL") and not PkgSkip("EGG"):
  5370. OPTS=['DIR:pandatool/src/eggcharbase', 'ZLIB']
  5371. TargetAdd('p3eggcharbase_composite1.obj', opts=OPTS, input='p3eggcharbase_composite1.cxx')
  5372. TargetAdd('libp3eggcharbase.lib', input='p3eggcharbase_composite1.obj')
  5373. #
  5374. # DIRECTORY: pandatool/src/egg-optchar/
  5375. #
  5376. if not PkgSkip("PANDATOOL") and not PkgSkip("EGG"):
  5377. OPTS=['DIR:pandatool/src/egg-optchar']
  5378. TargetAdd('egg-optchar_config_egg_optchar.obj', opts=OPTS, input='config_egg_optchar.cxx')
  5379. TargetAdd('egg-optchar_eggOptchar.obj', opts=OPTS, input='eggOptchar.cxx')
  5380. TargetAdd('egg-optchar_eggOptcharUserData.obj', opts=OPTS, input='eggOptcharUserData.cxx')
  5381. TargetAdd('egg-optchar_vertexMembership.obj', opts=OPTS, input='vertexMembership.cxx')
  5382. TargetAdd('egg-optchar.exe', input='egg-optchar_config_egg_optchar.obj')
  5383. TargetAdd('egg-optchar.exe', input='egg-optchar_eggOptchar.obj')
  5384. TargetAdd('egg-optchar.exe', input='egg-optchar_eggOptcharUserData.obj')
  5385. TargetAdd('egg-optchar.exe', input='egg-optchar_vertexMembership.obj')
  5386. TargetAdd('egg-optchar.exe', input='libp3eggcharbase.lib')
  5387. TargetAdd('egg-optchar.exe', input=COMMON_EGG2X_LIBS)
  5388. TargetAdd('egg-optchar.exe', opts=['ADVAPI', 'FREETYPE'])
  5389. #
  5390. # DIRECTORY: pandatool/src/egg-palettize/
  5391. #
  5392. if not PkgSkip("PANDATOOL") and not PkgSkip("EGG"):
  5393. OPTS=['DIR:pandatool/src/egg-palettize', 'DIR:pandatool/src/palettizer']
  5394. TargetAdd('egg-palettize_eggPalettize.obj', opts=OPTS, input='eggPalettize.cxx')
  5395. TargetAdd('egg-palettize.exe', input='egg-palettize_eggPalettize.obj')
  5396. TargetAdd('egg-palettize.exe', input='libp3palettizer.lib')
  5397. TargetAdd('egg-palettize.exe', input=COMMON_EGG2X_LIBS)
  5398. TargetAdd('egg-palettize.exe', opts=['ADVAPI'])
  5399. #
  5400. # DIRECTORY: pandatool/src/egg-qtess/
  5401. #
  5402. if not PkgSkip("PANDATOOL") and not PkgSkip("EGG"):
  5403. OPTS=['DIR:pandatool/src/egg-qtess']
  5404. TargetAdd('egg-qtess_composite1.obj', opts=OPTS, input='egg-qtess_composite1.cxx')
  5405. TargetAdd('egg-qtess.exe', input='egg-qtess_composite1.obj')
  5406. TargetAdd('egg-qtess.exe', input='libp3eggbase.lib')
  5407. TargetAdd('egg-qtess.exe', input='libp3progbase.lib')
  5408. TargetAdd('egg-qtess.exe', input='libp3converter.lib')
  5409. TargetAdd('egg-qtess.exe', input=COMMON_EGG2X_LIBS)
  5410. TargetAdd('egg-qtess.exe', opts=['ADVAPI'])
  5411. #
  5412. # DIRECTORY: pandatool/src/eggprogs/
  5413. #
  5414. if not PkgSkip("PANDATOOL") and not PkgSkip("EGG"):
  5415. OPTS=['DIR:pandatool/src/eggprogs']
  5416. TargetAdd('egg-crop_eggCrop.obj', opts=OPTS, input='eggCrop.cxx')
  5417. TargetAdd('egg-crop.exe', input='egg-crop_eggCrop.obj')
  5418. TargetAdd('egg-crop.exe', input=COMMON_EGG2X_LIBS)
  5419. TargetAdd('egg-crop.exe', opts=['ADVAPI'])
  5420. TargetAdd('egg-make-tube_eggMakeTube.obj', opts=OPTS, input='eggMakeTube.cxx')
  5421. TargetAdd('egg-make-tube.exe', input='egg-make-tube_eggMakeTube.obj')
  5422. TargetAdd('egg-make-tube.exe', input=COMMON_EGG2X_LIBS)
  5423. TargetAdd('egg-make-tube.exe', opts=['ADVAPI'])
  5424. TargetAdd('egg-texture-cards_eggTextureCards.obj', opts=OPTS, input='eggTextureCards.cxx')
  5425. TargetAdd('egg-texture-cards.exe', input='egg-texture-cards_eggTextureCards.obj')
  5426. TargetAdd('egg-texture-cards.exe', input=COMMON_EGG2X_LIBS)
  5427. TargetAdd('egg-texture-cards.exe', opts=['ADVAPI'])
  5428. TargetAdd('egg-topstrip_eggTopstrip.obj', opts=OPTS, input='eggTopstrip.cxx')
  5429. TargetAdd('egg-topstrip.exe', input='egg-topstrip_eggTopstrip.obj')
  5430. TargetAdd('egg-topstrip.exe', input='libp3eggcharbase.lib')
  5431. TargetAdd('egg-topstrip.exe', input=COMMON_EGG2X_LIBS)
  5432. TargetAdd('egg-topstrip.exe', opts=['ADVAPI'])
  5433. TargetAdd('egg-trans_eggTrans.obj', opts=OPTS, input='eggTrans.cxx')
  5434. TargetAdd('egg-trans.exe', input='egg-trans_eggTrans.obj')
  5435. TargetAdd('egg-trans.exe', input=COMMON_EGG2X_LIBS)
  5436. TargetAdd('egg-trans.exe', opts=['ADVAPI'])
  5437. TargetAdd('egg2c_eggToC.obj', opts=OPTS, input='eggToC.cxx')
  5438. TargetAdd('egg2c.exe', input='egg2c_eggToC.obj')
  5439. TargetAdd('egg2c.exe', input=COMMON_EGG2X_LIBS)
  5440. TargetAdd('egg2c.exe', opts=['ADVAPI'])
  5441. TargetAdd('egg-rename_eggRename.obj', opts=OPTS, input='eggRename.cxx')
  5442. TargetAdd('egg-rename.exe', input='egg-rename_eggRename.obj')
  5443. TargetAdd('egg-rename.exe', input=COMMON_EGG2X_LIBS)
  5444. TargetAdd('egg-rename.exe', opts=['ADVAPI'])
  5445. TargetAdd('egg-retarget-anim_eggRetargetAnim.obj', opts=OPTS, input='eggRetargetAnim.cxx')
  5446. TargetAdd('egg-retarget-anim.exe', input='egg-retarget-anim_eggRetargetAnim.obj')
  5447. TargetAdd('egg-retarget-anim.exe', input='libp3eggcharbase.lib')
  5448. TargetAdd('egg-retarget-anim.exe', input=COMMON_EGG2X_LIBS)
  5449. TargetAdd('egg-retarget-anim.exe', opts=['ADVAPI'])
  5450. TargetAdd('egg-list-textures_eggListTextures.obj', opts=OPTS, input='eggListTextures.cxx')
  5451. TargetAdd('egg-list-textures.exe', input='egg-list-textures_eggListTextures.obj')
  5452. TargetAdd('egg-list-textures.exe', input=COMMON_EGG2X_LIBS)
  5453. TargetAdd('egg-list-textures.exe', opts=['ADVAPI'])
  5454. #
  5455. # DIRECTORY: pandatool/src/flt/
  5456. #
  5457. if not PkgSkip("PANDATOOL"):
  5458. OPTS=['DIR:pandatool/src/flt', 'ZLIB']
  5459. TargetAdd('p3flt_composite1.obj', opts=OPTS, input='p3flt_composite1.cxx')
  5460. TargetAdd('libp3flt.lib', input=['p3flt_composite1.obj'])
  5461. #
  5462. # DIRECTORY: pandatool/src/fltegg/
  5463. #
  5464. if not PkgSkip("PANDATOOL") and not PkgSkip("EGG"):
  5465. OPTS=['DIR:pandatool/src/fltegg']
  5466. TargetAdd('p3fltegg_fltToEggConverter.obj', opts=OPTS, input='fltToEggConverter.cxx')
  5467. TargetAdd('p3fltegg_fltToEggLevelState.obj', opts=OPTS, input='fltToEggLevelState.cxx')
  5468. TargetAdd('libp3fltegg.lib', input=['p3fltegg_fltToEggConverter.obj', 'p3fltegg_fltToEggLevelState.obj'])
  5469. #
  5470. # DIRECTORY: pandatool/src/fltprogs/
  5471. #
  5472. if not PkgSkip("PANDATOOL"):
  5473. OPTS=['DIR:pandatool/src/fltprogs', 'DIR:pandatool/src/flt', 'DIR:pandatool/src/cvscopy']
  5474. TargetAdd('flt-info_fltInfo.obj', opts=OPTS, input='fltInfo.cxx')
  5475. TargetAdd('flt-info.exe', input='flt-info_fltInfo.obj')
  5476. TargetAdd('flt-info.exe', input='libp3flt.lib')
  5477. TargetAdd('flt-info.exe', input='libp3progbase.lib')
  5478. TargetAdd('flt-info.exe', input='libp3pandatoolbase.lib')
  5479. TargetAdd('flt-info.exe', input=COMMON_PANDA_LIBS)
  5480. TargetAdd('flt-info.exe', opts=['ADVAPI'])
  5481. TargetAdd('flt-trans_fltTrans.obj', opts=OPTS, input='fltTrans.cxx')
  5482. TargetAdd('flt-trans.exe', input='flt-trans_fltTrans.obj')
  5483. TargetAdd('flt-trans.exe', input='libp3flt.lib')
  5484. TargetAdd('flt-trans.exe', input='libp3progbase.lib')
  5485. TargetAdd('flt-trans.exe', input='libp3pandatoolbase.lib')
  5486. TargetAdd('flt-trans.exe', input=COMMON_PANDA_LIBS)
  5487. TargetAdd('flt-trans.exe', opts=['ADVAPI'])
  5488. TargetAdd('fltcopy_fltCopy.obj', opts=OPTS, input='fltCopy.cxx')
  5489. TargetAdd('fltcopy.exe', input='fltcopy_fltCopy.obj')
  5490. TargetAdd('fltcopy.exe', input='libp3cvscopy.lib')
  5491. TargetAdd('fltcopy.exe', input='libp3flt.lib')
  5492. TargetAdd('fltcopy.exe', input='libp3progbase.lib')
  5493. TargetAdd('fltcopy.exe', input='libp3pandatoolbase.lib')
  5494. TargetAdd('fltcopy.exe', input=COMMON_PANDA_LIBS)
  5495. TargetAdd('fltcopy.exe', opts=['ADVAPI'])
  5496. if not PkgSkip("EGG"):
  5497. TargetAdd('egg2flt_eggToFlt.obj', opts=OPTS, input='eggToFlt.cxx')
  5498. TargetAdd('egg2flt.exe', input='egg2flt_eggToFlt.obj')
  5499. TargetAdd('egg2flt.exe', input='libp3flt.lib')
  5500. TargetAdd('egg2flt.exe', input=COMMON_EGG2X_LIBS)
  5501. TargetAdd('egg2flt.exe', opts=['ADVAPI'])
  5502. TargetAdd('flt2egg_fltToEgg.obj', opts=OPTS, input='fltToEgg.cxx')
  5503. TargetAdd('flt2egg.exe', input='flt2egg_fltToEgg.obj')
  5504. TargetAdd('flt2egg.exe', input='libp3flt.lib')
  5505. TargetAdd('flt2egg.exe', input='libp3fltegg.lib')
  5506. TargetAdd('flt2egg.exe', input=COMMON_EGG2X_LIBS)
  5507. TargetAdd('flt2egg.exe', opts=['ADVAPI'])
  5508. #
  5509. # DIRECTORY: pandatool/src/imagebase/
  5510. #
  5511. if not PkgSkip("PANDATOOL"):
  5512. OPTS=['DIR:pandatool/src/imagebase']
  5513. TargetAdd('p3imagebase_composite1.obj', opts=OPTS, input='p3imagebase_composite1.cxx')
  5514. TargetAdd('libp3imagebase.lib', input='p3imagebase_composite1.obj')
  5515. #
  5516. # DIRECTORY: pandatool/src/imageprogs/
  5517. #
  5518. if not PkgSkip("PANDATOOL"):
  5519. OPTS=['DIR:pandatool/src/imageprogs']
  5520. TargetAdd('image-info_imageInfo.obj', opts=OPTS, input='imageInfo.cxx')
  5521. TargetAdd('image-info.exe', input='image-info_imageInfo.obj')
  5522. TargetAdd('image-info.exe', input='libp3imagebase.lib')
  5523. TargetAdd('image-info.exe', input='libp3progbase.lib')
  5524. TargetAdd('image-info.exe', input='libp3pandatoolbase.lib')
  5525. TargetAdd('image-info.exe', input=COMMON_PANDA_LIBS)
  5526. TargetAdd('image-info.exe', opts=['ADVAPI'])
  5527. TargetAdd('image-resize_imageResize.obj', opts=OPTS, input='imageResize.cxx')
  5528. TargetAdd('image-resize.exe', input='image-resize_imageResize.obj')
  5529. TargetAdd('image-resize.exe', input='libp3imagebase.lib')
  5530. TargetAdd('image-resize.exe', input='libp3progbase.lib')
  5531. TargetAdd('image-resize.exe', input='libp3pandatoolbase.lib')
  5532. TargetAdd('image-resize.exe', input=COMMON_PANDA_LIBS)
  5533. TargetAdd('image-resize.exe', opts=['ADVAPI'])
  5534. TargetAdd('image-trans_imageTrans.obj', opts=OPTS, input='imageTrans.cxx')
  5535. TargetAdd('image-trans.exe', input='image-trans_imageTrans.obj')
  5536. TargetAdd('image-trans.exe', input='libp3imagebase.lib')
  5537. TargetAdd('image-trans.exe', input='libp3progbase.lib')
  5538. TargetAdd('image-trans.exe', input='libp3pandatoolbase.lib')
  5539. TargetAdd('image-trans.exe', input=COMMON_PANDA_LIBS)
  5540. TargetAdd('image-trans.exe', opts=['ADVAPI'])
  5541. #
  5542. # DIRECTORY: pandatool/src/pfmprogs/
  5543. #
  5544. if not PkgSkip("PANDATOOL"):
  5545. OPTS=['DIR:pandatool/src/pfmprogs']
  5546. TargetAdd('pfm-trans_pfmTrans.obj', opts=OPTS, input='pfmTrans.cxx')
  5547. TargetAdd('pfm-trans.exe', input='pfm-trans_pfmTrans.obj')
  5548. TargetAdd('pfm-trans.exe', input='libp3progbase.lib')
  5549. TargetAdd('pfm-trans.exe', input='libp3pandatoolbase.lib')
  5550. TargetAdd('pfm-trans.exe', input=COMMON_PANDA_LIBS)
  5551. TargetAdd('pfm-trans.exe', opts=['ADVAPI'])
  5552. TargetAdd('pfm-bba_pfmBba.obj', opts=OPTS, input='pfmBba.cxx')
  5553. TargetAdd('pfm-bba_config_pfmprogs.obj', opts=OPTS, input='config_pfmprogs.cxx')
  5554. TargetAdd('pfm-bba.exe', input='pfm-bba_pfmBba.obj')
  5555. TargetAdd('pfm-bba.exe', input='pfm-bba_config_pfmprogs.obj')
  5556. TargetAdd('pfm-bba.exe', input='libp3progbase.lib')
  5557. TargetAdd('pfm-bba.exe', input='libp3pandatoolbase.lib')
  5558. TargetAdd('pfm-bba.exe', input=COMMON_PANDA_LIBS)
  5559. TargetAdd('pfm-bba.exe', opts=['ADVAPI'])
  5560. #
  5561. # DIRECTORY: pandatool/src/lwo/
  5562. #
  5563. if not PkgSkip("PANDATOOL"):
  5564. OPTS=['DIR:pandatool/src/lwo']
  5565. TargetAdd('p3lwo_composite1.obj', opts=OPTS, input='p3lwo_composite1.cxx')
  5566. TargetAdd('libp3lwo.lib', input='p3lwo_composite1.obj')
  5567. #
  5568. # DIRECTORY: pandatool/src/lwoegg/
  5569. #
  5570. if not PkgSkip("PANDATOOL") and not PkgSkip("EGG"):
  5571. OPTS=['DIR:pandatool/src/lwoegg']
  5572. TargetAdd('p3lwoegg_composite1.obj', opts=OPTS, input='p3lwoegg_composite1.cxx')
  5573. TargetAdd('libp3lwoegg.lib', input='p3lwoegg_composite1.obj')
  5574. #
  5575. # DIRECTORY: pandatool/src/lwoprogs/
  5576. #
  5577. if not PkgSkip("PANDATOOL"):
  5578. OPTS=['DIR:pandatool/src/lwoprogs', 'DIR:pandatool/src/lwo']
  5579. TargetAdd('lwo-scan_lwoScan.obj', opts=OPTS, input='lwoScan.cxx')
  5580. TargetAdd('lwo-scan.exe', input='lwo-scan_lwoScan.obj')
  5581. TargetAdd('lwo-scan.exe', input='libp3lwo.lib')
  5582. TargetAdd('lwo-scan.exe', input='libp3progbase.lib')
  5583. TargetAdd('lwo-scan.exe', input='libp3pandatoolbase.lib')
  5584. TargetAdd('lwo-scan.exe', input=COMMON_PANDA_LIBS)
  5585. TargetAdd('lwo-scan.exe', opts=['ADVAPI'])
  5586. if not PkgSkip("EGG"):
  5587. TargetAdd('lwo2egg_lwoToEgg.obj', opts=OPTS, input='lwoToEgg.cxx')
  5588. TargetAdd('lwo2egg.exe', input='lwo2egg_lwoToEgg.obj')
  5589. TargetAdd('lwo2egg.exe', input='libp3lwo.lib')
  5590. TargetAdd('lwo2egg.exe', input='libp3lwoegg.lib')
  5591. TargetAdd('lwo2egg.exe', input=COMMON_EGG2X_LIBS)
  5592. TargetAdd('lwo2egg.exe', opts=['ADVAPI'])
  5593. #
  5594. # DIRECTORY: pandatool/src/maya/
  5595. #
  5596. for VER in MAYAVERSIONS:
  5597. VNUM=VER[4:]
  5598. if not PkgSkip(VER) and not PkgSkip("PANDATOOL"):
  5599. OPTS=['DIR:pandatool/src/maya', VER]
  5600. TargetAdd('maya'+VNUM+'_composite1.obj', opts=OPTS, input='p3maya_composite1.cxx')
  5601. TargetAdd('libmaya'+VNUM+'.lib', input='maya'+VNUM+'_composite1.obj')
  5602. #
  5603. # DIRECTORY: pandatool/src/mayaegg/
  5604. #
  5605. for VER in MAYAVERSIONS:
  5606. VNUM=VER[4:]
  5607. if not PkgSkip(VER) and not PkgSkip("PANDATOOL") and not PkgSkip("EGG"):
  5608. OPTS=['DIR:pandatool/src/mayaegg', 'DIR:pandatool/src/maya', VER]
  5609. TargetAdd('mayaegg'+VNUM+'_loader.obj', opts=OPTS, input='mayaEggLoader.cxx')
  5610. TargetAdd('mayaegg'+VNUM+'_composite1.obj', opts=OPTS, input='p3mayaegg_composite1.cxx')
  5611. TargetAdd('libmayaegg'+VNUM+'.lib', input='mayaegg'+VNUM+'_loader.obj')
  5612. TargetAdd('libmayaegg'+VNUM+'.lib', input='mayaegg'+VNUM+'_composite1.obj')
  5613. #
  5614. # DIRECTORY: pandatool/src/maxegg/
  5615. #
  5616. for VER in MAXVERSIONS:
  5617. VNUM=VER[3:]
  5618. if not PkgSkip(VER) and not PkgSkip("PANDATOOL") and not PkgSkip("EGG"):
  5619. OPTS=['DIR:pandatool/src/maxegg', VER, "WINCOMCTL", "WINCOMDLG", "WINUSER", "MSFORSCOPE", "RTTI"]
  5620. TargetAdd('maxEgg'+VNUM+'.res', opts=OPTS, input='maxEgg.rc')
  5621. TargetAdd('maxegg'+VNUM+'_loader.obj', opts=OPTS, input='maxEggLoader.cxx')
  5622. TargetAdd('maxegg'+VNUM+'_composite1.obj', opts=OPTS, input='p3maxegg_composite1.cxx')
  5623. TargetAdd('maxegg'+VNUM+'.dlo', input='maxegg'+VNUM+'_composite1.obj')
  5624. TargetAdd('maxegg'+VNUM+'.dlo', input='maxEgg'+VNUM+'.res')
  5625. TargetAdd('maxegg'+VNUM+'.dlo', input='maxEgg.def', ipath=OPTS)
  5626. TargetAdd('maxegg'+VNUM+'.dlo', input=COMMON_EGG2X_LIBS)
  5627. TargetAdd('maxegg'+VNUM+'.dlo', opts=OPTS)
  5628. #
  5629. # DIRECTORY: pandatool/src/maxprogs/
  5630. #
  5631. for VER in MAXVERSIONS:
  5632. VNUM=VER[3:]
  5633. if not PkgSkip(VER) and not PkgSkip("PANDATOOL") and not PkgSkip("EGG"):
  5634. OPTS=['DIR:pandatool/src/maxprogs', VER, "WINCOMCTL", "WINCOMDLG", "WINUSER", "MSFORSCOPE", "RTTI"]
  5635. TargetAdd('maxImportRes.res', opts=OPTS, input='maxImportRes.rc')
  5636. TargetAdd('maxprogs'+VNUM+'_maxeggimport.obj', opts=OPTS, input='maxEggImport.cxx')
  5637. TargetAdd('maxeggimport'+VNUM+'.dle', input='maxegg'+VNUM+'_loader.obj')
  5638. TargetAdd('maxeggimport'+VNUM+'.dle', input='maxprogs'+VNUM+'_maxeggimport.obj')
  5639. TargetAdd('maxeggimport'+VNUM+'.dle', input='libpandaegg.dll')
  5640. TargetAdd('maxeggimport'+VNUM+'.dle', input='libpanda.dll')
  5641. TargetAdd('maxeggimport'+VNUM+'.dle', input='libpandaexpress.dll')
  5642. TargetAdd('maxeggimport'+VNUM+'.dle', input='maxImportRes.res')
  5643. TargetAdd('maxeggimport'+VNUM+'.dle', input='maxEggImport.def', ipath=OPTS)
  5644. TargetAdd('maxeggimport'+VNUM+'.dle', input=COMMON_DTOOL_LIBS)
  5645. TargetAdd('maxeggimport'+VNUM+'.dle', opts=OPTS)
  5646. #
  5647. # DIRECTORY: pandatool/src/vrml/
  5648. #
  5649. if not PkgSkip("PANDATOOL"):
  5650. OPTS=['DIR:pandatool/src/vrml', 'ZLIB', 'BISONPREFIX_vrmlyy']
  5651. CreateFile(GetOutputDir()+"/include/vrmlParser.h")
  5652. TargetAdd('p3vrml_vrmlParser.obj', opts=OPTS, input='vrmlParser.yxx')
  5653. TargetAdd('vrmlParser.h', input='p3vrml_vrmlParser.obj', opts=['DEPENDENCYONLY'])
  5654. TargetAdd('p3vrml_vrmlLexer.obj', opts=OPTS, input='vrmlLexer.lxx')
  5655. TargetAdd('p3vrml_parse_vrml.obj', opts=OPTS, input='parse_vrml.cxx')
  5656. TargetAdd('p3vrml_standard_nodes.obj', opts=OPTS, input='standard_nodes.cxx')
  5657. TargetAdd('p3vrml_vrmlNode.obj', opts=OPTS, input='vrmlNode.cxx')
  5658. TargetAdd('p3vrml_vrmlNodeType.obj', opts=OPTS, input='vrmlNodeType.cxx')
  5659. TargetAdd('libp3vrml.lib', input='p3vrml_parse_vrml.obj')
  5660. TargetAdd('libp3vrml.lib', input='p3vrml_standard_nodes.obj')
  5661. TargetAdd('libp3vrml.lib', input='p3vrml_vrmlNode.obj')
  5662. TargetAdd('libp3vrml.lib', input='p3vrml_vrmlNodeType.obj')
  5663. TargetAdd('libp3vrml.lib', input='p3vrml_vrmlParser.obj')
  5664. TargetAdd('libp3vrml.lib', input='p3vrml_vrmlLexer.obj')
  5665. #
  5666. # DIRECTORY: pandatool/src/vrmlegg/
  5667. #
  5668. if not PkgSkip("PANDATOOL") and not PkgSkip("EGG"):
  5669. OPTS=['DIR:pandatool/src/vrmlegg', 'DIR:pandatool/src/vrml']
  5670. TargetAdd('p3vrmlegg_indexedFaceSet.obj', opts=OPTS, input='indexedFaceSet.cxx')
  5671. TargetAdd('p3vrmlegg_vrmlAppearance.obj', opts=OPTS, input='vrmlAppearance.cxx')
  5672. TargetAdd('p3vrmlegg_vrmlToEggConverter.obj', opts=OPTS, input='vrmlToEggConverter.cxx')
  5673. TargetAdd('libp3vrmlegg.lib', input='p3vrmlegg_indexedFaceSet.obj')
  5674. TargetAdd('libp3vrmlegg.lib', input='p3vrmlegg_vrmlAppearance.obj')
  5675. TargetAdd('libp3vrmlegg.lib', input='p3vrmlegg_vrmlToEggConverter.obj')
  5676. #
  5677. # DIRECTORY: pandatool/src/xfile/
  5678. #
  5679. if not PkgSkip("PANDATOOL"):
  5680. OPTS=['DIR:pandatool/src/xfile', 'ZLIB', 'BISONPREFIX_xyy', 'FLEXDASHI']
  5681. CreateFile(GetOutputDir()+"/include/xParser.h")
  5682. TargetAdd('p3xfile_xParser.obj', opts=OPTS, input='xParser.yxx')
  5683. TargetAdd('xParser.h', input='p3xfile_xParser.obj', opts=['DEPENDENCYONLY'])
  5684. TargetAdd('p3xfile_xLexer.obj', opts=OPTS, input='xLexer.lxx')
  5685. TargetAdd('p3xfile_composite1.obj', opts=OPTS, input='p3xfile_composite1.cxx')
  5686. TargetAdd('libp3xfile.lib', input='p3xfile_composite1.obj')
  5687. TargetAdd('libp3xfile.lib', input='p3xfile_xParser.obj')
  5688. TargetAdd('libp3xfile.lib', input='p3xfile_xLexer.obj')
  5689. #
  5690. # DIRECTORY: pandatool/src/xfileegg/
  5691. #
  5692. if not PkgSkip("PANDATOOL") and not PkgSkip("EGG"):
  5693. OPTS=['DIR:pandatool/src/xfileegg', 'DIR:pandatool/src/xfile']
  5694. TargetAdd('p3xfileegg_composite1.obj', opts=OPTS, input='p3xfileegg_composite1.cxx')
  5695. TargetAdd('libp3xfileegg.lib', input='p3xfileegg_composite1.obj')
  5696. #
  5697. # DIRECTORY: pandatool/src/ptloader/
  5698. #
  5699. if not PkgSkip("PANDATOOL") and not PkgSkip("EGG"):
  5700. if not PkgSkip("FCOLLADA"):
  5701. DefSymbol("FCOLLADA", "HAVE_FCOLLADA")
  5702. 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']
  5703. TargetAdd('p3ptloader_config_ptloader.obj', opts=OPTS, input='config_ptloader.cxx', dep='dtool_have_fcollada.dat')
  5704. TargetAdd('p3ptloader_loaderFileTypePandatool.obj', opts=OPTS, input='loaderFileTypePandatool.cxx')
  5705. TargetAdd('libp3ptloader.dll', input='p3ptloader_config_ptloader.obj')
  5706. TargetAdd('libp3ptloader.dll', input='p3ptloader_loaderFileTypePandatool.obj')
  5707. TargetAdd('libp3ptloader.dll', input='libp3fltegg.lib')
  5708. TargetAdd('libp3ptloader.dll', input='libp3flt.lib')
  5709. TargetAdd('libp3ptloader.dll', input='libp3lwoegg.lib')
  5710. TargetAdd('libp3ptloader.dll', input='libp3lwo.lib')
  5711. TargetAdd('libp3ptloader.dll', input='libp3dxfegg.lib')
  5712. TargetAdd('libp3ptloader.dll', input='libp3dxf.lib')
  5713. TargetAdd('libp3ptloader.dll', input='libp3objegg.lib')
  5714. TargetAdd('libp3ptloader.dll', input='libp3vrmlegg.lib')
  5715. TargetAdd('libp3ptloader.dll', input='libp3vrml.lib')
  5716. TargetAdd('libp3ptloader.dll', input='libp3xfileegg.lib')
  5717. TargetAdd('libp3ptloader.dll', input='libp3xfile.lib')
  5718. if (PkgSkip("FCOLLADA")==0): TargetAdd('libp3ptloader.dll', input='libp3daeegg.lib')
  5719. TargetAdd('libp3ptloader.dll', input='libp3eggbase.lib')
  5720. TargetAdd('libp3ptloader.dll', input='libp3progbase.lib')
  5721. TargetAdd('libp3ptloader.dll', input='libp3converter.lib')
  5722. TargetAdd('libp3ptloader.dll', input='libp3pandatoolbase.lib')
  5723. TargetAdd('libp3ptloader.dll', input='libpandaegg.dll')
  5724. TargetAdd('libp3ptloader.dll', input=COMMON_PANDA_LIBS)
  5725. TargetAdd('libp3ptloader.dll', opts=['MODULE', 'ADVAPI', 'FCOLLADA', 'WINUSER'])
  5726. #
  5727. # DIRECTORY: pandatool/src/miscprogs/
  5728. #
  5729. # This is a bit of an esoteric tool, and it causes issues because
  5730. # it conflicts with tools of the same name in different packages.
  5731. #if (PkgSkip("PANDATOOL")==0):
  5732. # OPTS=['DIR:pandatool/src/miscprogs']
  5733. # TargetAdd('bin2c_binToC.obj', opts=OPTS, input='binToC.cxx')
  5734. # TargetAdd('bin2c.exe', input='bin2c_binToC.obj')
  5735. # TargetAdd('bin2c.exe', input='libp3progbase.lib')
  5736. # TargetAdd('bin2c.exe', input='libp3pandatoolbase.lib')
  5737. # TargetAdd('bin2c.exe', input=COMMON_PANDA_LIBS)
  5738. # TargetAdd('bin2c.exe', opts=['ADVAPI'])
  5739. #
  5740. # DIRECTORY: pandatool/src/pstatserver/
  5741. #
  5742. if (PkgSkip("PANDATOOL")==0):
  5743. OPTS=['DIR:pandatool/src/pstatserver']
  5744. TargetAdd('p3pstatserver_composite1.obj', opts=OPTS, input='p3pstatserver_composite1.cxx')
  5745. TargetAdd('libp3pstatserver.lib', input='p3pstatserver_composite1.obj')
  5746. #
  5747. # DIRECTORY: pandatool/src/text-stats/
  5748. #
  5749. if (PkgSkip("PANDATOOL")==0):
  5750. OPTS=['DIR:pandatool/src/text-stats']
  5751. TargetAdd('text-stats_textMonitor.obj', opts=OPTS, input='textMonitor.cxx')
  5752. TargetAdd('text-stats_textStats.obj', opts=OPTS, input='textStats.cxx')
  5753. TargetAdd('text-stats.exe', input='text-stats_textMonitor.obj')
  5754. TargetAdd('text-stats.exe', input='text-stats_textStats.obj')
  5755. TargetAdd('text-stats.exe', input='libp3progbase.lib')
  5756. TargetAdd('text-stats.exe', input='libp3pstatserver.lib')
  5757. TargetAdd('text-stats.exe', input='libp3pandatoolbase.lib')
  5758. TargetAdd('text-stats.exe', input=COMMON_PANDA_LIBS)
  5759. TargetAdd('text-stats.exe', opts=['ADVAPI'])
  5760. #
  5761. # DIRECTORY: pandatool/src/vrmlprogs/
  5762. #
  5763. if not PkgSkip("PANDATOOL"):
  5764. OPTS=['DIR:pandatool/src/vrmlprogs', 'DIR:pandatool/src/vrml', 'DIR:pandatool/src/vrmlegg']
  5765. TargetAdd('vrml-trans_vrmlTrans.obj', opts=OPTS, input='vrmlTrans.cxx')
  5766. TargetAdd('vrml-trans.exe', input='vrml-trans_vrmlTrans.obj')
  5767. TargetAdd('vrml-trans.exe', input='libp3vrml.lib')
  5768. TargetAdd('vrml-trans.exe', input='libp3progbase.lib')
  5769. TargetAdd('vrml-trans.exe', input='libp3pandatoolbase.lib')
  5770. TargetAdd('vrml-trans.exe', input=COMMON_PANDA_LIBS)
  5771. TargetAdd('vrml-trans.exe', opts=['ADVAPI'])
  5772. if not PkgSkip("EGG"):
  5773. TargetAdd('vrml2egg_vrmlToEgg.obj', opts=OPTS, input='vrmlToEgg.cxx')
  5774. TargetAdd('vrml2egg.exe', input='vrml2egg_vrmlToEgg.obj')
  5775. TargetAdd('vrml2egg.exe', input='libp3vrmlegg.lib')
  5776. TargetAdd('vrml2egg.exe', input='libp3vrml.lib')
  5777. TargetAdd('vrml2egg.exe', input=COMMON_EGG2X_LIBS)
  5778. TargetAdd('vrml2egg.exe', opts=['ADVAPI'])
  5779. #
  5780. # DIRECTORY: pandatool/src/win-stats/
  5781. # DIRECTORY: pandatool/src/gtk-stats/
  5782. #
  5783. if (PkgSkip("PANDATOOL")==0 and (GetTarget() == 'windows' or PkgSkip("GTK2")==0)):
  5784. if GetTarget() == 'windows':
  5785. OPTS=['DIR:pandatool/src/win-stats']
  5786. TargetAdd('pstats_composite1.obj', opts=OPTS, input='winstats_composite1.cxx')
  5787. else:
  5788. OPTS=['DIR:pandatool/src/gtk-stats', 'GTK2']
  5789. TargetAdd('pstats_composite1.obj', opts=OPTS, input='gtkstats_composite1.cxx')
  5790. TargetAdd('pstats.exe', input='pstats_composite1.obj')
  5791. TargetAdd('pstats.exe', input='libp3pstatserver.lib')
  5792. TargetAdd('pstats.exe', input='libp3progbase.lib')
  5793. TargetAdd('pstats.exe', input='libp3pandatoolbase.lib')
  5794. TargetAdd('pstats.exe', input=COMMON_PANDA_LIBS)
  5795. TargetAdd('pstats.exe', opts=['SUBSYSTEM:WINDOWS', 'WINSOCK', 'WINIMM', 'WINGDI', 'WINKERNEL', 'WINOLDNAMES', 'WINUSER', 'WINMM', 'GTK2'])
  5796. #
  5797. # DIRECTORY: pandatool/src/xfileprogs/
  5798. #
  5799. if not PkgSkip("PANDATOOL"):
  5800. OPTS=['DIR:pandatool/src/xfileprogs', 'DIR:pandatool/src/xfile', 'DIR:pandatool/src/xfileegg']
  5801. TargetAdd('x-trans_xFileTrans.obj', opts=OPTS, input='xFileTrans.cxx')
  5802. TargetAdd('x-trans.exe', input='x-trans_xFileTrans.obj')
  5803. TargetAdd('x-trans.exe', input='libp3progbase.lib')
  5804. TargetAdd('x-trans.exe', input='libp3xfile.lib')
  5805. TargetAdd('x-trans.exe', input='libp3pandatoolbase.lib')
  5806. TargetAdd('x-trans.exe', input=COMMON_PANDA_LIBS)
  5807. TargetAdd('x-trans.exe', opts=['ADVAPI'])
  5808. if not PkgSkip("EGG"):
  5809. TargetAdd('egg2x_eggToX.obj', opts=OPTS, input='eggToX.cxx')
  5810. TargetAdd('egg2x.exe', input='egg2x_eggToX.obj')
  5811. TargetAdd('egg2x.exe', input='libp3xfileegg.lib')
  5812. TargetAdd('egg2x.exe', input='libp3xfile.lib')
  5813. TargetAdd('egg2x.exe', input=COMMON_EGG2X_LIBS)
  5814. TargetAdd('egg2x.exe', opts=['ADVAPI'])
  5815. TargetAdd('x2egg_xFileToEgg.obj', opts=OPTS, input='xFileToEgg.cxx')
  5816. TargetAdd('x2egg.exe', input='x2egg_xFileToEgg.obj')
  5817. TargetAdd('x2egg.exe', input='libp3xfileegg.lib')
  5818. TargetAdd('x2egg.exe', input='libp3xfile.lib')
  5819. TargetAdd('x2egg.exe', input=COMMON_EGG2X_LIBS)
  5820. TargetAdd('x2egg.exe', opts=['ADVAPI'])
  5821. #
  5822. # DIRECTORY: pandatool/src/mayaprogs/
  5823. #
  5824. for VER in MAYAVERSIONS:
  5825. VNUM = VER[4:]
  5826. if not PkgSkip(VER) and not PkgSkip("PANDATOOL") and not PkgSkip("EGG"):
  5827. if GetTarget() == 'darwin' and int(VNUM) >= 2012:
  5828. ARCH_OPTS = ['NOARCH:PPC', 'NOARCH:I386', 'NOARCH:ARM64']
  5829. if len(OSX_ARCHS) != 0 and 'x86_64' not in OSX_ARCHS:
  5830. continue
  5831. elif GetTarget() == 'darwin' and int(VNUM) >= 2009:
  5832. ARCH_OPTS = ['NOARCH:PPC', 'NOARCH:ARM64']
  5833. elif GetTarget() == 'darwin':
  5834. ARCH_OPTS = ['NOARCH:X86_64', 'NOARCH:ARM64']
  5835. else:
  5836. ARCH_OPTS = []
  5837. OPTS=['DIR:pandatool/src/mayaprogs', 'DIR:pandatool/src/maya', 'DIR:pandatool/src/mayaegg', 'DIR:pandatool/src/cvscopy', 'BUILDING:MISC', VER] + ARCH_OPTS
  5838. TargetAdd('mayaeggimport'+VNUM+'_mayaeggimport.obj', opts=OPTS, input='mayaEggImport.cxx')
  5839. TargetAdd('mayaeggimport'+VNUM+'.mll', input='mayaegg'+VNUM+'_loader.obj')
  5840. TargetAdd('mayaeggimport'+VNUM+'.mll', input='mayaeggimport'+VNUM+'_mayaeggimport.obj')
  5841. TargetAdd('mayaeggimport'+VNUM+'.mll', input='libpandaegg.dll')
  5842. TargetAdd('mayaeggimport'+VNUM+'.mll', input=COMMON_PANDA_LIBS)
  5843. #if GetTarget() == 'windows':
  5844. # TargetAdd('mayaeggimport'+VNUM+'.mll', input='libp3pystub.lib')
  5845. TargetAdd('mayaeggimport'+VNUM+'.mll', opts=['ADVAPI', VER]+ARCH_OPTS)
  5846. TargetAdd('mayaloader'+VNUM+'_config_mayaloader.obj', opts=OPTS, input='config_mayaloader.cxx')
  5847. TargetAdd('libp3mayaloader'+VNUM+'.dll', input='mayaloader'+VNUM+'_config_mayaloader.obj')
  5848. TargetAdd('libp3mayaloader'+VNUM+'.dll', input='libmayaegg'+VNUM+'.lib')
  5849. TargetAdd('libp3mayaloader'+VNUM+'.dll', input='libp3ptloader.dll')
  5850. TargetAdd('libp3mayaloader'+VNUM+'.dll', input='libmaya'+VNUM+'.lib')
  5851. TargetAdd('libp3mayaloader'+VNUM+'.dll', input='libp3fltegg.lib')
  5852. TargetAdd('libp3mayaloader'+VNUM+'.dll', input='libp3flt.lib')
  5853. TargetAdd('libp3mayaloader'+VNUM+'.dll', input='libp3lwoegg.lib')
  5854. TargetAdd('libp3mayaloader'+VNUM+'.dll', input='libp3lwo.lib')
  5855. TargetAdd('libp3mayaloader'+VNUM+'.dll', input='libp3dxfegg.lib')
  5856. TargetAdd('libp3mayaloader'+VNUM+'.dll', input='libp3dxf.lib')
  5857. TargetAdd('libp3mayaloader'+VNUM+'.dll', input='libp3objegg.lib')
  5858. TargetAdd('libp3mayaloader'+VNUM+'.dll', input='libp3vrmlegg.lib')
  5859. TargetAdd('libp3mayaloader'+VNUM+'.dll', input='libp3vrml.lib')
  5860. TargetAdd('libp3mayaloader'+VNUM+'.dll', input='libp3xfileegg.lib')
  5861. TargetAdd('libp3mayaloader'+VNUM+'.dll', input='libp3xfile.lib')
  5862. TargetAdd('libp3mayaloader'+VNUM+'.dll', input='libp3eggbase.lib')
  5863. TargetAdd('libp3mayaloader'+VNUM+'.dll', input='libp3progbase.lib')
  5864. TargetAdd('libp3mayaloader'+VNUM+'.dll', input='libp3converter.lib')
  5865. TargetAdd('libp3mayaloader'+VNUM+'.dll', input='libp3pandatoolbase.lib')
  5866. TargetAdd('libp3mayaloader'+VNUM+'.dll', input='libpandaegg.dll')
  5867. TargetAdd('libp3mayaloader'+VNUM+'.dll', input=COMMON_PANDA_LIBS)
  5868. TargetAdd('libp3mayaloader'+VNUM+'.dll', opts=['ADVAPI', VER]+ARCH_OPTS)
  5869. TargetAdd('mayapview'+VNUM+'_mayaPview.obj', opts=OPTS, input='mayaPview.cxx')
  5870. TargetAdd('libmayapview'+VNUM+'.mll', input='mayapview'+VNUM+'_mayaPview.obj')
  5871. TargetAdd('libmayapview'+VNUM+'.mll', input='libmayaegg'+VNUM+'.lib')
  5872. TargetAdd('libmayapview'+VNUM+'.mll', input='libmaya'+VNUM+'.lib')
  5873. TargetAdd('libmayapview'+VNUM+'.mll', input='libp3framework.dll')
  5874. if GetTarget() == 'windows':
  5875. TargetAdd('libmayapview'+VNUM+'.mll', input=COMMON_EGG2X_LIBS)
  5876. else:
  5877. TargetAdd('libmayapview'+VNUM+'.mll', input=COMMON_EGG2X_LIBS)
  5878. TargetAdd('libmayapview'+VNUM+'.mll', opts=['ADVAPI', VER]+ARCH_OPTS)
  5879. TargetAdd('maya2egg'+VNUM+'_mayaToEgg.obj', opts=OPTS, input='mayaToEgg.cxx')
  5880. TargetAdd('maya2egg'+VNUM+'_bin.exe', input='maya2egg'+VNUM+'_mayaToEgg.obj')
  5881. TargetAdd('maya2egg'+VNUM+'_bin.exe', input='libmayaegg'+VNUM+'.lib')
  5882. TargetAdd('maya2egg'+VNUM+'_bin.exe', input='libmaya'+VNUM+'.lib')
  5883. if GetTarget() == 'windows':
  5884. TargetAdd('maya2egg'+VNUM+'_bin.exe', input=COMMON_EGG2X_LIBS)
  5885. else:
  5886. TargetAdd('maya2egg'+VNUM+'_bin.exe', input=COMMON_EGG2X_LIBS)
  5887. TargetAdd('maya2egg'+VNUM+'_bin.exe', opts=['ADVAPI', VER]+ARCH_OPTS)
  5888. TargetAdd('egg2maya'+VNUM+'_eggToMaya.obj', opts=OPTS, input='eggToMaya.cxx')
  5889. TargetAdd('egg2maya'+VNUM+'_bin.exe', input='egg2maya'+VNUM+'_eggToMaya.obj')
  5890. TargetAdd('egg2maya'+VNUM+'_bin.exe', input='libmayaegg'+VNUM+'.lib')
  5891. TargetAdd('egg2maya'+VNUM+'_bin.exe', input='libmaya'+VNUM+'.lib')
  5892. if GetTarget() == 'windows':
  5893. TargetAdd('egg2maya'+VNUM+'_bin.exe', input=COMMON_EGG2X_LIBS)
  5894. else:
  5895. TargetAdd('egg2maya'+VNUM+'_bin.exe', input=COMMON_EGG2X_LIBS)
  5896. TargetAdd('egg2maya'+VNUM+'_bin.exe', opts=['ADVAPI', VER]+ARCH_OPTS)
  5897. TargetAdd('mayacopy'+VNUM+'_mayaCopy.obj', opts=OPTS, input='mayaCopy.cxx')
  5898. TargetAdd('mayacopy'+VNUM+'_bin.exe', input='mayacopy'+VNUM+'_mayaCopy.obj')
  5899. TargetAdd('mayacopy'+VNUM+'_bin.exe', input='libp3cvscopy.lib')
  5900. TargetAdd('mayacopy'+VNUM+'_bin.exe', input='libmaya'+VNUM+'.lib')
  5901. if GetTarget() == 'windows':
  5902. TargetAdd('mayacopy'+VNUM+'_bin.exe', input=COMMON_EGG2X_LIBS)
  5903. else:
  5904. TargetAdd('mayacopy'+VNUM+'_bin.exe', input=COMMON_EGG2X_LIBS)
  5905. TargetAdd('mayacopy'+VNUM+'_bin.exe', opts=['ADVAPI', VER]+ARCH_OPTS)
  5906. TargetAdd('mayasavepview'+VNUM+'_mayaSavePview.obj', opts=OPTS, input='mayaSavePview.cxx')
  5907. TargetAdd('libmayasavepview'+VNUM+'.mll', input='mayasavepview'+VNUM+'_mayaSavePview.obj')
  5908. TargetAdd('libmayasavepview'+VNUM+'.mll', opts=['ADVAPI', VER]+ARCH_OPTS)
  5909. TargetAdd('mayapath'+VNUM+'.obj', opts=OPTS, input='mayapath.cxx')
  5910. TargetAdd('maya2egg'+VNUM+'.exe', input='mayapath'+VNUM+'.obj')
  5911. TargetAdd('maya2egg'+VNUM+'.exe', input='libpandaexpress.dll')
  5912. TargetAdd('maya2egg'+VNUM+'.exe', input=COMMON_DTOOL_LIBS)
  5913. TargetAdd('maya2egg'+VNUM+'.exe', opts=['ADVAPI']+ARCH_OPTS)
  5914. TargetAdd('egg2maya'+VNUM+'.exe', input='mayapath'+VNUM+'.obj')
  5915. TargetAdd('egg2maya'+VNUM+'.exe', input='libpandaexpress.dll')
  5916. TargetAdd('egg2maya'+VNUM+'.exe', input=COMMON_DTOOL_LIBS)
  5917. TargetAdd('egg2maya'+VNUM+'.exe', opts=['ADVAPI']+ARCH_OPTS)
  5918. TargetAdd('mayacopy'+VNUM+'.exe', input='mayapath'+VNUM+'.obj')
  5919. TargetAdd('mayacopy'+VNUM+'.exe', input='libpandaexpress.dll')
  5920. TargetAdd('mayacopy'+VNUM+'.exe', input=COMMON_DTOOL_LIBS)
  5921. TargetAdd('mayacopy'+VNUM+'.exe', opts=['ADVAPI']+ARCH_OPTS)
  5922. #
  5923. # DIRECTORY: contrib/src/ai/
  5924. #
  5925. if (PkgSkip("CONTRIB")==0 and not RUNTIME):
  5926. OPTS=['DIR:contrib/src/ai', 'BUILDING:PANDAAI']
  5927. TargetAdd('p3ai_composite1.obj', opts=OPTS, input='p3ai_composite1.cxx')
  5928. TargetAdd('libpandaai.dll', input='p3ai_composite1.obj')
  5929. TargetAdd('libpandaai.dll', input=COMMON_PANDA_LIBS)
  5930. OPTS=['DIR:contrib/src/ai']
  5931. IGATEFILES=GetDirectoryContents('contrib/src/ai', ["*.h", "*_composite*.cxx"])
  5932. TargetAdd('libpandaai.in', opts=OPTS, input=IGATEFILES)
  5933. TargetAdd('libpandaai.in', opts=['IMOD:panda3d.ai', 'ILIB:libpandaai', 'SRCDIR:contrib/src/ai'])
  5934. PyTargetAdd('ai_module.obj', input='libpandaai.in')
  5935. PyTargetAdd('ai_module.obj', opts=OPTS)
  5936. PyTargetAdd('ai_module.obj', opts=['IMOD:panda3d.ai', 'ILIB:ai', 'IMPORT:panda3d.core'])
  5937. PyTargetAdd('ai.pyd', input='ai_module.obj')
  5938. PyTargetAdd('ai.pyd', input='libpandaai_igate.obj')
  5939. PyTargetAdd('ai.pyd', input='libpandaai.dll')
  5940. PyTargetAdd('ai.pyd', input='libp3interrogatedb.dll')
  5941. PyTargetAdd('ai.pyd', input=COMMON_PANDA_LIBS)
  5942. #
  5943. # DIRECTORY: contrib/src/rplight/
  5944. #
  5945. if not PkgSkip("CONTRIB") and not PkgSkip("PYTHON") and not RUNTIME:
  5946. OPTS=['DIR:contrib/src/rplight', 'BUILDING:RPLIGHT']
  5947. TargetAdd('p3rplight_composite1.obj', opts=OPTS, input='p3rplight_composite1.cxx')
  5948. IGATEFILES=GetDirectoryContents('contrib/src/rplight', ["*.h", "*_composite*.cxx"])
  5949. TargetAdd('libp3rplight.in', opts=OPTS, input=IGATEFILES)
  5950. TargetAdd('libp3rplight.in', opts=['IMOD:panda3d._rplight', 'ILIB:libp3rplight', 'SRCDIR:contrib/src/rplight'])
  5951. PyTargetAdd('rplight_module.obj', input='libp3rplight.in')
  5952. PyTargetAdd('rplight_module.obj', opts=OPTS)
  5953. PyTargetAdd('rplight_module.obj', opts=['IMOD:panda3d._rplight', 'ILIB:_rplight', 'IMPORT:panda3d.core'])
  5954. PyTargetAdd('_rplight.pyd', input='rplight_module.obj')
  5955. PyTargetAdd('_rplight.pyd', input='libp3rplight_igate.obj')
  5956. PyTargetAdd('_rplight.pyd', input='p3rplight_composite1.obj')
  5957. PyTargetAdd('_rplight.pyd', input='libp3interrogatedb.dll')
  5958. PyTargetAdd('_rplight.pyd', input=COMMON_PANDA_LIBS)
  5959. #
  5960. # DIRECTORY: pandatool/src/deploy-stub
  5961. #
  5962. if PkgSkip("PYTHON") == 0:
  5963. OPTS=['DIR:pandatool/src/deploy-stub', 'BUILDING:DEPLOYSTUB']
  5964. PyTargetAdd('deploy-stub.obj', opts=OPTS, input='deploy-stub.c')
  5965. if GetTarget() == 'windows':
  5966. PyTargetAdd('frozen_dllmain.obj', opts=OPTS, input='frozen_dllmain.c')
  5967. if GetTarget() == 'linux' or GetTarget() == 'freebsd':
  5968. # Setup rpath so libs can be found in the same directory as the deployed game
  5969. LibName('DEPLOYSTUB', "-Wl,-rpath,\\$ORIGIN")
  5970. LibName('DEPLOYSTUB', "-Wl,-z,origin")
  5971. LibName('DEPLOYSTUB', "-rdynamic")
  5972. PyTargetAdd('deploy-stub.exe', input='deploy-stub.obj')
  5973. if GetTarget() == 'windows':
  5974. PyTargetAdd('deploy-stub.exe', input='frozen_dllmain.obj')
  5975. PyTargetAdd('deploy-stub.exe', opts=['WINSHELL', 'DEPLOYSTUB', 'NOICON'])
  5976. if GetTarget() == 'windows':
  5977. PyTargetAdd('deploy-stubw.exe', input='deploy-stub.obj')
  5978. PyTargetAdd('deploy-stubw.exe', input='frozen_dllmain.obj')
  5979. PyTargetAdd('deploy-stubw.exe', opts=['SUBSYSTEM:WINDOWS', 'WINSHELL', 'DEPLOYSTUB', 'NOICON'])
  5980. elif GetTarget() == 'darwin':
  5981. DefSymbol('MACOS_APP_BUNDLE', 'MACOS_APP_BUNDLE')
  5982. OPTS = OPTS + ['MACOS_APP_BUNDLE']
  5983. PyTargetAdd('deploy-stubw.obj', opts=OPTS, input='deploy-stub.c')
  5984. PyTargetAdd('deploy-stubw.exe', input='deploy-stubw.obj')
  5985. PyTargetAdd('deploy-stubw.exe', opts=['MACOS_APP_BUNDLE', 'DEPLOYSTUB', 'NOICON'])
  5986. #
  5987. # Generate the models directory and samples directory
  5988. #
  5989. if not PkgSkip("DIRECT") and not RUNTIME and not PkgSkip("EGG"):
  5990. model_extensions = ["*.egg"]
  5991. # Check if we have access to an flt2egg utility, either self-compiled or on the system.
  5992. if ((PkgSkip("PANDATOOL")==0 and GetHost()==GetTarget()) or LocateBinary('flt2egg')):
  5993. model_extensions.append("*.flt")
  5994. for model in GetDirectoryContents("dmodels/src/misc", model_extensions):
  5995. if (PkgSkip("ZLIB")==0 and PkgSkip("DEPLOYTOOLS")==0 and not RTDIST):
  5996. newname = model[:-4] + ".egg.pz"
  5997. else:
  5998. newname = model[:-4] + ".egg"
  5999. TargetAdd(GetOutputDir()+"/models/misc/"+newname, input="dmodels/src/misc/"+model)
  6000. for model in GetDirectoryContents("dmodels/src/gui", model_extensions):
  6001. if (PkgSkip("ZLIB")==0 and PkgSkip("DEPLOYTOOLS")==0 and not RTDIST):
  6002. newname = model[:-4] + ".egg.pz"
  6003. else:
  6004. newname = model[:-4] + ".egg"
  6005. TargetAdd(GetOutputDir()+"/models/gui/"+newname, input="dmodels/src/gui/"+model)
  6006. for model in GetDirectoryContents("models", model_extensions):
  6007. if (PkgSkip("ZLIB")==0 and PkgSkip("DEPLOYTOOLS")==0 and not RTDIST):
  6008. newname = model[:-4] + ".egg.pz"
  6009. else:
  6010. newname = model[:-4] + ".egg"
  6011. TargetAdd(GetOutputDir()+"/models/"+newname, input="models/"+model)
  6012. if not PkgSkip("DIRECT") and not RUNTIME:
  6013. CopyAllFiles(GetOutputDir()+"/models/audio/sfx/", "dmodels/src/audio/sfx/", ".wav")
  6014. CopyAllFiles(GetOutputDir()+"/models/icons/", "dmodels/src/icons/", ".gif")
  6015. CopyAllFiles(GetOutputDir()+"/models/maps/", "models/maps/", ".jpg")
  6016. CopyAllFiles(GetOutputDir()+"/models/maps/", "models/maps/", ".png")
  6017. CopyAllFiles(GetOutputDir()+"/models/maps/", "models/maps/", ".rgb")
  6018. CopyAllFiles(GetOutputDir()+"/models/maps/", "models/maps/", ".rgba")
  6019. CopyAllFiles(GetOutputDir()+"/models/maps/", "dmodels/src/maps/", ".jpg")
  6020. CopyAllFiles(GetOutputDir()+"/models/maps/", "dmodels/src/maps/", ".png")
  6021. CopyAllFiles(GetOutputDir()+"/models/maps/", "dmodels/src/maps/", ".rgb")
  6022. CopyAllFiles(GetOutputDir()+"/models/maps/", "dmodels/src/maps/", ".rgba")
  6023. #
  6024. # Build the rtdist.
  6025. #
  6026. if (RTDIST):
  6027. OPTS=['DIR:direct/src/p3d']
  6028. TargetAdd('_panda3d', opts=OPTS, input='panda3d.pdef')
  6029. TargetAdd('_coreapi', opts=OPTS, input='coreapi.pdef')
  6030. TargetAdd('_thirdparty', opts=OPTS, input='thirdparty.pdef')
  6031. #
  6032. # If we have a host URL and distributor, we can make .p3d deployment tools.
  6033. #
  6034. if not PkgSkip("DIRECT") and not PkgSkip("DEPLOYTOOLS") and not RUNTIME and not RTDIST and HOST_URL and DISTRIBUTOR:
  6035. OPTS=['DIR:direct/src/p3d']
  6036. TargetAdd('packp3d.p3d', opts=OPTS, input='panda3d.pdef')
  6037. TargetAdd('pdeploy.p3d', opts=OPTS, input='panda3d.pdef')
  6038. TargetAdd('pmerge.p3d', opts=OPTS, input='panda3d.pdef')
  6039. TargetAdd('ppackage.p3d', opts=OPTS, input='panda3d.pdef')
  6040. TargetAdd('ppatcher.p3d', opts=OPTS, input='panda3d.pdef')
  6041. ##########################################################################################
  6042. #
  6043. # Dependency-Based Distributed Build System.
  6044. #
  6045. ##########################################################################################
  6046. DEPENDENCYQUEUE=[]
  6047. for target in TARGET_LIST:
  6048. name = target.name
  6049. inputs = target.inputs
  6050. opts = target.opts
  6051. deps = target.deps
  6052. DEPENDENCYQUEUE.append([CompileAnything, [name, inputs, opts], [name], deps, []])
  6053. def BuildWorker(taskqueue, donequeue):
  6054. while True:
  6055. try:
  6056. task = taskqueue.get(timeout=1)
  6057. except:
  6058. ProgressOutput(None, "Waiting for tasks...")
  6059. task = taskqueue.get()
  6060. sys.stdout.flush()
  6061. if (task == 0): return
  6062. try:
  6063. task[0](*task[1])
  6064. donequeue.put(task)
  6065. except:
  6066. donequeue.put(0)
  6067. def AllSourcesReady(task, pending):
  6068. sources = task[3]
  6069. for x in sources:
  6070. if (x in pending):
  6071. return 0
  6072. sources = task[1][1]
  6073. for x in sources:
  6074. if (x in pending):
  6075. return 0
  6076. altsources = task[4]
  6077. for x in altsources:
  6078. if (x in pending):
  6079. return 0
  6080. return 1
  6081. def ParallelMake(tasklist):
  6082. # Create the communication queues.
  6083. donequeue = queue.Queue()
  6084. taskqueue = queue.Queue()
  6085. # Build up a table listing all the pending targets
  6086. #task = [CompileAnything, [name, inputs, opts], [name], deps, []]
  6087. # task[2] = [name]
  6088. # task[3] = deps
  6089. # The python tool package, in particular fltegg seems to throw parallelmake off
  6090. # A hack for now is to divide the tasklist into two parts, one to be built in parallel
  6091. # and another subpart to be built sequentially. The most time consuming part of the process
  6092. # is the c++ code generation anyways.
  6093. tasklist_seq = []
  6094. i = 0
  6095. while i < len(tasklist):
  6096. if tasklist[i][2][0].endswith('.egg') | tasklist[i][2][0].endswith('.egg.pz'):
  6097. break
  6098. i += 1
  6099. if i < len(tasklist):
  6100. tasklist_seq = tasklist[i:]
  6101. tasklist = tasklist[:i]
  6102. iNumStartingTasks = len(tasklist)
  6103. pending = {}
  6104. for task in tasklist:
  6105. for target in task[2]:
  6106. pending[target] = 1
  6107. # Create the workers
  6108. for slave in range(THREADCOUNT):
  6109. th = threading.Thread(target=BuildWorker, args=[taskqueue, donequeue])
  6110. th.setDaemon(1)
  6111. th.start()
  6112. # Feed tasks to the workers.
  6113. tasksqueued = 0
  6114. while True:
  6115. if (tasksqueued < THREADCOUNT):
  6116. extras = []
  6117. for task in tasklist:
  6118. if (tasksqueued < THREADCOUNT) and (AllSourcesReady(task, pending)):
  6119. if (NeedsBuild(task[2], task[3])):
  6120. tasksqueued += 1
  6121. taskqueue.put(task)
  6122. else:
  6123. for target in task[2]:
  6124. del pending[target]
  6125. else:
  6126. extras.append(task)
  6127. tasklist = extras
  6128. sys.stdout.flush()
  6129. if (tasksqueued == 0): break
  6130. donetask = donequeue.get()
  6131. if (donetask == 0):
  6132. exit("Build process aborting.")
  6133. sys.stdout.flush()
  6134. tasksqueued -= 1
  6135. JustBuilt(donetask[2], donetask[3])
  6136. for target in donetask[2]:
  6137. del pending[target]
  6138. # Kill the workers.
  6139. for slave in range(THREADCOUNT):
  6140. taskqueue.put(0)
  6141. # Make sure there aren't any unsatisfied tasks
  6142. if len(tasklist) > 0:
  6143. exit("Dependency problems: " + str(len(tasklist)) + " tasks not finished. First task unsatisfied: "+str(tasklist[0][2]))
  6144. SequentialMake(tasklist_seq)
  6145. def SequentialMake(tasklist):
  6146. i = 0
  6147. for task in tasklist:
  6148. if (NeedsBuild(task[2], task[3])):
  6149. task[0](*task[1] + [(i * 100.0) / len(tasklist)])
  6150. JustBuilt(task[2], task[3])
  6151. i += 1
  6152. def RunDependencyQueue(tasklist):
  6153. if (THREADCOUNT!=0):
  6154. ParallelMake(tasklist)
  6155. else:
  6156. SequentialMake(tasklist)
  6157. try:
  6158. RunDependencyQueue(DEPENDENCYQUEUE)
  6159. finally:
  6160. SaveDependencyCache()
  6161. # Run the test suite.
  6162. if RUNTESTS:
  6163. cmdstr = BracketNameWithQuotes(SDK["PYTHONEXEC"].replace('\\', '/'))
  6164. if sys.version_info >= (2, 6):
  6165. cmdstr += " -B"
  6166. cmdstr += " -m pytest tests"
  6167. if GetVerbose():
  6168. cmdstr += " --verbose"
  6169. oscmd(cmdstr)
  6170. # Write out information about the Python versions in the built dir.
  6171. python_version_info = GetCurrentPythonVersionInfo()
  6172. UpdatePythonVersionInfoFile(python_version_info)
  6173. ##########################################################################################
  6174. #
  6175. # The Installers
  6176. #
  6177. # Under windows, we can build an 'exe' package using NSIS
  6178. # Under linux, we can build a 'deb' package or an 'rpm' package.
  6179. # Under OSX, we can make a 'dmg' package.
  6180. #
  6181. ##########################################################################################
  6182. if INSTALLER:
  6183. ProgressOutput(100.0, "Building installer")
  6184. from makepackage import MakeInstaller
  6185. # When using the --installer flag, only install for the current version.
  6186. python_versions = []
  6187. if python_version_info:
  6188. python_versions.append(python_version_info)
  6189. MakeInstaller(version=VERSION, outputdir=GetOutputDir(),
  6190. optimize=GetOptimize(), compressor=COMPRESSOR,
  6191. debversion=DEBVERSION, rpmrelease=RPMRELEASE,
  6192. runtime=RUNTIME, python_versions=python_versions)
  6193. if WHEEL:
  6194. ProgressOutput(100.0, "Building wheel")
  6195. from makewheel import makewheel
  6196. makewheel(WHLVERSION, GetOutputDir())
  6197. ##########################################################################################
  6198. #
  6199. # Print final status report.
  6200. #
  6201. ##########################################################################################
  6202. WARNINGS.append("Elapsed Time: "+PrettyTime(time.time() - STARTTIME))
  6203. printStatus("Makepanda Final Status Report", WARNINGS)
  6204. print(GetColor("green") + "Build successfully finished, elapsed time: " + PrettyTime(time.time() - STARTTIME) + GetColor())