Skip to content

Commit b591ba8

Browse files
committed
Starting on windows
Signed-off-by: Aloys Baillet <[email protected]>
1 parent 96fa383 commit b591ba8

36 files changed

+576
-106
lines changed

.github/workflows/python.yml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,11 @@ on:
1414

1515
jobs:
1616
python:
17-
runs-on: ubuntu-latest
17+
runs-on: ${{ matrix.os }}
18+
strategy:
19+
fail-fast: false
20+
matrix:
21+
os: [ubuntu-latest, windows-latest]
1822

1923
steps:
2024
- uses: actions/checkout@v2

ci-common/Dockerfile

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

ci-common/image.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,5 +53,5 @@ docker_commands: |
5353
RUN --mount=type=cache,sharing=private,target=/tmp/downloads \
5454
/tmp/install_conan.sh
5555
56-
COPY ../packages/conan/settings /opt/conan_home/.conan
56+
COPY ../packages/conan/settings_linux /opt/conan_home/.conan
5757
ENV CONAN_USER_HOME=/opt/conan_home

packages/conan/.gitignore

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
data/
2-
settings/.conan.db
3-
settings/cacert.pem
4-
settings/artifacts.properties
2+
settings_*/.conan.db
3+
settings_*/cacert.pem
4+
settings_*/artifacts.properties
55
ccache/

packages/conan/recipes/clang/conanfile.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
from conans import ConanFile, CMake, tools
22

3-
import os.path
3+
import platform
44
import os
55

66

@@ -34,7 +34,7 @@ def _source_subfolder(self):
3434
return "source"
3535

3636
def build_requirements(self):
37-
if tools.Version(self.version) > "11":
37+
if tools.Version(self.version) > "11" and platform.system() == "Linux":
3838
self.build_requires(f"python/3.9.7@{self.user}/vfx2022")
3939

4040
def configure(self):
@@ -53,7 +53,8 @@ def configure(self):
5353

5454
def _configure_cmake(self):
5555
cmake = CMake(self)
56-
cmake.definitions["GCC_INSTALL_PREFIX"] = os.environ["GCC_INSTALL_PREFIX"]
56+
if platform.system() == "Linux":
57+
cmake.definitions["GCC_INSTALL_PREFIX"] = os.environ["GCC_INSTALL_PREFIX"]
5758
cmake.definitions["LLVM_BUILD_LLVM_DYLIB"] = True
5859
cmake.definitions["CLANG_INCLUDE_DOCS"] = False
5960
cmake.definitions["LIBCXX_INCLUDE_DOCS"] = False

packages/conan/recipes/python/conanfile.py

Lines changed: 33 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
from platform import system
12
from conans import AutoToolsBuildEnvironment, ConanFile, tools
23
from contextlib import contextmanager
34
import os
@@ -47,23 +48,23 @@ def export_sources(self):
4748
def _build_context(self):
4849
if self.settings.compiler == "Visual Studio":
4950
with tools.vcvars(self.settings):
50-
env = {
51-
"AR": "{} lib".format(
52-
tools.unix_path(self.deps_user_info["automake"].ar_lib)
53-
),
54-
"CC": "{} cl -nologo".format(
55-
tools.unix_path(self.deps_user_info["automake"].compile)
56-
),
57-
"CXX": "{} cl -nologo".format(
58-
tools.unix_path(self.deps_user_info["automake"].compile)
59-
),
60-
"NM": "dumpbin -symbols",
61-
"OBJDUMP": ":",
62-
"RANLIB": ":",
63-
"STRIP": ":",
64-
}
65-
with tools.environment_append(env):
66-
yield
51+
# env = {
52+
# "AR": "{} lib".format(
53+
# tools.unix_path(self.deps_user_info["automake"].ar_lib)
54+
# ),
55+
# "CC": "{} cl -nologo".format(
56+
# tools.unix_path(self.deps_user_info["automake"].compile)
57+
# ),
58+
# "CXX": "{} cl -nologo".format(
59+
# tools.unix_path(self.deps_user_info["automake"].compile)
60+
# ),
61+
# "NM": "dumpbin -symbols",
62+
# "OBJDUMP": ":",
63+
# "RANLIB": ":",
64+
# "STRIP": ":",
65+
# }
66+
# with tools.environment_append(env):
67+
yield
6768
else:
6869
yield
6970

@@ -92,19 +93,26 @@ def _configure_autotools(self):
9293
return self._autotools
9394

9495
def build(self):
95-
with self._build_context():
96-
autotools = self._configure_autotools()
97-
autotools.make()
96+
if system() == "Linux":
97+
with self._build_context():
98+
autotools = self._configure_autotools()
99+
autotools.make()
100+
else:
101+
self.run(
102+
os.path.join(self._source_subfolder, "PCbuild", "build.bat"),
103+
run_environment=True,
104+
)
98105

99106
def package(self):
100107
self.copy("COPYING", src=self._source_subfolder, dst="licenses")
101108

102-
self.copy("yum", dst="bin")
103-
self.copy("run-with-system-python", dst="bin")
109+
if system() == "Linux":
110+
self.copy("yum", dst="bin")
111+
self.copy("run-with-system-python", dst="bin")
104112

105-
with self._build_context():
106-
autotools = self._configure_autotools()
107-
autotools.install()
113+
with self._build_context():
114+
autotools = self._configure_autotools()
115+
autotools.install()
108116

109117
python_version = tools.Version(self.version)
110118
if python_version.major == "3":
File renamed without changes.

0 commit comments

Comments
 (0)