X-Mem/SConscript_win_x64

62 строки
2.7 KiB
Plaintext

# The MIT License (MIT)
#
# Copyright (c) 2014 Microsoft
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
# copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
#
# The above copyright notice and this permission notice shall be included in all
# copies or substantial portions of the Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
# SOFTWARE.
#
# Author: Mark Gottscho <mgottscho@ucla.edu>
import os
# Initialize build environment for Windows x86-64, using Visual Studio 2015
env = Environment(MSVC_USE_SCRIPT = 'C:\\Program Files (x86)\\Microsoft Visual Studio 14.0\\VC\\bin\\amd64\\vcvars64.bat', AS = 'ml64', MSVC_BATCH = 1)
# Initialize build environment for Windows x86-64, using Visual Studio 2013
#env = Environment(MSVC_USE_SCRIPT = 'C:\\Program Files (x86)\\Microsoft Visual Studio 12.0\\VC\\bin\\x86_amd64\\vcvarsx86_amd64.bat', AS = 'ml64', MSVC_BATCH = 1)
# Copy OS environment path to scons environment. TODO: Is this needed?
#env['ENV']['PATH'] = os.environ['PATH']
# Customize build settings
env.Append(ASFLAGS = '/c /nologo /WX /Zi /W3 /errorReport:prompt')
env.Append(CPPFLAGS = '/c /Zi /nologo /W3 /wd4101 /WX- /MP /O2 /Oi /Ot /D WIN32 /D NDEBUG /D _CONSOLE /Gm- /EHsc /GS /fp:precise /Zc:wchar_t /Zc:forScope /Gd /TP /errorReport:queue /volatile:iso ')
# Dynamic link
env.Append(CPPFLAGS = '/MD')
# Static link
#env.Append(CPPFLAGS = '/MT')
env['PDB'] = 'xmem.pdb'
env.Append(CPPPATH = ['src/include'])
env.Append(CPPPATH = ['src/include/ext/DelayInjectedLoadedLatencyBenchmark']) # Extension: Delay-injected loaded latency benchmark
env.Append(CPPPATH = ['src/include/ext/StreamBenchmark']) # Extension: Stream benchmark
# List all C++ source files
sources = [
Glob('src/*.cpp'),
Glob('src/ext/*/*.cpp'), # All extensions
Glob('src/win/*.cpp'),
]
defaultBuild = env.Program(target = 'xmem', source = sources)
# TODO: Build a MS Visual Studio project file?
# TODO: Build a MS Visual Studio solution file?
Default(defaultBuild)