Skip to content

Commit

Permalink
Don't use -A for non-VS generators Windows (#21)
Browse files Browse the repository at this point in the history
  • Loading branch information
tttapa committed Nov 4, 2023
1 parent 967c3ce commit 2fba7c5
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions src/py_build_cmake/commands/cmake.py
Original file line number Diff line number Diff line change
Expand Up @@ -190,15 +190,17 @@ def get_configure_options(self) -> list[str]:
)

def get_cmake_generator_platform(self) -> list[str]:
if self.cmake_settings.os == "windows" and not self.cross_compiling():
win = self.cmake_settings.os == "windows"
gen = self.conf_settings.generator
vs_gen = win and (not gen or gen.lower().startswith("visual studio"))
if vs_gen and not self.cross_compiling():
plat = sysconfig.get_platform()
cmake_plat = python_sysconfig_platform_to_cmake_platform_win(plat)
if cmake_plat:
return ["-A", cmake_plat]
else:
logger.warning(
"Unknown platform, CMake generator platform option (-A) will not be set"
)
msg = "Unknown platform, CMake generator platform option (-A) will not be set"
logger.warning(msg)
return []

def get_configure_command(self):
Expand Down

0 comments on commit 2fba7c5

Please sign in to comment.