mirror of https://github.com/Kylart/KawAnime.git
Now building libtorrent with main cmake
This commit is contained in:
parent
8b55b94c2a
commit
00b5440b2b
|
@ -19,7 +19,6 @@ jobs:
|
||||||
name: Mac
|
name: Mac
|
||||||
install:
|
install:
|
||||||
- brew install ninja
|
- brew install ninja
|
||||||
- bindings/scripts/install_libtorrent.sh
|
|
||||||
- npm install
|
- npm install
|
||||||
script:
|
script:
|
||||||
- npm run lint
|
- npm run lint
|
||||||
|
@ -44,9 +43,6 @@ jobs:
|
||||||
before_script:
|
before_script:
|
||||||
- "export DISPLAY=:99.0"
|
- "export DISPLAY=:99.0"
|
||||||
install:
|
install:
|
||||||
- cmake --version
|
|
||||||
- sudo ln -s $(which cmake) /usr/local/bin/
|
|
||||||
- sudo ./bindings/scripts/install_libtorrent.sh
|
|
||||||
- npm install
|
- npm install
|
||||||
script:
|
script:
|
||||||
- npm run lint
|
- npm run lint
|
||||||
|
|
10
appveyor.yml
10
appveyor.yml
|
@ -32,16 +32,6 @@ install:
|
||||||
- cd %BOOST_ROOT%
|
- cd %BOOST_ROOT%
|
||||||
- b2 cxxstd=14 address-model=64 threading=multi --with-system --with-date_time --toolset=msvc-14.1 link=static runtime-link=shared stage
|
- b2 cxxstd=14 address-model=64 threading=multi --with-system --with-date_time --toolset=msvc-14.1 link=static runtime-link=shared stage
|
||||||
|
|
||||||
- cd %APPVEYOR_BUILD_FOLDER%\bindings\lib\libtorrent
|
|
||||||
- mkdir build && cd build
|
|
||||||
- set BOOST_LIBRARYDIR=%BOOST_ROOT%\stage\lib
|
|
||||||
- dir %BOOST_LIBRARYDIR%
|
|
||||||
- cmake -DBOOST_LIBRARYDIR=%BOOST_LIBRARYDIR% -DCMAKE_CXX_STANDARD=14 -Dbuild_tools=ON -G "Visual Studio 15 2017 Win64" ..
|
|
||||||
- cmake --build . --config Release -- -verbosity:minimal
|
|
||||||
- cmake --install .
|
|
||||||
- set "PATH=%BOOST_LIBRARYDIR%;%PATH%"
|
|
||||||
- set "PATH=c:/Program Files/libtorrent/;%PATH%"
|
|
||||||
|
|
||||||
- cd %APPVEYOR_BUILD_FOLDER%
|
- cd %APPVEYOR_BUILD_FOLDER%
|
||||||
- npm install
|
- npm install
|
||||||
- dir %APPVEYOR_BUILD_FOLDER%\bindings\build\Release
|
- dir %APPVEYOR_BUILD_FOLDER%\bindings\build\Release
|
||||||
|
|
|
@ -32,6 +32,13 @@ endif(MSVC)
|
||||||
# LibGCrypt
|
# LibGCrypt
|
||||||
list(APPEND CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/lib/libtorrent/cmake/Modules)
|
list(APPEND CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/lib/libtorrent/cmake/Modules)
|
||||||
|
|
||||||
|
# Boost
|
||||||
|
# list(APPEND CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/../node_modules/boost-lib/cmake)
|
||||||
|
# include(BoostLib)
|
||||||
|
|
||||||
|
# require_boost_libs(">= 1.69.0" "system;date_time")
|
||||||
|
# include_directories(${Boost_INCLUDE_DIRS})
|
||||||
|
|
||||||
# Essential include files to build a node addon,
|
# Essential include files to build a node addon,
|
||||||
# you should add this line in every CMake.js based project.
|
# you should add this line in every CMake.js based project.
|
||||||
include_directories(${CMAKE_JS_INC})
|
include_directories(${CMAKE_JS_INC})
|
||||||
|
@ -51,17 +58,11 @@ add_library(${PROJECT_NAME} SHARED ${SOURCE_FILES})
|
||||||
target_include_directories(${PROJECT_NAME} PRIVATE "lib/anitomy")
|
target_include_directories(${PROJECT_NAME} PRIVATE "lib/anitomy")
|
||||||
|
|
||||||
## Libtorrent
|
## Libtorrent
|
||||||
find_package(LibtorrentRasterbar 1.2 REQUIRED)
|
set(LIBTORRENT_DIR "lib/libtorrent")
|
||||||
|
add_subdirectory(${LIBTORRENT_DIR})
|
||||||
|
|
||||||
# TODO: Would be great to have libtorrent build with cmake dependancy.
|
target_include_directories(${PROJECT_NAME} PRIVATE ${LIBTORRENT_DIR}/include)
|
||||||
# set(LIBTORRENT_DIR "lib/libtorrent")
|
target_link_libraries(${PROJECT_NAME} torrent-rasterbar)
|
||||||
# add_subdirectory(${LIBTORRENT_DIR})
|
|
||||||
|
|
||||||
find_path(LIBTORRENT_INCLUDE_PATH libtorrent)
|
|
||||||
find_library(LIBTORRENT_LIB torrent-rasterbar)
|
|
||||||
|
|
||||||
target_include_directories(${PROJECT_NAME} PRIVATE ${LIBTORRENT_INCLUDE_PATH})
|
|
||||||
target_link_libraries(${PROJECT_NAME} ${LIBTORRENT_LIB})
|
|
||||||
|
|
||||||
# Include N-API wrappers
|
# Include N-API wrappers
|
||||||
execute_process(COMMAND node -p "require('node-addon-api').include"
|
execute_process(COMMAND node -p "require('node-addon-api').include"
|
||||||
|
|
|
@ -1,17 +0,0 @@
|
||||||
export LIBTORRENT_PATH="$(dirname $0)/../lib/libtorrent"
|
|
||||||
|
|
||||||
cd $LIBTORRENT_PATH
|
|
||||||
|
|
||||||
mkdir build
|
|
||||||
cd build
|
|
||||||
|
|
||||||
cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_CXX_STANDARD=14 -G Ninja .. || exit 1
|
|
||||||
ninja || exit 2
|
|
||||||
ninja install
|
|
||||||
|
|
||||||
if [[ -z $TRAVIS ]]
|
|
||||||
then
|
|
||||||
cd ../../../
|
|
||||||
else
|
|
||||||
cd $TRAVIS_BUILD_DIR
|
|
||||||
fi
|
|
Loading…
Reference in New Issue