Skip to content

Commit

Permalink
fix msvc
Browse files Browse the repository at this point in the history
  • Loading branch information
shun2wang committed Sep 15, 2024
1 parent e7d1bce commit 9d8e100
Showing 1 changed file with 8 additions and 9 deletions.
17 changes: 8 additions & 9 deletions recipes/readstat/all/conanfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -82,12 +82,13 @@ def _is_windows_msvc(self):
return self.info.settings.os == "Windows"

def source(self):
if platform.system() == "Windows": # 'self.settings' access in 'source()' method was forbidden
print("微软Windows")
print(self.conan_data["sources"][self.version][0])
get(self, **self.conan_data["sources"][self.version][0], strip_root=True)
else:
get(self, **self.conan_data["sources"][self.version][1], strip_root=True)
# if platform.system() == "Windows": # 'self.settings' access in 'source()' method was forbidden
# print("微软Windows")
# print(self.conan_data["sources"][self.version][0])
# get(self, **self.conan_data["sources"][self.version][0], strip_root=True)
# else:
# get(self, **self.conan_data["sources"][self.version][1], strip_root=True)
get(self, **self.conan_data["sources"][self.version][1], strip_root=True)

def _msbuild_configuration(self):
return "Debug" if self.settings.build_type == "Debug" else "Release"
Expand Down Expand Up @@ -130,9 +131,7 @@ def generate(self):
"WINDRES": "windres --target=pe-x86-64",
})
msvc_version = {"Visual Studio": "12", "msvc": "180"}
if is_msvc(self) and Version(self.settings.compiler.version) >= msvc_version[str(self.settings.compiler)]:
# https://github.com/conan-io/conan/issues/6514
tc.extra_cflags.append("-FS")

if cross_building(self) and is_msvc(self):
triplet_arch_windows = {"x86_64": "x86_64", "x86": "i686", "armv8": "aarch64"}
# ICU doesn't like GNU triplet of conan for msvc (see https://github.com/conan-io/conan/issues/12546)
Expand Down

0 comments on commit 9d8e100

Please sign in to comment.