MCPcopy Create free account
hub / github.com/Moddable-OpenSource/moddable / generateDefinitions

Method generateDefinitions

tools/mcmanifest.js:537–629  ·  view source on GitHub ↗
(tool)

Source from the content-addressed store, hash-verified

535 this.line("");
536 }
537 generateDefinitions(tool) {
538 this.line('# WARNING: This file is automatically generated. Do not edit. #');
539 if (tool.platform == "zephyr") {
540 if (tool.debug) {
541 this.line("set(DEBUG 1)");
542 this.line("list(APPEND mFLAGS \"-DmxDebug=1\")");
543 }
544 if (tool.debug || tool.instrument) {
545 this.line("set(INSTRUMENT 1)");
546 this.line("list(APPEND mFLAGS \"-DMODINSTRUMENTATION=1\")");
547 this.line("list(APPEND mFLAGS \"-DmxInstrument=1\")");
548 }
549 if (tool.verbose)
550 this.line("set(VERBOSE 1)");
551 for (var result in tool.environment)
552 this.line("set(", result, " ", tool.environment[result].replace(/ /g, "\\ "), ")");
553 this.line("");
554
555 this.line("set(BIN_DIR ", tool.binPath, ")");
556 this.line("set(BUILD_DIR ", tool.buildPath, ")");
557 this.line("set(DATA_DIR ", tool.dataPath, ")");
558 this.line("set(MAIN_DIR ", tool.mainPath, ")");
559 this.line("set(MODULES_DIR ", tool.modulesPath, ")");
560 this.line("set(RESOURCES_DIR ", tool.resourcesPath, ")");
561 this.line("set(TMP_DIR ", tool.tmpPath, ")");
562 this.line("set(LIB_DIR ", tool.libPath, ")");
563 this.line("set(XS_DIR ", tool.xsPath, ")");
564 this.line("set(XSBUG_HOST ", tool.xsbug?.host ?? "localhost", ")");
565 this.line("set(XSBUG_PORT ", tool.xsbug?.port ?? 5002, ")");
566 if (tool.debug) {
567 if ("default" === tool.xsbugLaunch) {
568 if ("vscode" === tool.getenv("TERM_PROGRAM"))
569 tool.xsbugLaunch = "none";
570 else
571 tool.xsbugLaunch = "app";
572 }
573 this.line("set(XSBUG_LAUNCH ", tool.xsbugLaunch, ")");
574 if ("log" === tool.xsbugLaunch)
575 this.line("set(XSBUG_LOG 1)");
576 }
577 }
578 else {
579 if (tool.debug)
580 this.line("DEBUG = 1");
581 if (tool.debug || tool.instrument)
582 this.line("INSTRUMENT = 1");
583 if (tool.verbose)
584 this.line("VERBOSE = 1");
585 for (var result in tool.environment) {
586 if (result == "C_FLAGS")
587 this.line(`${result} = ${tool.environment[result]}`);
588 else
589 this.line(result, " = ", tool.environment[result].replace(/ /g, "\\ "));
590 }
591 this.line("");
592
593 this.line("BIN_DIR = ", tool.binPath);
594 this.line("BUILD_DIR = ", tool.buildPath);

Callers 1

generateMethod · 0.95

Calls 9

replaceMethod · 0.80
lineMethod · 0.45

Tested by

no test coverage detected