1 /*
2  * Copyright (c) 2020-2021 Huawei Device Co., Ltd.
3  * Licensed under the Apache License, Version 2.0 (the "License");
4  * you may not use this file except in compliance with the License.
5  * You may obtain a copy of the License at
6  *
7  *     http://www.apache.org/licenses/LICENSE-2.0
8  *
9  * Unless required by applicable law or agreed to in writing, software
10  * distributed under the License is distributed on an "AS IS" BASIS,
11  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12  * See the License for the specific language governing permissions and
13  * limitations under the License.
14  */
15 
16 #ifndef OHOS_ACELITE_JS_CONFIG_H
17 #define OHOS_ACELITE_JS_CONFIG_H
18 
19 #include "acelite_config.h"
20 
21 /*
22  * Usage:
23  *     #if DISABLED(LOG_OUTPUT)
24  *     #if ENABLED(LOG_OUTPUT)
25  */
26 #define IS_ENABLED(CONFIGURATION) ((CONFIGURATION) == 1)
27 #define IS_DISABLED(CONFIGURATION) ((CONFIGURATION) != 1)
28 
29 /**
30  * Enable/Disable JS framework runtime performance measurement.
31  *
32  * Allowed values:
33  *  0: Disable the JS framework performance measurement.
34  *  1: Enable the JS framework performance measurement.
35  *
36  * Default: 1
37  */
38 #ifndef JS_PROFILER
39 #define JS_PROFILER 0
40 #endif
41 
42 /**
43  * Enable/Disable log function, uncomment to disable.
44  *
45  * Allowed values:
46  *  0: Disable all JS console log output.
47  *  1: Enable all JS console log output.
48  *
49  * Default: 1
50  */
51 #define CONSOLE_LOG_OUTPUT 1 // this controls console log out
52 
53 /**
54  * Enable/Disable engine debugger initialization
55  *
56  * Allowed values:
57  *  0: Disable engine debugger initialization.
58  *  1: Enable engine debugger initialization.
59  *
60  * Default: 0 on real device and 1 on PC simulator
61  */
62 #if (TARGET_SIMULATOR == 1)
63 #define ENGINE_DEBUGGER 1
64 #else
65 #define ENGINE_DEBUGGER 0
66 #endif
67 
68 /**
69  * Enable/Disable the JS API for obtain ACELite version.
70  *
71  * Allowed values:
72  *  0: Disable the JS API for obtain ACELite version.
73  *  1: Enable the JS API for obtain ACELite version.
74  *
75  * Default: 1
76  */
77 #ifndef ACE_LITE_VERSION_JS_API
78 #define ACE_LITE_VERSION_JS_API 0
79 #endif
80 
81 /**
82  * JS engine macro for engine adapter layer.
83  */
84 #ifndef ENABLE_JERRY
85 #define ENABLE_JERRY 1
86 #endif
87 #endif // OHOS_ACELITE_JS_CONFIG_H
88