added include files to CMakeLists.txt and added minimal support for cmake build in CI (#2767)

This commit is contained in:
Alden Torres 2018-02-03 20:03:40 -05:00 committed by Arvid Norberg
parent 3261eea63a
commit 971cffaed9
3 changed files with 306 additions and 8 deletions

View File

@ -9,7 +9,7 @@ matrix:
- env: variant=test_debug lint=1 tests=1 toolset=gcc-sanitizer
- env: variant=test_debug sim=1 crypto=openssl toolset=gcc-sanitizer
- env: variant=test_release coverage=1 tests=1 toolset=gcc-coverage python=1
- env: autotools=1 toolset=gcc
- env: cmake=1 autotools=1 toolset=gcc
- env: variant=test_debug crypto=openssl docs=1 tests=1 examples=1 python=1 toolset=darwin ios=1
os: osx
osx_image: xcode9.2
@ -227,6 +227,17 @@ script:
fi'
- cd ..
# minimal support for cmake build
- mkdir build
- cd build
- if [[ "$cmake" == "1" ]]; then
export CXX=g++-5 &&
export CC=gcc-5 &&
cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_CXX_FLAGS="-Werror" -Dbuild_tests=ON -G "CodeBlocks - Unix Makefiles" .. &&
cmake --build . -- -j2;
fi
- cd ..
# run through autotools and ./configure to make sure it works
- if [[ "$autotools" == "1" ]]; then
./autotool.sh &&

View File

@ -6,6 +6,273 @@ set (VERSION "1.2.0")
list(APPEND CMAKE_MODULE_PATH ${libtorrent_SOURCE_DIR}/cmake/Modules)
set(libtorrent_include_files
add_torrent_params
address
alert
alert_manager
alert_types
allocator
announce_entry
assert
bandwidth_limit
bandwidth_manager
bandwidth_queue_entry
bandwidth_socket
bdecode
bencode
bitfield
block_cache
bloom_filter
broadcast_socket
bt_peer_connection
buffer
build_config
chained_buffer
choker
close_reason
config
ConvertUTF
copy_ptr
crc32c
create_torrent
deadline_timer
debug
disk_buffer_holder
disk_buffer_pool
disk_interface
disk_io_job
disk_io_thread
disk_io_thread_pool
disk_job_pool
disk_observer
download_priority
ed25519
entry
enum_net
error
error_code
export
extensions
file
file_pool
file_storage
fingerprint
flags
fwd
gzip
hasher
hasher512
heterogeneous_queue
hex
http_connection
http_parser
http_seed_connection
http_stream
http_tracker_connection
i2p_stream
identify_client
instantiate_connection
invariant_check
io
io_service
io_service_fwd
ip_filter
ip_voter
lazy_entry
link
linked_list
lsd
magnet_uri
natpmp
netlink
operations
optional
packet_buffer
packet_pool
parse_url
part_file
pe_crypto
peer
peer_class
peer_class_set
peer_class_type_filter
peer_connection
peer_connection_handle
peer_connection_interface
peer_id
peer_info
peer_list
peer_request
performance_counters
pex_flags
piece_block
piece_block_progress
piece_picker
platform_util
portmap
proxy_base
puff
random
read_resume_data
receive_buffer
request_blocks
resolve_links
resolver
resolver_interface
session
session_handle
session_settings
session_stats
session_status
session_types
settings_pack
sha1
sha1_hash
sha512
sliding_average
socket
socket_io
socks5_stream
span
ssl_stream
stack_allocator
stat
stat_cache
storage
storage_defs
string_util
string_view
tailqueue
time
timestamp_history
torrent
torrent_flags
torrent_handle
torrent_info
torrent_peer
torrent_peer_allocator
torrent_status
tracker_manager
udp_socket
udp_tracker_connection
union_endpoint
units
upnp
utf8
utp_socket_manager
utp_stream
vector_utils
version
web_connection_base
web_peer_connection
write_resume_data
xml_parse)
set(libtorrent_kademlia_include_files
dht_observer
dht_settings
dht_state
dht_storage
dht_tracker
direct_request
dos_blocker
ed25519
find_data
get_item
get_peers
io
item
msg
node
node_entry
node_id
observer
put_data
refresh
routing_table
rpc_manager
sample_infohashes
traversal_algorithm
types)
set(libtorrent_extensions_include_files
smart_ban
ut_metadata
ut_pex)
set(libtorrent_aux_include_files
aligned_storage
aligned_union
alloca
allocating_handler
array
bind_to_device
block_cache_reference
byteswap
cppint_import_export
cpuid
deferred_handler
deque
dev_random
disable_warnings_pop
disable_warnings_push
disk_job_fence
escape_string
ffs
file_progress
has_block
io
ip_notifier
listen_socket_handle
lsd
max_path
merkle
noexcept_movable
numeric_cast
openssl
path
portmap
proxy_settings
range
route
scope_end
session_call
session_impl
session_interface
session_settings
session_udp_sockets
set_socket_buffer
socket_type
storage_piece_set
storage_utils
string_ptr
suggest_piece
throw
time
torrent_impl
typed_span
unique_ptr
vector
win_crypto_provider
win_util)
foreach(s ${libtorrent_include_files})
list(APPEND include_files include/libtorrent/${s})
endforeach(s)
foreach(s ${libtorrent_kademlia_include_files})
list(APPEND include_files include/libtorrent/kademlia/${s})
endforeach(s)
foreach(s ${libtorrent_extensions_include_files})
list(APPEND include_files include/libtorrent/extensions/${s})
endforeach(s)
foreach(s ${libtorrent_aux_include_files})
list(APPEND include_files include/libtorrent/aux_/${s})
endforeach(s)
set(sources
web_connection_base
alert
@ -212,6 +479,31 @@ if (dht)
endif()
endif()
list(APPEND sources2 ${include_files})
if(CMAKE_CXX_COMPILER_ID MATCHES Clang)
add_compile_options(
-Weverything
-Wno-documentation
-Wno-c++98-compat-pedantic
-Wno-padded
-Wno-global-constructors
-Wno-exit-time-destructors
-Wno-weak-vtables)
endif()
if(CMAKE_CXX_COMPILER_ID MATCHES GNU)
add_compile_options(
-Wall
-Wextra
-Wpedantic
-Wparentheses
-Wvla
-Wc++11-compat
-Wno-format-zero-length
-ftemplate-depth=512)
endif()
if (shared)
add_library(torrent-rasterbar SHARED ${sources2})
target_compile_definitions(torrent-rasterbar PRIVATE TORRENT_BUILDING_SHARED)
@ -243,6 +535,8 @@ else()
add_library(torrent-rasterbar STATIC ${sources2})
endif()
target_compile_features(torrent-rasterbar PUBLIC cxx_std_11)
target_compile_definitions(torrent-rasterbar PUBLIC $<$<CONFIG:Debug>:TORRENT_DEBUG>)
target_compile_definitions(torrent-rasterbar PRIVATE TORRENT_BUILDING_LIBRARY)
@ -350,10 +644,6 @@ target_compile_definitions(torrent-rasterbar PUBLIC BOOST_ASIO_HAS_STD_CHRONO)
set_target_properties(torrent-rasterbar PROPERTIES
SOVERSION ${SOVERSION})
# libtorrent requires at least C++11
set_property(TARGET torrent-rasterbar PROPERTY CXX_STANDARD 11)
set_property(TARGET torrent-rasterbar PROPERTY CXX_STANDARD_REQUIRED ON)
get_property (COMPILETIME_OPTIONS_LIST
DIRECTORY ${CMAKE_CURRENT_SOURCE_DIRECTORY}
PROPERTY COMPILE_DEFINITIONS

View File

@ -198,9 +198,6 @@ rule warnings ( properties * )
result += <cflags>-Wvla ;
result += <cxxflags>-Wc++11-compat ;
result += <cflags>-Wno-format-zero-length ;
# enable these warnings again, once the other ones are dealt with
result += <cflags>-Wno-unused-variable ;
}
if <toolset>msvc in $(properties)