List:MySQL++« Previous MessageNext Message »
From:<Alex.Burton Date:January 7 2014 2:00am
Subject:RE: scons build on windows
View as plain text  
Hi Warren,
Attached is a more maintainable version which also builds the examples and tests.

From: Burton, Alex (DET, Newcastle)
Sent: Monday, January 06, 2014 5:45 PM
To: plusplus@stripped
Subject: scons build on windows


Below is a build script to build various versions of the mysqlpp dll on windows, I found
it easier to write this than get the visual studio project files to work.
I have been using mysqlpp for many years but the project files must be too old for the
current visual studio.

This build script works with SCons which i recommend. On linux I just use the distribution
version of mysqlpp so I don't have to build it but this script could be easily modified to
work on unix.

Please consider adding this script so that people can build mysqlpp easier on windows, or
update your build system to scons, or throw away in disgust if you like.

import glob
import os.path

for build in ['Debug','Release']:
    for arch in ['x86','amd64']:
        env = Environment(HOST_ARCH='x86',TARGET_ARCH=arch)
        if arch == 'x86':
                env['CPPPATH'] = ['C:/Program Files (x86)/MySQL/Connector C
                env['LIBS'] = ['C:/Program Files (x86)/MySQL/Connector C
                env['CPPPATH'] = ['C:/Program Files/MySQL/Connector C 6.0.2/include']
                env['LIBS'] = ['C:/Program Files/MySQL/Connector C

        env['LIBS'] += ['WSock32']
        if build == 'Debug':
            env['CCFLAGS'] = [
                            , '/EHsc'
                            , '/MDd'
#                            , '/Gm'
                            , '/GR'
                            , '/nologo'
                            , '/RTC1'
            #                , '/W2'

            env["CPPDEFINES"] = ['_DEBUG','MYSQLPP_MAKING_DLL','_WIN32']
            env['LINKFLAGS'] = [ '/DEBUG' , '/INCREMENTAL' ]
            env['CCFLAGS'] = [
                            , '/EHsc'
                            , '/MD'
                            , '/GL'
                            , '/GR'
                            , '/nologo'
            env["CPPDEFINES"] = ['MYSQLPP_MAKING_DLL','_WIN32']
            env['LINKFLAGS'] += ['/RELEASE' , '/LTCG' , '/INCREMENTAL:NO' , '/NOLOGO']

        buildDir = "lib/" + build + "_" + arch

        srcpaths = [buildDir + "/" + os.path.basename(x) for x in glob.glob('lib/*.cpp')]

        env.SharedLibrary(target=buildDir + "/mysqlpp",source=srcpaths)

Alex Burton
Research Engineer - Solar Thermal - Energy Technology - CSIRO
+61 2 4960 6110
+61 416 594 752

Attachment: [text/html]
Attachment: [text/html]
Attachment: [application/zip]
scons build on windowsAlex.Burton6 Jan
  • Re: scons build on windowsMickael Wolff6 Jan
    • Re: scons build on windowsWarren Young6 Jan
      • Re: scons build on windowsMickael Wolff7 Jan
        • Re: scons build on windowsWarren Young7 Jan
  • Re: scons build on windowsWarren Young6 Jan
  • RE: scons build on windowsAlex.Burton7 Jan