Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Test merge 2 #5758

Merged
merged 7 commits into from
Dec 21, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion .github/workflows/docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,13 @@ jobs:
- name: checkout
uses: actions/[email protected]

- name: update package lists
continue-on-error: true
run: |
sudo apt update

- name: install dependencies
run: |
sudo apt-get update
sudo apt install python-docutils python-pygments python-pil gsfonts inkscape icoutils graphviz hunspell imagemagick
python -m pip install aafigure
~/.local/bin/aafigure --version
Expand Down
41 changes: 40 additions & 1 deletion .github/workflows/linux.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,11 @@ jobs:
with:
submodules: recursive

- name: update package lists
continue-on-error: true
run: |
sudo apt update

- name: install boost
run: |
sudo apt install libboost-tools-dev libboost-dev libboost-system-dev
Expand Down Expand Up @@ -57,6 +62,11 @@ jobs:
with:
submodules: recursive

- name: update package lists
continue-on-error: true
run: |
sudo apt update

- name: install boost
run: |
sudo apt install libboost-tools-dev libboost-dev libboost-system-dev
Expand All @@ -79,6 +89,11 @@ jobs:
with:
submodules: recursive

- name: update package lists
continue-on-error: true
run: |
sudo apt update

- name: install boost
run: |
sudo apt install libboost-tools-dev libboost-dev libboost-system-dev
Expand All @@ -100,6 +115,11 @@ jobs:
with:
submodules: recursive

- name: update package lists
continue-on-error: true
run: |
sudo apt update

- name: install clang-tidy
run: sudo apt install clang-tidy

Expand Down Expand Up @@ -129,6 +149,11 @@ jobs:
with:
submodules: recursive

- name: update package lists
continue-on-error: true
run: |
sudo apt update

- name: install boost
run: |
sudo apt install libboost-tools-dev libboost-dev libboost-system-dev
Expand All @@ -155,6 +180,11 @@ jobs:
with:
submodules: recursive

- name: update package lists
continue-on-error: true
run: |
sudo apt update

- name: install boost
run: |
sudo apt install libboost-tools-dev libboost-dev libboost-system-dev
Expand All @@ -177,6 +207,11 @@ jobs:
with:
submodules: recursive

- name: update package lists
continue-on-error: true
run: |
sudo apt update

- name: install boost
run: |
sudo apt install libboost-tools-dev libboost-python-dev libboost-dev libboost-system-dev
Expand Down Expand Up @@ -207,9 +242,13 @@ jobs:
with:
submodules: recursive

- name: update package lists
continue-on-error: true
run: |
sudo apt update

- name: install boost
run: |
sudo apt-get update
sudo apt install libboost-tools-dev libboost-python-dev libboost-dev libboost-system-dev
sudo apt install python-docutils python-pygments python-pil gsfonts inkscape icoutils graphviz hunspell imagemagick
python -m pip install aafigure
Expand Down
45 changes: 45 additions & 0 deletions .github/workflows/python.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
name: Python bindings
on: [push, pull_request]

jobs:
build:
name: build
runs-on: ${{ matrix.os }}

strategy:
matrix:
os: [ubuntu-20.04, macos-latest]

steps:
- uses: actions/checkout@v2
with:
submodules: recursive

- name: dependencies (macos)
if: runner.os == 'macOS'
run: |
brew install boost-build boost boost-python3 [email protected]

- name: update package lists
if: runner.os == 'Linux'
continue-on-error: true
run: |
sudo apt update

- name: dependencies (linux)
if: runner.os == 'Linux'
run: |
sudo apt install libboost-tools-dev libboost-python-dev libboost-dev libboost-system-dev python3 python3-setuptools

- name: build/install
run: |
cd bindings/python
# Homebrew's python "framework" sets a prefix via distutils config.
# --prefix conflicts with --user, so null out prefix so we have one
# command that works everywhere
python3 setup.py build_ext -j3 --libtorrent-link=static install --user --prefix=

- name: tests
run: |
cd bindings/python
python3 test.py
32 changes: 32 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -632,6 +632,38 @@ if (APPLE)
target_link_libraries(torrent-rasterbar PRIVATE "-framework CoreFoundation" "-framework SystemConfiguration")
endif()

