Skip to content

ci: windows 2017 C++17 testing #2428

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 11 additions & 12 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,21 +29,20 @@ jobs:
python: 3.6
arch: x64
max-cxx-std: 17
args: "-DPYBIND11_FINDPYTHON=ON"
- runs-on: macos-latest
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why was this removed?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This was just to have a macOS FindPython run, but 3.9dev can also do FindPython without making another macOS run.

python: 3.7
arch: x64
max-cxx-std: 17
args: "-DPYBIND11_FINDPYTHON=ON"
args: >
-DPYBIND11_FINDPYTHON=ON
- runs-on: windows-2016
python: 3.7
arch: x86
max-cxx-std: 14
max-cxx-std: 17
args2: >
-DCMAKE_CXX_FLAGS="/permissive- /EHsc /GR"
- runs-on: windows-latest
python: 3.6
arch: x64
max-cxx-std: 17
args: "-DPYBIND11_FINDPYTHON=ON"
args: >
-DPYBIND11_FINDPYTHON=ON
- runs-on: windows-latest
python: 3.7
arch: x64
Expand All @@ -57,6 +56,8 @@ jobs:
python: 3.9-dev
arch: x64
max-cxx-std: 17
args: >
-DPYBIND11_FINDPYTHON=ON

exclude:
# Currently 32bit only, and we build 64bit
Expand Down Expand Up @@ -92,8 +93,7 @@ jobs:
python-version: ${{ matrix.python }}
architecture: ${{ matrix.arch }}

- name: Setup Boost
if: runner.os != 'macOS'
- name: Setup Boost (Windows / Linux latest)
run: echo "::set-env name=BOOST_ROOT::$BOOST_ROOT_1_72_0"

- name: Update CMake
Expand All @@ -114,7 +114,6 @@ jobs:
run: python -m pip install -r tests/requirements.txt --prefer-binary

- name: Configure C++11 ${{ matrix.args }}
shell: bash
run: >
cmake -S . -B .
-DPYBIND11_WERROR=ON
Expand All @@ -139,14 +138,14 @@ jobs:
run: git clean -fdx

- name: Configure C++${{ matrix.max-cxx-std }} ${{ matrix.args }}
shell: bash
run: >
cmake -S . -B build2
-DPYBIND11_WERROR=ON
-DDOWNLOAD_CATCH=ON
-DDOWNLOAD_EIGEN=ON
-DCMAKE_CXX_STANDARD=${{ matrix.max-cxx-std }}
${{ matrix.args }}
${{ matrix.args2 }}

- name: Build C++${{ matrix.max-cxx-std }}
run: cmake --build build2 -j 2
Expand Down
8 changes: 8 additions & 0 deletions docs/basics.rst
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,14 @@ Windows
On Windows, only **Visual Studio 2015** and newer are supported since pybind11 relies
on various C++11 language features that break older versions of Visual Studio.

.. Note::

To use the C++17 in Visual Studio 2017 (MSVC 14.1), pybind11 requires the flag
``/permissive-`` to be passed to the compiler `to enforce standard conformance`_. When
building with Visual Studio 2019, this is not strictly necessary, but still adviced.

.. _`to enforce standard conformance`: https://docs.microsoft.com/en-us/cpp/build/reference/permissive-standards-conformance?view=vs-2017

To compile and run the tests:

.. code-block:: batch
Expand Down