Skip to content

Commit

Permalink
Add support for MSVC 2017, 2019 and 2022 compilers.
Browse files Browse the repository at this point in the history
Also drop support for ia64 (Itanium). In should be possible to support ARM
and ARM64.
  • Loading branch information
donno committed Nov 29, 2022
1 parent d8a9cd6 commit 4542877
Showing 1 changed file with 22 additions and 10 deletions.
32 changes: 22 additions & 10 deletions config.cake
Original file line number Diff line number Diff line change
Expand Up @@ -105,14 +105,26 @@ if cake.system.isWindows():
createVariants(platform, hostArchitecture, compiler)
except CompilerNotFoundError:
pass

# Create MSVC Compilers.
try:
from cake.library.compilers.msvc import findMsvcCompiler
for architecture in ["x86", "amd64", "ia64"]:
compiler = findMsvcCompiler(configuration=configuration, architecture=architecture)
compiler.addDefine("WIN32")
if architecture in ["amd64", "ia64"]:
compiler.addDefine("WIN64")
createVariants(platform, architecture, compiler)
except CompilerNotFoundError:
pass
from cake.library.compilers.msvc import (findMsvcCompiler,
getVisualStudio2017Compiler)
for architecture in ["x86", "x64"]:
try:
compiler = getVisualStudio2017Compiler(configuration=configuration,
targetArchitecture=architecture)
except CompilerNotFoundError:
try:
compiler = findMsvcCompiler(configuration=configuration,
architecture=architecture)
except CompilerNotFoundError:
pass

compiler.addDefine("WIN32")
if architecture in ["x64"]:
compiler.addDefine("WIN64")
createVariants(platform, architecture, compiler)

if sum(1 for _ in configuration.findAllVariants()) == 0:
engine.raiseError(
"Error: No variants were registered - no suitable compilers found.\n")

0 comments on commit 4542877

Please sign in to comment.