-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathplatform.amd64-win.xpybuild.py
More file actions
executable file
·76 lines (62 loc) · 4.3 KB
/
Copy pathplatform.amd64-win.xpybuild.py
File metadata and controls
executable file
·76 lines (62 loc) · 4.3 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
# $Copyright(c) 2014 Progress Software Corporation (PSC). All rights reserved.$
# $Copyright (c) 2014-2017 Software AG, Darmstadt, Germany and/or Software AG USA Inc., Reston, VA, USA, and/or its subsidiaries and/or its affiliates and/or their licensors. $
# Use, reproduction, transfer, publication or disclosure is prohibited except as specifically provided for in your License Agreement with Software AG
#
# $Id: platform.amd64-win.xpybuild.py 394960 2021-09-22 12:06:08Z vrao $
#
from xpybuild.propertysupport import *
from xpybuild.buildcontext import getBuildInitializationContext
import xpybuild.targets.csharp
import os, re, logging
from xpybuild.utils.compilers import VisualStudio
from xpybuild.utils.outputhandler import ProcessOutputHandler
#from xpybuild.vstargetutils import getVisualStudioDir
#from xpybuild.compiler_vs import ApamaVisualStudio
defineStringProperty('VISUAL_STUDIO_VC_VERSION', '14.28.29910')
definePathProperty('VISUAL_STUDIO_DIR', 'c:/Program Files (x86)/Microsoft Visual Studio/2019/Professional')
definePathProperty('VISUAL_STUDIO_BIN_DIR', r'${VISUAL_STUDIO_DIR}\VC\Tools\MSVC\${VISUAL_STUDIO_VC_VERSION}\bin\Hostx64\x64')
defineStringProperty('LIB_VISUAL_STUDIO_SDK_DIR', 'C:/Program Files (x86)/Windows Kits/10')
defineStringProperty('LIB_VISUAL_STUDIO_STANDARD_LIB_DIRS[]', '${VISUAL_STUDIO_DIR}/VC/Tools/MSVC/${VISUAL_STUDIO_VC_VERSION}/ATLMFC/lib/x64, ${VISUAL_STUDIO_DIR}/VC/Tools/MSVC/${VISUAL_STUDIO_VC_VERSION}/lib/x64, ${LIB_VISUAL_STUDIO_SDK_DIR}/Lib/10.0.19041.0/um/x64, C:/Program Files (x86)/Windows Kits/10/Lib/10.0.19041.0/ucrt/x64')
defineStringProperty('LIB_VISUAL_STUDIO_STANDARD_INCLUDE_DIRS[]', '${VISUAL_STUDIO_DIR}/VC/Tools/MSVC/${VISUAL_STUDIO_VC_VERSION}/ATLMFC/include, ${VISUAL_STUDIO_DIR}/VC/Tools/MSVC/${VISUAL_STUDIO_VC_VERSION}/include, ${LIB_VISUAL_STUDIO_SDK_DIR}/Include/10.0.19041.0/ucrt, ${LIB_VISUAL_STUDIO_SDK_DIR}/include/10.0.19041.0/um, ${LIB_VISUAL_STUDIO_SDK_DIR}/Include/10.0.19041.0/shared')
setGlobalOption('native.link.flags', [
'/SUBSYSTEM:CONSOLE',
'/FORCE:MULTIPLE',
'/DEBUG', # generates pdbs for tools (nb: does not mean it's a debug build)
]) # TODO: add '/WX'
#setGlobalOption('native.cxx.libfn', NamedFunctor(lambda x:x+'.lib', 'StringFormatter<%s.lib>'))
defineStringProperty('CXX_WARNINGS_AS_ERRORS_FLAGS', '/WX')
defineStringProperty('LIB_JNI_PLATFORM', 'win32')
defineOption('native.output_dir', '${OUTPUT_DIR}')
setGlobalOption('native.compilers', VisualStudio(getProperty("VISUAL_STUDIO_BIN_DIR")))
setGlobalOption('native.include', expandListProperty('LIB_VISUAL_STUDIO_STANDARD_INCLUDE_DIRS[]'))
setGlobalOption('native.libs', ["wsock32", 'user32', 'kernel32', 'gdi32', 'user32', 'advapi32', 'shell32'])
setGlobalOption('native.libpaths', expandListProperty('LIB_VISUAL_STUDIO_STANDARD_LIB_DIRS[]'))
defineStringProperty('LIB_SUFFIX', '')
defineStringProperty('TOOLS_BUILD_MODE', '${BUILD_MODE}') # usually the same, but may be overridden differently for some cxx tests
TOOLS_BUILD_MODE = getProperty('TOOLS_BUILD_MODE')
if TOOLS_BUILD_MODE == 'release':
DEBUG_FLAGS = '-DNDEBUG /O2 /MD'.split(" ")
elif TOOLS_BUILD_MODE == 'noopt':
DEBUG_FLAGS = '-DNDEBUG /Od /MD'.split(" ")
elif TOOLS_BUILD_MODE == 'debug':
DEBUG_FLAGS = '-D_DEBUG -D_SAG_INTERNAL_UNSUPPORTED_DEBUG -UNDEBUG /Od /MDd'.split(" ")
FLAGS = ("/DBOOST_VARIANT_NO_FULL_RECURSIVE_VARIANT_SUPPORT /D_APBUILD_WIN32_ALL__ /D_CONSOLE /D_WIN64_ /DWIN64 /D_WIN64 /D_AMD64_ /D__WIN64__ /D__NT__ /D__OSVERSION__=4 /D_MBCS /DWIN32").split(' ')+[
'/GR', # calling convention __fastcall
'/EHa', # async exception handling
'/Z7', # put debug info into .obj rather than
#'/FS', # use separate process to force serialized writes to pdbs (hopefully not needed with Z7?)
'/nologo',
'/wd4005',
'/wd4273',
'/wd4503',
'/bigobj',
'/D_SCL_SECURE_NO_WARNINGS',
]
C_FLAGS = ['/DCE_TWVS2012_64', # CE_T* = SAG platform identifier.
'/DLIC_NO_VERSION_CHECK', # LIC_NO_VERSION_CHECK to disable checking which saglic version we're using
]
CPP_FLAGS = C_FLAGS+["/TP"]
DEFAULT_FLAGS = FLAGS+DEBUG_FLAGS
setGlobalOption('native.cxx.flags', DEFAULT_FLAGS+CPP_FLAGS)
setGlobalOption('native.c.flags', DEFAULT_FLAGS+C_FLAGS)
setGlobalOption('native.cxx.path', ["${VISUAL_STUDIO_BIN_DIR}\Common7\IDE",r"${VISUAL_STUDIO_BIN_DIR}\VC\BIN\amd64", "${VISUAL_STUDIO_BIN_DIR}\Common7\Tools", r"c:\Windows\Microsoft.NET\Framework\v3.5"])