-
Notifications
You must be signed in to change notification settings - Fork 515
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
MSVC build environment. #2085
MSVC build environment. #2085
Changes from 15 commits
9567b29
d4041c3
16d65de
fb47e01
6151ae0
72bd325
1933e23
4fa55bb
087c2d4
cb7eb70
8c637d8
938cc84
868f158
dc6edc1
e88f175
c4c805b
519196e
ad4aa60
a61ef61
0be5301
af5ecbe
a5e4390
cfe21f9
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -478,12 +478,27 @@ def main(wxDir, args): | |
"CPPFLAGS=/I%s" % | ||
os.path.join(os.environ.get("CAIRO_ROOT", ""), 'include\\cairo')) | ||
|
||
if options.jom: | ||
nmakeCommand = 'jom.exe' | ||
|
||
if options.no_dpi_aware: | ||
args.append("USE_DPI_AWARE_MANIFEST=0") | ||
|
||
if options.jom: | ||
nmakeCommand = 'jom.exe' | ||
else: | ||
from . import msvc | ||
environment = msvc.setup_environment(minimum_c_version=14.2) | ||
|
||
if ( | ||
environment.visual_c.has_cmake and | ||
environment.visual_c.has_ninja | ||
): | ||
args.pop(0) | ||
for i, arg in enumerate(args[:]): | ||
args[i] = '-D' + arg | ||
buildDir = wxRootDir | ||
nmakeCommand = 'cmake.exe' | ||
os.environ['INCLUDE'] += ( | ||
';' + os.path.join(wxRootDir, 'include', 'msvc') | ||
) | ||
|
||
wxBuilder = builder.MSVCBuilder(commandName=nmakeCommand) | ||
|
||
|
@@ -511,10 +526,18 @@ def main(wxDir, args): | |
if options.extra_make: | ||
args.append(options.extra_make) | ||
|
||
if not sys.platform.startswith("win"): | ||
if sys.platform.startswith("win"): | ||
if nmakeCommand.startswith('cmake'): | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. can do: if sys.platform.startswith("win") and nmakeCommand.startswith('cmake'): There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. No I cannot. if sys.platform.startswith("win"):
if nmakeCommand.startswith('cmake'):
args.insert(0, '-GNinja')
else:
args.append("--jobs=" + options.jobs) because if cmake or ninja is not available then cmake.exe doesn't get set to the nmake command so if the platform is windows we do not want to ad a --jobs to the nmake.exe command bcause it doesn't support this switch. |
||
args.insert(0, '-GNinja') | ||
else: | ||
args.append("--jobs=" + options.jobs) | ||
|
||
exitIfError(wxBuilder.build(dir=buildDir, options=args), "Error building") | ||
|
||
if sys.platform.startswith("win") and nmakeCommand.startswith('cmake'): | ||
wxBuilder = builder.MSVCBuilder(commandName='ninja.exe') | ||
exitIfError(wxBuilder.build(dir=buildDir, options=['-j ' + options.jobs]), "Error building") | ||
|
||
if options.install: | ||
extra=None | ||
if installDir: | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
you say ";" is
os.pathsep
?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes it is and I should have used os.pathsep. didn't think about it tho