makepanda.py 269 KB

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