makepanda.py 284 KB

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