Skip to content

Commit

Permalink
build: Convert winexe to use enabled= in wscript
Browse files Browse the repository at this point in the history
This also allows --without-winexe to stop building the .exe files even if
the compilers are present on the system.

BUG: https://bugzilla.samba.org/show_bug.cgi?id=15264

Signed-off-by: Andrew Bartlett <[email protected]>
Reviewed-by: Volker Lendecke <[email protected]>

Autobuild-User(master): Andrew Bartlett <[email protected]>
Autobuild-Date(master): Fri Dec 16 07:41:38 UTC 2022 on sn-devel-184
  • Loading branch information
abartlet committed Dec 16, 2022
1 parent ddbb8f1 commit 9189bd9
Showing 1 changed file with 34 additions and 26 deletions.
60 changes: 34 additions & 26 deletions examples/winexe/wscript_build
Original file line number Diff line number Diff line change
Expand Up @@ -65,36 +65,44 @@ const DATA_BLOB *%s(void)

winexesvc_binaries = ''

bld.SAMBA_GENERATOR(
'winexesvc32_exe',
source='winexesvc.c',
target='winexesvc32.exe',
rule='${WINEXE_CC_WIN32} ${SRC} -o ${TGT} ${WINEXE_LDFLAGS}',
enabled=bld.env.build_winexe and bld.env.WINEXE_CC_WIN32)

vars = {"WINEXE_FN": "winexesvc32_exe_binary"}
bld.SAMBA_GENERATOR(
'winexesvc32_exe_binary',
source='winexesvc32.exe',
target='winexesvc32_exe_binary.c',
group='build_source',
vars=vars,
rule=generate_winexesvc_c_from_exe,
enabled=bld.env.build_winexe and bld.env.WINEXE_CC_WIN32)

if bld.env.WINEXE_CC_WIN32:
bld.SAMBA_GENERATOR(
'winexesvc32_exe',
source='winexesvc.c',
target='winexesvc32.exe',
rule='${WINEXE_CC_WIN32} ${SRC} -o ${TGT} ${WINEXE_LDFLAGS}')
vars = {"WINEXE_FN": "winexesvc32_exe_binary"}
bld.SAMBA_GENERATOR(
'winexesvc32_exe_binary',
source='winexesvc32.exe',
target='winexesvc32_exe_binary.c',
group='build_source',
vars=vars,
rule=generate_winexesvc_c_from_exe)
winexesvc_binaries += ' winexesvc32_exe_binary.c'

bld.SAMBA_GENERATOR(
'winexesvc64_exe',
source='winexesvc.c',
target='winexesvc64.exe',
rule='${WINEXE_CC_WIN64} ${SRC} -o ${TGT} ${WINEXE_LDFLAGS}',
enabled=bld.env.build_winexe and bld.env.WINEXE_CC_WIN64)

vars = {"WINEXE_FN": "winexesvc64_exe_binary"}
bld.SAMBA_GENERATOR(
'winexesvc64_exe_binary',
source='winexesvc64.exe',
target='winexesvc64_exe_binary.c',
group='build_source',
vars=vars,
rule=generate_winexesvc_c_from_exe,
enabled=bld.env.build_winexe and bld.env.WINEXE_CC_WIN64)

if bld.env.WINEXE_CC_WIN64:
bld.SAMBA_GENERATOR(
'winexesvc64_exe',
source='winexesvc.c',
target='winexesvc64.exe',
rule='${WINEXE_CC_WIN64} ${SRC} -o ${TGT} ${WINEXE_LDFLAGS}')
vars = {"WINEXE_FN": "winexesvc64_exe_binary"}
bld.SAMBA_GENERATOR(
'winexesvc64_exe_binary',
source='winexesvc64.exe',
target='winexesvc64_exe_binary.c',
group='build_source',
vars=vars,
rule=generate_winexesvc_c_from_exe)
winexesvc_binaries += ' winexesvc64_exe_binary.c'

if winexesvc_binaries != '':
Expand Down

0 comments on commit 9189bd9

Please sign in to comment.