2
0
mirror of https://github.com/boostorg/python.git synced 2026-01-21 17:12:22 +00:00

Compare commits

...

33 Commits

Author SHA1 Message Date
Stefan Seefeld
8dd1511773 Use the /python//numpy target instead of [ numpy.include ] (fixes #361) 2021-07-04 15:29:43 -04:00
Peter Dimov
909a4d1530 Merge branch 'master' into develop 2021-06-10 02:46:19 +03:00
TaWeiTu
aee2667407 Fix deprecated usage of <boost/bind.hpp>
Replace <boost/bind.hpp> with <boost/bind/bind.hpp> and use namespace
boost::placeholders when necessary.
2021-06-09 07:16:19 -04:00
Peter Dimov
209179fa09 Add CMakeLists.txt 2021-06-04 03:10:21 +03:00
Stefan Seefeld
5e77eabb63 Revert previous commit until 'Boost.Build' is ready. 2021-05-26 07:46:42 -04:00
Peter Dimov
ecda18f01e Use the /python//numpy target instead of [ numpy.include ] (fixes #361) 2021-05-24 18:54:56 -04:00
Stefan Seefeld
68fa9dccde Merge branch 'develop' 2021-03-04 11:57:23 -05:00
Stefan Seefeld
cc973263c4 Merge branch 'develop' 2020-11-02 00:58:26 -05:00
Stefan Seefeld
ec402ea0d7 Merge branch 'develop' 2020-08-14 15:59:10 -04:00
Stefan Seefeld
102acf1d34 Merge branch 'develop' 2019-03-29 09:41:46 -04:00
Stefan Seefeld
b9c0e58d57 Merge branch 'develop' 2019-03-05 21:39:52 -05:00
Stefan Seefeld
90813b1ad7 Merge branch 'develop' 2019-01-10 18:45:39 -05:00
Stefan Seefeld
6f72675bff Merge branch 'develop' 2018-07-11 19:25:10 -04:00
Stefan Seefeld
b0f512c15a Merge branch 'develop' 2018-04-17 21:32:48 -04:00
Stefan Seefeld
a383ecdd88 Fix build warning. 2018-03-19 13:58:48 -04:00
Stefan Seefeld
02e079cf4d Merge branch 'develop' 2018-03-08 07:07:42 -05:00
Stefan Seefeld
7c33ff0c59 Merge branch 'develop' 2017-11-17 10:06:54 -05:00
Stefan Seefeld
fc978f085b Merge branch 'develop' 2017-11-11 08:04:54 -05:00
Stefan Seefeld
fed4f0d0f9 Fix version number. 2017-08-19 11:57:56 -04:00
Stefan Seefeld
39edfd45cf Fix traits qualification. 2017-08-19 11:57:39 -04:00
Stefan Seefeld
8c2a808cbe Remove 'numeric' documentation. 2017-07-31 11:38:40 -04:00
Stefan Seefeld
aeedea409a Merge branch 'develop' 2017-07-20 13:04:44 -04:00
Stefan Seefeld
df6926551e Merge branch 'develop' 2017-06-25 18:27:19 -04:00
Stefan Seefeld
7d3df3d3a7 Merge branch 'develop' 2017-03-28 12:57:32 -04:00
Stefan Seefeld
ae747521b0 Merge branch 'develop' 2017-03-24 15:53:30 -04:00
Rene Rivera
5e4b44e0af Don't build numpy if there's no python version to target. 2017-03-06 10:39:01 -06:00
Rene Rivera
07b1489f3b BPL builds targets need to always be defined. 2017-03-05 15:17:26 -06:00
Rene Rivera
44ea0562b2 Fix no pynumpy target when no numpy configured. 2017-03-05 09:00:27 -06:00
Rene Rivera
60fba03e99 Fix libs from referencing BPL when there is no python configured. 2017-03-05 09:00:10 -06:00
Stefan Seefeld
e3c9dd78aa Merge branch 'develop' 2017-03-03 18:07:49 -05:00
Stefan Seefeld
aaf9022770 Merge branch 'develop' 2016-11-02 14:12:45 -04:00
Rene Rivera
88ea1f9626 Fix syntax error caused by merging. 2016-10-10 12:22:25 -05:00
Rene Rivera
731ba745ca Add, and update, documentation build targets. 2016-10-10 12:22:10 -05:00
8 changed files with 186 additions and 7 deletions

