Skip to content

Commit 47a1b52

Browse files
author
zhangbin
committed
Solve the error when generating binary templates.
1 parent 74cf465 commit 47a1b52

File tree

2 files changed

+3
-15
lines changed

2 files changed

+3
-15
lines changed

plugins/plugin_generate/configs/gen_templates_config.json

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -117,19 +117,6 @@
117117
"build-cfg.json"
118118
]
119119
},
120-
{
121-
"from": "tools/simulator/frameworks/runtime-src/proj.win32",
122-
"to": "js-template-binary/frameworks/runtime-src/proj.win32/",
123-
"include": [
124-
"game.rc",
125-
"main.cpp",
126-
"main.h",
127-
"res",
128-
"resource.h",
129-
"SimulatorWin.cpp",
130-
"SimulatorWin.h"
131-
]
132-
},
133120
{
134121
"from": "cocos/platform/android/java/src",
135122
"to": "cpp-template-binary/proj.android/src"

plugins/plugin_generate/gen_templates.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,8 @@ def modify_win32_maincpp(self):
127127
cpp_files = win32_cfg['main_cpps']
128128
link_libs_cfg = win32_cfg['link_libs']
129129

130-
check_pattern = r'^int[\s]+APIENTRY[\s]+_tWinMain'
130+
check_pattern1 = r'^int[\s]+APIENTRY[\s]+_tWinMain'
131+
check_pattern2 = r'^int[\s]+WINAPI[\s]+_tWinMain'
131132
for main_cpp in cpp_files:
132133
cpp_full_path = os.path.join(self.engine_template_dir, main_cpp)
133134

@@ -145,7 +146,7 @@ def modify_win32_maincpp(self):
145146
new_lines = []
146147
for line in old_lines:
147148
strip_line = line.strip()
148-
if re.match(check_pattern, strip_line):
149+
if re.match(check_pattern1, strip_line) or re.match(check_pattern2, strip_line):
149150
new_lines.append('#if _MSC_VER > 1800\n')
150151
for lib in link_libs:
151152
new_lines.append('%s\n' % self.get_lib_str(lib, 2015))

0 commit comments

Comments
 (0)