Skip to content

Commit 938f107

Browse files
committed
working on macOS build
1 parent d5d2381 commit 938f107

File tree

3 files changed

+13
-35
lines changed

3 files changed

+13
-35
lines changed

builder/__init__.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@ def setup_windows_build():
4444

4545
return _windows_env
4646

47+
4748
def update_mphalport(target):
4849
if target == 'esp8266':
4950
mphalport_path = f'lib/micropython/ports/{target}/esp_mphal.h'

builder/macOS.py

Lines changed: 12 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,6 @@
2222

2323

2424
def parse_args(extra_args, lv_cflags, board):
25-
26-
print('macOS: parse_args')
2725
global heap_size
2826
unix_argParser = ArgumentParser(prefix_chars='-')
2927

@@ -51,8 +49,6 @@ def parse_args(extra_args, lv_cflags, board):
5149

5250

5351
def build_commands(_, extra_args, script_dir, lv_cflags, board):
54-
print('macOS: build_commands')
55-
5652
global variant
5753
variant = board
5854

@@ -70,9 +66,6 @@ def build_commands(_, extra_args, script_dir, lv_cflags, board):
7066
f'LV_CFLAGS="{lv_cflags}"',
7167
f'LV_PORT=unix',
7268
f'USER_C_MODULES="{script_dir}/ext_mod"',
73-
f'"CFLAGS=-Wno-missing-field-initializers -Wno-unused-function -I{script_dir}/lib/micropython -I{script_dir}/lib/micropython/ports/unix"',
74-
f'"LCD_BUS_CFLAGS=-Wno-missing-field-initializers -Wno-unused-function -I{script_dir}/lib/micropython -I{script_dir}/lib/micropython/ports/unix"',
75-
f'"CFLAGS_EXTRA=-Wno-missing-field-initializers -Wno-unused-function"'
7669
])
7770
unix_cmd.extend(extra_args)
7871

@@ -87,8 +80,6 @@ def build_commands(_, extra_args, script_dir, lv_cflags, board):
8780

8881

8982
def build_manifest(target, script_dir, lvgl_api, displays, indevs, frozen_manifest):
90-
print('macOS: build_manifest')
91-
9283
global SCRIPT_PATH
9384

9485
SCRIPT_PATH = script_dir
@@ -104,22 +95,16 @@ def build_manifest(target, script_dir, lvgl_api, displays, indevs, frozen_manife
10495

10596

10697
def clean():
107-
print('macOS: clean')
108-
10998
spawn(clean_cmd)
11099

111100

112101
def _run(c, spinner=False, cmpl=False):
113-
print('macOS - COMMAND:', c)
114-
115102
res, _ = spawn(c, spinner=spinner, cmpl=cmpl)
116103
if res != 0:
117104
sys.exit(res)
118105

119106

120107
def build_sdl():
121-
print('macOS: build_sdl')
122-
123108
global variant
124109

125110
if variant is None:
@@ -149,8 +134,6 @@ def build_sdl():
149134

150135

151136
def submodules():
152-
print('macOS: submodules')
153-
154137
if not os.path.exists('lib/SDL/include'):
155138
cmd_ = [
156139
'git',
@@ -171,8 +154,6 @@ def submodules():
171154

172155

173156
def compile(): # NOQA
174-
print('macOS: compile')
175-
176157
main_path = 'lib/micropython/ports/unix/main.c'
177158

178159
with open(main_path, 'rb') as f:
@@ -228,24 +209,21 @@ def compile(): # NOQA
228209
with open(mpconfigvariant_common_path, 'w') as f:
229210
f.write(mpconfigvariant_common)
230211

231-
for makefile_path in (
232-
'lib/micropython/ports/unix/Makefile',
233-
'lib/micropython/py/dynruntime.mk'
234-
):
235-
236-
with open(makefile_path, 'rb') as f:
237-
data = f.read().decode('utf-8')
238-
239-
data = data.replace('-Werror', '')
240-
241-
with open(makefile_path, 'wb') as f:
242-
f.write(data.encode('utf-8'))
212+
# for makefile_path in (
213+
# 'lib/micropython/ports/unix/Makefile',
214+
# 'lib/micropython/py/dynruntime.mk'
215+
# ):
216+
#
217+
# with open(makefile_path, 'rb') as f:
218+
# data = f.read().decode('utf-8')
219+
#
220+
# data = data.replace('-Werror', '')
221+
#
222+
# with open(makefile_path, 'wb') as f:
223+
# f.write(data.encode('utf-8'))
243224

244225
build_sdl()
245226

246-
print('CC:', os.environ.get('CC', ''))
247-
print('CFLAGS:', os.environ.get('CFLAGS', ''))
248-
249227
os.environ['CC'] = 'gcc'
250228
return_code, _ = spawn(compile_cmd)
251229
if return_code != 0:

ext_mod/lcd_bus/micropython.mk

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55
MOD_DIR := $(USERMOD_DIR)
66
LVGL_BINDING_DIR = $(subst /ext_mod/lcd_bus,,$(MOD_DIR))
77

8-
CFLAGS_USERMOD += $(LCD_BUS_CFLAGS)
98
CFLAGS_USERMOD += -I$(MOD_DIR)
109
CFLAGS_USERMOD += -I$(MOD_DIR)/common_include
1110
CFLAGS_USERMOD += -I$(MOD_DIR)/sdl_bus

0 commit comments

Comments
 (0)