Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
gaoqiong
pybind11
Commits
c14b1933
Unverified
Commit
c14b1933
authored
Jul 28, 2021
by
Henry Schreiner
Committed by
GitHub
Jul 28, 2021
Browse files
chore: increase CMake upper limit (#3124)
parent
b72ca7d1
Changes
10
Hide whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
23 additions
and
14 deletions
+23
-14
.github/workflows/configure.yml
.github/workflows/configure.yml
+1
-1
CMakeLists.txt
CMakeLists.txt
+3
-3
tests/CMakeLists.txt
tests/CMakeLists.txt
+2
-2
tests/test_cmake_build/installed_embed/CMakeLists.txt
tests/test_cmake_build/installed_embed/CMakeLists.txt
+4
-2
tests/test_cmake_build/installed_function/CMakeLists.txt
tests/test_cmake_build/installed_function/CMakeLists.txt
+2
-1
tests/test_cmake_build/installed_target/CMakeLists.txt
tests/test_cmake_build/installed_target/CMakeLists.txt
+2
-1
tests/test_cmake_build/subdirectory_embed/CMakeLists.txt
tests/test_cmake_build/subdirectory_embed/CMakeLists.txt
+4
-2
tests/test_cmake_build/subdirectory_function/CMakeLists.txt
tests/test_cmake_build/subdirectory_function/CMakeLists.txt
+2
-1
tests/test_cmake_build/subdirectory_target/CMakeLists.txt
tests/test_cmake_build/subdirectory_target/CMakeLists.txt
+2
-1
tests/test_embed/CMakeLists.txt
tests/test_embed/CMakeLists.txt
+1
-0
No files found.
.github/workflows/configure.yml
View file @
c14b1933
...
...
@@ -18,7 +18,7 @@ jobs:
matrix
:
runs-on
:
[
ubuntu-latest
,
macos-latest
,
windows-latest
]
arch
:
[
x64
]
cmake
:
[
3.
18
]
cmake
:
[
"
3.
21"
]
include
:
-
runs-on
:
ubuntu-latest
...
...
CMakeLists.txt
View file @
c14b1933
...
...
@@ -7,13 +7,13 @@
cmake_minimum_required
(
VERSION 3.4
)
# The `cmake_minimum_required(VERSION 3.4...3.1
8
)` syntax does not work with
# The `cmake_minimum_required(VERSION 3.4...3.
2
1)` syntax does not work with
# some versions of VS that have a patched CMake 3.11. This forces us to emulate
# the behavior using the following workaround:
if
(
${
CMAKE_VERSION
}
VERSION_LESS 3.1
8
)
if
(
${
CMAKE_VERSION
}
VERSION_LESS 3.
2
1
)
cmake_policy
(
VERSION
${
CMAKE_MAJOR_VERSION
}
.
${
CMAKE_MINOR_VERSION
}
)
else
()
cmake_policy
(
VERSION 3.1
8
)
cmake_policy
(
VERSION 3.
2
1
)
endif
()
# Extract project version from source
...
...
tests/CMakeLists.txt
View file @
c14b1933
...
...
@@ -10,10 +10,10 @@ cmake_minimum_required(VERSION 3.4)
# The `cmake_minimum_required(VERSION 3.4...3.18)` syntax does not work with
# some versions of VS that have a patched CMake 3.11. This forces us to emulate
# the behavior using the following workaround:
if
(
${
CMAKE_VERSION
}
VERSION_LESS 3.1
8
)
if
(
${
CMAKE_VERSION
}
VERSION_LESS 3.
2
1
)
cmake_policy
(
VERSION
${
CMAKE_MAJOR_VERSION
}
.
${
CMAKE_MINOR_VERSION
}
)
else
()
cmake_policy
(
VERSION 3.1
8
)
cmake_policy
(
VERSION 3.
2
1
)
endif
()
# Only needed for CMake < 3.5 support
...
...
tests/test_cmake_build/installed_embed/CMakeLists.txt
View file @
c14b1933
...
...
@@ -22,5 +22,7 @@ set_target_properties(test_installed_embed PROPERTIES OUTPUT_NAME test_cmake_bui
# This may be needed to resolve header conflicts, e.g. between Python release and debug headers.
set_target_properties
(
test_installed_embed PROPERTIES NO_SYSTEM_FROM_IMPORTED ON
)
add_custom_target
(
check_installed_embed $<TARGET_FILE:test_installed_embed>
${
PROJECT_SOURCE_DIR
}
/../test.py
)
add_custom_target
(
check_installed_embed
$<TARGET_FILE:test_installed_embed>
${
PROJECT_SOURCE_DIR
}
/../test.py
DEPENDS test_installed_embed
)
tests/test_cmake_build/installed_function/CMakeLists.txt
View file @
c14b1933
...
...
@@ -35,4 +35,5 @@ add_custom_target(
PYTHONPATH=$<TARGET_FILE_DIR:test_installed_function>
${
_Python_EXECUTABLE
}
${
PROJECT_SOURCE_DIR
}
/../test.py
${
PROJECT_NAME
}
)
${
PROJECT_NAME
}
DEPENDS test_installed_function
)
tests/test_cmake_build/installed_target/CMakeLists.txt
View file @
c14b1933
...
...
@@ -42,4 +42,5 @@ add_custom_target(
PYTHONPATH=$<TARGET_FILE_DIR:test_installed_target>
${
_Python_EXECUTABLE
}
${
PROJECT_SOURCE_DIR
}
/../test.py
${
PROJECT_NAME
}
)
${
PROJECT_NAME
}
DEPENDS test_installed_target
)
tests/test_cmake_build/subdirectory_embed/CMakeLists.txt
View file @
c14b1933
...
...
@@ -23,8 +23,10 @@ add_executable(test_subdirectory_embed ../embed.cpp)
target_link_libraries
(
test_subdirectory_embed PRIVATE pybind11::embed
)
set_target_properties
(
test_subdirectory_embed PROPERTIES OUTPUT_NAME test_cmake_build
)
add_custom_target
(
check_subdirectory_embed $<TARGET_FILE:test_subdirectory_embed>
"
${
PROJECT_SOURCE_DIR
}
/../test.py"
)
add_custom_target
(
check_subdirectory_embed
$<TARGET_FILE:test_subdirectory_embed>
"
${
PROJECT_SOURCE_DIR
}
/../test.py"
DEPENDS test_subdirectory_embed
)
# Test custom export group -- PYBIND11_EXPORT_NAME
add_library
(
test_embed_lib ../embed.cpp
)
...
...
tests/test_cmake_build/subdirectory_function/CMakeLists.txt
View file @
c14b1933
...
...
@@ -31,4 +31,5 @@ add_custom_target(
PYTHONPATH=$<TARGET_FILE_DIR:test_subdirectory_function>
${
_Python_EXECUTABLE
}
${
PROJECT_SOURCE_DIR
}
/../test.py
${
PROJECT_NAME
}
)
${
PROJECT_NAME
}
DEPENDS test_subdirectory_function
)
tests/test_cmake_build/subdirectory_target/CMakeLists.txt
View file @
c14b1933
...
...
@@ -37,4 +37,5 @@ add_custom_target(
PYTHONPATH=$<TARGET_FILE_DIR:test_subdirectory_target>
${
_Python_EXECUTABLE
}
${
PROJECT_SOURCE_DIR
}
/../test.py
${
PROJECT_NAME
}
)
${
PROJECT_NAME
}
DEPENDS test_subdirectory_target
)
tests/test_embed/CMakeLists.txt
View file @
c14b1933
...
...
@@ -31,6 +31,7 @@ endif()
add_custom_target
(
cpptest
COMMAND
"$<TARGET_FILE:test_embed>"
DEPENDS test_embed
WORKING_DIRECTORY
"
${
CMAKE_CURRENT_BINARY_DIR
}
"
)
pybind11_add_module
(
external_module THIN_LTO external_module.cpp
)
...
...
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