Skip to content

Commit

Permalink
start to support windows
Browse files Browse the repository at this point in the history
  • Loading branch information
mattip committed Feb 22, 2021
1 parent 2a49435 commit ba87912
Show file tree
Hide file tree
Showing 4 changed files with 34 additions and 9 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ __pycache__/

# C extensions
*.so
vc140.pdb

# Distribution / packaging
.Python
Expand Down Expand Up @@ -51,6 +52,7 @@ htmlcov/
.cache
nosetests.xml
coverage.xml
test-output.xml
*.cover
*.py,cover
.hypothesis/
Expand Down
6 changes: 6 additions & 0 deletions azure-pipelines.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,9 @@ jobs:
py38-macos:
python.version: '3.8'
imageName: 'macos-latest'
py38-win:
python.version: '3.8'
imageName: 'windows-latest'
steps:
- template: azure-templates/ccache.yml
parameters:
Expand Down Expand Up @@ -51,6 +54,9 @@ jobs:
py38-macos:
python.version: '3.8'
imageName: 'macos-latest'
py38-win:
python.version: '3.8'
imageName: 'windows-latest'
steps:
- template: azure-templates/ccache.yml
parameters:
Expand Down
30 changes: 22 additions & 8 deletions test/support.py
Original file line number Diff line number Diff line change
Expand Up @@ -182,14 +182,28 @@ def compile_module(self, ExtensionTemplate, main_src, name, extra_sources):
extra_filename = self._expand(ExtensionTemplate, 'extmod_%d' % i, src)
sources.append(extra_filename)
#
compile_args = [
'-g', '-O0',
'-Wfatal-errors', # stop after one error (unrelated to warnings)
'-Werror', # turn warnings into errors (all, for now)
]
link_args = [
'-g',
]
if sys.platform == 'win32':
# not strictly true, could be mingw
compile_args = [
'/Od',
'/WX', # turn warnings into errors (all, for now)
# '/Wall', # this is too aggresive, makes windows itself fail
'/Zi',
'-D_CRT_SECURE_NO_WARNINGS', # something about _snprintf and _snprintf_s
]
link_args = [
'/DEBUG',
'/LTCG',
]
else:
compile_args = [
'-g', '-O0',
'-Wfatal-errors', # stop after one error (unrelated to warnings)
'-Werror', # turn warnings into errors (all, for now)
]
link_args = [
'-g',
]
#
ext = Extension(
name,
Expand Down
5 changes: 4 additions & 1 deletion test/test_argparse.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,10 @@
class TestParseItem(HPyTest):
def make_parse_item(self, fmt, type, hpy_converter):
mod = self.make_module("""
__attribute__((unused)) static inline
#ifndef _MSC_VER
__attribute__((unused))
#endif
static inline
HPy char_to_hpybytes(HPyContext ctx, char a) {{
return HPyBytes_FromStringAndSize(ctx, &a, 1);
}}
Expand Down

0 comments on commit ba87912

Please sign in to comment.