makepanda.py 262 KB

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