Skip to content

Commit de9b708

Browse files
Only build dynamic libraries and include UWP versions
1 parent 76c144d commit de9b708

5 files changed

Lines changed: 39 additions & 49 deletions

File tree

.azure-pipelines/build_jobs.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ jobs:
9999
displayName: Download dynamic libraries
100100
- download: current
101101
patterns: "**/*.lib"
102-
displayName: Download static libraries and link import libraries
102+
displayName: Download link import libraries
103103
- download: current
104104
patterns: "**/*.h"
105105
displayName: Download headers

.azure-pipelines/generate_windows_matrix_build.py

Lines changed: 11 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -3,39 +3,31 @@
33

44
from itertools import product
55

6-
from shared import (BITS, TRUE_FALSE, VS_VERSIONS, make_win_artifact_name,
6+
from shared import (PLATFORMS, TRUE_FALSE, VS_VERSION, make_win_artifact_name,
77
output_json)
88

99
if __name__ == "__main__":
1010

1111
configs = {}
12-
for vsver, bits, debug, dynamic in product(VS_VERSIONS.keys(), BITS, (False,), TRUE_FALSE):
13-
label = [str(vsver)]
12+
for platform, debug, uwp in product(PLATFORMS, (False,), TRUE_FALSE):
13+
label = [platform]
1414
config = []
15-
generator = VS_VERSIONS[vsver]
16-
if bits == 64:
17-
config.append('-A x64')
18-
else:
19-
config.append('-A Win32')
20-
label.append(str(bits))
21-
if dynamic:
22-
label.append('dynamic')
23-
config.append('-DDYNAMIC_LOADER=ON')
24-
else:
25-
label.append('static')
26-
config.append('-DDYNAMIC_LOADER=OFF')
15+
generator = VS_VERSION
16+
config.append('-A ' + platform)
17+
config.append('-DDYNAMIC_LOADER=ON')
2718
if debug:
2819
label.append('debug')
20+
if uwp:
21+
label.append('UWP')
22+
config.append('-DCMAKE_SYSTEM_NAME=WindowsStore -DCMAKE_SYSTEM_VERSION=10.0')
2923
name = '_'.join(label)
3024
configs[name] = {
3125
'generator': generator,
3226
'buildType': 'Debug' if debug else 'RelWithDebInfo',
33-
'cmakeArgs': ' '.join(config),
34-
'dynamic': dynamic,
35-
'bits': bits
27+
'cmakeArgs': ' '.join(config)
3628
}
3729
if not debug:
3830
configs[name]['artifactName'] = make_win_artifact_name(
39-
vsver, dynamic, bits)
31+
platform, uwp)
4032

4133
output_json(configs)

.azure-pipelines/organize_windows_artifacts.py

Lines changed: 18 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
from pathlib import Path
66
import sys
77

8-
from shared import BITS, TRUE_FALSE, VS_VERSIONS, make_win_artifact_name
8+
from shared import PLATFORMS, TRUE_FALSE, VS_VERSION, make_win_artifact_name
99

1010
CWD = Path.cwd()
1111

@@ -22,22 +22,24 @@ def move(src, dest):
2222
workspace = Path(sys.argv[1])
2323
outbase = Path(sys.argv[2])
2424

25-
for vsver, dynamic in product(VS_VERSIONS.keys(), TRUE_FALSE):
26-
base = outbase / 'msvs{}_{}'.format(vsver,
27-
'dynamic' if dynamic else 'static')
25+
26+
include_copied = False
27+
28+
for platform, uwp in product(PLATFORMS, TRUE_FALSE):
29+
base = outbase / '{}{}'.format(platform,
30+
'_uwp' if uwp else '')
2831
base.mkdir(parents=True, exist_ok=True)
29-
name_64 = make_win_artifact_name(vsver, dynamic, 64)
30-
name_32 = make_win_artifact_name(vsver, dynamic, 32)
31-
artifact_64 = workspace / name_64
32-
artifact_32 = workspace / name_32
33-
# Move over one set of includes
34-
move(artifact_32 / 'include', base / 'include')
32+
name = make_win_artifact_name(platform, uwp)
33+
34+
artifact = workspace / name
35+
36+
if not include_copied:
37+
# Move over one set of includes to the base
38+
move(artifact / 'include', outbase / 'include')
39+
include_copied = True
3540

3641
# lib files
37-
move(artifact_32 / 'lib', base / 'lib32')
38-
move(artifact_64 / 'lib', base / 'lib')
42+
move(artifact / 'lib', base / 'lib')
3943

40-
if dynamic:
41-
# dll files
42-
move(artifact_32 / 'bin', base / 'bin32')
43-
move(artifact_64 / 'bin', base / 'bin')
44+
# dll files
45+
move(artifact / 'bin', base / 'bin')

.azure-pipelines/print_windows_artifact_names.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,9 @@
33

44
from itertools import product
55

6-
from shared import BITS, TRUE_FALSE, VS_VERSIONS, make_win_artifact_name
6+
from shared import PLATFORMS, TRUE_FALSE, VS_VERSION, make_win_artifact_name
77

88
if __name__ == "__main__":
99

10-
for vsver, bits, dynamic in product(VS_VERSIONS.keys(), BITS, TRUE_FALSE):
11-
print(make_win_artifact_name(vsver, dynamic, bits))
10+
for platform, uwp in product(PLATFORMS, TRUE_FALSE):
11+
print(make_win_artifact_name(platform, uwp))

.azure-pipelines/shared.py

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -3,21 +3,17 @@
33
import json
44
import sys
55

6-
VS_VERSIONS = {
7-
2019: 'Visual Studio 16 2019',
8-
# 2017: 'Visual Studio 15 2017',
9-
}
6+
VS_VERSION = 'Visual Studio 16 2019'
107

11-
BITS = (32, 64)
8+
PLATFORMS = ('Win32', 'x64', 'ARM', 'ARM64')
129

1310
TRUE_FALSE = (True, False)
1411

1512

16-
def make_win_artifact_name(vsver, dynamic, bits):
17-
return 'loader_win{}_msvs{}_{}'.format(
18-
bits,
19-
vsver,
20-
'dynamic' if dynamic else 'static'
13+
def make_win_artifact_name(platform, uwp):
14+
return 'loader_{}{}'.format(
15+
platform.lower(),
16+
'_uwp' if uwp else '',
2117
)
2218

2319

0 commit comments

Comments
 (0)