Skip to content

Commit 4e7518c

Browse files
committed
Debugging non-failure of /std:c++17
1 parent 9a7dfef commit 4e7518c

File tree

2 files changed

+12
-7
lines changed

2 files changed

+12
-7
lines changed

.appveyor.yml

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,10 @@ platform:
1212
environment:
1313
matrix:
1414
- PYTHON: 36
15-
CPP: 14
15+
CPP: 17
1616
CONFIG: Debug
1717
- PYTHON: 27
18-
CPP: 14
18+
CPP: 17
1919
CONFIG: Debug
2020
- CONDA: 36
2121
CPP: 17
@@ -57,14 +57,14 @@ install:
5757
7z x 3.3.3.zip -y > $null
5858
$env:CMAKE_INCLUDE_PATH = "eigen-eigen-67e894c6cd8f;$env:CMAKE_INCLUDE_PATH"
5959
build_script:
60+
- set VERBOSE=1
6061
- cmake -G "%CMAKE_GENERATOR%" -A "%CMAKE_ARCH%"
61-
-DPYBIND11_CPP_STANDARD="/std:c++%CPP%"
62+
-DPYBIND11_CPP_STANDARD="/std:c++17"
6263
-DPYBIND11_WERROR=ON
6364
-DDOWNLOAD_CATCH=ON
64-
-DCMAKE_SUPPRESS_REGENERATION=1
6565
.
6666
- set MSBuildLogger="C:\Program Files\AppVeyor\BuildAgent\Appveyor.MSBuildLogger.dll"
67-
- cmake --build . --config %CONFIG% --target pytest -- /m /v:m /logger:%MSBuildLogger%
68-
- cmake --build . --config %CONFIG% --target cpptest -- /m /v:m /logger:%MSBuildLogger%
69-
- if "%CPP%"=="17" (cmake --build . --config %CONFIG% --target test_cmake_build -- /m /v:m /logger:%MSBuildLogger%)
67+
- cmake --build . --config %CONFIG% --target pytest -- /m /logger:%MSBuildLogger%
68+
- cmake --build . --config %CONFIG% --target cpptest -- /m /logger:%MSBuildLogger%
69+
- if "%CPP%"=="17" (cmake --build . --config %CONFIG% --target test_cmake_build -- /m /logger:%MSBuildLogger%)
7070
on_failure: if exist "tests\test_cmake_build" type tests\test_cmake_build\*.log*

tools/pybind11Tools.cmake

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,8 @@ if(NOT PYBIND11_CPP_STANDARD AND NOT CMAKE_CXX_STANDARD)
5656
"C++ standard flag, e.g. -std=c++11, -std=c++14, /std:c++14. Defaults to C++14 mode." FORCE)
5757
endif()
5858

59+
message(PYBIND11_CPP_STANDARD = ${PYBIND11_CPP_STANDARD})
60+
5961
# Checks whether the given CXX/linker flags can compile and link a cxx file. cxxflags and
6062
# linkerflags are lists of flags to use. The result variable is a unique variable name for each set
6163
# of flags: the compilation result will be cached base on the result variable. If the flags work,
@@ -217,9 +219,12 @@ function(pybind11_add_module target_name)
217219

218220
# Make sure C++11/14 are enabled
219221
if(PYBIND11_CPP_STANDARD)
222+
message("Hello")
220223
if(CMAKE_VERSION VERSION_LESS 3.3)
224+
message("Not here, I hope?")
221225
target_compile_options(${target_name} PUBLIC ${PYBIND11_CPP_STANDARD})
222226
else()
227+
message("Now here")
223228
target_compile_options(${target_name} PUBLIC $<$<COMPILE_LANGUAGE:CXX>:${PYBIND11_CPP_STANDARD}>)
224229
endif()
225230
endif()

0 commit comments

Comments
 (0)