Skip to content

Commit cb9ce09

Browse files
committed
Debugging non-failure of /std:c++17
1 parent f995cfc commit cb9ce09

File tree

2 files changed

+13
-9
lines changed

2 files changed

+13
-9
lines changed

.appveyor.yml

Lines changed: 8 additions & 8 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
@@ -35,7 +35,6 @@ install:
3535
if ($env:APPVEYOR_JOB_NAME -like "*Visual Studio 2017*") {
3636
$env:CMAKE_GENERATOR = "Visual Studio 15 2017"
3737
$env:CMAKE_INCLUDE_PATH = "C:\Libraries\boost_1_64_0"
38-
$env:CXXFLAGS = "-permissive-"
3938
} else {
4039
$env:CMAKE_GENERATOR = "Visual Studio 14 2015"
4140
}
@@ -57,14 +56,15 @@ install:
5756
7z x 3.3.3.zip -y > $null
5857
$env:CMAKE_INCLUDE_PATH = "eigen-eigen-67e894c6cd8f;$env:CMAKE_INCLUDE_PATH"
5958
build_script:
59+
- set VERBOSE=1
60+
- cmake --version
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 & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ include(CMakeParseArguments)
2020

2121
# Use the language standards abstraction if CMake supports it with the current compiler
2222
if(NOT CMAKE_VERSION VERSION_LESS 3.1)
23-
if(NOT CMAKE_CXX_STANDARD)
23+
if(NOT CMAKE_CXX_STANDARD AND NOT PYBIND11_CPP_STANDARD)
2424
if(CMAKE_CXX14_STANDARD_COMPILE_OPTION)
2525
set(CMAKE_CXX_STANDARD 14)
2626
elseif(CMAKE_CXX11_STANDARD_COMPILE_OPTION)
@@ -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,
@@ -218,8 +220,10 @@ function(pybind11_add_module target_name)
218220
# Make sure C++11/14 are enabled
219221
if(PYBIND11_CPP_STANDARD)
220222
if(CMAKE_VERSION VERSION_LESS 3.3 OR CMAKE_GENERATOR MATCHES "Visual Studio")
223+
message("HERE, I hope?")
221224
target_compile_options(${target_name} PUBLIC ${PYBIND11_CPP_STANDARD})
222225
else()
226+
message("NOT HERE, I hope?")
223227
target_compile_options(${target_name} PUBLIC $<$<COMPILE_LANGUAGE:CXX>:${PYBIND11_CPP_STANDARD}>)
224228
endif()
225229
endif()

0 commit comments

Comments
 (0)