makepanda.py 265 KB

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