Skip to content

Commit

Permalink
Add runtime parameter and disable CC_SUPPORT_JIT (cocos#2926)
Browse files Browse the repository at this point in the history
  • Loading branch information
pandamicro authored and jareguo committed Jun 30, 2018
1 parent ecc8bb0 commit 93e115e
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
6 changes: 3 additions & 3 deletions gulp/util/utils.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@

const PLATFORM_MACROS = ['CC_EDITOR', 'CC_PREVIEW', 'CC_BUILD', 'CC_TEST'];
const FLAGS = ['jsb', 'wechatgame', 'qqplay', 'debug', 'nativeRenderer'];
const FLAGS = ['jsb', 'runtime', 'wechatgame', 'qqplay', 'debug', 'nativeRenderer'];

// generate macros for uglify's global_defs
// available platforms: 'editor' | 'preview' | 'build' | 'test'
// available keys of flags: 'jsb' | 'wechatgame' | 'debug'
// available keys of flags: 'jsb' | 'runtime' | 'wechatgame' | 'qqplay' | 'debug' | 'nativeRenderer'
exports.getMacros = function (platform, flags) {
// platform macros
var platformMacro = 'CC_' + platform.toUpperCase();
Expand Down Expand Up @@ -36,7 +36,7 @@ exports.getMacros = function (platform, flags) {
// debug macros
res['CC_DEV'] = res['CC_EDITOR'] || res['CC_PREVIEW'] || res['CC_TEST'];
res['CC_DEBUG'] = res['CC_DEBUG'] || res['CC_DEV'];
res['CC_SUPPORT_JIT'] = !(res['CC_WECHATGAME'] || res['CC_QQPLAY']);
res['CC_SUPPORT_JIT'] = !(res['CC_WECHATGAME'] || res['CC_QQPLAY'] || res['CC_RUNTIME']);
return res;
};

Expand Down
10 changes: 5 additions & 5 deletions predefine.js
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,9 @@
/**
* @property {Boolean} CC_QQPLAY - Running in the bricks.
*/
/**
* @property {Boolean} CC_RUNTIME - Running in runtime environments.
*/

// window may be undefined when first load engine from editor
var _global = typeof window === 'undefined' ? global : window;
Expand All @@ -134,11 +137,8 @@ defineMacro('CC_JSB', defined('jsb'));
defineMacro('CC_BUILD', false);
defineMacro('CC_WECHATGAME', defined('wx') && wx.getSystemInfoSync);
defineMacro('CC_QQPLAY', defined('bk'));
if (CC_JSB) {
defineMacro('CC_SUPPORT_JIT', true); //FIXME: cjh close it since safety issues.
} else {
defineMacro('CC_SUPPORT_JIT', !(CC_WECHATGAME || CC_QQPLAY));
}
defineMacro('CC_RUNTIME', false);
defineMacro('CC_SUPPORT_JIT', !(CC_WECHATGAME || CC_QQPLAY || CC_RUNTIME));

//

Expand Down

0 comments on commit 93e115e

Please sign in to comment.