makepanda.py 278 KB

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