forked from smooth80/defold
-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathwscript
47 lines (38 loc) · 1.66 KB
/
wscript
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
#! /usr/bin/env python
import os
import waf_dynamo
from BuildUtility import create_build_utility
def configure(conf):
build_util = create_build_utility(conf.env)
target = build_util.get_target_os()
if not target in ('win32', 'osx', 'linux'):
return
if 'osx' == target:
conf.env.append_value('LINKFLAGS', ['-framework', 'Cocoa'])
if 'win32' in target:
conf.find_program('signtool', var='SIGNTOOL', mandatory = True, path_list = search_path)
def build(bld):
# if not desktop
if not bld.env.PLATFORM in ('x86_64-win32', 'x86_64-darwin', 'x86_64-linux'):
return
build_util = create_build_utility(bld.env)
target = build_util.get_target_os()
exe = bld.new_task_gen(features = ['cc', 'cxx', 'cprogram'],
includes = ['.'],
uselib = 'DLIB CARES',
source = ['launcher.cpp', 'launcher_util.cpp'],
target = 'launcher')
if 'osx' == target:
exe.source.append('macos_events.mm')
lib = bld.new_task_gen(features = 'cxx cstaticlib',
includes = ['.'],
target = 'launcherutil',
source = ['launcher_util.cpp'])
if 'win32' in bld.env.BUILD_PLATFORM:
exe.linkflags = ['/subsystem:windows', '/entry:mainCRTStartup']
exe.source.append('launcher.rc')
if waf_dynamo.authenticode_certificate_installed(bld):
exe.features.append('authenticode')
exe.install_path = None
bld.install_as("${PREFIX}/bin/${PLATFORM}/launcher.exe", "launcher_signed.exe")
bld.add_subdirs('test')