makepanda.py 263 KB

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