Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
P
pybind11
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
open
pybind11
Commits
227170dc
Commit
227170dc
authored
Aug 03, 2020
by
Henry Schreiner
Committed by
Henry Schreiner
Aug 06, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix: better handling of PYBIND11_CPP_STANDARD
parent
c664d557
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
4 deletions
+13
-4
tools/pybind11Tools.cmake
+13
-4
No files found.
tools/pybind11Tools.cmake
View file @
227170dc
...
@@ -25,14 +25,23 @@ include(CheckCXXCompilerFlag)
...
@@ -25,14 +25,23 @@ include(CheckCXXCompilerFlag)
# Warn or error if old variable name used
# Warn or error if old variable name used
if
(
PYBIND11_CPP_STANDARD
)
if
(
PYBIND11_CPP_STANDARD
)
if
(
NOT CMAKE_CXX_STANDARD
)
string
(
REGEX MATCH
[[..$]]
VAL
"
${
PYBIND11_CPP_STANDARD
}
"
)
string
(
REGEX MATCH
[=[..^]=]
VAL
"
${
PYBIND11_CPP_STANDARD
}
"
)
if
(
CMAKE_CXX_STANDARD
)
if
(
NOT CMAKE_CXX_STANDARD STREQUAL VAL
)
message
(
WARNING
"CMAKE_CXX_STANDARD=
${
CMAKE_CXX_STANDARD
}
does not match "
"PYBIND11_CPP_STANDARD=
${
PYBIND11_CPP_STANDARD
}
, "
"please remove PYBIND11_CPP_STANDARD from your cache"
)
endif
()
else
()
set
(
supported_standards 11 14 17 20
)
set
(
supported_standards 11 14 17 20
)
if
(
"
${
VAL
}
"
IN_LIST supported_standards
)
if
(
"
${
VAL
}
"
IN_LIST supported_standards
)
message
(
WARNING
"USE -DCMAKE_CXX_STANDARD=
${
VAL
}
instead of PYBIND11_PYTHON_VERSION"
)
message
(
WARNING
"USE -DCMAKE_CXX_STANDARD=
${
VAL
}
instead of PYBIND11_PYTHON_VERSION"
)
set
(
CMAKE_CXX_STANDARD
${
VAL
}
)
set
(
CMAKE_CXX_STANDARD
${
VAL
}
CACHE STRING
"From PYBIND11_CPP_STANDARD"
)
else
()
else
()
message
(
FATAL_ERROR
"PYBIND11_CPP_STANDARD should be replaced with CMAKE_CXX_STANDARD"
)
message
(
FATAL_ERROR
"PYBIND11_CPP_STANDARD should be replaced with CMAKE_CXX_STANDARD "
"(last two chars:
${
VAL
}
not understood as a valid CXX std)"
)
endif
()
endif
()
endif
()
endif
()
endif
()
endif
()
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment