2025-12-24 18:28:20 +08:00
|
|
|
|
import os
|
|
|
|
|
|
from building import *
|
|
|
|
|
|
|
|
|
|
|
|
cwd = GetCurrentDir()
|
|
|
|
|
|
|
|
|
|
|
|
def p(*args):
|
|
|
|
|
|
return os.path.join(cwd, *args)
|
|
|
|
|
|
|
|
|
|
|
|
src = []
|
|
|
|
|
|
|
|
|
|
|
|
# server 侧业务代码
|
|
|
|
|
|
if GetDepend(['ERPC_MODE_SERVER']):
|
|
|
|
|
|
src += Glob(p('service/src', '*.c'))
|
|
|
|
|
|
src += Glob(p('service/src', '*.cpp'))
|
|
|
|
|
|
|
|
|
|
|
|
# client 侧业务代码
|
|
|
|
|
|
if GetDepend(['ERPC_MODE_CLIENT']):
|
|
|
|
|
|
src += Glob(p('client/src', '*.c'))
|
|
|
|
|
|
src += Glob(p('client/src', '*.cpp'))
|
|
|
|
|
|
|
|
|
|
|
|
# 生成的 proto(C++版)
|
|
|
|
|
|
gen_dir = p('proto', 'generated')
|
|
|
|
|
|
|
|
|
|
|
|
# interface 建议始终编译(两端都可能需要)
|
|
|
|
|
|
src += [p('proto', 'generated', 'head_service_interface.cpp')]
|
2025-12-30 15:44:41 +08:00
|
|
|
|
src += [p('common', 'src', 'erpc_error_handler.cpp')]
|
2025-12-24 18:28:20 +08:00
|
|
|
|
if GetDepend(['ERPC_MODE_SERVER']):
|
|
|
|
|
|
src += [p('proto', 'generated', 'head_service_server.cpp')]
|
|
|
|
|
|
|
|
|
|
|
|
if GetDepend(['ERPC_MODE_CLIENT']):
|
|
|
|
|
|
src += [p('proto', 'generated', 'head_service_client.cpp')]
|
|
|
|
|
|
|
|
|
|
|
|
CPPPATH = [
|
|
|
|
|
|
cwd,
|
|
|
|
|
|
p('service'),
|
|
|
|
|
|
p('client'),
|
2025-12-30 15:44:41 +08:00
|
|
|
|
p('common'),
|
2025-12-24 18:28:20 +08:00
|
|
|
|
gen_dir,
|
|
|
|
|
|
]
|
|
|
|
|
|
|
|
|
|
|
|
# depend 用于“组依赖”,空列表即可
|
|
|
|
|
|
group = DefineGroup(
|
|
|
|
|
|
'app_erpc',
|
|
|
|
|
|
src,
|
|
|
|
|
|
depend=[],
|
|
|
|
|
|
CPPPATH=CPPPATH,
|
|
|
|
|
|
CPPDEFINES=[],
|
|
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
|
|
Return('group')
|