Skip to content

Commit 0a19f5d

Browse files
committed
Merge branch 'main' of https://github.com/awslabs/aws-crt-builder into xcodebuild_setup
2 parents 641be25 + aaaf246 commit 0a19f5d

File tree

6 files changed

+22
-11
lines changed

6 files changed

+22
-11
lines changed

.github/workflows/sanity-test.yml

+3-4
Original file line numberDiff line numberDiff line change
@@ -209,7 +209,7 @@ jobs:
209209
fail-fast: false
210210
matrix:
211211
compiler: [gcc-8, clang-9]
212-
std: [c++11, c++14, c++17, c++2a]
212+
cxx-std: ["11", "14", "17", "20"]
213213
steps:
214214
- uses: aws-actions/configure-aws-credentials@v4
215215
with:
@@ -224,10 +224,9 @@ jobs:
224224
name: builder
225225
path: .
226226

227-
- name: Build aws-crt-cpp with ${{ matrix.compiler }}/${{ matrix.std }}
227+
- name: Build aws-crt-cpp with ${{ matrix.compiler }}/cxx${{ matrix.cxx-std }}
228228
run: |
229-
export CXXFLAGS=-std=${{ matrix.std }}
230-
python3 builder.pyz build -p aws-crt-cpp --compiler=${{ matrix.compiler }}
229+
python3 builder.pyz build -p aws-crt-cpp --compiler=${{ matrix.compiler }} --cmake-extra=-DCMAKE_CXX_STANDARD=${{ matrix.cxx-std }}
231230
232231
release_notes:
233232
strategy:

builder/actions/cmake.py

+1
Original file line numberDiff line numberDiff line change
@@ -147,6 +147,7 @@ def _build_project(env, project, cmake_extra, build_tests=False, args_transforme
147147
"-H{}".format(project_source_dir),
148148
"-DAWS_WARNINGS_ARE_ERRORS=ON",
149149
"-DPERFORM_HEADER_CHECK=ON",
150+
"-DCMAKE_VERBOSE_MAKEFILE=ON", # shows all flags passed to compiler & linker
150151
"-DCMAKE_INSTALL_PREFIX=" + project_install_dir,
151152
"-DCMAKE_PREFIX_PATH=" + project_install_dir,
152153
"-DCMAKE_EXPORT_COMPILE_COMMANDS=ON",

builder/core/data.py

+9-3
Original file line numberDiff line numberDiff line change
@@ -215,6 +215,15 @@ class PKG_TOOLS(Enum):
215215
'python': "python3",
216216
},
217217
},
218+
'al2023': {
219+
'os': 'linux',
220+
'pkg_tool': PKG_TOOLS.DNF,
221+
'pkg_update': 'dnf update -y',
222+
'pkg_install': 'dnf install -y',
223+
'variables': {
224+
'python': "python3",
225+
},
226+
},
218227
'manylinux': {
219228
'os': 'linux',
220229
'pkg_tool': PKG_TOOLS.YUM,
@@ -321,9 +330,6 @@ class PKG_TOOLS(Enum):
321330
'armv7': {
322331
'run_tests': False
323332
},
324-
'armv8': {
325-
'run_tests': False
326-
},
327333
'mips': {
328334
'run_tests': False
329335
},

builder/core/project.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -553,7 +553,8 @@ def build_consumers(self, env):
553553
for c in consumers:
554554
build_consumers += _build_project(c, env)
555555
# build consumer tests
556-
build_consumers += to_list(c.test(env))
556+
if c.needs_tests(env):
557+
build_consumers += to_list(c.test(env))
557558
if len(build_consumers) == 0:
558559
return None
559560
return Script(build_consumers, name='build consumers of {}'.format(self.name))

builder/main.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,8 @@ def post_build(env):
7373
return env.project.post_build(env)
7474

7575
def test(env):
76-
return env.project.test(env)
76+
if env.project.needs_tests(env):
77+
return env.project.test(env)
7778

7879
def install(env):
7980
return env.project.install(env)

tests/test_project.py

+5-2
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
'name': 'test-proj',
1717
'search_dirs': [test_data_dir],
1818
'path': here,
19+
'run_tests': True,
1920
}
2021

2122

@@ -148,7 +149,8 @@ def test_downstream_tests_build_by_default(self):
148149
]
149150

150151
p = Project(**config)
151-
mock_env = mock.Mock(name='MockEnv', config=config)
152+
m_toolchain = mock.Mock(name='mock toolchain', cross_compile=False)
153+
mock_env = mock.Mock(name='MockEnv', config=config, project=p, toolchain=m_toolchain)
152154
mock_env.spec = BuildSpec()
153155
steps = p.build_consumers(mock_env)
154156
self._assert_step_contains_all(steps, ['test lib-1'])
@@ -163,7 +165,8 @@ def test_downstream_post_build_runs_before_tests(self):
163165
]
164166

165167
p = Project(**config)
166-
mock_env = mock.Mock(name='MockEnv', config=config)
168+
m_toolchain = mock.Mock(name='mock toolchain', cross_compile=False)
169+
mock_env = mock.Mock(name='MockEnv', config=config, project=p, toolchain=m_toolchain)
167170
mock_env.spec = BuildSpec()
168171
steps = p.build_consumers(mock_env)
169172
self._assert_step_contains_all(steps, ['post build lib-1', 'test lib-1'])

0 commit comments

Comments
 (0)