makepanda.py 297 KB

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