makepanda.py 314 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333233423352336233723382339234023412342234323442345234623472348234923502351235223532354235523562357235823592360236123622363236423652366236723682369237023712372237323742375237623772378237923802381238223832384238523862387238823892390239123922393239423952396239723982399240024012402240324042405240624072408240924102411241224132414241524162417241824192420242124222423242424252426242724282429243024312432243324342435243624372438243924402441244224432444244524462447244824492450245124522453245424552456245724582459246024612462246324642465246624672468246924702471247224732474247524762477247824792480248124822483248424852486248724882489249024912492249324942495249624972498249925002501250225032504250525062507250825092510251125122513251425152516251725182519252025212522252325242525252625272528252925302531253225332534253525362537253825392540254125422543254425452546254725482549255025512552255325542555255625572558255925602561256225632564256525662567256825692570257125722573257425752576257725782579258025812582258325842585258625872588258925902591259225932594259525962597259825992600260126022603260426052606260726082609261026112612261326142615261626172618261926202621262226232624262526262627262826292630263126322633263426352636263726382639264026412642264326442645264626472648264926502651265226532654265526562657265826592660266126622663266426652666266726682669267026712672267326742675267626772678267926802681268226832684268526862687268826892690269126922693269426952696269726982699270027012702270327042705270627072708270927102711271227132714271527162717271827192720272127222723272427252726272727282729273027312732273327342735273627372738273927402741274227432744274527462747274827492750275127522753275427552756275727582759276027612762276327642765276627672768276927702771277227732774277527762777277827792780278127822783278427852786278727882789279027912792279327942795279627972798279928002801280228032804280528062807280828092810281128122813281428152816281728182819282028212822282328242825282628272828282928302831283228332834283528362837283828392840284128422843284428452846284728482849285028512852285328542855285628572858285928602861286228632864286528662867286828692870287128722873287428752876287728782879288028812882288328842885288628872888288928902891289228932894289528962897289828992900290129022903290429052906290729082909291029112912291329142915291629172918291929202921292229232924292529262927292829292930293129322933293429352936293729382939294029412942294329442945294629472948294929502951295229532954295529562957295829592960296129622963296429652966296729682969297029712972297329742975297629772978297929802981298229832984298529862987298829892990299129922993299429952996299729982999300030013002300330043005300630073008300930103011301230133014301530163017301830193020302130223023302430253026302730283029303030313032303330343035303630373038303930403041304230433044304530463047304830493050305130523053305430553056305730583059306030613062306330643065306630673068306930703071307230733074307530763077307830793080308130823083308430853086308730883089309030913092309330943095309630973098309931003101310231033104310531063107310831093110311131123113311431153116311731183119312031213122312331243125312631273128312931303131313231333134313531363137313831393140314131423143314431453146314731483149315031513152315331543155315631573158315931603161316231633164316531663167316831693170317131723173317431753176317731783179318031813182318331843185318631873188318931903191319231933194319531963197319831993200320132023203320432053206320732083209321032113212321332143215321632173218321932203221322232233224322532263227322832293230323132323233323432353236323732383239324032413242324332443245324632473248324932503251325232533254325532563257325832593260326132623263326432653266326732683269327032713272327332743275327632773278327932803281328232833284328532863287328832893290329132923293329432953296329732983299330033013302330333043305330633073308330933103311331233133314331533163317331833193320332133223323332433253326332733283329333033313332333333343335333633373338333933403341334233433344334533463347334833493350335133523353335433553356335733583359336033613362336333643365336633673368336933703371337233733374337533763377337833793380338133823383338433853386338733883389339033913392339333943395339633973398339934003401340234033404340534063407340834093410341134123413341434153416341734183419342034213422342334243425342634273428342934303431343234333434343534363437343834393440344134423443344434453446344734483449345034513452345334543455345634573458345934603461346234633464346534663467346834693470347134723473347434753476347734783479348034813482348334843485348634873488348934903491349234933494349534963497349834993500350135023503350435053506350735083509351035113512351335143515351635173518351935203521352235233524352535263527352835293530353135323533353435353536353735383539354035413542354335443545354635473548354935503551355235533554355535563557355835593560356135623563356435653566356735683569357035713572357335743575357635773578357935803581358235833584358535863587358835893590359135923593359435953596359735983599360036013602360336043605360636073608360936103611361236133614361536163617361836193620362136223623362436253626362736283629363036313632363336343635363636373638363936403641364236433644364536463647364836493650365136523653365436553656365736583659366036613662366336643665366636673668366936703671367236733674367536763677367836793680368136823683368436853686368736883689369036913692369336943695369636973698369937003701370237033704370537063707370837093710371137123713371437153716371737183719372037213722372337243725372637273728372937303731373237333734373537363737373837393740374137423743374437453746374737483749375037513752375337543755375637573758375937603761376237633764376537663767376837693770377137723773377437753776377737783779378037813782378337843785378637873788378937903791379237933794379537963797379837993800380138023803380438053806380738083809381038113812381338143815381638173818381938203821382238233824382538263827382838293830383138323833383438353836383738383839384038413842384338443845384638473848384938503851385238533854385538563857385838593860386138623863386438653866386738683869387038713872387338743875387638773878387938803881388238833884388538863887388838893890389138923893389438953896389738983899390039013902390339043905390639073908390939103911391239133914391539163917391839193920392139223923392439253926392739283929393039313932393339343935393639373938393939403941394239433944394539463947394839493950395139523953395439553956395739583959396039613962396339643965396639673968396939703971397239733974397539763977397839793980398139823983398439853986398739883989399039913992399339943995399639973998399940004001400240034004400540064007400840094010401140124013401440154016401740184019402040214022402340244025402640274028402940304031403240334034403540364037403840394040404140424043404440454046404740484049405040514052405340544055405640574058405940604061406240634064406540664067406840694070407140724073407440754076407740784079408040814082408340844085408640874088408940904091409240934094409540964097409840994100410141024103410441054106410741084109411041114112411341144115411641174118411941204121412241234124412541264127412841294130413141324133413441354136413741384139414041414142414341444145414641474148414941504151415241534154415541564157415841594160416141624163416441654166416741684169417041714172417341744175417641774178417941804181418241834184418541864187418841894190419141924193419441954196419741984199420042014202420342044205420642074208420942104211421242134214421542164217421842194220422142224223422442254226422742284229423042314232423342344235423642374238423942404241424242434244424542464247424842494250425142524253425442554256425742584259426042614262426342644265426642674268426942704271427242734274427542764277427842794280428142824283428442854286428742884289429042914292429342944295429642974298429943004301430243034304430543064307430843094310431143124313431443154316431743184319432043214322432343244325432643274328432943304331433243334334433543364337433843394340434143424343434443454346434743484349435043514352435343544355435643574358435943604361436243634364436543664367436843694370437143724373437443754376437743784379438043814382438343844385438643874388438943904391439243934394439543964397439843994400440144024403440444054406440744084409441044114412441344144415441644174418441944204421442244234424442544264427442844294430443144324433443444354436443744384439444044414442444344444445444644474448444944504451445244534454445544564457445844594460446144624463446444654466446744684469447044714472447344744475447644774478447944804481448244834484448544864487448844894490449144924493449444954496449744984499450045014502450345044505450645074508450945104511451245134514451545164517451845194520452145224523452445254526452745284529453045314532453345344535453645374538453945404541454245434544454545464547454845494550455145524553455445554556455745584559456045614562456345644565456645674568456945704571457245734574457545764577457845794580458145824583458445854586458745884589459045914592459345944595459645974598459946004601460246034604460546064607460846094610461146124613461446154616461746184619462046214622462346244625462646274628462946304631463246334634463546364637463846394640464146424643464446454646464746484649465046514652465346544655465646574658465946604661466246634664466546664667466846694670467146724673467446754676467746784679468046814682468346844685468646874688468946904691469246934694469546964697469846994700470147024703470447054706470747084709471047114712471347144715471647174718471947204721472247234724472547264727472847294730473147324733473447354736473747384739474047414742474347444745474647474748474947504751475247534754475547564757475847594760476147624763476447654766476747684769477047714772477347744775477647774778477947804781478247834784478547864787478847894790479147924793479447954796479747984799480048014802480348044805480648074808480948104811481248134814481548164817481848194820482148224823482448254826482748284829483048314832483348344835483648374838483948404841484248434844484548464847484848494850485148524853485448554856485748584859486048614862486348644865486648674868486948704871487248734874487548764877487848794880488148824883488448854886488748884889489048914892489348944895489648974898489949004901490249034904490549064907490849094910491149124913491449154916491749184919492049214922492349244925492649274928492949304931493249334934493549364937493849394940494149424943494449454946494749484949495049514952495349544955495649574958495949604961496249634964496549664967496849694970497149724973497449754976497749784979498049814982498349844985498649874988498949904991499249934994499549964997499849995000500150025003500450055006500750085009501050115012501350145015501650175018501950205021502250235024502550265027502850295030503150325033503450355036503750385039504050415042504350445045504650475048504950505051505250535054505550565057505850595060506150625063506450655066506750685069507050715072507350745075507650775078507950805081508250835084508550865087508850895090509150925093509450955096509750985099510051015102510351045105510651075108510951105111511251135114511551165117511851195120512151225123512451255126512751285129513051315132513351345135513651375138513951405141514251435144514551465147514851495150515151525153515451555156515751585159516051615162516351645165516651675168516951705171517251735174517551765177517851795180518151825183518451855186518751885189519051915192519351945195519651975198519952005201520252035204520552065207520852095210521152125213521452155216521752185219522052215222522352245225522652275228522952305231523252335234523552365237523852395240524152425243524452455246524752485249525052515252525352545255525652575258525952605261526252635264526552665267526852695270527152725273527452755276527752785279528052815282528352845285528652875288528952905291529252935294529552965297529852995300530153025303530453055306530753085309531053115312531353145315531653175318531953205321532253235324532553265327532853295330533153325333533453355336533753385339534053415342534353445345534653475348534953505351535253535354535553565357535853595360536153625363536453655366536753685369537053715372537353745375537653775378537953805381538253835384538553865387538853895390539153925393539453955396539753985399540054015402540354045405540654075408540954105411541254135414541554165417541854195420542154225423542454255426542754285429543054315432543354345435543654375438543954405441544254435444544554465447544854495450545154525453545454555456545754585459546054615462546354645465546654675468546954705471547254735474547554765477547854795480548154825483548454855486548754885489549054915492549354945495549654975498549955005501550255035504550555065507550855095510551155125513551455155516551755185519552055215522552355245525552655275528552955305531553255335534553555365537553855395540554155425543554455455546554755485549555055515552555355545555555655575558555955605561556255635564556555665567556855695570557155725573557455755576557755785579558055815582558355845585558655875588558955905591559255935594559555965597559855995600560156025603560456055606560756085609561056115612561356145615561656175618561956205621562256235624562556265627562856295630563156325633563456355636563756385639564056415642564356445645564656475648564956505651565256535654565556565657565856595660566156625663566456655666566756685669567056715672567356745675567656775678567956805681568256835684568556865687568856895690569156925693569456955696569756985699570057015702570357045705570657075708570957105711571257135714571557165717571857195720572157225723572457255726572757285729573057315732573357345735573657375738573957405741574257435744574557465747574857495750575157525753575457555756575757585759576057615762576357645765576657675768576957705771577257735774577557765777577857795780578157825783578457855786578757885789579057915792579357945795579657975798579958005801580258035804580558065807580858095810581158125813581458155816581758185819582058215822582358245825582658275828582958305831583258335834583558365837583858395840584158425843584458455846584758485849585058515852585358545855585658575858585958605861586258635864586558665867586858695870587158725873587458755876587758785879588058815882588358845885588658875888588958905891589258935894589558965897589858995900590159025903590459055906590759085909591059115912591359145915591659175918591959205921592259235924592559265927592859295930593159325933593459355936593759385939594059415942594359445945594659475948594959505951595259535954595559565957595859595960596159625963596459655966596759685969597059715972597359745975597659775978597959805981598259835984598559865987598859895990599159925993599459955996599759985999600060016002600360046005600660076008600960106011601260136014601560166017601860196020602160226023602460256026602760286029603060316032603360346035603660376038603960406041604260436044604560466047604860496050605160526053605460556056605760586059606060616062606360646065606660676068606960706071607260736074607560766077607860796080608160826083608460856086608760886089609060916092609360946095609660976098609961006101610261036104610561066107610861096110611161126113611461156116611761186119612061216122612361246125612661276128612961306131613261336134613561366137613861396140614161426143614461456146614761486149615061516152615361546155615661576158615961606161616261636164616561666167616861696170617161726173617461756176617761786179618061816182618361846185618661876188618961906191619261936194619561966197619861996200620162026203620462056206620762086209621062116212621362146215621662176218621962206221622262236224622562266227622862296230623162326233623462356236623762386239624062416242624362446245624662476248624962506251625262536254625562566257625862596260626162626263626462656266626762686269627062716272627362746275627662776278627962806281628262836284628562866287628862896290629162926293629462956296629762986299630063016302630363046305630663076308630963106311631263136314631563166317631863196320632163226323632463256326632763286329633063316332633363346335633663376338633963406341634263436344634563466347634863496350635163526353635463556356635763586359636063616362636363646365636663676368636963706371637263736374637563766377637863796380638163826383638463856386638763886389639063916392639363946395639663976398639964006401640264036404640564066407640864096410641164126413641464156416641764186419642064216422642364246425642664276428642964306431643264336434643564366437643864396440644164426443644464456446644764486449645064516452645364546455645664576458645964606461646264636464646564666467646864696470647164726473647464756476647764786479648064816482648364846485648664876488648964906491649264936494649564966497649864996500650165026503650465056506650765086509651065116512651365146515651665176518651965206521652265236524652565266527652865296530653165326533653465356536653765386539654065416542654365446545654665476548654965506551655265536554655565566557655865596560656165626563656465656566656765686569657065716572657365746575657665776578657965806581658265836584658565866587658865896590659165926593659465956596659765986599660066016602660366046605660666076608660966106611661266136614661566166617661866196620662166226623662466256626662766286629663066316632663366346635663666376638663966406641664266436644664566466647664866496650665166526653665466556656665766586659666066616662666366646665666666676668666966706671667266736674667566766677667866796680668166826683668466856686668766886689669066916692669366946695669666976698669967006701670267036704670567066707670867096710671167126713671467156716671767186719672067216722672367246725672667276728672967306731673267336734673567366737673867396740674167426743674467456746674767486749675067516752675367546755675667576758675967606761676267636764676567666767676867696770677167726773677467756776677767786779678067816782678367846785678667876788678967906791679267936794679567966797679867996800680168026803680468056806680768086809681068116812681368146815681668176818681968206821682268236824682568266827682868296830683168326833683468356836683768386839684068416842684368446845684668476848684968506851685268536854685568566857685868596860686168626863686468656866686768686869687068716872687368746875687668776878687968806881688268836884688568866887688868896890689168926893689468956896689768986899690069016902690369046905690669076908690969106911691269136914691569166917691869196920692169226923692469256926692769286929693069316932693369346935693669376938693969406941694269436944694569466947694869496950695169526953695469556956695769586959696069616962696369646965696669676968696969706971697269736974697569766977697869796980698169826983698469856986698769886989699069916992699369946995699669976998699970007001700270037004700570067007700870097010701170127013701470157016701770187019702070217022702370247025702670277028702970307031703270337034703570367037703870397040704170427043704470457046704770487049705070517052705370547055705670577058705970607061706270637064706570667067706870697070707170727073707470757076707770787079708070817082708370847085708670877088708970907091709270937094709570967097709870997100710171027103710471057106710771087109711071117112711371147115711671177118711971207121712271237124712571267127712871297130713171327133713471357136713771387139714071417142714371447145714671477148714971507151715271537154715571567157715871597160716171627163716471657166716771687169717071717172717371747175717671777178717971807181718271837184718571867187718871897190719171927193719471957196719771987199720072017202720372047205
  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. if (PkgSkip("JPEG")==0): LibName("JPEG", GetThirdpartyDir() + "jpeg/lib/jpeg-static.lib")
  690. if (PkgSkip("ZLIB")==0): LibName("ZLIB", GetThirdpartyDir() + "zlib/lib/zlibstatic.lib")
  691. if (PkgSkip("VRPN")==0): LibName("VRPN", GetThirdpartyDir() + "vrpn/lib/vrpn.lib")
  692. if (PkgSkip("VRPN")==0): LibName("VRPN", GetThirdpartyDir() + "vrpn/lib/quat.lib")
  693. if (PkgSkip("NVIDIACG")==0): LibName("CGGL", GetThirdpartyDir() + "nvidiacg/lib/cgGL.lib")
  694. if (PkgSkip("NVIDIACG")==0): LibName("CGDX9", GetThirdpartyDir() + "nvidiacg/lib/cgD3D9.lib")
  695. if (PkgSkip("NVIDIACG")==0): LibName("NVIDIACG", GetThirdpartyDir() + "nvidiacg/lib/cg.lib")
  696. if (PkgSkip("FREETYPE")==0): LibName("FREETYPE", GetThirdpartyDir() + "freetype/lib/freetype.lib")
  697. if (PkgSkip("HARFBUZZ")==0):
  698. LibName("HARFBUZZ", GetThirdpartyDir() + "harfbuzz/lib/harfbuzz.lib")
  699. IncDirectory("HARFBUZZ", GetThirdpartyDir() + "harfbuzz/include/harfbuzz")
  700. if (PkgSkip("FFTW")==0): LibName("FFTW", GetThirdpartyDir() + "fftw/lib/fftw3.lib")
  701. if (PkgSkip("ARTOOLKIT")==0):LibName("ARTOOLKIT",GetThirdpartyDir() + "artoolkit/lib/libAR.lib")
  702. if (PkgSkip("OPENCV")==0): LibName("OPENCV", GetThirdpartyDir() + "opencv/lib/cv.lib")
  703. if (PkgSkip("OPENCV")==0): LibName("OPENCV", GetThirdpartyDir() + "opencv/lib/highgui.lib")
  704. if (PkgSkip("OPENCV")==0): LibName("OPENCV", GetThirdpartyDir() + "opencv/lib/cvaux.lib")
  705. if (PkgSkip("OPENCV")==0): LibName("OPENCV", GetThirdpartyDir() + "opencv/lib/ml.lib")
  706. if (PkgSkip("OPENCV")==0): LibName("OPENCV", GetThirdpartyDir() + "opencv/lib/cxcore.lib")
  707. if (PkgSkip("FFMPEG")==0): LibName("FFMPEG", GetThirdpartyDir() + "ffmpeg/lib/avcodec.lib")
  708. if (PkgSkip("FFMPEG")==0): LibName("FFMPEG", GetThirdpartyDir() + "ffmpeg/lib/avformat.lib")
  709. if (PkgSkip("FFMPEG")==0): LibName("FFMPEG", GetThirdpartyDir() + "ffmpeg/lib/avutil.lib")
  710. if (PkgSkip("SWSCALE")==0): LibName("SWSCALE", GetThirdpartyDir() + "ffmpeg/lib/swscale.lib")
  711. if (PkgSkip("SWRESAMPLE")==0):LibName("SWRESAMPLE",GetThirdpartyDir() + "ffmpeg/lib/swresample.lib")
  712. if (PkgSkip("FCOLLADA")==0):
  713. LibName("FCOLLADA", GetThirdpartyDir() + "fcollada/lib/FCollada.lib")
  714. IncDirectory("FCOLLADA", GetThirdpartyDir() + "fcollada/include/FCollada")
  715. if (PkgSkip("ASSIMP")==0):
  716. LibName("ASSIMP", GetThirdpartyDir() + "assimp/lib/assimp.lib")
  717. if os.path.isfile(GetThirdpartyDir() + "assimp/lib/IrrXML.lib"):
  718. LibName("ASSIMP", GetThirdpartyDir() + "assimp/lib/IrrXML.lib")
  719. IncDirectory("ASSIMP", GetThirdpartyDir() + "assimp/include")
  720. if (PkgSkip("SQUISH")==0):
  721. if GetOptimize() <= 2:
  722. LibName("SQUISH", GetThirdpartyDir() + "squish/lib/squishd.lib")
  723. else:
  724. LibName("SQUISH", GetThirdpartyDir() + "squish/lib/squish.lib")
  725. if (PkgSkip("ROCKET")==0):
  726. LibName("ROCKET", GetThirdpartyDir() + "rocket/lib/RocketCore.lib")
  727. LibName("ROCKET", GetThirdpartyDir() + "rocket/lib/RocketControls.lib")
  728. if (PkgSkip("PYTHON")==0):
  729. LibName("ROCKET", GetThirdpartyDir() + "rocket/lib/" + SDK["PYTHONVERSION"] + "/boost_python-vc100-mt-1_54.lib")
  730. if (GetOptimize() <= 3):
  731. LibName("ROCKET", GetThirdpartyDir() + "rocket/lib/RocketDebugger.lib")
  732. if (PkgSkip("OPENAL")==0):
  733. LibName("OPENAL", GetThirdpartyDir() + "openal/lib/OpenAL32.lib")
  734. if not os.path.isfile(GetThirdpartyDir() + "openal/bin/OpenAL32.dll"):
  735. # Link OpenAL Soft statically.
  736. DefSymbol("OPENAL", "AL_LIBTYPE_STATIC")
  737. if (PkgSkip("ODE")==0):
  738. LibName("ODE", GetThirdpartyDir() + "ode/lib/ode_single.lib")
  739. DefSymbol("ODE", "dSINGLE", "")
  740. if (PkgSkip("FMODEX")==0):
  741. if (GetTargetArch() == 'x64'):
  742. LibName("FMODEX", GetThirdpartyDir() + "fmodex/lib/fmodex64_vc.lib")
  743. else:
  744. LibName("FMODEX", GetThirdpartyDir() + "fmodex/lib/fmodex_vc.lib")
  745. if (PkgSkip("FLTK")==0 and RTDIST):
  746. LibName("FLTK", GetThirdpartyDir() + "fltk/lib/fltk.lib")
  747. if not PkgSkip("FLTK"):
  748. # If we have fltk, we don't need wx
  749. PkgDisable("WX")
  750. if (PkgSkip("WX")==0 and RTDIST):
  751. LibName("WX", GetThirdpartyDir() + "wx/lib/wxbase28u.lib")
  752. LibName("WX", GetThirdpartyDir() + "wx/lib/wxmsw28u_core.lib")
  753. DefSymbol("WX", "__WXMSW__", "")
  754. DefSymbol("WX", "_UNICODE", "")
  755. DefSymbol("WX", "UNICODE", "")
  756. if (PkgSkip("VORBIS")==0):
  757. for lib in ('ogg', 'vorbis', 'vorbisfile'):
  758. path = GetThirdpartyDir() + "vorbis/lib/lib{0}_static.lib".format(lib)
  759. if not os.path.isfile(path):
  760. path = GetThirdpartyDir() + "vorbis/lib/{0}.lib".format(lib)
  761. LibName("VORBIS", path)
  762. if (PkgSkip("OPUS")==0):
  763. IncDirectory("OPUS", GetThirdpartyDir() + "opus/include/opus")
  764. for lib in ('ogg', 'opus', 'opusfile'):
  765. path = GetThirdpartyDir() + "opus/lib/lib{0}_static.lib".format(lib)
  766. if not os.path.isfile(path):
  767. path = GetThirdpartyDir() + "opus/lib/{0}.lib".format(lib)
  768. LibName("OPUS", path)
  769. for pkg in MAYAVERSIONS:
  770. if (PkgSkip(pkg)==0):
  771. LibName(pkg, '"' + SDK[pkg] + '/lib/Foundation.lib"')
  772. LibName(pkg, '"' + SDK[pkg] + '/lib/OpenMaya.lib"')
  773. LibName(pkg, '"' + SDK[pkg] + '/lib/OpenMayaAnim.lib"')
  774. LibName(pkg, '"' + SDK[pkg] + '/lib/OpenMayaUI.lib"')
  775. for pkg in MAXVERSIONS:
  776. if (PkgSkip(pkg)==0):
  777. LibName(pkg, SDK[pkg] + '/lib/core.lib')
  778. LibName(pkg, SDK[pkg] + '/lib/edmodel.lib')
  779. LibName(pkg, SDK[pkg] + '/lib/gfx.lib')
  780. LibName(pkg, SDK[pkg] + '/lib/geom.lib')
  781. LibName(pkg, SDK[pkg] + '/lib/mesh.lib')
  782. LibName(pkg, SDK[pkg] + '/lib/maxutil.lib')
  783. LibName(pkg, SDK[pkg] + '/lib/paramblk2.lib')
  784. if (PkgSkip("PHYSX")==0):
  785. if GetTargetArch() == 'x64':
  786. LibName("PHYSX", SDK["PHYSXLIBS"] + "/PhysXLoader64.lib")
  787. LibName("PHYSX", SDK["PHYSXLIBS"] + "/NxCharacter64.lib")
  788. else:
  789. LibName("PHYSX", SDK["PHYSXLIBS"] + "/PhysXLoader.lib")
  790. LibName("PHYSX", SDK["PHYSXLIBS"] + "/NxCharacter.lib")
  791. IncDirectory("PHYSX", SDK["PHYSX"] + "/Physics/include")
  792. IncDirectory("PHYSX", SDK["PHYSX"] + "/PhysXLoader/include")
  793. IncDirectory("PHYSX", SDK["PHYSX"] + "/NxCharacter/include")
  794. IncDirectory("PHYSX", SDK["PHYSX"] + "/NxExtensions/include")
  795. IncDirectory("PHYSX", SDK["PHYSX"] + "/Foundation/include")
  796. IncDirectory("PHYSX", SDK["PHYSX"] + "/Cooking/include")
  797. if (PkgSkip("SPEEDTREE")==0):
  798. if GetTargetArch() == 'x64':
  799. libdir = SDK["SPEEDTREE"] + "/Lib/Windows/VC10.x64/"
  800. p64ext = '64'
  801. else:
  802. libdir = SDK["SPEEDTREE"] + "/Lib/Windows/VC10/"
  803. p64ext = ''
  804. debugext = ''
  805. if (GetOptimize() <= 2): debugext = "_d"
  806. libsuffix = "_v%s_VC100MT%s_Static%s.lib" % (
  807. SDK["SPEEDTREEVERSION"], p64ext, debugext)
  808. LibName("SPEEDTREE", "%sSpeedTreeCore%s" % (libdir, libsuffix))
  809. LibName("SPEEDTREE", "%sSpeedTreeForest%s" % (libdir, libsuffix))
  810. LibName("SPEEDTREE", "%sSpeedTree%sRenderer%s" % (libdir, SDK["SPEEDTREEAPI"], libsuffix))
  811. LibName("SPEEDTREE", "%sSpeedTreeRenderInterface%s" % (libdir, libsuffix))
  812. if (SDK["SPEEDTREEAPI"] == "OpenGL"):
  813. LibName("SPEEDTREE", "%sglew32.lib" % (libdir))
  814. LibName("SPEEDTREE", "glu32.lib")
  815. IncDirectory("SPEEDTREE", SDK["SPEEDTREE"] + "/Include")
  816. if (PkgSkip("BULLET")==0):
  817. suffix = '.lib'
  818. if GetTargetArch() == 'x64' and os.path.isfile(GetThirdpartyDir() + "bullet/lib/BulletCollision_x64.lib"):
  819. suffix = '_x64.lib'
  820. LibName("BULLET", GetThirdpartyDir() + "bullet/lib/LinearMath" + suffix)
  821. LibName("BULLET", GetThirdpartyDir() + "bullet/lib/BulletCollision" + suffix)
  822. LibName("BULLET", GetThirdpartyDir() + "bullet/lib/BulletDynamics" + suffix)
  823. LibName("BULLET", GetThirdpartyDir() + "bullet/lib/BulletSoftBody" + suffix)
  824. if (COMPILER=="GCC"):
  825. if GetTarget() != "darwin":
  826. PkgDisable("CARBON")
  827. PkgDisable("COCOA")
  828. elif RUNTIME:
  829. # We don't support Cocoa in the runtime yet.
  830. PkgDisable("COCOA")
  831. if 'x86_64' in OSX_ARCHS or 'arm64' in OSX_ARCHS:
  832. # 64-bits macOS doesn't have Carbon.
  833. PkgDisable("CARBON")
  834. if GetTarget() == 'darwin':
  835. if OSX_ARCHS and 'x86_64' not in OSX_ARCHS and 'i386' not in OSX_ARCHS:
  836. # These support only these archs, so don't build them if we're not
  837. # targeting any of the supported archs.
  838. PkgDisable("FMODEX")
  839. PkgDisable("NVIDIACG")
  840. PkgDisable("ROCKET")
  841. elif (OSX_ARCHS and 'arm64' in OSX_ARCHS) or \
  842. (OSXTARGET and OSXTARGET >= (10, 14)) or \
  843. (not OSXTARGET and not os.path.isfile('/usr/lib/libstdc++.6.0.9.dylib')):
  844. # Also, we can't target FMOD Ex with the 10.14 SDK
  845. PkgDisable("FMODEX")
  846. #if (PkgSkip("PYTHON")==0):
  847. # IncDirectory("PYTHON", SDK["PYTHON"])
  848. if (GetHost() == "darwin"):
  849. if (PkgSkip("FREETYPE")==0 and not os.path.isdir(GetThirdpartyDir() + 'freetype')):
  850. IncDirectory("FREETYPE", "/usr/X11/include")
  851. IncDirectory("FREETYPE", "/usr/X11/include/freetype2")
  852. LibDirectory("FREETYPE", "/usr/X11/lib")
  853. if (GetHost() == "freebsd"):
  854. IncDirectory("ALWAYS", "/usr/local/include")
  855. LibDirectory("ALWAYS", "/usr/local/lib")
  856. if (os.path.isdir("/usr/PCBSD")):
  857. IncDirectory("ALWAYS", "/usr/PCBSD/local/include")
  858. LibDirectory("ALWAYS", "/usr/PCBSD/local/lib")
  859. if GetTarget() != "windows":
  860. PkgDisable("DIRECTCAM")
  861. fcollada_libs = ("FColladaD", "FColladaSD", "FColladaS")
  862. # WARNING! The order of the ffmpeg libraries matters!
  863. ffmpeg_libs = ("libavformat", "libavcodec", "libavutil")
  864. assimp_libs = ("libassimp", "libassimpd")
  865. # Name pkg-config libs, include(dir)s
  866. if (not RUNTIME):
  867. SmartPkgEnable("EIGEN", "eigen3", (), ("Eigen/Dense",), target_pkg = 'ALWAYS')
  868. SmartPkgEnable("ARTOOLKIT", "", ("AR"), "AR/ar.h")
  869. SmartPkgEnable("FCOLLADA", "", ChooseLib(fcollada_libs, "FCOLLADA"), ("FCollada", "FCollada/FCollada.h"))
  870. SmartPkgEnable("ASSIMP", "assimp", ChooseLib(assimp_libs, "ASSIMP"), "assimp/Importer.hpp")
  871. SmartPkgEnable("FFMPEG", ffmpeg_libs, ffmpeg_libs, ("libavformat/avformat.h", "libavcodec/avcodec.h", "libavutil/avutil.h"))
  872. SmartPkgEnable("SWSCALE", "libswscale", "libswscale", ("libswscale/swscale.h"), target_pkg = "FFMPEG", thirdparty_dir = "ffmpeg")
  873. SmartPkgEnable("SWRESAMPLE","libswresample", "libswresample", ("libswresample/swresample.h"), target_pkg = "FFMPEG", thirdparty_dir = "ffmpeg")
  874. SmartPkgEnable("FFTW", "", ("fftw3"), ("fftw.h"))
  875. SmartPkgEnable("FMODEX", "", ("fmodex"), ("fmodex", "fmodex/fmod.h"))
  876. SmartPkgEnable("FREETYPE", "freetype2", ("freetype"), ("freetype2", "freetype2/freetype/freetype.h"))
  877. SmartPkgEnable("HARFBUZZ", "harfbuzz", ("harfbuzz"), ("harfbuzz", "harfbuzz/hb-ft.h"))
  878. SmartPkgEnable("GL", "gl", ("GL"), ("GL/gl.h"), framework = "OpenGL")
  879. SmartPkgEnable("GLES", "glesv1_cm", ("GLESv1_CM"), ("GLES/gl.h"), framework = "OpenGLES")
  880. SmartPkgEnable("GLES2", "glesv2", ("GLESv2"), ("GLES2/gl2.h")) #framework = "OpenGLES"?
  881. SmartPkgEnable("EGL", "egl", ("EGL"), ("EGL/egl.h"))
  882. SmartPkgEnable("NVIDIACG", "", ("Cg"), "Cg/cg.h", framework = "Cg")
  883. SmartPkgEnable("ODE", "", ("ode"), "ode/ode.h", tool = "ode-config")
  884. SmartPkgEnable("OPENAL", "openal", ("openal"), "AL/al.h", framework = "OpenAL")
  885. SmartPkgEnable("SQUISH", "", ("squish"), "squish.h")
  886. SmartPkgEnable("TIFF", "libtiff-4", ("tiff"), "tiff.h")
  887. SmartPkgEnable("OPENEXR", "OpenEXR", ("IlmImf", "Imath", "Half", "Iex", "IexMath", "IlmThread"), ("OpenEXR", "OpenEXR/ImfOutputFile.h"))
  888. SmartPkgEnable("VRPN", "", ("vrpn", "quat"), ("vrpn", "quat.h", "vrpn/vrpn_Types.h"))
  889. SmartPkgEnable("BULLET", "bullet", ("BulletSoftBody", "BulletDynamics", "BulletCollision", "LinearMath"), ("bullet", "bullet/btBulletDynamicsCommon.h"))
  890. SmartPkgEnable("VORBIS", "vorbisfile",("vorbisfile", "vorbis", "ogg"), ("ogg/ogg.h", "vorbis/vorbisfile.h"))
  891. SmartPkgEnable("OPUS", "opusfile", ("opusfile", "opus", "ogg"), ("ogg/ogg.h", "opus/opusfile.h", "opus"))
  892. SmartPkgEnable("JPEG", "", ("jpeg"), "jpeglib.h")
  893. SmartPkgEnable("PNG", "libpng", ("png"), "png.h", tool = "libpng-config")
  894. # Copy freetype libraries to be specified after harfbuzz libraries as well,
  895. # because there's a circular dependency between the two libraries.
  896. if not PkgSkip("FREETYPE") and not PkgSkip("HARFBUZZ"):
  897. for (opt, name) in LIBNAMES:
  898. if opt == "FREETYPE":
  899. LibName("HARFBUZZ", name)
  900. if not PkgSkip("FFMPEG"):
  901. if GetTarget() == "darwin":
  902. if 'i386' in OSX_ARCHS or 'ppc' in OSX_ARCHS:
  903. LibName("FFMPEG", "-Wl,-read_only_relocs,suppress")
  904. LibName("FFMPEG", "-framework VideoDecodeAcceleration")
  905. elif os.path.isfile(GetThirdpartyDir() + "ffmpeg/lib/libavcodec.a"):
  906. # Needed when linking ffmpeg statically on Linux.
  907. LibName("FFMPEG", "-Wl,-Bsymbolic")
  908. # Don't export ffmpeg symbols from libp3ffmpeg when linking statically.
  909. for ffmpeg_lib in ffmpeg_libs:
  910. LibName("FFMPEG", "-Wl,--exclude-libs,%s.a" % (ffmpeg_lib))
  911. if GetTarget() != "darwin":
  912. for fcollada_lib in fcollada_libs:
  913. LibName("FCOLLADA", "-Wl,--exclude-libs,lib%s.a" % (fcollada_lib))
  914. if not PkgSkip("SWSCALE"):
  915. LibName("SWSCALE", "-Wl,--exclude-libs,libswscale.a")
  916. if not PkgSkip("SWRESAMPLE"):
  917. LibName("SWRESAMPLE", "-Wl,--exclude-libs,libswresample.a")
  918. if not PkgSkip("JPEG"):
  919. LibName("JPEG", "-Wl,--exclude-libs,libjpeg.a")
  920. if not PkgSkip("TIFF"):
  921. LibName("TIFF", "-Wl,--exclude-libs,libtiff.a")
  922. if not PkgSkip("PNG"):
  923. LibName("PNG", "-Wl,--exclude-libs,libpng.a")
  924. LibName("PNG", "-Wl,--exclude-libs,libpng16.a")
  925. if not PkgSkip("SQUISH"):
  926. LibName("SQUISH", "-Wl,--exclude-libs,libsquish.a")
  927. if not PkgSkip("OPENEXR"):
  928. LibName("OPENEXR", "-Wl,--exclude-libs,libHalf.a")
  929. LibName("OPENEXR", "-Wl,--exclude-libs,libIex.a")
  930. LibName("OPENEXR", "-Wl,--exclude-libs,libIexMath.a")
  931. LibName("OPENEXR", "-Wl,--exclude-libs,libIlmImf.a")
  932. LibName("OPENEXR", "-Wl,--exclude-libs,libIlmImfUtil.a")
  933. LibName("OPENEXR", "-Wl,--exclude-libs,libIlmThread.a")
  934. LibName("OPENEXR", "-Wl,--exclude-libs,libImath.a")
  935. if not PkgSkip("VORBIS"):
  936. LibName("VORBIS", "-Wl,--exclude-libs,libogg.a")
  937. LibName("VORBIS", "-Wl,--exclude-libs,libvorbis.a")
  938. LibName("VORBIS", "-Wl,--exclude-libs,libvorbisenc.a")
  939. LibName("VORBIS", "-Wl,--exclude-libs,libvorbisfile.a")
  940. if not PkgSkip("OPUS"):
  941. LibName("OPUS", "-Wl,--exclude-libs,libogg.a")
  942. LibName("OPUS", "-Wl,--exclude-libs,libopus.a")
  943. LibName("OPUS", "-Wl,--exclude-libs,libopusfile.a")
  944. if not PkgSkip("VRPN"):
  945. LibName("VRPN", "-Wl,--exclude-libs,libvrpn.a")
  946. LibName("VRPN", "-Wl,--exclude-libs,libquat.a")
  947. if not PkgSkip("ARTOOLKIT"):
  948. LibName("ARTOOLKIT", "-Wl,--exclude-libs,libAR.a")
  949. LibName("ARTOOLKIT", "-Wl,--exclude-libs,libARMulti.a")
  950. if PkgSkip("FFMPEG") or GetTarget() == "darwin":
  951. cv_lib = ChooseLib(("opencv_core", "cv"), "OPENCV")
  952. if cv_lib == "opencv_core":
  953. OPENCV_VER_23 = True
  954. SmartPkgEnable("OPENCV", "opencv", ("opencv_core", "opencv_highgui"), ("opencv2/core/core.hpp"))
  955. else:
  956. SmartPkgEnable("OPENCV", "opencv", ("cv", "highgui", "cvaux", "ml", "cxcore"),
  957. ("opencv", "opencv/cv.h", "opencv/cxcore.h", "opencv/highgui.h"))
  958. else:
  959. PkgDisable("OPENCV")
  960. if not PkgSkip("OPENAL"):
  961. if GetTarget() == "darwin":
  962. LibName("OPENAL", "-framework AudioUnit")
  963. LibName("OPENAL", "-framework AudioToolbox")
  964. LibName("OPENAL", "-framework CoreAudio")
  965. else:
  966. LibName("OPENAL", "-Wl,--exclude-libs,libopenal.a")
  967. if not PkgSkip("ASSIMP") and \
  968. os.path.isfile(GetThirdpartyDir() + "assimp/lib/libassimp.a"):
  969. # Also pick up IrrXML, which is needed when linking statically.
  970. irrxml = GetThirdpartyDir() + "assimp/lib/libIrrXML.a"
  971. if os.path.isfile(irrxml):
  972. LibName("ASSIMP", irrxml)
  973. if GetTarget() != "darwin":
  974. LibName("ASSIMP", "-Wl,--exclude-libs,libassimp.a")
  975. LibName("ASSIMP", "-Wl,--exclude-libs,libIrrXML.a")
  976. rocket_libs = ("RocketCore", "RocketControls")
  977. if (GetOptimize() <= 3):
  978. rocket_libs += ("RocketDebugger",)
  979. rocket_libs += ("boost_python",)
  980. SmartPkgEnable("ROCKET", "", rocket_libs, "Rocket/Core.h")
  981. if not PkgSkip("PYTHON"):
  982. python_lib = SDK["PYTHONVERSION"]
  983. SmartPkgEnable("PYTHON", "", python_lib, (SDK["PYTHONVERSION"], SDK["PYTHONVERSION"] + "/Python.h"))
  984. if GetTarget() == "linux":
  985. LibName("PYTHON", "-lutil")
  986. LibName("PYTHON", "-lrt")
  987. SmartPkgEnable("OPENSSL", "openssl", ("ssl", "crypto"), ("openssl/ssl.h", "openssl/crypto.h"))
  988. SmartPkgEnable("ZLIB", "zlib", ("z"), "zlib.h")
  989. SmartPkgEnable("GTK2", "gtk+-2.0")
  990. if not PkgSkip("OPENSSL") and GetTarget() != "darwin":
  991. LibName("OPENSSL", "-Wl,--exclude-libs,libssl.a")
  992. LibName("OPENSSL", "-Wl,--exclude-libs,libcrypto.a")
  993. if (RTDIST):
  994. SmartPkgEnable("WX", tool = "wx-config")
  995. SmartPkgEnable("FLTK", "", ("fltk"), ("FL/Fl.H"), tool = "fltk-config")
  996. if GetTarget() != 'darwin':
  997. # CgGL is covered by the Cg framework, and we don't need X11 components on OSX
  998. if not PkgSkip("NVIDIACG") and not RUNTIME:
  999. SmartPkgEnable("CGGL", "", ("CgGL"), "Cg/cgGL.h", thirdparty_dir = "nvidiacg")
  1000. if not RUNTIME and GetTarget() != "android":
  1001. SmartPkgEnable("X11", "x11", "X11", ("X11", "X11/Xlib.h", "X11/XKBlib.h"))
  1002. if GetHost() != "darwin":
  1003. # Workaround for an issue where pkg-config does not include this path
  1004. if GetTargetArch() in ("x86_64", "amd64"):
  1005. if (os.path.isdir("/usr/lib64/glib-2.0/include")):
  1006. IncDirectory("GTK2", "/usr/lib64/glib-2.0/include")
  1007. if (os.path.isdir("/usr/lib64/gtk-2.0/include")):
  1008. IncDirectory("GTK2", "/usr/lib64/gtk-2.0/include")
  1009. if not PkgSkip("X11"):
  1010. if (os.path.isdir("/usr/X11R6/lib64")):
  1011. LibDirectory("ALWAYS", "/usr/X11R6/lib64")
  1012. else:
  1013. LibDirectory("ALWAYS", "/usr/X11R6/lib")
  1014. elif not PkgSkip("X11"):
  1015. LibDirectory("ALWAYS", "/usr/X11R6/lib")
  1016. if RUNTIME:
  1017. # For the runtime, these packages are required
  1018. for pkg in ["OPENSSL", "ZLIB"]:
  1019. skips = []
  1020. if (pkg in PkgListGet() and PkgSkip(pkg)==1):
  1021. skips.append(pkg)
  1022. if skips:
  1023. exit("Runtime must be compiled with OpenSSL and ZLib support (missing %s)" % (', '.join(skips)))
  1024. for pkg in MAYAVERSIONS:
  1025. if (PkgSkip(pkg)==0 and (pkg in SDK)):
  1026. if (GetHost() == "darwin"):
  1027. # Sheesh, Autodesk really can't make up their mind
  1028. # regarding the location of the Maya devkit on macOS.
  1029. if (os.path.isdir(SDK[pkg] + "/Maya.app/Contents/lib")):
  1030. LibDirectory(pkg, SDK[pkg] + "/Maya.app/Contents/lib")
  1031. if (os.path.isdir(SDK[pkg] + "/Maya.app/Contents/MacOS")):
  1032. LibDirectory(pkg, SDK[pkg] + "/Maya.app/Contents/MacOS")
  1033. if (os.path.isdir(SDK[pkg] + "/lib")):
  1034. LibDirectory(pkg, SDK[pkg] + "/lib")
  1035. if (os.path.isdir(SDK[pkg] + "/Maya.app/Contents/include/maya")):
  1036. IncDirectory(pkg, SDK[pkg] + "/Maya.app/Contents/include")
  1037. if (os.path.isdir(SDK[pkg] + "/devkit/include/maya")):
  1038. IncDirectory(pkg, SDK[pkg] + "/devkit/include")
  1039. if (os.path.isdir(SDK[pkg] + "/include/maya")):
  1040. IncDirectory(pkg, SDK[pkg] + "/include")
  1041. else:
  1042. LibDirectory(pkg, SDK[pkg] + "/lib")
  1043. IncDirectory(pkg, SDK[pkg] + "/include")
  1044. DefSymbol(pkg, "MAYAVERSION", pkg)
  1045. if GetTarget() == 'darwin':
  1046. LibName("ALWAYS", "-framework AppKit")
  1047. LibName("AGL", "-framework AGL")
  1048. LibName("CARBON", "-framework Carbon")
  1049. LibName("COCOA", "-framework Cocoa")
  1050. # Fix for a bug in OSX Leopard:
  1051. LibName("GL", "-dylib_file /System/Library/Frameworks/OpenGL.framework/Versions/A/Libraries/libGL.dylib:/System/Library/Frameworks/OpenGL.framework/Versions/A/Libraries/libGL.dylib")
  1052. if GetTarget() == 'android':
  1053. LibName("ALWAYS", '-llog')
  1054. LibName("ANDROID", '-landroid')
  1055. LibName("JNIGRAPHICS", '-ljnigraphics')
  1056. for pkg in MAYAVERSIONS:
  1057. if (PkgSkip(pkg)==0 and (pkg in SDK)):
  1058. if GetTarget() == 'darwin':
  1059. LibName(pkg, "-Wl,-rpath,/Applications/Autodesk/" + pkg.lower() + "/Maya.app/Contents/MacOS")
  1060. else:
  1061. LibName(pkg, "-Wl,-rpath," + SDK[pkg] + "/lib")
  1062. LibName(pkg, "-lOpenMaya")
  1063. LibName(pkg, "-lOpenMayaAnim")
  1064. LibName(pkg, "-lOpenMayaUI")
  1065. LibName(pkg, "-lAnimSlice")
  1066. LibName(pkg, "-lDeformSlice")
  1067. LibName(pkg, "-lModifiers")
  1068. LibName(pkg, "-lDynSlice")
  1069. LibName(pkg, "-lKinSlice")
  1070. LibName(pkg, "-lModelSlice")
  1071. LibName(pkg, "-lNurbsSlice")
  1072. LibName(pkg, "-lPolySlice")
  1073. LibName(pkg, "-lProjectSlice")
  1074. LibName(pkg, "-lImage")
  1075. LibName(pkg, "-lShared")
  1076. LibName(pkg, "-lTranslators")
  1077. LibName(pkg, "-lDataModel")
  1078. LibName(pkg, "-lRenderModel")
  1079. LibName(pkg, "-lNurbsEngine")
  1080. LibName(pkg, "-lDependEngine")
  1081. LibName(pkg, "-lCommandEngine")
  1082. LibName(pkg, "-lFoundation")
  1083. if pkg != "MAYA2020":
  1084. LibName(pkg, "-lIMFbase")
  1085. if GetTarget() != 'darwin':
  1086. LibName(pkg, "-lOpenMayalib")
  1087. else:
  1088. LibName(pkg, "-dylib_file /System/Library/Frameworks/OpenGL.framework/Versions/A/Libraries/libGL.dylib:/System/Library/Frameworks/OpenGL.framework/Versions/A/Libraries/libGL.dylib")
  1089. if (PkgSkip("PHYSX")==0):
  1090. IncDirectory("PHYSX", SDK["PHYSX"] + "/Physics/include")
  1091. IncDirectory("PHYSX", SDK["PHYSX"] + "/PhysXLoader/include")
  1092. IncDirectory("PHYSX", SDK["PHYSX"] + "/NxCharacter/include")
  1093. IncDirectory("PHYSX", SDK["PHYSX"] + "/NxExtensions/include")
  1094. IncDirectory("PHYSX", SDK["PHYSX"] + "/Foundation/include")
  1095. IncDirectory("PHYSX", SDK["PHYSX"] + "/Cooking/include")
  1096. LibDirectory("PHYSX", SDK["PHYSXLIBS"])
  1097. if (GetHost() == "darwin"):
  1098. LibName("PHYSX", SDK["PHYSXLIBS"] + "/osxstatic/PhysXCooking.a")
  1099. LibName("PHYSX", SDK["PHYSXLIBS"] + "/osxstatic/PhysXCore.a")
  1100. else:
  1101. LibName("PHYSX", "-lPhysXLoader")
  1102. LibName("PHYSX", "-lNxCharacter")
  1103. DefSymbol("WITHINPANDA", "WITHIN_PANDA", "1")
  1104. if GetLinkAllStatic():
  1105. DefSymbol("ALWAYS", "LINK_ALL_STATIC")
  1106. if GetTarget() == 'android':
  1107. DefSymbol("ALWAYS", "ANDROID")
  1108. if not PkgSkip("EIGEN"):
  1109. if GetOptimize() >= 3:
  1110. if COMPILER == "MSVC":
  1111. # Squeeze out a bit more performance on MSVC builds...
  1112. # Only do this if EIGEN_NO_DEBUG is also set, otherwise it
  1113. # will turn them into runtime assertions.
  1114. DefSymbol("ALWAYS", "EIGEN_NO_STATIC_ASSERT")
  1115. if not PkgSkip("EGL"):
  1116. DefSymbol('EGL', 'HAVE_EGL', '')
  1117. if PkgSkip("X11"):
  1118. DefSymbol('EGL', 'EGL_NO_X11', '')
  1119. if not PkgSkip("X11"):
  1120. DefSymbol('X11', 'USE_X11', '')
  1121. ########################################################################
  1122. ##
  1123. ## Give a Status Report on Command-Line Options
  1124. ##
  1125. ########################################################################
  1126. def printStatus(header,warnings):
  1127. if GetVerbose():
  1128. print("")
  1129. print("-------------------------------------------------------------------")
  1130. print(header)
  1131. tkeep = ""
  1132. tomit = ""
  1133. for x in PkgListGet():
  1134. if PkgSkip(x):
  1135. tomit = tomit + x + " "
  1136. else:
  1137. tkeep = tkeep + x + " "
  1138. if RTDIST:
  1139. print("Makepanda: Runtime distribution build")
  1140. elif RUNTIME:
  1141. print("Makepanda: Runtime build")
  1142. else:
  1143. print("Makepanda: Regular build")
  1144. print("Makepanda: Compiler: %s" % (COMPILER))
  1145. print("Makepanda: Optimize: %d" % (GetOptimize()))
  1146. print("Makepanda: Keep Pkg: %s" % (tkeep))
  1147. print("Makepanda: Omit Pkg: %s" % (tomit))
  1148. if GENMAN:
  1149. print("Makepanda: Generate API reference manual")
  1150. else:
  1151. print("Makepanda: Don't generate API reference manual")
  1152. if GetHost() == "windows" and not RTDIST:
  1153. if INSTALLER:
  1154. print("Makepanda: Build installer, using %s" % (COMPRESSOR))
  1155. else:
  1156. print("Makepanda: Don't build installer")
  1157. print("Makepanda: Version ID: %s" % (VERSION))
  1158. for x in warnings:
  1159. print("Makepanda: %s" % (x))
  1160. print("-------------------------------------------------------------------")
  1161. print("")
  1162. sys.stdout.flush()
  1163. ########################################################################
  1164. ##
  1165. ## BracketNameWithQuotes
  1166. ##
  1167. ########################################################################
  1168. def BracketNameWithQuotes(name):
  1169. # Workaround for OSX bug - compiler doesn't like those flags quoted.
  1170. if (name.startswith("-framework")): return name
  1171. if (name.startswith("-dylib_file")): return name
  1172. # Don't add quotes when it's not necessary.
  1173. if " " not in name: return name
  1174. # Account for quoted name (leave as is) but quote everything else (e.g., to protect spaces within paths from improper parsing)
  1175. if (name.startswith('"') and name.endswith('"')): return name
  1176. else: return '"' + name + '"'
  1177. ########################################################################
  1178. ##
  1179. ## CompileCxx
  1180. ##
  1181. ########################################################################
  1182. def CompileCxx(obj,src,opts):
  1183. ipath = GetListOption(opts, "DIR:")
  1184. optlevel = GetOptimizeOption(opts)
  1185. if (COMPILER=="MSVC"):
  1186. if not BOOUSEINTELCOMPILER:
  1187. cmd = "cl "
  1188. if GetTargetArch() == 'x64':
  1189. cmd += "/favor:blend "
  1190. cmd += "/wd4996 /wd4275 /wd4273 "
  1191. # We still target Windows XP.
  1192. cmd += "/DWINVER=0x501 "
  1193. # Work around a WinXP/2003 bug when using VS 2015+.
  1194. if SDK.get("VISUALSTUDIO_VERSION") >= (14,0):
  1195. cmd += "/Zc:threadSafeInit- "
  1196. cmd += "/Fo" + obj + " /nologo /c"
  1197. if GetTargetArch() == 'x86':
  1198. # x86 (32 bit) MSVC 2015+ defaults to /arch:SSE2
  1199. if not PkgSkip("SSE2") or 'SSE2' in opts: # x86 with SSE2
  1200. cmd += " /arch:SSE2" # let's still be explicit and pass in /arch:SSE2
  1201. else: # x86 without SSE2
  1202. cmd += " /arch:IA32"
  1203. for x in ipath: cmd += " /I" + x
  1204. for (opt,dir) in INCDIRECTORIES:
  1205. if (opt=="ALWAYS") or (opt in opts): cmd += " /I" + BracketNameWithQuotes(dir)
  1206. for (opt,var,val) in DEFSYMBOLS:
  1207. if (opt=="ALWAYS") or (opt in opts): cmd += " /D" + var + "=" + val
  1208. if (opts.count('MSFORSCOPE')): cmd += ' /Zc:forScope-'
  1209. if (optlevel==1): cmd += " /MDd /Zi /RTCs /GS"
  1210. if (optlevel==2): cmd += " /MDd /Zi"
  1211. if (optlevel==3): cmd += " /MD /Zi /GS- /O2 /Ob2 /Oi /Ot /fp:fast"
  1212. if (optlevel==4):
  1213. cmd += " /MD /Zi /GS- /Ox /Ob2 /Oi /Ot /fp:fast /DFORCE_INLINING /DNDEBUG /GL"
  1214. cmd += " /Oy /Zp16" # jean-claude add /Zp16 insures correct static alignment for SSEx
  1215. cmd += " /Fd" + os.path.splitext(obj)[0] + ".pdb"
  1216. building = GetValueOption(opts, "BUILDING:")
  1217. if (building):
  1218. cmd += " /DBUILDING_" + building
  1219. if ("BIGOBJ" in opts) or GetTargetArch() == 'x64':
  1220. cmd += " /bigobj"
  1221. cmd += " /Zm300 /DWIN32_VC /DWIN32"
  1222. if 'EXCEPTIONS' in opts:
  1223. cmd += " /EHsc"
  1224. else:
  1225. cmd += " /D_HAS_EXCEPTIONS=0"
  1226. if 'RTTI' not in opts:
  1227. cmd += " /GR-"
  1228. if GetTargetArch() == 'x64':
  1229. cmd += " /DWIN64_VC /DWIN64"
  1230. if WINDOWS_SDK.startswith('7.') and MSVC_VERSION > (10,):
  1231. # To preserve Windows XP compatibility.
  1232. cmd += " /D_USING_V110_SDK71_"
  1233. cmd += " /W3 " + BracketNameWithQuotes(src)
  1234. oscmd(cmd)
  1235. else:
  1236. cmd = "icl "
  1237. if GetTargetArch() == 'x64':
  1238. cmd += "/favor:blend "
  1239. cmd += "/wd4996 /wd4275 /wd4267 /wd4101 /wd4273 "
  1240. cmd += "/DWINVER=0x501 "
  1241. cmd += "/Fo" + obj + " /c"
  1242. for x in ipath: cmd += " /I" + x
  1243. for (opt,dir) in INCDIRECTORIES:
  1244. if (opt=="ALWAYS") or (opt in opts): cmd += " /I" + BracketNameWithQuotes(dir)
  1245. for (opt,var,val) in DEFSYMBOLS:
  1246. if (opt=="ALWAYS") or (opt in opts): cmd += " /D" + var + "=" + val
  1247. if (opts.count('MSFORSCOPE')): cmd += ' /Zc:forScope-'
  1248. if (optlevel==1): cmd += " /MDd /Zi /RTCs /GS"
  1249. if (optlevel==2): cmd += " /MDd /Zi /arch:SSE3"
  1250. # core changes from jean-claude (dec 2011)
  1251. # ----------------------------------------
  1252. # performance will be seeked at level 3 & 4
  1253. # -----------------------------------------
  1254. if (optlevel==3):
  1255. cmd += " /MD /Zi /O2 /Oi /Ot /arch:SSE3"
  1256. cmd += " /Ob0"
  1257. cmd += " /Qipo-" # beware of IPO !!!
  1258. ## Lesson learned: Don't use /GL flag -> end result is MESSY
  1259. ## ----------------------------------------------------------------
  1260. if (optlevel==4):
  1261. cmd += " /MD /Zi /O3 /Oi /Ot /Ob0 /Yc /DNDEBUG" # /Ob0 a ete rajoute en cours de route a 47%
  1262. cmd += " /Qipo" # optimization multi file
  1263. # for 3 & 4 optimization levels
  1264. # -----------------------------
  1265. if (optlevel>=3):
  1266. cmd += " /fp:fast=2"
  1267. cmd += " /Qftz"
  1268. cmd += " /Qfp-speculation:fast"
  1269. cmd += " /Qopt-matmul" # needs /O2 or /O3
  1270. cmd += " /Qprec-div-"
  1271. cmd += " /Qsimd"
  1272. cmd += " /QxHost" # compile for target host; Compiling for distribs should probably strictly enforce /arch:..
  1273. cmd += " /Quse-intel-optimized-headers" # use intel optimized headers
  1274. cmd += " /Qparallel" # enable parallelization
  1275. cmd += " /Qvc10" # for Microsoft Visual C++ 2010
  1276. ## PCH files coexistence: the /Qpchi option causes the Intel C++ Compiler to name its
  1277. ## PCH files with a .pchi filename suffix and reduce build time.
  1278. ## The /Qpchi option is on by default but interferes with Microsoft libs; so use /Qpchi- to turn it off.
  1279. ## I need to have a deeper look at this since the compile time is quite influenced by this setting !!!
  1280. cmd += " /Qpchi-" # keep it this way!
  1281. ## Inlining seems to be an issue here ! (the linker doesn't find necessary info later on)
  1282. ## ------------------------------------
  1283. ## so don't use cmd += " /DFORCE_INLINING" (need to check why with Panda developpers!)
  1284. ## Inline expansion /Ob1 : Allow functions marked inline to be inlined.
  1285. ## Inline any /Ob2 : Inline functions deemed appropriate by compiler.
  1286. ## Ctor displacement /vd0 : Disable constructor displacement.
  1287. ## Choose this option only if no class constructors or destructors call virtual functions.
  1288. ## Use /vd1 (default) to enable. Alternate: #pragma vtordisp
  1289. ## Best case ptrs /vmb : Use best case "pointer to class member" representation.
  1290. ## Use this option if you always define a class before you declare a pointer to a member of the class.
  1291. ## The compiler will issue an error if it encounters a pointer declaration before the class is defined.
  1292. ## Alternate: #pragma pointers_to_members
  1293. cmd += " /Fd" + os.path.splitext(obj)[0] + ".pdb"
  1294. building = GetValueOption(opts, "BUILDING:")
  1295. if (building): cmd += " /DBUILDING_" + building
  1296. if ("BIGOBJ" in opts) or GetTargetArch() == 'x64':
  1297. cmd += " /bigobj"
  1298. # level of warnings and optimization reports
  1299. if GetVerbose():
  1300. cmd += " /W3 " # or /W4 or /Wall
  1301. cmd += " /Qopt-report:2 /Qopt-report-phase:hlo /Qopt-report-phase:hpo" # some optimization reports
  1302. else:
  1303. cmd += " /W1 "
  1304. cmd += " /EHa /Zm300 /DWIN32_VC /DWIN32"
  1305. if GetTargetArch() == 'x64':
  1306. cmd += " /DWIN64_VC /DWIN64"
  1307. cmd += " " + BracketNameWithQuotes(src)
  1308. oscmd(cmd)
  1309. if (COMPILER=="GCC"):
  1310. if (src.endswith(".c")): cmd = GetCC() +' -fPIC -c -o ' + obj
  1311. else: cmd = GetCXX()+' -std=gnu++11 -ftemplate-depth-70 -fPIC -c -o ' + obj
  1312. for (opt, dir) in INCDIRECTORIES:
  1313. if (opt=="ALWAYS") or (opt in opts): cmd += ' -I' + BracketNameWithQuotes(dir)
  1314. for (opt, dir) in FRAMEWORKDIRECTORIES:
  1315. if (opt=="ALWAYS") or (opt in opts): cmd += ' -F' + BracketNameWithQuotes(dir)
  1316. for (opt,var,val) in DEFSYMBOLS:
  1317. if (opt=="ALWAYS") or (opt in opts): cmd += ' -D' + var + '=' + val
  1318. for x in ipath: cmd += ' -I' + x
  1319. if not GetLinkAllStatic() and 'NOHIDDEN' not in opts:
  1320. cmd += ' -fvisibility=hidden'
  1321. # Mac-specific flags.
  1322. if GetTarget() == "darwin":
  1323. cmd += " -Wno-deprecated-declarations"
  1324. if OSXTARGET is not None:
  1325. cmd += " -isysroot " + SDK["MACOSX"]
  1326. cmd += " -mmacosx-version-min=%d.%d" % (OSXTARGET)
  1327. elif platform.mac_ver()[0].startswith('11.'):
  1328. cmd += " -mmacosx-version-min=11.0"
  1329. for arch in OSX_ARCHS:
  1330. if 'NOARCH:' + arch.upper() not in opts:
  1331. cmd += " -arch %s" % arch
  1332. if "SYSROOT" in SDK:
  1333. if GetTarget() != "android":
  1334. cmd += ' --sysroot=%s' % (SDK["SYSROOT"])
  1335. else:
  1336. ndk_dir = SDK["ANDROID_NDK"].replace('\\', '/')
  1337. cmd += ' -isystem %s/sysroot/usr/include' % (ndk_dir)
  1338. cmd += ' -isystem %s/sysroot/usr/include/%s' % (ndk_dir, SDK["ANDROID_TRIPLE"])
  1339. cmd += ' -no-canonical-prefixes'
  1340. # Android-specific flags.
  1341. arch = GetTargetArch()
  1342. if GetTarget() == "android":
  1343. # Most of the specific optimization flags here were
  1344. # just copied from the default Android Makefiles.
  1345. if "ANDROID_API" in SDK:
  1346. cmd += ' -D__ANDROID_API__=' + str(SDK["ANDROID_API"])
  1347. if "ANDROID_GCC_TOOLCHAIN" in SDK:
  1348. cmd += ' -gcc-toolchain ' + SDK["ANDROID_GCC_TOOLCHAIN"].replace('\\', '/')
  1349. cmd += ' -ffunction-sections -funwind-tables'
  1350. if arch == 'armv7a':
  1351. cmd += ' -target armv7-none-linux-androideabi'
  1352. cmd += ' -march=armv7-a -mfloat-abi=softfp -mfpu=vfpv3-d16'
  1353. cmd += ' -fno-integrated-as'
  1354. elif arch == 'arm':
  1355. cmd += ' -target armv5te-none-linux-androideabi'
  1356. cmd += ' -march=armv5te -mtune=xscale -msoft-float'
  1357. cmd += ' -fno-integrated-as'
  1358. elif arch == 'aarch64':
  1359. cmd += ' -target aarch64-none-linux-android'
  1360. elif arch == 'mips':
  1361. cmd += ' -target mipsel-none-linux-android'
  1362. cmd += ' -mips32'
  1363. elif arch == 'mips64':
  1364. cmd += ' -target mips64el-none-linux-android'
  1365. cmd += ' -fintegrated-as'
  1366. elif arch == 'x86':
  1367. cmd += ' -target i686-none-linux-android'
  1368. cmd += ' -march=i686 -mtune=intel -mssse3 -mfpmath=sse -m32'
  1369. cmd += ' -mstackrealign'
  1370. elif arch == 'x86_64':
  1371. cmd += ' -target x86_64-none-linux-android'
  1372. cmd += ' -march=x86-64 -msse4.2 -mpopcnt -m64 -mtune=intel'
  1373. cmd += " -Wa,--noexecstack"
  1374. # Do we want thumb or arm instructions?
  1375. if arch.startswith('arm'):
  1376. if optlevel >= 3:
  1377. cmd += ' -mthumb'
  1378. else:
  1379. cmd += ' -marm'
  1380. # Enable SIMD instructions if requested
  1381. if arch.startswith('arm') and PkgSkip("NEON") == 0:
  1382. cmd += ' -mfpu=neon'
  1383. else:
  1384. cmd += " -pthread"
  1385. if not src.endswith(".c"):
  1386. # We don't use exceptions for most modules.
  1387. if 'EXCEPTIONS' in opts:
  1388. cmd += " -fexceptions"
  1389. else:
  1390. cmd += " -fno-exceptions"
  1391. if src.endswith(".mm"):
  1392. # Work around Apple compiler bug.
  1393. cmd += " -U__EXCEPTIONS"
  1394. target = GetTarget()
  1395. if 'RTTI' not in opts and target != "darwin":
  1396. # We always disable RTTI on Android for memory usage reasons.
  1397. if optlevel >= 4 or target == "android":
  1398. cmd += " -fno-rtti"
  1399. if ('SSE2' in opts or not PkgSkip("SSE2")) and not arch.startswith("arm") and arch != 'aarch64':
  1400. cmd += " -msse2"
  1401. # Needed by both Python, Panda, Eigen, all of which break aliasing rules.
  1402. cmd += " -fno-strict-aliasing"
  1403. if optlevel >= 3:
  1404. cmd += " -ffast-math -fno-stack-protector"
  1405. if optlevel == 3:
  1406. # Fast math is nice, but we'd like to see NaN in dev builds.
  1407. cmd += " -fno-finite-math-only"
  1408. # Make sure this is off to avoid GCC/Eigen bug (see GitHub #228)
  1409. cmd += " -fno-unsafe-math-optimizations"
  1410. if (optlevel==1): cmd += " -ggdb -D_DEBUG"
  1411. if (optlevel==2): cmd += " -O1 -D_DEBUG"
  1412. if (optlevel==3): cmd += " -O2"
  1413. if (optlevel==4): cmd += " -O3 -DNDEBUG"
  1414. # Enable more warnings.
  1415. cmd += " -Wall -Wno-unused-function"
  1416. if not src.endswith(".c"):
  1417. cmd += " -Wno-reorder"
  1418. # Ignore unused variables in NDEBUG builds, often used in asserts.
  1419. if optlevel == 4:
  1420. cmd += " -Wno-unused-variable"
  1421. if src.endswith(".c"):
  1422. cmd += ' ' + CFLAGS
  1423. else:
  1424. cmd += ' ' + CXXFLAGS
  1425. cmd = cmd.rstrip()
  1426. building = GetValueOption(opts, "BUILDING:")
  1427. if (building): cmd += " -DBUILDING_" + building
  1428. cmd += ' ' + BracketNameWithQuotes(src)
  1429. oscmd(cmd)
  1430. ########################################################################
  1431. ##
  1432. ## CompileBison
  1433. ##
  1434. ########################################################################
  1435. def CompileBison(wobj, wsrc, opts):
  1436. ifile = os.path.basename(wsrc)
  1437. wdsth = GetOutputDir()+"/include/" + ifile[:-4] + ".h"
  1438. wdstc = GetOutputDir()+"/tmp/" + ifile + ".cxx"
  1439. pre = GetValueOption(opts, "BISONPREFIX_")
  1440. bison = GetBison()
  1441. if bison is None:
  1442. # We don't have bison. See if there is a prebuilt file.
  1443. base, ext = os.path.splitext(wsrc)
  1444. if os.path.isfile(base + '.h.prebuilt') and \
  1445. os.path.isfile(base + '.cxx.prebuilt'):
  1446. CopyFile(wdstc, base + '.cxx.prebuilt')
  1447. CopyFile(wdsth, base + '.h.prebuilt')
  1448. else:
  1449. exit('Could not find bison!')
  1450. else:
  1451. oscmd(bison + ' -y -d -o'+GetOutputDir()+'/tmp/'+ifile+'.c -p '+pre+' '+wsrc)
  1452. CopyFile(wdstc, GetOutputDir()+"/tmp/"+ifile+".c")
  1453. CopyFile(wdsth, GetOutputDir()+"/tmp/"+ifile+".h")
  1454. # Finally, compile the generated source file.
  1455. CompileCxx(wobj, wdstc, opts + ["FLEX"])
  1456. ########################################################################
  1457. ##
  1458. ## CompileFlex
  1459. ##
  1460. ########################################################################
  1461. def CompileFlex(wobj,wsrc,opts):
  1462. ifile = os.path.basename(wsrc)
  1463. wdst = GetOutputDir()+"/tmp/"+ifile+".cxx"
  1464. pre = GetValueOption(opts, "BISONPREFIX_")
  1465. dashi = opts.count("FLEXDASHI")
  1466. flex = GetFlex()
  1467. want_version = GetValueOption(opts, "FLEXVERSION:")
  1468. if flex and want_version:
  1469. # Is flex at the required version for this file?
  1470. want_version = tuple(map(int, want_version.split('.')))
  1471. have_version = GetFlexVersion()
  1472. if want_version > have_version:
  1473. Warn("Skipping flex %s for file %s, need at least %s" % (
  1474. '.'.join(map(str, have_version)),
  1475. ifile,
  1476. '.'.join(map(str, want_version)),
  1477. ))
  1478. flex = None
  1479. if flex is None:
  1480. # We don't have flex. See if there is a prebuilt file.
  1481. base, ext = os.path.splitext(wsrc)
  1482. if os.path.isfile(base + '.cxx.prebuilt'):
  1483. CopyFile(wdst, base + '.cxx.prebuilt')
  1484. else:
  1485. exit('Could not find flex!')
  1486. else:
  1487. if (dashi):
  1488. oscmd(flex + " -i -P" + pre + " -o"+wdst+" "+wsrc)
  1489. else:
  1490. oscmd(flex + " -P" + pre + " -o"+wdst+" "+wsrc)
  1491. # Finally, compile the generated source file.
  1492. CompileCxx(wobj, wdst, opts + ["FLEX"])
  1493. ########################################################################
  1494. ##
  1495. ## CompileIgate
  1496. ##
  1497. ########################################################################
  1498. def CompileIgate(woutd,wsrc,opts):
  1499. outbase = os.path.basename(woutd)[:-3]
  1500. woutc = GetOutputDir()+"/tmp/"+outbase+"_igate.cxx"
  1501. srcdir = GetValueOption(opts, "SRCDIR:")
  1502. module = GetValueOption(opts, "IMOD:")
  1503. library = GetValueOption(opts, "ILIB:")
  1504. ipath = GetListOption(opts, "DIR:")
  1505. if (PkgSkip("PYTHON")):
  1506. WriteFile(woutc, "")
  1507. WriteFile(woutd, "")
  1508. ConditionalWriteFile(woutd, "")
  1509. return
  1510. if not CrossCompiling():
  1511. # If we're compiling for this platform, we can use the one we've built.
  1512. cmd = os.path.join(GetOutputDir(), 'bin', 'interrogate')
  1513. else:
  1514. # Assume that interrogate is on the PATH somewhere.
  1515. cmd = 'interrogate'
  1516. if GetVerbose():
  1517. cmd += ' -v'
  1518. cmd += ' -srcdir %s -I%s' % (srcdir, srcdir)
  1519. cmd += ' -DCPPPARSER -D__STDC__=1 -D__cplusplus=201103L'
  1520. if (COMPILER=="MSVC"):
  1521. cmd += ' -DWIN32_VC -DWIN32 -D_WIN32'
  1522. if GetTargetArch() == 'x64':
  1523. cmd += ' -DWIN64_VC -DWIN64 -D_WIN64 -D_M_X64 -D_M_AMD64'
  1524. else:
  1525. cmd += ' -D_M_IX86'
  1526. # NOTE: this 1600 value is the version number for VC2010.
  1527. cmd += ' -D_MSC_VER=1600 -D"__declspec(param)=" -D__cdecl -D_near -D_far -D__near -D__far -D__stdcall'
  1528. if (COMPILER=="GCC"):
  1529. cmd += ' -D__attribute__\\(x\\)='
  1530. target_arch = GetTargetArch()
  1531. if target_arch in ("x86_64", "amd64"):
  1532. cmd += ' -D_LP64'
  1533. elif target_arch in ('aarch64', 'arm64'):
  1534. cmd += ' -D_LP64 -D__LP64__ -D__aarch64__'
  1535. else:
  1536. cmd += ' -D__i386__'
  1537. target = GetTarget()
  1538. if target == 'darwin':
  1539. cmd += ' -D__APPLE__'
  1540. elif target == 'android':
  1541. cmd += ' -D__ANDROID__'
  1542. optlevel = GetOptimizeOption(opts)
  1543. if (optlevel==1): cmd += ' -D_DEBUG'
  1544. if (optlevel==2): cmd += ' -D_DEBUG'
  1545. if (optlevel==3): pass
  1546. if (optlevel==4): cmd += ' -DNDEBUG'
  1547. cmd += ' -oc ' + woutc + ' -od ' + woutd
  1548. cmd += ' -fnames -string -refcount -assert -python-native'
  1549. cmd += ' -S' + GetOutputDir() + '/include/parser-inc'
  1550. # Add -I, -S and -D flags
  1551. for x in ipath:
  1552. cmd += ' -I' + BracketNameWithQuotes(x)
  1553. for (opt,dir) in INCDIRECTORIES:
  1554. if (opt=="ALWAYS") or (opt in opts):
  1555. cmd += ' -S' + BracketNameWithQuotes(dir)
  1556. for (opt,var,val) in DEFSYMBOLS:
  1557. if (opt=="ALWAYS") or (opt in opts):
  1558. cmd += ' -D' + var + '=' + val
  1559. #building = GetValueOption(opts, "BUILDING:")
  1560. #if (building): cmd += " -DBUILDING_"+building
  1561. cmd += ' -module ' + module + ' -library ' + library
  1562. for x in wsrc:
  1563. if (x.startswith("/")):
  1564. cmd += ' ' + BracketNameWithQuotes(x)
  1565. else:
  1566. cmd += ' ' + BracketNameWithQuotes(os.path.basename(x))
  1567. oscmd(cmd)
  1568. ########################################################################
  1569. ##
  1570. ## CompileImod
  1571. ##
  1572. ########################################################################
  1573. def CompileImod(wobj, wsrc, opts):
  1574. module = GetValueOption(opts, "IMOD:")
  1575. library = GetValueOption(opts, "ILIB:")
  1576. if (COMPILER=="MSVC"):
  1577. woutc = wobj[:-4]+".cxx"
  1578. if (COMPILER=="GCC"):
  1579. woutc = wobj[:-2]+".cxx"
  1580. if (PkgSkip("PYTHON")):
  1581. WriteFile(woutc, "")
  1582. CompileCxx(wobj, woutc, opts)
  1583. return
  1584. if not CrossCompiling():
  1585. # If we're compiling for this platform, we can use the one we've built.
  1586. cmd = os.path.join(GetOutputDir(), 'bin', 'interrogate_module')
  1587. else:
  1588. # Assume that interrogate_module is on the PATH somewhere.
  1589. cmd = 'interrogate_module'
  1590. cmd += ' -oc ' + woutc + ' -module ' + module + ' -library ' + library + ' -python-native'
  1591. importmod = GetValueOption(opts, "IMPORT:")
  1592. if importmod:
  1593. cmd += ' -import ' + importmod
  1594. for x in wsrc: cmd += ' ' + BracketNameWithQuotes(x)
  1595. oscmd(cmd)
  1596. CompileCxx(wobj,woutc,opts)
  1597. return
  1598. ########################################################################
  1599. ##
  1600. ## CompileLib
  1601. ##
  1602. ########################################################################
  1603. def CompileLib(lib, obj, opts):
  1604. if (COMPILER=="MSVC"):
  1605. if not BOOUSEINTELCOMPILER:
  1606. #Use MSVC Linker
  1607. cmd = 'link /lib /nologo'
  1608. if GetOptimizeOption(opts) == 4:
  1609. cmd += " /LTCG"
  1610. if HasTargetArch():
  1611. cmd += " /MACHINE:" + GetTargetArch().upper()
  1612. cmd += ' /OUT:' + BracketNameWithQuotes(lib)
  1613. for x in obj:
  1614. if not x.endswith('.lib'):
  1615. cmd += ' ' + BracketNameWithQuotes(x)
  1616. oscmd(cmd)
  1617. else:
  1618. # Choose Intel linker; from Jean-Claude
  1619. cmd = 'xilink /verbose:lib /lib '
  1620. if HasTargetArch():
  1621. cmd += " /MACHINE:" + GetTargetArch().upper()
  1622. cmd += ' /OUT:' + BracketNameWithQuotes(lib)
  1623. for x in obj: cmd += ' ' + BracketNameWithQuotes(x)
  1624. cmd += ' /LIBPATH:"C:\\Program Files (x86)\\Intel\\Composer XE 2011 SP1\\ipp\\lib\\ia32"'
  1625. cmd += ' /LIBPATH:"C:\\Program Files (x86)\\Intel\\Composer XE 2011 SP1\\TBB\\Lib\\ia32\\vc10"'
  1626. cmd += ' /LIBPATH:"C:\\Program Files (x86)\\Intel\\Composer XE 2011 SP1\\compiler\\lib\\ia32"'
  1627. oscmd(cmd)
  1628. if (COMPILER=="GCC"):
  1629. if GetTarget() == 'darwin':
  1630. cmd = 'libtool -static -o ' + BracketNameWithQuotes(lib)
  1631. else:
  1632. cmd = GetAR() + ' cru ' + BracketNameWithQuotes(lib)
  1633. for x in obj:
  1634. if GetLinkAllStatic() and x.endswith('.a'):
  1635. continue
  1636. cmd += ' ' + BracketNameWithQuotes(x)
  1637. oscmd(cmd)
  1638. oscmd(GetRanlib() + ' ' + BracketNameWithQuotes(lib))
  1639. ########################################################################
  1640. ##
  1641. ## CompileLink
  1642. ##
  1643. ########################################################################
  1644. def CompileLink(dll, obj, opts):
  1645. if (COMPILER=="MSVC"):
  1646. if not BOOUSEINTELCOMPILER:
  1647. cmd = "link /nologo "
  1648. if HasTargetArch():
  1649. cmd += " /MACHINE:" + GetTargetArch().upper()
  1650. if ("MFC" not in opts):
  1651. cmd += " /NOD:MFC90.LIB /NOD:MFC80.LIB /NOD:LIBCMT"
  1652. cmd += " /NOD:LIBCI.LIB /DEBUG"
  1653. cmd += " /nod:libc /nod:libcmtd /nod:atlthunk /nod:atls /nod:atlsd"
  1654. if (GetOrigExt(dll) != ".exe"): cmd += " /DLL"
  1655. optlevel = GetOptimizeOption(opts)
  1656. if (optlevel==1): cmd += " /MAP /MAPINFO:EXPORTS /NOD:MSVCRT.LIB /NOD:MSVCPRT.LIB /NOD:MSVCIRT.LIB"
  1657. if (optlevel==2): cmd += " /MAP:NUL /NOD:MSVCRT.LIB /NOD:MSVCPRT.LIB /NOD:MSVCIRT.LIB"
  1658. if (optlevel==3): cmd += " /MAP:NUL /NOD:MSVCRTD.LIB /NOD:MSVCPRTD.LIB /NOD:MSVCIRTD.LIB"
  1659. if (optlevel==4): cmd += " /MAP:NUL /LTCG /NOD:MSVCRTD.LIB /NOD:MSVCPRTD.LIB /NOD:MSVCIRTD.LIB"
  1660. if ("MFC" in opts):
  1661. if (optlevel<=2): cmd += " /NOD:MSVCRTD.LIB mfcs100d.lib MSVCRTD.lib"
  1662. else: cmd += " /NOD:MSVCRT.LIB mfcs100.lib MSVCRT.lib"
  1663. cmd += " /FIXED:NO /OPT:REF /STACK:4194304 /INCREMENTAL:NO "
  1664. cmd += ' /OUT:' + BracketNameWithQuotes(dll)
  1665. if not PkgSkip("PYTHON"):
  1666. # If we're building without Python, don't pick it up implicitly.
  1667. if "PYTHON" not in opts:
  1668. pythonv = SDK["PYTHONVERSION"].replace('.', '')
  1669. if optlevel <= 2:
  1670. cmd += ' /NOD:{}d.lib'.format(pythonv)
  1671. else:
  1672. cmd += ' /NOD:{}.lib'.format(pythonv)
  1673. # Yes, we know we are importing "locally defined symbols".
  1674. for x in obj:
  1675. if x.endswith('libp3pystub.lib'):
  1676. cmd += ' /ignore:4049,4217'
  1677. break
  1678. # Set the subsystem. Specify that we want to target Windows XP.
  1679. subsystem = GetValueOption(opts, "SUBSYSTEM:") or "CONSOLE"
  1680. cmd += " /SUBSYSTEM:" + subsystem
  1681. if GetTargetArch() == 'x64':
  1682. cmd += ",5.02"
  1683. else:
  1684. cmd += ",5.01"
  1685. if dll.endswith(".dll") or dll.endswith(".pyd"):
  1686. cmd += ' /IMPLIB:' + GetOutputDir() + '/lib/' + os.path.splitext(os.path.basename(dll))[0] + ".lib"
  1687. for (opt, dir) in LIBDIRECTORIES:
  1688. if (opt=="ALWAYS") or (opt in opts):
  1689. cmd += ' /LIBPATH:' + BracketNameWithQuotes(dir)
  1690. for x in obj:
  1691. if x.endswith(".dll") or x.endswith(".pyd"):
  1692. cmd += ' ' + GetOutputDir() + '/lib/' + os.path.splitext(os.path.basename(x))[0] + ".lib"
  1693. elif x.endswith(".lib"):
  1694. dname = os.path.splitext(os.path.basename(x))[0] + ".dll"
  1695. if (GetOrigExt(x) != ".ilb" and os.path.exists(GetOutputDir()+"/bin/" + dname)):
  1696. exit("Error: in makepanda, specify "+dname+", not "+x)
  1697. cmd += ' ' + BracketNameWithQuotes(x)
  1698. elif x.endswith(".def"):
  1699. cmd += ' /DEF:' + BracketNameWithQuotes(x)
  1700. elif x.endswith(".dat"):
  1701. pass
  1702. else:
  1703. cmd += ' ' + BracketNameWithQuotes(x)
  1704. if (GetOrigExt(dll)==".exe" and "NOICON" not in opts):
  1705. cmd += " " + GetOutputDir() + "/tmp/pandaIcon.res"
  1706. for (opt, name) in LIBNAMES:
  1707. if (opt=="ALWAYS") or (opt in opts):
  1708. cmd += " " + BracketNameWithQuotes(name)
  1709. oscmd(cmd)
  1710. else:
  1711. cmd = "xilink"
  1712. if GetVerbose(): cmd += " /verbose:lib"
  1713. if HasTargetArch():
  1714. cmd += " /MACHINE:" + GetTargetArch().upper()
  1715. if ("MFC" not in opts):
  1716. cmd += " /NOD:MFC90.LIB /NOD:MFC80.LIB /NOD:LIBCMT"
  1717. cmd += " /NOD:LIBCI.LIB /DEBUG"
  1718. cmd += " /nod:libc /nod:libcmtd /nod:atlthunk /nod:atls"
  1719. cmd += ' /LIBPATH:"C:\\Program Files (x86)\\Intel\\Composer XE 2011 SP1\\ipp\\lib\\ia32"'
  1720. cmd += ' /LIBPATH:"C:\\Program Files (x86)\\Intel\\Composer XE 2011 SP1\\TBB\\Lib\\ia32\\vc10"'
  1721. cmd += ' /LIBPATH:"C:\\Program Files (x86)\\Intel\\Composer XE 2011 SP1\\compiler\\lib\\ia32"'
  1722. if (GetOrigExt(dll) != ".exe"): cmd += " /DLL"
  1723. optlevel = GetOptimizeOption(opts)
  1724. if (optlevel==1): cmd += " /MAP /MAPINFO:EXPORTS /NOD:MSVCRT.LIB /NOD:MSVCPRT.LIB /NOD:MSVCIRT.LIB"
  1725. if (optlevel==2): cmd += " /MAP:NUL /NOD:MSVCRT.LIB /NOD:MSVCPRT.LIB /NOD:MSVCIRT.LIB"
  1726. if (optlevel==3): cmd += " /MAP:NUL /NOD:MSVCRTD.LIB /NOD:MSVCPRTD.LIB /NOD:MSVCIRTD.LIB"
  1727. if (optlevel==4): cmd += " /MAP:NUL /LTCG /NOD:MSVCRTD.LIB /NOD:MSVCPRTD.LIB /NOD:MSVCIRTD.LIB"
  1728. if ("MFC" in opts):
  1729. if (optlevel<=2): cmd += " /NOD:MSVCRTD.LIB mfcs100d.lib MSVCRTD.lib"
  1730. else: cmd += " /NOD:MSVCRT.LIB mfcs100.lib MSVCRT.lib"
  1731. cmd += " /FIXED:NO /OPT:REF /STACK:4194304 /INCREMENTAL:NO "
  1732. cmd += ' /OUT:' + BracketNameWithQuotes(dll)
  1733. subsystem = GetValueOption(opts, "SUBSYSTEM:")
  1734. if subsystem:
  1735. cmd += " /SUBSYSTEM:" + subsystem
  1736. if dll.endswith(".dll"):
  1737. cmd += ' /IMPLIB:' + GetOutputDir() + '/lib/' + os.path.splitext(os.path.basename(dll))[0] + ".lib"
  1738. for (opt, dir) in LIBDIRECTORIES:
  1739. if (opt=="ALWAYS") or (opt in opts):
  1740. cmd += ' /LIBPATH:' + BracketNameWithQuotes(dir)
  1741. for x in obj:
  1742. if x.endswith(".dll") or x.endswith(".pyd"):
  1743. cmd += ' ' + GetOutputDir() + '/lib/' + os.path.splitext(os.path.basename(x))[0] + ".lib"
  1744. elif x.endswith(".lib"):
  1745. dname = os.path.splitext(dll)[0]+".dll"
  1746. if (GetOrigExt(x) != ".ilb" and os.path.exists(GetOutputDir()+"/bin/" + os.path.splitext(os.path.basename(x))[0] + ".dll")):
  1747. exit("Error: in makepanda, specify "+dname+", not "+x)
  1748. cmd += ' ' + BracketNameWithQuotes(x)
  1749. elif x.endswith(".def"):
  1750. cmd += ' /DEF:' + BracketNameWithQuotes(x)
  1751. elif x.endswith(".dat"):
  1752. pass
  1753. else:
  1754. cmd += ' ' + BracketNameWithQuotes(x)
  1755. if (GetOrigExt(dll)==".exe" and "NOICON" not in opts):
  1756. cmd += " " + GetOutputDir() + "/tmp/pandaIcon.res"
  1757. for (opt, name) in LIBNAMES:
  1758. if (opt=="ALWAYS") or (opt in opts):
  1759. cmd += " " + BracketNameWithQuotes(name)
  1760. oscmd(cmd)
  1761. if COMPILER == "GCC":
  1762. cxx = GetCXX()
  1763. if GetOrigExt(dll) == ".exe":
  1764. cmd = cxx + ' -o ' + dll + ' -L' + GetOutputDir() + '/lib -L' + GetOutputDir() + '/tmp'
  1765. if GetTarget() == "android":
  1766. # Necessary to work around an issue with libandroid depending on vendor libraries
  1767. cmd += ' -Wl,--allow-shlib-undefined'
  1768. else:
  1769. if (GetTarget() == "darwin"):
  1770. cmd = cxx + ' -undefined dynamic_lookup'
  1771. if ("BUNDLE" in opts or GetOrigExt(dll) == ".pyd"):
  1772. cmd += ' -bundle '
  1773. else:
  1774. install_name = '@loader_path/../lib/' + os.path.basename(dll)
  1775. cmd += ' -dynamiclib -install_name ' + install_name
  1776. cmd += ' -compatibility_version ' + MAJOR_VERSION + ' -current_version ' + VERSION
  1777. cmd += ' -o ' + dll + ' -L' + GetOutputDir() + '/lib -L' + GetOutputDir() + '/tmp'
  1778. else:
  1779. cmd = cxx + ' -shared'
  1780. # Always set soname on Android to avoid a linker warning when loading the library.
  1781. if "MODULE" not in opts or GetTarget() == 'android':
  1782. cmd += " -Wl,-soname=" + os.path.basename(dll)
  1783. cmd += ' -o ' + dll + ' -L' + GetOutputDir() + '/lib -L' + GetOutputDir() + '/tmp'
  1784. for x in obj:
  1785. if GetOrigExt(x) != ".dat":
  1786. cmd += ' ' + x
  1787. if (GetOrigExt(dll) == ".exe" and GetTarget() == 'windows' and "NOICON" not in opts):
  1788. cmd += " " + GetOutputDir() + "/tmp/pandaIcon.res"
  1789. # macOS specific flags.
  1790. if GetTarget() == 'darwin':
  1791. cmd += " -headerpad_max_install_names"
  1792. if OSXTARGET is not None:
  1793. cmd += " -isysroot " + SDK["MACOSX"] + " -Wl,-syslibroot," + SDK["MACOSX"]
  1794. cmd += " -mmacosx-version-min=%d.%d" % (OSXTARGET)
  1795. elif platform.mac_ver()[0].startswith('11.'):
  1796. cmd += " -mmacosx-version-min=11.0"
  1797. for arch in OSX_ARCHS:
  1798. if 'NOARCH:' + arch.upper() not in opts:
  1799. cmd += " -arch %s" % arch
  1800. elif GetTarget() == 'android':
  1801. arch = GetTargetArch()
  1802. if "ANDROID_GCC_TOOLCHAIN" in SDK:
  1803. cmd += ' -gcc-toolchain ' + SDK["ANDROID_GCC_TOOLCHAIN"].replace('\\', '/')
  1804. cmd += " -Wl,-z,noexecstack -Wl,-z,relro -Wl,-z,now"
  1805. if arch == 'armv7a':
  1806. cmd += ' -target armv7-none-linux-androideabi'
  1807. cmd += " -march=armv7-a -Wl,--fix-cortex-a8"
  1808. elif arch == 'arm':
  1809. cmd += ' -target armv5te-none-linux-androideabi'
  1810. elif arch == 'aarch64':
  1811. cmd += ' -target aarch64-none-linux-android'
  1812. elif arch == 'mips':
  1813. cmd += ' -target mipsel-none-linux-android'
  1814. cmd += ' -mips32'
  1815. elif arch == 'mips64':
  1816. cmd += ' -target mips64el-none-linux-android'
  1817. elif arch == 'x86':
  1818. cmd += ' -target i686-none-linux-android'
  1819. elif arch == 'x86_64':
  1820. cmd += ' -target x86_64-none-linux-android'
  1821. cmd += ' -lc -lm'
  1822. else:
  1823. cmd += " -pthread"
  1824. if "SYSROOT" in SDK:
  1825. cmd += " --sysroot=%s -no-canonical-prefixes" % (SDK["SYSROOT"])
  1826. if LDFLAGS != "":
  1827. cmd += " " + LDFLAGS
  1828. # Don't link libraries with Python, except on Android.
  1829. if "PYTHON" in opts and GetOrigExt(dll) != ".exe" and not RTDIST and GetTarget() != 'android':
  1830. opts = opts[:]
  1831. opts.remove("PYTHON")
  1832. for (opt, dir) in LIBDIRECTORIES:
  1833. if (opt=="ALWAYS") or (opt in opts):
  1834. cmd += ' -L' + BracketNameWithQuotes(dir)
  1835. for (opt, dir) in FRAMEWORKDIRECTORIES:
  1836. if (opt=="ALWAYS") or (opt in opts):
  1837. cmd += ' -F' + BracketNameWithQuotes(dir)
  1838. for (opt, name) in LIBNAMES:
  1839. if (opt=="ALWAYS") or (opt in opts):
  1840. cmd += ' ' + BracketNameWithQuotes(name)
  1841. if GetTarget() != 'freebsd':
  1842. cmd += " -ldl"
  1843. oscmd(cmd)
  1844. if GetOptimizeOption(opts) == 4 and GetTarget() in ('linux', 'android'):
  1845. oscmd(GetStrip() + " --strip-unneeded " + BracketNameWithQuotes(dll))
  1846. os.system("chmod +x " + BracketNameWithQuotes(dll))
  1847. if dll.endswith("." + MAJOR_VERSION + ".dylib"):
  1848. newdll = dll[:-6-len(MAJOR_VERSION)] + "dylib"
  1849. if os.path.isfile(newdll):
  1850. os.remove(newdll)
  1851. oscmd("ln -s " + BracketNameWithQuotes(os.path.basename(dll)) + " " + BracketNameWithQuotes(newdll))
  1852. elif dll.endswith("." + MAJOR_VERSION):
  1853. newdll = dll[:-len(MAJOR_VERSION)-1]
  1854. if os.path.isfile(newdll):
  1855. os.remove(newdll)
  1856. oscmd("ln -s " + BracketNameWithQuotes(os.path.basename(dll)) + " " + BracketNameWithQuotes(newdll))
  1857. ##########################################################################################
  1858. #
  1859. # CompileEgg
  1860. #
  1861. ##########################################################################################
  1862. def CompileEgg(eggfile, src, opts):
  1863. pz = False
  1864. if eggfile.endswith(".pz"):
  1865. pz = True
  1866. eggfile = eggfile[:-3]
  1867. # Determine the location of the pzip and flt2egg tools.
  1868. if CrossCompiling():
  1869. # We may not be able to use our generated versions of these tools,
  1870. # so we'll expect them to already be present in the PATH.
  1871. pzip = 'pzip'
  1872. flt2egg = 'flt2egg'
  1873. else:
  1874. # If we're compiling for this machine, we can use the binaries we've built.
  1875. pzip = os.path.join(GetOutputDir(), 'bin', 'pzip')
  1876. flt2egg = os.path.join(GetOutputDir(), 'bin', 'flt2egg')
  1877. if not os.path.isfile(pzip):
  1878. pzip = 'pzip'
  1879. if not os.path.isfile(flt2egg):
  1880. flt2egg = 'flt2egg'
  1881. if src.endswith(".egg"):
  1882. CopyFile(eggfile, src)
  1883. elif src.endswith(".flt"):
  1884. oscmd(flt2egg + ' -ps keep -o ' + BracketNameWithQuotes(eggfile) + ' ' + BracketNameWithQuotes(src))
  1885. if pz:
  1886. oscmd(pzip + ' ' + BracketNameWithQuotes(eggfile))
  1887. ##########################################################################################
  1888. #
  1889. # CompileRes, CompileRsrc
  1890. #
  1891. ##########################################################################################
  1892. def CompileRes(target, src, opts):
  1893. """Compiles a Windows .rc file into a .res file."""
  1894. ipath = GetListOption(opts, "DIR:")
  1895. if (COMPILER == "MSVC"):
  1896. cmd = "rc"
  1897. cmd += " /Fo" + BracketNameWithQuotes(target)
  1898. for x in ipath: cmd += " /I" + x
  1899. for (opt,dir) in INCDIRECTORIES:
  1900. if (opt=="ALWAYS") or (opt in opts):
  1901. cmd += " /I" + BracketNameWithQuotes(dir)
  1902. for (opt,var,val) in DEFSYMBOLS:
  1903. if (opt=="ALWAYS") or (opt in opts):
  1904. cmd += " /D" + var + "=" + val
  1905. cmd += " " + BracketNameWithQuotes(src)
  1906. else:
  1907. cmd = "windres"
  1908. for x in ipath: cmd += " -I" + x
  1909. for (opt,dir) in INCDIRECTORIES:
  1910. if (opt=="ALWAYS") or (opt in opts):
  1911. cmd += " -I" + BracketNameWithQuotes(dir)
  1912. for (opt,var,val) in DEFSYMBOLS:
  1913. if (opt=="ALWAYS") or (opt in opts):
  1914. cmd += " -D" + var + "=" + val
  1915. cmd += " -i " + BracketNameWithQuotes(src)
  1916. cmd += " -o " + BracketNameWithQuotes(target)
  1917. oscmd(cmd)
  1918. def CompileRsrc(target, src, opts):
  1919. """Compiles a Mac OS .r file into an .rsrc file."""
  1920. ipath = GetListOption(opts, "DIR:")
  1921. if os.path.isfile("/usr/bin/Rez"):
  1922. cmd = "Rez -useDF"
  1923. elif os.path.isfile("/Library/Developer/CommandLineTools/usr/bin/Rez"):
  1924. cmd = "/Library/Developer/CommandLineTools/usr/bin/Rez -useDF"
  1925. else:
  1926. cmd = "/Developer/Tools/Rez -useDF"
  1927. cmd += " -o " + BracketNameWithQuotes(target)
  1928. for x in ipath:
  1929. cmd += " -i " + x
  1930. for (opt,dir) in INCDIRECTORIES:
  1931. if (opt=="ALWAYS") or (opt in opts):
  1932. cmd += " -i " + BracketNameWithQuotes(dir)
  1933. for (opt,var,val) in DEFSYMBOLS:
  1934. if (opt=="ALWAYS") or (opt in opts):
  1935. if (val == ""):
  1936. cmd += " -d " + var
  1937. else:
  1938. cmd += " -d " + var + " = " + val
  1939. cmd += " " + BracketNameWithQuotes(src)
  1940. oscmd(cmd)
  1941. ##########################################################################################
  1942. #
  1943. # CompileJava (Android only)
  1944. #
  1945. ##########################################################################################
  1946. def CompileJava(target, src, opts):
  1947. """Compiles a .java file into a .class file."""
  1948. if GetHost() == 'android':
  1949. cmd = "ecj "
  1950. else:
  1951. cmd = "javac -bootclasspath " + BracketNameWithQuotes(SDK["ANDROID_JAR"]) + " "
  1952. optlevel = GetOptimizeOption(opts)
  1953. if optlevel >= 4:
  1954. cmd += "-debug:none "
  1955. cmd += "-cp " + GetOutputDir() + "/classes "
  1956. cmd += "-d " + GetOutputDir() + "/classes "
  1957. cmd += BracketNameWithQuotes(src)
  1958. oscmd(cmd)
  1959. ##########################################################################################
  1960. #
  1961. # FreezePy
  1962. #
  1963. ##########################################################################################
  1964. def FreezePy(target, inputs, opts):
  1965. assert len(inputs) > 0
  1966. cmdstr = BracketNameWithQuotes(SDK["PYTHONEXEC"].replace('\\', '/')) + " "
  1967. if sys.version_info >= (2, 6):
  1968. cmdstr += "-B "
  1969. cmdstr += os.path.join(GetOutputDir(), "direct", "dist", "pfreeze.py")
  1970. if 'FREEZE_STARTUP' in opts:
  1971. cmdstr += " -s"
  1972. if GetOrigExt(target) == '.exe':
  1973. src = inputs.pop(0)
  1974. else:
  1975. src = ""
  1976. for i in inputs:
  1977. i = os.path.splitext(i)[0]
  1978. i = i.replace('/', '.')
  1979. if i.startswith('direct.src'):
  1980. i = i.replace('.src.', '.')
  1981. cmdstr += " -i " + i
  1982. cmdstr += " -o " + target + " " + src
  1983. if ("LINK_PYTHON_STATIC" in opts):
  1984. os.environ["LINK_PYTHON_STATIC"] = "1"
  1985. oscmd(cmdstr)
  1986. if ("LINK_PYTHON_STATIC" in os.environ):
  1987. del os.environ["LINK_PYTHON_STATIC"]
  1988. if (not os.path.exists(target)):
  1989. exit("FREEZER_ERROR")
  1990. ##########################################################################################
  1991. #
  1992. # Package
  1993. #
  1994. ##########################################################################################
  1995. def Package(target, inputs, opts):
  1996. assert len(inputs) == 1
  1997. # Invoke the ppackage script.
  1998. command = BracketNameWithQuotes(SDK["PYTHONEXEC"]) + " "
  1999. if GetOptimizeOption(opts) >= 4:
  2000. command += "-OO "
  2001. if sys.version_info >= (2, 6):
  2002. command += "-B "
  2003. command += "direct/src/p3d/ppackage.py"
  2004. if not RTDIST:
  2005. # Don't compile Python sources, because we might not running in the same
  2006. # Python version as the selected host.
  2007. command += " -N"
  2008. if GetTarget() == "darwin":
  2009. if SDK.get("MACOSX"):
  2010. command += " -R \"%s\"" % SDK["MACOSX"]
  2011. for arch in OSX_ARCHS:
  2012. if arch == "x86_64":
  2013. arch = "amd64"
  2014. command += " -P osx_%s" % arch
  2015. command += " -i \"" + GetOutputDir() + "/stage\""
  2016. if (P3DSUFFIX):
  2017. command += ' -a "' + P3DSUFFIX + '"'
  2018. command += " " + inputs[0]
  2019. if GetOrigExt(target) == '.p3d':
  2020. # Build a specific .p3d file.
  2021. basename = os.path.basename(os.path.splitext(target)[0])
  2022. command += " " + basename
  2023. oscmd(command)
  2024. if GetTarget() == 'windows':
  2025. # Make an .exe that calls this .p3d.
  2026. objfile = FindLocation('p3dWrapper_' + basename + '.obj', [])
  2027. CompileCxx(objfile, 'direct/src/p3d/p3dWrapper.c', [])
  2028. exefile = FindLocation(basename + '.exe', [])
  2029. CompileLink(exefile, [objfile], ['ADVAPI'])
  2030. # Move it to the bin directory.
  2031. os.rename(GetOutputDir() + '/stage/' + basename + P3DSUFFIX + '.p3d', target)
  2032. if sys.platform != 'win32':
  2033. oscmd('chmod +x ' + BracketNameWithQuotes(target))
  2034. else:
  2035. # This is presumably a package or set of packages.
  2036. oscmd(command)
  2037. ##########################################################################################
  2038. #
  2039. # CompileBundle
  2040. #
  2041. ##########################################################################################
  2042. def CompileBundle(target, inputs, opts):
  2043. assert GetTarget() == "darwin", 'bundles can only be made for macOS'
  2044. plist = None
  2045. resources = []
  2046. objects = []
  2047. for i in inputs:
  2048. if (i.endswith(".plist")):
  2049. if (plist != None): exit("Only one plist file can be used when creating a bundle!")
  2050. plist = i
  2051. elif (i.endswith(".rsrc") or i.endswith(".icns")):
  2052. resources.append(i)
  2053. elif (GetOrigExt(i) == ".obj" or GetOrigExt(i) in SUFFIX_LIB or GetOrigExt(i) in SUFFIX_DLL):
  2054. objects.append(i)
  2055. else:
  2056. exit("Don't know how to bundle file %s" % i)
  2057. # Now link the object files to form the bundle.
  2058. if (plist == None): exit("One plist file must be used when creating a bundle!")
  2059. bundleName = plistlib.readPlist(plist)["CFBundleExecutable"]
  2060. oscmd("rm -rf %s" % target)
  2061. oscmd("mkdir -p %s/Contents/MacOS/" % target)
  2062. oscmd("mkdir -p %s/Contents/Resources/" % target)
  2063. if target.endswith(".app"):
  2064. SetOrigExt("%s/Contents/MacOS/%s" % (target, bundleName), ".exe")
  2065. else:
  2066. SetOrigExt("%s/Contents/MacOS/%s" % (target, bundleName), ".dll")
  2067. CompileLink("%s/Contents/MacOS/%s" % (target, bundleName), objects, opts + ["BUNDLE"])
  2068. oscmd("cp %s %s/Contents/Info.plist" % (plist, target))
  2069. for r in resources:
  2070. oscmd("cp %s %s/Contents/Resources/" % (r, target))
  2071. ##########################################################################################
  2072. #
  2073. # CompileMIDL
  2074. #
  2075. ##########################################################################################
  2076. def CompileMIDL(target, src, opts):
  2077. ipath = GetListOption(opts, "DIR:")
  2078. if (COMPILER=="MSVC"):
  2079. cmd = "midl"
  2080. cmd += " /out" + BracketNameWithQuotes(os.path.dirname(target))
  2081. for x in ipath: cmd += " /I" + x
  2082. for (opt,dir) in INCDIRECTORIES:
  2083. if (opt=="ALWAYS") or (opt in opts): cmd += " /I" + BracketNameWithQuotes(dir)
  2084. for (opt,var,val) in DEFSYMBOLS:
  2085. if (opt=="ALWAYS") or (opt in opts): cmd += " /D" + var + "=" + val
  2086. cmd += " " + BracketNameWithQuotes(src)
  2087. oscmd(cmd)
  2088. ##########################################################################################
  2089. #
  2090. # CompileAnything
  2091. #
  2092. ##########################################################################################
  2093. def CompileAnything(target, inputs, opts, progress = None):
  2094. if (opts.count("DEPENDENCYONLY")):
  2095. return
  2096. if (len(inputs)==0):
  2097. exit("No input files for target "+target)
  2098. infile = inputs[0]
  2099. origsuffix = GetOrigExt(target)
  2100. if (len(inputs) == 1 and origsuffix == GetOrigExt(infile)):
  2101. # It must be a simple copy operation.
  2102. ProgressOutput(progress, "Copying file", target)
  2103. CopyFile(target, infile)
  2104. if (origsuffix==".exe" and GetHost() != "windows"):
  2105. os.system("chmod +x \"%s\"" % target)
  2106. return
  2107. elif (infile.endswith(".py")):
  2108. if origsuffix == ".obj":
  2109. source = os.path.splitext(target)[0] + ".c"
  2110. SetOrigExt(source, ".c")
  2111. ProgressOutput(progress, "Building frozen source", source)
  2112. FreezePy(source, inputs, opts)
  2113. ProgressOutput(progress, "Building C++ object", target)
  2114. return CompileCxx(target, source, opts)
  2115. if origsuffix == ".exe":
  2116. ProgressOutput(progress, "Building frozen executable", target)
  2117. else:
  2118. ProgressOutput(progress, "Building frozen library", target)
  2119. return FreezePy(target, inputs, opts)
  2120. elif (infile.endswith(".idl")):
  2121. ProgressOutput(progress, "Compiling MIDL file", infile)
  2122. return CompileMIDL(target, infile, opts)
  2123. elif (infile.endswith(".pdef")):
  2124. if origsuffix == '.p3d':
  2125. ProgressOutput(progress, "Building package", target)
  2126. else:
  2127. ProgressOutput(progress, "Building package from pdef file", infile)
  2128. return Package(target, inputs, opts)
  2129. elif origsuffix in SUFFIX_LIB:
  2130. ProgressOutput(progress, "Linking static library", target)
  2131. return CompileLib(target, inputs, opts)
  2132. elif origsuffix in SUFFIX_DLL or (origsuffix==".plugin" and GetTarget() != "darwin"):
  2133. if (origsuffix==".exe"):
  2134. ProgressOutput(progress, "Linking executable", target)
  2135. else:
  2136. ProgressOutput(progress, "Linking dynamic library", target)
  2137. # Add version number to the dynamic library, on unix
  2138. if origsuffix == ".dll" and "MODULE" not in opts and not RTDIST:
  2139. tplatform = GetTarget()
  2140. if tplatform == "darwin":
  2141. # On Mac, libraries are named like libpanda.1.2.dylib
  2142. if target.lower().endswith(".dylib"):
  2143. target = target[:-5] + MAJOR_VERSION + ".dylib"
  2144. SetOrigExt(target, origsuffix)
  2145. elif tplatform != "windows" and tplatform != "android":
  2146. # On Linux, libraries are named like libpanda.so.1.2
  2147. target += "." + MAJOR_VERSION
  2148. SetOrigExt(target, origsuffix)
  2149. return CompileLink(target, inputs, opts)
  2150. elif (origsuffix==".in"):
  2151. ProgressOutput(progress, "Building Interrogate database", target)
  2152. return CompileIgate(target, inputs, opts)
  2153. elif (origsuffix==".plugin" and GetTarget() == "darwin"):
  2154. ProgressOutput(progress, "Building plugin bundle", target)
  2155. return CompileBundle(target, inputs, opts)
  2156. elif (origsuffix==".app"):
  2157. ProgressOutput(progress, "Building application bundle", target)
  2158. return CompileBundle(target, inputs, opts)
  2159. elif (origsuffix==".pz"):
  2160. ProgressOutput(progress, "Compressing", target)
  2161. return CompileEgg(target, infile, opts)
  2162. elif (origsuffix==".egg"):
  2163. ProgressOutput(progress, "Converting", target)
  2164. return CompileEgg(target, infile, opts)
  2165. elif (origsuffix==".res"):
  2166. ProgressOutput(progress, "Building resource object", target)
  2167. return CompileRes(target, infile, opts)
  2168. elif (origsuffix==".rsrc"):
  2169. ProgressOutput(progress, "Building resource object", target)
  2170. return CompileRsrc(target, infile, opts)
  2171. elif (origsuffix==".class"):
  2172. ProgressOutput(progress, "Building Java class", target)
  2173. return CompileJava(target, infile, opts)
  2174. elif (origsuffix==".obj"):
  2175. if (infile.endswith(".cxx")):
  2176. ProgressOutput(progress, "Building C++ object", target)
  2177. return CompileCxx(target, infile, opts)
  2178. elif (infile.endswith(".c")):
  2179. ProgressOutput(progress, "Building C object", target)
  2180. return CompileCxx(target, infile, opts)
  2181. elif (infile.endswith(".mm")):
  2182. ProgressOutput(progress, "Building Objective-C++ object", target)
  2183. return CompileCxx(target, infile, opts)
  2184. elif (infile.endswith(".yxx")):
  2185. ProgressOutput(progress, "Building Bison object", target)
  2186. return CompileBison(target, infile, opts)
  2187. elif (infile.endswith(".lxx")):
  2188. ProgressOutput(progress, "Building Flex object", target)
  2189. return CompileFlex(target, infile, opts)
  2190. elif (infile.endswith(".in")):
  2191. ProgressOutput(progress, "Building Interrogate object", target)
  2192. return CompileImod(target, inputs, opts)
  2193. elif (infile.endswith(".rc")):
  2194. ProgressOutput(progress, "Building resource object", target)
  2195. return CompileRes(target, infile, opts)
  2196. elif (infile.endswith(".r")):
  2197. ProgressOutput(progress, "Building resource object", target)
  2198. return CompileRsrc(target, infile, opts)
  2199. exit("Don't know how to compile: %s from %s" % (target, inputs))
  2200. ##########################################################################################
  2201. #
  2202. # Generate dtool_config.h, prc_parameters.h, and dtool_have_xxx.dat
  2203. #
  2204. ##########################################################################################
  2205. DTOOL_CONFIG=[
  2206. #_Variable_________________________Windows___________________Unix__________
  2207. ("HAVE_PYTHON", '1', '1'),
  2208. ("USE_DEBUG_PYTHON", 'UNDEF', 'UNDEF'),
  2209. ("PYTHON_FRAMEWORK", 'UNDEF', 'UNDEF'),
  2210. ("COMPILE_IN_DEFAULT_FONT", '1', '1'),
  2211. ("STDFLOAT_DOUBLE", 'UNDEF', 'UNDEF'),
  2212. ("HAVE_MAYA", '1', '1'),
  2213. ("REPORT_OPENSSL_ERRORS", '1', '1'),
  2214. ("USE_PANDAFILESTREAM", '1', '1'),
  2215. ("USE_DELETED_CHAIN", '1', '1'),
  2216. ("HAVE_WGL", '1', 'UNDEF'),
  2217. ("HAVE_DX9", 'UNDEF', 'UNDEF'),
  2218. ("HAVE_THREADS", '1', '1'),
  2219. ("SIMPLE_THREADS", 'UNDEF', 'UNDEF'),
  2220. ("OS_SIMPLE_THREADS", '1', '1'),
  2221. ("DEBUG_THREADS", 'UNDEF', 'UNDEF'),
  2222. ("HAVE_POSIX_THREADS", 'UNDEF', '1'),
  2223. ("MUTEX_SPINLOCK", 'UNDEF', 'UNDEF'),
  2224. ("HAVE_AUDIO", '1', '1'),
  2225. ("NOTIFY_DEBUG", 'UNDEF', 'UNDEF'),
  2226. ("DO_PSTATS", 'UNDEF', 'UNDEF'),
  2227. ("DO_DCAST", 'UNDEF', 'UNDEF'),
  2228. ("DO_COLLISION_RECORDING", 'UNDEF', 'UNDEF'),
  2229. ("SUPPORT_IMMEDIATE_MODE", 'UNDEF', 'UNDEF'),
  2230. ("SUPPORT_FIXED_FUNCTION", '1', '1'),
  2231. ("DO_MEMORY_USAGE", 'UNDEF', 'UNDEF'),
  2232. ("DO_PIPELINING", '1', '1'),
  2233. ("DEFAULT_PATHSEP", '";"', '":"'),
  2234. ("WORDS_BIGENDIAN", 'UNDEF', 'UNDEF'),
  2235. ("PHAVE_LOCKF", '1', '1'),
  2236. ("SIMPLE_STRUCT_POINTERS", '1', 'UNDEF'),
  2237. ("HAVE_DINKUM", 'UNDEF', 'UNDEF'),
  2238. ("HAVE_STL_HASH", 'UNDEF', 'UNDEF'),
  2239. ("GETTIMEOFDAY_ONE_PARAM", 'UNDEF', 'UNDEF'),
  2240. ("HAVE_GETOPT", 'UNDEF', '1'),
  2241. ("HAVE_GETOPT_LONG_ONLY", 'UNDEF', '1'),
  2242. ("PHAVE_GETOPT_H", 'UNDEF', '1'),
  2243. ("PHAVE_LINUX_INPUT_H", 'UNDEF', '1'),
  2244. ("IOCTL_TERMINAL_WIDTH", 'UNDEF', '1'),
  2245. ("HAVE_IOS_TYPEDEFS", '1', '1'),
  2246. ("HAVE_IOS_BINARY", '1', '1'),
  2247. ("STATIC_INIT_GETENV", '1', 'UNDEF'),
  2248. ("HAVE_PROC_SELF_EXE", 'UNDEF', '1'),
  2249. ("HAVE_PROC_SELF_MAPS", 'UNDEF', '1'),
  2250. ("HAVE_PROC_SELF_ENVIRON", 'UNDEF', '1'),
  2251. ("HAVE_PROC_SELF_CMDLINE", 'UNDEF', '1'),
  2252. ("HAVE_PROC_CURPROC_FILE", 'UNDEF', 'UNDEF'),
  2253. ("HAVE_PROC_CURPROC_MAP", 'UNDEF', 'UNDEF'),
  2254. ("HAVE_PROC_SELF_CMDLINE", 'UNDEF', 'UNDEF'),
  2255. ("HAVE_GLOBAL_ARGV", '1', 'UNDEF'),
  2256. ("PROTOTYPE_GLOBAL_ARGV", 'UNDEF', 'UNDEF'),
  2257. ("GLOBAL_ARGV", '__argv', 'UNDEF'),
  2258. ("GLOBAL_ARGC", '__argc', 'UNDEF'),
  2259. ("PHAVE_IO_H", '1', 'UNDEF'),
  2260. ("PHAVE_IOSTREAM", '1', '1'),
  2261. ("PHAVE_STRING_H", 'UNDEF', '1'),
  2262. ("PHAVE_LIMITS_H", 'UNDEF', '1'),
  2263. ("PHAVE_STDLIB_H", 'UNDEF', '1'),
  2264. ("PHAVE_MALLOC_H", '1', '1'),
  2265. ("PHAVE_SYS_MALLOC_H", 'UNDEF', 'UNDEF'),
  2266. ("PHAVE_ALLOCA_H", 'UNDEF', '1'),
  2267. ("PHAVE_LOCALE_H", 'UNDEF', '1'),
  2268. ("PHAVE_SSTREAM", '1', '1'),
  2269. ("PHAVE_NEW", '1', '1'),
  2270. ("PHAVE_SYS_TYPES_H", '1', '1'),
  2271. ("PHAVE_SYS_TIME_H", 'UNDEF', '1'),
  2272. ("PHAVE_UNISTD_H", 'UNDEF', '1'),
  2273. ("PHAVE_UTIME_H", 'UNDEF', '1'),
  2274. ("PHAVE_GLOB_H", 'UNDEF', '1'),
  2275. ("PHAVE_DIRENT_H", 'UNDEF', '1'),
  2276. ("PHAVE_UCONTEXT_H", 'UNDEF', '1'),
  2277. ("PHAVE_STDINT_H", '1', '1'),
  2278. ("HAVE_RTTI", '1', '1'),
  2279. ("HAVE_X11", 'UNDEF', '1'),
  2280. ("IS_LINUX", 'UNDEF', '1'),
  2281. ("IS_OSX", 'UNDEF', 'UNDEF'),
  2282. ("IS_FREEBSD", 'UNDEF', 'UNDEF'),
  2283. ("HAVE_EIGEN", 'UNDEF', 'UNDEF'),
  2284. ("LINMATH_ALIGN", '1', '1'),
  2285. ("HAVE_ZLIB", 'UNDEF', 'UNDEF'),
  2286. ("HAVE_PNG", 'UNDEF', 'UNDEF'),
  2287. ("HAVE_JPEG", 'UNDEF', 'UNDEF'),
  2288. ("HAVE_VIDEO4LINUX", 'UNDEF', '1'),
  2289. ("HAVE_TIFF", 'UNDEF', 'UNDEF'),
  2290. ("HAVE_OPENEXR", 'UNDEF', 'UNDEF'),
  2291. ("HAVE_SGI_RGB", '1', '1'),
  2292. ("HAVE_TGA", '1', '1'),
  2293. ("HAVE_IMG", '1', '1'),
  2294. ("HAVE_SOFTIMAGE_PIC", '1', '1'),
  2295. ("HAVE_BMP", '1', '1'),
  2296. ("HAVE_PNM", '1', '1'),
  2297. ("HAVE_STB_IMAGE", '1', '1'),
  2298. ("HAVE_VORBIS", 'UNDEF', 'UNDEF'),
  2299. ("HAVE_OPUS", 'UNDEF', 'UNDEF'),
  2300. ("HAVE_FREETYPE", 'UNDEF', 'UNDEF'),
  2301. ("HAVE_FFTW", 'UNDEF', 'UNDEF'),
  2302. ("HAVE_OPENSSL", 'UNDEF', 'UNDEF'),
  2303. ("HAVE_NET", 'UNDEF', 'UNDEF'),
  2304. ("WANT_NATIVE_NET", '1', '1'),
  2305. ("SIMULATE_NETWORK_DELAY", 'UNDEF', 'UNDEF'),
  2306. ("HAVE_CG", 'UNDEF', 'UNDEF'),
  2307. ("HAVE_CGGL", 'UNDEF', 'UNDEF'),
  2308. ("HAVE_CGDX9", 'UNDEF', 'UNDEF'),
  2309. ("HAVE_ARTOOLKIT", 'UNDEF', 'UNDEF'),
  2310. ("HAVE_DIRECTCAM", 'UNDEF', 'UNDEF'),
  2311. ("HAVE_SQUISH", 'UNDEF', 'UNDEF'),
  2312. ("HAVE_CARBON", 'UNDEF', 'UNDEF'),
  2313. ("HAVE_COCOA", 'UNDEF', 'UNDEF'),
  2314. ("HAVE_OPENAL_FRAMEWORK", 'UNDEF', 'UNDEF'),
  2315. ("HAVE_ROCKET_PYTHON", '1', '1'),
  2316. ("HAVE_ROCKET_DEBUGGER", 'UNDEF', 'UNDEF'),
  2317. ("USE_TAU", 'UNDEF', 'UNDEF'),
  2318. ("PRC_SAVE_DESCRIPTIONS", '1', '1'),
  2319. # ("_SECURE_SCL", '0', 'UNDEF'),
  2320. # ("_SECURE_SCL_THROWS", '0', 'UNDEF'),
  2321. ("HAVE_P3D_PLUGIN", 'UNDEF', 'UNDEF'),
  2322. ]
  2323. PRC_PARAMETERS=[
  2324. ("DEFAULT_PRC_DIR", '"<auto>etc"', '"<auto>etc"'),
  2325. ("PRC_DIR_ENVVARS", '"PANDA_PRC_DIR"', '"PANDA_PRC_DIR"'),
  2326. ("PRC_PATH_ENVVARS", '"PANDA_PRC_PATH"', '"PANDA_PRC_PATH"'),
  2327. ("PRC_PATH2_ENVVARS", '""', '""'),
  2328. ("PRC_PATTERNS", '"*.prc"', '"*.prc"'),
  2329. ("PRC_ENCRYPTED_PATTERNS", '"*.prc.pe"', '"*.prc.pe"'),
  2330. ("PRC_ENCRYPTION_KEY", '""', '""'),
  2331. ("PRC_EXECUTABLE_PATTERNS", '""', '""'),
  2332. ("PRC_EXECUTABLE_ARGS_ENVVAR", '"PANDA_PRC_XARGS"', '"PANDA_PRC_XARGS"'),
  2333. ("PRC_PUBLIC_KEYS_FILENAME", '""', '""'),
  2334. ("PRC_RESPECT_TRUST_LEVEL", 'UNDEF', 'UNDEF'),
  2335. ("PRC_DCONFIG_TRUST_LEVEL", '0', '0'),
  2336. ("PRC_INC_TRUST_LEVEL", '0', '0'),
  2337. ]
  2338. def WriteConfigSettings():
  2339. dtool_config={}
  2340. prc_parameters={}
  2341. speedtree_parameters={}
  2342. plugin_config={}
  2343. if (GetTarget() == 'windows'):
  2344. for key,win,unix in DTOOL_CONFIG:
  2345. dtool_config[key] = win
  2346. for key,win,unix in PRC_PARAMETERS:
  2347. prc_parameters[key] = win
  2348. else:
  2349. for key,win,unix in DTOOL_CONFIG:
  2350. dtool_config[key] = unix
  2351. for key,win,unix in PRC_PARAMETERS:
  2352. prc_parameters[key] = unix
  2353. for x in PkgListGet():
  2354. if ("HAVE_"+x in dtool_config):
  2355. if (PkgSkip(x)==0):
  2356. dtool_config["HAVE_"+x] = '1'
  2357. else:
  2358. dtool_config["HAVE_"+x] = 'UNDEF'
  2359. dtool_config["HAVE_NET"] = '1'
  2360. if (PkgSkip("NVIDIACG")==0):
  2361. dtool_config["HAVE_CG"] = '1'
  2362. dtool_config["HAVE_CGGL"] = '1'
  2363. dtool_config["HAVE_CGDX9"] = '1'
  2364. if GetTarget() not in ("linux", "android"):
  2365. dtool_config["HAVE_PROC_SELF_EXE"] = 'UNDEF'
  2366. dtool_config["HAVE_PROC_SELF_MAPS"] = 'UNDEF'
  2367. dtool_config["HAVE_PROC_SELF_CMDLINE"] = 'UNDEF'
  2368. dtool_config["HAVE_PROC_SELF_ENVIRON"] = 'UNDEF'
  2369. if (GetTarget() == "darwin"):
  2370. dtool_config["PYTHON_FRAMEWORK"] = 'Python'
  2371. dtool_config["PHAVE_MALLOC_H"] = 'UNDEF'
  2372. dtool_config["PHAVE_SYS_MALLOC_H"] = '1'
  2373. dtool_config["HAVE_OPENAL_FRAMEWORK"] = '1'
  2374. dtool_config["HAVE_X11"] = 'UNDEF' # We might have X11, but we don't need it.
  2375. dtool_config["IS_LINUX"] = 'UNDEF'
  2376. dtool_config["HAVE_VIDEO4LINUX"] = 'UNDEF'
  2377. dtool_config["PHAVE_LINUX_INPUT_H"] = 'UNDEF'
  2378. dtool_config["IS_OSX"] = '1'
  2379. if (GetTarget() == "freebsd"):
  2380. dtool_config["IS_LINUX"] = 'UNDEF'
  2381. dtool_config["HAVE_VIDEO4LINUX"] = 'UNDEF'
  2382. dtool_config["IS_FREEBSD"] = '1'
  2383. dtool_config["PHAVE_ALLOCA_H"] = 'UNDEF'
  2384. dtool_config["PHAVE_MALLOC_H"] = 'UNDEF'
  2385. dtool_config["PHAVE_LINUX_INPUT_H"] = 'UNDEF'
  2386. dtool_config["HAVE_PROC_CURPROC_FILE"] = '1'
  2387. dtool_config["HAVE_PROC_CURPROC_MAP"] = '1'
  2388. dtool_config["HAVE_PROC_CURPROC_CMDLINE"] = '1'
  2389. if (GetTarget() == "android"):
  2390. # Android does have RTTI, but we disable it anyway.
  2391. dtool_config["HAVE_RTTI"] = 'UNDEF'
  2392. dtool_config["PHAVE_GLOB_H"] = 'UNDEF'
  2393. dtool_config["PHAVE_LOCKF"] = 'UNDEF'
  2394. dtool_config["HAVE_VIDEO4LINUX"] = 'UNDEF'
  2395. if (GetOptimize() <= 2 and GetTarget() == "windows"):
  2396. dtool_config["USE_DEBUG_PYTHON"] = '1'
  2397. # This should probably be more sophisticated, such as based
  2398. # on whether the libRocket Python modules are available.
  2399. if (PkgSkip("PYTHON") != 0):
  2400. dtool_config["HAVE_ROCKET_PYTHON"] = 'UNDEF'
  2401. if (GetOptimize() <= 3):
  2402. dtool_config["HAVE_ROCKET_DEBUGGER"] = '1'
  2403. if (GetOptimize() <= 3):
  2404. if (dtool_config["HAVE_NET"] != 'UNDEF'):
  2405. dtool_config["DO_PSTATS"] = '1'
  2406. if (GetOptimize() <= 3):
  2407. dtool_config["DO_DCAST"] = '1'
  2408. if (GetOptimize() <= 3):
  2409. dtool_config["DO_COLLISION_RECORDING"] = '1'
  2410. if (GetOptimize() <= 3):
  2411. dtool_config["DO_MEMORY_USAGE"] = '1'
  2412. if (GetOptimize() <= 3):
  2413. dtool_config["NOTIFY_DEBUG"] = '1'
  2414. if (GetOptimize() >= 4):
  2415. dtool_config["PRC_SAVE_DESCRIPTIONS"] = 'UNDEF'
  2416. if (GetOptimize() >= 4):
  2417. # Disable RTTI on release builds.
  2418. dtool_config["HAVE_RTTI"] = 'UNDEF'
  2419. # Now that we have OS_SIMPLE_THREADS, we can support
  2420. # SIMPLE_THREADS on exotic architectures like win64, so we no
  2421. # longer need to disable it for this platform.
  2422. ## if GetTarget() == 'windows' and GetTargetArch() == 'x64':
  2423. ## dtool_config["SIMPLE_THREADS"] = 'UNDEF'
  2424. if (RTDIST or RUNTIME):
  2425. prc_parameters["DEFAULT_PRC_DIR"] = '""'
  2426. if HOST_URL:
  2427. plugin_config["PANDA_PACKAGE_HOST_URL"] = HOST_URL
  2428. #plugin_config["P3D_PLUGIN_LOG_DIRECTORY"] = ""
  2429. plugin_config["P3D_PLUGIN_LOG_BASENAME1"] = ""
  2430. plugin_config["P3D_PLUGIN_LOG_BASENAME2"] = ""
  2431. plugin_config["P3D_PLUGIN_LOG_BASENAME3"] = ""
  2432. plugin_config["P3D_PLUGIN_P3D_PLUGIN"] = ""
  2433. plugin_config["P3D_PLUGIN_P3DPYTHON"] = ""
  2434. plugin_config["P3D_COREAPI_VERSION_STR"] = COREAPI_VERSION
  2435. plugin_config["P3D_PLUGIN_VERSION_STR"] = PLUGIN_VERSION
  2436. if PkgSkip("GTK2") == 0:
  2437. plugin_config["HAVE_GTK"] = '1'
  2438. if (RUNTIME):
  2439. dtool_config["HAVE_P3D_PLUGIN"] = '1'
  2440. # Whether it's present on the system doesn't matter here,
  2441. # as the runtime itself doesn't include or link with X11.
  2442. if (RUNTIME and GetTarget() == 'linux'):
  2443. dtool_config["HAVE_X11"] = '1'
  2444. if ("GENERIC_DXERR_LIBRARY" in SDK):
  2445. dtool_config["USE_GENERIC_DXERR_LIBRARY"] = "1"
  2446. else:
  2447. dtool_config["USE_GENERIC_DXERR_LIBRARY"] = "UNDEF"
  2448. if (PkgSkip("SPEEDTREE")==0):
  2449. speedtree_parameters["SPEEDTREE_OPENGL"] = "UNDEF"
  2450. speedtree_parameters["SPEEDTREE_DIRECTX9"] = "UNDEF"
  2451. if SDK["SPEEDTREEAPI"] == "OpenGL":
  2452. speedtree_parameters["SPEEDTREE_OPENGL"] = "1"
  2453. elif SDK["SPEEDTREEAPI"] == "DirectX9":
  2454. speedtree_parameters["SPEEDTREE_DIRECTX9"] = "1"
  2455. speedtree_parameters["SPEEDTREE_BIN_DIR"] = (SDK["SPEEDTREE"] + "/Bin")
  2456. conf = "/* prc_parameters.h. Generated automatically by makepanda.py */\n"
  2457. for key in sorted(prc_parameters.keys()):
  2458. if ((key == "DEFAULT_PRC_DIR") or (key[:4]=="PRC_")):
  2459. val = OverrideValue(key, prc_parameters[key])
  2460. if (val == 'UNDEF'): conf = conf + "#undef " + key + "\n"
  2461. else: conf = conf + "#define " + key + " " + val + "\n"
  2462. ConditionalWriteFile(GetOutputDir() + '/include/prc_parameters.h', conf)
  2463. conf = "/* dtool_config.h. Generated automatically by makepanda.py */\n"
  2464. for key in sorted(dtool_config.keys()):
  2465. val = OverrideValue(key, dtool_config[key])
  2466. if key in ('HAVE_CG', 'HAVE_CGGL', 'HAVE_CGDX9') and val != 'UNDEF':
  2467. # These are not available for ARM, period.
  2468. conf = conf + "#ifdef __aarch64__\n"
  2469. conf = conf + "#undef " + key + "\n"
  2470. conf = conf + "#else\n"
  2471. conf = conf + "#define " + key + " " + val + "\n"
  2472. conf = conf + "#endif\n"
  2473. elif val == 'UNDEF':
  2474. conf = conf + "#undef " + key + "\n"
  2475. else:
  2476. conf = conf + "#define " + key + " " + val + "\n"
  2477. ConditionalWriteFile(GetOutputDir() + '/include/dtool_config.h', conf)
  2478. if (RTDIST or RUNTIME):
  2479. conf = "/* p3d_plugin_config.h. Generated automatically by makepanda.py */\n"
  2480. for key in sorted(plugin_config.keys()):
  2481. val = plugin_config[key]
  2482. if (val == 'UNDEF'): conf = conf + "#undef " + key + "\n"
  2483. else: conf = conf + "#define " + key + " \"" + val.replace("\\", "\\\\") + "\"\n"
  2484. ConditionalWriteFile(GetOutputDir() + '/include/p3d_plugin_config.h', conf)
  2485. if (PkgSkip("SPEEDTREE")==0):
  2486. conf = "/* speedtree_parameters.h. Generated automatically by makepanda.py */\n"
  2487. for key in sorted(speedtree_parameters.keys()):
  2488. val = OverrideValue(key, speedtree_parameters[key])
  2489. if (val == 'UNDEF'): conf = conf + "#undef " + key + "\n"
  2490. else: conf = conf + "#define " + key + " \"" + val.replace("\\", "\\\\") + "\"\n"
  2491. ConditionalWriteFile(GetOutputDir() + '/include/speedtree_parameters.h', conf)
  2492. for x in PkgListGet():
  2493. if (PkgSkip(x)): ConditionalWriteFile(GetOutputDir() + '/tmp/dtool_have_'+x.lower()+'.dat', "0\n")
  2494. else: ConditionalWriteFile(GetOutputDir() + '/tmp/dtool_have_'+x.lower()+'.dat', "1\n")
  2495. # Finally, write a platform.dat with the platform we are compiling for.
  2496. ConditionalWriteFile(GetOutputDir() + '/tmp/platform.dat', PLATFORM)
  2497. # This is useful for tools like makepackage that need to know things about
  2498. # the build parameters.
  2499. ConditionalWriteFile(GetOutputDir() + '/tmp/optimize.dat', str(GetOptimize()))
  2500. WriteConfigSettings()
  2501. WarnConflictingFiles()
  2502. if SystemLibraryExists("dtoolbase"):
  2503. Warn("Found conflicting Panda3D libraries from other ppremake build!")
  2504. if SystemLibraryExists("p3dtoolconfig"):
  2505. Warn("Found conflicting Panda3D libraries from other makepanda build!")
  2506. ##########################################################################################
  2507. #
  2508. # Generate pandaVersion.h, pythonversion, null.cxx, etc.
  2509. #
  2510. ##########################################################################################
  2511. PANDAVERSION_H="""
  2512. #define PANDA_MAJOR_VERSION $VERSION1
  2513. #define PANDA_MINOR_VERSION $VERSION2
  2514. #define PANDA_SEQUENCE_VERSION $VERSION3
  2515. #define PANDA_VERSION $NVERSION
  2516. #define PANDA_NUMERIC_VERSION $NVERSION
  2517. #define PANDA_VERSION_STR "$VERSION"
  2518. #define PANDA_ABI_VERSION_STR "$VERSION1.$VERSION2"
  2519. #define PANDA_DISTRIBUTOR "$DISTRIBUTOR"
  2520. #define PANDA_PACKAGE_VERSION_STR "$RTDIST_VERSION"
  2521. #define PANDA_PACKAGE_HOST_URL "$HOST_URL"
  2522. """
  2523. PANDAVERSION_H_RUNTIME="""
  2524. #define PANDA_MAJOR_VERSION 0
  2525. #define PANDA_MINOR_VERSION 0
  2526. #define PANDA_SEQUENCE_VERSION 0
  2527. #define PANDA_VERSION_STR "0.0.0"
  2528. #define PANDA_ABI_VERSION_STR "0.0"
  2529. #define P3D_PLUGIN_MAJOR_VERSION $VERSION1
  2530. #define P3D_PLUGIN_MINOR_VERSION $VERSION2
  2531. #define P3D_PLUGIN_SEQUENCE_VERSION $VERSION3
  2532. #define P3D_PLUGIN_VERSION_STR "$VERSION1.$VERSION2.$VERSION3"
  2533. #define P3D_COREAPI_VERSION_STR "$COREAPI_VERSION"
  2534. #define PANDA_DISTRIBUTOR "$DISTRIBUTOR"
  2535. #define PANDA_PACKAGE_VERSION_STR ""
  2536. #define PANDA_PACKAGE_HOST_URL "$HOST_URL"
  2537. """
  2538. CHECKPANDAVERSION_CXX="""
  2539. # include "dtoolbase.h"
  2540. EXPCL_DTOOL_DTOOLBASE int panda_version_$VERSION1_$VERSION2 = 0;
  2541. """
  2542. CHECKPANDAVERSION_H="""
  2543. # ifndef CHECKPANDAVERSION_H
  2544. # define CHECKPANDAVERSION_H
  2545. # include "dtoolbase.h"
  2546. extern EXPCL_DTOOL_DTOOLBASE int panda_version_$VERSION1_$VERSION2;
  2547. // Hack to forcibly depend on the check
  2548. template<typename T>
  2549. class CheckPandaVersion {
  2550. public:
  2551. int check_version() { return panda_version_$VERSION1_$VERSION2; }
  2552. };
  2553. template class CheckPandaVersion<void>;
  2554. # endif
  2555. """
  2556. P3DACTIVEX_RC="""#include "resource.h"
  2557. #define APSTUDIO_READONLY_SYMBOLS
  2558. #include "afxres.h"
  2559. #undef APSTUDIO_READONLY_SYMBOLS
  2560. #if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU)
  2561. #ifdef _WIN32
  2562. LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US
  2563. #pragma code_page(1252)
  2564. #endif
  2565. #ifdef APSTUDIO_INVOKED
  2566. 1 TEXTINCLUDE
  2567. BEGIN
  2568. "resource.h\\0"
  2569. END
  2570. 2 TEXTINCLUDE
  2571. BEGIN
  2572. "#include ""afxres.h""\\r\\n"
  2573. "\\0"
  2574. END
  2575. 3 TEXTINCLUDE
  2576. BEGIN
  2577. "1 TYPELIB ""P3DActiveX.tlb""\\r\\n"
  2578. "\\0"
  2579. END
  2580. #endif
  2581. %s
  2582. IDB_P3DACTIVEX BITMAP "P3DActiveXCtrl.bmp"
  2583. IDD_PROPPAGE_P3DACTIVEX DIALOG 0, 0, 250, 62
  2584. STYLE DS_SETFONT | WS_CHILD
  2585. FONT 8, "MS Sans Serif"
  2586. BEGIN
  2587. LTEXT "TODO: Place controls to manipulate properties of P3DActiveX Control on this dialog.",
  2588. IDC_STATIC,7,25,229,16
  2589. END
  2590. #ifdef APSTUDIO_INVOKED
  2591. GUIDELINES DESIGNINFO
  2592. BEGIN
  2593. IDD_PROPPAGE_P3DACTIVEX, DIALOG
  2594. BEGIN
  2595. LEFTMARGIN, 7
  2596. RIGHTMARGIN, 243
  2597. TOPMARGIN, 7
  2598. BOTTOMMARGIN, 55
  2599. END
  2600. END
  2601. #endif
  2602. STRINGTABLE
  2603. BEGIN
  2604. IDS_P3DACTIVEX "P3DActiveX Control"
  2605. IDS_P3DACTIVEX_PPG "P3DActiveX Property Page"
  2606. END
  2607. STRINGTABLE
  2608. BEGIN
  2609. IDS_P3DACTIVEX_PPG_CAPTION "General"
  2610. END
  2611. #endif
  2612. #ifndef APSTUDIO_INVOKED
  2613. 1 TYPELIB "P3DActiveX.tlb"
  2614. #endif"""
  2615. def CreatePandaVersionFiles():
  2616. version1=int(VERSION.split(".")[0])
  2617. version2=int(VERSION.split(".")[1])
  2618. version3=int(VERSION.split(".")[2])
  2619. nversion=version1*1000000+version2*1000+version3
  2620. if (DISTRIBUTOR != "cmu"):
  2621. # Subtract 1 if we are not an official version.
  2622. nversion -= 1
  2623. if (RUNTIME):
  2624. pandaversion_h = PANDAVERSION_H_RUNTIME
  2625. else:
  2626. pandaversion_h = PANDAVERSION_H
  2627. pandaversion_h = pandaversion_h.replace("$VERSION1",str(version1))
  2628. pandaversion_h = pandaversion_h.replace("$VERSION2",str(version2))
  2629. pandaversion_h = pandaversion_h.replace("$VERSION3",str(version3))
  2630. pandaversion_h = pandaversion_h.replace("$VERSION",VERSION)
  2631. pandaversion_h = pandaversion_h.replace("$NVERSION",str(nversion))
  2632. pandaversion_h = pandaversion_h.replace("$DISTRIBUTOR",DISTRIBUTOR)
  2633. pandaversion_h = pandaversion_h.replace("$RTDIST_VERSION",RTDIST_VERSION)
  2634. pandaversion_h = pandaversion_h.replace("$COREAPI_VERSION",COREAPI_VERSION)
  2635. pandaversion_h = pandaversion_h.replace("$HOST_URL",(HOST_URL or ""))
  2636. if (DISTRIBUTOR == "cmu"):
  2637. pandaversion_h += "\n#define PANDA_OFFICIAL_VERSION\n"
  2638. else:
  2639. pandaversion_h += "\n#undef PANDA_OFFICIAL_VERSION\n"
  2640. if GIT_COMMIT:
  2641. pandaversion_h += "\n#define PANDA_GIT_COMMIT_STR \"%s\"\n" % (GIT_COMMIT)
  2642. # Allow creating a deterministic build by setting this.
  2643. source_date = os.environ.get("SOURCE_DATE_EPOCH")
  2644. if source_date:
  2645. # This matches the GCC / Clang format for __DATE__ __TIME__
  2646. source_date = time.gmtime(int(source_date))
  2647. try:
  2648. source_date = time.strftime('%b %e %Y %H:%M:%S', source_date)
  2649. except ValueError:
  2650. source_date = time.strftime('%b %d %Y %H:%M:%S', source_date)
  2651. if source_date[3:5] == ' 0':
  2652. source_date = source_date[:3] + ' ' + source_date[5:]
  2653. pandaversion_h += "\n#define PANDA_BUILD_DATE_STR \"%s\"\n" % (source_date)
  2654. if not RUNTIME:
  2655. checkpandaversion_cxx = CHECKPANDAVERSION_CXX.replace("$VERSION1",str(version1))
  2656. checkpandaversion_cxx = checkpandaversion_cxx.replace("$VERSION2",str(version2))
  2657. checkpandaversion_cxx = checkpandaversion_cxx.replace("$VERSION3",str(version3))
  2658. checkpandaversion_cxx = checkpandaversion_cxx.replace("$NVERSION",str(nversion))
  2659. checkpandaversion_h = CHECKPANDAVERSION_H.replace("$VERSION1",str(version1))
  2660. checkpandaversion_h = checkpandaversion_h.replace("$VERSION2",str(version2))
  2661. checkpandaversion_h = checkpandaversion_h.replace("$VERSION3",str(version3))
  2662. checkpandaversion_h = checkpandaversion_h.replace("$NVERSION",str(nversion))
  2663. ConditionalWriteFile(GetOutputDir()+'/include/pandaVersion.h', pandaversion_h)
  2664. if RUNTIME:
  2665. ConditionalWriteFile(GetOutputDir()+'/include/checkPandaVersion.cxx', '')
  2666. ConditionalWriteFile(GetOutputDir()+'/include/checkPandaVersion.h', '')
  2667. else:
  2668. ConditionalWriteFile(GetOutputDir()+'/include/checkPandaVersion.cxx', checkpandaversion_cxx)
  2669. ConditionalWriteFile(GetOutputDir()+'/include/checkPandaVersion.h', checkpandaversion_h)
  2670. ConditionalWriteFile(GetOutputDir()+"/tmp/null.cxx","")
  2671. if RUNTIME:
  2672. p3dactivex_rc = {"name" : "Panda3D Game Engine Plug-in",
  2673. "version" : VERSION,
  2674. "description" : "Runs 3-D games and interactive applets",
  2675. "filename" : "p3dactivex.ocx",
  2676. "mimetype" : "application/x-panda3d",
  2677. "extension" : "p3d",
  2678. "filedesc" : "Panda3D applet"}
  2679. ConditionalWriteFile(GetOutputDir()+"/include/P3DActiveX.rc", P3DACTIVEX_RC % GenerateResourceFile(**p3dactivex_rc))
  2680. CreatePandaVersionFiles()
  2681. ##########################################################################################
  2682. #
  2683. # Copy the "direct" tree
  2684. #
  2685. ##########################################################################################
  2686. if (PkgSkip("DIRECT")==0):
  2687. CopyPythonTree(GetOutputDir() + '/direct', 'direct/src', threads=THREADCOUNT)
  2688. ConditionalWriteFile(GetOutputDir() + '/direct/__init__.py', "")
  2689. # This file used to be copied, but would nowadays cause conflicts.
  2690. # Let's get it out of the way in case someone hasn't cleaned their build since.
  2691. if os.path.isfile(GetOutputDir() + '/bin/panda3d.py'):
  2692. os.remove(GetOutputDir() + '/bin/panda3d.py')
  2693. if os.path.isfile(GetOutputDir() + '/lib/panda3d.py'):
  2694. os.remove(GetOutputDir() + '/lib/panda3d.py')
  2695. # This directory doesn't exist at all any more.
  2696. if os.path.isdir(os.path.join(GetOutputDir(), 'direct', 'ffi')):
  2697. shutil.rmtree(os.path.join(GetOutputDir(), 'direct', 'ffi'))
  2698. # These files used to exist; remove them to avoid conflicts.
  2699. del_files = ['core.py', 'core.pyc', 'core.pyo',
  2700. '_core.pyd', '_core.so',
  2701. 'direct.py', 'direct.pyc', 'direct.pyo',
  2702. '_direct.pyd', '_direct.so',
  2703. 'dtoolconfig.pyd', 'dtoolconfig.so']
  2704. for basename in del_files:
  2705. path = os.path.join(GetOutputDir(), 'panda3d', basename)
  2706. if os.path.isfile(path):
  2707. print("Removing %s" % (path))
  2708. os.remove(path)
  2709. # Write an appropriate panda3d/__init__.py
  2710. p3d_init = """"Python bindings for the Panda3D libraries"
  2711. __version__ = '%s'
  2712. """ % (WHLVERSION)
  2713. if GetTarget() == 'windows':
  2714. p3d_init += """
  2715. if '__file__' in locals():
  2716. import os
  2717. bindir = os.path.join(os.path.dirname(__file__), '..', 'bin')
  2718. if os.path.isdir(bindir):
  2719. if hasattr(os, 'add_dll_directory'):
  2720. os.add_dll_directory(bindir)
  2721. elif not os.environ.get('PATH'):
  2722. os.environ['PATH'] = bindir
  2723. else:
  2724. os.environ['PATH'] = bindir + os.pathsep + os.environ['PATH']
  2725. del os, bindir
  2726. """
  2727. if not PkgSkip("PYTHON"):
  2728. ConditionalWriteFile(GetOutputDir() + '/panda3d/__init__.py', p3d_init)
  2729. # Also add this file, for backward compatibility.
  2730. ConditionalWriteFile(GetOutputDir() + '/panda3d/dtoolconfig.py', """\
  2731. '''Alias of :mod:`panda3d.interrogatedb`.
  2732. .. deprecated:: 1.10.0
  2733. This module has been renamed to :mod:`panda3d.interrogatedb`.
  2734. '''
  2735. if __debug__:
  2736. print("Warning: panda3d.dtoolconfig is deprecated, use panda3d.interrogatedb instead.")
  2737. from .interrogatedb import *
  2738. """)
  2739. # PandaModules is now deprecated; generate a shim for backward compatibility.
  2740. for fn in glob.glob(GetOutputDir() + '/pandac/*.py') + glob.glob(GetOutputDir() + '/pandac/*.py[co]'):
  2741. if os.path.basename(fn) not in ('PandaModules.py', '__init__.py'):
  2742. os.remove(fn)
  2743. panda_modules = ['core']
  2744. if not PkgSkip("PANDAPHYSICS"):
  2745. panda_modules.append('physics')
  2746. if not PkgSkip('PANDAFX'):
  2747. panda_modules.append('fx')
  2748. if not PkgSkip("DIRECT"):
  2749. panda_modules.append('direct')
  2750. if not PkgSkip("VISION"):
  2751. panda_modules.append('vision')
  2752. if not PkgSkip("SKEL"):
  2753. panda_modules.append('skel')
  2754. if not PkgSkip("EGG"):
  2755. panda_modules.append('egg')
  2756. if not PkgSkip("ODE"):
  2757. panda_modules.append('ode')
  2758. if not PkgSkip("VRPN"):
  2759. panda_modules.append('vrpn')
  2760. panda_modules_code = """
  2761. "This module is deprecated. Import from panda3d.core and other panda3d.* modules instead."
  2762. if __debug__:
  2763. print("Warning: pandac.PandaModules is deprecated, import from panda3d.core instead")
  2764. """
  2765. for module in panda_modules:
  2766. panda_modules_code += """
  2767. try:
  2768. from panda3d.%s import *
  2769. except ImportError as err:
  2770. if "No module named %s" not in str(err):
  2771. raise""" % (module, module)
  2772. panda_modules_code += """
  2773. from direct.showbase import DConfig
  2774. def get_config_showbase():
  2775. return DConfig
  2776. def get_config_express():
  2777. return DConfig
  2778. getConfigShowbase = get_config_showbase
  2779. getConfigExpress = get_config_express
  2780. """
  2781. exthelpers_code = """
  2782. "This module is deprecated. Import from direct.extensions_native.extension_native_helpers instead."
  2783. from direct.extensions_native.extension_native_helpers import *
  2784. """
  2785. if not PkgSkip("PYTHON"):
  2786. ConditionalWriteFile(GetOutputDir() + '/pandac/PandaModules.py', panda_modules_code)
  2787. ConditionalWriteFile(GetOutputDir() + '/pandac/extension_native_helpers.py', exthelpers_code)
  2788. ConditionalWriteFile(GetOutputDir() + '/pandac/__init__.py', '')
  2789. ##########################################################################################
  2790. #
  2791. # Write the dist-info directory.
  2792. #
  2793. ##########################################################################################
  2794. # This is just some basic stuff since setuptools just needs this file to
  2795. # exist, otherwise it will not read the entry_points.txt file. Maybe we will
  2796. # eventually want to merge this with the metadata generator in makewheel.py.
  2797. METADATA = """Metadata-Version: 2.0
  2798. Name: Panda3D
  2799. Version: {version}
  2800. License: BSD
  2801. Home-page: https://www.panda3d.org/
  2802. Author: Panda3D Team
  2803. Author-email: [email protected]
  2804. """
  2805. ENTRY_POINTS = """[distutils.commands]
  2806. build_apps = direct.dist.commands:build_apps
  2807. bdist_apps = direct.dist.commands:bdist_apps
  2808. """
  2809. if not PkgSkip("DIRECT"):
  2810. dist_dir = os.path.join(GetOutputDir(), 'panda3d.dist-info')
  2811. MakeDirectory(dist_dir)
  2812. ConditionalWriteFile(os.path.join(dist_dir, 'METADATA'), METADATA.format(version=VERSION))
  2813. ConditionalWriteFile(os.path.join(dist_dir, 'entry_points.txt'), ENTRY_POINTS)
  2814. ##########################################################################################
  2815. #
  2816. # Generate the PRC files into the ETC directory.
  2817. #
  2818. ##########################################################################################
  2819. confautoprc = ReadFile("makepanda/confauto.in")
  2820. if (PkgSkip("SPEEDTREE")==0):
  2821. # If SpeedTree is available, enable it in the config file
  2822. confautoprc = confautoprc.replace('#st#', '')
  2823. else:
  2824. # otherwise, disable it.
  2825. confautoprc = confautoprc.replace('#st#', '#')
  2826. confautoprc = confautoprc.replace('\r\n', '\n')
  2827. if PkgSkip("ASSIMP") or GetLinkAllStatic():
  2828. confautoprc = confautoprc.replace("load-file-type p3assimp", "#load-file-type p3assimp")
  2829. if PkgSkip("EGG") or GetLinkAllStatic():
  2830. confautoprc = confautoprc.replace("load-file-type egg pandaegg", "#load-file-type egg pandaegg")
  2831. if PkgSkip("PANDATOOL") or PkgSkip("EGG") or GetLinkAllStatic():
  2832. confautoprc = confautoprc.replace("load-file-type p3ptloader", "#load-file-type p3ptloader")
  2833. if PkgSkip("FFMPEG") or GetLinkAllStatic():
  2834. confautoprc = confautoprc.replace("load-audio-type * p3ffmpeg", "#load-audio-type * p3ffmpeg")
  2835. confautoprc = confautoprc.replace("load-video-type * p3ffmpeg", "#load-video-type * p3ffmpeg")
  2836. if (os.path.isfile("makepanda/myconfig.in")):
  2837. configprc = ReadFile("makepanda/myconfig.in")
  2838. else:
  2839. configprc = ReadFile("makepanda/config.in")
  2840. configprc = configprc.replace('\r\n', '\n')
  2841. if (GetTarget() == 'windows'):
  2842. configprc = configprc.replace("$XDG_CACHE_HOME/panda3d", "$USER_APPDATA/Panda3D-%s" % MAJOR_VERSION)
  2843. elif not PkgSkip("X11") and not PkgSkip("GL") and not PkgSkip("EGL") and not GetLinkAllStatic():
  2844. configprc = configprc.replace("#load-display pandadx9", "aux-display p3headlessgl")
  2845. else:
  2846. configprc = configprc.replace("aux-display pandadx9", "")
  2847. if (GetTarget() == 'darwin'):
  2848. configprc = configprc.replace("$XDG_CACHE_HOME/panda3d", "$HOME/Library/Caches/Panda3D-%s" % MAJOR_VERSION)
  2849. # OpenAL is not yet working well on OSX for us, so let's do this for now.
  2850. if not PkgSkip("FMODEX"):
  2851. configprc = configprc.replace("p3openal_audio", "p3fmod_audio")
  2852. if PkgSkip("GL") or GetLinkAllStatic():
  2853. configprc = configprc.replace("\nload-display pandagl", "\n#load-display pandagl")
  2854. if PkgSkip("GLES") or GetLinkAllStatic():
  2855. configprc = configprc.replace("\n#load-display pandagles", "")
  2856. if PkgSkip("DX9") or GetLinkAllStatic():
  2857. configprc = configprc.replace("\n#load-display pandadx9", "")
  2858. if PkgSkip("TINYDISPLAY") or GetLinkAllStatic():
  2859. configprc = configprc.replace("\n#load-display p3tinydisplay", "")
  2860. if PkgSkip("OPENAL") or GetLinkAllStatic():
  2861. configprc = configprc.replace("audio-library-name p3openal_audio", "#audio-library-name p3openal_audio")
  2862. if GetTarget() == 'windows':
  2863. # Convert to Windows newlines.
  2864. ConditionalWriteFile(GetOutputDir()+"/etc/Config.prc", configprc, newline='\r\n')
  2865. ConditionalWriteFile(GetOutputDir()+"/etc/Confauto.prc", confautoprc, newline='\r\n')
  2866. else:
  2867. ConditionalWriteFile(GetOutputDir()+"/etc/Config.prc", configprc)
  2868. ConditionalWriteFile(GetOutputDir()+"/etc/Confauto.prc", confautoprc)
  2869. ##########################################################################################
  2870. #
  2871. # Copy the precompiled binaries and DLLs into the build.
  2872. #
  2873. ##########################################################################################
  2874. tp_dir = GetThirdpartyDir()
  2875. if tp_dir is not None:
  2876. dylibs = {}
  2877. if GetTarget() == 'darwin':
  2878. # Make a list of all the dylibs we ship, to figure out whether we should use
  2879. # install_name_tool to correct the library reference to point to our copy.
  2880. for pkg in PkgListGet():
  2881. if PkgSkip(pkg):
  2882. continue
  2883. tp_libdir = GetThirdpartyLibDir(pkg)
  2884. for lib in glob.glob(os.path.join(tp_libdir, "*.dylib")):
  2885. dylibs[os.path.basename(lib)] = os.path.basename(os.path.realpath(lib))
  2886. if not PkgSkip("PYTHON"):
  2887. for lib in glob.glob(os.path.join(tp_libdir, SDK["PYTHONVERSION"], "*.dylib")):
  2888. dylibs[os.path.basename(lib)] = os.path.basename(os.path.realpath(lib))
  2889. for pkg in PkgListGet():
  2890. if PkgSkip(pkg):
  2891. continue
  2892. tp_pkg = tp_dir + pkg.lower()
  2893. if GetTarget() == 'windows':
  2894. if os.path.exists(tp_pkg + "/bin"):
  2895. CopyAllFiles(GetOutputDir() + "/bin/", tp_pkg + "/bin/")
  2896. if (PkgSkip("PYTHON")==0 and os.path.exists(tp_pkg + "/bin/" + SDK["PYTHONVERSION"])):
  2897. CopyAllFiles(GetOutputDir() + "/bin/", tp_pkg + "/bin/" + SDK["PYTHONVERSION"] + "/")
  2898. elif GetTarget() == 'darwin':
  2899. tp_libdir = GetThirdpartyLibDir(pkg)
  2900. tp_libs = glob.glob(os.path.join(tp_libdir, "*.dylib"))
  2901. if not PkgSkip("PYTHON"):
  2902. tp_libs += glob.glob(os.path.join(tp_libdir, SDK["PYTHONVERSION"], "*.dylib"))
  2903. tp_libs += glob.glob(os.path.join(tp_libdir, SDK["PYTHONVERSION"], "*.so"))
  2904. if pkg != 'PYTHON':
  2905. tp_libs += glob.glob(os.path.join(tp_libdir, SDK["PYTHONVERSION"], "*.py"))
  2906. for tp_lib in tp_libs:
  2907. basename = os.path.basename(tp_lib)
  2908. if basename.endswith('.dylib'):
  2909. # It's a dynamic link library. Put it in the lib directory.
  2910. target = GetOutputDir() + "/lib/" + basename
  2911. dep_prefix = "@loader_path/../lib/"
  2912. lib_id = dep_prefix + basename
  2913. else:
  2914. # It's a Python module, like _rocketcore.so. Copy it to the root, because
  2915. # nowadays the 'lib' directory may no longer be on the PYTHONPATH.
  2916. target = GetOutputDir() + "/" + basename
  2917. dep_prefix = "@loader_path/lib/"
  2918. lib_id = basename
  2919. if not NeedsBuild([target], [tp_lib]):
  2920. continue
  2921. CopyFile(target, tp_lib)
  2922. if os.path.islink(target) or target.endswith('.py'):
  2923. continue
  2924. # Correct the inter-library dependencies so that the build is relocatable.
  2925. oscmd('install_name_tool -id %s %s' % (lib_id, target))
  2926. oscmd("otool -L %s | grep .dylib > %s/tmp/otool-libs.txt" % (target, GetOutputDir()), True)
  2927. for line in open(GetOutputDir() + "/tmp/otool-libs.txt", "r"):
  2928. line = line.strip()
  2929. if not line or line.startswith(dep_prefix) or line.endswith(":"):
  2930. continue
  2931. libdep = line.split(" ", 1)[0]
  2932. dep_basename = os.path.basename(libdep)
  2933. if dep_basename in dylibs:
  2934. dep_target = dylibs[dep_basename]
  2935. oscmd("install_name_tool -change %s %s%s %s" % (libdep, dep_prefix, dep_target, target), True)
  2936. JustBuilt([target], [tp_lib])
  2937. for fwx in glob.glob(tp_pkg + "/*.framework"):
  2938. MakeDirectory(GetOutputDir() + "/Frameworks")
  2939. CopyTree(GetOutputDir() + "/Frameworks/" + os.path.basename(fwx), fwx)
  2940. else: # Linux / FreeBSD case.
  2941. for tp_lib in glob.glob(tp_pkg + "/lib/*.so*"):
  2942. CopyFile(GetOutputDir() + "/lib/" + os.path.basename(tp_lib), tp_lib)
  2943. if not PkgSkip("PYTHON"):
  2944. for tp_lib in glob.glob(os.path.join(tp_pkg, "lib", SDK["PYTHONVERSION"], "*.so*")):
  2945. base = os.path.basename(tp_lib)
  2946. if base.startswith('lib'):
  2947. CopyFile(GetOutputDir() + "/lib/" + base, tp_lib)
  2948. else:
  2949. # It's a Python module, like _rocketcore.so.
  2950. CopyFile(GetOutputDir() + "/" + base, tp_lib)
  2951. if GetTarget() == 'windows':
  2952. if os.path.isdir(os.path.join(tp_dir, "extras", "bin")):
  2953. CopyAllFiles(GetOutputDir() + "/bin/", tp_dir + "extras/bin/")
  2954. if not PkgSkip("PYTHON") and not RTDIST:
  2955. # We need to copy the Python DLL to the bin directory for now.
  2956. pydll = "/" + SDK["PYTHONVERSION"].replace(".", "")
  2957. if GetOptimize() <= 2:
  2958. pydll += "_d.dll"
  2959. else:
  2960. pydll += ".dll"
  2961. CopyFile(GetOutputDir() + "/bin" + pydll, SDK["PYTHON"] + pydll)
  2962. for fn in glob.glob(SDK["PYTHON"] + "/vcruntime*.dll"):
  2963. CopyFile(GetOutputDir() + "/bin/", fn)
  2964. # Copy the whole Python directory.
  2965. if COPY_PYTHON:
  2966. CopyTree(GetOutputDir() + "/python", SDK["PYTHON"])
  2967. # NB: Python does not always ship with the correct manifest/dll.
  2968. # Figure out the correct one to ship, and grab it from WinSxS dir.
  2969. manifest = GetOutputDir() + '/tmp/python.manifest'
  2970. if os.path.isfile(manifest):
  2971. os.unlink(manifest)
  2972. oscmd('mt -inputresource:"%s\\python.exe";#1 -out:"%s" -nologo' % (SDK["PYTHON"], manifest), True)
  2973. if COPY_PYTHON and os.path.isfile(manifest):
  2974. import xml.etree.ElementTree as ET
  2975. tree = ET.parse(manifest)
  2976. idents = tree.findall('./{urn:schemas-microsoft-com:asm.v1}dependency/{urn:schemas-microsoft-com:asm.v1}dependentAssembly/{urn:schemas-microsoft-com:asm.v1}assemblyIdentity')
  2977. else:
  2978. idents = ()
  2979. for ident in idents:
  2980. sxs_name = '_'.join([
  2981. ident.get('processorArchitecture'),
  2982. ident.get('name').lower(),
  2983. ident.get('publicKeyToken'),
  2984. ident.get('version'),
  2985. ])
  2986. # Find the manifest matching these parameters.
  2987. pattern = os.path.join('C:' + os.sep, 'Windows', 'WinSxS', 'Manifests', sxs_name + '_*.manifest')
  2988. manifests = glob.glob(pattern)
  2989. if not manifests:
  2990. Warn("Could not locate manifest %s. You may need to reinstall the Visual C++ Redistributable." % (pattern))
  2991. continue
  2992. CopyFile(GetOutputDir() + "/python/" + ident.get('name') + ".manifest", manifests[0])
  2993. # Also copy the corresponding msvcr dll.
  2994. pattern = os.path.join('C:' + os.sep, 'Windows', 'WinSxS', sxs_name + '_*', 'msvcr*.dll')
  2995. for file in glob.glob(pattern):
  2996. CopyFile(GetOutputDir() + "/python/", file)
  2997. # Copy python.exe to ppython.exe.
  2998. if COPY_PYTHON:
  2999. if not os.path.isfile(SDK["PYTHON"] + "/ppython.exe") and os.path.isfile(SDK["PYTHON"] + "/python.exe"):
  3000. CopyFile(GetOutputDir() + "/python/ppython.exe", SDK["PYTHON"] + "/python.exe")
  3001. if not os.path.isfile(SDK["PYTHON"] + "/ppythonw.exe") and os.path.isfile(SDK["PYTHON"] + "/pythonw.exe"):
  3002. CopyFile(GetOutputDir() + "/python/ppythonw.exe", SDK["PYTHON"] + "/pythonw.exe")
  3003. ConditionalWriteFile(GetOutputDir() + "/python/panda.pth", "..\n../bin\n")
  3004. # Copy over the MSVC runtime.
  3005. if GetTarget() == 'windows' and "VISUALSTUDIO" in SDK:
  3006. vcver = "%s%s" % (SDK["MSVC_VERSION"][0], 0) # ignore minor version.
  3007. crtname = "Microsoft.VC%s.CRT" % (vcver)
  3008. if ("VCTOOLSVERSION" in SDK):
  3009. dir = os.path.join(SDK["VISUALSTUDIO"], "VC", "Redist", "MSVC", SDK["VCTOOLSVERSION"], "onecore", GetTargetArch(), crtname)
  3010. else:
  3011. dir = os.path.join(SDK["VISUALSTUDIO"], "VC", "redist", GetTargetArch(), crtname)
  3012. if os.path.isfile(os.path.join(dir, "msvcr" + vcver + ".dll")):
  3013. CopyFile(GetOutputDir() + "/bin/", os.path.join(dir, "msvcr" + vcver + ".dll"))
  3014. if os.path.isfile(os.path.join(dir, "msvcp" + vcver + ".dll")):
  3015. CopyFile(GetOutputDir() + "/bin/", os.path.join(dir, "msvcp" + vcver + ".dll"))
  3016. if os.path.isfile(os.path.join(dir, "vcruntime" + vcver + ".dll")):
  3017. CopyFile(GetOutputDir() + "/bin/", os.path.join(dir, "vcruntime" + vcver + ".dll"))
  3018. ########################################################################
  3019. ##
  3020. ## Copy various stuff into the build.
  3021. ##
  3022. ########################################################################
  3023. if GetTarget() == 'windows':
  3024. # Convert to Windows newlines so they can be opened by notepad.
  3025. WriteFile(GetOutputDir() + "/LICENSE", ReadFile("doc/LICENSE"), newline='\r\n')
  3026. WriteFile(GetOutputDir() + "/ReleaseNotes", ReadFile("doc/ReleaseNotes"), newline='\r\n')
  3027. CopyFile(GetOutputDir() + "/pandaIcon.ico", "panda/src/configfiles/pandaIcon.ico")
  3028. else:
  3029. CopyFile(GetOutputDir()+"/", "doc/LICENSE")
  3030. CopyFile(GetOutputDir()+"/", "doc/ReleaseNotes")
  3031. if (PkgSkip("PANDATOOL")==0):
  3032. CopyAllFiles(GetOutputDir()+"/plugins/", "pandatool/src/scripts/", ".mel")
  3033. CopyAllFiles(GetOutputDir()+"/plugins/", "pandatool/src/scripts/", ".ms")
  3034. if (PkgSkip("PYTHON")==0 and os.path.isdir(GetThirdpartyBase()+"/Pmw")):
  3035. CopyTree(GetOutputDir()+'/Pmw', GetThirdpartyBase()+'/Pmw')
  3036. ConditionalWriteFile(GetOutputDir()+'/include/ctl3d.h', '/* dummy file to make MAX happy */')
  3037. # Since Eigen is included by all sorts of core headers, as a convenience
  3038. # to C++ users on Win and Mac, we include it in the Panda include directory.
  3039. if not PkgSkip("EIGEN") and GetTarget() in ("windows", "darwin") and GetThirdpartyDir():
  3040. CopyTree(GetOutputDir()+'/include/Eigen', GetThirdpartyDir()+'eigen/include/Eigen')
  3041. ########################################################################
  3042. #
  3043. # Copy header files to the built/include/parser-inc directory.
  3044. #
  3045. ########################################################################
  3046. CopyTree(GetOutputDir()+'/include/parser-inc','dtool/src/parser-inc')
  3047. DeleteVCS(GetOutputDir()+'/include/parser-inc')
  3048. ########################################################################
  3049. #
  3050. # Transfer all header files to the built/include directory.
  3051. #
  3052. ########################################################################
  3053. CopyAllHeaders('dtool/src/dtoolbase')
  3054. CopyAllHeaders('dtool/src/dtoolutil', skip=["pandaVersion.h", "checkPandaVersion.h"])
  3055. CopyFile(GetOutputDir()+'/include/','dtool/src/dtoolutil/vector_src.cxx')
  3056. CopyAllHeaders('dtool/metalibs/dtool')
  3057. CopyAllHeaders('dtool/src/cppparser')
  3058. CopyAllHeaders('dtool/src/prc', skip=["prc_parameters.h"])
  3059. CopyAllHeaders('dtool/src/dconfig')
  3060. CopyAllHeaders('dtool/src/interrogatedb')
  3061. CopyAllHeaders('dtool/metalibs/dtoolconfig')
  3062. CopyAllHeaders('dtool/src/pystub')
  3063. CopyAllHeaders('dtool/src/interrogate')
  3064. CopyAllHeaders('dtool/src/test_interrogate')
  3065. CopyAllHeaders('panda/src/putil')
  3066. CopyAllHeaders('panda/src/pandabase')
  3067. CopyAllHeaders('panda/src/express')
  3068. CopyAllHeaders('panda/src/downloader')
  3069. CopyAllHeaders('panda/metalibs/pandaexpress')
  3070. CopyAllHeaders('panda/src/pipeline')
  3071. CopyAllHeaders('panda/src/linmath')
  3072. CopyAllHeaders('panda/src/putil')
  3073. CopyAllHeaders('dtool/src/prckeys')
  3074. CopyAllHeaders('panda/src/audio')
  3075. CopyAllHeaders('panda/src/event')
  3076. CopyAllHeaders('panda/src/mathutil')
  3077. CopyAllHeaders('panda/src/gsgbase')
  3078. CopyAllHeaders('panda/src/pnmimage')
  3079. CopyAllHeaders('panda/src/nativenet')
  3080. CopyAllHeaders('panda/src/net')
  3081. CopyAllHeaders('panda/src/pstatclient')
  3082. CopyAllHeaders('panda/src/gobj')
  3083. CopyAllHeaders('panda/src/movies')
  3084. CopyAllHeaders('panda/src/pgraphnodes')
  3085. CopyAllHeaders('panda/src/pgraph')
  3086. CopyAllHeaders('panda/src/cull')
  3087. CopyAllHeaders('panda/src/display')
  3088. CopyAllHeaders('panda/src/chan')
  3089. CopyAllHeaders('panda/src/char')
  3090. CopyAllHeaders('panda/src/dgraph')
  3091. CopyAllHeaders('panda/src/device')
  3092. CopyAllHeaders('panda/src/pnmtext')
  3093. CopyAllHeaders('panda/src/text')
  3094. CopyAllHeaders('panda/src/grutil')
  3095. if (PkgSkip("VISION")==0):
  3096. CopyAllHeaders('panda/src/vision')
  3097. if (PkgSkip("FFMPEG")==0):
  3098. CopyAllHeaders('panda/src/ffmpeg')
  3099. CopyAllHeaders('panda/src/tform')
  3100. CopyAllHeaders('panda/src/collide')
  3101. CopyAllHeaders('panda/src/parametrics')
  3102. CopyAllHeaders('panda/src/pgui')
  3103. CopyAllHeaders('panda/src/pnmimagetypes')
  3104. CopyAllHeaders('panda/src/recorder')
  3105. if (PkgSkip("ROCKET")==0):
  3106. CopyAllHeaders('panda/src/rocket')
  3107. if (PkgSkip("VRPN")==0):
  3108. CopyAllHeaders('panda/src/vrpn')
  3109. CopyAllHeaders('panda/src/wgldisplay')
  3110. CopyAllHeaders('panda/src/ode')
  3111. CopyAllHeaders('panda/metalibs/pandaode')
  3112. if (PkgSkip("PANDAPHYSICS")==0):
  3113. CopyAllHeaders('panda/src/physics')
  3114. if (PkgSkip("PANDAPARTICLESYSTEM")==0):
  3115. CopyAllHeaders('panda/src/particlesystem')
  3116. CopyAllHeaders('panda/src/dxml')
  3117. CopyAllHeaders('panda/metalibs/panda')
  3118. CopyAllHeaders('panda/src/audiotraits')
  3119. CopyAllHeaders('panda/src/audiotraits')
  3120. CopyAllHeaders('panda/src/distort')
  3121. CopyAllHeaders('panda/src/downloadertools')
  3122. CopyAllHeaders('panda/src/windisplay')
  3123. CopyAllHeaders('panda/src/dxgsg9')
  3124. CopyAllHeaders('panda/metalibs/pandadx9')
  3125. if not PkgSkip("EGG"):
  3126. CopyAllHeaders('panda/src/egg')
  3127. CopyAllHeaders('panda/src/egg2pg')
  3128. CopyAllHeaders('panda/src/framework')
  3129. CopyAllHeaders('panda/metalibs/pandafx')
  3130. CopyAllHeaders('panda/src/glstuff')
  3131. CopyAllHeaders('panda/src/glgsg')
  3132. CopyAllHeaders('panda/src/glesgsg')
  3133. CopyAllHeaders('panda/src/gles2gsg')
  3134. if not PkgSkip("EGG"):
  3135. CopyAllHeaders('panda/metalibs/pandaegg')
  3136. if GetTarget() == 'windows':
  3137. CopyAllHeaders('panda/src/wgldisplay')
  3138. elif GetTarget() == 'darwin':
  3139. CopyAllHeaders('panda/src/osxdisplay')
  3140. CopyAllHeaders('panda/src/cocoadisplay')
  3141. elif GetTarget() == 'android':
  3142. CopyAllHeaders('panda/src/android')
  3143. CopyAllHeaders('panda/src/androiddisplay')
  3144. if not PkgSkip('X11'):
  3145. CopyAllHeaders('panda/src/x11display')
  3146. if not PkgSkip('GL'):
  3147. CopyAllHeaders('panda/src/glxdisplay')
  3148. CopyAllHeaders('panda/src/egldisplay')
  3149. CopyAllHeaders('panda/metalibs/pandagl')
  3150. CopyAllHeaders('panda/metalibs/pandagles')
  3151. CopyAllHeaders('panda/metalibs/pandagles2')
  3152. CopyAllHeaders('panda/metalibs/pandaphysics')
  3153. CopyAllHeaders('panda/src/testbed')
  3154. if (PkgSkip("PHYSX")==0):
  3155. CopyAllHeaders('panda/src/physx')
  3156. CopyAllHeaders('panda/metalibs/pandaphysx')
  3157. if (PkgSkip("BULLET")==0):
  3158. CopyAllHeaders('panda/src/bullet')
  3159. CopyAllHeaders('panda/metalibs/pandabullet')
  3160. if (PkgSkip("SPEEDTREE")==0):
  3161. CopyAllHeaders('panda/src/speedtree')
  3162. if (PkgSkip("DIRECT")==0):
  3163. CopyAllHeaders('direct/src/directbase')
  3164. CopyAllHeaders('direct/src/dcparser')
  3165. CopyAllHeaders('direct/src/deadrec')
  3166. CopyAllHeaders('direct/src/distributed')
  3167. CopyAllHeaders('direct/src/interval')
  3168. CopyAllHeaders('direct/src/showbase')
  3169. CopyAllHeaders('direct/src/dcparse')
  3170. if (RUNTIME or RTDIST):
  3171. CopyAllHeaders('direct/src/plugin', skip=["p3d_plugin_config.h"])
  3172. if (RUNTIME):
  3173. CopyAllHeaders('direct/src/plugin_npapi')
  3174. CopyAllHeaders('direct/src/plugin_standalone')
  3175. if (PkgSkip("PANDATOOL")==0):
  3176. CopyAllHeaders('pandatool/src/pandatoolbase')
  3177. CopyAllHeaders('pandatool/src/converter')
  3178. CopyAllHeaders('pandatool/src/progbase')
  3179. CopyAllHeaders('pandatool/src/eggbase')
  3180. CopyAllHeaders('pandatool/src/bam')
  3181. CopyAllHeaders('pandatool/src/cvscopy')
  3182. CopyAllHeaders('pandatool/src/daeegg')
  3183. CopyAllHeaders('pandatool/src/daeprogs')
  3184. CopyAllHeaders('pandatool/src/dxf')
  3185. CopyAllHeaders('pandatool/src/dxfegg')
  3186. CopyAllHeaders('pandatool/src/dxfprogs')
  3187. CopyAllHeaders('pandatool/src/palettizer')
  3188. CopyAllHeaders('pandatool/src/egg-mkfont')
  3189. CopyAllHeaders('pandatool/src/eggcharbase')
  3190. CopyAllHeaders('pandatool/src/egg-optchar')
  3191. CopyAllHeaders('pandatool/src/egg-palettize')
  3192. CopyAllHeaders('pandatool/src/egg-qtess')
  3193. CopyAllHeaders('pandatool/src/eggprogs')
  3194. CopyAllHeaders('pandatool/src/flt')
  3195. CopyAllHeaders('pandatool/src/fltegg')
  3196. CopyAllHeaders('pandatool/src/fltprogs')
  3197. CopyAllHeaders('pandatool/src/imagebase')
  3198. CopyAllHeaders('pandatool/src/imageprogs')
  3199. CopyAllHeaders('pandatool/src/pfmprogs')
  3200. CopyAllHeaders('pandatool/src/lwo')
  3201. CopyAllHeaders('pandatool/src/lwoegg')
  3202. CopyAllHeaders('pandatool/src/lwoprogs')
  3203. CopyAllHeaders('pandatool/src/maya')
  3204. CopyAllHeaders('pandatool/src/mayaegg')
  3205. CopyAllHeaders('pandatool/src/maxegg')
  3206. CopyAllHeaders('pandatool/src/maxprogs')
  3207. CopyAllHeaders('pandatool/src/objegg')
  3208. CopyAllHeaders('pandatool/src/objprogs')
  3209. CopyAllHeaders('pandatool/src/vrml')
  3210. CopyAllHeaders('pandatool/src/vrmlegg')
  3211. CopyAllHeaders('pandatool/src/xfile')
  3212. CopyAllHeaders('pandatool/src/xfileegg')
  3213. CopyAllHeaders('pandatool/src/ptloader')
  3214. CopyAllHeaders('pandatool/src/miscprogs')
  3215. CopyAllHeaders('pandatool/src/pstatserver')
  3216. CopyAllHeaders('pandatool/src/text-stats')
  3217. CopyAllHeaders('pandatool/src/vrmlprogs')
  3218. CopyAllHeaders('pandatool/src/win-stats')
  3219. CopyAllHeaders('pandatool/src/xfileprogs')
  3220. if (PkgSkip("CONTRIB")==0):
  3221. CopyAllHeaders('contrib/src/contribbase')
  3222. CopyAllHeaders('contrib/src/ai')
  3223. ########################################################################
  3224. #
  3225. # These definitions are syntactic shorthand. They make it easy
  3226. # to link with the usual libraries without listing them all.
  3227. #
  3228. ########################################################################
  3229. COMMON_DTOOL_LIBS=[
  3230. 'libp3dtool.dll',
  3231. 'libp3dtoolconfig.dll',
  3232. ]
  3233. COMMON_PANDA_LIBS=[
  3234. 'libpanda.dll',
  3235. 'libpandaexpress.dll'
  3236. ] + COMMON_DTOOL_LIBS
  3237. COMMON_EGG2X_LIBS=[
  3238. 'libp3eggbase.lib',
  3239. 'libp3progbase.lib',
  3240. 'libp3converter.lib',
  3241. 'libp3pandatoolbase.lib',
  3242. 'libpandaegg.dll',
  3243. ] + COMMON_PANDA_LIBS
  3244. ########################################################################
  3245. #
  3246. # This section contains a list of all the files that need to be compiled.
  3247. #
  3248. ########################################################################
  3249. print("Generating dependencies...")
  3250. sys.stdout.flush()
  3251. #
  3252. # Compile Panda icon resource file.
  3253. # We do it first because we need it at
  3254. # the time we compile an executable.
  3255. #
  3256. if GetTarget() == 'windows':
  3257. OPTS=['DIR:panda/src/configfiles']
  3258. TargetAdd('pandaIcon.res', opts=OPTS, input='pandaIcon.rc')
  3259. #
  3260. # DIRECTORY: dtool/src/dtoolbase/
  3261. #
  3262. OPTS=['DIR:dtool/src/dtoolbase', 'BUILDING:DTOOL']
  3263. TargetAdd('p3dtoolbase_composite1.obj', opts=OPTS, input='p3dtoolbase_composite1.cxx')
  3264. TargetAdd('p3dtoolbase_composite2.obj', opts=OPTS, input='p3dtoolbase_composite2.cxx')
  3265. TargetAdd('p3dtoolbase_lookup3.obj', opts=OPTS, input='lookup3.c')
  3266. TargetAdd('p3dtoolbase_indent.obj', opts=OPTS, input='indent.cxx')
  3267. #
  3268. # DIRECTORY: dtool/src/dtoolutil/
  3269. #
  3270. OPTS=['DIR:dtool/src/dtoolutil', 'BUILDING:DTOOL']
  3271. TargetAdd('p3dtoolutil_composite1.obj', opts=OPTS, input='p3dtoolutil_composite1.cxx')
  3272. TargetAdd('p3dtoolutil_composite2.obj', opts=OPTS, input='p3dtoolutil_composite2.cxx')
  3273. if GetTarget() == 'darwin':
  3274. TargetAdd('p3dtoolutil_filename_assist.obj', opts=OPTS, input='filename_assist.mm')
  3275. #
  3276. # DIRECTORY: dtool/metalibs/dtool/
  3277. #
  3278. OPTS=['DIR:dtool/metalibs/dtool', 'BUILDING:DTOOL']
  3279. TargetAdd('p3dtool_dtool.obj', opts=OPTS, input='dtool.cxx')
  3280. TargetAdd('libp3dtool.dll', input='p3dtool_dtool.obj')
  3281. TargetAdd('libp3dtool.dll', input='p3dtoolutil_composite1.obj')
  3282. TargetAdd('libp3dtool.dll', input='p3dtoolutil_composite2.obj')
  3283. if GetTarget() == 'darwin':
  3284. TargetAdd('libp3dtool.dll', input='p3dtoolutil_filename_assist.obj')
  3285. TargetAdd('libp3dtool.dll', input='p3dtoolbase_composite1.obj')
  3286. TargetAdd('libp3dtool.dll', input='p3dtoolbase_composite2.obj')
  3287. TargetAdd('libp3dtool.dll', input='p3dtoolbase_indent.obj')
  3288. TargetAdd('libp3dtool.dll', input='p3dtoolbase_lookup3.obj')
  3289. TargetAdd('libp3dtool.dll', opts=['ADVAPI','WINSHELL','WINKERNEL'])
  3290. #
  3291. # DIRECTORY: dtool/src/cppparser/
  3292. #
  3293. if (not RUNTIME):
  3294. OPTS=['DIR:dtool/src/cppparser', 'BISONPREFIX_cppyy']
  3295. CreateFile(GetOutputDir()+"/include/cppBison.h")
  3296. TargetAdd('p3cppParser_cppBison.obj', opts=OPTS, input='cppBison.yxx')
  3297. TargetAdd('cppBison.h', input='p3cppParser_cppBison.obj', opts=['DEPENDENCYONLY'])
  3298. TargetAdd('p3cppParser_composite1.obj', opts=OPTS, input='p3cppParser_composite1.cxx')
  3299. TargetAdd('p3cppParser_composite2.obj', opts=OPTS, input='p3cppParser_composite2.cxx')
  3300. TargetAdd('libp3cppParser.ilb', input='p3cppParser_composite1.obj')
  3301. TargetAdd('libp3cppParser.ilb', input='p3cppParser_composite2.obj')
  3302. TargetAdd('libp3cppParser.ilb', input='p3cppParser_cppBison.obj')
  3303. #
  3304. # DIRECTORY: dtool/src/prc/
  3305. #
  3306. OPTS=['DIR:dtool/src/prc', 'BUILDING:DTOOLCONFIG', 'OPENSSL']
  3307. TargetAdd('p3prc_composite1.obj', opts=OPTS, input='p3prc_composite1.cxx')
  3308. TargetAdd('p3prc_composite2.obj', opts=OPTS, input='p3prc_composite2.cxx')
  3309. #
  3310. # DIRECTORY: dtool/metalibs/dtoolconfig/
  3311. #
  3312. OPTS=['DIR:dtool/metalibs/dtoolconfig', 'BUILDING:DTOOLCONFIG']
  3313. TargetAdd('p3dtoolconfig_dtoolconfig.obj', opts=OPTS, input='dtoolconfig.cxx')
  3314. TargetAdd('libp3dtoolconfig.dll', input='p3dtoolconfig_dtoolconfig.obj')
  3315. TargetAdd('libp3dtoolconfig.dll', input='p3prc_composite1.obj')
  3316. TargetAdd('libp3dtoolconfig.dll', input='p3prc_composite2.obj')
  3317. TargetAdd('libp3dtoolconfig.dll', input='libp3dtool.dll')
  3318. TargetAdd('libp3dtoolconfig.dll', opts=['ADVAPI', 'OPENSSL', 'WINGDI', 'WINUSER'])
  3319. #
  3320. # DIRECTORY: dtool/src/interrogatedb/
  3321. #
  3322. OPTS=['DIR:dtool/src/interrogatedb', 'BUILDING:INTERROGATEDB']
  3323. TargetAdd('p3interrogatedb_composite1.obj', opts=OPTS, input='p3interrogatedb_composite1.cxx')
  3324. TargetAdd('p3interrogatedb_composite2.obj', opts=OPTS, input='p3interrogatedb_composite2.cxx')
  3325. TargetAdd('libp3interrogatedb.dll', input='p3interrogatedb_composite1.obj')
  3326. TargetAdd('libp3interrogatedb.dll', input='p3interrogatedb_composite2.obj')
  3327. TargetAdd('libp3interrogatedb.dll', input='libp3dtool.dll')
  3328. TargetAdd('libp3interrogatedb.dll', input='libp3dtoolconfig.dll')
  3329. # This used to be called dtoolconfig.pyd, but it just contains the interrogatedb
  3330. # stuff, so it has been renamed appropriately.
  3331. OPTS=['DIR:dtool/metalibs/dtoolconfig']
  3332. PyTargetAdd('interrogatedb_pydtool.obj', opts=OPTS, input="pydtool.cxx")
  3333. PyTargetAdd('interrogatedb.pyd', input='interrogatedb_pydtool.obj')
  3334. PyTargetAdd('interrogatedb.pyd', input='libp3dtool.dll')
  3335. PyTargetAdd('interrogatedb.pyd', input='libp3dtoolconfig.dll')
  3336. PyTargetAdd('interrogatedb.pyd', input='libp3interrogatedb.dll')
  3337. #
  3338. # DIRECTORY: dtool/src/pystub/
  3339. #
  3340. if not RUNTIME and not RTDIST:
  3341. OPTS=['DIR:dtool/src/pystub']
  3342. TargetAdd('p3pystub_pystub.obj', opts=OPTS, input='pystub.cxx')
  3343. TargetAdd('libp3pystub.lib', input='p3pystub_pystub.obj')
  3344. #TargetAdd('libp3pystub.lib', input='libp3dtool.dll')
  3345. TargetAdd('libp3pystub.lib', opts=['ADVAPI'])
  3346. #
  3347. # DIRECTORY: dtool/src/interrogate/
  3348. #
  3349. if (not RUNTIME):
  3350. OPTS=['DIR:dtool/src/interrogate', 'DIR:dtool/src/cppparser', 'DIR:dtool/src/interrogatedb']
  3351. TargetAdd('interrogate_composite1.obj', opts=OPTS, input='interrogate_composite1.cxx')
  3352. TargetAdd('interrogate_composite2.obj', opts=OPTS, input='interrogate_composite2.cxx')
  3353. TargetAdd('interrogate.exe', input='interrogate_composite1.obj')
  3354. TargetAdd('interrogate.exe', input='interrogate_composite2.obj')
  3355. TargetAdd('interrogate.exe', input='libp3cppParser.ilb')
  3356. TargetAdd('interrogate.exe', input=COMMON_DTOOL_LIBS)
  3357. TargetAdd('interrogate.exe', input='libp3interrogatedb.dll')
  3358. TargetAdd('interrogate.exe', opts=['ADVAPI', 'WINSHELL', 'WINGDI', 'WINUSER'])
  3359. preamble = WriteEmbeddedStringFile('interrogate_preamble_python_native', inputs=[
  3360. 'dtool/src/interrogatedb/py_panda.cxx',
  3361. 'dtool/src/interrogatedb/py_compat.cxx',
  3362. 'dtool/src/interrogatedb/py_wrappers.cxx',
  3363. 'dtool/src/interrogatedb/dtool_super_base.cxx',
  3364. ])
  3365. TargetAdd('interrogate_module_preamble_python_native.obj', opts=OPTS, input=preamble)
  3366. TargetAdd('interrogate_module_interrogate_module.obj', opts=OPTS, input='interrogate_module.cxx')
  3367. TargetAdd('interrogate_module.exe', input='interrogate_module_interrogate_module.obj')
  3368. TargetAdd('interrogate_module.exe', input='interrogate_module_preamble_python_native.obj')
  3369. TargetAdd('interrogate_module.exe', input='libp3cppParser.ilb')
  3370. TargetAdd('interrogate_module.exe', input=COMMON_DTOOL_LIBS)
  3371. TargetAdd('interrogate_module.exe', input='libp3interrogatedb.dll')
  3372. TargetAdd('interrogate_module.exe', opts=['ADVAPI', 'WINSHELL', 'WINGDI', 'WINUSER'])
  3373. if (not RTDIST):
  3374. TargetAdd('parse_file_parse_file.obj', opts=OPTS, input='parse_file.cxx')
  3375. TargetAdd('parse_file.exe', input='parse_file_parse_file.obj')
  3376. TargetAdd('parse_file.exe', input='libp3cppParser.ilb')
  3377. TargetAdd('parse_file.exe', input=COMMON_DTOOL_LIBS)
  3378. TargetAdd('parse_file.exe', input='libp3interrogatedb.dll')
  3379. TargetAdd('parse_file.exe', opts=['ADVAPI', 'WINSHELL', 'WINGDI', 'WINUSER'])
  3380. #
  3381. # DIRECTORY: dtool/src/prckeys/
  3382. #
  3383. if (PkgSkip("OPENSSL")==0 and not RUNTIME and not RTDIST):
  3384. OPTS=['DIR:dtool/src/prckeys', 'OPENSSL']
  3385. TargetAdd('make-prc-key_makePrcKey.obj', opts=OPTS, input='makePrcKey.cxx')
  3386. TargetAdd('make-prc-key.exe', input='make-prc-key_makePrcKey.obj')
  3387. TargetAdd('make-prc-key.exe', input=COMMON_DTOOL_LIBS)
  3388. TargetAdd('make-prc-key.exe', opts=['ADVAPI', 'OPENSSL', 'WINSHELL', 'WINGDI', 'WINUSER'])
  3389. #
  3390. # DIRECTORY: dtool/src/test_interrogate/
  3391. #
  3392. if (not RTDIST and not RUNTIME):
  3393. OPTS=['DIR:dtool/src/test_interrogate']
  3394. TargetAdd('test_interrogate_test_interrogate.obj', opts=OPTS, input='test_interrogate.cxx')
  3395. TargetAdd('test_interrogate.exe', input='test_interrogate_test_interrogate.obj')
  3396. TargetAdd('test_interrogate.exe', input='libp3interrogatedb.dll')
  3397. TargetAdd('test_interrogate.exe', input=COMMON_DTOOL_LIBS)
  3398. TargetAdd('test_interrogate.exe', opts=['ADVAPI', 'WINSHELL', 'WINGDI', 'WINUSER'])
  3399. #
  3400. # DIRECTORY: dtool/src/dtoolbase/
  3401. #
  3402. OPTS=['DIR:dtool/src/dtoolbase']
  3403. IGATEFILES=GetDirectoryContents('dtool/src/dtoolbase', ["*_composite*.cxx"])
  3404. IGATEFILES += [
  3405. "typeHandle.h",
  3406. "typeHandle_ext.h",
  3407. "typeRegistry.h",
  3408. "typedObject.h",
  3409. "neverFreeMemory.h",
  3410. ]
  3411. TargetAdd('libp3dtoolbase.in', opts=OPTS, input=IGATEFILES)
  3412. TargetAdd('libp3dtoolbase.in', opts=['IMOD:panda3d.core', 'ILIB:libp3dtoolbase', 'SRCDIR:dtool/src/dtoolbase'])
  3413. PyTargetAdd('p3dtoolbase_typeHandle_ext.obj', opts=OPTS, input='typeHandle_ext.cxx')
  3414. #
  3415. # DIRECTORY: dtool/src/dtoolutil/
  3416. #
  3417. OPTS=['DIR:dtool/src/dtoolutil']
  3418. IGATEFILES=GetDirectoryContents('dtool/src/dtoolutil', ["*_composite*.cxx"])
  3419. IGATEFILES += [
  3420. "config_dtoolutil.h",
  3421. "pandaSystem.h",
  3422. "dSearchPath.h",
  3423. "executionEnvironment.h",
  3424. "textEncoder.h",
  3425. "textEncoder_ext.h",
  3426. "filename.h",
  3427. "filename_ext.h",
  3428. "globPattern.h",
  3429. "globPattern_ext.h",
  3430. "pandaFileStream.h",
  3431. "lineStream.h",
  3432. ]
  3433. TargetAdd('libp3dtoolutil.in', opts=OPTS, input=IGATEFILES)
  3434. TargetAdd('libp3dtoolutil.in', opts=['IMOD:panda3d.core', 'ILIB:libp3dtoolutil', 'SRCDIR:dtool/src/dtoolutil'])
  3435. PyTargetAdd('p3dtoolutil_ext_composite.obj', opts=OPTS, input='p3dtoolutil_ext_composite.cxx')
  3436. #
  3437. # DIRECTORY: dtool/src/prc/
  3438. #
  3439. OPTS=['DIR:dtool/src/prc']
  3440. IGATEFILES=GetDirectoryContents('dtool/src/prc', ["*.h", "*_composite*.cxx"])
  3441. TargetAdd('libp3prc.in', opts=OPTS, input=IGATEFILES)
  3442. TargetAdd('libp3prc.in', opts=['IMOD:panda3d.core', 'ILIB:libp3prc', 'SRCDIR:dtool/src/prc'])
  3443. PyTargetAdd('p3prc_ext_composite.obj', opts=OPTS, input='p3prc_ext_composite.cxx')
  3444. #
  3445. # DIRECTORY: panda/src/pandabase/
  3446. #
  3447. OPTS=['DIR:panda/src/pandabase', 'BUILDING:PANDAEXPRESS']
  3448. TargetAdd('p3pandabase_pandabase.obj', opts=OPTS, input='pandabase.cxx')
  3449. #
  3450. # DIRECTORY: panda/src/express/
  3451. #
  3452. OPTS=['DIR:panda/src/express', 'BUILDING:PANDAEXPRESS', 'OPENSSL', 'ZLIB']
  3453. TargetAdd('p3express_composite1.obj', opts=OPTS, input='p3express_composite1.cxx')
  3454. TargetAdd('p3express_composite2.obj', opts=OPTS, input='p3express_composite2.cxx')
  3455. OPTS=['DIR:panda/src/express', 'OPENSSL', 'ZLIB']
  3456. IGATEFILES=GetDirectoryContents('panda/src/express', ["*.h", "*_composite*.cxx"])
  3457. TargetAdd('libp3express.in', opts=OPTS, input=IGATEFILES)
  3458. TargetAdd('libp3express.in', opts=['IMOD:panda3d.core', 'ILIB:libp3express', 'SRCDIR:panda/src/express'])
  3459. PyTargetAdd('p3express_ext_composite.obj', opts=OPTS, input='p3express_ext_composite.cxx')
  3460. #
  3461. # DIRECTORY: panda/src/downloader/
  3462. #
  3463. OPTS=['DIR:panda/src/downloader', 'BUILDING:PANDAEXPRESS', 'OPENSSL', 'ZLIB']
  3464. TargetAdd('p3downloader_composite1.obj', opts=OPTS, input='p3downloader_composite1.cxx')
  3465. TargetAdd('p3downloader_composite2.obj', opts=OPTS, input='p3downloader_composite2.cxx')
  3466. OPTS=['DIR:panda/src/downloader', 'OPENSSL', 'ZLIB']
  3467. IGATEFILES=GetDirectoryContents('panda/src/downloader', ["*.h", "*_composite*.cxx"])
  3468. TargetAdd('libp3downloader.in', opts=OPTS, input=IGATEFILES)
  3469. TargetAdd('libp3downloader.in', opts=['IMOD:panda3d.core', 'ILIB:libp3downloader', 'SRCDIR:panda/src/downloader'])
  3470. PyTargetAdd('p3downloader_stringStream_ext.obj', opts=OPTS, input='stringStream_ext.cxx')
  3471. #
  3472. # DIRECTORY: panda/metalibs/pandaexpress/
  3473. #
  3474. OPTS=['DIR:panda/metalibs/pandaexpress', 'BUILDING:PANDAEXPRESS', 'ZLIB']
  3475. TargetAdd('pandaexpress_pandaexpress.obj', opts=OPTS, input='pandaexpress.cxx')
  3476. TargetAdd('libpandaexpress.dll', input='pandaexpress_pandaexpress.obj')
  3477. TargetAdd('libpandaexpress.dll', input='p3downloader_composite1.obj')
  3478. TargetAdd('libpandaexpress.dll', input='p3downloader_composite2.obj')
  3479. TargetAdd('libpandaexpress.dll', input='p3express_composite1.obj')
  3480. TargetAdd('libpandaexpress.dll', input='p3express_composite2.obj')
  3481. TargetAdd('libpandaexpress.dll', input='p3pandabase_pandabase.obj')
  3482. TargetAdd('libpandaexpress.dll', input=COMMON_DTOOL_LIBS)
  3483. TargetAdd('libpandaexpress.dll', opts=['ADVAPI', 'WINSOCK2', 'OPENSSL', 'ZLIB', 'WINGDI', 'WINUSER', 'ANDROID'])
  3484. #
  3485. # DIRECTORY: panda/src/pipeline/
  3486. #
  3487. if (not RUNTIME):
  3488. OPTS=['DIR:panda/src/pipeline', 'BUILDING:PANDA']
  3489. TargetAdd('p3pipeline_composite1.obj', opts=OPTS, input='p3pipeline_composite1.cxx')
  3490. TargetAdd('p3pipeline_composite2.obj', opts=OPTS, input='p3pipeline_composite2.cxx')
  3491. TargetAdd('p3pipeline_contextSwitch.obj', opts=OPTS, input='contextSwitch.c')
  3492. OPTS=['DIR:panda/src/pipeline']
  3493. IGATEFILES=GetDirectoryContents('panda/src/pipeline', ["*.h", "*_composite*.cxx"])
  3494. TargetAdd('libp3pipeline.in', opts=OPTS, input=IGATEFILES)
  3495. TargetAdd('libp3pipeline.in', opts=['IMOD:panda3d.core', 'ILIB:libp3pipeline', 'SRCDIR:panda/src/pipeline'])
  3496. PyTargetAdd('p3pipeline_pythonThread.obj', opts=OPTS, input='pythonThread.cxx')
  3497. #
  3498. # DIRECTORY: panda/src/linmath/
  3499. #
  3500. if (not RUNTIME):
  3501. OPTS=['DIR:panda/src/linmath', 'BUILDING:PANDA']
  3502. TargetAdd('p3linmath_composite1.obj', opts=OPTS, input='p3linmath_composite1.cxx')
  3503. TargetAdd('p3linmath_composite2.obj', opts=OPTS, input='p3linmath_composite2.cxx')
  3504. OPTS=['DIR:panda/src/linmath']
  3505. IGATEFILES=GetDirectoryContents('panda/src/linmath', ["*.h", "*_composite*.cxx"])
  3506. for ifile in IGATEFILES[:]:
  3507. if "_src." in ifile:
  3508. IGATEFILES.remove(ifile)
  3509. IGATEFILES.remove('cast_to_double.h')
  3510. IGATEFILES.remove('lmat_ops.h')
  3511. IGATEFILES.remove('cast_to_float.h')
  3512. TargetAdd('libp3linmath.in', opts=OPTS, input=IGATEFILES)
  3513. TargetAdd('libp3linmath.in', opts=['IMOD:panda3d.core', 'ILIB:libp3linmath', 'SRCDIR:panda/src/linmath'])
  3514. #
  3515. # DIRECTORY: panda/src/putil/
  3516. #
  3517. if (not RUNTIME):
  3518. OPTS=['DIR:panda/src/putil', 'BUILDING:PANDA', 'ZLIB']
  3519. TargetAdd('p3putil_composite1.obj', opts=OPTS, input='p3putil_composite1.cxx')
  3520. TargetAdd('p3putil_composite2.obj', opts=OPTS, input='p3putil_composite2.cxx')
  3521. OPTS=['DIR:panda/src/putil', 'ZLIB']
  3522. IGATEFILES=GetDirectoryContents('panda/src/putil', ["*.h", "*_composite*.cxx"])
  3523. IGATEFILES.remove("test_bam.h")
  3524. IGATEFILES.remove("config_util.h")
  3525. TargetAdd('libp3putil.in', opts=OPTS, input=IGATEFILES)
  3526. TargetAdd('libp3putil.in', opts=['IMOD:panda3d.core', 'ILIB:libp3putil', 'SRCDIR:panda/src/putil'])
  3527. PyTargetAdd('p3putil_ext_composite.obj', opts=OPTS, input='p3putil_ext_composite.cxx')
  3528. #
  3529. # DIRECTORY: panda/src/audio/
  3530. #
  3531. if (not RUNTIME):
  3532. OPTS=['DIR:panda/src/audio', 'BUILDING:PANDA']
  3533. TargetAdd('p3audio_composite1.obj', opts=OPTS, input='p3audio_composite1.cxx')
  3534. OPTS=['DIR:panda/src/audio']
  3535. IGATEFILES=["audio.h"]
  3536. TargetAdd('libp3audio.in', opts=OPTS, input=IGATEFILES)
  3537. TargetAdd('libp3audio.in', opts=['IMOD:panda3d.core', 'ILIB:libp3audio', 'SRCDIR:panda/src/audio'])
  3538. #
  3539. # DIRECTORY: panda/src/event/
  3540. #
  3541. if (not RUNTIME):
  3542. OPTS=['DIR:panda/src/event', 'BUILDING:PANDA']
  3543. TargetAdd('p3event_composite1.obj', opts=OPTS, input='p3event_composite1.cxx')
  3544. TargetAdd('p3event_composite2.obj', opts=OPTS, input='p3event_composite2.cxx')
  3545. OPTS=['DIR:panda/src/event']
  3546. PyTargetAdd('p3event_asyncFuture_ext.obj', opts=OPTS, input='asyncFuture_ext.cxx')
  3547. PyTargetAdd('p3event_pythonTask.obj', opts=OPTS, input='pythonTask.cxx')
  3548. IGATEFILES=GetDirectoryContents('panda/src/event', ["*.h", "*_composite*.cxx"])
  3549. TargetAdd('libp3event.in', opts=OPTS, input=IGATEFILES)
  3550. TargetAdd('libp3event.in', opts=['IMOD:panda3d.core', 'ILIB:libp3event', 'SRCDIR:panda/src/event'])
  3551. #
  3552. # DIRECTORY: panda/src/mathutil/
  3553. #
  3554. if (not RUNTIME):
  3555. OPTS=['DIR:panda/src/mathutil', 'BUILDING:PANDA', 'FFTW']
  3556. TargetAdd('p3mathutil_composite1.obj', opts=OPTS, input='p3mathutil_composite1.cxx')
  3557. TargetAdd('p3mathutil_composite2.obj', opts=OPTS, input='p3mathutil_composite2.cxx')
  3558. OPTS=['DIR:panda/src/mathutil', 'FFTW']
  3559. IGATEFILES=GetDirectoryContents('panda/src/mathutil', ["*.h", "*_composite*.cxx"])
  3560. for ifile in IGATEFILES[:]:
  3561. if "_src." in ifile:
  3562. IGATEFILES.remove(ifile)
  3563. TargetAdd('libp3mathutil.in', opts=OPTS, input=IGATEFILES)
  3564. TargetAdd('libp3mathutil.in', opts=['IMOD:panda3d.core', 'ILIB:libp3mathutil', 'SRCDIR:panda/src/mathutil'])
  3565. #
  3566. # DIRECTORY: panda/src/gsgbase/
  3567. #
  3568. if (not RUNTIME):
  3569. OPTS=['DIR:panda/src/gsgbase', 'BUILDING:PANDA']
  3570. TargetAdd('p3gsgbase_composite1.obj', opts=OPTS, input='p3gsgbase_composite1.cxx')
  3571. OPTS=['DIR:panda/src/gsgbase']
  3572. IGATEFILES=GetDirectoryContents('panda/src/gsgbase', ["*.h", "*_composite*.cxx"])
  3573. TargetAdd('libp3gsgbase.in', opts=OPTS, input=IGATEFILES)
  3574. TargetAdd('libp3gsgbase.in', opts=['IMOD:panda3d.core', 'ILIB:libp3gsgbase', 'SRCDIR:panda/src/gsgbase'])
  3575. #
  3576. # DIRECTORY: panda/src/pnmimage/
  3577. #
  3578. if (not RUNTIME):
  3579. OPTS=['DIR:panda/src/pnmimage', 'BUILDING:PANDA', 'ZLIB']
  3580. TargetAdd('p3pnmimage_composite1.obj', opts=OPTS, input='p3pnmimage_composite1.cxx')
  3581. TargetAdd('p3pnmimage_composite2.obj', opts=OPTS, input='p3pnmimage_composite2.cxx')
  3582. TargetAdd('p3pnmimage_convert_srgb_sse2.obj', opts=OPTS+['SSE2'], input='convert_srgb_sse2.cxx')
  3583. OPTS=['DIR:panda/src/pnmimage', 'ZLIB']
  3584. IGATEFILES=GetDirectoryContents('panda/src/pnmimage', ["*.h", "*_composite*.cxx"])
  3585. TargetAdd('libp3pnmimage.in', opts=OPTS, input=IGATEFILES)
  3586. TargetAdd('libp3pnmimage.in', opts=['IMOD:panda3d.core', 'ILIB:libp3pnmimage', 'SRCDIR:panda/src/pnmimage'])
  3587. PyTargetAdd('p3pnmimage_pfmFile_ext.obj', opts=OPTS, input='pfmFile_ext.cxx')
  3588. #
  3589. # DIRECTORY: panda/src/nativenet/
  3590. #
  3591. if (not RUNTIME):
  3592. OPTS=['DIR:panda/src/nativenet', 'OPENSSL', 'BUILDING:PANDA']
  3593. TargetAdd('p3nativenet_composite1.obj', opts=OPTS, input='p3nativenet_composite1.cxx')
  3594. OPTS=['DIR:panda/src/nativenet', 'OPENSSL']
  3595. IGATEFILES=GetDirectoryContents('panda/src/nativenet', ["*.h", "*_composite*.cxx"])
  3596. TargetAdd('libp3nativenet.in', opts=OPTS, input=IGATEFILES)
  3597. TargetAdd('libp3nativenet.in', opts=['IMOD:panda3d.core', 'ILIB:libp3nativenet', 'SRCDIR:panda/src/nativenet'])
  3598. #
  3599. # DIRECTORY: panda/src/net/
  3600. #
  3601. if (not RUNTIME):
  3602. OPTS=['DIR:panda/src/net', 'BUILDING:PANDA']
  3603. TargetAdd('p3net_composite1.obj', opts=OPTS, input='p3net_composite1.cxx')
  3604. TargetAdd('p3net_composite2.obj', opts=OPTS, input='p3net_composite2.cxx')
  3605. OPTS=['DIR:panda/src/net']
  3606. IGATEFILES=GetDirectoryContents('panda/src/net', ["*.h", "*_composite*.cxx"])
  3607. IGATEFILES.remove("datagram_ui.h")
  3608. TargetAdd('libp3net.in', opts=OPTS, input=IGATEFILES)
  3609. TargetAdd('libp3net.in', opts=['IMOD:panda3d.core', 'ILIB:libp3net', 'SRCDIR:panda/src/net'])
  3610. #
  3611. # DIRECTORY: panda/src/pstatclient/
  3612. #
  3613. if (not RUNTIME):
  3614. OPTS=['DIR:panda/src/pstatclient', 'BUILDING:PANDA']
  3615. TargetAdd('p3pstatclient_composite1.obj', opts=OPTS, input='p3pstatclient_composite1.cxx')
  3616. TargetAdd('p3pstatclient_composite2.obj', opts=OPTS, input='p3pstatclient_composite2.cxx')
  3617. OPTS=['DIR:panda/src/pstatclient']
  3618. IGATEFILES=GetDirectoryContents('panda/src/pstatclient', ["*.h", "*_composite*.cxx"])
  3619. IGATEFILES.remove("config_pstats.h")
  3620. TargetAdd('libp3pstatclient.in', opts=OPTS, input=IGATEFILES)
  3621. TargetAdd('libp3pstatclient.in', opts=['IMOD:panda3d.core', 'ILIB:libp3pstatclient', 'SRCDIR:panda/src/pstatclient'])
  3622. #
  3623. # DIRECTORY: panda/src/gobj/
  3624. #
  3625. if (not RUNTIME):
  3626. OPTS=['DIR:panda/src/gobj', 'BUILDING:PANDA', 'NVIDIACG', 'ZLIB', 'SQUISH']
  3627. TargetAdd('p3gobj_composite1.obj', opts=OPTS, input='p3gobj_composite1.cxx')
  3628. TargetAdd('p3gobj_composite2.obj', opts=OPTS+['BIGOBJ'], input='p3gobj_composite2.cxx')
  3629. OPTS=['DIR:panda/src/gobj', 'NVIDIACG', 'ZLIB', 'SQUISH']
  3630. IGATEFILES=GetDirectoryContents('panda/src/gobj', ["*.h", "*_composite*.cxx"])
  3631. if ("cgfx_states.h" in IGATEFILES): IGATEFILES.remove("cgfx_states.h")
  3632. TargetAdd('libp3gobj.in', opts=OPTS, input=IGATEFILES)
  3633. TargetAdd('libp3gobj.in', opts=['IMOD:panda3d.core', 'ILIB:libp3gobj', 'SRCDIR:panda/src/gobj'])
  3634. PyTargetAdd('p3gobj_ext_composite.obj', opts=OPTS, input='p3gobj_ext_composite.cxx')
  3635. #
  3636. # DIRECTORY: panda/src/pgraphnodes/
  3637. #
  3638. if (not RUNTIME):
  3639. OPTS=['DIR:panda/src/pgraphnodes', 'BUILDING:PANDA']
  3640. TargetAdd('p3pgraphnodes_composite1.obj', opts=OPTS, input='p3pgraphnodes_composite1.cxx')
  3641. TargetAdd('p3pgraphnodes_composite2.obj', opts=OPTS, input='p3pgraphnodes_composite2.cxx')
  3642. OPTS=['DIR:panda/src/pgraphnodes']
  3643. IGATEFILES=GetDirectoryContents('panda/src/pgraphnodes', ["*.h", "*_composite*.cxx"])
  3644. TargetAdd('libp3pgraphnodes.in', opts=OPTS, input=IGATEFILES)
  3645. TargetAdd('libp3pgraphnodes.in', opts=['IMOD:panda3d.core', 'ILIB:libp3pgraphnodes', 'SRCDIR:panda/src/pgraphnodes'])
  3646. #
  3647. # DIRECTORY: panda/src/pgraph/
  3648. #
  3649. if (not RUNTIME):
  3650. OPTS=['DIR:panda/src/pgraph', 'BUILDING:PANDA']
  3651. TargetAdd('p3pgraph_nodePath.obj', opts=OPTS, input='nodePath.cxx')
  3652. TargetAdd('p3pgraph_composite1.obj', opts=OPTS, input='p3pgraph_composite1.cxx')
  3653. TargetAdd('p3pgraph_composite2.obj', opts=OPTS, input='p3pgraph_composite2.cxx')
  3654. TargetAdd('p3pgraph_composite3.obj', opts=OPTS, input='p3pgraph_composite3.cxx')
  3655. TargetAdd('p3pgraph_composite4.obj', opts=OPTS, input='p3pgraph_composite4.cxx')
  3656. OPTS=['DIR:panda/src/pgraph']
  3657. IGATEFILES=GetDirectoryContents('panda/src/pgraph', ["*.h", "nodePath.cxx", "*_composite*.cxx"])
  3658. TargetAdd('libp3pgraph.in', opts=OPTS, input=IGATEFILES)
  3659. TargetAdd('libp3pgraph.in', opts=['IMOD:panda3d.core', 'ILIB:libp3pgraph', 'SRCDIR:panda/src/pgraph'])
  3660. PyTargetAdd('p3pgraph_ext_composite.obj', opts=OPTS, input='p3pgraph_ext_composite.cxx')
  3661. #
  3662. # DIRECTORY: panda/src/cull/
  3663. #
  3664. if (not RUNTIME):
  3665. OPTS=['DIR:panda/src/cull', 'BUILDING:PANDA']
  3666. TargetAdd('p3cull_composite1.obj', opts=OPTS, input='p3cull_composite1.cxx')
  3667. TargetAdd('p3cull_composite2.obj', opts=OPTS, input='p3cull_composite2.cxx')
  3668. OPTS=['DIR:panda/src/cull']
  3669. IGATEFILES=GetDirectoryContents('panda/src/cull', ["*.h", "*_composite*.cxx"])
  3670. TargetAdd('libp3cull.in', opts=OPTS, input=IGATEFILES)
  3671. TargetAdd('libp3cull.in', opts=['IMOD:panda3d.core', 'ILIB:libp3cull', 'SRCDIR:panda/src/cull'])
  3672. #
  3673. # DIRECTORY: panda/src/dgraph/
  3674. #
  3675. if (not RUNTIME):
  3676. OPTS=['DIR:panda/src/dgraph', 'BUILDING:PANDA']
  3677. TargetAdd('p3dgraph_composite1.obj', opts=OPTS, input='p3dgraph_composite1.cxx')
  3678. TargetAdd('p3dgraph_composite2.obj', opts=OPTS, input='p3dgraph_composite2.cxx')
  3679. OPTS=['DIR:panda/src/dgraph']
  3680. IGATEFILES=GetDirectoryContents('panda/src/dgraph', ["*.h", "*_composite*.cxx"])
  3681. TargetAdd('libp3dgraph.in', opts=OPTS, input=IGATEFILES)
  3682. TargetAdd('libp3dgraph.in', opts=['IMOD:panda3d.core', 'ILIB:libp3dgraph', 'SRCDIR:panda/src/dgraph'])
  3683. #
  3684. # DIRECTORY: panda/src/device/
  3685. #
  3686. if (not RUNTIME):
  3687. OPTS=['DIR:panda/src/device', 'BUILDING:PANDA']
  3688. TargetAdd('p3device_composite1.obj', opts=OPTS, input='p3device_composite1.cxx')
  3689. TargetAdd('p3device_composite2.obj', opts=OPTS, input='p3device_composite2.cxx')
  3690. OPTS=['DIR:panda/src/device']
  3691. IGATEFILES=GetDirectoryContents('panda/src/device', ["*.h", "*_composite*.cxx"])
  3692. TargetAdd('libp3device.in', opts=OPTS, input=IGATEFILES)
  3693. TargetAdd('libp3device.in', opts=['IMOD:panda3d.core', 'ILIB:libp3device', 'SRCDIR:panda/src/device'])
  3694. #
  3695. # DIRECTORY: panda/src/display/
  3696. #
  3697. if (not RUNTIME):
  3698. OPTS=['DIR:panda/src/display', 'BUILDING:PANDA', 'X11']
  3699. TargetAdd('p3display_graphicsStateGuardian.obj', opts=OPTS, input='graphicsStateGuardian.cxx')
  3700. TargetAdd('p3display_composite1.obj', opts=OPTS, input='p3display_composite1.cxx')
  3701. TargetAdd('p3display_composite2.obj', opts=OPTS, input='p3display_composite2.cxx')
  3702. OPTS=['DIR:panda/src/display', 'X11']
  3703. IGATEFILES=GetDirectoryContents('panda/src/display', ["*.h", "*_composite*.cxx"])
  3704. IGATEFILES.remove("renderBuffer.h")
  3705. TargetAdd('libp3display.in', opts=OPTS, input=IGATEFILES)
  3706. TargetAdd('libp3display.in', opts=['IMOD:panda3d.core', 'ILIB:libp3display', 'SRCDIR:panda/src/display'])
  3707. PyTargetAdd('p3display_ext_composite.obj', opts=OPTS, input='p3display_ext_composite.cxx')
  3708. if RTDIST and GetTarget() == 'darwin':
  3709. OPTS=['DIR:panda/src/display']
  3710. TargetAdd('subprocessWindowBuffer.obj', opts=OPTS, input='subprocessWindowBuffer.cxx')
  3711. TargetAdd('libp3subprocbuffer.ilb', input='subprocessWindowBuffer.obj')
  3712. #
  3713. # DIRECTORY: panda/src/chan/
  3714. #
  3715. if (not RUNTIME):
  3716. OPTS=['DIR:panda/src/chan', 'BUILDING:PANDA']
  3717. TargetAdd('p3chan_composite1.obj', opts=OPTS, input='p3chan_composite1.cxx')
  3718. TargetAdd('p3chan_composite2.obj', opts=OPTS, input='p3chan_composite2.cxx')
  3719. OPTS=['DIR:panda/src/chan']
  3720. IGATEFILES=GetDirectoryContents('panda/src/chan', ["*.h", "*_composite*.cxx"])
  3721. IGATEFILES.remove('movingPart.h')
  3722. IGATEFILES.remove('animChannelFixed.h')
  3723. TargetAdd('libp3chan.in', opts=OPTS, input=IGATEFILES)
  3724. TargetAdd('libp3chan.in', opts=['IMOD:panda3d.core', 'ILIB:libp3chan', 'SRCDIR:panda/src/chan'])
  3725. # DIRECTORY: panda/src/char/
  3726. #
  3727. if (not RUNTIME):
  3728. OPTS=['DIR:panda/src/char', 'BUILDING:PANDA']
  3729. TargetAdd('p3char_composite1.obj', opts=OPTS, input='p3char_composite1.cxx')
  3730. TargetAdd('p3char_composite2.obj', opts=OPTS, input='p3char_composite2.cxx')
  3731. OPTS=['DIR:panda/src/char']
  3732. IGATEFILES=GetDirectoryContents('panda/src/char', ["*.h", "*_composite*.cxx"])
  3733. TargetAdd('libp3char.in', opts=OPTS, input=IGATEFILES)
  3734. TargetAdd('libp3char.in', opts=['IMOD:panda3d.core', 'ILIB:libp3char', 'SRCDIR:panda/src/char'])
  3735. #
  3736. # DIRECTORY: panda/src/pnmtext/
  3737. #
  3738. if (PkgSkip("FREETYPE")==0 and not RUNTIME):
  3739. OPTS=['DIR:panda/src/pnmtext', 'BUILDING:PANDA', 'FREETYPE']
  3740. TargetAdd('p3pnmtext_composite1.obj', opts=OPTS, input='p3pnmtext_composite1.cxx')
  3741. OPTS=['DIR:panda/src/pnmtext', 'FREETYPE']
  3742. IGATEFILES=GetDirectoryContents('panda/src/pnmtext', ["*.h", "*_composite*.cxx"])
  3743. TargetAdd('libp3pnmtext.in', opts=OPTS, input=IGATEFILES)
  3744. TargetAdd('libp3pnmtext.in', opts=['IMOD:panda3d.core', 'ILIB:libp3pnmtext', 'SRCDIR:panda/src/pnmtext'])
  3745. #
  3746. # DIRECTORY: panda/src/text/
  3747. #
  3748. if (not RUNTIME):
  3749. if not PkgSkip("HARFBUZZ"):
  3750. DefSymbol("HARFBUZZ", "HAVE_HARFBUZZ")
  3751. OPTS=['DIR:panda/src/text', 'BUILDING:PANDA', 'ZLIB', 'FREETYPE', 'HARFBUZZ']
  3752. TargetAdd('p3text_composite1.obj', opts=OPTS, input='p3text_composite1.cxx')
  3753. TargetAdd('p3text_composite2.obj', opts=OPTS, input='p3text_composite2.cxx')
  3754. OPTS=['DIR:panda/src/text', 'ZLIB', 'FREETYPE']
  3755. IGATEFILES=GetDirectoryContents('panda/src/text', ["*.h", "*_composite*.cxx"])
  3756. TargetAdd('libp3text.in', opts=OPTS, input=IGATEFILES)
  3757. TargetAdd('libp3text.in', opts=['IMOD:panda3d.core', 'ILIB:libp3text', 'SRCDIR:panda/src/text'])
  3758. #
  3759. # DIRECTORY: panda/src/movies/
  3760. #
  3761. if (not RUNTIME):
  3762. OPTS=['DIR:panda/src/movies', 'BUILDING:PANDA', 'VORBIS', 'OPUS']
  3763. TargetAdd('p3movies_composite1.obj', opts=OPTS, input='p3movies_composite1.cxx')
  3764. OPTS=['DIR:panda/src/movies', 'VORBIS', 'OPUS']
  3765. IGATEFILES=GetDirectoryContents('panda/src/movies', ["*.h", "*_composite*.cxx"])
  3766. TargetAdd('libp3movies.in', opts=OPTS, input=IGATEFILES)
  3767. TargetAdd('libp3movies.in', opts=['IMOD:panda3d.core', 'ILIB:libp3movies', 'SRCDIR:panda/src/movies'])
  3768. #
  3769. # DIRECTORY: panda/src/grutil/
  3770. #
  3771. if (not RUNTIME):
  3772. OPTS=['DIR:panda/src/grutil', 'BUILDING:PANDA']
  3773. TargetAdd('p3grutil_multitexReducer.obj', opts=OPTS, input='multitexReducer.cxx')
  3774. TargetAdd('p3grutil_composite1.obj', opts=OPTS, input='p3grutil_composite1.cxx')
  3775. TargetAdd('p3grutil_composite2.obj', opts=OPTS, input='p3grutil_composite2.cxx')
  3776. OPTS=['DIR:panda/src/grutil']
  3777. IGATEFILES=GetDirectoryContents('panda/src/grutil', ["*.h", "*_composite*.cxx"])
  3778. if 'convexHull.h' in IGATEFILES: IGATEFILES.remove('convexHull.h')
  3779. TargetAdd('libp3grutil.in', opts=OPTS, input=IGATEFILES)
  3780. TargetAdd('libp3grutil.in', opts=['IMOD:panda3d.core', 'ILIB:libp3grutil', 'SRCDIR:panda/src/grutil'])
  3781. #
  3782. # DIRECTORY: panda/src/tform/
  3783. #
  3784. if (not RUNTIME):
  3785. OPTS=['DIR:panda/src/tform', 'BUILDING:PANDA']
  3786. TargetAdd('p3tform_composite1.obj', opts=OPTS, input='p3tform_composite1.cxx')
  3787. TargetAdd('p3tform_composite2.obj', opts=OPTS, input='p3tform_composite2.cxx')
  3788. OPTS=['DIR:panda/src/tform']
  3789. IGATEFILES=GetDirectoryContents('panda/src/tform', ["*.h", "*_composite*.cxx"])
  3790. TargetAdd('libp3tform.in', opts=OPTS, input=IGATEFILES)
  3791. TargetAdd('libp3tform.in', opts=['IMOD:panda3d.core', 'ILIB:libp3tform', 'SRCDIR:panda/src/tform'])
  3792. #
  3793. # DIRECTORY: panda/src/collide/
  3794. #
  3795. if (not RUNTIME):
  3796. OPTS=['DIR:panda/src/collide', 'BUILDING:PANDA']
  3797. TargetAdd('p3collide_composite1.obj', opts=OPTS, input='p3collide_composite1.cxx')
  3798. TargetAdd('p3collide_composite2.obj', opts=OPTS, input='p3collide_composite2.cxx')
  3799. OPTS=['DIR:panda/src/collide']
  3800. IGATEFILES=GetDirectoryContents('panda/src/collide', ["*.h", "*_composite*.cxx"])
  3801. TargetAdd('libp3collide.in', opts=OPTS, input=IGATEFILES)
  3802. TargetAdd('libp3collide.in', opts=['IMOD:panda3d.core', 'ILIB:libp3collide', 'SRCDIR:panda/src/collide'])
  3803. PyTargetAdd('p3collide_ext_composite.obj', opts=OPTS, input='p3collide_ext_composite.cxx')
  3804. #
  3805. # DIRECTORY: panda/src/parametrics/
  3806. #
  3807. if (not RUNTIME):
  3808. OPTS=['DIR:panda/src/parametrics', 'BUILDING:PANDA']
  3809. TargetAdd('p3parametrics_composite1.obj', opts=OPTS, input='p3parametrics_composite1.cxx')
  3810. TargetAdd('p3parametrics_composite2.obj', opts=OPTS, input='p3parametrics_composite2.cxx')
  3811. OPTS=['DIR:panda/src/parametrics']
  3812. IGATEFILES=GetDirectoryContents('panda/src/parametrics', ["*.h", "*_composite*.cxx"])
  3813. TargetAdd('libp3parametrics.in', opts=OPTS, input=IGATEFILES)
  3814. TargetAdd('libp3parametrics.in', opts=['IMOD:panda3d.core', 'ILIB:libp3parametrics', 'SRCDIR:panda/src/parametrics'])
  3815. #
  3816. # DIRECTORY: panda/src/pgui/
  3817. #
  3818. if (not RUNTIME):
  3819. OPTS=['DIR:panda/src/pgui', 'BUILDING:PANDA']
  3820. TargetAdd('p3pgui_composite1.obj', opts=OPTS, input='p3pgui_composite1.cxx')
  3821. TargetAdd('p3pgui_composite2.obj', opts=OPTS, input='p3pgui_composite2.cxx')
  3822. OPTS=['DIR:panda/src/pgui']
  3823. IGATEFILES=GetDirectoryContents('panda/src/pgui', ["*.h", "*_composite*.cxx"])
  3824. TargetAdd('libp3pgui.in', opts=OPTS, input=IGATEFILES)
  3825. TargetAdd('libp3pgui.in', opts=['IMOD:panda3d.core', 'ILIB:libp3pgui', 'SRCDIR:panda/src/pgui'])
  3826. #
  3827. # DIRECTORY: panda/src/pnmimagetypes/
  3828. #
  3829. if (not RUNTIME):
  3830. OPTS=['DIR:panda/src/pnmimagetypes', 'DIR:panda/src/pnmimage', 'BUILDING:PANDA', 'PNG', 'ZLIB', 'JPEG', 'TIFF', 'OPENEXR', 'EXCEPTIONS']
  3831. TargetAdd('p3pnmimagetypes_composite1.obj', opts=OPTS, input='p3pnmimagetypes_composite1.cxx')
  3832. TargetAdd('p3pnmimagetypes_composite2.obj', opts=OPTS, input='p3pnmimagetypes_composite2.cxx')
  3833. #
  3834. # DIRECTORY: panda/src/recorder/
  3835. #
  3836. if (not RUNTIME):
  3837. OPTS=['DIR:panda/src/recorder', 'BUILDING:PANDA']
  3838. TargetAdd('p3recorder_composite1.obj', opts=OPTS, input='p3recorder_composite1.cxx')
  3839. TargetAdd('p3recorder_composite2.obj', opts=OPTS, input='p3recorder_composite2.cxx')
  3840. OPTS=['DIR:panda/src/recorder']
  3841. IGATEFILES=GetDirectoryContents('panda/src/recorder', ["*.h", "*_composite*.cxx"])
  3842. TargetAdd('libp3recorder.in', opts=OPTS, input=IGATEFILES)
  3843. TargetAdd('libp3recorder.in', opts=['IMOD:panda3d.core', 'ILIB:libp3recorder', 'SRCDIR:panda/src/recorder'])
  3844. #
  3845. # DIRECTORY: panda/src/dxml/
  3846. #
  3847. DefSymbol("TINYXML", "TIXML_USE_STL", "")
  3848. OPTS=['DIR:panda/src/dxml', 'TINYXML']
  3849. TargetAdd('tinyxml_composite1.obj', opts=OPTS, input='tinyxml_composite1.cxx')
  3850. TargetAdd('libp3tinyxml.ilb', input='tinyxml_composite1.obj')
  3851. if (not RUNTIME):
  3852. OPTS=['DIR:panda/src/dxml', 'BUILDING:PANDA', 'TINYXML']
  3853. TargetAdd('p3dxml_composite1.obj', opts=OPTS, input='p3dxml_composite1.cxx')
  3854. OPTS=['DIR:panda/src/dxml', 'TINYXML']
  3855. IGATEFILES=GetDirectoryContents('panda/src/dxml', ["*.h", "p3dxml_composite1.cxx"])
  3856. TargetAdd('libp3dxml.in', opts=OPTS, input=IGATEFILES)
  3857. TargetAdd('libp3dxml.in', opts=['IMOD:panda3d.core', 'ILIB:libp3dxml', 'SRCDIR:panda/src/dxml'])
  3858. #
  3859. # DIRECTORY: panda/metalibs/panda/
  3860. #
  3861. if (not RUNTIME):
  3862. OPTS=['DIR:panda/metalibs/panda', 'BUILDING:PANDA', 'JPEG', 'PNG', 'HARFBUZZ',
  3863. 'TIFF', 'OPENEXR', 'ZLIB', 'OPENSSL', 'FREETYPE', 'FFTW', 'ADVAPI', 'WINSOCK2',
  3864. 'SQUISH', 'NVIDIACG', 'VORBIS', 'OPUS', 'WINUSER', 'WINMM', 'WINGDI', 'IPHLPAPI',
  3865. 'SETUPAPI']
  3866. TargetAdd('panda_panda.obj', opts=OPTS, input='panda.cxx')
  3867. TargetAdd('libpanda.dll', input='panda_panda.obj')
  3868. TargetAdd('libpanda.dll', input='p3recorder_composite1.obj')
  3869. TargetAdd('libpanda.dll', input='p3recorder_composite2.obj')
  3870. TargetAdd('libpanda.dll', input='p3pgraphnodes_composite1.obj')
  3871. TargetAdd('libpanda.dll', input='p3pgraphnodes_composite2.obj')
  3872. TargetAdd('libpanda.dll', input='p3pgraph_nodePath.obj')
  3873. TargetAdd('libpanda.dll', input='p3pgraph_composite1.obj')
  3874. TargetAdd('libpanda.dll', input='p3pgraph_composite2.obj')
  3875. TargetAdd('libpanda.dll', input='p3pgraph_composite3.obj')
  3876. TargetAdd('libpanda.dll', input='p3pgraph_composite4.obj')
  3877. TargetAdd('libpanda.dll', input='p3cull_composite1.obj')
  3878. TargetAdd('libpanda.dll', input='p3cull_composite2.obj')
  3879. TargetAdd('libpanda.dll', input='p3movies_composite1.obj')
  3880. TargetAdd('libpanda.dll', input='p3grutil_multitexReducer.obj')
  3881. TargetAdd('libpanda.dll', input='p3grutil_composite1.obj')
  3882. TargetAdd('libpanda.dll', input='p3grutil_composite2.obj')
  3883. TargetAdd('libpanda.dll', input='p3chan_composite1.obj')
  3884. TargetAdd('libpanda.dll', input='p3chan_composite2.obj')
  3885. TargetAdd('libpanda.dll', input='p3pstatclient_composite1.obj')
  3886. TargetAdd('libpanda.dll', input='p3pstatclient_composite2.obj')
  3887. TargetAdd('libpanda.dll', input='p3char_composite1.obj')
  3888. TargetAdd('libpanda.dll', input='p3char_composite2.obj')
  3889. TargetAdd('libpanda.dll', input='p3collide_composite1.obj')
  3890. TargetAdd('libpanda.dll', input='p3collide_composite2.obj')
  3891. TargetAdd('libpanda.dll', input='p3device_composite1.obj')
  3892. TargetAdd('libpanda.dll', input='p3device_composite2.obj')
  3893. TargetAdd('libpanda.dll', input='p3dgraph_composite1.obj')
  3894. TargetAdd('libpanda.dll', input='p3dgraph_composite2.obj')
  3895. TargetAdd('libpanda.dll', input='p3display_graphicsStateGuardian.obj')
  3896. TargetAdd('libpanda.dll', input='p3display_composite1.obj')
  3897. TargetAdd('libpanda.dll', input='p3display_composite2.obj')
  3898. TargetAdd('libpanda.dll', input='p3pipeline_composite1.obj')
  3899. TargetAdd('libpanda.dll', input='p3pipeline_composite2.obj')
  3900. TargetAdd('libpanda.dll', input='p3pipeline_contextSwitch.obj')
  3901. TargetAdd('libpanda.dll', input='p3event_composite1.obj')
  3902. TargetAdd('libpanda.dll', input='p3event_composite2.obj')
  3903. TargetAdd('libpanda.dll', input='p3gobj_composite1.obj')
  3904. TargetAdd('libpanda.dll', input='p3gobj_composite2.obj')
  3905. TargetAdd('libpanda.dll', input='p3gsgbase_composite1.obj')
  3906. TargetAdd('libpanda.dll', input='p3linmath_composite1.obj')
  3907. TargetAdd('libpanda.dll', input='p3linmath_composite2.obj')
  3908. TargetAdd('libpanda.dll', input='p3mathutil_composite1.obj')
  3909. TargetAdd('libpanda.dll', input='p3mathutil_composite2.obj')
  3910. TargetAdd('libpanda.dll', input='p3parametrics_composite1.obj')
  3911. TargetAdd('libpanda.dll', input='p3parametrics_composite2.obj')
  3912. TargetAdd('libpanda.dll', input='p3pnmimagetypes_composite1.obj')
  3913. TargetAdd('libpanda.dll', input='p3pnmimagetypes_composite2.obj')
  3914. TargetAdd('libpanda.dll', input='p3pnmimage_composite1.obj')
  3915. TargetAdd('libpanda.dll', input='p3pnmimage_composite2.obj')
  3916. TargetAdd('libpanda.dll', input='p3pnmimage_convert_srgb_sse2.obj')
  3917. TargetAdd('libpanda.dll', input='p3text_composite1.obj')
  3918. TargetAdd('libpanda.dll', input='p3text_composite2.obj')
  3919. TargetAdd('libpanda.dll', input='p3tform_composite1.obj')
  3920. TargetAdd('libpanda.dll', input='p3tform_composite2.obj')
  3921. TargetAdd('libpanda.dll', input='p3putil_composite1.obj')
  3922. TargetAdd('libpanda.dll', input='p3putil_composite2.obj')
  3923. TargetAdd('libpanda.dll', input='p3audio_composite1.obj')
  3924. TargetAdd('libpanda.dll', input='p3pgui_composite1.obj')
  3925. TargetAdd('libpanda.dll', input='p3pgui_composite2.obj')
  3926. TargetAdd('libpanda.dll', input='p3net_composite1.obj')
  3927. TargetAdd('libpanda.dll', input='p3net_composite2.obj')
  3928. TargetAdd('libpanda.dll', input='p3nativenet_composite1.obj')
  3929. TargetAdd('libpanda.dll', input='p3pandabase_pandabase.obj')
  3930. TargetAdd('libpanda.dll', input='libpandaexpress.dll')
  3931. TargetAdd('libpanda.dll', input='p3dxml_composite1.obj')
  3932. TargetAdd('libpanda.dll', input='libp3dtoolconfig.dll')
  3933. TargetAdd('libpanda.dll', input='libp3dtool.dll')
  3934. if PkgSkip("FREETYPE")==0:
  3935. TargetAdd('libpanda.dll', input="p3pnmtext_composite1.obj")
  3936. TargetAdd('libpanda.dll', dep='dtool_have_freetype.dat')
  3937. TargetAdd('libpanda.dll', opts=OPTS)
  3938. PyTargetAdd('core_module.obj', input='libp3dtoolbase.in')
  3939. PyTargetAdd('core_module.obj', input='libp3dtoolutil.in')
  3940. PyTargetAdd('core_module.obj', input='libp3prc.in')
  3941. PyTargetAdd('core_module.obj', input='libp3downloader.in')
  3942. PyTargetAdd('core_module.obj', input='libp3express.in')
  3943. PyTargetAdd('core_module.obj', input='libp3recorder.in')
  3944. PyTargetAdd('core_module.obj', input='libp3pgraphnodes.in')
  3945. PyTargetAdd('core_module.obj', input='libp3pgraph.in')
  3946. PyTargetAdd('core_module.obj', input='libp3cull.in')
  3947. PyTargetAdd('core_module.obj', input='libp3grutil.in')
  3948. PyTargetAdd('core_module.obj', input='libp3chan.in')
  3949. PyTargetAdd('core_module.obj', input='libp3pstatclient.in')
  3950. PyTargetAdd('core_module.obj', input='libp3char.in')
  3951. PyTargetAdd('core_module.obj', input='libp3collide.in')
  3952. PyTargetAdd('core_module.obj', input='libp3device.in')
  3953. PyTargetAdd('core_module.obj', input='libp3dgraph.in')
  3954. PyTargetAdd('core_module.obj', input='libp3display.in')
  3955. PyTargetAdd('core_module.obj', input='libp3pipeline.in')
  3956. PyTargetAdd('core_module.obj', input='libp3event.in')
  3957. PyTargetAdd('core_module.obj', input='libp3gobj.in')
  3958. PyTargetAdd('core_module.obj', input='libp3gsgbase.in')
  3959. PyTargetAdd('core_module.obj', input='libp3linmath.in')
  3960. PyTargetAdd('core_module.obj', input='libp3mathutil.in')
  3961. PyTargetAdd('core_module.obj', input='libp3parametrics.in')
  3962. PyTargetAdd('core_module.obj', input='libp3pnmimage.in')
  3963. PyTargetAdd('core_module.obj', input='libp3text.in')
  3964. PyTargetAdd('core_module.obj', input='libp3tform.in')
  3965. PyTargetAdd('core_module.obj', input='libp3putil.in')
  3966. PyTargetAdd('core_module.obj', input='libp3audio.in')
  3967. PyTargetAdd('core_module.obj', input='libp3nativenet.in')
  3968. PyTargetAdd('core_module.obj', input='libp3net.in')
  3969. PyTargetAdd('core_module.obj', input='libp3pgui.in')
  3970. PyTargetAdd('core_module.obj', input='libp3movies.in')
  3971. PyTargetAdd('core_module.obj', input='libp3dxml.in')
  3972. if PkgSkip("FREETYPE")==0:
  3973. PyTargetAdd('core_module.obj', input='libp3pnmtext.in')
  3974. PyTargetAdd('core_module.obj', opts=['IMOD:panda3d.core', 'ILIB:core'])
  3975. PyTargetAdd('core.pyd', input='libp3dtoolbase_igate.obj')
  3976. PyTargetAdd('core.pyd', input='p3dtoolbase_typeHandle_ext.obj')
  3977. PyTargetAdd('core.pyd', input='libp3dtoolutil_igate.obj')
  3978. PyTargetAdd('core.pyd', input='p3dtoolutil_ext_composite.obj')
  3979. PyTargetAdd('core.pyd', input='libp3prc_igate.obj')
  3980. PyTargetAdd('core.pyd', input='p3prc_ext_composite.obj')
  3981. PyTargetAdd('core.pyd', input='libp3downloader_igate.obj')
  3982. PyTargetAdd('core.pyd', input='p3downloader_stringStream_ext.obj')
  3983. PyTargetAdd('core.pyd', input='p3express_ext_composite.obj')
  3984. PyTargetAdd('core.pyd', input='libp3express_igate.obj')
  3985. PyTargetAdd('core.pyd', input='libp3recorder_igate.obj')
  3986. PyTargetAdd('core.pyd', input='libp3pgraphnodes_igate.obj')
  3987. PyTargetAdd('core.pyd', input='libp3pgraph_igate.obj')
  3988. PyTargetAdd('core.pyd', input='libp3movies_igate.obj')
  3989. PyTargetAdd('core.pyd', input='libp3grutil_igate.obj')
  3990. PyTargetAdd('core.pyd', input='libp3chan_igate.obj')
  3991. PyTargetAdd('core.pyd', input='libp3pstatclient_igate.obj')
  3992. PyTargetAdd('core.pyd', input='libp3char_igate.obj')
  3993. PyTargetAdd('core.pyd', input='libp3collide_igate.obj')
  3994. PyTargetAdd('core.pyd', input='libp3device_igate.obj')
  3995. PyTargetAdd('core.pyd', input='libp3dgraph_igate.obj')
  3996. PyTargetAdd('core.pyd', input='libp3display_igate.obj')
  3997. PyTargetAdd('core.pyd', input='libp3pipeline_igate.obj')
  3998. PyTargetAdd('core.pyd', input='libp3event_igate.obj')
  3999. PyTargetAdd('core.pyd', input='libp3gobj_igate.obj')
  4000. PyTargetAdd('core.pyd', input='libp3gsgbase_igate.obj')
  4001. PyTargetAdd('core.pyd', input='libp3linmath_igate.obj')
  4002. PyTargetAdd('core.pyd', input='libp3mathutil_igate.obj')
  4003. PyTargetAdd('core.pyd', input='libp3parametrics_igate.obj')
  4004. PyTargetAdd('core.pyd', input='libp3pnmimage_igate.obj')
  4005. PyTargetAdd('core.pyd', input='libp3text_igate.obj')
  4006. PyTargetAdd('core.pyd', input='libp3tform_igate.obj')
  4007. PyTargetAdd('core.pyd', input='libp3putil_igate.obj')
  4008. PyTargetAdd('core.pyd', input='libp3audio_igate.obj')
  4009. PyTargetAdd('core.pyd', input='libp3pgui_igate.obj')
  4010. PyTargetAdd('core.pyd', input='libp3net_igate.obj')
  4011. PyTargetAdd('core.pyd', input='libp3nativenet_igate.obj')
  4012. PyTargetAdd('core.pyd', input='libp3dxml_igate.obj')
  4013. if PkgSkip("FREETYPE")==0:
  4014. PyTargetAdd('core.pyd', input="libp3pnmtext_igate.obj")
  4015. PyTargetAdd('core.pyd', input='p3collide_ext_composite.obj')
  4016. PyTargetAdd('core.pyd', input='p3pipeline_pythonThread.obj')
  4017. PyTargetAdd('core.pyd', input='p3putil_ext_composite.obj')
  4018. PyTargetAdd('core.pyd', input='p3pnmimage_pfmFile_ext.obj')
  4019. PyTargetAdd('core.pyd', input='p3event_asyncFuture_ext.obj')
  4020. PyTargetAdd('core.pyd', input='p3event_pythonTask.obj')
  4021. PyTargetAdd('core.pyd', input='p3gobj_ext_composite.obj')
  4022. PyTargetAdd('core.pyd', input='p3pgraph_ext_composite.obj')
  4023. PyTargetAdd('core.pyd', input='p3display_ext_composite.obj')
  4024. PyTargetAdd('core.pyd', input='core_module.obj')
  4025. if not GetLinkAllStatic() and GetTarget() != 'emscripten':
  4026. PyTargetAdd('core.pyd', input='libp3tinyxml.ilb')
  4027. PyTargetAdd('core.pyd', input='libp3interrogatedb.dll')
  4028. PyTargetAdd('core.pyd', input=COMMON_PANDA_LIBS)
  4029. PyTargetAdd('core.pyd', opts=['WINSOCK2'])
  4030. #
  4031. # DIRECTORY: panda/src/vision/
  4032. #
  4033. if (PkgSkip("VISION") == 0) and (not RUNTIME):
  4034. # We want to know whether we have ffmpeg so that we can override the .avi association.
  4035. if not PkgSkip("FFMPEG"):
  4036. DefSymbol("OPENCV", "HAVE_FFMPEG")
  4037. if not PkgSkip("OPENCV"):
  4038. DefSymbol("OPENCV", "HAVE_OPENCV")
  4039. if OPENCV_VER_23:
  4040. DefSymbol("OPENCV", "OPENCV_VER_23")
  4041. OPTS=['DIR:panda/src/vision', 'BUILDING:VISION', 'ARTOOLKIT', 'OPENCV', 'DX9', 'DIRECTCAM', 'JPEG', 'EXCEPTIONS']
  4042. TargetAdd('p3vision_composite1.obj', opts=OPTS, input='p3vision_composite1.cxx', dep=[
  4043. 'dtool_have_ffmpeg.dat',
  4044. 'dtool_have_opencv.dat',
  4045. 'dtool_have_directcam.dat',
  4046. ])
  4047. TargetAdd('libp3vision.dll', input='p3vision_composite1.obj')
  4048. TargetAdd('libp3vision.dll', input=COMMON_PANDA_LIBS)
  4049. TargetAdd('libp3vision.dll', opts=OPTS)
  4050. OPTS=['DIR:panda/src/vision', 'ARTOOLKIT', 'OPENCV', 'DX9', 'DIRECTCAM', 'JPEG', 'EXCEPTIONS']
  4051. IGATEFILES=GetDirectoryContents('panda/src/vision', ["*.h", "*_composite*.cxx"])
  4052. TargetAdd('libp3vision.in', opts=OPTS, input=IGATEFILES)
  4053. TargetAdd('libp3vision.in', opts=['IMOD:panda3d.vision', 'ILIB:libp3vision', 'SRCDIR:panda/src/vision'])
  4054. PyTargetAdd('vision_module.obj', input='libp3vision.in')
  4055. PyTargetAdd('vision_module.obj', opts=OPTS)
  4056. PyTargetAdd('vision_module.obj', opts=['IMOD:panda3d.vision', 'ILIB:vision', 'IMPORT:panda3d.core'])
  4057. PyTargetAdd('vision.pyd', input='vision_module.obj')
  4058. PyTargetAdd('vision.pyd', input='libp3vision_igate.obj')
  4059. PyTargetAdd('vision.pyd', input='libp3vision.dll')
  4060. PyTargetAdd('vision.pyd', input='libp3interrogatedb.dll')
  4061. PyTargetAdd('vision.pyd', input=COMMON_PANDA_LIBS)
  4062. #
  4063. # DIRECTORY: panda/src/rocket/
  4064. #
  4065. if (PkgSkip("ROCKET") == 0) and (not RUNTIME):
  4066. OPTS=['DIR:panda/src/rocket', 'BUILDING:ROCKET', 'ROCKET', 'PYTHON', 'NOARCH:ARM64']
  4067. TargetAdd('p3rocket_composite1.obj', opts=OPTS, input='p3rocket_composite1.cxx')
  4068. TargetAdd('libp3rocket.dll', input='p3rocket_composite1.obj')
  4069. TargetAdd('libp3rocket.dll', input=COMMON_PANDA_LIBS)
  4070. TargetAdd('libp3rocket.dll', opts=OPTS)
  4071. OPTS=['DIR:panda/src/rocket', 'ROCKET', 'RTTI', 'EXCEPTIONS', 'NOARCH:ARM64']
  4072. IGATEFILES=GetDirectoryContents('panda/src/rocket', ["rocketInputHandler.h",
  4073. "rocketInputHandler.cxx", "rocketRegion.h", "rocketRegion.cxx", "rocketRegion_ext.h"])
  4074. TargetAdd('libp3rocket.in', opts=OPTS, input=IGATEFILES)
  4075. TargetAdd('libp3rocket.in', opts=['IMOD:panda3d.rocket', 'ILIB:libp3rocket', 'SRCDIR:panda/src/rocket'])
  4076. PyTargetAdd('p3rocket_rocketRegion_ext.obj', opts=OPTS, input='rocketRegion_ext.cxx')
  4077. PyTargetAdd('rocket_module.obj', input='libp3rocket.in')
  4078. PyTargetAdd('rocket_module.obj', opts=OPTS)
  4079. PyTargetAdd('rocket_module.obj', opts=['IMOD:panda3d.rocket', 'ILIB:rocket', 'IMPORT:panda3d.core'])
  4080. PyTargetAdd('rocket.pyd', input='rocket_module.obj')
  4081. PyTargetAdd('rocket.pyd', input='libp3rocket_igate.obj')
  4082. PyTargetAdd('rocket.pyd', input='p3rocket_rocketRegion_ext.obj')
  4083. PyTargetAdd('rocket.pyd', input='libp3rocket.dll')
  4084. PyTargetAdd('rocket.pyd', input='libp3interrogatedb.dll')
  4085. PyTargetAdd('rocket.pyd', input=COMMON_PANDA_LIBS)
  4086. PyTargetAdd('rocket.pyd', opts=['ROCKET', 'NOARCH:ARM64'])
  4087. #
  4088. # DIRECTORY: panda/src/p3skel
  4089. #
  4090. if (PkgSkip('SKEL')==0) and (not RUNTIME):
  4091. OPTS=['DIR:panda/src/skel', 'BUILDING:PANDASKEL', 'ADVAPI']
  4092. TargetAdd('p3skel_composite1.obj', opts=OPTS, input='p3skel_composite1.cxx')
  4093. OPTS=['DIR:panda/src/skel', 'ADVAPI']
  4094. IGATEFILES=GetDirectoryContents("panda/src/skel", ["*.h", "*_composite*.cxx"])
  4095. TargetAdd('libp3skel.in', opts=OPTS, input=IGATEFILES)
  4096. TargetAdd('libp3skel.in', opts=['IMOD:panda3d.skel', 'ILIB:libp3skel', 'SRCDIR:panda/src/skel'])
  4097. #
  4098. # DIRECTORY: panda/src/p3skel
  4099. #
  4100. if (PkgSkip('SKEL')==0) and (not RUNTIME):
  4101. OPTS=['BUILDING:PANDASKEL', 'ADVAPI']
  4102. TargetAdd('libpandaskel.dll', input='p3skel_composite1.obj')
  4103. TargetAdd('libpandaskel.dll', input=COMMON_PANDA_LIBS)
  4104. TargetAdd('libpandaskel.dll', opts=OPTS)
  4105. PyTargetAdd('skel_module.obj', input='libp3skel.in')
  4106. PyTargetAdd('skel_module.obj', opts=['IMOD:panda3d.skel', 'ILIB:skel', 'IMPORT:panda3d.core'])
  4107. PyTargetAdd('skel.pyd', input='skel_module.obj')
  4108. PyTargetAdd('skel.pyd', input='libp3skel_igate.obj')
  4109. PyTargetAdd('skel.pyd', input='libpandaskel.dll')
  4110. PyTargetAdd('skel.pyd', input='libp3interrogatedb.dll')
  4111. PyTargetAdd('skel.pyd', input=COMMON_PANDA_LIBS)
  4112. #
  4113. # DIRECTORY: panda/src/distort/
  4114. #
  4115. if (PkgSkip('PANDAFX')==0) and (not RUNTIME):
  4116. OPTS=['DIR:panda/src/distort', 'BUILDING:PANDAFX']
  4117. TargetAdd('p3distort_composite1.obj', opts=OPTS, input='p3distort_composite1.cxx')
  4118. OPTS=['DIR:panda/metalibs/pandafx', 'DIR:panda/src/distort', 'NVIDIACG']
  4119. IGATEFILES=GetDirectoryContents('panda/src/distort', ["*.h", "*_composite*.cxx"])
  4120. TargetAdd('libp3distort.in', opts=OPTS, input=IGATEFILES)
  4121. TargetAdd('libp3distort.in', opts=['IMOD:panda3d.fx', 'ILIB:libp3distort', 'SRCDIR:panda/src/distort'])
  4122. #
  4123. # DIRECTORY: panda/metalibs/pandafx/
  4124. #
  4125. if (PkgSkip('PANDAFX')==0) and (not RUNTIME):
  4126. OPTS=['DIR:panda/metalibs/pandafx', 'DIR:panda/src/distort', 'BUILDING:PANDAFX', 'NVIDIACG']
  4127. TargetAdd('pandafx_pandafx.obj', opts=OPTS, input='pandafx.cxx')
  4128. TargetAdd('libpandafx.dll', input='pandafx_pandafx.obj')
  4129. TargetAdd('libpandafx.dll', input='p3distort_composite1.obj')
  4130. TargetAdd('libpandafx.dll', input=COMMON_PANDA_LIBS)
  4131. TargetAdd('libpandafx.dll', opts=['ADVAPI', 'NVIDIACG'])
  4132. OPTS=['DIR:panda/metalibs/pandafx', 'DIR:panda/src/distort', 'NVIDIACG']
  4133. PyTargetAdd('fx_module.obj', input='libp3distort.in')
  4134. PyTargetAdd('fx_module.obj', opts=OPTS)
  4135. PyTargetAdd('fx_module.obj', opts=['IMOD:panda3d.fx', 'ILIB:fx', 'IMPORT:panda3d.core'])
  4136. PyTargetAdd('fx.pyd', input='fx_module.obj')
  4137. PyTargetAdd('fx.pyd', input='libp3distort_igate.obj')
  4138. PyTargetAdd('fx.pyd', input='libpandafx.dll')
  4139. PyTargetAdd('fx.pyd', input='libp3interrogatedb.dll')
  4140. PyTargetAdd('fx.pyd', input=COMMON_PANDA_LIBS)
  4141. #
  4142. # DIRECTORY: panda/src/vrpn/
  4143. #
  4144. if (PkgSkip("VRPN")==0 and not RUNTIME):
  4145. OPTS=['DIR:panda/src/vrpn', 'BUILDING:VRPN', 'VRPN']
  4146. TargetAdd('p3vrpn_composite1.obj', opts=OPTS, input='p3vrpn_composite1.cxx')
  4147. TargetAdd('libp3vrpn.dll', input='p3vrpn_composite1.obj')
  4148. TargetAdd('libp3vrpn.dll', input=COMMON_PANDA_LIBS)
  4149. TargetAdd('libp3vrpn.dll', opts=['VRPN'])
  4150. OPTS=['DIR:panda/src/vrpn', 'VRPN']
  4151. IGATEFILES=GetDirectoryContents('panda/src/vrpn', ["*.h", "*_composite*.cxx"])
  4152. TargetAdd('libp3vrpn.in', opts=OPTS, input=IGATEFILES)
  4153. TargetAdd('libp3vrpn.in', opts=['IMOD:panda3d.vrpn', 'ILIB:libp3vrpn', 'SRCDIR:panda/src/vrpn'])
  4154. PyTargetAdd('vrpn_module.obj', input='libp3vrpn.in')
  4155. PyTargetAdd('vrpn_module.obj', opts=OPTS)
  4156. PyTargetAdd('vrpn_module.obj', opts=['IMOD:panda3d.vrpn', 'ILIB:vrpn', 'IMPORT:panda3d.core'])
  4157. PyTargetAdd('vrpn.pyd', input='vrpn_module.obj')
  4158. PyTargetAdd('vrpn.pyd', input='libp3vrpn_igate.obj')
  4159. PyTargetAdd('vrpn.pyd', input='libp3vrpn.dll')
  4160. PyTargetAdd('vrpn.pyd', input='libp3interrogatedb.dll')
  4161. PyTargetAdd('vrpn.pyd', input=COMMON_PANDA_LIBS)
  4162. #
  4163. # DIRECTORY: panda/src/ffmpeg
  4164. #
  4165. if PkgSkip("FFMPEG") == 0 and not RUNTIME:
  4166. if not PkgSkip("SWSCALE"):
  4167. DefSymbol("FFMPEG", "HAVE_SWSCALE")
  4168. if not PkgSkip("SWRESAMPLE"):
  4169. DefSymbol("FFMPEG", "HAVE_SWRESAMPLE")
  4170. OPTS=['DIR:panda/src/ffmpeg', 'BUILDING:FFMPEG', 'FFMPEG', 'SWSCALE', 'SWRESAMPLE']
  4171. TargetAdd('p3ffmpeg_composite1.obj', opts=OPTS, input='p3ffmpeg_composite1.cxx', dep=[
  4172. 'dtool_have_swscale.dat', 'dtool_have_swresample.dat'])
  4173. TargetAdd('libp3ffmpeg.dll', input='p3ffmpeg_composite1.obj')
  4174. TargetAdd('libp3ffmpeg.dll', input=COMMON_PANDA_LIBS)
  4175. TargetAdd('libp3ffmpeg.dll', opts=OPTS)
  4176. #
  4177. # DIRECTORY: panda/src/audiotraits/
  4178. #
  4179. if PkgSkip("FMODEX") == 0 and not RUNTIME:
  4180. OPTS=['DIR:panda/src/audiotraits', 'BUILDING:FMOD_AUDIO', 'FMODEX']
  4181. TargetAdd('fmod_audio_fmod_audio_composite1.obj', opts=OPTS, input='fmod_audio_composite1.cxx')
  4182. TargetAdd('libp3fmod_audio.dll', input='fmod_audio_fmod_audio_composite1.obj')
  4183. TargetAdd('libp3fmod_audio.dll', input=COMMON_PANDA_LIBS)
  4184. TargetAdd('libp3fmod_audio.dll', opts=['MODULE', 'ADVAPI', 'WINUSER', 'WINMM', 'FMODEX'])
  4185. if PkgSkip("OPENAL") == 0 and not RUNTIME:
  4186. OPTS=['DIR:panda/src/audiotraits', 'BUILDING:OPENAL_AUDIO', 'OPENAL']
  4187. TargetAdd('openal_audio_openal_audio_composite1.obj', opts=OPTS, input='openal_audio_composite1.cxx')
  4188. TargetAdd('libp3openal_audio.dll', input='openal_audio_openal_audio_composite1.obj')
  4189. TargetAdd('libp3openal_audio.dll', input=COMMON_PANDA_LIBS)
  4190. TargetAdd('libp3openal_audio.dll', opts=['MODULE', 'ADVAPI', 'WINUSER', 'WINMM', 'WINSHELL', 'WINOLE', 'OPENAL'])
  4191. #
  4192. # DIRECTORY: panda/src/downloadertools/
  4193. #
  4194. if (PkgSkip("OPENSSL")==0 and not RTDIST and not RUNTIME and PkgSkip("DEPLOYTOOLS")==0):
  4195. OPTS=['DIR:panda/src/downloadertools', 'ZLIB', 'ADVAPI', 'WINSOCK2', 'WINSHELL', 'WINGDI', 'WINUSER']
  4196. TargetAdd('apply_patch_apply_patch.obj', opts=OPTS, input='apply_patch.cxx')
  4197. TargetAdd('apply_patch.exe', input=['apply_patch_apply_patch.obj'])
  4198. TargetAdd('apply_patch.exe', input=COMMON_PANDA_LIBS)
  4199. TargetAdd('apply_patch.exe', opts=OPTS)
  4200. TargetAdd('build_patch_build_patch.obj', opts=OPTS, input='build_patch.cxx')
  4201. TargetAdd('build_patch.exe', input=['build_patch_build_patch.obj'])
  4202. TargetAdd('build_patch.exe', input=COMMON_PANDA_LIBS)
  4203. TargetAdd('build_patch.exe', opts=OPTS)
  4204. if not PkgSkip("ZLIB"):
  4205. TargetAdd('check_adler_check_adler.obj', opts=OPTS, input='check_adler.cxx')
  4206. TargetAdd('check_adler.exe', input=['check_adler_check_adler.obj'])
  4207. TargetAdd('check_adler.exe', input=COMMON_PANDA_LIBS)
  4208. TargetAdd('check_adler.exe', opts=OPTS)
  4209. TargetAdd('check_crc_check_crc.obj', opts=OPTS, input='check_crc.cxx')
  4210. TargetAdd('check_crc.exe', input=['check_crc_check_crc.obj'])
  4211. TargetAdd('check_crc.exe', input=COMMON_PANDA_LIBS)
  4212. TargetAdd('check_crc.exe', opts=OPTS)
  4213. TargetAdd('check_md5_check_md5.obj', opts=OPTS, input='check_md5.cxx')
  4214. TargetAdd('check_md5.exe', input=['check_md5_check_md5.obj'])
  4215. TargetAdd('check_md5.exe', input=COMMON_PANDA_LIBS)
  4216. TargetAdd('check_md5.exe', opts=OPTS)
  4217. TargetAdd('pdecrypt_pdecrypt.obj', opts=OPTS, input='pdecrypt.cxx')
  4218. TargetAdd('pdecrypt.exe', input=['pdecrypt_pdecrypt.obj'])
  4219. TargetAdd('pdecrypt.exe', input=COMMON_PANDA_LIBS)
  4220. TargetAdd('pdecrypt.exe', opts=OPTS)
  4221. TargetAdd('pencrypt_pencrypt.obj', opts=OPTS, input='pencrypt.cxx')
  4222. TargetAdd('pencrypt.exe', input=['pencrypt_pencrypt.obj'])
  4223. TargetAdd('pencrypt.exe', input=COMMON_PANDA_LIBS)
  4224. TargetAdd('pencrypt.exe', opts=OPTS)
  4225. TargetAdd('show_ddb_show_ddb.obj', opts=OPTS, input='show_ddb.cxx')
  4226. TargetAdd('show_ddb.exe', input=['show_ddb_show_ddb.obj'])
  4227. TargetAdd('show_ddb.exe', input=COMMON_PANDA_LIBS)
  4228. TargetAdd('show_ddb.exe', opts=OPTS)
  4229. #
  4230. # DIRECTORY: panda/src/downloadertools/
  4231. #
  4232. if (PkgSkip("ZLIB")==0 and not RTDIST and not RUNTIME and PkgSkip("DEPLOYTOOLS")==0):
  4233. OPTS=['DIR:panda/src/downloadertools', 'ZLIB', 'ADVAPI', 'WINSOCK2', 'WINSHELL', 'WINGDI', 'WINUSER']
  4234. TargetAdd('multify_multify.obj', opts=OPTS, input='multify.cxx')
  4235. TargetAdd('multify.exe', input=['multify_multify.obj'])
  4236. TargetAdd('multify.exe', input=COMMON_PANDA_LIBS)
  4237. TargetAdd('multify.exe', opts=OPTS)
  4238. TargetAdd('pzip_pzip.obj', opts=OPTS, input='pzip.cxx')
  4239. TargetAdd('pzip.exe', input=['pzip_pzip.obj'])
  4240. TargetAdd('pzip.exe', input=COMMON_PANDA_LIBS)
  4241. TargetAdd('pzip.exe', opts=OPTS)
  4242. TargetAdd('punzip_punzip.obj', opts=OPTS, input='punzip.cxx')
  4243. TargetAdd('punzip.exe', input=['punzip_punzip.obj'])
  4244. TargetAdd('punzip.exe', input=COMMON_PANDA_LIBS)
  4245. TargetAdd('punzip.exe', opts=OPTS)
  4246. #
  4247. # DIRECTORY: panda/src/windisplay/
  4248. #
  4249. if (GetTarget() == 'windows' and not RUNTIME):
  4250. OPTS=['DIR:panda/src/windisplay', 'BUILDING:PANDAWIN']
  4251. TargetAdd('p3windisplay_composite1.obj', opts=OPTS+["BIGOBJ"], input='p3windisplay_composite1.cxx')
  4252. TargetAdd('p3windisplay_windetectdx9.obj', opts=OPTS + ["DX9"], input='winDetectDx9.cxx')
  4253. TargetAdd('libp3windisplay.dll', input='p3windisplay_composite1.obj')
  4254. TargetAdd('libp3windisplay.dll', input='p3windisplay_windetectdx9.obj')
  4255. TargetAdd('libp3windisplay.dll', input=COMMON_PANDA_LIBS)
  4256. TargetAdd('libp3windisplay.dll', opts=['WINIMM', 'WINGDI', 'WINKERNEL', 'WINOLDNAMES', 'WINUSER', 'WINMM',"BIGOBJ"])
  4257. #
  4258. # DIRECTORY: panda/metalibs/pandadx9/
  4259. #
  4260. if GetTarget() == 'windows' and PkgSkip("DX9")==0 and not RUNTIME:
  4261. OPTS=['DIR:panda/src/dxgsg9', 'BUILDING:PANDADX', 'DX9', 'NVIDIACG', 'CGDX9']
  4262. TargetAdd('p3dxgsg9_dxGraphicsStateGuardian9.obj', opts=OPTS, input='dxGraphicsStateGuardian9.cxx')
  4263. TargetAdd('p3dxgsg9_composite1.obj', opts=OPTS, input='p3dxgsg9_composite1.cxx')
  4264. OPTS=['DIR:panda/metalibs/pandadx9', 'BUILDING:PANDADX', 'DX9', 'NVIDIACG', 'CGDX9']
  4265. TargetAdd('pandadx9_pandadx9.obj', opts=OPTS, input='pandadx9.cxx')
  4266. TargetAdd('libpandadx9.dll', input='pandadx9_pandadx9.obj')
  4267. TargetAdd('libpandadx9.dll', input='p3dxgsg9_dxGraphicsStateGuardian9.obj')
  4268. TargetAdd('libpandadx9.dll', input='p3dxgsg9_composite1.obj')
  4269. TargetAdd('libpandadx9.dll', input='libp3windisplay.dll')
  4270. TargetAdd('libpandadx9.dll', input=COMMON_PANDA_LIBS)
  4271. TargetAdd('libpandadx9.dll', opts=['MODULE', 'ADVAPI', 'WINGDI', 'WINKERNEL', 'WINUSER', 'WINMM', 'DX9', 'NVIDIACG', 'CGDX9'])
  4272. #
  4273. # DIRECTORY: panda/src/egg/
  4274. #
  4275. if not RUNTIME and not PkgSkip("EGG"):
  4276. OPTS=['DIR:panda/src/egg', 'BUILDING:PANDAEGG', 'ZLIB', 'BISONPREFIX_eggyy', 'FLEXDASHI', 'FLEXVERSION:2.5.9']
  4277. CreateFile(GetOutputDir()+"/include/parser.h")
  4278. TargetAdd('p3egg_parser.obj', opts=OPTS, input='parser.yxx')
  4279. TargetAdd('parser.h', input='p3egg_parser.obj', opts=['DEPENDENCYONLY'])
  4280. TargetAdd('p3egg_lexer.obj', opts=OPTS, input='lexer.lxx')
  4281. TargetAdd('p3egg_composite1.obj', opts=OPTS, input='p3egg_composite1.cxx')
  4282. TargetAdd('p3egg_composite2.obj', opts=OPTS, input='p3egg_composite2.cxx')
  4283. OPTS=['DIR:panda/src/egg', 'ZLIB']
  4284. IGATEFILES=GetDirectoryContents('panda/src/egg', ["*.h", "*_composite*.cxx"])
  4285. if "parser.h" in IGATEFILES: IGATEFILES.remove("parser.h")
  4286. TargetAdd('libp3egg.in', opts=OPTS, input=IGATEFILES)
  4287. TargetAdd('libp3egg.in', opts=['IMOD:panda3d.egg', 'ILIB:libp3egg', 'SRCDIR:panda/src/egg'])
  4288. PyTargetAdd('p3egg_ext_composite.obj', opts=OPTS, input='p3egg_ext_composite.cxx')
  4289. #
  4290. # DIRECTORY: panda/src/egg2pg/
  4291. #
  4292. if not RUNTIME and not PkgSkip("EGG"):
  4293. OPTS=['DIR:panda/src/egg2pg', 'BUILDING:PANDAEGG']
  4294. TargetAdd('p3egg2pg_composite1.obj', opts=OPTS, input='p3egg2pg_composite1.cxx')
  4295. TargetAdd('p3egg2pg_composite2.obj', opts=OPTS, input='p3egg2pg_composite2.cxx')
  4296. OPTS=['DIR:panda/src/egg2pg']
  4297. IGATEFILES=['load_egg_file.h', 'save_egg_file.h']
  4298. TargetAdd('libp3egg2pg.in', opts=OPTS, input=IGATEFILES)
  4299. TargetAdd('libp3egg2pg.in', opts=['IMOD:panda3d.egg', 'ILIB:libp3egg2pg', 'SRCDIR:panda/src/egg2pg'])
  4300. #
  4301. # DIRECTORY: panda/src/framework/
  4302. #
  4303. if (not RUNTIME):
  4304. deps = []
  4305. # Framework wants to link in a renderer when building statically, so tell it what is available.
  4306. if GetLinkAllStatic():
  4307. deps = ['dtool_have_gl.dat', 'dtool_have_tinydisplay.dat', 'dtool_have_egg.dat']
  4308. if not PkgSkip("GL"):
  4309. DefSymbol("FRAMEWORK", "HAVE_GL")
  4310. if not PkgSkip("TINYDISPLAY"):
  4311. DefSymbol("FRAMEWORK", "HAVE_TINYDISPLAY")
  4312. if not PkgSkip("EGG"):
  4313. DefSymbol("FRAMEWORK", "HAVE_EGG")
  4314. OPTS=['DIR:panda/src/framework', 'BUILDING:FRAMEWORK', 'FRAMEWORK']
  4315. TargetAdd('p3framework_composite1.obj', opts=OPTS, input='p3framework_composite1.cxx', dep=deps)
  4316. TargetAdd('libp3framework.dll', input='p3framework_composite1.obj')
  4317. TargetAdd('libp3framework.dll', input=COMMON_PANDA_LIBS)
  4318. TargetAdd('libp3framework.dll', opts=['ADVAPI'])
  4319. #
  4320. # DIRECTORY: panda/src/glgsg/
  4321. #
  4322. if (not RUNTIME and PkgSkip("GL")==0):
  4323. OPTS=['DIR:panda/src/glgsg', 'DIR:panda/src/glstuff', 'BUILDING:PANDAGL', 'GL', 'NVIDIACG']
  4324. TargetAdd('p3glgsg_config_glgsg.obj', opts=OPTS, input='config_glgsg.cxx')
  4325. TargetAdd('p3glgsg_glgsg.obj', opts=OPTS, input='glgsg.cxx')
  4326. #
  4327. # DIRECTORY: panda/src/glesgsg/
  4328. #
  4329. if (not RUNTIME and PkgSkip("GLES")==0):
  4330. OPTS=['DIR:panda/src/glesgsg', 'DIR:panda/src/glstuff', 'BUILDING:PANDAGLES', 'GLES']
  4331. TargetAdd('p3glesgsg_config_glesgsg.obj', opts=OPTS, input='config_glesgsg.cxx')
  4332. TargetAdd('p3glesgsg_glesgsg.obj', opts=OPTS, input='glesgsg.cxx')
  4333. #
  4334. # DIRECTORY: panda/src/gles2gsg/
  4335. #
  4336. if (not RUNTIME and PkgSkip("GLES2")==0):
  4337. OPTS=['DIR:panda/src/gles2gsg', 'DIR:panda/src/glstuff', 'BUILDING:PANDAGLES2', 'GLES2']
  4338. TargetAdd('p3gles2gsg_config_gles2gsg.obj', opts=OPTS, input='config_gles2gsg.cxx')
  4339. TargetAdd('p3gles2gsg_gles2gsg.obj', opts=OPTS, input='gles2gsg.cxx')
  4340. #
  4341. # DIRECTORY: panda/metalibs/pandaegg/
  4342. #
  4343. if not RUNTIME and not PkgSkip("EGG"):
  4344. OPTS=['DIR:panda/metalibs/pandaegg', 'DIR:panda/src/egg', 'BUILDING:PANDAEGG']
  4345. TargetAdd('pandaegg_pandaegg.obj', opts=OPTS, input='pandaegg.cxx')
  4346. TargetAdd('libpandaegg.dll', input='pandaegg_pandaegg.obj')
  4347. TargetAdd('libpandaegg.dll', input='p3egg2pg_composite1.obj')
  4348. TargetAdd('libpandaegg.dll', input='p3egg2pg_composite2.obj')
  4349. TargetAdd('libpandaegg.dll', input='p3egg_composite1.obj')
  4350. TargetAdd('libpandaegg.dll', input='p3egg_composite2.obj')
  4351. TargetAdd('libpandaegg.dll', input='p3egg_parser.obj')
  4352. TargetAdd('libpandaegg.dll', input='p3egg_lexer.obj')
  4353. TargetAdd('libpandaegg.dll', input=COMMON_PANDA_LIBS)
  4354. TargetAdd('libpandaegg.dll', opts=['ADVAPI'])
  4355. OPTS=['DIR:panda/metalibs/pandaegg', 'DIR:panda/src/egg']
  4356. PyTargetAdd('egg_module.obj', input='libp3egg2pg.in')
  4357. PyTargetAdd('egg_module.obj', input='libp3egg.in')
  4358. PyTargetAdd('egg_module.obj', opts=OPTS)
  4359. PyTargetAdd('egg_module.obj', opts=['IMOD:panda3d.egg', 'ILIB:egg', 'IMPORT:panda3d.core'])
  4360. PyTargetAdd('egg.pyd', input='egg_module.obj')
  4361. PyTargetAdd('egg.pyd', input='p3egg_ext_composite.obj')
  4362. PyTargetAdd('egg.pyd', input='libp3egg_igate.obj')
  4363. PyTargetAdd('egg.pyd', input='libp3egg2pg_igate.obj')
  4364. PyTargetAdd('egg.pyd', input='libpandaegg.dll')
  4365. PyTargetAdd('egg.pyd', input='libp3interrogatedb.dll')
  4366. PyTargetAdd('egg.pyd', input=COMMON_PANDA_LIBS)
  4367. #
  4368. # DIRECTORY: panda/src/x11display/
  4369. #
  4370. if (GetTarget() not in ['windows', 'darwin'] and PkgSkip("X11")==0 and not RUNTIME):
  4371. OPTS=['DIR:panda/src/x11display', 'BUILDING:PANDAX11', 'X11']
  4372. TargetAdd('p3x11display_composite1.obj', opts=OPTS, input='p3x11display_composite1.cxx')
  4373. #
  4374. # DIRECTORY: panda/src/glxdisplay/
  4375. #
  4376. if (GetTarget() not in ['windows', 'darwin'] and PkgSkip("GL")==0 and PkgSkip("X11")==0 and not RUNTIME):
  4377. DefSymbol('GLX', 'HAVE_GLX', '')
  4378. OPTS=['DIR:panda/src/glxdisplay', 'BUILDING:PANDAGL', 'GL', 'NVIDIACG', 'CGGL', 'GLX']
  4379. TargetAdd('p3glxdisplay_composite1.obj', opts=OPTS, input='p3glxdisplay_composite1.cxx')
  4380. OPTS=['DIR:panda/metalibs/pandagl', 'BUILDING:PANDAGL', 'GL', 'NVIDIACG', 'CGGL', 'GLX']
  4381. TargetAdd('pandagl_pandagl.obj', opts=OPTS, input='pandagl.cxx')
  4382. TargetAdd('libpandagl.dll', input='p3x11display_composite1.obj')
  4383. TargetAdd('libpandagl.dll', input='pandagl_pandagl.obj')
  4384. TargetAdd('libpandagl.dll', input='p3glgsg_config_glgsg.obj')
  4385. TargetAdd('libpandagl.dll', input='p3glgsg_glgsg.obj')
  4386. TargetAdd('libpandagl.dll', input='p3glxdisplay_composite1.obj')
  4387. TargetAdd('libpandagl.dll', input=COMMON_PANDA_LIBS)
  4388. TargetAdd('libpandagl.dll', opts=['MODULE', 'GL', 'NVIDIACG', 'CGGL', 'X11'])
  4389. #
  4390. # DIRECTORY: panda/src/cocoadisplay/
  4391. #
  4392. if (GetTarget() == 'darwin' and PkgSkip("COCOA")==0 and PkgSkip("GL")==0 and not RUNTIME):
  4393. OPTS=['DIR:panda/src/cocoadisplay', 'BUILDING:PANDAGL', 'GL', 'NVIDIACG', 'CGGL']
  4394. TargetAdd('p3cocoadisplay_composite1.obj', opts=OPTS, input='p3cocoadisplay_composite1.mm')
  4395. OPTS=['DIR:panda/metalibs/pandagl', 'BUILDING:PANDAGL', 'GL', 'NVIDIACG', 'CGGL']
  4396. TargetAdd('pandagl_pandagl.obj', opts=OPTS, input='pandagl.cxx')
  4397. TargetAdd('libpandagl.dll', input='pandagl_pandagl.obj')
  4398. TargetAdd('libpandagl.dll', input='p3glgsg_config_glgsg.obj')
  4399. TargetAdd('libpandagl.dll', input='p3glgsg_glgsg.obj')
  4400. TargetAdd('libpandagl.dll', input='p3cocoadisplay_composite1.obj')
  4401. if (PkgSkip('PANDAFX')==0):
  4402. TargetAdd('libpandagl.dll', input='libpandafx.dll')
  4403. TargetAdd('libpandagl.dll', input=COMMON_PANDA_LIBS)
  4404. TargetAdd('libpandagl.dll', opts=['MODULE', 'GL', 'NVIDIACG', 'CGGL', 'COCOA', 'CARBON'])
  4405. #
  4406. # DIRECTORY: panda/src/osxdisplay/
  4407. #
  4408. elif (GetTarget() == 'darwin' and PkgSkip("CARBON")==0 and PkgSkip("GL")==0 and not RUNTIME):
  4409. OPTS=['DIR:panda/src/osxdisplay', 'BUILDING:PANDAGL', 'GL', 'NVIDIACG', 'CGGL']
  4410. TargetAdd('p3osxdisplay_composite1.obj', opts=OPTS, input='p3osxdisplay_composite1.cxx')
  4411. TargetAdd('p3osxdisplay_osxGraphicsWindow.obj', opts=OPTS, input='osxGraphicsWindow.mm')
  4412. OPTS=['DIR:panda/metalibs/pandagl', 'BUILDING:PANDAGL', 'GL', 'NVIDIACG', 'CGGL']
  4413. TargetAdd('pandagl_pandagl.obj', opts=OPTS, input='pandagl.cxx')
  4414. TargetAdd('libpandagl.dll', input='pandagl_pandagl.obj')
  4415. TargetAdd('libpandagl.dll', input='p3glgsg_config_glgsg.obj')
  4416. TargetAdd('libpandagl.dll', input='p3glgsg_glgsg.obj')
  4417. TargetAdd('libpandagl.dll', input='p3osxdisplay_composite1.obj')
  4418. TargetAdd('libpandagl.dll', input='p3osxdisplay_osxGraphicsWindow.obj')
  4419. if (PkgSkip('PANDAFX')==0):
  4420. TargetAdd('libpandagl.dll', input='libpandafx.dll')
  4421. TargetAdd('libpandagl.dll', input=COMMON_PANDA_LIBS)
  4422. TargetAdd('libpandagl.dll', opts=['MODULE', 'GL', 'NVIDIACG', 'CGGL', 'CARBON', 'AGL', 'COCOA'])
  4423. #
  4424. # DIRECTORY: panda/src/wgldisplay/
  4425. #
  4426. if (GetTarget() == 'windows' and PkgSkip("GL")==0 and not RUNTIME):
  4427. OPTS=['DIR:panda/src/wgldisplay', 'DIR:panda/src/glstuff', 'BUILDING:PANDAGL', 'NVIDIACG', 'CGGL']
  4428. TargetAdd('p3wgldisplay_composite1.obj', opts=OPTS, input='p3wgldisplay_composite1.cxx')
  4429. OPTS=['DIR:panda/metalibs/pandagl', 'BUILDING:PANDAGL', 'NVIDIACG', 'CGGL']
  4430. TargetAdd('pandagl_pandagl.obj', opts=OPTS, input='pandagl.cxx')
  4431. TargetAdd('libpandagl.dll', input='pandagl_pandagl.obj')
  4432. TargetAdd('libpandagl.dll', input='p3glgsg_config_glgsg.obj')
  4433. TargetAdd('libpandagl.dll', input='p3glgsg_glgsg.obj')
  4434. TargetAdd('libpandagl.dll', input='p3wgldisplay_composite1.obj')
  4435. TargetAdd('libpandagl.dll', input='libp3windisplay.dll')
  4436. if (PkgSkip('PANDAFX')==0):
  4437. TargetAdd('libpandagl.dll', input='libpandafx.dll')
  4438. TargetAdd('libpandagl.dll', input=COMMON_PANDA_LIBS)
  4439. TargetAdd('libpandagl.dll', opts=['MODULE', 'WINGDI', 'GL', 'WINKERNEL', 'WINOLDNAMES', 'WINUSER', 'WINMM', 'NVIDIACG', 'CGGL'])
  4440. #
  4441. # DIRECTORY: panda/src/egldisplay/
  4442. #
  4443. # If we're not compiling with any windowing system at all, but we do have EGL,
  4444. # we can use that to create a headless libpandagl instead.
  4445. if not PkgSkip("EGL") and not PkgSkip("GL") and PkgSkip("X11") and GetTarget() not in ('windows', 'darwin') and not RUNTIME:
  4446. OPTS=['DIR:panda/src/egldisplay', 'DIR:panda/src/glstuff', 'BUILDING:PANDAGL', 'GL', 'EGL']
  4447. TargetAdd('pandagl_egldisplay_composite1.obj', opts=OPTS, input='p3egldisplay_composite1.cxx')
  4448. OPTS=['DIR:panda/metalibs/pandagl', 'BUILDING:PANDAGL', 'GL', 'EGL']
  4449. TargetAdd('pandagl_pandagl.obj', opts=OPTS, input='pandagl.cxx')
  4450. TargetAdd('libpandagl.dll', input='pandagl_pandagl.obj')
  4451. TargetAdd('libpandagl.dll', input='p3glgsg_config_glgsg.obj')
  4452. TargetAdd('libpandagl.dll', input='p3glgsg_glgsg.obj')
  4453. TargetAdd('libpandagl.dll', input='pandagl_egldisplay_composite1.obj')
  4454. TargetAdd('libpandagl.dll', input=COMMON_PANDA_LIBS)
  4455. TargetAdd('libpandagl.dll', opts=['MODULE', 'GL', 'EGL', 'CGGL'])
  4456. elif not PkgSkip("EGL") and not PkgSkip("GL") and GetTarget() not in ('windows', 'darwin') and not RUNTIME:
  4457. # As a temporary solution for #1086, build this module, which we can use as a
  4458. # fallback to OpenGL for headless systems.
  4459. DefSymbol('EGL', 'HAVE_EGL', '')
  4460. OPTS=['DIR:panda/src/egldisplay', 'DIR:panda/src/glstuff', 'BUILDING:PANDAGL', 'GL', 'EGL']
  4461. TargetAdd('p3headlessgl_egldisplay_composite1.obj', opts=OPTS, input='p3egldisplay_composite1.cxx')
  4462. OPTS=['DIR:panda/metalibs/pandagl', 'BUILDING:PANDAGL', 'GL', 'EGL']
  4463. TargetAdd('p3headlessgl_pandagl.obj', opts=OPTS, input='pandagl.cxx')
  4464. TargetAdd('libp3headlessgl.dll', input='p3headlessgl_pandagl.obj')
  4465. TargetAdd('libp3headlessgl.dll', input='p3glgsg_config_glgsg.obj')
  4466. TargetAdd('libp3headlessgl.dll', input='p3glgsg_glgsg.obj')
  4467. TargetAdd('libp3headlessgl.dll', input='p3headlessgl_egldisplay_composite1.obj')
  4468. TargetAdd('libp3headlessgl.dll', input=COMMON_PANDA_LIBS)
  4469. TargetAdd('libp3headlessgl.dll', opts=['MODULE', 'GL', 'EGL', 'CGGL'])
  4470. #
  4471. # DIRECTORY: panda/src/egldisplay/
  4472. #
  4473. if (PkgSkip("EGL")==0 and PkgSkip("GLES")==0 and not RUNTIME):
  4474. DefSymbol('GLES', 'OPENGLES_1', '')
  4475. OPTS=['DIR:panda/src/egldisplay', 'DIR:panda/src/glstuff', 'BUILDING:PANDAGLES', 'GLES', 'EGL', 'X11']
  4476. TargetAdd('pandagles_egldisplay_composite1.obj', opts=OPTS, input='p3egldisplay_composite1.cxx')
  4477. OPTS=['DIR:panda/metalibs/pandagles', 'BUILDING:PANDAGLES', 'GLES', 'EGL']
  4478. TargetAdd('pandagles_pandagles.obj', opts=OPTS, input='pandagles.cxx')
  4479. if not PkgSkip("X11"):
  4480. TargetAdd('libpandagles.dll', input='p3x11display_composite1.obj')
  4481. TargetAdd('libpandagles.dll', input='pandagles_pandagles.obj')
  4482. TargetAdd('libpandagles.dll', input='p3glesgsg_config_glesgsg.obj')
  4483. TargetAdd('libpandagles.dll', input='p3glesgsg_glesgsg.obj')
  4484. TargetAdd('libpandagles.dll', input='pandagles_egldisplay_composite1.obj')
  4485. TargetAdd('libpandagles.dll', input=COMMON_PANDA_LIBS)
  4486. TargetAdd('libpandagles.dll', opts=['MODULE', 'GLES', 'EGL', 'X11'])
  4487. #
  4488. # DIRECTORY: panda/src/egldisplay/
  4489. #
  4490. if (PkgSkip("EGL")==0 and PkgSkip("GLES2")==0 and not RUNTIME):
  4491. DefSymbol('GLES2', 'OPENGLES_2', '')
  4492. OPTS=['DIR:panda/src/egldisplay', 'DIR:panda/src/glstuff', 'BUILDING:PANDAGLES2', 'GLES2', 'EGL', 'X11']
  4493. TargetAdd('pandagles2_egldisplay_composite1.obj', opts=OPTS, input='p3egldisplay_composite1.cxx')
  4494. OPTS=['DIR:panda/metalibs/pandagles2', 'BUILDING:PANDAGLES2', 'GLES2', 'EGL']
  4495. TargetAdd('pandagles2_pandagles2.obj', opts=OPTS, input='pandagles2.cxx')
  4496. if not PkgSkip("X11"):
  4497. TargetAdd('libpandagles2.dll', input='p3x11display_composite1.obj')
  4498. TargetAdd('libpandagles2.dll', input='pandagles2_pandagles2.obj')
  4499. TargetAdd('libpandagles2.dll', input='p3gles2gsg_config_gles2gsg.obj')
  4500. TargetAdd('libpandagles2.dll', input='p3gles2gsg_gles2gsg.obj')
  4501. TargetAdd('libpandagles2.dll', input='pandagles2_egldisplay_composite1.obj')
  4502. TargetAdd('libpandagles2.dll', input=COMMON_PANDA_LIBS)
  4503. TargetAdd('libpandagles2.dll', opts=['MODULE', 'GLES2', 'EGL', 'X11'])
  4504. #
  4505. # DIRECTORY: panda/src/ode/
  4506. #
  4507. if (PkgSkip("ODE")==0 and not RUNTIME):
  4508. OPTS=['DIR:panda/src/ode', 'BUILDING:PANDAODE', 'ODE']
  4509. TargetAdd('p3ode_composite1.obj', opts=OPTS, input='p3ode_composite1.cxx')
  4510. TargetAdd('p3ode_composite2.obj', opts=OPTS, input='p3ode_composite2.cxx')
  4511. TargetAdd('p3ode_composite3.obj', opts=OPTS, input='p3ode_composite3.cxx')
  4512. OPTS=['DIR:panda/src/ode', 'ODE']
  4513. IGATEFILES=GetDirectoryContents('panda/src/ode', ["*.h", "*_composite*.cxx"])
  4514. IGATEFILES.remove("odeConvexGeom.h")
  4515. IGATEFILES.remove("odeHelperStructs.h")
  4516. TargetAdd('libpandaode.in', opts=OPTS, input=IGATEFILES)
  4517. TargetAdd('libpandaode.in', opts=['IMOD:panda3d.ode', 'ILIB:libpandaode', 'SRCDIR:panda/src/ode'])
  4518. PyTargetAdd('p3ode_ext_composite.obj', opts=OPTS, input='p3ode_ext_composite.cxx')
  4519. #
  4520. # DIRECTORY: panda/metalibs/pandaode/
  4521. #
  4522. if (PkgSkip("ODE")==0 and not RUNTIME):
  4523. OPTS=['DIR:panda/metalibs/pandaode', 'BUILDING:PANDAODE', 'ODE']
  4524. TargetAdd('pandaode_pandaode.obj', opts=OPTS, input='pandaode.cxx')
  4525. TargetAdd('libpandaode.dll', input='pandaode_pandaode.obj')
  4526. TargetAdd('libpandaode.dll', input='p3ode_composite1.obj')
  4527. TargetAdd('libpandaode.dll', input='p3ode_composite2.obj')
  4528. TargetAdd('libpandaode.dll', input='p3ode_composite3.obj')
  4529. TargetAdd('libpandaode.dll', input=COMMON_PANDA_LIBS)
  4530. TargetAdd('libpandaode.dll', opts=['WINUSER', 'ODE'])
  4531. OPTS=['DIR:panda/metalibs/pandaode', 'ODE']
  4532. PyTargetAdd('ode_module.obj', input='libpandaode.in')
  4533. PyTargetAdd('ode_module.obj', opts=OPTS)
  4534. PyTargetAdd('ode_module.obj', opts=['IMOD:panda3d.ode', 'ILIB:ode', 'IMPORT:panda3d.core'])
  4535. PyTargetAdd('ode.pyd', input='ode_module.obj')
  4536. PyTargetAdd('ode.pyd', input='libpandaode_igate.obj')
  4537. PyTargetAdd('ode.pyd', input='p3ode_ext_composite.obj')
  4538. PyTargetAdd('ode.pyd', input='libpandaode.dll')
  4539. PyTargetAdd('ode.pyd', input='libp3interrogatedb.dll')
  4540. PyTargetAdd('ode.pyd', input=COMMON_PANDA_LIBS)
  4541. PyTargetAdd('ode.pyd', opts=['WINUSER', 'ODE'])
  4542. #
  4543. # DIRECTORY: panda/src/bullet/
  4544. #
  4545. if (PkgSkip("BULLET")==0 and not RUNTIME):
  4546. OPTS=['DIR:panda/src/bullet', 'BUILDING:PANDABULLET', 'BULLET']
  4547. TargetAdd('p3bullet_composite.obj', opts=OPTS, input='p3bullet_composite.cxx')
  4548. OPTS=['DIR:panda/src/bullet', 'BULLET']
  4549. IGATEFILES=GetDirectoryContents('panda/src/bullet', ["*.h", "*_composite*.cxx"])
  4550. TargetAdd('libpandabullet.in', opts=OPTS, input=IGATEFILES)
  4551. TargetAdd('libpandabullet.in', opts=['IMOD:panda3d.bullet', 'ILIB:libpandabullet', 'SRCDIR:panda/src/bullet'])
  4552. #
  4553. # DIRECTORY: panda/metalibs/pandabullet/
  4554. #
  4555. if (PkgSkip("BULLET")==0 and not RUNTIME):
  4556. OPTS=['DIR:panda/metalibs/pandabullet', 'BUILDING:PANDABULLET', 'BULLET']
  4557. TargetAdd('pandabullet_pandabullet.obj', opts=OPTS, input='pandabullet.cxx')
  4558. TargetAdd('libpandabullet.dll', input='pandabullet_pandabullet.obj')
  4559. TargetAdd('libpandabullet.dll', input='p3bullet_composite.obj')
  4560. TargetAdd('libpandabullet.dll', input=COMMON_PANDA_LIBS)
  4561. TargetAdd('libpandabullet.dll', opts=['WINUSER', 'BULLET'])
  4562. OPTS=['DIR:panda/metalibs/pandabullet', 'BULLET']
  4563. PyTargetAdd('bullet_module.obj', input='libpandabullet.in')
  4564. PyTargetAdd('bullet_module.obj', opts=OPTS)
  4565. PyTargetAdd('bullet_module.obj', opts=['IMOD:panda3d.bullet', 'ILIB:bullet', 'IMPORT:panda3d.core'])
  4566. PyTargetAdd('bullet.pyd', input='bullet_module.obj')
  4567. PyTargetAdd('bullet.pyd', input='libpandabullet_igate.obj')
  4568. PyTargetAdd('bullet.pyd', input='libpandabullet.dll')
  4569. PyTargetAdd('bullet.pyd', input='libp3interrogatedb.dll')
  4570. PyTargetAdd('bullet.pyd', input=COMMON_PANDA_LIBS)
  4571. PyTargetAdd('bullet.pyd', opts=['WINUSER', 'BULLET'])
  4572. #
  4573. # DIRECTORY: panda/src/physx/
  4574. #
  4575. if (PkgSkip("PHYSX")==0):
  4576. OPTS=['DIR:panda/src/physx', 'BUILDING:PANDAPHYSX', 'PHYSX', 'NOARCH:PPC', 'NOARCH:ARM64']
  4577. TargetAdd('p3physx_composite.obj', opts=OPTS, input='p3physx_composite.cxx')
  4578. OPTS=['DIR:panda/src/physx', 'PHYSX', 'NOARCH:PPC', 'NOARCH:ARM64']
  4579. IGATEFILES=GetDirectoryContents('panda/src/physx', ["*.h", "*_composite*.cxx"])
  4580. TargetAdd('libpandaphysx.in', opts=OPTS, input=IGATEFILES)
  4581. TargetAdd('libpandaphysx.in', opts=['IMOD:panda3d.physx', 'ILIB:libpandaphysx', 'SRCDIR:panda/src/physx'])
  4582. #
  4583. # DIRECTORY: panda/metalibs/pandaphysx/
  4584. #
  4585. if (PkgSkip("PHYSX")==0):
  4586. OPTS=['DIR:panda/metalibs/pandaphysx', 'BUILDING:PANDAPHYSX', 'PHYSX', 'NOARCH:PPC', 'NOARCH:ARM64', 'PYTHON']
  4587. TargetAdd('pandaphysx_pandaphysx.obj', opts=OPTS, input='pandaphysx.cxx')
  4588. TargetAdd('libpandaphysx.dll', input='pandaphysx_pandaphysx.obj')
  4589. TargetAdd('libpandaphysx.dll', input='p3physx_composite.obj')
  4590. TargetAdd('libpandaphysx.dll', input=COMMON_PANDA_LIBS)
  4591. TargetAdd('libpandaphysx.dll', opts=['WINUSER', 'PHYSX', 'NOARCH:PPC', 'NOARCH:ARM64', 'PYTHON'])
  4592. OPTS=['DIR:panda/metalibs/pandaphysx', 'PHYSX', 'NOARCH:PPC', 'NOARCH:ARM64']
  4593. PyTargetAdd('physx_module.obj', input='libpandaphysx.in')
  4594. PyTargetAdd('physx_module.obj', opts=OPTS)
  4595. PyTargetAdd('physx_module.obj', opts=['IMOD:panda3d.physx', 'ILIB:physx', 'IMPORT:panda3d.core'])
  4596. PyTargetAdd('physx.pyd', input='physx_module.obj')
  4597. PyTargetAdd('physx.pyd', input='libpandaphysx_igate.obj')
  4598. PyTargetAdd('physx.pyd', input='libpandaphysx.dll')
  4599. PyTargetAdd('physx.pyd', input='libp3interrogatedb.dll')
  4600. PyTargetAdd('physx.pyd', input=COMMON_PANDA_LIBS)
  4601. PyTargetAdd('physx.pyd', opts=['WINUSER', 'PHYSX', 'NOARCH:PPC', 'NOARCH:ARM64'])
  4602. #
  4603. # DIRECTORY: panda/src/physics/
  4604. #
  4605. if (PkgSkip("PANDAPHYSICS")==0) and (not RUNTIME):
  4606. OPTS=['DIR:panda/src/physics', 'BUILDING:PANDAPHYSICS']
  4607. TargetAdd('p3physics_composite1.obj', opts=OPTS, input='p3physics_composite1.cxx')
  4608. TargetAdd('p3physics_composite2.obj', opts=OPTS, input='p3physics_composite2.cxx')
  4609. OPTS=['DIR:panda/src/physics']
  4610. IGATEFILES=GetDirectoryContents('panda/src/physics', ["*.h", "*_composite*.cxx"])
  4611. IGATEFILES.remove("forces.h")
  4612. TargetAdd('libp3physics.in', opts=OPTS, input=IGATEFILES)
  4613. TargetAdd('libp3physics.in', opts=['IMOD:panda3d.physics', 'ILIB:libp3physics', 'SRCDIR:panda/src/physics'])
  4614. #
  4615. # DIRECTORY: panda/src/particlesystem/
  4616. #
  4617. if (PkgSkip("PANDAPHYSICS")==0) and (PkgSkip("PANDAPARTICLESYSTEM")==0) and (not RUNTIME):
  4618. OPTS=['DIR:panda/src/particlesystem', 'BUILDING:PANDAPHYSICS']
  4619. TargetAdd('p3particlesystem_composite1.obj', opts=OPTS, input='p3particlesystem_composite1.cxx')
  4620. TargetAdd('p3particlesystem_composite2.obj', opts=OPTS, input='p3particlesystem_composite2.cxx')
  4621. OPTS=['DIR:panda/src/particlesystem']
  4622. IGATEFILES=GetDirectoryContents('panda/src/particlesystem', ["*.h", "*_composite*.cxx"])
  4623. IGATEFILES.remove('orientedParticle.h')
  4624. IGATEFILES.remove('orientedParticleFactory.h')
  4625. IGATEFILES.remove('particlefactories.h')
  4626. IGATEFILES.remove('emitters.h')
  4627. IGATEFILES.remove('particles.h')
  4628. TargetAdd('libp3particlesystem.in', opts=OPTS, input=IGATEFILES)
  4629. TargetAdd('libp3particlesystem.in', opts=['IMOD:panda3d.physics', 'ILIB:libp3particlesystem', 'SRCDIR:panda/src/particlesystem'])
  4630. #
  4631. # DIRECTORY: panda/metalibs/pandaphysics/
  4632. #
  4633. if (PkgSkip("PANDAPHYSICS")==0) and (not RUNTIME):
  4634. OPTS=['DIR:panda/metalibs/pandaphysics', 'BUILDING:PANDAPHYSICS']
  4635. TargetAdd('pandaphysics_pandaphysics.obj', opts=OPTS, input='pandaphysics.cxx')
  4636. TargetAdd('libpandaphysics.dll', input='pandaphysics_pandaphysics.obj')
  4637. TargetAdd('libpandaphysics.dll', input='p3physics_composite1.obj')
  4638. TargetAdd('libpandaphysics.dll', input='p3physics_composite2.obj')
  4639. TargetAdd('libpandaphysics.dll', input='p3particlesystem_composite1.obj')
  4640. TargetAdd('libpandaphysics.dll', input='p3particlesystem_composite2.obj')
  4641. TargetAdd('libpandaphysics.dll', input=COMMON_PANDA_LIBS)
  4642. TargetAdd('libpandaphysics.dll', opts=['ADVAPI'])
  4643. OPTS=['DIR:panda/metalibs/pandaphysics']
  4644. PyTargetAdd('physics_module.obj', input='libp3physics.in')
  4645. if (PkgSkip("PANDAPARTICLESYSTEM")==0):
  4646. PyTargetAdd('physics_module.obj', input='libp3particlesystem.in')
  4647. PyTargetAdd('physics_module.obj', opts=OPTS)
  4648. PyTargetAdd('physics_module.obj', opts=['IMOD:panda3d.physics', 'ILIB:physics', 'IMPORT:panda3d.core'])
  4649. PyTargetAdd('physics.pyd', input='physics_module.obj')
  4650. PyTargetAdd('physics.pyd', input='libp3physics_igate.obj')
  4651. if (PkgSkip("PANDAPARTICLESYSTEM")==0):
  4652. PyTargetAdd('physics.pyd', input='libp3particlesystem_igate.obj')
  4653. PyTargetAdd('physics.pyd', input='libpandaphysics.dll')
  4654. PyTargetAdd('physics.pyd', input='libp3interrogatedb.dll')
  4655. PyTargetAdd('physics.pyd', input=COMMON_PANDA_LIBS)
  4656. #
  4657. # DIRECTORY: panda/src/speedtree/
  4658. #
  4659. if (PkgSkip("SPEEDTREE")==0):
  4660. OPTS=['DIR:panda/src/speedtree', 'BUILDING:PANDASPEEDTREE', 'SPEEDTREE']
  4661. TargetAdd('pandaspeedtree_composite1.obj', opts=OPTS, input='pandaspeedtree_composite1.cxx')
  4662. IGATEFILES=GetDirectoryContents('panda/src/speedtree', ["*.h", "*_composite*.cxx"])
  4663. TargetAdd('libpandaspeedtree.in', opts=OPTS, input=IGATEFILES)
  4664. TargetAdd('libpandaspeedtree.in', opts=['IMOD:libpandaspeedtree', 'ILIB:libpandaspeedtree', 'SRCDIR:panda/src/speedtree'])
  4665. PyTargetAdd('libpandaspeedtree_module.obj', input='libpandaspeedtree.in')
  4666. PyTargetAdd('libpandaspeedtree_module.obj', opts=OPTS)
  4667. PyTargetAdd('libpandaspeedtree_module.obj', opts=['IMOD:libpandaspeedtree', 'ILIB:libpandaspeedtree'])
  4668. TargetAdd('libpandaspeedtree.dll', input='pandaspeedtree_composite1.obj')
  4669. PyTargetAdd('libpandaspeedtree.dll', input='libpandaspeedtree_igate.obj')
  4670. TargetAdd('libpandaspeedtree.dll', input='libpandaspeedtree_module.obj')
  4671. TargetAdd('libpandaspeedtree.dll', input=COMMON_PANDA_LIBS)
  4672. TargetAdd('libpandaspeedtree.dll', opts=['SPEEDTREE'])
  4673. if SDK["SPEEDTREEAPI"] == 'OpenGL':
  4674. TargetAdd('libpandaspeedtree.dll', opts=['GL', 'NVIDIACG', 'CGGL'])
  4675. elif SDK["SPEEDTREEAPI"] == 'DirectX9':
  4676. TargetAdd('libpandaspeedtree.dll', opts=['DX9', 'NVIDIACG', 'CGDX9'])
  4677. #
  4678. # DIRECTORY: panda/src/testbed/
  4679. #
  4680. if (not RTDIST and not RUNTIME and PkgSkip("PVIEW")==0):
  4681. OPTS=['DIR:panda/src/testbed']
  4682. TargetAdd('pview_pview.obj', opts=OPTS, input='pview.cxx')
  4683. TargetAdd('pview.exe', input='pview_pview.obj')
  4684. TargetAdd('pview.exe', input='libp3framework.dll')
  4685. if not PkgSkip("EGG"):
  4686. TargetAdd('pview.exe', input='libpandaegg.dll')
  4687. TargetAdd('pview.exe', input=COMMON_PANDA_LIBS)
  4688. TargetAdd('pview.exe', opts=['ADVAPI', 'WINSOCK2', 'WINSHELL'])
  4689. if GetLinkAllStatic() and not PkgSkip("GL"):
  4690. TargetAdd('pview.exe', input='libpandagl.dll')
  4691. #
  4692. # DIRECTORY: panda/src/android/
  4693. #
  4694. if (not RUNTIME and GetTarget() == 'android'):
  4695. OPTS=['DIR:panda/src/android']
  4696. TargetAdd('org/panda3d/android/NativeIStream.class', opts=OPTS, input='NativeIStream.java')
  4697. TargetAdd('org/panda3d/android/NativeOStream.class', opts=OPTS, input='NativeOStream.java')
  4698. TargetAdd('org/panda3d/android/PandaActivity.class', opts=OPTS, input='PandaActivity.java')
  4699. TargetAdd('org/panda3d/android/PythonActivity.class', opts=OPTS, input='PythonActivity.java')
  4700. TargetAdd('p3android_composite1.obj', opts=OPTS, input='p3android_composite1.cxx')
  4701. TargetAdd('libp3android.dll', input='p3android_composite1.obj')
  4702. TargetAdd('libp3android.dll', input=COMMON_PANDA_LIBS)
  4703. TargetAdd('libp3android.dll', opts=['JNIGRAPHICS'])
  4704. TargetAdd('android_native_app_glue.obj', opts=OPTS + ['NOHIDDEN'], input='android_native_app_glue.c')
  4705. TargetAdd('android_main.obj', opts=OPTS, input='android_main.cxx')
  4706. if (not RTDIST and PkgSkip("PVIEW")==0):
  4707. TargetAdd('libpview_pview.obj', opts=OPTS, input='pview.cxx')
  4708. TargetAdd('libpview.dll', input='android_native_app_glue.obj')
  4709. TargetAdd('libpview.dll', input='android_main.obj')
  4710. TargetAdd('libpview.dll', input='libpview_pview.obj')
  4711. TargetAdd('libpview.dll', input='libp3framework.dll')
  4712. if not PkgSkip("EGG"):
  4713. TargetAdd('libpview.dll', input='libpandaegg.dll')
  4714. TargetAdd('libpview.dll', input='libp3android.dll')
  4715. TargetAdd('libpview.dll', input=COMMON_PANDA_LIBS)
  4716. TargetAdd('libpview.dll', opts=['MODULE', 'ANDROID'])
  4717. if (not RTDIST and PkgSkip("PYTHON")==0):
  4718. OPTS += ['PYTHON']
  4719. TargetAdd('ppython_ppython.obj', opts=OPTS, input='python_main.cxx')
  4720. TargetAdd('libppython.dll', input='android_native_app_glue.obj')
  4721. TargetAdd('libppython.dll', input='android_main.obj')
  4722. TargetAdd('libppython.dll', input='ppython_ppython.obj')
  4723. TargetAdd('libppython.dll', input='libp3framework.dll')
  4724. TargetAdd('libppython.dll', input='libp3android.dll')
  4725. TargetAdd('libppython.dll', input=COMMON_PANDA_LIBS)
  4726. TargetAdd('libppython.dll', opts=['MODULE', 'ANDROID', 'PYTHON'])
  4727. #
  4728. # DIRECTORY: panda/src/androiddisplay/
  4729. #
  4730. if (GetTarget() == 'android' and PkgSkip("EGL")==0 and PkgSkip("GLES")==0 and not RUNTIME):
  4731. DefSymbol('GLES', 'OPENGLES_1', '')
  4732. OPTS=['DIR:panda/src/androiddisplay', 'DIR:panda/src/glstuff', 'BUILDING:PANDAGLES', 'GLES', 'EGL']
  4733. TargetAdd('pandagles_androiddisplay_composite1.obj', opts=OPTS, input='p3androiddisplay_composite1.cxx')
  4734. OPTS=['DIR:panda/metalibs/pandagles', 'BUILDING:PANDAGLES', 'GLES', 'EGL']
  4735. TargetAdd('pandagles_pandagles.obj', opts=OPTS, input='pandagles.cxx')
  4736. TargetAdd('libpandagles.dll', input='pandagles_pandagles.obj')
  4737. TargetAdd('libpandagles.dll', input='p3glesgsg_config_glesgsg.obj')
  4738. TargetAdd('libpandagles.dll', input='p3glesgsg_glesgsg.obj')
  4739. TargetAdd('libpandagles.dll', input='pandagles_androiddisplay_composite1.obj')
  4740. TargetAdd('libpandagles.dll', input='libp3android.dll')
  4741. TargetAdd('libpandagles.dll', input=COMMON_PANDA_LIBS)
  4742. TargetAdd('libpandagles.dll', opts=['MODULE', 'GLES', 'EGL'])
  4743. #
  4744. # DIRECTORY: panda/src/tinydisplay/
  4745. #
  4746. if (not RUNTIME and (GetTarget() in ('windows', 'darwin') or PkgSkip("X11")==0) and PkgSkip("TINYDISPLAY")==0):
  4747. OPTS=['DIR:panda/src/tinydisplay', 'BUILDING:TINYDISPLAY', 'X11']
  4748. TargetAdd('p3tinydisplay_composite1.obj', opts=OPTS, input='p3tinydisplay_composite1.cxx')
  4749. TargetAdd('p3tinydisplay_composite2.obj', opts=OPTS, input='p3tinydisplay_composite2.cxx')
  4750. TargetAdd('p3tinydisplay_ztriangle_1.obj', opts=OPTS, input='ztriangle_1.cxx')
  4751. TargetAdd('p3tinydisplay_ztriangle_2.obj', opts=OPTS, input='ztriangle_2.cxx')
  4752. TargetAdd('p3tinydisplay_ztriangle_3.obj', opts=OPTS, input='ztriangle_3.cxx')
  4753. TargetAdd('p3tinydisplay_ztriangle_4.obj', opts=OPTS, input='ztriangle_4.cxx')
  4754. TargetAdd('p3tinydisplay_ztriangle_table.obj', opts=OPTS, input='ztriangle_table.cxx')
  4755. if GetTarget() == 'darwin':
  4756. TargetAdd('p3tinydisplay_tinyOsxGraphicsWindow.obj', opts=OPTS, input='tinyOsxGraphicsWindow.mm')
  4757. TargetAdd('libp3tinydisplay.dll', input='p3tinydisplay_tinyOsxGraphicsWindow.obj')
  4758. TargetAdd('libp3tinydisplay.dll', opts=['CARBON', 'AGL', 'COCOA'])
  4759. elif GetTarget() == 'windows':
  4760. TargetAdd('libp3tinydisplay.dll', input='libp3windisplay.dll')
  4761. TargetAdd('libp3tinydisplay.dll', opts=['WINIMM', 'WINGDI', 'WINKERNEL', 'WINOLDNAMES', 'WINUSER', 'WINMM'])
  4762. else:
  4763. TargetAdd('libp3tinydisplay.dll', input='p3x11display_composite1.obj')
  4764. TargetAdd('libp3tinydisplay.dll', opts=['X11'])
  4765. TargetAdd('libp3tinydisplay.dll', input='p3tinydisplay_composite1.obj')
  4766. TargetAdd('libp3tinydisplay.dll', input='p3tinydisplay_composite2.obj')
  4767. TargetAdd('libp3tinydisplay.dll', input='p3tinydisplay_ztriangle_1.obj')
  4768. TargetAdd('libp3tinydisplay.dll', input='p3tinydisplay_ztriangle_2.obj')
  4769. TargetAdd('libp3tinydisplay.dll', input='p3tinydisplay_ztriangle_3.obj')
  4770. TargetAdd('libp3tinydisplay.dll', input='p3tinydisplay_ztriangle_4.obj')
  4771. TargetAdd('libp3tinydisplay.dll', input='p3tinydisplay_ztriangle_table.obj')
  4772. TargetAdd('libp3tinydisplay.dll', input=COMMON_PANDA_LIBS)
  4773. #
  4774. # DIRECTORY: direct/src/directbase/
  4775. #
  4776. if (PkgSkip("DIRECT")==0):
  4777. OPTS=['DIR:direct/src/directbase']
  4778. TargetAdd('p3directbase_directbase.obj', opts=OPTS+['BUILDING:DIRECT'], input='directbase.cxx')
  4779. #
  4780. # DIRECTORY: direct/src/dcparser/
  4781. #
  4782. if (PkgSkip("DIRECT")==0):
  4783. OPTS=['DIR:direct/src/dcparser', 'BUILDING:DIRECT_DCPARSER', 'WITHINPANDA', 'BISONPREFIX_dcyy']
  4784. CreateFile(GetOutputDir()+"/include/dcParser.h")
  4785. PyTargetAdd('p3dcparser_dcParser.obj', opts=OPTS, input='dcParser.yxx')
  4786. #TargetAdd('dcParser.h', input='p3dcparser_dcParser.obj', opts=['DEPENDENCYONLY'])
  4787. PyTargetAdd('p3dcparser_dcLexer.obj', opts=OPTS, input='dcLexer.lxx', dep='p3dcparser_dcParser.obj')
  4788. PyTargetAdd('p3dcparser_composite1.obj', opts=OPTS, input='p3dcparser_composite1.cxx')
  4789. PyTargetAdd('p3dcparser_composite2.obj', opts=OPTS, input='p3dcparser_composite2.cxx')
  4790. OPTS=['DIR:direct/src/dcparser', 'WITHINPANDA']
  4791. IGATEFILES=GetDirectoryContents('direct/src/dcparser', ["*.h", "*_composite*.cxx"])
  4792. if "dcParser.h" in IGATEFILES: IGATEFILES.remove("dcParser.h")
  4793. if "dcmsgtypes.h" in IGATEFILES: IGATEFILES.remove('dcmsgtypes.h')
  4794. TargetAdd('libp3dcparser.in', opts=OPTS, input=IGATEFILES)
  4795. TargetAdd('libp3dcparser.in', opts=['IMOD:panda3d.direct', 'ILIB:libp3dcparser', 'SRCDIR:direct/src/dcparser'])
  4796. #
  4797. # DIRECTORY: direct/src/deadrec/
  4798. #
  4799. if (PkgSkip("DIRECT")==0):
  4800. OPTS=['DIR:direct/src/deadrec', 'BUILDING:DIRECT']
  4801. TargetAdd('p3deadrec_composite1.obj', opts=OPTS, input='p3deadrec_composite1.cxx')
  4802. OPTS=['DIR:direct/src/deadrec']
  4803. IGATEFILES=GetDirectoryContents('direct/src/deadrec', ["*.h", "*_composite*.cxx"])
  4804. TargetAdd('libp3deadrec.in', opts=OPTS, input=IGATEFILES)
  4805. TargetAdd('libp3deadrec.in', opts=['IMOD:panda3d.direct', 'ILIB:libp3deadrec', 'SRCDIR:direct/src/deadrec'])
  4806. #
  4807. # DIRECTORY: direct/src/distributed/
  4808. #
  4809. if (PkgSkip("DIRECT")==0):
  4810. OPTS=['DIR:direct/src/distributed', 'DIR:direct/src/dcparser', 'WITHINPANDA', 'BUILDING:DIRECT']
  4811. TargetAdd('p3distributed_config_distributed.obj', opts=OPTS, input='config_distributed.cxx')
  4812. PyTargetAdd('p3distributed_cConnectionRepository.obj', opts=OPTS, input='cConnectionRepository.cxx')
  4813. PyTargetAdd('p3distributed_cDistributedSmoothNodeBase.obj', opts=OPTS, input='cDistributedSmoothNodeBase.cxx')
  4814. OPTS=['DIR:direct/src/distributed', 'WITHINPANDA']
  4815. IGATEFILES=GetDirectoryContents('direct/src/distributed', ["*.h", "*.cxx"])
  4816. TargetAdd('libp3distributed.in', opts=OPTS, input=IGATEFILES)
  4817. TargetAdd('libp3distributed.in', opts=['IMOD:panda3d.direct', 'ILIB:libp3distributed', 'SRCDIR:direct/src/distributed'])
  4818. #
  4819. # DIRECTORY: direct/src/interval/
  4820. #
  4821. if (PkgSkip("DIRECT")==0):
  4822. OPTS=['DIR:direct/src/interval', 'BUILDING:DIRECT']
  4823. TargetAdd('p3interval_composite1.obj', opts=OPTS, input='p3interval_composite1.cxx')
  4824. OPTS=['DIR:direct/src/interval']
  4825. IGATEFILES=GetDirectoryContents('direct/src/interval', ["*.h", "*_composite*.cxx"])
  4826. TargetAdd('libp3interval.in', opts=OPTS, input=IGATEFILES)
  4827. TargetAdd('libp3interval.in', opts=['IMOD:panda3d.direct', 'ILIB:libp3interval', 'SRCDIR:direct/src/interval'])
  4828. PyTargetAdd('p3interval_cInterval_ext.obj', opts=OPTS, input='cInterval_ext.cxx')
  4829. #
  4830. # DIRECTORY: direct/src/showbase/
  4831. #
  4832. if (PkgSkip("DIRECT")==0):
  4833. OPTS=['DIR:direct/src/showbase', 'BUILDING:DIRECT']
  4834. TargetAdd('p3showbase_showBase.obj', opts=OPTS, input='showBase.cxx')
  4835. if GetTarget() == 'darwin':
  4836. TargetAdd('p3showbase_showBase_assist.obj', opts=OPTS, input='showBase_assist.mm')
  4837. OPTS=['DIR:direct/src/showbase']
  4838. IGATEFILES=GetDirectoryContents('direct/src/showbase', ["*.h", "showBase.cxx"])
  4839. TargetAdd('libp3showbase.in', opts=OPTS, input=IGATEFILES)
  4840. TargetAdd('libp3showbase.in', opts=['IMOD:panda3d.direct', 'ILIB:libp3showbase', 'SRCDIR:direct/src/showbase'])
  4841. #
  4842. # DIRECTORY: direct/src/motiontrail/
  4843. #
  4844. if (PkgSkip("DIRECT")==0):
  4845. OPTS=['DIR:direct/src/motiontrail', 'BUILDING:DIRECT']
  4846. TargetAdd('p3motiontrail_cMotionTrail.obj', opts=OPTS, input='cMotionTrail.cxx')
  4847. TargetAdd('p3motiontrail_config_motiontrail.obj', opts=OPTS, input='config_motiontrail.cxx')
  4848. OPTS=['DIR:direct/src/motiontrail']
  4849. IGATEFILES=GetDirectoryContents('direct/src/motiontrail', ["*.h", "cMotionTrail.cxx"])
  4850. TargetAdd('libp3motiontrail.in', opts=OPTS, input=IGATEFILES)
  4851. TargetAdd('libp3motiontrail.in', opts=['IMOD:panda3d.direct', 'ILIB:libp3motiontrail', 'SRCDIR:direct/src/motiontrail'])
  4852. #
  4853. # DIRECTORY: direct/metalibs/direct/
  4854. #
  4855. if (PkgSkip("DIRECT")==0):
  4856. TargetAdd('libp3direct.dll', input='p3directbase_directbase.obj')
  4857. TargetAdd('libp3direct.dll', input='p3showbase_showBase.obj')
  4858. if GetTarget() == 'darwin':
  4859. TargetAdd('libp3direct.dll', input='p3showbase_showBase_assist.obj')
  4860. TargetAdd('libp3direct.dll', input='p3deadrec_composite1.obj')
  4861. TargetAdd('libp3direct.dll', input='p3interval_composite1.obj')
  4862. TargetAdd('libp3direct.dll', input='p3motiontrail_config_motiontrail.obj')
  4863. TargetAdd('libp3direct.dll', input='p3motiontrail_cMotionTrail.obj')
  4864. TargetAdd('libp3direct.dll', input=COMMON_PANDA_LIBS)
  4865. TargetAdd('libp3direct.dll', opts=['ADVAPI', 'WINUSER', 'WINGDI'])
  4866. PyTargetAdd('direct_module.obj', input='libp3dcparser.in')
  4867. PyTargetAdd('direct_module.obj', input='libp3showbase.in')
  4868. PyTargetAdd('direct_module.obj', input='libp3deadrec.in')
  4869. PyTargetAdd('direct_module.obj', input='libp3interval.in')
  4870. PyTargetAdd('direct_module.obj', input='libp3distributed.in')
  4871. PyTargetAdd('direct_module.obj', input='libp3motiontrail.in')
  4872. PyTargetAdd('direct_module.obj', opts=['IMOD:panda3d.direct', 'ILIB:direct', 'IMPORT:panda3d.core'])
  4873. PyTargetAdd('direct.pyd', input='libp3dcparser_igate.obj')
  4874. PyTargetAdd('direct.pyd', input='libp3showbase_igate.obj')
  4875. PyTargetAdd('direct.pyd', input='libp3deadrec_igate.obj')
  4876. PyTargetAdd('direct.pyd', input='libp3interval_igate.obj')
  4877. PyTargetAdd('direct.pyd', input='p3interval_cInterval_ext.obj')
  4878. PyTargetAdd('direct.pyd', input='libp3distributed_igate.obj')
  4879. PyTargetAdd('direct.pyd', input='libp3motiontrail_igate.obj')
  4880. # These are part of direct.pyd, not libp3direct.dll, because they rely on
  4881. # the Python libraries. If a C++ user needs these modules, we can move them
  4882. # back and filter out the Python-specific code.
  4883. PyTargetAdd('direct.pyd', input='p3dcparser_composite1.obj')
  4884. PyTargetAdd('direct.pyd', input='p3dcparser_composite2.obj')
  4885. PyTargetAdd('direct.pyd', input='p3dcparser_dcParser.obj')
  4886. PyTargetAdd('direct.pyd', input='p3dcparser_dcLexer.obj')
  4887. PyTargetAdd('direct.pyd', input='p3distributed_config_distributed.obj')
  4888. PyTargetAdd('direct.pyd', input='p3distributed_cConnectionRepository.obj')
  4889. PyTargetAdd('direct.pyd', input='p3distributed_cDistributedSmoothNodeBase.obj')
  4890. PyTargetAdd('direct.pyd', input='direct_module.obj')
  4891. PyTargetAdd('direct.pyd', input='libp3direct.dll')
  4892. PyTargetAdd('direct.pyd', input='libp3interrogatedb.dll')
  4893. PyTargetAdd('direct.pyd', input=COMMON_PANDA_LIBS)
  4894. PyTargetAdd('direct.pyd', opts=['WINUSER', 'WINGDI', 'WINSOCK2'])
  4895. #
  4896. # DIRECTORY: direct/src/dcparse/
  4897. #
  4898. if (PkgSkip("PYTHON")==0 and PkgSkip("DIRECT")==0 and not RTDIST and not RUNTIME):
  4899. OPTS=['DIR:direct/src/dcparse', 'DIR:direct/src/dcparser', 'WITHINPANDA', 'ADVAPI']
  4900. PyTargetAdd('dcparse_dcparse.obj', opts=OPTS, input='dcparse.cxx')
  4901. PyTargetAdd('p3dcparse.exe', input='p3dcparser_composite1.obj')
  4902. PyTargetAdd('p3dcparse.exe', input='p3dcparser_composite2.obj')
  4903. PyTargetAdd('p3dcparse.exe', input='p3dcparser_dcParser.obj')
  4904. PyTargetAdd('p3dcparse.exe', input='p3dcparser_dcLexer.obj')
  4905. PyTargetAdd('p3dcparse.exe', input='dcparse_dcparse.obj')
  4906. PyTargetAdd('p3dcparse.exe', input='libp3direct.dll')
  4907. PyTargetAdd('p3dcparse.exe', input=COMMON_PANDA_LIBS)
  4908. PyTargetAdd('p3dcparse.exe', input='libp3pystub.lib')
  4909. PyTargetAdd('p3dcparse.exe', opts=['ADVAPI'])
  4910. #
  4911. # DIRECTORY: direct/src/plugin/
  4912. #
  4913. if (RTDIST or RUNTIME):
  4914. # Explicitly define this as we don't include dtool_config.h here.
  4915. if GetTarget() not in ('windows', 'darwin'):
  4916. DefSymbol("RUNTIME", "HAVE_X11", "1")
  4917. OPTS=['DIR:direct/src/plugin', 'BUILDING:P3D_PLUGIN', 'RUNTIME', 'OPENSSL']
  4918. TargetAdd('plugin_common.obj', opts=OPTS, input='plugin_common_composite1.cxx')
  4919. OPTS += ['ZLIB', 'MSIMG']
  4920. TargetAdd('plugin_plugin.obj', opts=OPTS, input='p3d_plugin_composite1.cxx')
  4921. TargetAdd('plugin_mkdir_complete.obj', opts=OPTS, input='mkdir_complete.cxx')
  4922. TargetAdd('plugin_wstring_encode.obj', opts=OPTS, input='wstring_encode.cxx')
  4923. TargetAdd('plugin_parse_color.obj', opts=OPTS, input='parse_color.cxx')
  4924. TargetAdd('plugin_get_twirl_data.obj', opts=OPTS, input='get_twirl_data.cxx')
  4925. TargetAdd('plugin_find_root_dir.obj', opts=OPTS, input='find_root_dir.cxx')
  4926. if GetTarget() == 'darwin':
  4927. TargetAdd('plugin_find_root_dir_assist.obj', opts=OPTS, input='find_root_dir_assist.mm')
  4928. TargetAdd('plugin_binaryXml.obj', opts=OPTS, input='binaryXml.cxx')
  4929. TargetAdd('plugin_fileSpec.obj', opts=OPTS, input='fileSpec.cxx')
  4930. TargetAdd('plugin_handleStream.obj', opts=OPTS, input='handleStream.cxx')
  4931. TargetAdd('plugin_handleStreamBuf.obj', opts=OPTS, input='handleStreamBuf.cxx')
  4932. if (RTDIST):
  4933. for fname in ("p3d_plugin.dll", "libp3d_plugin_static.ilb"):
  4934. TargetAdd(fname, input='plugin_plugin.obj')
  4935. TargetAdd(fname, input='plugin_mkdir_complete.obj')
  4936. TargetAdd(fname, input='plugin_wstring_encode.obj')
  4937. TargetAdd(fname, input='plugin_parse_color.obj')
  4938. TargetAdd(fname, input='plugin_find_root_dir.obj')
  4939. if GetTarget() == 'darwin':
  4940. TargetAdd(fname, input='plugin_find_root_dir_assist.obj')
  4941. TargetAdd(fname, input='plugin_fileSpec.obj')
  4942. TargetAdd(fname, input='plugin_binaryXml.obj')
  4943. TargetAdd(fname, input='plugin_handleStream.obj')
  4944. TargetAdd(fname, input='plugin_handleStreamBuf.obj')
  4945. TargetAdd(fname, input='libp3tinyxml.ilb')
  4946. if GetTarget() == 'darwin':
  4947. TargetAdd(fname, input='libp3subprocbuffer.ilb')
  4948. TargetAdd(fname, opts=['OPENSSL', 'ZLIB', 'X11', 'ADVAPI', 'WINUSER', 'WINGDI', 'WINSHELL', 'WINCOMCTL', 'WINOLE', 'MSIMG'])
  4949. TargetAdd("libp3d_plugin_static.ilb", input='plugin_get_twirl_data.obj')
  4950. if (PkgSkip("PYTHON")==0 and RTDIST):
  4951. # Freeze VFSImporter and its dependency modules into p3dpython.
  4952. # Mark panda3d.core as a dependency to make sure to build that first.
  4953. TargetAdd('p3dpython_frozen.obj', input='VFSImporter.py', opts=['DIR:direct/src/showbase', 'FREEZE_STARTUP'])
  4954. TargetAdd('p3dpython_frozen.obj', dep='core.pyd')
  4955. OPTS += ['PYTHON']
  4956. TargetAdd('p3dpython_p3dpython_composite1.obj', opts=OPTS, input='p3dpython_composite1.cxx')
  4957. TargetAdd('p3dpython_p3dPythonMain.obj', opts=OPTS, input='p3dPythonMain.cxx')
  4958. TargetAdd('p3dpython.exe', input='p3dpython_p3dpython_composite1.obj')
  4959. TargetAdd('p3dpython.exe', input='p3dpython_p3dPythonMain.obj')
  4960. TargetAdd('p3dpython.exe', input='p3dpython_frozen.obj')
  4961. TargetAdd('p3dpython.exe', input=COMMON_PANDA_LIBS)
  4962. TargetAdd('p3dpython.exe', input='libp3tinyxml.ilb')
  4963. TargetAdd('p3dpython.exe', input='libp3interrogatedb.dll')
  4964. TargetAdd('p3dpython.exe', opts=['PYTHON', 'WINUSER'])
  4965. TargetAdd('libp3dpython.dll', input='p3dpython_p3dpython_composite1.obj')
  4966. TargetAdd('libp3dpython.dll', input='p3dpython_frozen.obj')
  4967. TargetAdd('libp3dpython.dll', input=COMMON_PANDA_LIBS)
  4968. TargetAdd('libp3dpython.dll', input='libp3tinyxml.ilb')
  4969. TargetAdd('libp3dpython.dll', input='libp3interrogatedb.dll')
  4970. TargetAdd('libp3dpython.dll', opts=['PYTHON', 'WINUSER'])
  4971. if GetTarget() == 'windows':
  4972. DefSymbol("NON_CONSOLE", "NON_CONSOLE", "")
  4973. OPTS.append("NON_CONSOLE")
  4974. TargetAdd('p3dpythonw_p3dpython_composite1.obj', opts=OPTS, input='p3dpython_composite1.cxx')
  4975. TargetAdd('p3dpythonw_p3dPythonMain.obj', opts=OPTS, input='p3dPythonMain.cxx')
  4976. TargetAdd('p3dpythonw.exe', input='p3dpythonw_p3dpython_composite1.obj')
  4977. TargetAdd('p3dpythonw.exe', input='p3dpythonw_p3dPythonMain.obj')
  4978. TargetAdd('p3dpythonw.exe', input='p3dpython_frozen.obj')
  4979. TargetAdd('p3dpythonw.exe', input=COMMON_PANDA_LIBS)
  4980. TargetAdd('p3dpythonw.exe', input='libp3tinyxml.ilb')
  4981. TargetAdd('p3dpythonw.exe', input='libp3interrogatedb.dll')
  4982. TargetAdd('p3dpythonw.exe', opts=['SUBSYSTEM:WINDOWS', 'WINUSER'])
  4983. if (PkgSkip("OPENSSL")==0 and RTDIST and False):
  4984. OPTS=['DIR:direct/src/plugin', 'DIR:panda/src/express', 'OPENSSL']
  4985. if GetTarget() == 'darwin':
  4986. OPTS += ['OPT:2']
  4987. if (PkgSkip("FLTK")==0):
  4988. OPTS.append("FLTK")
  4989. TargetAdd('plugin_p3dCert.obj', opts=OPTS, input='p3dCert.cxx')
  4990. TargetAdd('plugin_p3dCert_strings.obj', opts=OPTS, input='p3dCert_strings.cxx')
  4991. TargetAdd('p3dcert.exe', input='plugin_mkdir_complete.obj')
  4992. TargetAdd('p3dcert.exe', input='plugin_wstring_encode.obj')
  4993. TargetAdd('p3dcert.exe', input='plugin_p3dCert.obj')
  4994. TargetAdd('p3dcert.exe', input='plugin_p3dCert_strings.obj')
  4995. OPTS=['SUBSYSTEM:WINDOWS', 'OPENSSL', 'FLTK', 'X11', 'WINCOMCTL', 'WINSOCK', 'WINGDI', 'WINUSER', 'ADVAPI', 'WINOLE', 'WINSHELL', 'SUBSYSTEM:WINDOWS']
  4996. if GetTarget() == 'darwin':
  4997. OPTS += ['OPT:2']
  4998. TargetAdd('p3dcert.exe', opts=OPTS)
  4999. elif (PkgSkip("WX")==0):
  5000. OPTS += ["WX", "RTTI"]
  5001. TargetAdd('plugin_p3dCert.obj', opts=OPTS, input='p3dCert_wx.cxx')
  5002. TargetAdd('p3dcert.exe', input='plugin_mkdir_complete.obj')
  5003. TargetAdd('p3dcert.exe', input='plugin_wstring_encode.obj')
  5004. TargetAdd('p3dcert.exe', input='plugin_p3dCert.obj')
  5005. OPTS=['SUBSYSTEM:WINDOWS', 'OPENSSL', 'WX', 'CARBON', 'WINOLE', 'WINOLEAUT', 'WINUSER', 'ADVAPI', 'WINSHELL', 'WINCOMCTL', 'WINGDI', 'WINCOMDLG']
  5006. if GetTarget() == "darwin":
  5007. OPTS += ['GL', 'OPT:2']
  5008. TargetAdd('p3dcert.exe', opts=OPTS)
  5009. #
  5010. # DIRECTORY: direct/src/plugin_npapi/
  5011. #
  5012. if RUNTIME:
  5013. OPTS=['DIR:direct/src/plugin_npapi', 'RUNTIME', 'GTK2']
  5014. if GetTarget() == 'windows':
  5015. nppanda3d_rc = {"name" : "Panda3D Game Engine Plug-in",
  5016. "version" : VERSION,
  5017. "description" : "Runs 3-D games and interactive applets",
  5018. "filename" : "nppanda3d.dll",
  5019. "mimetype" : "application/x-panda3d",
  5020. "extension" : "p3d",
  5021. "filedesc" : "Panda3D applet"}
  5022. TargetAdd('nppanda3d.res', opts=OPTS, winrc=nppanda3d_rc)
  5023. elif GetTarget() == 'darwin':
  5024. TargetAdd('nppanda3d.rsrc', opts=OPTS, input='nppanda3d.r')
  5025. OPTS += ['GTK2']
  5026. TargetAdd('plugin_npapi_nppanda3d_composite1.obj', opts=OPTS, input='nppanda3d_composite1.cxx')
  5027. TargetAdd('nppanda3d.plugin', input='plugin_common.obj')
  5028. TargetAdd('nppanda3d.plugin', input='plugin_parse_color.obj')
  5029. TargetAdd('nppanda3d.plugin', input='plugin_get_twirl_data.obj')
  5030. TargetAdd('nppanda3d.plugin', input='plugin_wstring_encode.obj')
  5031. TargetAdd('nppanda3d.plugin', input='plugin_npapi_nppanda3d_composite1.obj')
  5032. if GetTarget() == 'windows':
  5033. TargetAdd('nppanda3d.plugin', input='nppanda3d.res')
  5034. TargetAdd('nppanda3d.plugin', input='nppanda3d.def', ipath=OPTS)
  5035. elif GetTarget() == 'darwin':
  5036. TargetAdd('nppanda3d.plugin', input='nppanda3d.rsrc')
  5037. TargetAdd('nppanda3d.plugin', input='nppanda3d.plist', ipath=OPTS)
  5038. TargetAdd('nppanda3d.plugin', input='plugin_find_root_dir_assist.obj')
  5039. TargetAdd('nppanda3d.plugin', input='libp3tinyxml.ilb')
  5040. TargetAdd('nppanda3d.plugin', opts=['OPENSSL', 'WINGDI', 'WINUSER', 'WINSHELL', 'WINOLE', 'CARBON'])
  5041. #
  5042. # DIRECTORY: direct/src/plugin_activex/
  5043. #
  5044. if (RUNTIME and GetTarget() == 'windows' and PkgSkip("MFC")==0):
  5045. OPTS=['DIR:direct/src/plugin_activex', 'RUNTIME', 'ACTIVEX', 'MFC']
  5046. DefSymbol('ACTIVEX', '_USRDLL', '')
  5047. DefSymbol('ACTIVEX', '_WINDLL', '')
  5048. DefSymbol('ACTIVEX', '_AFXDLL', '')
  5049. DefSymbol('ACTIVEX', '_MBCS', '')
  5050. TargetAdd('P3DActiveX.tlb', opts=OPTS, input='P3DActiveX.idl')
  5051. TargetAdd('P3DActiveX.res', opts=OPTS, input='P3DActiveX.rc')
  5052. TargetAdd('plugin_activex_p3dactivex_composite1.obj', opts=OPTS, input='p3dactivex_composite1.cxx')
  5053. TargetAdd('p3dactivex.ocx', input='plugin_common.obj')
  5054. TargetAdd('p3dactivex.ocx', input='plugin_parse_color.obj')
  5055. TargetAdd('p3dactivex.ocx', input='plugin_get_twirl_data.obj')
  5056. TargetAdd('p3dactivex.ocx', input='plugin_wstring_encode.obj')
  5057. TargetAdd('p3dactivex.ocx', input='plugin_activex_p3dactivex_composite1.obj')
  5058. TargetAdd('p3dactivex.ocx', input='P3DActiveX.res')
  5059. TargetAdd('p3dactivex.ocx', input='P3DActiveX.def', ipath=OPTS)
  5060. TargetAdd('p3dactivex.ocx', input='libp3tinyxml.ilb')
  5061. TargetAdd('p3dactivex.ocx', opts=['MFC', 'WINSOCK2', 'OPENSSL', 'WINGDI', 'WINUSER'])
  5062. #
  5063. # DIRECTORY: direct/src/plugin_standalone/
  5064. #
  5065. if (RUNTIME):
  5066. OPTS=['DIR:direct/src/plugin_standalone', 'RUNTIME', 'OPENSSL']
  5067. TargetAdd('plugin_standalone_panda3d.obj', opts=OPTS, input='panda3d.cxx')
  5068. TargetAdd('plugin_standalone_panda3dBase.obj', opts=OPTS, input='panda3dBase.cxx')
  5069. if GetTarget() == 'windows':
  5070. panda3d_rc = {"name" : "Panda3D Game Engine Plug-in",
  5071. "version" : VERSION,
  5072. "description" : "Runs 3-D games and interactive applets",
  5073. "filename" : "panda3d.exe",
  5074. "mimetype" : "application/x-panda3d",
  5075. "extension" : "p3d",
  5076. "filedesc" : "Panda3D applet",
  5077. "icon" : "panda3d.ico"}
  5078. TargetAdd('panda3d.res', opts=OPTS, winrc=panda3d_rc)
  5079. TargetAdd('plugin_standalone_panda3dMain.obj', opts=OPTS, input='panda3dMain.cxx')
  5080. TargetAdd('panda3d.exe', input='plugin_standalone_panda3d.obj')
  5081. TargetAdd('panda3d.exe', input='plugin_standalone_panda3dMain.obj')
  5082. TargetAdd('panda3d.exe', input='plugin_standalone_panda3dBase.obj')
  5083. TargetAdd('panda3d.exe', input='plugin_common.obj')
  5084. TargetAdd('panda3d.exe', input='plugin_wstring_encode.obj')
  5085. if GetTarget() == 'darwin':
  5086. TargetAdd('panda3d.exe', input='plugin_find_root_dir_assist.obj')
  5087. elif GetTarget() == 'windows':
  5088. TargetAdd('panda3d.exe', input='panda3d.res')
  5089. TargetAdd('panda3d.exe', input='libpandaexpress.dll')
  5090. TargetAdd('panda3d.exe', input='libp3dtoolconfig.dll')
  5091. TargetAdd('panda3d.exe', input='libp3dtool.dll')
  5092. #TargetAdd('panda3d.exe', input='libp3pystub.lib')
  5093. TargetAdd('panda3d.exe', input='libp3tinyxml.ilb')
  5094. TargetAdd('panda3d.exe', opts=['NOICON', 'OPENSSL', 'ZLIB', 'WINGDI', 'WINUSER', 'WINSHELL', 'ADVAPI', 'WINSOCK2', 'WINOLE', 'CARBON'])
  5095. if (GetTarget() == 'darwin'):
  5096. TargetAdd('plugin_standalone_panda3dMac.obj', opts=OPTS, input='panda3dMac.cxx')
  5097. TargetAdd('Panda3D.app', input='plugin_standalone_panda3d.obj')
  5098. TargetAdd('Panda3D.app', input='plugin_standalone_panda3dMac.obj')
  5099. TargetAdd('Panda3D.app', input='plugin_standalone_panda3dBase.obj')
  5100. TargetAdd('Panda3D.app', input='plugin_common.obj')
  5101. TargetAdd('Panda3D.app', input='plugin_find_root_dir_assist.obj')
  5102. TargetAdd('Panda3D.app', input='libpandaexpress.dll')
  5103. TargetAdd('Panda3D.app', input='libp3dtoolconfig.dll')
  5104. TargetAdd('Panda3D.app', input='libp3dtool.dll')
  5105. #TargetAdd('Panda3D.app', input='libp3pystub.lib')
  5106. TargetAdd('Panda3D.app', input='libp3tinyxml.ilb')
  5107. TargetAdd('Panda3D.app', input='panda3d_mac.plist', ipath=OPTS)
  5108. TargetAdd('Panda3D.app', input='models/plugin_images/panda3d.icns')
  5109. TargetAdd('Panda3D.app', opts=['OPENSSL', 'ZLIB', 'WINGDI', 'WINUSER', 'WINSHELL', 'ADVAPI', 'WINSOCK2', 'WINOLE', 'CARBON'])
  5110. elif (GetTarget() == 'windows'):
  5111. TargetAdd('plugin_standalone_panda3dWinMain.obj', opts=OPTS, input='panda3dWinMain.cxx')
  5112. TargetAdd('panda3dw.exe', input='plugin_standalone_panda3d.obj')
  5113. TargetAdd('panda3dw.exe', input='plugin_standalone_panda3dWinMain.obj')
  5114. TargetAdd('panda3dw.exe', input='plugin_standalone_panda3dBase.obj')
  5115. TargetAdd('panda3dw.exe', input='plugin_wstring_encode.obj')
  5116. TargetAdd('panda3dw.exe', input='plugin_common.obj')
  5117. TargetAdd('panda3dw.exe', input='libpandaexpress.dll')
  5118. TargetAdd('panda3dw.exe', input='libp3dtoolconfig.dll')
  5119. TargetAdd('panda3dw.exe', input='libp3dtool.dll')
  5120. #TargetAdd('panda3dw.exe', input='libp3pystub.lib')
  5121. TargetAdd('panda3dw.exe', input='libp3tinyxml.ilb')
  5122. TargetAdd('panda3dw.exe', opts=['SUBSYSTEM:WINDOWS', 'OPENSSL', 'ZLIB', 'WINGDI', 'WINUSER', 'WINSHELL', 'ADVAPI', 'WINSOCK2', 'WINOLE', 'CARBON'])
  5123. if (RTDIST):
  5124. 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']
  5125. # This is arguably a big fat ugly hack, but doing it otherwise would complicate the build process considerably.
  5126. DefSymbol("P3DEMBED", "LINK_ALL_STATIC", "")
  5127. TargetAdd('plugin_standalone_panda3dBase.obj', opts=OPTS, input='panda3dBase.cxx')
  5128. TargetAdd('plugin_standalone_p3dEmbedMain.obj', opts=OPTS, input='p3dEmbedMain.cxx')
  5129. TargetAdd('plugin_standalone_p3dEmbed.obj', opts=OPTS, input='p3dEmbed.cxx')
  5130. #TargetAdd('plugin_standalone_pystub.obj', opts=OPTS, input='pystub.cxx')
  5131. TargetAdd('plugin_standalone_dtoolbase_composite1.obj', opts=OPTS, input='p3dtoolbase_composite1.cxx')
  5132. TargetAdd('plugin_standalone_dtoolbase_composite2.obj', opts=OPTS, input='p3dtoolbase_composite2.cxx')
  5133. TargetAdd('plugin_standalone_lookup3.obj', opts=OPTS, input='lookup3.c')
  5134. TargetAdd('plugin_standalone_indent.obj', opts=OPTS, input='indent.cxx')
  5135. TargetAdd('plugin_standalone_dtoolutil_composite1.obj', opts=OPTS, input='p3dtoolutil_composite1.cxx')
  5136. TargetAdd('plugin_standalone_dtoolutil_composite2.obj', opts=OPTS, input='p3dtoolutil_composite2.cxx')
  5137. if (GetTarget() == 'darwin'):
  5138. TargetAdd('plugin_standalone_dtoolutil_filename_assist.obj', opts=OPTS, input='filename_assist.mm')
  5139. TargetAdd('plugin_standalone_prc_composite1.obj', opts=OPTS, input='p3prc_composite1.cxx')
  5140. TargetAdd('plugin_standalone_prc_composite2.obj', opts=OPTS, input='p3prc_composite2.cxx')
  5141. TargetAdd('plugin_standalone_express_composite1.obj', opts=OPTS, input='p3express_composite1.cxx')
  5142. TargetAdd('plugin_standalone_express_composite2.obj', opts=OPTS, input='p3express_composite2.cxx')
  5143. TargetAdd('plugin_standalone_downloader_composite1.obj', opts=OPTS, input='p3downloader_composite1.cxx')
  5144. TargetAdd('plugin_standalone_downloader_composite2.obj', opts=OPTS, input='p3downloader_composite2.cxx')
  5145. TargetAdd('p3dembed.exe', input='plugin_standalone_panda3dBase.obj')
  5146. TargetAdd('p3dembed.exe', input='plugin_standalone_p3dEmbedMain.obj')
  5147. TargetAdd('p3dembed.exe', input='plugin_standalone_p3dEmbed.obj')
  5148. #TargetAdd('p3dembed.exe', input='plugin_standalone_pystub.obj')
  5149. TargetAdd('p3dembed.exe', input='plugin_standalone_dtoolbase_composite1.obj')
  5150. TargetAdd('p3dembed.exe', input='plugin_standalone_dtoolbase_composite2.obj')
  5151. TargetAdd('p3dembed.exe', input='plugin_standalone_lookup3.obj')
  5152. TargetAdd('p3dembed.exe', input='plugin_standalone_indent.obj')
  5153. TargetAdd('p3dembed.exe', input='plugin_standalone_dtoolutil_composite1.obj')
  5154. TargetAdd('p3dembed.exe', input='plugin_standalone_dtoolutil_composite2.obj')
  5155. if GetTarget() == 'darwin':
  5156. TargetAdd('p3dembed.exe', input='plugin_standalone_dtoolutil_filename_assist.obj')
  5157. TargetAdd('p3dembed.exe', input='plugin_standalone_prc_composite1.obj')
  5158. TargetAdd('p3dembed.exe', input='plugin_standalone_prc_composite2.obj')
  5159. TargetAdd('p3dembed.exe', input='plugin_standalone_express_composite1.obj')
  5160. TargetAdd('p3dembed.exe', input='plugin_standalone_express_composite2.obj')
  5161. TargetAdd('p3dembed.exe', input='plugin_standalone_downloader_composite1.obj')
  5162. TargetAdd('p3dembed.exe', input='plugin_standalone_downloader_composite2.obj')
  5163. TargetAdd('p3dembed.exe', input='plugin_common.obj')
  5164. if GetTarget() == 'darwin':
  5165. TargetAdd('p3dembed.exe', input='plugin_find_root_dir_assist.obj')
  5166. TargetAdd('p3dembed.exe', input='libp3subprocbuffer.ilb')
  5167. TargetAdd('p3dembed.exe', input='libp3tinyxml.ilb')
  5168. TargetAdd('p3dembed.exe', input='libp3d_plugin_static.ilb')
  5169. TargetAdd('p3dembed.exe', opts=['NOICON', 'WINGDI', 'WINSOCK2', 'ZLIB', 'WINUSER', 'OPENSSL', 'WINOLE', 'CARBON', 'MSIMG', 'WINCOMCTL', 'ADVAPI', 'WINSHELL', 'X11'])
  5170. if GetTarget() == 'windows':
  5171. OPTS.append("P3DEMBEDW")
  5172. DefSymbol("P3DEMBEDW", "P3DEMBEDW", "")
  5173. TargetAdd('plugin_standalone_p3dEmbedWinMain.obj', opts=OPTS, input='p3dEmbedMain.cxx')
  5174. TargetAdd('p3dembedw.exe', input='plugin_standalone_panda3dBase.obj')
  5175. TargetAdd('p3dembedw.exe', input='plugin_standalone_p3dEmbedWinMain.obj')
  5176. TargetAdd('p3dembedw.exe', input='plugin_standalone_p3dEmbed.obj')
  5177. #TargetAdd('p3dembedw.exe', input='plugin_standalone_pystub.obj')
  5178. TargetAdd('p3dembedw.exe', input='plugin_standalone_dtoolbase_composite1.obj')
  5179. TargetAdd('p3dembedw.exe', input='plugin_standalone_dtoolbase_composite2.obj')
  5180. TargetAdd('p3dembedw.exe', input='plugin_standalone_lookup3.obj')
  5181. TargetAdd('p3dembedw.exe', input='plugin_standalone_indent.obj')
  5182. TargetAdd('p3dembedw.exe', input='plugin_standalone_dtoolutil_composite1.obj')
  5183. TargetAdd('p3dembedw.exe', input='plugin_standalone_dtoolutil_composite2.obj')
  5184. TargetAdd('p3dembedw.exe', input='plugin_standalone_prc_composite1.obj')
  5185. TargetAdd('p3dembedw.exe', input='plugin_standalone_prc_composite2.obj')
  5186. TargetAdd('p3dembedw.exe', input='plugin_standalone_express_composite1.obj')
  5187. TargetAdd('p3dembedw.exe', input='plugin_standalone_express_composite2.obj')
  5188. TargetAdd('p3dembedw.exe', input='plugin_standalone_downloader_composite1.obj')
  5189. TargetAdd('p3dembedw.exe', input='plugin_standalone_downloader_composite2.obj')
  5190. TargetAdd('p3dembedw.exe', input='plugin_common.obj')
  5191. TargetAdd('p3dembedw.exe', input='libp3tinyxml.ilb')
  5192. TargetAdd('p3dembedw.exe', input='libp3d_plugin_static.ilb')
  5193. TargetAdd('p3dembedw.exe', opts=['SUBSYSTEM:WINDOWS', 'NOICON', 'WINGDI', 'WINSOCK2', 'ZLIB', 'WINUSER', 'OPENSSL', 'WINOLE', 'MSIMG', 'WINCOMCTL', 'ADVAPI', 'WINSHELL'])
  5194. #
  5195. # DIRECTORY: pandatool/src/pandatoolbase/
  5196. #
  5197. if (PkgSkip("PANDATOOL")==0):
  5198. OPTS=['DIR:pandatool/src/pandatoolbase']
  5199. TargetAdd('p3pandatoolbase_composite1.obj', opts=OPTS, input='p3pandatoolbase_composite1.cxx')
  5200. TargetAdd('libp3pandatoolbase.lib', input='p3pandatoolbase_composite1.obj')
  5201. #
  5202. # DIRECTORY: pandatool/src/converter/
  5203. #
  5204. if not PkgSkip("PANDATOOL") and not PkgSkip("EGG"):
  5205. OPTS=['DIR:pandatool/src/converter']
  5206. TargetAdd('p3converter_somethingToEggConverter.obj', opts=OPTS, input='somethingToEggConverter.cxx')
  5207. TargetAdd('p3converter_eggToSomethingConverter.obj', opts=OPTS, input='eggToSomethingConverter.cxx')
  5208. TargetAdd('libp3converter.lib', input='p3converter_somethingToEggConverter.obj')
  5209. TargetAdd('libp3converter.lib', input='p3converter_eggToSomethingConverter.obj')
  5210. #
  5211. # DIRECTORY: pandatool/src/progbase/
  5212. #
  5213. if not PkgSkip("PANDATOOL"):
  5214. OPTS=['DIR:pandatool/src/progbase', 'ZLIB']
  5215. TargetAdd('p3progbase_composite1.obj', opts=OPTS, input='p3progbase_composite1.cxx')
  5216. TargetAdd('libp3progbase.lib', input='p3progbase_composite1.obj')
  5217. #
  5218. # DIRECTORY: pandatool/src/eggbase/
  5219. #
  5220. if not PkgSkip("PANDATOOL") and not PkgSkip("EGG"):
  5221. OPTS=['DIR:pandatool/src/eggbase']
  5222. TargetAdd('p3eggbase_composite1.obj', opts=OPTS, input='p3eggbase_composite1.cxx')
  5223. TargetAdd('libp3eggbase.lib', input='p3eggbase_composite1.obj')
  5224. #
  5225. # DIRECTORY: pandatool/src/bam/
  5226. #
  5227. if not PkgSkip("PANDATOOL"):
  5228. OPTS=['DIR:pandatool/src/bam']
  5229. TargetAdd('bam-info_bamInfo.obj', opts=OPTS, input='bamInfo.cxx')
  5230. TargetAdd('bam-info.exe', input='bam-info_bamInfo.obj')
  5231. TargetAdd('bam-info.exe', input='libp3progbase.lib')
  5232. TargetAdd('bam-info.exe', input='libp3pandatoolbase.lib')
  5233. TargetAdd('bam-info.exe', input=COMMON_PANDA_LIBS)
  5234. TargetAdd('bam-info.exe', opts=['ADVAPI', 'FFTW'])
  5235. if not PkgSkip("EGG"):
  5236. TargetAdd('bam2egg_bamToEgg.obj', opts=OPTS, input='bamToEgg.cxx')
  5237. TargetAdd('bam2egg.exe', input='bam2egg_bamToEgg.obj')
  5238. TargetAdd('bam2egg.exe', input=COMMON_EGG2X_LIBS)
  5239. TargetAdd('bam2egg.exe', opts=['ADVAPI', 'FFTW'])
  5240. TargetAdd('egg2bam_eggToBam.obj', opts=OPTS, input='eggToBam.cxx')
  5241. TargetAdd('egg2bam.exe', input='egg2bam_eggToBam.obj')
  5242. TargetAdd('egg2bam.exe', input=COMMON_EGG2X_LIBS)
  5243. TargetAdd('egg2bam.exe', opts=['ADVAPI', 'FFTW'])
  5244. #
  5245. # DIRECTORY: pandatool/src/cvscopy/
  5246. #
  5247. if not PkgSkip("PANDATOOL"):
  5248. OPTS=['DIR:pandatool/src/cvscopy']
  5249. TargetAdd('p3cvscopy_composite1.obj', opts=OPTS, input='p3cvscopy_composite1.cxx')
  5250. TargetAdd('libp3cvscopy.lib', input='p3cvscopy_composite1.obj')
  5251. #
  5252. # DIRECTORY: pandatool/src/daeegg/
  5253. #
  5254. if not PkgSkip("PANDATOOL") and not PkgSkip("FCOLLADA") and not PkgSkip("EGG"):
  5255. OPTS=['DIR:pandatool/src/daeegg', 'FCOLLADA']
  5256. TargetAdd('p3daeegg_composite1.obj', opts=OPTS, input='p3daeegg_composite1.cxx')
  5257. TargetAdd('libp3daeegg.lib', input='p3daeegg_composite1.obj')
  5258. TargetAdd('libp3daeegg.lib', opts=['FCOLLADA', 'CARBON'])
  5259. #
  5260. # DIRECTORY: pandatool/src/assimp
  5261. #
  5262. if not PkgSkip("PANDATOOL") and not PkgSkip("ASSIMP"):
  5263. OPTS=['DIR:pandatool/src/assimp', 'BUILDING:ASSIMP', 'ASSIMP', 'MODULE']
  5264. TargetAdd('p3assimp_composite1.obj', opts=OPTS, input='p3assimp_composite1.cxx')
  5265. TargetAdd('libp3assimp.dll', input='p3assimp_composite1.obj')
  5266. TargetAdd('libp3assimp.dll', input=COMMON_PANDA_LIBS)
  5267. TargetAdd('libp3assimp.dll', opts=OPTS+['ZLIB', 'ADVAPI'])
  5268. #
  5269. # DIRECTORY: pandatool/src/daeprogs/
  5270. #
  5271. if not PkgSkip("PANDATOOL") and not PkgSkip("FCOLLADA") and not PkgSkip("EGG"):
  5272. OPTS=['DIR:pandatool/src/daeprogs', 'FCOLLADA']
  5273. TargetAdd('dae2egg_daeToEgg.obj', opts=OPTS, input='daeToEgg.cxx')
  5274. TargetAdd('dae2egg.exe', input='dae2egg_daeToEgg.obj')
  5275. TargetAdd('dae2egg.exe', input='libp3daeegg.lib')
  5276. TargetAdd('dae2egg.exe', input=COMMON_EGG2X_LIBS)
  5277. TargetAdd('dae2egg.exe', opts=['WINUSER', 'FCOLLADA', 'CARBON'])
  5278. #
  5279. # DIRECTORY: pandatool/src/dxf/
  5280. #
  5281. if not PkgSkip("PANDATOOL"):
  5282. OPTS=['DIR:pandatool/src/dxf']
  5283. TargetAdd('p3dxf_composite1.obj', opts=OPTS, input='p3dxf_composite1.cxx')
  5284. TargetAdd('libp3dxf.lib', input='p3dxf_composite1.obj')
  5285. #
  5286. # DIRECTORY: pandatool/src/dxfegg/
  5287. #
  5288. if not PkgSkip("PANDATOOL") and not PkgSkip("EGG"):
  5289. OPTS=['DIR:pandatool/src/dxfegg']
  5290. TargetAdd('p3dxfegg_dxfToEggConverter.obj', opts=OPTS, input='dxfToEggConverter.cxx')
  5291. TargetAdd('p3dxfegg_dxfToEggLayer.obj', opts=OPTS, input='dxfToEggLayer.cxx')
  5292. TargetAdd('libp3dxfegg.lib', input='p3dxfegg_dxfToEggConverter.obj')
  5293. TargetAdd('libp3dxfegg.lib', input='p3dxfegg_dxfToEggLayer.obj')
  5294. #
  5295. # DIRECTORY: pandatool/src/dxfprogs/
  5296. #
  5297. if not PkgSkip("PANDATOOL"):
  5298. OPTS=['DIR:pandatool/src/dxfprogs']
  5299. TargetAdd('dxf-points_dxfPoints.obj', opts=OPTS, input='dxfPoints.cxx')
  5300. TargetAdd('dxf-points.exe', input='dxf-points_dxfPoints.obj')
  5301. TargetAdd('dxf-points.exe', input='libp3progbase.lib')
  5302. TargetAdd('dxf-points.exe', input='libp3dxf.lib')
  5303. TargetAdd('dxf-points.exe', input='libp3pandatoolbase.lib')
  5304. TargetAdd('dxf-points.exe', input=COMMON_PANDA_LIBS)
  5305. TargetAdd('dxf-points.exe', opts=['ADVAPI', 'FFTW'])
  5306. if not PkgSkip("EGG"):
  5307. TargetAdd('dxf2egg_dxfToEgg.obj', opts=OPTS, input='dxfToEgg.cxx')
  5308. TargetAdd('dxf2egg.exe', input='dxf2egg_dxfToEgg.obj')
  5309. TargetAdd('dxf2egg.exe', input='libp3dxfegg.lib')
  5310. TargetAdd('dxf2egg.exe', input='libp3dxf.lib')
  5311. TargetAdd('dxf2egg.exe', input=COMMON_EGG2X_LIBS)
  5312. TargetAdd('dxf2egg.exe', opts=['ADVAPI', 'FFTW'])
  5313. TargetAdd('egg2dxf_eggToDXF.obj', opts=OPTS, input='eggToDXF.cxx')
  5314. TargetAdd('egg2dxf_eggToDXFLayer.obj', opts=OPTS, input='eggToDXFLayer.cxx')
  5315. TargetAdd('egg2dxf.exe', input='egg2dxf_eggToDXF.obj')
  5316. TargetAdd('egg2dxf.exe', input='egg2dxf_eggToDXFLayer.obj')
  5317. TargetAdd('egg2dxf.exe', input='libp3dxf.lib')
  5318. TargetAdd('egg2dxf.exe', input=COMMON_EGG2X_LIBS)
  5319. TargetAdd('egg2dxf.exe', opts=['ADVAPI', 'FFTW'])
  5320. #
  5321. # DIRECTORY: pandatool/src/objegg/
  5322. #
  5323. if not PkgSkip("PANDATOOL") and not PkgSkip("EGG"):
  5324. OPTS=['DIR:pandatool/src/objegg']
  5325. TargetAdd('p3objegg_objToEggConverter.obj', opts=OPTS, input='objToEggConverter.cxx')
  5326. TargetAdd('p3objegg_eggToObjConverter.obj', opts=OPTS, input='eggToObjConverter.cxx')
  5327. TargetAdd('p3objegg_config_objegg.obj', opts=OPTS, input='config_objegg.cxx')
  5328. TargetAdd('libp3objegg.lib', input='p3objegg_objToEggConverter.obj')
  5329. TargetAdd('libp3objegg.lib', input='p3objegg_eggToObjConverter.obj')
  5330. TargetAdd('libp3objegg.lib', input='p3objegg_config_objegg.obj')
  5331. #
  5332. # DIRECTORY: pandatool/src/objprogs/
  5333. #
  5334. if not PkgSkip("PANDATOOL") and not PkgSkip("EGG"):
  5335. OPTS=['DIR:pandatool/src/objprogs']
  5336. TargetAdd('obj2egg_objToEgg.obj', opts=OPTS, input='objToEgg.cxx')
  5337. TargetAdd('obj2egg.exe', input='obj2egg_objToEgg.obj')
  5338. TargetAdd('obj2egg.exe', input='libp3objegg.lib')
  5339. TargetAdd('obj2egg.exe', input=COMMON_EGG2X_LIBS)
  5340. TargetAdd('egg2obj_eggToObj.obj', opts=OPTS, input='eggToObj.cxx')
  5341. TargetAdd('egg2obj.exe', input='egg2obj_eggToObj.obj')
  5342. TargetAdd('egg2obj.exe', input='libp3objegg.lib')
  5343. TargetAdd('egg2obj.exe', input=COMMON_EGG2X_LIBS)
  5344. #
  5345. # DIRECTORY: pandatool/src/palettizer/
  5346. #
  5347. if not PkgSkip("PANDATOOL") and not PkgSkip("EGG"):
  5348. OPTS=['DIR:pandatool/src/palettizer']
  5349. TargetAdd('p3palettizer_composite1.obj', opts=OPTS, input='p3palettizer_composite1.cxx')
  5350. TargetAdd('libp3palettizer.lib', input='p3palettizer_composite1.obj')
  5351. #
  5352. # DIRECTORY: pandatool/src/egg-mkfont/
  5353. #
  5354. if not PkgSkip("FREETYPE") and not PkgSkip("PANDATOOL") and not PkgSkip("EGG"):
  5355. OPTS=['DIR:pandatool/src/egg-mkfont', 'DIR:pandatool/src/palettizer', 'FREETYPE']
  5356. TargetAdd('egg-mkfont_eggMakeFont.obj', opts=OPTS, input='eggMakeFont.cxx')
  5357. TargetAdd('egg-mkfont_rangeDescription.obj', opts=OPTS, input='rangeDescription.cxx')
  5358. TargetAdd('egg-mkfont_rangeIterator.obj', opts=OPTS, input='rangeIterator.cxx')
  5359. TargetAdd('egg-mkfont.exe', input='egg-mkfont_eggMakeFont.obj')
  5360. TargetAdd('egg-mkfont.exe', input='egg-mkfont_rangeDescription.obj')
  5361. TargetAdd('egg-mkfont.exe', input='egg-mkfont_rangeIterator.obj')
  5362. TargetAdd('egg-mkfont.exe', input='libp3palettizer.lib')
  5363. TargetAdd('egg-mkfont.exe', input=COMMON_EGG2X_LIBS)
  5364. TargetAdd('egg-mkfont.exe', opts=['ADVAPI', 'FREETYPE'])
  5365. #
  5366. # DIRECTORY: pandatool/src/eggcharbase/
  5367. #
  5368. if not PkgSkip("PANDATOOL") and not PkgSkip("EGG"):
  5369. OPTS=['DIR:pandatool/src/eggcharbase', 'ZLIB']
  5370. TargetAdd('p3eggcharbase_composite1.obj', opts=OPTS, input='p3eggcharbase_composite1.cxx')
  5371. TargetAdd('libp3eggcharbase.lib', input='p3eggcharbase_composite1.obj')
  5372. #
  5373. # DIRECTORY: pandatool/src/egg-optchar/
  5374. #
  5375. if not PkgSkip("PANDATOOL") and not PkgSkip("EGG"):
  5376. OPTS=['DIR:pandatool/src/egg-optchar']
  5377. TargetAdd('egg-optchar_config_egg_optchar.obj', opts=OPTS, input='config_egg_optchar.cxx')
  5378. TargetAdd('egg-optchar_eggOptchar.obj', opts=OPTS, input='eggOptchar.cxx')
  5379. TargetAdd('egg-optchar_eggOptcharUserData.obj', opts=OPTS, input='eggOptcharUserData.cxx')
  5380. TargetAdd('egg-optchar_vertexMembership.obj', opts=OPTS, input='vertexMembership.cxx')
  5381. TargetAdd('egg-optchar.exe', input='egg-optchar_config_egg_optchar.obj')
  5382. TargetAdd('egg-optchar.exe', input='egg-optchar_eggOptchar.obj')
  5383. TargetAdd('egg-optchar.exe', input='egg-optchar_eggOptcharUserData.obj')
  5384. TargetAdd('egg-optchar.exe', input='egg-optchar_vertexMembership.obj')
  5385. TargetAdd('egg-optchar.exe', input='libp3eggcharbase.lib')
  5386. TargetAdd('egg-optchar.exe', input=COMMON_EGG2X_LIBS)
  5387. TargetAdd('egg-optchar.exe', opts=['ADVAPI', 'FREETYPE'])
  5388. #
  5389. # DIRECTORY: pandatool/src/egg-palettize/
  5390. #
  5391. if not PkgSkip("PANDATOOL") and not PkgSkip("EGG"):
  5392. OPTS=['DIR:pandatool/src/egg-palettize', 'DIR:pandatool/src/palettizer']
  5393. TargetAdd('egg-palettize_eggPalettize.obj', opts=OPTS, input='eggPalettize.cxx')
  5394. TargetAdd('egg-palettize.exe', input='egg-palettize_eggPalettize.obj')
  5395. TargetAdd('egg-palettize.exe', input='libp3palettizer.lib')
  5396. TargetAdd('egg-palettize.exe', input=COMMON_EGG2X_LIBS)
  5397. TargetAdd('egg-palettize.exe', opts=['ADVAPI'])
  5398. #
  5399. # DIRECTORY: pandatool/src/egg-qtess/
  5400. #
  5401. if not PkgSkip("PANDATOOL") and not PkgSkip("EGG"):
  5402. OPTS=['DIR:pandatool/src/egg-qtess']
  5403. TargetAdd('egg-qtess_composite1.obj', opts=OPTS, input='egg-qtess_composite1.cxx')
  5404. TargetAdd('egg-qtess.exe', input='egg-qtess_composite1.obj')
  5405. TargetAdd('egg-qtess.exe', input='libp3eggbase.lib')
  5406. TargetAdd('egg-qtess.exe', input='libp3progbase.lib')
  5407. TargetAdd('egg-qtess.exe', input='libp3converter.lib')
  5408. TargetAdd('egg-qtess.exe', input=COMMON_EGG2X_LIBS)
  5409. TargetAdd('egg-qtess.exe', opts=['ADVAPI'])
  5410. #
  5411. # DIRECTORY: pandatool/src/eggprogs/
  5412. #
  5413. if not PkgSkip("PANDATOOL") and not PkgSkip("EGG"):
  5414. OPTS=['DIR:pandatool/src/eggprogs']
  5415. TargetAdd('egg-crop_eggCrop.obj', opts=OPTS, input='eggCrop.cxx')
  5416. TargetAdd('egg-crop.exe', input='egg-crop_eggCrop.obj')
  5417. TargetAdd('egg-crop.exe', input=COMMON_EGG2X_LIBS)
  5418. TargetAdd('egg-crop.exe', opts=['ADVAPI'])
  5419. TargetAdd('egg-make-tube_eggMakeTube.obj', opts=OPTS, input='eggMakeTube.cxx')
  5420. TargetAdd('egg-make-tube.exe', input='egg-make-tube_eggMakeTube.obj')
  5421. TargetAdd('egg-make-tube.exe', input=COMMON_EGG2X_LIBS)
  5422. TargetAdd('egg-make-tube.exe', opts=['ADVAPI'])
  5423. TargetAdd('egg-texture-cards_eggTextureCards.obj', opts=OPTS, input='eggTextureCards.cxx')
  5424. TargetAdd('egg-texture-cards.exe', input='egg-texture-cards_eggTextureCards.obj')
  5425. TargetAdd('egg-texture-cards.exe', input=COMMON_EGG2X_LIBS)
  5426. TargetAdd('egg-texture-cards.exe', opts=['ADVAPI'])
  5427. TargetAdd('egg-topstrip_eggTopstrip.obj', opts=OPTS, input='eggTopstrip.cxx')
  5428. TargetAdd('egg-topstrip.exe', input='egg-topstrip_eggTopstrip.obj')
  5429. TargetAdd('egg-topstrip.exe', input='libp3eggcharbase.lib')
  5430. TargetAdd('egg-topstrip.exe', input=COMMON_EGG2X_LIBS)
  5431. TargetAdd('egg-topstrip.exe', opts=['ADVAPI'])
  5432. TargetAdd('egg-trans_eggTrans.obj', opts=OPTS, input='eggTrans.cxx')
  5433. TargetAdd('egg-trans.exe', input='egg-trans_eggTrans.obj')
  5434. TargetAdd('egg-trans.exe', input=COMMON_EGG2X_LIBS)
  5435. TargetAdd('egg-trans.exe', opts=['ADVAPI'])
  5436. TargetAdd('egg2c_eggToC.obj', opts=OPTS, input='eggToC.cxx')
  5437. TargetAdd('egg2c.exe', input='egg2c_eggToC.obj')
  5438. TargetAdd('egg2c.exe', input=COMMON_EGG2X_LIBS)
  5439. TargetAdd('egg2c.exe', opts=['ADVAPI'])
  5440. TargetAdd('egg-rename_eggRename.obj', opts=OPTS, input='eggRename.cxx')
  5441. TargetAdd('egg-rename.exe', input='egg-rename_eggRename.obj')
  5442. TargetAdd('egg-rename.exe', input=COMMON_EGG2X_LIBS)
  5443. TargetAdd('egg-rename.exe', opts=['ADVAPI'])
  5444. TargetAdd('egg-retarget-anim_eggRetargetAnim.obj', opts=OPTS, input='eggRetargetAnim.cxx')
  5445. TargetAdd('egg-retarget-anim.exe', input='egg-retarget-anim_eggRetargetAnim.obj')
  5446. TargetAdd('egg-retarget-anim.exe', input='libp3eggcharbase.lib')
  5447. TargetAdd('egg-retarget-anim.exe', input=COMMON_EGG2X_LIBS)
  5448. TargetAdd('egg-retarget-anim.exe', opts=['ADVAPI'])
  5449. TargetAdd('egg-list-textures_eggListTextures.obj', opts=OPTS, input='eggListTextures.cxx')
  5450. TargetAdd('egg-list-textures.exe', input='egg-list-textures_eggListTextures.obj')
  5451. TargetAdd('egg-list-textures.exe', input=COMMON_EGG2X_LIBS)
  5452. TargetAdd('egg-list-textures.exe', opts=['ADVAPI'])
  5453. #
  5454. # DIRECTORY: pandatool/src/flt/
  5455. #
  5456. if not PkgSkip("PANDATOOL"):
  5457. OPTS=['DIR:pandatool/src/flt', 'ZLIB']
  5458. TargetAdd('p3flt_composite1.obj', opts=OPTS, input='p3flt_composite1.cxx')
  5459. TargetAdd('libp3flt.lib', input=['p3flt_composite1.obj'])
  5460. #
  5461. # DIRECTORY: pandatool/src/fltegg/
  5462. #
  5463. if not PkgSkip("PANDATOOL") and not PkgSkip("EGG"):
  5464. OPTS=['DIR:pandatool/src/fltegg']
  5465. TargetAdd('p3fltegg_fltToEggConverter.obj', opts=OPTS, input='fltToEggConverter.cxx')
  5466. TargetAdd('p3fltegg_fltToEggLevelState.obj', opts=OPTS, input='fltToEggLevelState.cxx')
  5467. TargetAdd('libp3fltegg.lib', input=['p3fltegg_fltToEggConverter.obj', 'p3fltegg_fltToEggLevelState.obj'])
  5468. #
  5469. # DIRECTORY: pandatool/src/fltprogs/
  5470. #
  5471. if not PkgSkip("PANDATOOL"):
  5472. OPTS=['DIR:pandatool/src/fltprogs', 'DIR:pandatool/src/flt', 'DIR:pandatool/src/cvscopy']
  5473. TargetAdd('flt-info_fltInfo.obj', opts=OPTS, input='fltInfo.cxx')
  5474. TargetAdd('flt-info.exe', input='flt-info_fltInfo.obj')
  5475. TargetAdd('flt-info.exe', input='libp3flt.lib')
  5476. TargetAdd('flt-info.exe', input='libp3progbase.lib')
  5477. TargetAdd('flt-info.exe', input='libp3pandatoolbase.lib')
  5478. TargetAdd('flt-info.exe', input=COMMON_PANDA_LIBS)
  5479. TargetAdd('flt-info.exe', opts=['ADVAPI'])
  5480. TargetAdd('flt-trans_fltTrans.obj', opts=OPTS, input='fltTrans.cxx')
  5481. TargetAdd('flt-trans.exe', input='flt-trans_fltTrans.obj')
  5482. TargetAdd('flt-trans.exe', input='libp3flt.lib')
  5483. TargetAdd('flt-trans.exe', input='libp3progbase.lib')
  5484. TargetAdd('flt-trans.exe', input='libp3pandatoolbase.lib')
  5485. TargetAdd('flt-trans.exe', input=COMMON_PANDA_LIBS)
  5486. TargetAdd('flt-trans.exe', opts=['ADVAPI'])
  5487. TargetAdd('fltcopy_fltCopy.obj', opts=OPTS, input='fltCopy.cxx')
  5488. TargetAdd('fltcopy.exe', input='fltcopy_fltCopy.obj')
  5489. TargetAdd('fltcopy.exe', input='libp3cvscopy.lib')
  5490. TargetAdd('fltcopy.exe', input='libp3flt.lib')
  5491. TargetAdd('fltcopy.exe', input='libp3progbase.lib')
  5492. TargetAdd('fltcopy.exe', input='libp3pandatoolbase.lib')
  5493. TargetAdd('fltcopy.exe', input=COMMON_PANDA_LIBS)
  5494. TargetAdd('fltcopy.exe', opts=['ADVAPI'])
  5495. if not PkgSkip("EGG"):
  5496. TargetAdd('egg2flt_eggToFlt.obj', opts=OPTS, input='eggToFlt.cxx')
  5497. TargetAdd('egg2flt.exe', input='egg2flt_eggToFlt.obj')
  5498. TargetAdd('egg2flt.exe', input='libp3flt.lib')
  5499. TargetAdd('egg2flt.exe', input=COMMON_EGG2X_LIBS)
  5500. TargetAdd('egg2flt.exe', opts=['ADVAPI'])
  5501. TargetAdd('flt2egg_fltToEgg.obj', opts=OPTS, input='fltToEgg.cxx')
  5502. TargetAdd('flt2egg.exe', input='flt2egg_fltToEgg.obj')
  5503. TargetAdd('flt2egg.exe', input='libp3flt.lib')
  5504. TargetAdd('flt2egg.exe', input='libp3fltegg.lib')
  5505. TargetAdd('flt2egg.exe', input=COMMON_EGG2X_LIBS)
  5506. TargetAdd('flt2egg.exe', opts=['ADVAPI'])
  5507. #
  5508. # DIRECTORY: pandatool/src/imagebase/
  5509. #
  5510. if not PkgSkip("PANDATOOL"):
  5511. OPTS=['DIR:pandatool/src/imagebase']
  5512. TargetAdd('p3imagebase_composite1.obj', opts=OPTS, input='p3imagebase_composite1.cxx')
  5513. TargetAdd('libp3imagebase.lib', input='p3imagebase_composite1.obj')
  5514. #
  5515. # DIRECTORY: pandatool/src/imageprogs/
  5516. #
  5517. if not PkgSkip("PANDATOOL"):
  5518. OPTS=['DIR:pandatool/src/imageprogs']
  5519. TargetAdd('image-info_imageInfo.obj', opts=OPTS, input='imageInfo.cxx')
  5520. TargetAdd('image-info.exe', input='image-info_imageInfo.obj')
  5521. TargetAdd('image-info.exe', input='libp3imagebase.lib')
  5522. TargetAdd('image-info.exe', input='libp3progbase.lib')
  5523. TargetAdd('image-info.exe', input='libp3pandatoolbase.lib')
  5524. TargetAdd('image-info.exe', input=COMMON_PANDA_LIBS)
  5525. TargetAdd('image-info.exe', opts=['ADVAPI'])
  5526. TargetAdd('image-resize_imageResize.obj', opts=OPTS, input='imageResize.cxx')
  5527. TargetAdd('image-resize.exe', input='image-resize_imageResize.obj')
  5528. TargetAdd('image-resize.exe', input='libp3imagebase.lib')
  5529. TargetAdd('image-resize.exe', input='libp3progbase.lib')
  5530. TargetAdd('image-resize.exe', input='libp3pandatoolbase.lib')
  5531. TargetAdd('image-resize.exe', input=COMMON_PANDA_LIBS)
  5532. TargetAdd('image-resize.exe', opts=['ADVAPI'])
  5533. TargetAdd('image-trans_imageTrans.obj', opts=OPTS, input='imageTrans.cxx')
  5534. TargetAdd('image-trans.exe', input='image-trans_imageTrans.obj')
  5535. TargetAdd('image-trans.exe', input='libp3imagebase.lib')
  5536. TargetAdd('image-trans.exe', input='libp3progbase.lib')
  5537. TargetAdd('image-trans.exe', input='libp3pandatoolbase.lib')
  5538. TargetAdd('image-trans.exe', input=COMMON_PANDA_LIBS)
  5539. TargetAdd('image-trans.exe', opts=['ADVAPI'])
  5540. #
  5541. # DIRECTORY: pandatool/src/pfmprogs/
  5542. #
  5543. if not PkgSkip("PANDATOOL"):
  5544. OPTS=['DIR:pandatool/src/pfmprogs']
  5545. TargetAdd('pfm-trans_pfmTrans.obj', opts=OPTS, input='pfmTrans.cxx')
  5546. TargetAdd('pfm-trans.exe', input='pfm-trans_pfmTrans.obj')
  5547. TargetAdd('pfm-trans.exe', input='libp3progbase.lib')
  5548. TargetAdd('pfm-trans.exe', input='libp3pandatoolbase.lib')
  5549. TargetAdd('pfm-trans.exe', input=COMMON_PANDA_LIBS)
  5550. TargetAdd('pfm-trans.exe', opts=['ADVAPI'])
  5551. TargetAdd('pfm-bba_pfmBba.obj', opts=OPTS, input='pfmBba.cxx')
  5552. TargetAdd('pfm-bba_config_pfmprogs.obj', opts=OPTS, input='config_pfmprogs.cxx')
  5553. TargetAdd('pfm-bba.exe', input='pfm-bba_pfmBba.obj')
  5554. TargetAdd('pfm-bba.exe', input='pfm-bba_config_pfmprogs.obj')
  5555. TargetAdd('pfm-bba.exe', input='libp3progbase.lib')
  5556. TargetAdd('pfm-bba.exe', input='libp3pandatoolbase.lib')
  5557. TargetAdd('pfm-bba.exe', input=COMMON_PANDA_LIBS)
  5558. TargetAdd('pfm-bba.exe', opts=['ADVAPI'])
  5559. #
  5560. # DIRECTORY: pandatool/src/lwo/
  5561. #
  5562. if not PkgSkip("PANDATOOL"):
  5563. OPTS=['DIR:pandatool/src/lwo']
  5564. TargetAdd('p3lwo_composite1.obj', opts=OPTS, input='p3lwo_composite1.cxx')
  5565. TargetAdd('libp3lwo.lib', input='p3lwo_composite1.obj')
  5566. #
  5567. # DIRECTORY: pandatool/src/lwoegg/
  5568. #
  5569. if not PkgSkip("PANDATOOL") and not PkgSkip("EGG"):
  5570. OPTS=['DIR:pandatool/src/lwoegg']
  5571. TargetAdd('p3lwoegg_composite1.obj', opts=OPTS, input='p3lwoegg_composite1.cxx')
  5572. TargetAdd('libp3lwoegg.lib', input='p3lwoegg_composite1.obj')
  5573. #
  5574. # DIRECTORY: pandatool/src/lwoprogs/
  5575. #
  5576. if not PkgSkip("PANDATOOL"):
  5577. OPTS=['DIR:pandatool/src/lwoprogs', 'DIR:pandatool/src/lwo']
  5578. TargetAdd('lwo-scan_lwoScan.obj', opts=OPTS, input='lwoScan.cxx')
  5579. TargetAdd('lwo-scan.exe', input='lwo-scan_lwoScan.obj')
  5580. TargetAdd('lwo-scan.exe', input='libp3lwo.lib')
  5581. TargetAdd('lwo-scan.exe', input='libp3progbase.lib')
  5582. TargetAdd('lwo-scan.exe', input='libp3pandatoolbase.lib')
  5583. TargetAdd('lwo-scan.exe', input=COMMON_PANDA_LIBS)
  5584. TargetAdd('lwo-scan.exe', opts=['ADVAPI'])
  5585. if not PkgSkip("EGG"):
  5586. TargetAdd('lwo2egg_lwoToEgg.obj', opts=OPTS, input='lwoToEgg.cxx')
  5587. TargetAdd('lwo2egg.exe', input='lwo2egg_lwoToEgg.obj')
  5588. TargetAdd('lwo2egg.exe', input='libp3lwo.lib')
  5589. TargetAdd('lwo2egg.exe', input='libp3lwoegg.lib')
  5590. TargetAdd('lwo2egg.exe', input=COMMON_EGG2X_LIBS)
  5591. TargetAdd('lwo2egg.exe', opts=['ADVAPI'])
  5592. #
  5593. # DIRECTORY: pandatool/src/maya/
  5594. #
  5595. for VER in MAYAVERSIONS:
  5596. VNUM=VER[4:]
  5597. if not PkgSkip(VER) and not PkgSkip("PANDATOOL"):
  5598. OPTS=['DIR:pandatool/src/maya', VER]
  5599. TargetAdd('maya'+VNUM+'_composite1.obj', opts=OPTS, input='p3maya_composite1.cxx')
  5600. TargetAdd('libmaya'+VNUM+'.lib', input='maya'+VNUM+'_composite1.obj')
  5601. #
  5602. # DIRECTORY: pandatool/src/mayaegg/
  5603. #
  5604. for VER in MAYAVERSIONS:
  5605. VNUM=VER[4:]
  5606. if not PkgSkip(VER) and not PkgSkip("PANDATOOL") and not PkgSkip("EGG"):
  5607. OPTS=['DIR:pandatool/src/mayaegg', 'DIR:pandatool/src/maya', VER]
  5608. TargetAdd('mayaegg'+VNUM+'_loader.obj', opts=OPTS, input='mayaEggLoader.cxx')
  5609. TargetAdd('mayaegg'+VNUM+'_composite1.obj', opts=OPTS, input='p3mayaegg_composite1.cxx')
  5610. TargetAdd('libmayaegg'+VNUM+'.lib', input='mayaegg'+VNUM+'_loader.obj')
  5611. TargetAdd('libmayaegg'+VNUM+'.lib', input='mayaegg'+VNUM+'_composite1.obj')
  5612. #
  5613. # DIRECTORY: pandatool/src/maxegg/
  5614. #
  5615. for VER in MAXVERSIONS:
  5616. VNUM=VER[3:]
  5617. if not PkgSkip(VER) and not PkgSkip("PANDATOOL") and not PkgSkip("EGG"):
  5618. OPTS=['DIR:pandatool/src/maxegg', VER, "WINCOMCTL", "WINCOMDLG", "WINUSER", "MSFORSCOPE", "RTTI"]
  5619. TargetAdd('maxEgg'+VNUM+'.res', opts=OPTS, input='maxEgg.rc')
  5620. TargetAdd('maxegg'+VNUM+'_loader.obj', opts=OPTS, input='maxEggLoader.cxx')
  5621. TargetAdd('maxegg'+VNUM+'_composite1.obj', opts=OPTS, input='p3maxegg_composite1.cxx')
  5622. TargetAdd('maxegg'+VNUM+'.dlo', input='maxegg'+VNUM+'_composite1.obj')
  5623. TargetAdd('maxegg'+VNUM+'.dlo', input='maxEgg'+VNUM+'.res')
  5624. TargetAdd('maxegg'+VNUM+'.dlo', input='maxEgg.def', ipath=OPTS)
  5625. TargetAdd('maxegg'+VNUM+'.dlo', input=COMMON_EGG2X_LIBS)
  5626. TargetAdd('maxegg'+VNUM+'.dlo', opts=OPTS)
  5627. #
  5628. # DIRECTORY: pandatool/src/maxprogs/
  5629. #
  5630. for VER in MAXVERSIONS:
  5631. VNUM=VER[3:]
  5632. if not PkgSkip(VER) and not PkgSkip("PANDATOOL") and not PkgSkip("EGG"):
  5633. OPTS=['DIR:pandatool/src/maxprogs', VER, "WINCOMCTL", "WINCOMDLG", "WINUSER", "MSFORSCOPE", "RTTI"]
  5634. TargetAdd('maxImportRes.res', opts=OPTS, input='maxImportRes.rc')
  5635. TargetAdd('maxprogs'+VNUM+'_maxeggimport.obj', opts=OPTS, input='maxEggImport.cxx')
  5636. TargetAdd('maxeggimport'+VNUM+'.dle', input='maxegg'+VNUM+'_loader.obj')
  5637. TargetAdd('maxeggimport'+VNUM+'.dle', input='maxprogs'+VNUM+'_maxeggimport.obj')
  5638. TargetAdd('maxeggimport'+VNUM+'.dle', input='libpandaegg.dll')
  5639. TargetAdd('maxeggimport'+VNUM+'.dle', input='libpanda.dll')
  5640. TargetAdd('maxeggimport'+VNUM+'.dle', input='libpandaexpress.dll')
  5641. TargetAdd('maxeggimport'+VNUM+'.dle', input='maxImportRes.res')
  5642. TargetAdd('maxeggimport'+VNUM+'.dle', input='maxEggImport.def', ipath=OPTS)
  5643. TargetAdd('maxeggimport'+VNUM+'.dle', input=COMMON_DTOOL_LIBS)
  5644. TargetAdd('maxeggimport'+VNUM+'.dle', opts=OPTS)
  5645. #
  5646. # DIRECTORY: pandatool/src/vrml/
  5647. #
  5648. if not PkgSkip("PANDATOOL"):
  5649. OPTS=['DIR:pandatool/src/vrml', 'ZLIB', 'BISONPREFIX_vrmlyy']
  5650. CreateFile(GetOutputDir()+"/include/vrmlParser.h")
  5651. TargetAdd('p3vrml_vrmlParser.obj', opts=OPTS, input='vrmlParser.yxx')
  5652. TargetAdd('vrmlParser.h', input='p3vrml_vrmlParser.obj', opts=['DEPENDENCYONLY'])
  5653. TargetAdd('p3vrml_vrmlLexer.obj', opts=OPTS, input='vrmlLexer.lxx')
  5654. TargetAdd('p3vrml_parse_vrml.obj', opts=OPTS, input='parse_vrml.cxx')
  5655. TargetAdd('p3vrml_standard_nodes.obj', opts=OPTS, input='standard_nodes.cxx')
  5656. TargetAdd('p3vrml_vrmlNode.obj', opts=OPTS, input='vrmlNode.cxx')
  5657. TargetAdd('p3vrml_vrmlNodeType.obj', opts=OPTS, input='vrmlNodeType.cxx')
  5658. TargetAdd('libp3vrml.lib', input='p3vrml_parse_vrml.obj')
  5659. TargetAdd('libp3vrml.lib', input='p3vrml_standard_nodes.obj')
  5660. TargetAdd('libp3vrml.lib', input='p3vrml_vrmlNode.obj')
  5661. TargetAdd('libp3vrml.lib', input='p3vrml_vrmlNodeType.obj')
  5662. TargetAdd('libp3vrml.lib', input='p3vrml_vrmlParser.obj')
  5663. TargetAdd('libp3vrml.lib', input='p3vrml_vrmlLexer.obj')
  5664. #
  5665. # DIRECTORY: pandatool/src/vrmlegg/
  5666. #
  5667. if not PkgSkip("PANDATOOL") and not PkgSkip("EGG"):
  5668. OPTS=['DIR:pandatool/src/vrmlegg', 'DIR:pandatool/src/vrml']
  5669. TargetAdd('p3vrmlegg_indexedFaceSet.obj', opts=OPTS, input='indexedFaceSet.cxx')
  5670. TargetAdd('p3vrmlegg_vrmlAppearance.obj', opts=OPTS, input='vrmlAppearance.cxx')
  5671. TargetAdd('p3vrmlegg_vrmlToEggConverter.obj', opts=OPTS, input='vrmlToEggConverter.cxx')
  5672. TargetAdd('libp3vrmlegg.lib', input='p3vrmlegg_indexedFaceSet.obj')
  5673. TargetAdd('libp3vrmlegg.lib', input='p3vrmlegg_vrmlAppearance.obj')
  5674. TargetAdd('libp3vrmlegg.lib', input='p3vrmlegg_vrmlToEggConverter.obj')
  5675. #
  5676. # DIRECTORY: pandatool/src/xfile/
  5677. #
  5678. if not PkgSkip("PANDATOOL"):
  5679. OPTS=['DIR:pandatool/src/xfile', 'ZLIB', 'BISONPREFIX_xyy', 'FLEXDASHI']
  5680. CreateFile(GetOutputDir()+"/include/xParser.h")
  5681. TargetAdd('p3xfile_xParser.obj', opts=OPTS, input='xParser.yxx')
  5682. TargetAdd('xParser.h', input='p3xfile_xParser.obj', opts=['DEPENDENCYONLY'])
  5683. TargetAdd('p3xfile_xLexer.obj', opts=OPTS, input='xLexer.lxx')
  5684. TargetAdd('p3xfile_composite1.obj', opts=OPTS, input='p3xfile_composite1.cxx')
  5685. TargetAdd('libp3xfile.lib', input='p3xfile_composite1.obj')
  5686. TargetAdd('libp3xfile.lib', input='p3xfile_xParser.obj')
  5687. TargetAdd('libp3xfile.lib', input='p3xfile_xLexer.obj')
  5688. #
  5689. # DIRECTORY: pandatool/src/xfileegg/
  5690. #
  5691. if not PkgSkip("PANDATOOL") and not PkgSkip("EGG"):
  5692. OPTS=['DIR:pandatool/src/xfileegg', 'DIR:pandatool/src/xfile']
  5693. TargetAdd('p3xfileegg_composite1.obj', opts=OPTS, input='p3xfileegg_composite1.cxx')
  5694. TargetAdd('libp3xfileegg.lib', input='p3xfileegg_composite1.obj')
  5695. #
  5696. # DIRECTORY: pandatool/src/ptloader/
  5697. #
  5698. if not PkgSkip("PANDATOOL") and not PkgSkip("EGG"):
  5699. if not PkgSkip("FCOLLADA"):
  5700. DefSymbol("FCOLLADA", "HAVE_FCOLLADA")
  5701. 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']
  5702. TargetAdd('p3ptloader_config_ptloader.obj', opts=OPTS, input='config_ptloader.cxx', dep='dtool_have_fcollada.dat')
  5703. TargetAdd('p3ptloader_loaderFileTypePandatool.obj', opts=OPTS, input='loaderFileTypePandatool.cxx')
  5704. TargetAdd('libp3ptloader.dll', input='p3ptloader_config_ptloader.obj')
  5705. TargetAdd('libp3ptloader.dll', input='p3ptloader_loaderFileTypePandatool.obj')
  5706. TargetAdd('libp3ptloader.dll', input='libp3fltegg.lib')
  5707. TargetAdd('libp3ptloader.dll', input='libp3flt.lib')
  5708. TargetAdd('libp3ptloader.dll', input='libp3lwoegg.lib')
  5709. TargetAdd('libp3ptloader.dll', input='libp3lwo.lib')
  5710. TargetAdd('libp3ptloader.dll', input='libp3dxfegg.lib')
  5711. TargetAdd('libp3ptloader.dll', input='libp3dxf.lib')
  5712. TargetAdd('libp3ptloader.dll', input='libp3objegg.lib')
  5713. TargetAdd('libp3ptloader.dll', input='libp3vrmlegg.lib')
  5714. TargetAdd('libp3ptloader.dll', input='libp3vrml.lib')
  5715. TargetAdd('libp3ptloader.dll', input='libp3xfileegg.lib')
  5716. TargetAdd('libp3ptloader.dll', input='libp3xfile.lib')
  5717. if (PkgSkip("FCOLLADA")==0): TargetAdd('libp3ptloader.dll', input='libp3daeegg.lib')
  5718. TargetAdd('libp3ptloader.dll', input='libp3eggbase.lib')
  5719. TargetAdd('libp3ptloader.dll', input='libp3progbase.lib')
  5720. TargetAdd('libp3ptloader.dll', input='libp3converter.lib')
  5721. TargetAdd('libp3ptloader.dll', input='libp3pandatoolbase.lib')
  5722. TargetAdd('libp3ptloader.dll', input='libpandaegg.dll')
  5723. TargetAdd('libp3ptloader.dll', input=COMMON_PANDA_LIBS)
  5724. TargetAdd('libp3ptloader.dll', opts=['MODULE', 'ADVAPI', 'FCOLLADA', 'WINUSER'])
  5725. #
  5726. # DIRECTORY: pandatool/src/miscprogs/
  5727. #
  5728. # This is a bit of an esoteric tool, and it causes issues because
  5729. # it conflicts with tools of the same name in different packages.
  5730. #if (PkgSkip("PANDATOOL")==0):
  5731. # OPTS=['DIR:pandatool/src/miscprogs']
  5732. # TargetAdd('bin2c_binToC.obj', opts=OPTS, input='binToC.cxx')
  5733. # TargetAdd('bin2c.exe', input='bin2c_binToC.obj')
  5734. # TargetAdd('bin2c.exe', input='libp3progbase.lib')
  5735. # TargetAdd('bin2c.exe', input='libp3pandatoolbase.lib')
  5736. # TargetAdd('bin2c.exe', input=COMMON_PANDA_LIBS)
  5737. # TargetAdd('bin2c.exe', opts=['ADVAPI'])
  5738. #
  5739. # DIRECTORY: pandatool/src/pstatserver/
  5740. #
  5741. if (PkgSkip("PANDATOOL")==0):
  5742. OPTS=['DIR:pandatool/src/pstatserver']
  5743. TargetAdd('p3pstatserver_composite1.obj', opts=OPTS, input='p3pstatserver_composite1.cxx')
  5744. TargetAdd('libp3pstatserver.lib', input='p3pstatserver_composite1.obj')
  5745. #
  5746. # DIRECTORY: pandatool/src/text-stats/
  5747. #
  5748. if (PkgSkip("PANDATOOL")==0):
  5749. OPTS=['DIR:pandatool/src/text-stats']
  5750. TargetAdd('text-stats_textMonitor.obj', opts=OPTS, input='textMonitor.cxx')
  5751. TargetAdd('text-stats_textStats.obj', opts=OPTS, input='textStats.cxx')
  5752. TargetAdd('text-stats.exe', input='text-stats_textMonitor.obj')
  5753. TargetAdd('text-stats.exe', input='text-stats_textStats.obj')
  5754. TargetAdd('text-stats.exe', input='libp3progbase.lib')
  5755. TargetAdd('text-stats.exe', input='libp3pstatserver.lib')
  5756. TargetAdd('text-stats.exe', input='libp3pandatoolbase.lib')
  5757. TargetAdd('text-stats.exe', input=COMMON_PANDA_LIBS)
  5758. TargetAdd('text-stats.exe', opts=['ADVAPI'])
  5759. #
  5760. # DIRECTORY: pandatool/src/vrmlprogs/
  5761. #
  5762. if not PkgSkip("PANDATOOL"):
  5763. OPTS=['DIR:pandatool/src/vrmlprogs', 'DIR:pandatool/src/vrml', 'DIR:pandatool/src/vrmlegg']
  5764. TargetAdd('vrml-trans_vrmlTrans.obj', opts=OPTS, input='vrmlTrans.cxx')
  5765. TargetAdd('vrml-trans.exe', input='vrml-trans_vrmlTrans.obj')
  5766. TargetAdd('vrml-trans.exe', input='libp3vrml.lib')
  5767. TargetAdd('vrml-trans.exe', input='libp3progbase.lib')
  5768. TargetAdd('vrml-trans.exe', input='libp3pandatoolbase.lib')
  5769. TargetAdd('vrml-trans.exe', input=COMMON_PANDA_LIBS)
  5770. TargetAdd('vrml-trans.exe', opts=['ADVAPI'])
  5771. if not PkgSkip("EGG"):
  5772. TargetAdd('vrml2egg_vrmlToEgg.obj', opts=OPTS, input='vrmlToEgg.cxx')
  5773. TargetAdd('vrml2egg.exe', input='vrml2egg_vrmlToEgg.obj')
  5774. TargetAdd('vrml2egg.exe', input='libp3vrmlegg.lib')
  5775. TargetAdd('vrml2egg.exe', input='libp3vrml.lib')
  5776. TargetAdd('vrml2egg.exe', input=COMMON_EGG2X_LIBS)
  5777. TargetAdd('vrml2egg.exe', opts=['ADVAPI'])
  5778. #
  5779. # DIRECTORY: pandatool/src/win-stats/
  5780. # DIRECTORY: pandatool/src/gtk-stats/
  5781. #
  5782. if (PkgSkip("PANDATOOL")==0 and (GetTarget() == 'windows' or PkgSkip("GTK2")==0)):
  5783. if GetTarget() == 'windows':
  5784. OPTS=['DIR:pandatool/src/win-stats']
  5785. TargetAdd('pstats_composite1.obj', opts=OPTS, input='winstats_composite1.cxx')
  5786. else:
  5787. OPTS=['DIR:pandatool/src/gtk-stats', 'GTK2']
  5788. TargetAdd('pstats_composite1.obj', opts=OPTS, input='gtkstats_composite1.cxx')
  5789. TargetAdd('pstats.exe', input='pstats_composite1.obj')
  5790. TargetAdd('pstats.exe', input='libp3pstatserver.lib')
  5791. TargetAdd('pstats.exe', input='libp3progbase.lib')
  5792. TargetAdd('pstats.exe', input='libp3pandatoolbase.lib')
  5793. TargetAdd('pstats.exe', input=COMMON_PANDA_LIBS)
  5794. TargetAdd('pstats.exe', opts=['SUBSYSTEM:WINDOWS', 'WINSOCK', 'WINIMM', 'WINGDI', 'WINKERNEL', 'WINOLDNAMES', 'WINUSER', 'WINMM', 'GTK2'])
  5795. #
  5796. # DIRECTORY: pandatool/src/xfileprogs/
  5797. #
  5798. if not PkgSkip("PANDATOOL"):
  5799. OPTS=['DIR:pandatool/src/xfileprogs', 'DIR:pandatool/src/xfile', 'DIR:pandatool/src/xfileegg']
  5800. TargetAdd('x-trans_xFileTrans.obj', opts=OPTS, input='xFileTrans.cxx')
  5801. TargetAdd('x-trans.exe', input='x-trans_xFileTrans.obj')
  5802. TargetAdd('x-trans.exe', input='libp3progbase.lib')
  5803. TargetAdd('x-trans.exe', input='libp3xfile.lib')
  5804. TargetAdd('x-trans.exe', input='libp3pandatoolbase.lib')
  5805. TargetAdd('x-trans.exe', input=COMMON_PANDA_LIBS)
  5806. TargetAdd('x-trans.exe', opts=['ADVAPI'])
  5807. if not PkgSkip("EGG"):
  5808. TargetAdd('egg2x_eggToX.obj', opts=OPTS, input='eggToX.cxx')
  5809. TargetAdd('egg2x.exe', input='egg2x_eggToX.obj')
  5810. TargetAdd('egg2x.exe', input='libp3xfileegg.lib')
  5811. TargetAdd('egg2x.exe', input='libp3xfile.lib')
  5812. TargetAdd('egg2x.exe', input=COMMON_EGG2X_LIBS)
  5813. TargetAdd('egg2x.exe', opts=['ADVAPI'])
  5814. TargetAdd('x2egg_xFileToEgg.obj', opts=OPTS, input='xFileToEgg.cxx')
  5815. TargetAdd('x2egg.exe', input='x2egg_xFileToEgg.obj')
  5816. TargetAdd('x2egg.exe', input='libp3xfileegg.lib')
  5817. TargetAdd('x2egg.exe', input='libp3xfile.lib')
  5818. TargetAdd('x2egg.exe', input=COMMON_EGG2X_LIBS)
  5819. TargetAdd('x2egg.exe', opts=['ADVAPI'])
  5820. #
  5821. # DIRECTORY: pandatool/src/mayaprogs/
  5822. #
  5823. for VER in MAYAVERSIONS:
  5824. VNUM = VER[4:]
  5825. if not PkgSkip(VER) and not PkgSkip("PANDATOOL") and not PkgSkip("EGG"):
  5826. if GetTarget() == 'darwin' and int(VNUM) >= 2012:
  5827. ARCH_OPTS = ['NOARCH:PPC', 'NOARCH:I386', 'NOARCH:ARM64']
  5828. if len(OSX_ARCHS) != 0 and 'x86_64' not in OSX_ARCHS:
  5829. continue
  5830. elif GetTarget() == 'darwin' and int(VNUM) >= 2009:
  5831. ARCH_OPTS = ['NOARCH:PPC', 'NOARCH:ARM64']
  5832. elif GetTarget() == 'darwin':
  5833. ARCH_OPTS = ['NOARCH:X86_64', 'NOARCH:ARM64']
  5834. else:
  5835. ARCH_OPTS = []
  5836. OPTS=['DIR:pandatool/src/mayaprogs', 'DIR:pandatool/src/maya', 'DIR:pandatool/src/mayaegg', 'DIR:pandatool/src/cvscopy', 'BUILDING:MISC', VER] + ARCH_OPTS
  5837. TargetAdd('mayaeggimport'+VNUM+'_mayaeggimport.obj', opts=OPTS, input='mayaEggImport.cxx')
  5838. TargetAdd('mayaeggimport'+VNUM+'.mll', input='mayaegg'+VNUM+'_loader.obj')
  5839. TargetAdd('mayaeggimport'+VNUM+'.mll', input='mayaeggimport'+VNUM+'_mayaeggimport.obj')
  5840. TargetAdd('mayaeggimport'+VNUM+'.mll', input='libpandaegg.dll')
  5841. TargetAdd('mayaeggimport'+VNUM+'.mll', input=COMMON_PANDA_LIBS)
  5842. #if GetTarget() == 'windows':
  5843. # TargetAdd('mayaeggimport'+VNUM+'.mll', input='libp3pystub.lib')
  5844. TargetAdd('mayaeggimport'+VNUM+'.mll', opts=['ADVAPI', VER]+ARCH_OPTS)
  5845. TargetAdd('mayaloader'+VNUM+'_config_mayaloader.obj', opts=OPTS, input='config_mayaloader.cxx')
  5846. TargetAdd('libp3mayaloader'+VNUM+'.dll', input='mayaloader'+VNUM+'_config_mayaloader.obj')
  5847. TargetAdd('libp3mayaloader'+VNUM+'.dll', input='libmayaegg'+VNUM+'.lib')
  5848. TargetAdd('libp3mayaloader'+VNUM+'.dll', input='libp3ptloader.dll')
  5849. TargetAdd('libp3mayaloader'+VNUM+'.dll', input='libmaya'+VNUM+'.lib')
  5850. TargetAdd('libp3mayaloader'+VNUM+'.dll', input='libp3fltegg.lib')
  5851. TargetAdd('libp3mayaloader'+VNUM+'.dll', input='libp3flt.lib')
  5852. TargetAdd('libp3mayaloader'+VNUM+'.dll', input='libp3lwoegg.lib')
  5853. TargetAdd('libp3mayaloader'+VNUM+'.dll', input='libp3lwo.lib')
  5854. TargetAdd('libp3mayaloader'+VNUM+'.dll', input='libp3dxfegg.lib')
  5855. TargetAdd('libp3mayaloader'+VNUM+'.dll', input='libp3dxf.lib')
  5856. TargetAdd('libp3mayaloader'+VNUM+'.dll', input='libp3objegg.lib')
  5857. TargetAdd('libp3mayaloader'+VNUM+'.dll', input='libp3vrmlegg.lib')
  5858. TargetAdd('libp3mayaloader'+VNUM+'.dll', input='libp3vrml.lib')
  5859. TargetAdd('libp3mayaloader'+VNUM+'.dll', input='libp3xfileegg.lib')
  5860. TargetAdd('libp3mayaloader'+VNUM+'.dll', input='libp3xfile.lib')
  5861. TargetAdd('libp3mayaloader'+VNUM+'.dll', input='libp3eggbase.lib')
  5862. TargetAdd('libp3mayaloader'+VNUM+'.dll', input='libp3progbase.lib')
  5863. TargetAdd('libp3mayaloader'+VNUM+'.dll', input='libp3converter.lib')
  5864. TargetAdd('libp3mayaloader'+VNUM+'.dll', input='libp3pandatoolbase.lib')
  5865. TargetAdd('libp3mayaloader'+VNUM+'.dll', input='libpandaegg.dll')
  5866. TargetAdd('libp3mayaloader'+VNUM+'.dll', input=COMMON_PANDA_LIBS)
  5867. TargetAdd('libp3mayaloader'+VNUM+'.dll', opts=['ADVAPI', VER]+ARCH_OPTS)
  5868. TargetAdd('mayapview'+VNUM+'_mayaPview.obj', opts=OPTS, input='mayaPview.cxx')
  5869. TargetAdd('libmayapview'+VNUM+'.mll', input='mayapview'+VNUM+'_mayaPview.obj')
  5870. TargetAdd('libmayapview'+VNUM+'.mll', input='libmayaegg'+VNUM+'.lib')
  5871. TargetAdd('libmayapview'+VNUM+'.mll', input='libmaya'+VNUM+'.lib')
  5872. TargetAdd('libmayapview'+VNUM+'.mll', input='libp3framework.dll')
  5873. if GetTarget() == 'windows':
  5874. TargetAdd('libmayapview'+VNUM+'.mll', input=COMMON_EGG2X_LIBS)
  5875. else:
  5876. TargetAdd('libmayapview'+VNUM+'.mll', input=COMMON_EGG2X_LIBS)
  5877. TargetAdd('libmayapview'+VNUM+'.mll', opts=['ADVAPI', VER]+ARCH_OPTS)
  5878. TargetAdd('maya2egg'+VNUM+'_mayaToEgg.obj', opts=OPTS, input='mayaToEgg.cxx')
  5879. TargetAdd('maya2egg'+VNUM+'_bin.exe', input='maya2egg'+VNUM+'_mayaToEgg.obj')
  5880. TargetAdd('maya2egg'+VNUM+'_bin.exe', input='libmayaegg'+VNUM+'.lib')
  5881. TargetAdd('maya2egg'+VNUM+'_bin.exe', input='libmaya'+VNUM+'.lib')
  5882. if GetTarget() == 'windows':
  5883. TargetAdd('maya2egg'+VNUM+'_bin.exe', input=COMMON_EGG2X_LIBS)
  5884. else:
  5885. TargetAdd('maya2egg'+VNUM+'_bin.exe', input=COMMON_EGG2X_LIBS)
  5886. TargetAdd('maya2egg'+VNUM+'_bin.exe', opts=['ADVAPI', VER]+ARCH_OPTS)
  5887. TargetAdd('egg2maya'+VNUM+'_eggToMaya.obj', opts=OPTS, input='eggToMaya.cxx')
  5888. TargetAdd('egg2maya'+VNUM+'_bin.exe', input='egg2maya'+VNUM+'_eggToMaya.obj')
  5889. TargetAdd('egg2maya'+VNUM+'_bin.exe', input='libmayaegg'+VNUM+'.lib')
  5890. TargetAdd('egg2maya'+VNUM+'_bin.exe', input='libmaya'+VNUM+'.lib')
  5891. if GetTarget() == 'windows':
  5892. TargetAdd('egg2maya'+VNUM+'_bin.exe', input=COMMON_EGG2X_LIBS)
  5893. else:
  5894. TargetAdd('egg2maya'+VNUM+'_bin.exe', input=COMMON_EGG2X_LIBS)
  5895. TargetAdd('egg2maya'+VNUM+'_bin.exe', opts=['ADVAPI', VER]+ARCH_OPTS)
  5896. TargetAdd('mayacopy'+VNUM+'_mayaCopy.obj', opts=OPTS, input='mayaCopy.cxx')
  5897. TargetAdd('mayacopy'+VNUM+'_bin.exe', input='mayacopy'+VNUM+'_mayaCopy.obj')
  5898. TargetAdd('mayacopy'+VNUM+'_bin.exe', input='libp3cvscopy.lib')
  5899. TargetAdd('mayacopy'+VNUM+'_bin.exe', input='libmaya'+VNUM+'.lib')
  5900. if GetTarget() == 'windows':
  5901. TargetAdd('mayacopy'+VNUM+'_bin.exe', input=COMMON_EGG2X_LIBS)
  5902. else:
  5903. TargetAdd('mayacopy'+VNUM+'_bin.exe', input=COMMON_EGG2X_LIBS)
  5904. TargetAdd('mayacopy'+VNUM+'_bin.exe', opts=['ADVAPI', VER]+ARCH_OPTS)
  5905. TargetAdd('mayasavepview'+VNUM+'_mayaSavePview.obj', opts=OPTS, input='mayaSavePview.cxx')
  5906. TargetAdd('libmayasavepview'+VNUM+'.mll', input='mayasavepview'+VNUM+'_mayaSavePview.obj')
  5907. TargetAdd('libmayasavepview'+VNUM+'.mll', opts=['ADVAPI', VER]+ARCH_OPTS)
  5908. TargetAdd('mayapath'+VNUM+'.obj', opts=OPTS, input='mayapath.cxx')
  5909. TargetAdd('maya2egg'+VNUM+'.exe', input='mayapath'+VNUM+'.obj')
  5910. TargetAdd('maya2egg'+VNUM+'.exe', input='libpandaexpress.dll')
  5911. TargetAdd('maya2egg'+VNUM+'.exe', input=COMMON_DTOOL_LIBS)
  5912. TargetAdd('maya2egg'+VNUM+'.exe', opts=['ADVAPI']+ARCH_OPTS)
  5913. TargetAdd('egg2maya'+VNUM+'.exe', input='mayapath'+VNUM+'.obj')
  5914. TargetAdd('egg2maya'+VNUM+'.exe', input='libpandaexpress.dll')
  5915. TargetAdd('egg2maya'+VNUM+'.exe', input=COMMON_DTOOL_LIBS)
  5916. TargetAdd('egg2maya'+VNUM+'.exe', opts=['ADVAPI']+ARCH_OPTS)
  5917. TargetAdd('mayacopy'+VNUM+'.exe', input='mayapath'+VNUM+'.obj')
  5918. TargetAdd('mayacopy'+VNUM+'.exe', input='libpandaexpress.dll')
  5919. TargetAdd('mayacopy'+VNUM+'.exe', input=COMMON_DTOOL_LIBS)
  5920. TargetAdd('mayacopy'+VNUM+'.exe', opts=['ADVAPI']+ARCH_OPTS)
  5921. #
  5922. # DIRECTORY: contrib/src/ai/
  5923. #
  5924. if (PkgSkip("CONTRIB")==0 and not RUNTIME):
  5925. OPTS=['DIR:contrib/src/ai', 'BUILDING:PANDAAI']
  5926. TargetAdd('p3ai_composite1.obj', opts=OPTS, input='p3ai_composite1.cxx')
  5927. TargetAdd('libpandaai.dll', input='p3ai_composite1.obj')
  5928. TargetAdd('libpandaai.dll', input=COMMON_PANDA_LIBS)
  5929. OPTS=['DIR:contrib/src/ai']
  5930. IGATEFILES=GetDirectoryContents('contrib/src/ai', ["*.h", "*_composite*.cxx"])
  5931. TargetAdd('libpandaai.in', opts=OPTS, input=IGATEFILES)
  5932. TargetAdd('libpandaai.in', opts=['IMOD:panda3d.ai', 'ILIB:libpandaai', 'SRCDIR:contrib/src/ai'])
  5933. PyTargetAdd('ai_module.obj', input='libpandaai.in')
  5934. PyTargetAdd('ai_module.obj', opts=OPTS)
  5935. PyTargetAdd('ai_module.obj', opts=['IMOD:panda3d.ai', 'ILIB:ai', 'IMPORT:panda3d.core'])
  5936. PyTargetAdd('ai.pyd', input='ai_module.obj')
  5937. PyTargetAdd('ai.pyd', input='libpandaai_igate.obj')
  5938. PyTargetAdd('ai.pyd', input='libpandaai.dll')
  5939. PyTargetAdd('ai.pyd', input='libp3interrogatedb.dll')
  5940. PyTargetAdd('ai.pyd', input=COMMON_PANDA_LIBS)
  5941. #
  5942. # DIRECTORY: contrib/src/rplight/
  5943. #
  5944. if not PkgSkip("CONTRIB") and not PkgSkip("PYTHON") and not RUNTIME:
  5945. OPTS=['DIR:contrib/src/rplight', 'BUILDING:RPLIGHT']
  5946. TargetAdd('p3rplight_composite1.obj', opts=OPTS, input='p3rplight_composite1.cxx')
  5947. IGATEFILES=GetDirectoryContents('contrib/src/rplight', ["*.h", "*_composite*.cxx"])
  5948. TargetAdd('libp3rplight.in', opts=OPTS, input=IGATEFILES)
  5949. TargetAdd('libp3rplight.in', opts=['IMOD:panda3d._rplight', 'ILIB:libp3rplight', 'SRCDIR:contrib/src/rplight'])
  5950. PyTargetAdd('rplight_module.obj', input='libp3rplight.in')
  5951. PyTargetAdd('rplight_module.obj', opts=OPTS)
  5952. PyTargetAdd('rplight_module.obj', opts=['IMOD:panda3d._rplight', 'ILIB:_rplight', 'IMPORT:panda3d.core'])
  5953. PyTargetAdd('_rplight.pyd', input='rplight_module.obj')
  5954. PyTargetAdd('_rplight.pyd', input='libp3rplight_igate.obj')
  5955. PyTargetAdd('_rplight.pyd', input='p3rplight_composite1.obj')
  5956. PyTargetAdd('_rplight.pyd', input='libp3interrogatedb.dll')
  5957. PyTargetAdd('_rplight.pyd', input=COMMON_PANDA_LIBS)
  5958. #
  5959. # DIRECTORY: pandatool/src/deploy-stub
  5960. #
  5961. if PkgSkip("PYTHON") == 0:
  5962. OPTS=['DIR:pandatool/src/deploy-stub', 'BUILDING:DEPLOYSTUB']
  5963. PyTargetAdd('deploy-stub.obj', opts=OPTS, input='deploy-stub.c')
  5964. if GetTarget() == 'windows':
  5965. PyTargetAdd('frozen_dllmain.obj', opts=OPTS, input='frozen_dllmain.c')
  5966. if GetTarget() == 'linux' or GetTarget() == 'freebsd':
  5967. # Setup rpath so libs can be found in the same directory as the deployed game
  5968. LibName('DEPLOYSTUB', "-Wl,-rpath,\\$ORIGIN")
  5969. LibName('DEPLOYSTUB', "-Wl,-z,origin")
  5970. LibName('DEPLOYSTUB', "-rdynamic")
  5971. PyTargetAdd('deploy-stub.exe', input='deploy-stub.obj')
  5972. if GetTarget() == 'windows':
  5973. PyTargetAdd('deploy-stub.exe', input='frozen_dllmain.obj')
  5974. PyTargetAdd('deploy-stub.exe', opts=['WINSHELL', 'DEPLOYSTUB', 'NOICON'])
  5975. if GetTarget() == 'windows':
  5976. PyTargetAdd('deploy-stubw.exe', input='deploy-stub.obj')
  5977. PyTargetAdd('deploy-stubw.exe', input='frozen_dllmain.obj')
  5978. PyTargetAdd('deploy-stubw.exe', opts=['SUBSYSTEM:WINDOWS', 'WINSHELL', 'DEPLOYSTUB', 'NOICON'])
  5979. elif GetTarget() == 'darwin':
  5980. DefSymbol('MACOS_APP_BUNDLE', 'MACOS_APP_BUNDLE')
  5981. OPTS = OPTS + ['MACOS_APP_BUNDLE']
  5982. PyTargetAdd('deploy-stubw.obj', opts=OPTS, input='deploy-stub.c')
  5983. PyTargetAdd('deploy-stubw.exe', input='deploy-stubw.obj')
  5984. PyTargetAdd('deploy-stubw.exe', opts=['MACOS_APP_BUNDLE', 'DEPLOYSTUB', 'NOICON'])
  5985. #
  5986. # Generate the models directory and samples directory
  5987. #
  5988. if not PkgSkip("DIRECT") and not RUNTIME and not PkgSkip("EGG"):
  5989. model_extensions = ["*.egg"]
  5990. # Check if we have access to an flt2egg utility, either self-compiled or on the system.
  5991. if ((PkgSkip("PANDATOOL")==0 and GetHost()==GetTarget()) or LocateBinary('flt2egg')):
  5992. model_extensions.append("*.flt")
  5993. for model in GetDirectoryContents("dmodels/src/misc", model_extensions):
  5994. if (PkgSkip("ZLIB")==0 and PkgSkip("DEPLOYTOOLS")==0 and not RTDIST):
  5995. newname = model[:-4] + ".egg.pz"
  5996. else:
  5997. newname = model[:-4] + ".egg"
  5998. TargetAdd(GetOutputDir()+"/models/misc/"+newname, input="dmodels/src/misc/"+model)
  5999. for model in GetDirectoryContents("dmodels/src/gui", model_extensions):
  6000. if (PkgSkip("ZLIB")==0 and PkgSkip("DEPLOYTOOLS")==0 and not RTDIST):
  6001. newname = model[:-4] + ".egg.pz"
  6002. else:
  6003. newname = model[:-4] + ".egg"
  6004. TargetAdd(GetOutputDir()+"/models/gui/"+newname, input="dmodels/src/gui/"+model)
  6005. for model in GetDirectoryContents("models", model_extensions):
  6006. if (PkgSkip("ZLIB")==0 and PkgSkip("DEPLOYTOOLS")==0 and not RTDIST):
  6007. newname = model[:-4] + ".egg.pz"
  6008. else:
  6009. newname = model[:-4] + ".egg"
  6010. TargetAdd(GetOutputDir()+"/models/"+newname, input="models/"+model)
  6011. if not PkgSkip("DIRECT") and not RUNTIME:
  6012. CopyAllFiles(GetOutputDir()+"/models/audio/sfx/", "dmodels/src/audio/sfx/", ".wav")
  6013. CopyAllFiles(GetOutputDir()+"/models/icons/", "dmodels/src/icons/", ".gif")
  6014. CopyAllFiles(GetOutputDir()+"/models/maps/", "models/maps/", ".jpg")
  6015. CopyAllFiles(GetOutputDir()+"/models/maps/", "models/maps/", ".png")
  6016. CopyAllFiles(GetOutputDir()+"/models/maps/", "models/maps/", ".rgb")
  6017. CopyAllFiles(GetOutputDir()+"/models/maps/", "models/maps/", ".rgba")
  6018. CopyAllFiles(GetOutputDir()+"/models/maps/", "dmodels/src/maps/", ".jpg")
  6019. CopyAllFiles(GetOutputDir()+"/models/maps/", "dmodels/src/maps/", ".png")
  6020. CopyAllFiles(GetOutputDir()+"/models/maps/", "dmodels/src/maps/", ".rgb")
  6021. CopyAllFiles(GetOutputDir()+"/models/maps/", "dmodels/src/maps/", ".rgba")
  6022. #
  6023. # Build the rtdist.
  6024. #
  6025. if (RTDIST):
  6026. OPTS=['DIR:direct/src/p3d']
  6027. TargetAdd('_panda3d', opts=OPTS, input='panda3d.pdef')
  6028. TargetAdd('_coreapi', opts=OPTS, input='coreapi.pdef')
  6029. TargetAdd('_thirdparty', opts=OPTS, input='thirdparty.pdef')
  6030. #
  6031. # If we have a host URL and distributor, we can make .p3d deployment tools.
  6032. #
  6033. if not PkgSkip("DIRECT") and not PkgSkip("DEPLOYTOOLS") and not RUNTIME and not RTDIST and HOST_URL and DISTRIBUTOR:
  6034. OPTS=['DIR:direct/src/p3d']
  6035. TargetAdd('packp3d.p3d', opts=OPTS, input='panda3d.pdef')
  6036. TargetAdd('pdeploy.p3d', opts=OPTS, input='panda3d.pdef')
  6037. TargetAdd('pmerge.p3d', opts=OPTS, input='panda3d.pdef')
  6038. TargetAdd('ppackage.p3d', opts=OPTS, input='panda3d.pdef')
  6039. TargetAdd('ppatcher.p3d', opts=OPTS, input='panda3d.pdef')
  6040. ##########################################################################################
  6041. #
  6042. # Dependency-Based Distributed Build System.
  6043. #
  6044. ##########################################################################################
  6045. DEPENDENCYQUEUE=[]
  6046. for target in TARGET_LIST:
  6047. name = target.name
  6048. inputs = target.inputs
  6049. opts = target.opts
  6050. deps = target.deps
  6051. DEPENDENCYQUEUE.append([CompileAnything, [name, inputs, opts], [name], deps, []])
  6052. def BuildWorker(taskqueue, donequeue):
  6053. while True:
  6054. try:
  6055. task = taskqueue.get(timeout=1)
  6056. except:
  6057. ProgressOutput(None, "Waiting for tasks...")
  6058. task = taskqueue.get()
  6059. sys.stdout.flush()
  6060. if (task == 0): return
  6061. try:
  6062. task[0](*task[1])
  6063. donequeue.put(task)
  6064. except:
  6065. donequeue.put(0)
  6066. def AllSourcesReady(task, pending):
  6067. sources = task[3]
  6068. for x in sources:
  6069. if (x in pending):
  6070. return 0
  6071. sources = task[1][1]
  6072. for x in sources:
  6073. if (x in pending):
  6074. return 0
  6075. altsources = task[4]
  6076. for x in altsources:
  6077. if (x in pending):
  6078. return 0
  6079. return 1
  6080. def ParallelMake(tasklist):
  6081. # Create the communication queues.
  6082. donequeue = queue.Queue()
  6083. taskqueue = queue.Queue()
  6084. # Build up a table listing all the pending targets
  6085. #task = [CompileAnything, [name, inputs, opts], [name], deps, []]
  6086. # task[2] = [name]
  6087. # task[3] = deps
  6088. # The python tool package, in particular fltegg seems to throw parallelmake off
  6089. # A hack for now is to divide the tasklist into two parts, one to be built in parallel
  6090. # and another subpart to be built sequentially. The most time consuming part of the process
  6091. # is the c++ code generation anyways.
  6092. tasklist_seq = []
  6093. i = 0
  6094. while i < len(tasklist):
  6095. if tasklist[i][2][0].endswith('.egg') | tasklist[i][2][0].endswith('.egg.pz'):
  6096. break
  6097. i += 1
  6098. if i < len(tasklist):
  6099. tasklist_seq = tasklist[i:]
  6100. tasklist = tasklist[:i]
  6101. iNumStartingTasks = len(tasklist)
  6102. pending = {}
  6103. for task in tasklist:
  6104. for target in task[2]:
  6105. pending[target] = 1
  6106. # Create the workers
  6107. for slave in range(THREADCOUNT):
  6108. th = threading.Thread(target=BuildWorker, args=[taskqueue, donequeue])
  6109. th.setDaemon(1)
  6110. th.start()
  6111. # Feed tasks to the workers.
  6112. tasksqueued = 0
  6113. while True:
  6114. if (tasksqueued < THREADCOUNT):
  6115. extras = []
  6116. for task in tasklist:
  6117. if (tasksqueued < THREADCOUNT) and (AllSourcesReady(task, pending)):
  6118. if (NeedsBuild(task[2], task[3])):
  6119. tasksqueued += 1
  6120. taskqueue.put(task)
  6121. else:
  6122. for target in task[2]:
  6123. del pending[target]
  6124. else:
  6125. extras.append(task)
  6126. tasklist = extras
  6127. sys.stdout.flush()
  6128. if (tasksqueued == 0): break
  6129. donetask = donequeue.get()
  6130. if (donetask == 0):
  6131. exit("Build process aborting.")
  6132. sys.stdout.flush()
  6133. tasksqueued -= 1
  6134. JustBuilt(donetask[2], donetask[3])
  6135. for target in donetask[2]:
  6136. del pending[target]
  6137. # Kill the workers.
  6138. for slave in range(THREADCOUNT):
  6139. taskqueue.put(0)
  6140. # Make sure there aren't any unsatisfied tasks
  6141. if len(tasklist) > 0:
  6142. exit("Dependency problems: " + str(len(tasklist)) + " tasks not finished. First task unsatisfied: "+str(tasklist[0][2]))
  6143. SequentialMake(tasklist_seq)
  6144. def SequentialMake(tasklist):
  6145. i = 0
  6146. for task in tasklist:
  6147. if (NeedsBuild(task[2], task[3])):
  6148. task[0](*task[1] + [(i * 100.0) / len(tasklist)])
  6149. JustBuilt(task[2], task[3])
  6150. i += 1
  6151. def RunDependencyQueue(tasklist):
  6152. if (THREADCOUNT!=0):
  6153. ParallelMake(tasklist)
  6154. else:
  6155. SequentialMake(tasklist)
  6156. try:
  6157. RunDependencyQueue(DEPENDENCYQUEUE)
  6158. finally:
  6159. SaveDependencyCache()
  6160. # Run the test suite.
  6161. if RUNTESTS:
  6162. cmdstr = BracketNameWithQuotes(SDK["PYTHONEXEC"].replace('\\', '/'))
  6163. if sys.version_info >= (2, 6):
  6164. cmdstr += " -B"
  6165. cmdstr += " -m pytest tests"
  6166. if GetVerbose():
  6167. cmdstr += " --verbose"
  6168. oscmd(cmdstr)
  6169. # Write out information about the Python versions in the built dir.
  6170. python_version_info = GetCurrentPythonVersionInfo()
  6171. UpdatePythonVersionInfoFile(python_version_info)
  6172. ##########################################################################################
  6173. #
  6174. # The Installers
  6175. #
  6176. # Under windows, we can build an 'exe' package using NSIS
  6177. # Under linux, we can build a 'deb' package or an 'rpm' package.
  6178. # Under OSX, we can make a 'dmg' package.
  6179. #
  6180. ##########################################################################################
  6181. if INSTALLER:
  6182. ProgressOutput(100.0, "Building installer")
  6183. from makepackage import MakeInstaller
  6184. # When using the --installer flag, only install for the current version.
  6185. python_versions = []
  6186. if python_version_info:
  6187. python_versions.append(python_version_info)
  6188. MakeInstaller(version=VERSION, outputdir=GetOutputDir(),
  6189. optimize=GetOptimize(), compressor=COMPRESSOR,
  6190. debversion=DEBVERSION, rpmrelease=RPMRELEASE,
  6191. runtime=RUNTIME, python_versions=python_versions)
  6192. if WHEEL:
  6193. ProgressOutput(100.0, "Building wheel")
  6194. from makewheel import makewheel
  6195. makewheel(WHLVERSION, GetOutputDir())
  6196. ##########################################################################################
  6197. #
  6198. # Print final status report.
  6199. #
  6200. ##########################################################################################
  6201. WARNINGS.append("Elapsed Time: "+PrettyTime(time.time() - STARTTIME))
  6202. printStatus("Makepanda Final Status Report", WARNINGS)
  6203. print(GetColor("green") + "Build successfully finished, elapsed time: " + PrettyTime(time.time() - STARTTIME) + GetColor())