Add new options and docs for pybind11_add_module

See the documentation for a description of the options.
This commit is contained in:
Dean Moldovan
2016-12-16 22:58:37 +01:00
committed by Wenzel Jakob
parent b0f3885c95
commit 0cbec5c96e
4 changed files with 144 additions and 66 deletions

View File

@@ -6,7 +6,7 @@ set(CMAKE_MODULE_PATH "")
find_package(pybind11 CONFIG REQUIRED)
message(STATUS "Found pybind11 v${pybind11_VERSION}: ${pybind11_INCLUDE_DIRS}")
pybind11_add_module(test_cmake_build SHARED ../main.cpp)
pybind11_add_module(test_cmake_build SHARED NO_EXTRAS ../main.cpp)
add_custom_target(check ${CMAKE_COMMAND} -E env PYTHONPATH=$<TARGET_FILE_DIR:test_cmake_build>
${PYTHON_EXECUTABLE} ${PROJECT_SOURCE_DIR}/../test.py ${PROJECT_NAME})

View File

@@ -2,7 +2,7 @@ cmake_minimum_required(VERSION 2.8.12)
project(test_subdirectory_module CXX)
add_subdirectory(${PYBIND11_PROJECT_DIR} pybind11)
pybind11_add_module(test_cmake_build ../main.cpp)
pybind11_add_module(test_cmake_build THIN_LTO ../main.cpp)
add_custom_target(check ${CMAKE_COMMAND} -E env PYTHONPATH=$<TARGET_FILE_DIR:test_cmake_build>
${PYTHON_EXECUTABLE} ${PROJECT_SOURCE_DIR}/../test.py ${PROJECT_NAME})