blob: 6f0c6b96ebbadb3b5ff79908b811ee3eabdfe79d [file] [log] [blame]
Alexander Afanasyev749f0652013-09-22 13:03:21 -07001# -*- Mode: python; py-indent-offset: 4; indent-tabs-mode: nil; coding: utf-8; -*-
2VERSION='1.0'
3APPNAME='ndnx-control-center'
4
5from waflib import Logs, Utils, Task, TaskGen
6
7def options(opt):
8 opt.load('compiler_c compiler_cxx')
9 opt.load('sparkle', tooldir='waf-tools')
10
11def configure(conf):
12 conf.load('compiler_c compiler_cxx')
13
14 if Utils.unversioned_sys_platform () != "darwin":
15 Logs.error ("Only OSX is supported so far")
16 return -1
17
18 if Utils.unversioned_sys_platform () == "darwin":
19 conf.check_cxx(framework_name='Foundation', uselib_store='OSX_FOUNDATION', compile_filename='test.mm')
20 conf.check_cxx(framework_name='AppKit', uselib_store='OSX_APPKIT', compile_filename='test.mm')
21 conf.check_cxx(framework_name='Cocoa', uselib_store='OSX_COCOA', compile_filename='test.mm')
22
23 conf.load('sparkle')
24
25def build (bld):
26 if Utils.unversioned_sys_platform () != "darwin":
27 Logs.error ("Only OSX is supported so far")
28 return -1
29
30 if Utils.unversioned_sys_platform () == "darwin":
31 bld (
32 target = "NDNx Control Center",
33 features=['cxxprogram', 'cxx'],
34 includes = "osx",
35 mac_app = "NDNx Control Center.app",
36 source = bld.path.ant_glob ('osx/**/*.mm'),
37 use = "OSX_FOUNDATION OSX_APPKIT OSX_COCOA OSX_SPARKLE",
38
39 mac_plist = bld.path.find_resource('osx/Info.plist').read (),
40 mac_resources = 'osx/ndnx-main.icns osx/ndnx-tray.icns',
41 mac_frameworks = "osx/Frameworks/Sparkle.framework",
42 )
43
44from waflib import TaskGen
45@TaskGen.extension('.mm')
46def m_hook(self, node):
47 """Alias .mm files to be compiled the same as .cc files, gcc/clang will do the right thing."""
48 return self.create_compiled_task('cxx', node)