Commits

Sylvain Rouquette committed 43bd6be

cleaned up main wscript and config.py
added precompiled libs to project

  • Participants
  • Parent commits c7519cc
  • Branches input

Comments (0)

Files changed (13)

 .target
 3ds_noe
 linux_x64
-windows_x86
+win_x64
 @echo off
-if exist .target (
-    for /f %%i in (.target) do (
-        set TARGET=%%i
-        set WAFLOCK=.lock-waf%%i
-    )
-)
+call env.bat
 python waf build %* --target=%TARGET%
 @echo off
-if exist .target (
-    for /f %%i in (.target) do (
-        set TARGET=%%i
-        set WAFLOCK=.lock-waf%%i
-    )
-)
+call env.bat
 python waf clean %* --target=%TARGET%

game/configure.bat

 @echo off
-if exist .target (
-    for /f %%i in (.target) do (
-        set TARGET=%%i
-        set WAFLOCK=.lock-waf%%i
-    )
-)
-python waf configure %* --target=%TARGET%
+call env.bat
+python waf configure %* --target=%TARGET% --includes=%INCLUDES%
+if exist .target (
+    for /f %%i in (.target) do (
+        set TARGET=%%i
+        set WAFLOCK=.lock-waf%%i
+    )
+)
+set INCLUDES=../../libs/zlib;../../libs/libconfig/lib;../../libs/xz/src/liblzma/api

game/src/main/main_win32.cpp

     //delete test;
     //delete list_test;
 
-    //game::GameLoopSample game_loop;
-    //game::GameWin32 *game;
-    //game = new game::GameWin32(&game_loop);
-    //
-    //game->run();
-    //
-    //delete game;
+    game::GameLoopSample game_loop;
+    game::GameWin32 *game;
+    game = new game::GameWin32(&game_loop);
+
+    game->run();
+
+    delete game;
 
 #if defined(DEBUG)
     common::Log::clear();

game/tools/config.py

         'big_endian': False,
         'zip_module': 'zlib',
         'zip_level': 9,
+        'lib_path': '',
         'platform': '',
     },
     'linux_x64': {
         'zip_module': 'zlib',
         'zip_level': 9,
         'platform': 'x11',
-        'libs': 'X11 Xrandr GL rt config z'.split(),
+        'lib_path': '',
+        'libs': 'X11 Xrandr GL rt'.split(),
     },
-    'windows_x86': {
+    'win_x64': {
         'languages': 'fr gb jp tw'.split(),
         'padding': 4,
-        'm64': False,
+        'm64': True,
         'big_endian': False,
         'zip_module': 'zlib',
         'zip_level': 9,
         'platform': 'win32',
-        'libs': 'user32 gdi32 opengl32 zlibstat libconfig'.split(),
+        'lib_path': '../../libs/vc2010_x64',
+        'libs': 'user32 gdi32 opengl32'.split(),
     }
 }
 
         conf.env.zip_level = conf.options.zip_level
 
     if conf.options.target in TARGETS:
+        conf.env.STLIBPATH = TARGETS[conf.options.target]['lib_path']
         conf.env.target = conf.options.target
-        Options.lockfile = '.lock-waf%s' % conf.env.target
+        Options.lockfile = '.lock-waf%s' % conf.options.target
         for key, value in TARGETS[conf.options.target].items():
             conf.env[key] = value
 
     config.options(opt)
     opt.add_option('-d', '--debug', action='store_true', default=False,
                    dest='debug', help='Debug mode.')
+    opt.add_option('-I', '--includes', type='string', default='',
+                   dest='includes', help='Specify additional include path.')
 
 
 def configure(conf):
     conf.load('compiler_cxx')
     config.configure(conf)
 
+    conf.env.INCLUDES.extend(conf.options.includes.split(';'))
+
+    msvc = conf.env.COMPILER_CXX == 'msvc'
+    win32 = Utils.unversioned_sys_platform() == 'win32'
+
     if conf.options.zip == 'zlib':
-        conf.env.INCLUDES_ZIP = '../../libs/zlib'
-        #conf.env.STLIBPATH_ZIP = '../../../libs/zlib'
-        conf.env.STLIBPATH_ZIP = '../../../libs/zlib'
+        conf.env.STLIB_ZIP = 'zlibstat' if msvc else 'z'
     elif conf.options.zip == 'lzma':
         conf.env.STLIB_ZIP = 'lzma'
-        conf.env.INCLUDES_ZIP = '../../libs/xz/src/liblzma/api'
-        conf.env.STLIBPATH_ZIP = '../../../libs/xz/src/liblzma/.libs'
-        #conf.env.INCLUDES_ZIP = '../../libs/xz/include'
-        #conf.env.STLIBPATH_ZIP = '../../../libs/xz/bin_x86-64'
     else:
         conf.fatal('compression unsupported')
     conf.define('COMPRESSION_%s' % conf.options.zip.upper(), 1)
     conf.define('COMPRESSION_LIB', conf.options.zip)
 
-    conf.env.INCLUDES_LIBCONFIG = '../../libs/libconfig/lib'
-    conf.env.STLIBPATH_LIBCONFIG = '../../../libs/libconfig/Release'
-    #conf.env.STLIBPATH_LIBCONFIG = '../../../libs/libconfig/lib/.libs'
+    conf.env.STLIB_LIBCONFIG = 'libconfig' if win32 else 'config'
+    conf.env.STLIB_YAML = 'yaml-cpp'
 
-    conf.env.STLIB_YAML = 'yaml-cpp'
-    conf.env.INCLUDES_YAML = '../../libs/yaml-cpp/include'
-    conf.env.STLIBPATH_YAML = '../../../libs/yaml-cpp/build'
-
-    if conf.env.COMPILER_CXX == 'msvc':
+    if msvc:
         conf.define('MSVC', 1)
-        conf.env.cxxflags = ['/EHsc', '/DWIN32']
+        conf.env.cxxflags = ['/EHsc']
         conf.env.linkflags = ['%s.lib' % lib for lib in conf.env.libs]
         conf.env.linkflags.append('/NODEFAULTLIB:LIBCMT');
         if conf.options.debug:
             conf.env.cxxflags.extend(('/Z7', '/O2', '/DDEBUG'))
             conf.env.linkflags.append('/Debug')
     else:
-        conf.env.cxxflags = ['-mwindows', '-m64' if conf.env.m64 else '-m32']
+        conf.env.cxxflags = ['-m64' if conf.env.m64 else '-m32']
         conf.env.linkflags = conf.env.cxxflags
         if conf.options.debug:
             conf.env.cxxflags.extend(('-g', '-DDEBUG'))
     if conf.options.debug:
         conf.env.cxxflags.append('-DDEBUG')
 
-    if Utils.unversioned_sys_platform() == 'win32':
-        conf.env.cxxflags.extend(('-DWINVER=0x0601',
+    if win32:
+        conf.env.cxxflags.extend(('-mwindows' if not msvc else '',
+                                  '/DWIN32',
+                                  '-DWINVER=0x0601',
                                   '-D_WIN32_WINNT=0x0601'))
 
     if conf.options.warning:

libs/vc2010_x64/libconfig.dll

Binary file added.

libs/vc2010_x64/libconfig.lib

Binary file added.

libs/vc2010_x64/zlibstat.lib

Binary file added.

libs/vc2010_x64/zlibwapi.dll

Binary file added.

libs/vc2010_x64/zlibwapi.lib

Binary file added.