Windows development on Linux (this is kind of hacky right now):
- sudo apt-get install gcc-mingw32 wine
- export CC=i586-mingw32msvc-cc CXX=i586-mingw32msvc-c++ AR=i586-mingw32msvc-ar
-- ./configure.py --platform=mingw
+- ./configure.py --platform=mingw --host=linux
- Build gtest:
- unpack it into your source dir
- ./configure
- to work around missing _TlsAlloc I had to hack the libtool script to
append -lmingw32 -lkernel32 at the *end* of the link line
-- Build ninja: /path/to/linux/ninja ninja
-- Run: ./ninja (implicitly runs through wine(!))
+- Build ninja: /path/to/linux/ninja
+- Run: ./ninja.exe (implicitly runs through wine(!))
Windows development on Windows:
- install mingw, msys, and python
parser.add_option('--platform',
help='target platform (' + '/'.join(platforms) + ')',
choices=platforms)
+parser.add_option('--host',
+ help='host platform (' + '/'.join(platforms) + ')',
+ choices=platforms)
parser.add_option('--debug', action='store_true',
help='enable debugging flags',)
parser.add_option('--profile', metavar='TYPE',
platform = 'freebsd'
elif platform.startswith('mingw') or platform.startswith('win'):
platform = 'mingw'
+host = options.host or platform
BUILD_FILENAME = 'build.ninja'
buildfile = open(BUILD_FILENAME, 'w')
cflags.remove('-fvisibility=hidden');
cflags.append('-Igtest-1.6.0/include')
ldflags.append('-Lgtest-1.6.0/lib/.libs')
- ldflags.extend(['-static'])
+ ldflags.append('-static')
else:
if options.profile == 'gmon':
cflags.append('-pg')
description='CXX $out')
n.newline()
-if platform != 'mingw':
+if host != 'mingw':
n.rule('ar',
command='rm -f $out && $ar crs $out $in',
description='AR $out')