# check if we need to link with libatomic (not needed on MSVC)
if (NOT Windows)
# TODO: migrate to CheckSourceCompiles in CMake >= 3.19
include(CheckCXXSourceCompiles)

set(ATOMICS_TEST_SOURCE [=[
#include <atomic>
#include <cstdint>
std::atomic<int> x{0};
int main() {
x.fetch_add(1, std::memory_order_relaxed);
return 0;
}
]=])
string(REPLACE "std::atomic<int>" "std::atomic<std::int64_t>" ATOMICS64_TEST_SOURCE "${ATOMICS_TEST_SOURCE}")

check_cxx_source_compiles("${ATOMICS_TEST_SOURCE}" HAVE_CXX_ATOMICS_WITHOUT_LIB)
check_cxx_source_compiles("${ATOMICS64_TEST_SOURCE}" HAVE_CXX_ATOMICS64_WITHOUT_LIB)
if((NOT HAVE_CXX_ATOMICS_WITHOUT_LIB) OR (NOT HAVE_CXX_ATOMICS64_WITHOUT_LIB))
set(CMAKE_REQUIRED_LIBRARIES "atomic")
check_cxx_source_compiles("${ATOMICS_TEST_SOURCE}" HAVE_CXX_ATOMICS_WITH_LIB)
check_cxx_source_compiles("${ATOMICS64_TEST_SOURCE}" HAVE_CXX_ATOMICS64_WITH_LIB)
if ((NOT HAVE_CXX_ATOMICS_WITH_LIB) OR (NOT HAVE_CXX_ATOMICS64_WITH_LIB))
message(FATAL_ERROR "No native support for std::atomic, or libatomic not found!")
else()
message(STATUS "Linking with libatomic for atomics support")
unset(CMAKE_REQUIRED_LIBRARIES)
target_link_libraries(torrent-rasterbar PUBLIC atomic)
endif()
endif()
endif()

feature_option(build_tests "build tests" OFF)
feature_option(build_examples "build examples" OFF)
feature_option(build_tools "build tools" OFF)
Expand Down
2 changes: 1 addition & 1 deletion appveyor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ build_script:
b2.exe --hash openssl-lib=%ssl_lib% openssl-include=%ssl_include% warnings=all -j %NUMBER_OF_PROCESSORS% %compiler% address-model=%model% picker-debugging=on invariant-checks=full variant=%variant% link=shared crypto=%crypto% asserts=on export-extra=on windows-api=%api% windows-version=win10 libtorrent-link=shared stage_module stage_dependencies
)
- if defined python_dist (
c:\Python35-x64\python.exe setup.py bdist --format=msi
c:\Python36-x64\python.exe setup.py bdist --format=msi
)

# simulations
Expand Down
10 changes: 0 additions & 10 deletions bindings/python/Jamfile
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ use-project /torrent : ../.. ;

BOOST_ROOT = [ modules.peek : BOOST_ROOT ] ;
# this is used to make bjam use the same version of python which is executing setup.py
LIBTORRENT_PYTHON_INTERPRETER = [ modules.peek : LIBTORRENT_PYTHON_INTERPRETER ] ;

feature libtorrent-link : shared static : composite propagated ;
feature libtorrent-python-pic : off on : composite propagated link-incompatible ;
Expand All @@ -24,15 +23,6 @@ feature python-install-path : : free path ;
# the python module in the system directory or user-specifc directory
feature python-install-scope : user system : ;

# this is just to force boost build to pick the desired python target when using LIBTORRENT_PYTHON_INTERPRETER
feature libtorrent-python : on ;

if $(LIBTORRENT_PYTHON_INTERPRETER)
{
echo "using python interpreter at: " $(LIBTORRENT_PYTHON_INTERPRETER) ;
using python : : "$(LIBTORRENT_PYTHON_INTERPRETER)" : : : <libtorrent-python>on ;
}

# copied from boost 1.63's boost python jamfile
rule find-py3-version
{
Expand Down
Loading