176
CMakeLists.txt Normal file
View File

@@ -0,0 +1,176 @@
# Copyright 2020, 2021 Peter Dimov
# Distributed under the Boost Software License, Version 1.0.
# https://www.boost.org/LICENSE_1_0.txt
cmake_minimum_required(VERSION 3.14...3.20)
project(boost_python VERSION "${BOOST_SUPERPROJECT_VERSION}" LANGUAGES CXX)
find_package(Python REQUIRED COMPONENTS Development OPTIONAL_COMPONENTS NumPy)
if(Python_NumPy_FOUND)
message(STATUS "Boost.Python: using Python ${Python_VERSION} with NumPy at ${Python_NumPy_INCLUDE_DIRS}")
else()
message(STATUS "Boost.Python: using Python ${Python_VERSION} without NumPy")
endif()
# boost_pythonXY
set(_pyver ${Python_VERSION_MAJOR}${Python_VERSION_MINOR})
set(_boost_python boost_python${_pyver})
add_library(${_boost_python}
src/dict.cpp
src/errors.cpp
src/exec.cpp
src/import.cpp
src/list.cpp
src/long.cpp
src/module.cpp
src/object_operators.cpp
src/object_protocol.cpp
src/slice.cpp
src/str.cpp
src/tuple.cpp
src/wrapper.cpp
src/converter/from_python.cpp
src/converter/registry.cpp
src/converter/type_id.cpp
src/converter/builtin_converters.cpp
src/converter/arg_to_python_base.cpp
src/object/enum.cpp
src/object/class.cpp
src/object/function.cpp
src/object/inheritance.cpp
src/object/life_support.cpp
src/object/pickle_support.cpp
src/object/iterator.cpp
src/object/stl_iterator.cpp
src/object_protocol.cpp
src/object_operators.cpp
src/object/function_doc_signature.cpp
)
add_library(Boost::python${_pyver} ALIAS ${_boost_python})
target_include_directories(${_boost_python} PUBLIC include)
target_link_libraries(${_boost_python}
PUBLIC
Boost::align
Boost::bind
Boost::config
Boost::conversion
Boost::core
Boost::detail
Boost::foreach
Boost::function
Boost::iterator
Boost::lexical_cast
Boost::mpl
Boost::numeric_conversion
Boost::preprocessor
Boost::smart_ptr
Boost::static_assert
Boost::tuple
Boost::type_traits
Boost::utility
Python::Module
PRIVATE
Boost::graph
Boost::integer
Boost::property_map
)
target_compile_definitions(${_boost_python}
PUBLIC BOOST_PYTHON_NO_LIB
PRIVATE BOOST_PYTHON_SOURCE
)
if(BUILD_SHARED_LIBS)
target_compile_definitions(${_boost_python} PUBLIC BOOST_PYTHON_DYN_LINK)
else()
target_compile_definitions(${_boost_python} PUBLIC BOOST_PYTHON_STATIC_LINK BOOST_PYTHON_STATIC_LIB)
endif()
# Boost::python alias
add_library(boost_python INTERFACE)
add_library(Boost::python ALIAS boost_python)
target_link_libraries(boost_python INTERFACE Boost::python${_pyver})
# Installation
if(BOOST_SUPERPROJECT_VERSION AND NOT CMAKE_VERSION VERSION_LESS 3.13)
boost_install(TARGETS ${_boost_python} boost_python VERSION ${BOOST_SUPERPROJECT_VERSION} HEADER_DIRECTORY include)
endif()
if(Python_NumPy_FOUND)
# boost_numpyXY
set(_boost_numpy boost_numpy${_pyver})
add_library(${_boost_numpy}
src/numpy/dtype.cpp
src/numpy/matrix.cpp
src/numpy/ndarray.cpp
src/numpy/numpy.cpp
src/numpy/scalars.cpp
src/numpy/ufunc.cpp
)
add_library(Boost::numpy${_pyver} ALIAS ${_boost_numpy})
target_include_directories(${_boost_numpy} PUBLIC include)
target_link_libraries(${_boost_numpy}
PUBLIC
Boost::config
Boost::core
Boost::detail
Boost::mpl
Boost::python
Boost::smart_ptr
Python::NumPy
)
target_compile_definitions(${_boost_numpy}
PUBLIC BOOST_NUMPY_NO_LIB
PRIVATE BOOST_NUMPY_SOURCE
)
if(BUILD_SHARED_LIBS)
target_compile_definitions(${_boost_numpy} PUBLIC BOOST_NUMPY_DYN_LINK)
else()
target_compile_definitions(${_boost_numpy} PUBLIC BOOST_NUMPY_STATIC_LINK BOOST_NUMPY_STATIC_LIB)
endif()
# Boost::numpy alias
add_library(boost_numpy INTERFACE)
add_library(Boost::numpy ALIAS boost_numpy)
target_link_libraries(boost_numpy INTERFACE Boost::numpy${_pyver})
# Installation
if(BOOST_SUPERPROJECT_VERSION AND NOT CMAKE_VERSION VERSION_LESS 3.13)
boost_install(TARGETS ${_boost_numpy} boost_numpy VERSION ${BOOST_SUPERPROJECT_VERSION})
endif()
endif()
unset(_pyver)
unset(_boost_python)
unset(_boost_numpy)
# Testing
if(BUILD_TESTING AND EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/test/CMakeLists.txt")
add_subdirectory(test)
endif()

View File

@@ -117,7 +117,7 @@ lib boost_numpy
<define>BOOST_NUMPY_SOURCE
[ cond [ python.numpy ] : <library>/python//python_for_extensions ]
[ unless [ python.numpy ] : <build>no ]
<include>$(numpy-include)
<library>/python//numpy
<library>boost_python
<python-debugging>on:<define>BOOST_DEBUG_PYTHON
-<tag>@$(BOOST_JAMROOT_MODULE)%$(BOOST_JAMROOT_MODULE).tag

View File

@@ -7,7 +7,7 @@
# include <boost/python/detail/prefix.hpp>
# include <boost/bind.hpp>
# include <boost/bind/bind.hpp>
# include <boost/bind/placeholders.hpp>
# include <boost/type.hpp>
# include <boost/python/detail/translate_exception.hpp>
@@ -18,6 +18,7 @@ namespace boost { namespace python {
template <class ExceptionType, class Translate>
void register_exception_translator(Translate translate, boost::type<ExceptionType>* = 0)
{
using namespace boost::placeholders;
detail::register_exception_handler(
boost::bind<bool>(detail::translate_exception<ExceptionType,Translate>(), _1, _2, translate)
);

View File

@@ -22,7 +22,7 @@ works correctly. */
# pragma warning(disable: 4180)
# endif
# include <boost/bind.hpp>
# include <boost/bind/bind.hpp>
# include <boost/bind/protect.hpp>
namespace boost { namespace python {
@@ -40,6 +40,7 @@ namespace detail
, Target&(*)()
)
{
using namespace boost::placeholders;
return objects::make_iterator_function<Target>(
boost::protect(boost::bind(get_start, _1))
, boost::protect(boost::bind(get_finish, _1))

View File

@@ -21,7 +21,7 @@
#include <boost/python/detail/none.hpp>
#include <boost/mpl/vector/vector10.hpp>
#include <boost/bind.hpp>
#include <boost/bind/bind.hpp>
#include <algorithm>
#include <cstring>

View File

@@ -11,7 +11,7 @@
#include <boost/graph/adjacency_list.hpp>
#include <boost/graph/reverse_graph.hpp>
#include <boost/property_map/property_map.hpp>
#include <boost/bind.hpp>
#include <boost/bind/bind.hpp>
#include <boost/integer_traits.hpp>
#include <boost/tuple/tuple.hpp>
#include <boost/tuple/tuple_comparison.hpp>
@@ -184,6 +184,7 @@ namespace
// map a type to a position in the index
inline type_index_t::iterator type_position(class_id type)
{
using namespace boost::placeholders;
typedef index_entry entry;
return std::lower_bound(

View File

@@ -5,7 +5,7 @@
#include <boost/python/object/iterator_core.hpp>
#include <boost/python/object/function_object.hpp>
#include <boost/bind.hpp>
#include <boost/bind/bind.hpp>
#include <boost/mpl/vector/vector10.hpp>
namespace boost { namespace python { namespace objects {

View File

@@ -6,7 +6,7 @@
#include <boost/python.hpp>
#include <boost/detail/lightweight_test.hpp>
#include <boost/bind.hpp>
#include <boost/bind/bind.hpp>
#include <iostream>
#include <sstream>