aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKirk Shoop <kirk.shoop@microsoft.com>2015-06-04 07:52:22 -0700
committerKirk Shoop <kirk.shoop@microsoft.com>2015-06-04 08:22:07 -0700
commit001ac1e827530a3b0e7411b77c37be89c95251c0 (patch)
tree4500b72e2e15a8f2253ee72f3487530c2c276296
parent73b1adbbabb43c8bb887178de628e0871e6b350d (diff)
downloadplatform_external_Reactive-Extensions_RxCpp-001ac1e827530a3b0e7411b77c37be89c95251c0.tar.gz
platform_external_Reactive-Extensions_RxCpp-001ac1e827530a3b0e7411b77c37be89c95251c0.tar.bz2
platform_external_Reactive-Extensions_RxCpp-001ac1e827530a3b0e7411b77c37be89c95251c0.zip
CMake - require 3.2 and refactor
NOTE: binaries have moved! OSX <build>/test/rxcppv2_test <build>/examples/pythagorian/pythagorian Windows <build>\test\Debug\rxcppv2_test.exe <build>\examples\pythagorian\Debug\pythagorian.exe NOTE: cmake can be run in the root! This will make a dir named build with the binaries cmake . cmake --build .
-rw-r--r--.gitignore3
-rw-r--r--.travis.yml163
-rw-r--r--CMakeLists.txt5
-rw-r--r--Rx/v2/examples/cep/CMakeLists.txt41
-rw-r--r--Rx/v2/examples/doxygen/CMakeLists.txt32
-rw-r--r--Rx/v2/examples/println/CMakeLists.txt34
-rw-r--r--Rx/v2/examples/pythagorian/CMakeLists.txt34
-rw-r--r--Rx/v2/examples/stop/CMakeLists.txt2
-rw-r--r--Rx/v2/examples/tests/CMakeLists.txt35
-rw-r--r--Rx/v2/src/rxcpp/operators/rx-buffer_time.hpp2
-rw-r--r--Rx/v2/src/rxcpp/operators/rx-buffer_time_count.hpp2
-rw-r--r--Rx/v2/src/rxcpp/operators/rx-window_time.hpp2
-rw-r--r--Rx/v2/src/rxcpp/operators/rx-window_time_count.hpp2
-rw-r--r--Rx/v2/src/rxcpp/rx-scheduler.hpp2
-rw-r--r--Rx/v2/test/CMakeLists.txt93
-rw-r--r--Rx/v2/test/test.cpp2
-rw-r--r--appveyor.yml26
-rw-r--r--projects/CMake/CMakeLists.txt221
-rw-r--r--projects/CMake/shared.cmake47
-rw-r--r--projects/doxygen/CMakeLists.txt114
-rw-r--r--projects/scripts/install_libcxx.sh12
-rwxr-xr-xprojects/scripts/travis-install.sh49
22 files changed, 613 insertions, 310 deletions
diff --git a/.gitignore b/.gitignore
index d9537e2..558f52c 100644
--- a/.gitignore
+++ b/.gitignore
@@ -105,11 +105,14 @@ Desktop.ini
## CMake
############
+build/*
projects/*
!projects/CMake/CMakeLists.txt
+!projects/CMake/shared.cmake
!projects/nuget/rxcpp.autopackage
!projects/doxygen
!projects/scripts
+Testing/*
CMakeCache.txt
CMakeFiles
diff --git a/.travis.yml b/.travis.yml
index 5b86c92..8e4b442 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -1,35 +1,152 @@
+sudo: true
language: cpp
-os:
-- linux
-- osx
-compiler:
-- clang
-- gcc
env:
- matrix:
- - CMAKE_BUILD_TYPE=RelWithDebInfo
global:
secure: FNZOWYO89qsT9kQKngrYbpnqCTMCSCSQ2rnZ3l17KHctOfS554TTDS+dfxPYz2XHm6azYDVcyBSs2gWJ6TmXZZZqEfr3X4VV4ooAa9PoeIkvVlT654zjZwxeXPYXrHFXZh/ImLUGWjsxRaUHYOv5SzyNGcZv07dtLKVd0ykhbH4=
+# Test matrix:
+# - Build matrix per compiler: C++11/C++14 + Debug/Release
+# - Optionally: AddressSanitizer (ASAN)
+# - Valgrind: all release builds are also tested with valgrind
+# - clang 3.4, 3.5, 3.6, trunk
+# - Note: 3.4 and trunk are tested with/without ASAN,
+# the rest is only tested with ASAN=On.
+# - gcc 4.9, 5.0
+#
matrix:
- allow_failures:
- - compiler: clang
- os: linux
- exclude:
- - compiler: gcc
- os: osx
+ include:
+ # Test clang-3.4: C++11, Buidd=Debug/Release, ASAN=On/Off
+ # - env: CLANG_VERSION=3.4 BUILD_TYPE=Debug CPP=11 ASAN=On LIBCXX=On
+ # os: linux
+ # compiler: clang34
+ # addons: &clang34
+ # apt:
+ # packages:
+ # - valgrind
+ # sources:
+ # - ubuntu-toolchain-r-test
+
+ # - env: CLANG_VERSION=3.4 BUILD_TYPE=Release CPP=11 ASAN=On LIBCXX=On
+ # os: linux
+ # compiler: clang
+ # addons: *clang34
+
+ # Test clang-3.7: C++11/C++14, Buidd=Debug/Release, ASAN=On/Off
+ # - env: CLANG_VERSION=3.7 BUILD_TYPE=Debug CPP=11 ASAN=On LIBCXX=On
+ # os: linux
+ # addons: &clang37
+ # apt:
+ # packages:
+ # - clang-3.7
+ # - valgrind
+ # sources:
+ # - ubuntu-toolchain-r-test
+ # - llvm-toolchain-precise
+
+ - env: BUILD_TYPE=Release CPP=11 ASAN=On LIBCXX=On
+ os: osx
+ compiler: clang
+
+ - env: CLANG_VERSION=3.7 BUILD_TYPE=Release CPP=11 ASAN=On LIBCXX=On
+ os: linux
+ compiler: clang
+ addons: &clang37
+ apt:
+ packages:
+ - clang-3.7
+ sources:
+ - ubuntu-toolchain-r-test
+ - llvm-toolchain-precise
+
+ # - env: CLANG_VERSION=3.7 BUILD_TYPE=Debug CPP=14 ASAN=On LIBCXX=On
+ # os: linux
+ # addons: *clang37
+
+ # - env: CLANG_VERSION=3.7 BUILD_TYPE=Release CPP=14 ASAN=On LIBCXX=On
+ # os: linux
+ # addons: *clang37
+
+ # - env: CLANG_VERSION=3.7 BUILD_TYPE=Debug CPP=11 ASAN=Off LIBCXX=On
+ # os: linux
+ # addons: *clang37
+
+ # - env: CLANG_VERSION=3.7 BUILD_TYPE=Release CPP=11 ASAN=Off LIBCXX=On
+ # os: linux
+ # addons: *clang37
+
+ # - env: CLANG_VERSION=3.7 BUILD_TYPE=Debug CPP=14 ASAN=Off LIBCXX=On
+ # os: linux
+ # addons: *clang37
+
+ # - env: CLANG_VERSION=3.7 BUILD_TYPE=Release CPP=14 ASAN=Off LIBCXX=On
+ # os: linux
+ # addons: *clang37
+
+ # Test gcc-4.9: C++11, Build=Debug/Release, ASAN=Off
+ # - env: GCC_VERSION=4.9 BUILD_TYPE=Debug CPP=11 ASAN=Off LIBCXX=Off
+ # os: linux
+ # addons: &gcc49
+ # apt:
+ # packages:
+ # - g++-4.9
+ # - valgrind
+ # sources:
+ # - ubuntu-toolchain-r-test
+
+ - env: GCC_VERSION=4.9 BUILD_TYPE=Release CPP=11 ASAN=Off LIBCXX=Off
+ os: linux
+ compiler: gcc
+ addons: &gcc49
+ apt:
+ packages:
+ - g++-4.9
+ - cmake
+ - doxygen
+ - graphviz
+ sources:
+ - ubuntu-toolchain-r-test
+ - kubuntu-backports
+
+ # Test gcc-5.0: C++11/14, Build=Debug/Release, ASAN=Off
+ # - env: GCC_VERSION=5 BUILD_TYPE=Debug CPP=11 ASAN=Off LIBCXX=Off
+ # os: linux
+ # addons: &gcc5
+ # apt:
+ # packages:
+ # - gcc-5
+ # - valgrind
+ # sources:
+ # - ubuntu-toolchain-r-test
+
+ # - env: GCC_VERSION=5 BUILD_TYPE=Release CPP=11 ASAN=Off LIBCXX=Off
+ # os: linux
+ # addons: *gcc5
+
+ # - env: GCC_VERSION=5 BUILD_TYPE=Debug CPP=14 ASAN=Off LIBCXX=Off
+ # os: linux
+ # addons: *gcc5
+
+ # - env: GCC_VERSION=5 BUILD_TYPE=Release CPP=14 ASAN=Off LIBCXX=Off
+ # os: linux
+ # addons: *gcc5
before_install:
+- if [ -n "$GCC_VERSION" ]; then export CXX="g++-${GCC_VERSION}" CC="gcc-${GCC_VERSION}"; fi
+- if [ -n "$CLANG_VERSION" ]; then export CXX="clang++-${CLANG_VERSION}" CC="clang-${CLANG_VERSION}"; fi
+- which $CXX
+- which $CC
- sh projects/scripts/travis-install.sh
+- if [ -n "$CLANG_VERSION" ]; then sh projects/scripts/install_libcxx.sh; fi
install:
-- "$CXX --version"
-- "/usr/local/bin/cmake --version"
-- cd projects
-- "/usr/local/bin/cmake -GUnix\\ Makefiles -HCMake -Bbuild -DCMAKE_C_COMPILER=$CC
- -DCMAKE_CXX_COMPILER=$CXX"
-- cd ..
+- export CXX_FLAGS=""
+- export CXX_LINKER_FLAGS=""
+- if [ -z "$BUILD_TYPE" ]; then export BUILD_TYPE=Release; fi
+- if [ "$ASAN" == "On"]; then export CXX_FLAGS="${CXX_FLAGS} -fsanitize=address,undefined,integer -fno-omit-frame-pointer -fno-sanitize=unsigned-integer-overflow"; fi
+- if [ -n "$CLANG_VERSION" ]; then CXX_FLAGS="${CXX_FLAGS} -D__extern_always_inline=inline"; fi
+- if [ "$LIBCXX" == "On" ]; then CXX_FLAGS="${CXX_FLAGS} -stdlib=libc++ -I/usr/include/c++/v1/"; fi
+- if [ "$LIBCXX" == "On" ]; then CXX_LINKER_FLAGS="${CXX_FLAGS} -L/usr/lib/ -lc++"; fi
+- cmake . -DCMAKE_BUILD_TYPE=$BUILD_TYPE -DCMAKE_CXX_FLAGS="${CXX_FLAGS}" -DCMAKE_EXE_LINKER_FLAGS="${CXX_LINKER_FLAGS}"
script:
-- cd projects/build
-- make -j1
-- cd ../..
+- make VERBOSE=1
+- if [ -n "$GCC_VERSION" ]; then build/test/rxcppv2_test; fi
after_success:
- sh projects/scripts/travis-doxygen.sh
branches:
diff --git a/CMakeLists.txt b/CMakeLists.txt
new file mode 100644
index 0000000..ae61a35
--- /dev/null
+++ b/CMakeLists.txt
@@ -0,0 +1,5 @@
+cmake_minimum_required(VERSION 3.2 FATAL_ERROR)
+
+# define some folders
+
+add_subdirectory(projects/CMake build)
diff --git a/Rx/v2/examples/cep/CMakeLists.txt b/Rx/v2/examples/cep/CMakeLists.txt
index c04bead..542a858 100644
--- a/Rx/v2/examples/cep/CMakeLists.txt
+++ b/Rx/v2/examples/cep/CMakeLists.txt
@@ -1,30 +1,8 @@
-cmake_minimum_required(VERSION 2.8)
+cmake_minimum_required(VERSION 3.2 FATAL_ERROR)
get_filename_component(SAMPLE_PROJECT "${CMAKE_CURRENT_SOURCE_DIR}" NAME)
-project(${SAMPLE_PROJECT})
-
-FIND_PACKAGE(Threads)
-
-MESSAGE( STATUS "CMAKE_CXX_COMPILER_ID: " ${CMAKE_CXX_COMPILER_ID} )
-if (CMAKE_CXX_COMPILER_ID MATCHES "Clang")
- MESSAGE( STATUS "using clang settings" )
- add_compile_options( -Wall -Wextra -Werror )
- add_compile_options( -std=c++11 -stdlib=libc++ )
- add_compile_options( -ftemplate-depth=1024 ) # sometimes you just do what the compiler tells you
-elseif (CMAKE_CXX_COMPILER_ID MATCHES "GNU")
- MESSAGE( STATUS "using gnu settings" )
- add_compile_options( -Wall -Wextra -Werror )
- add_compile_options( -std=c++11 )
-elseif (CMAKE_CXX_COMPILER_ID MATCHES "MSVC")
- MESSAGE( STATUS "using msvc settings" )
- add_compile_options( /W4 /WX )
- add_compile_options( /wd4503 ) # truncated symbol
- add_compile_options( /wd4702 ) # unreachable code
- add_compile_options( /bigobj )
- add_definitions( /DUNICODE /D_UNICODE ) # it is a new millenium
-endif()
-
+project(${SAMPLE_PROJECT} LANGUAGES C CXX)
# define some folders
get_filename_component(RXCPP_DIR "${CMAKE_CURRENT_SOURCE_DIR}" PATH)
@@ -34,20 +12,25 @@ get_filename_component(RXCPP_DIR "${RXCPP_DIR}" PATH)
MESSAGE( STATUS "RXCPP_DIR: " ${RXCPP_DIR} )
-include_directories(SYSTEM ${RXCPP_DIR}/ext/catch/include)
-include_directories(${RXCPP_DIR}/Ix/CPP/src ${RXCPP_DIR}/Rx/v2/src)
+include(${RXCPP_DIR}/projects/CMake/shared.cmake)
# define the sources
set(SAMPLE_SOURCES
${CMAKE_CURRENT_SOURCE_DIR}/main.cpp
)
add_executable(${SAMPLE_PROJECT} ${SAMPLE_SOURCES})
-TARGET_LINK_LIBRARIES(${SAMPLE_PROJECT} ${CMAKE_THREAD_LIBS_INIT})
+add_executable(rxcpp::examples::${SAMPLE_PROJECT} ALIAS ${SAMPLE_PROJECT})
+target_compile_options(${SAMPLE_PROJECT} PUBLIC ${RX_COMPILE_OPTIONS})
+target_compile_features(${SAMPLE_PROJECT} PUBLIC ${RX_COMPILE_FEATURES})
+target_include_directories(${SAMPLE_PROJECT}
+ PUBLIC ${RX_SRC_DIR} ${RX_CATCH_DIR}
+ )
+target_link_libraries(${SAMPLE_PROJECT} ${CMAKE_THREAD_LIBS_INIT})
# configure unit tests via CTest
enable_testing()
set(CTEST_CONFIGURATION_TYPE "${JOB_BUILD_CONFIGURATION}")
-add_test(NAME RunTests
+add_test(NAME RunTests
WORKING_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}"
- COMMAND ${SAMPLE_PROJECT} ${TEST_ARGS}) \ No newline at end of file
+ COMMAND ${SAMPLE_PROJECT} ${TEST_ARGS})
diff --git a/Rx/v2/examples/doxygen/CMakeLists.txt b/Rx/v2/examples/doxygen/CMakeLists.txt
new file mode 100644
index 0000000..d89b175
--- /dev/null
+++ b/Rx/v2/examples/doxygen/CMakeLists.txt
@@ -0,0 +1,32 @@
+cmake_minimum_required(VERSION 3.2 FATAL_ERROR)
+
+get_filename_component(SAMPLE_PROJECT "${CMAKE_CURRENT_SOURCE_DIR}" NAME)
+
+project(${SAMPLE_PROJECT} LANGUAGES C CXX)
+
+# define some folders
+get_filename_component(RXCPP_DIR "${CMAKE_CURRENT_SOURCE_DIR}" PATH)
+get_filename_component(RXCPP_DIR "${RXCPP_DIR}" PATH)
+get_filename_component(RXCPP_DIR "${RXCPP_DIR}" PATH)
+get_filename_component(RXCPP_DIR "${RXCPP_DIR}" PATH)
+
+MESSAGE( STATUS "RXCPP_DIR: " ${RXCPP_DIR} )
+
+include(${RXCPP_DIR}/projects/CMake/shared.cmake)
+
+# define the sources
+file(GLOB SAMPLE_SOURCES "${CMAKE_CURRENT_SOURCE_DIR}/*.cpp")
+add_executable(${SAMPLE_PROJECT} ${SAMPLE_SOURCES})
+add_executable(rxcpp::examples::${SAMPLE_PROJECT} ALIAS ${SAMPLE_PROJECT})
+target_compile_options(${SAMPLE_PROJECT} PUBLIC ${RX_COMPILE_OPTIONS})
+target_compile_features(${SAMPLE_PROJECT} PUBLIC ${RX_COMPILE_FEATURES})
+target_include_directories(${SAMPLE_PROJECT} PUBLIC ${RX_SRC_DIR} ${RX_CATCH_DIR})
+target_link_libraries(${SAMPLE_PROJECT} ${CMAKE_THREAD_LIBS_INIT})
+
+# configure unit tests via CTest
+enable_testing()
+set(CTEST_CONFIGURATION_TYPE "${JOB_BUILD_CONFIGURATION}")
+
+add_test(NAME RunTests
+ WORKING_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}"
+ COMMAND ${SAMPLE_PROJECT} ${TEST_ARGS})
diff --git a/Rx/v2/examples/println/CMakeLists.txt b/Rx/v2/examples/println/CMakeLists.txt
new file mode 100644
index 0000000..82cd2a4
--- /dev/null
+++ b/Rx/v2/examples/println/CMakeLists.txt
@@ -0,0 +1,34 @@
+cmake_minimum_required(VERSION 3.2 FATAL_ERROR)
+
+get_filename_component(SAMPLE_PROJECT "${CMAKE_CURRENT_SOURCE_DIR}" NAME)
+
+project(${SAMPLE_PROJECT} LANGUAGES C CXX)
+
+# define some folders
+get_filename_component(RXCPP_DIR "${CMAKE_CURRENT_SOURCE_DIR}" PATH)
+get_filename_component(RXCPP_DIR "${RXCPP_DIR}" PATH)
+get_filename_component(RXCPP_DIR "${RXCPP_DIR}" PATH)
+get_filename_component(RXCPP_DIR "${RXCPP_DIR}" PATH)
+
+MESSAGE( STATUS "RXCPP_DIR: " ${RXCPP_DIR} )
+
+include(${RXCPP_DIR}/projects/CMake/shared.cmake)
+
+# define the sources
+set(SAMPLE_SOURCES
+ ${CMAKE_CURRENT_SOURCE_DIR}/main.cpp
+)
+add_executable(${SAMPLE_PROJECT} ${SAMPLE_SOURCES})
+add_executable(rxcpp::examples::${SAMPLE_PROJECT} ALIAS ${SAMPLE_PROJECT})
+target_compile_options(${SAMPLE_PROJECT} PUBLIC ${RX_COMPILE_OPTIONS})
+target_compile_features(${SAMPLE_PROJECT} PUBLIC ${RX_COMPILE_FEATURES})
+target_include_directories(${SAMPLE_PROJECT} PUBLIC ${RX_SRC_DIR})
+target_link_libraries(${SAMPLE_PROJECT} ${CMAKE_THREAD_LIBS_INIT})
+
+# configure unit tests via CTest
+enable_testing()
+set(CTEST_CONFIGURATION_TYPE "${JOB_BUILD_CONFIGURATION}")
+
+add_test(NAME RunTests
+ WORKING_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}"
+ COMMAND ${SAMPLE_PROJECT} ${TEST_ARGS})
diff --git a/Rx/v2/examples/pythagorian/CMakeLists.txt b/Rx/v2/examples/pythagorian/CMakeLists.txt
new file mode 100644
index 0000000..82cd2a4
--- /dev/null
+++ b/Rx/v2/examples/pythagorian/CMakeLists.txt
@@ -0,0 +1,34 @@
+cmake_minimum_required(VERSION 3.2 FATAL_ERROR)
+
+get_filename_component(SAMPLE_PROJECT "${CMAKE_CURRENT_SOURCE_DIR}" NAME)
+
+project(${SAMPLE_PROJECT} LANGUAGES C CXX)
+
+# define some folders
+get_filename_component(RXCPP_DIR "${CMAKE_CURRENT_SOURCE_DIR}" PATH)
+get_filename_component(RXCPP_DIR "${RXCPP_DIR}" PATH)
+get_filename_component(RXCPP_DIR "${RXCPP_DIR}" PATH)
+get_filename_component(RXCPP_DIR "${RXCPP_DIR}" PATH)
+
+MESSAGE( STATUS "RXCPP_DIR: " ${RXCPP_DIR} )
+
+include(${RXCPP_DIR}/projects/CMake/shared.cmake)
+
+# define the sources
+set(SAMPLE_SOURCES
+ ${CMAKE_CURRENT_SOURCE_DIR}/main.cpp
+)
+add_executable(${SAMPLE_PROJECT} ${SAMPLE_SOURCES})
+add_executable(rxcpp::examples::${SAMPLE_PROJECT} ALIAS ${SAMPLE_PROJECT})
+target_compile_options(${SAMPLE_PROJECT} PUBLIC ${RX_COMPILE_OPTIONS})
+target_compile_features(${SAMPLE_PROJECT} PUBLIC ${RX_COMPILE_FEATURES})
+target_include_directories(${SAMPLE_PROJECT} PUBLIC ${RX_SRC_DIR})
+target_link_libraries(${SAMPLE_PROJECT} ${CMAKE_THREAD_LIBS_INIT})
+
+# configure unit tests via CTest
+enable_testing()
+set(CTEST_CONFIGURATION_TYPE "${JOB_BUILD_CONFIGURATION}")
+
+add_test(NAME RunTests
+ WORKING_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}"
+ COMMAND ${SAMPLE_PROJECT} ${TEST_ARGS})
diff --git a/Rx/v2/examples/stop/CMakeLists.txt b/Rx/v2/examples/stop/CMakeLists.txt
index b1791ad..82cd2a4 100644
--- a/Rx/v2/examples/stop/CMakeLists.txt
+++ b/Rx/v2/examples/stop/CMakeLists.txt
@@ -2,7 +2,7 @@ cmake_minimum_required(VERSION 3.2 FATAL_ERROR)
get_filename_component(SAMPLE_PROJECT "${CMAKE_CURRENT_SOURCE_DIR}" NAME)
-project(${SAMPLE_PROJECT} LANGUAGES CXX)
+project(${SAMPLE_PROJECT} LANGUAGES C CXX)
# define some folders
get_filename_component(RXCPP_DIR "${CMAKE_CURRENT_SOURCE_DIR}" PATH)
diff --git a/Rx/v2/examples/tests/CMakeLists.txt b/Rx/v2/examples/tests/CMakeLists.txt
new file mode 100644
index 0000000..af849ff
--- /dev/null
+++ b/Rx/v2/examples/tests/CMakeLists.txt
@@ -0,0 +1,35 @@
+cmake_minimum_required(VERSION 3.2 FATAL_ERROR)
+
+get_filename_component(SAMPLE_PROJECT "${CMAKE_CURRENT_SOURCE_DIR}" NAME)
+
+project(${SAMPLE_PROJECT} LANGUAGES C CXX)
+
+# define some folders
+get_filename_component(RXCPP_DIR "${CMAKE_CURRENT_SOURCE_DIR}" PATH)
+get_filename_component(RXCPP_DIR "${RXCPP_DIR}" PATH)
+get_filename_component(RXCPP_DIR "${RXCPP_DIR}" PATH)
+get_filename_component(RXCPP_DIR "${RXCPP_DIR}" PATH)
+
+MESSAGE( STATUS "RXCPP_DIR: " ${RXCPP_DIR} )
+
+include(${RXCPP_DIR}/projects/CMake/shared.cmake)
+
+# define the sources
+set(SAMPLE_SOURCES
+ ${CMAKE_CURRENT_SOURCE_DIR}/main.cpp
+ ${CMAKE_CURRENT_SOURCE_DIR}/take.cpp
+)
+add_executable(${SAMPLE_PROJECT} ${SAMPLE_SOURCES})
+add_executable(rxcpp::examples::${SAMPLE_PROJECT} ALIAS ${SAMPLE_PROJECT})
+target_compile_options(${SAMPLE_PROJECT} PUBLIC ${RX_COMPILE_OPTIONS})
+target_compile_features(${SAMPLE_PROJECT} PUBLIC ${RX_COMPILE_FEATURES})
+target_include_directories(${SAMPLE_PROJECT} PUBLIC ${RX_SRC_DIR} ${RX_CATCH_DIR})
+target_link_libraries(${SAMPLE_PROJECT} ${CMAKE_THREAD_LIBS_INIT})
+
+# configure unit tests via CTest
+enable_testing()
+set(CTEST_CONFIGURATION_TYPE "${JOB_BUILD_CONFIGURATION}")
+
+add_test(NAME RunTests
+ WORKING_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}"
+ COMMAND ${SAMPLE_PROJECT} ${TEST_ARGS})
diff --git a/Rx/v2/src/rxcpp/operators/rx-buffer_time.hpp b/Rx/v2/src/rxcpp/operators/rx-buffer_time.hpp
index f1edbe6..776c020 100644
--- a/Rx/v2/src/rxcpp/operators/rx-buffer_time.hpp
+++ b/Rx/v2/src/rxcpp/operators/rx-buffer_time.hpp
@@ -58,7 +58,7 @@ struct buffer_with_time
, cs(std::move(cs))
, dest(std::move(d))
, coordinator(std::move(c))
- , worker(std::move(coordinator.get_worker()))
+ , worker(coordinator.get_worker())
, expected(worker.now())
{
}
diff --git a/Rx/v2/src/rxcpp/operators/rx-buffer_time_count.hpp b/Rx/v2/src/rxcpp/operators/rx-buffer_time_count.hpp
index ba8d62a..936315d 100644
--- a/Rx/v2/src/rxcpp/operators/rx-buffer_time_count.hpp
+++ b/Rx/v2/src/rxcpp/operators/rx-buffer_time_count.hpp
@@ -58,7 +58,7 @@ struct buffer_with_time_or_count
, cs(std::move(cs))
, dest(std::move(d))
, coordinator(std::move(c))
- , worker(std::move(coordinator.get_worker()))
+ , worker(coordinator.get_worker())
, chunk_id(0)
{
}
diff --git a/Rx/v2/src/rxcpp/operators/rx-window_time.hpp b/Rx/v2/src/rxcpp/operators/rx-window_time.hpp
index a64d83d..db6d11b 100644
--- a/Rx/v2/src/rxcpp/operators/rx-window_time.hpp
+++ b/Rx/v2/src/rxcpp/operators/rx-window_time.hpp
@@ -56,7 +56,7 @@ struct window_with_time
, cs(std::move(cs))
, dest(std::move(d))
, coordinator(std::move(c))
- , worker(std::move(coordinator.get_worker()))
+ , worker(coordinator.get_worker())
, expected(worker.now())
{
}
diff --git a/Rx/v2/src/rxcpp/operators/rx-window_time_count.hpp b/Rx/v2/src/rxcpp/operators/rx-window_time_count.hpp
index 5bb65ab..ab36006 100644
--- a/Rx/v2/src/rxcpp/operators/rx-window_time_count.hpp
+++ b/Rx/v2/src/rxcpp/operators/rx-window_time_count.hpp
@@ -56,7 +56,7 @@ struct window_with_time_or_count
, cs(std::move(cs))
, dest(std::move(d))
, coordinator(std::move(c))
- , worker(std::move(coordinator.get_worker()))
+ , worker(coordinator.get_worker())
, cursor(0)
, subj_id(0)
{
diff --git a/Rx/v2/src/rxcpp/rx-scheduler.hpp b/Rx/v2/src/rxcpp/rx-scheduler.hpp
index d28fd82..40d3337 100644
--- a/Rx/v2/src/rxcpp/rx-scheduler.hpp
+++ b/Rx/v2/src/rxcpp/rx-scheduler.hpp
@@ -370,7 +370,7 @@ public:
{
}
explicit scheduler(detail::const_scheduler_interface_ptr i)
- : inner(std::move(std::const_pointer_cast<scheduler_interface>(i)))
+ : inner(std::const_pointer_cast<scheduler_interface>(i))
{
}
diff --git a/Rx/v2/test/CMakeLists.txt b/Rx/v2/test/CMakeLists.txt
new file mode 100644
index 0000000..5d64906
--- /dev/null
+++ b/Rx/v2/test/CMakeLists.txt
@@ -0,0 +1,93 @@
+cmake_minimum_required(VERSION 3.2 FATAL_ERROR)
+
+project(rxcppv2_test LANGUAGES C CXX)
+
+# define some folders
+
+get_filename_component(RXCPP_DIR "${CMAKE_CURRENT_SOURCE_DIR}" PATH)
+get_filename_component(RXCPP_DIR "${RXCPP_DIR}" PATH)
+get_filename_component(RXCPP_DIR "${RXCPP_DIR}" PATH)
+
+MESSAGE( STATUS "RXCPP_DIR: " ${RXCPP_DIR} )
+
+include(${RXCPP_DIR}/projects/CMake/shared.cmake)
+
+set(TEST_DIR ${RXCPP_DIR}/Rx/v2/test)
+
+# define the sources of the self test
+set(TEST_SOURCES
+ ${TEST_DIR}/test.cpp
+ ${TEST_DIR}/subscriptions/observer.cpp
+ ${TEST_DIR}/subscriptions/subscription.cpp
+ ${TEST_DIR}/subjects/subject.cpp
+ ${TEST_DIR}/sources/create.cpp
+ ${TEST_DIR}/sources/defer.cpp
+ ${TEST_DIR}/sources/interval.cpp
+ ${TEST_DIR}/sources/scope.cpp
+ ${TEST_DIR}/sources/timer.cpp
+ ${TEST_DIR}/operators/amb.cpp
+ ${TEST_DIR}/operators/amb_variadic.cpp
+ ${TEST_DIR}/operators/buffer.cpp
+ ${TEST_DIR}/operators/combine_latest.1.cpp
+ ${TEST_DIR}/operators/combine_latest.2.cpp
+ ${TEST_DIR}/operators/concat.cpp
+ ${TEST_DIR}/operators/concat_map.cpp
+ ${TEST_DIR}/operators/distinct_until_changed.cpp
+ ${TEST_DIR}/operators/filter.cpp
+ ${TEST_DIR}/operators/flat_map.cpp
+ ${TEST_DIR}/operators/group_by.cpp
+ ${TEST_DIR}/operators/lift.cpp
+ ${TEST_DIR}/operators/map.cpp
+ ${TEST_DIR}/operators/merge.cpp
+ ${TEST_DIR}/operators/observe_on.cpp
+ ${TEST_DIR}/operators/pairwise.cpp
+ ${TEST_DIR}/operators/publish.cpp
+ ${TEST_DIR}/operators/reduce.cpp
+ ${TEST_DIR}/operators/repeat.cpp
+ ${TEST_DIR}/operators/retry.cpp
+ ${TEST_DIR}/operators/scan.cpp
+ ${TEST_DIR}/operators/skip.cpp
+ ${TEST_DIR}/operators/skip_until.cpp
+ ${TEST_DIR}/operators/subscribe_on.cpp
+ ${TEST_DIR}/operators/switch_on_next.cpp
+ ${TEST_DIR}/operators/take.cpp
+ ${TEST_DIR}/operators/take_until.cpp
+ ${TEST_DIR}/operators/window.cpp
+ ${TEST_DIR}/operators/zip.1.cpp
+ ${TEST_DIR}/operators/zip.2.cpp
+)
+add_executable(rxcppv2_test ${TEST_SOURCES})
+add_executable(rxcpp::tests ALIAS rxcppv2_test)
+target_compile_options(rxcppv2_test PUBLIC ${RX_COMPILE_OPTIONS})
+target_compile_features(rxcppv2_test PUBLIC ${RX_COMPILE_FEATURES})
+target_include_directories(rxcppv2_test
+ PUBLIC ${RX_SRC_DIR} ${RX_CATCH_DIR}
+ )
+target_link_libraries(rxcppv2_test ${CMAKE_THREAD_LIBS_INIT})
+
+# define the sources of the self test
+set(ONE_SOURCES
+ ${TEST_DIR}/test.cpp
+ #${TEST_DIR}/operators/combine_latest.1.cpp
+ #${TEST_DIR}/operators/combine_latest.2.cpp
+)
+add_executable(one_test ${ONE_SOURCES})
+add_executable(rxcpp::one_test ALIAS one_test)
+target_compile_options(one_test PUBLIC ${RX_COMPILE_OPTIONS})
+target_compile_features(one_test PUBLIC ${RX_COMPILE_FEATURES})
+target_include_directories(one_test
+ PUBLIC ${RX_SRC_DIR} ${RX_CATCH_DIR}
+ )
+target_link_libraries(one_test ${CMAKE_THREAD_LIBS_INIT})
+
+# configure unit tests via CTest
+enable_testing()
+
+add_test(NAME RunTests COMMAND rxcppv2_test)
+
+add_test(NAME ListTests COMMAND rxcppv2_test --list-tests)
+set_tests_properties(ListTests PROPERTIES PASS_REGULAR_EXPRESSION "[0-9]+ test cases")
+
+add_test(NAME ListTags COMMAND rxcppv2_test --list-tags)
+set_tests_properties(ListTags PROPERTIES PASS_REGULAR_EXPRESSION "[0-9]+ tags")
+
diff --git a/Rx/v2/test/test.cpp b/Rx/v2/test/test.cpp
index 8fe512e..8cd3e05 100644
--- a/Rx/v2/test/test.cpp
+++ b/Rx/v2/test/test.cpp
@@ -1,5 +1,5 @@
#include <exception>
-#if (__GLIBCXX__ / 10000) == 2014
+#if (__GLIBCXX__ / 10000) == 2014 || (__GLIBCXX__ / 10000) == 2015
namespace std {
inline bool uncaught_exception() noexcept(true) {
return current_exception() != nullptr;
diff --git a/appveyor.yml b/appveyor.yml
index 5697165..3f1a0ce 100644
--- a/appveyor.yml
+++ b/appveyor.yml
@@ -1,4 +1,4 @@
-version: 2.1.{build}
+version: 2.2.{build}
branches:
# whitelist
@@ -6,20 +6,26 @@ branches:
- master
- appveyor
+environment:
+ matrix:
+ - VSVER: Visual Studio 12 2013 Win64
+# - VSVER: Visual Studio 14 2015 Win64
+
install:
+ - choco install cmake
+ - choco upgrade cmake
+ - cmake --version
- git submodule -q update --init
before_build:
- - mkdir projects\build
- - cd projects\build
- - cmake -G"Visual Studio 12" -T"v120" -B. ..\CMake\
- - cd ..\..
+ - cmake -G"%VSVER%" .
build:
- project: projects\build\rxcpp.sln
+ project: build\rxcpp.sln
+
+test_script:
+ - build\test\Debug\rxcppv2_test.exe
notifications:
- - provider: Slack
- auth_token:
- secure: qaGjbI98VXZa7Zd2s3RmMzfA+ymrfWUDuzevdtOcHssEGBXbcoOJzLHNOmG+Y1nX
- channel: rxcpp
+ slack:
+ secure: qaGjbI98VXZa7Zd2s3RmMzfA+ymrfWUDuzevdtOcHssEGBXbcoOJzLHNOmG+Y1nX
diff --git a/projects/CMake/CMakeLists.txt b/projects/CMake/CMakeLists.txt
index 76ef1ab..254cd49 100644
--- a/projects/CMake/CMakeLists.txt
+++ b/projects/CMake/CMakeLists.txt
@@ -1,222 +1,23 @@
-cmake_minimum_required(VERSION 2.8)
-
-project(rxcpp)
-
-FIND_PACKAGE(Threads)
-
-MESSAGE( STATUS "CMAKE_CXX_COMPILER_ID: " ${CMAKE_CXX_COMPILER_ID} )
-if (CMAKE_CXX_COMPILER_ID MATCHES "Clang")
- MESSAGE( STATUS "using clang settings" )
- add_compile_options( -Wall -Wextra -Werror )
- add_compile_options( -std=c++11 -stdlib=libc++ )
- add_compile_options( -ftemplate-depth=1024 ) # sometimes you just do what the compiler tells you
-elseif (CMAKE_CXX_COMPILER_ID MATCHES "GNU")
- MESSAGE( STATUS "using gnu settings" )
- add_compile_options( -Wall -Wextra -Werror )
- add_compile_options( -std=c++11 )
-elseif (CMAKE_CXX_COMPILER_ID MATCHES "MSVC")
- MESSAGE( STATUS "using msvc settings" )
- add_compile_options( /W4 /WX )
- add_compile_options( /wd4503 ) # truncated symbol
- add_compile_options( /wd4702 ) # unreachable code
- add_compile_options( /bigobj )
- add_definitions( /DUNICODE /D_UNICODE ) # it is a new millenium
-endif()
+cmake_minimum_required(VERSION 3.2 FATAL_ERROR)
+project(rxcpp VERSION 2.2.4 LANGUAGES C CXX)
# define some folders
+
get_filename_component(RXCPP_DIR "${CMAKE_CURRENT_SOURCE_DIR}" PATH)
get_filename_component(RXCPP_DIR "${RXCPP_DIR}" PATH)
MESSAGE( STATUS "RXCPP_DIR: " ${RXCPP_DIR} )
-set(IX_SRC_DIR ${RXCPP_DIR}/Ix/CPP/src)
-set(RX_SRC_DIR ${RXCPP_DIR}/Rx/v2/src)
-
-include_directories(SYSTEM ${RXCPP_DIR}/ext/catch/include)
-include_directories(${IX_SRC_DIR} ${RX_SRC_DIR})
-
-set(TEST_DIR ${RXCPP_DIR}/Rx/v2/test)
+add_subdirectory(${RXCPP_DIR}/Rx/v2/test ${CMAKE_CURRENT_BINARY_DIR}/test)
-# define the sources of the self test
-set(TEST_SOURCES
- ${TEST_DIR}/test.cpp
- ${TEST_DIR}/subscriptions/observer.cpp
- ${TEST_DIR}/subscriptions/subscription.cpp
- ${TEST_DIR}/subjects/subject.cpp
- ${TEST_DIR}/sources/create.cpp
- ${TEST_DIR}/sources/defer.cpp
- ${TEST_DIR}/sources/interval.cpp
- ${TEST_DIR}/sources/scope.cpp
- ${TEST_DIR}/sources/timer.cpp
- ${TEST_DIR}/operators/amb.cpp
- ${TEST_DIR}/operators/amb_variadic.cpp
- ${TEST_DIR}/operators/buffer.cpp
- ${TEST_DIR}/operators/combine_latest.1.cpp
- ${TEST_DIR}/operators/combine_latest.2.cpp
- ${TEST_DIR}/operators/concat.cpp
- ${TEST_DIR}/operators/concat_map.cpp
- ${TEST_DIR}/operators/distinct_until_changed.cpp
- ${TEST_DIR}/operators/filter.cpp
- ${TEST_DIR}/operators/flat_map.cpp
- ${TEST_DIR}/operators/group_by.cpp
- ${TEST_DIR}/operators/lift.cpp
- ${TEST_DIR}/operators/map.cpp
- ${TEST_DIR}/operators/merge.cpp
- ${TEST_DIR}/operators/observe_on.cpp
- ${TEST_DIR}/operators/pairwise.cpp
- ${TEST_DIR}/operators/publish.cpp
- ${TEST_DIR}/operators/reduce.cpp
- ${TEST_DIR}/operators/repeat.cpp
- ${TEST_DIR}/operators/retry.cpp
- ${TEST_DIR}/operators/scan.cpp
- ${TEST_DIR}/operators/skip.cpp
- ${TEST_DIR}/operators/skip_until.cpp
- ${TEST_DIR}/operators/subscribe_on.cpp
- ${TEST_DIR}/operators/switch_on_next.cpp
- ${TEST_DIR}/operators/take.cpp
- ${TEST_DIR}/operators/take_until.cpp
- ${TEST_DIR}/operators/window.cpp
- ${TEST_DIR}/operators/zip.1.cpp
- ${TEST_DIR}/operators/zip.2.cpp
-)
-add_executable(rxcppv2_test ${TEST_SOURCES})
-TARGET_LINK_LIBRARIES(rxcppv2_test ${CMAKE_THREAD_LIBS_INIT})
-
-# define the sources of the self test
-set(ONE_SOURCES
- ${TEST_DIR}/test.cpp
- #${TEST_DIR}/operators/combine_latest.1.cpp
- #${TEST_DIR}/operators/combine_latest.2.cpp
-)
-add_executable(one_test ${ONE_SOURCES})
-TARGET_LINK_LIBRARIES(one_test ${CMAKE_THREAD_LIBS_INIT})
+add_subdirectory(${RXCPP_DIR}/projects/doxygen ${CMAKE_CURRENT_BINARY_DIR}/projects/doxygen)
set(EXAMPLES_DIR ${RXCPP_DIR}/Rx/v2/examples)
-# define the sources of the pythagorian example
-set(PYTHAGORIAN_SOURCES
- ${EXAMPLES_DIR}/pythagorian/main.cpp
-)
-add_executable(pythagorian ${PYTHAGORIAN_SOURCES})
-TARGET_LINK_LIBRARIES(pythagorian ${CMAKE_THREAD_LIBS_INIT})
-
-# define the sources of the println example
-set(PRINTLN_SOURCES
- ${EXAMPLES_DIR}/println/main.cpp
-)
-add_executable(println ${PRINTLN_SOURCES})
-TARGET_LINK_LIBRARIES(println ${CMAKE_THREAD_LIBS_INIT})
-
-# define the sources of the tests example
-set(TESTS_EXAMPLE_SOURCES
- ${EXAMPLES_DIR}/tests/main.cpp
- ${EXAMPLES_DIR}/tests/take.cpp
-)
-add_executable(tests_example ${TESTS_EXAMPLE_SOURCES})
-TARGET_LINK_LIBRARIES(tests_example ${CMAKE_THREAD_LIBS_INIT})
-
-# configure unit tests via CTest
-enable_testing()
-
-add_test(NAME RunTests COMMAND rxcppv2_test)
-
-add_test(NAME ListTests COMMAND rxcppv2_test --list-tests)
-set_tests_properties(ListTests PROPERTIES PASS_REGULAR_EXPRESSION "[0-9]+ test cases")
-
-add_test(NAME ListTags COMMAND rxcppv2_test --list-tags)
-set_tests_properties(ListTags PROPERTIES PASS_REGULAR_EXPRESSION "[0-9]+ tags")
-
-# target to generate documentation with Doxygen
-find_package(Doxygen)
-if(DOXYGEN_FOUND)
- # Doxygen configuration
- set(DOXY_CONF_DIR ${RXCPP_DIR}/projects/doxygen)
- set(DOXY_CONF_FILE ${DOXY_CONF_DIR}/doxygen.conf)
-
- # File with main page (index.html) content
- set(DOXY_MAIN_PAGE ${DOXY_CONF_DIR}/mainpage.dox)
-
- # Sources for processing location
- set(DOXY_INPUT_DIR "${IX_SRC_DIR} ${RX_SRC_DIR} ${DOXY_MAIN_PAGE}")
-
- # C++ examples location
- set(DOXY_EXAMPLES_SRC_DIR ${EXAMPLES_DIR}/doxygen)
- set(DOXY_EXAMPLES_BIN_DIR doxy_examples)
-
- # Directories and files allowed for include-type command (\include, \example, \snippet etc)
- set(DOXY_INCLUDE_DIR "${RXCPP_DIR} ${DOXY_EXAMPLES_SRC_DIR}")
-
- # Resulting documentation to be placed here
- set(DOXY_OUTPUT_DIR ${RXCPP_DIR}/projects/doxygen)
-
- # Make Doxygen configuration from template with placeholders
- configure_file(${DOXY_CONF_FILE}.in ${DOXY_CONF_FILE})
-
- # Target to build examples
- set(DOXY_EXAMPLE_SRC_LIST
- ${DOXY_EXAMPLES_SRC_DIR}/main.cpp
- ${DOXY_EXAMPLES_SRC_DIR}/amb.cpp
- ${DOXY_EXAMPLES_SRC_DIR}/as_dynamic.cpp
- ${DOXY_EXAMPLES_SRC_DIR}/buffer.cpp
- ${DOXY_EXAMPLES_SRC_DIR}/combine_latest.cpp
- ${DOXY_EXAMPLES_SRC_DIR}/concat.cpp
- ${DOXY_EXAMPLES_SRC_DIR}/concat_map.cpp
- ${DOXY_EXAMPLES_SRC_DIR}/create.cpp
- ${DOXY_EXAMPLES_SRC_DIR}/defer.cpp
- ${DOXY_EXAMPLES_SRC_DIR}/distinct_until_changed.cpp
- ${DOXY_EXAMPLES_SRC_DIR}/empty.cpp
- ${DOXY_EXAMPLES_SRC_DIR}/error.cpp
- ${DOXY_EXAMPLES_SRC_DIR}/filter.cpp
- ${DOXY_EXAMPLES_SRC_DIR}/finally.cpp
- ${DOXY_EXAMPLES_SRC_DIR}/flat_map.cpp
- ${DOXY_EXAMPLES_SRC_DIR}/from.cpp
- ${DOXY_EXAMPLES_SRC_DIR}/group_by.cpp
- ${DOXY_EXAMPLES_SRC_DIR}/interval.cpp
- ${DOXY_EXAMPLES_SRC_DIR}/iterate.cpp
- ${DOXY_EXAMPLES_SRC_DIR}/just.cpp
- ${DOXY_EXAMPLES_SRC_DIR}/map.cpp
- ${DOXY_EXAMPLES_SRC_DIR}/math.cpp
- ${DOXY_EXAMPLES_SRC_DIR}/merge.cpp
- ${DOXY_EXAMPLES_SRC_DIR}/never.cpp
- ${DOXY_EXAMPLES_SRC_DIR}/observe_on.cpp
- ${DOXY_EXAMPLES_SRC_DIR}/pairwise.cpp
- ${DOXY_EXAMPLES_SRC_DIR}/publish.cpp
- ${DOXY_EXAMPLES_SRC_DIR}/range.cpp
- ${DOXY_EXAMPLES_SRC_DIR}/reduce.cpp
- ${DOXY_EXAMPLES_SRC_DIR}/repeat.cpp
- ${DOXY_EXAMPLES_SRC_DIR}/retry.cpp
- ${DOXY_EXAMPLES_SRC_DIR}/scan.cpp
- ${DOXY_EXAMPLES_SRC_DIR}/scope.cpp
- ${DOXY_EXAMPLES_SRC_DIR}/skip.cpp
- ${DOXY_EXAMPLES_SRC_DIR}/skip_until.cpp
- ${DOXY_EXAMPLES_SRC_DIR}/start_with.cpp
- ${DOXY_EXAMPLES_SRC_DIR}/subscribe.cpp
- ${DOXY_EXAMPLES_SRC_DIR}/subscribe_on.cpp
- ${DOXY_EXAMPLES_SRC_DIR}/switch_on_next.cpp
- ${DOXY_EXAMPLES_SRC_DIR}/take.cpp
- ${DOXY_EXAMPLES_SRC_DIR}/take_until.cpp
- ${DOXY_EXAMPLES_SRC_DIR}/timer.cpp
- ${DOXY_EXAMPLES_SRC_DIR}/window.cpp
- ${DOXY_EXAMPLES_SRC_DIR}/zip.cpp
- )
- set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${DOXY_EXAMPLES_BIN_DIR})
- set(CMAKE_RUNTIME_OUTPUT_DIRECTORY_DEBUG ${DOXY_EXAMPLES_BIN_DIR})
- set(CMAKE_RUNTIME_OUTPUT_DIRECTORY_RELEASE ${DOXY_EXAMPLES_BIN_DIR})
- add_executable(doxy_examples EXCLUDE_FROM_ALL ${DOXY_EXAMPLE_SRC_LIST})
- TARGET_LINK_LIBRARIES(doxy_examples ${CMAKE_THREAD_LIBS_INIT})
-
- # Target to execute examples and save their output
- add_custom_command(
- OUTPUT doxy_examples_output
- COMMAND ${DOXY_EXAMPLES_BIN_DIR}/doxy_examples > ${DOXY_EXAMPLES_SRC_DIR}/output.txt
- COMMENT "Execute examples for Doxygen documentation")
-
- # Target to generate docs
- add_custom_target(doc
- COMMAND ${DOXYGEN_EXECUTABLE} ${DOXY_CONF_FILE}
- WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
- DEPENDS doxy_examples doxy_examples_output
- COMMENT "Generating documentation with Doxygen"
- VERBATIM)
-endif()
+add_subdirectory(${EXAMPLES_DIR}/cep ${CMAKE_CURRENT_BINARY_DIR}/examples/cep)
+add_subdirectory(${EXAMPLES_DIR}/stop ${CMAKE_CURRENT_BINARY_DIR}/examples/stop)
+add_subdirectory(${EXAMPLES_DIR}/println ${CMAKE_CURRENT_BINARY_DIR}/examples/println)
+add_subdirectory(${EXAMPLES_DIR}/pythagorian ${CMAKE_CURRENT_BINARY_DIR}/examples/pythagorian)
+add_subdirectory(${EXAMPLES_DIR}/tests ${CMAKE_CURRENT_BINARY_DIR}/examples/tests)
+add_subdirectory(${EXAMPLES_DIR}/doxygen ${CMAKE_CURRENT_BINARY_DIR}/examples/doxygen)
diff --git a/projects/CMake/shared.cmake b/projects/CMake/shared.cmake
new file mode 100644
index 0000000..c29bdcb
--- /dev/null
+++ b/projects/CMake/shared.cmake
@@ -0,0 +1,47 @@
+FIND_PACKAGE(Threads)
+
+# define some compiler settings
+
+MESSAGE( STATUS "CMAKE_CXX_COMPILER_ID: " ${CMAKE_CXX_COMPILER_ID} )
+
+if (CMAKE_CXX_COMPILER_ID MATCHES "Clang")
+ MESSAGE( STATUS "using clang settings" )
+ set(RX_COMPILE_OPTIONS
+ -Wall -Wextra -Werror -Wunused
+ -stdlib=libc++
+ -ftemplate-depth=1024
+ )
+elseif (CMAKE_CXX_COMPILER_ID MATCHES "GNU")
+ MESSAGE( STATUS "using gnu settings" )
+ set(RX_COMPILE_OPTIONS
+ -Wall -Wextra -Werror -Wunused
+ )
+elseif (CMAKE_CXX_COMPILER_ID MATCHES "MSVC")
+ MESSAGE( STATUS "using msvc settings" )
+ set(RX_COMPILE_OPTIONS
+ /W4 /WX
+ /wd4503 # truncated symbol
+ /wd4702 # unreachable code
+ /bigobj
+ /DUNICODE /D_UNICODE # it is a new millenium
+ )
+endif()
+
+set(RX_COMPILE_FEATURES
+ cxx_auto_type
+ cxx_nullptr
+ cxx_decltype
+ cxx_lambdas
+ cxx_range_for
+ cxx_right_angle_brackets
+ cxx_rvalue_references
+ cxx_static_assert
+ cxx_trailing_return_types
+ cxx_alias_templates
+ cxx_variadic_templates
+ cxx_template_template_parameters
+ )
+
+set(IX_SRC_DIR ${RXCPP_DIR}/Ix/CPP/src)
+set(RX_SRC_DIR ${RXCPP_DIR}/Rx/v2/src)
+set(RX_CATCH_DIR ${RXCPP_DIR}/ext/catch/include)
diff --git a/projects/doxygen/CMakeLists.txt b/projects/doxygen/CMakeLists.txt
new file mode 100644
index 0000000..b5a0113
--- /dev/null
+++ b/projects/doxygen/CMakeLists.txt
@@ -0,0 +1,114 @@
+cmake_minimum_required(VERSION 3.2 FATAL_ERROR)
+
+project(doxygen LANGUAGES C CXX)
+
+# define some folders
+
+get_filename_component(RXCPP_DIR "${CMAKE_CURRENT_SOURCE_DIR}" PATH)
+get_filename_component(RXCPP_DIR "${RXCPP_DIR}" PATH)
+
+MESSAGE( STATUS "RXCPP_DIR: " ${RXCPP_DIR} )
+
+# target to generate documentation with Doxygen
+find_package(Doxygen)
+
+if(DOXYGEN_FOUND)
+ include(${RXCPP_DIR}/projects/CMake/shared.cmake)
+ set(EXAMPLES_DIR ${RXCPP_DIR}/Rx/v2/examples)
+
+ # Doxygen configuration
+ set(DOXY_CONF_DIR ${RXCPP_DIR}/projects/doxygen)
+ set(DOXY_CONF_FILE ${DOXY_CONF_DIR}/doxygen.conf)
+
+ # File with main page (index.html) content
+ set(DOXY_MAIN_PAGE ${DOXY_CONF_DIR}/mainpage.dox)
+
+ # Sources for processing location
+ set(DOXY_INPUT_DIR "${IX_SRC_DIR} ${RX_SRC_DIR} ${DOXY_MAIN_PAGE}")
+
+ # C++ examples location
+ set(DOXY_EXAMPLES_SRC_DIR ${EXAMPLES_DIR}/doxygen)
+ set(DOXY_EXAMPLES_BIN_DIR doxy_examples)
+
+ # Directories and files allowed for include-type command (\include, \example, \snippet etc)
+ set(DOXY_INCLUDE_DIR "${RXCPP_DIR} ${DOXY_EXAMPLES_SRC_DIR}")
+
+ # Resulting documentation to be placed here
+ set(DOXY_OUTPUT_DIR ${RXCPP_DIR}/projects/doxygen)
+
+ # Make Doxygen configuration from template with placeholders
+ configure_file(${DOXY_CONF_FILE}.in ${DOXY_CONF_FILE})
+
+ # Target to build examples
+ set(DOXY_EXAMPLE_SRC_LIST
+ ${DOXY_EXAMPLES_SRC_DIR}/main.cpp
+ ${DOXY_EXAMPLES_SRC_DIR}/amb.cpp
+ ${DOXY_EXAMPLES_SRC_DIR}/as_dynamic.cpp
+ ${DOXY_EXAMPLES_SRC_DIR}/buffer.cpp
+ ${DOXY_EXAMPLES_SRC_DIR}/combine_latest.cpp
+ ${DOXY_EXAMPLES_SRC_DIR}/concat.cpp
+ ${DOXY_EXAMPLES_SRC_DIR}/concat_map.cpp
+ ${DOXY_EXAMPLES_SRC_DIR}/create.cpp
+ ${DOXY_EXAMPLES_SRC_DIR}/defer.cpp
+ ${DOXY_EXAMPLES_SRC_DIR}/distinct_until_changed.cpp
+ ${DOXY_EXAMPLES_SRC_DIR}/empty.cpp
+ ${DOXY_EXAMPLES_SRC_DIR}/error.cpp
+ ${DOXY_EXAMPLES_SRC_DIR}/filter.cpp
+ ${DOXY_EXAMPLES_SRC_DIR}/finally.cpp
+ ${DOXY_EXAMPLES_SRC_DIR}/flat_map.cpp
+ ${DOXY_EXAMPLES_SRC_DIR}/from.cpp
+ ${DOXY_EXAMPLES_SRC_DIR}/group_by.cpp
+ ${DOXY_EXAMPLES_SRC_DIR}/interval.cpp
+ ${DOXY_EXAMPLES_SRC_DIR}/iterate.cpp
+ ${DOXY_EXAMPLES_SRC_DIR}/just.cpp
+ ${DOXY_EXAMPLES_SRC_DIR}/map.cpp
+ ${DOXY_EXAMPLES_SRC_DIR}/math.cpp
+ ${DOXY_EXAMPLES_SRC_DIR}/merge.cpp
+ ${DOXY_EXAMPLES_SRC_DIR}/never.cpp
+ ${DOXY_EXAMPLES_SRC_DIR}/observe_on.cpp
+ ${DOXY_EXAMPLES_SRC_DIR}/pairwise.cpp
+ ${DOXY_EXAMPLES_SRC_DIR}/publish.cpp
+ ${DOXY_EXAMPLES_SRC_DIR}/range.cpp
+ ${DOXY_EXAMPLES_SRC_DIR}/reduce.cpp
+ ${DOXY_EXAMPLES_SRC_DIR}/repeat.cpp
+ ${DOXY_EXAMPLES_SRC_DIR}/retry.cpp
+ ${DOXY_EXAMPLES_SRC_DIR}/scan.cpp
+ ${DOXY_EXAMPLES_SRC_DIR}/scope.cpp
+ ${DOXY_EXAMPLES_SRC_DIR}/skip.cpp
+ ${DOXY_EXAMPLES_SRC_DIR}/skip_until.cpp
+ ${DOXY_EXAMPLES_SRC_DIR}/start_with.cpp
+ ${DOXY_EXAMPLES_SRC_DIR}/subscribe.cpp
+ ${DOXY_EXAMPLES_SRC_DIR}/subscribe_on.cpp
+ ${DOXY_EXAMPLES_SRC_DIR}/switch_on_next.cpp
+ ${DOXY_EXAMPLES_SRC_DIR}/take.cpp
+ ${DOXY_EXAMPLES_SRC_DIR}/take_until.cpp
+ ${DOXY_EXAMPLES_SRC_DIR}/timer.cpp
+ ${DOXY_EXAMPLES_SRC_DIR}/window.cpp
+ ${DOXY_EXAMPLES_SRC_DIR}/zip.cpp
+ )
+ set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${DOXY_EXAMPLES_BIN_DIR})
+ set(CMAKE_RUNTIME_OUTPUT_DIRECTORY_DEBUG ${DOXY_EXAMPLES_BIN_DIR})
+ set(CMAKE_RUNTIME_OUTPUT_DIRECTORY_RELEASE ${DOXY_EXAMPLES_BIN_DIR})
+ add_executable(doxy_examples EXCLUDE_FROM_ALL ${DOXY_EXAMPLE_SRC_LIST})
+ add_executable(rxcpp::doxygen::examples ALIAS doxy_examples)
+ target_compile_options(doxy_examples PUBLIC ${RX_COMPILE_OPTIONS})
+ target_compile_features(doxy_examples PUBLIC ${RX_COMPILE_FEATURES})
+ target_include_directories(doxy_examples
+ PUBLIC ${RX_SRC_DIR} ${RX_CATCH_DIR}
+ )
+ target_link_libraries(doxy_examples PRIVATE ${CMAKE_THREAD_LIBS_INIT})
+
+ # Target to execute examples and save their output
+ add_custom_command(
+ OUTPUT doxy_examples_output
+ COMMAND ${DOXY_EXAMPLES_BIN_DIR}/doxy_examples > ${DOXY_EXAMPLES_SRC_DIR}/output.txt
+ COMMENT "Execute examples for Doxygen documentation")
+
+ # Target to generate docs
+ add_custom_target(doc
+ COMMAND ${DOXYGEN_EXECUTABLE} ${DOXY_CONF_FILE}
+ WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
+ DEPENDS doxy_examples doxy_examples_output
+ COMMENT "Generating documentation with Doxygen"
+ VERBATIM)
+endif()
diff --git a/projects/scripts/install_libcxx.sh b/projects/scripts/install_libcxx.sh
new file mode 100644
index 0000000..b82e83b
--- /dev/null
+++ b/projects/scripts/install_libcxx.sh
@@ -0,0 +1,12 @@
+#!/bin/bash
+#
+# Install libc++ under travis
+
+svn --quiet co http://llvm.org/svn/llvm-project/libcxx/trunk libcxx
+mkdir libcxx/build
+(cd libcxx/build && cmake .. -DLIBCXX_CXX_ABI=libstdc++ -DLIBCXX_CXX_ABI_INCLUDE_PATHS="/usr/include/c++/4.6;/usr/include/c++/4.6/x86_64-linux-gnu")
+make -C libcxx/build cxx -j2
+sudo cp libcxx/build/lib/libc++.so.1.0 /usr/lib/
+sudo cp -r libcxx/build/include/c++/v1 /usr/include/c++/v1/
+sudo ln -sf /usr/lib/libc++.so.1.0 /usr/lib/libc++.so
+sudo ln -sf /usr/lib/libc++.so.1.0 /usr/lib/libc++.so.1 \ No newline at end of file
diff --git a/projects/scripts/travis-install.sh b/projects/scripts/travis-install.sh
index 8dc46e1..683c126 100755
--- a/projects/scripts/travis-install.sh
+++ b/projects/scripts/travis-install.sh
@@ -2,44 +2,31 @@
set -e
+echo "TRAVIS_OS_NAME=$TRAVIS_OS_NAME"
+
#if OS is linux or is not set
if [ "$TRAVIS_OS_NAME" = linux -o -z "$TRAVIS_OS_NAME" ]; then
-# wget -O - http://llvm.org/apt/llvm-snapshot.gpg.key|sudo apt-key add -
-# sudo add-apt-repository -y 'deb http://llvm.org/apt/trusty/ llvm-toolchain-trusty main'
-# sudo add-apt-repository -y "deb http://us.archive.ubuntu.com/ubuntu/ trusty main universe"
- sudo add-apt-repository -y ppa:ubuntu-toolchain-r/test
- sudo apt-get clean -qq || echo "ignore clean failure"
- sudo apt-get update -qq || echo "ignore update failure"
-
- wget http://www.cmake.org/files/v3.1/cmake-3.1.3-Linux-x86_64.sh
- chmod a+x cmake-3.1.3-Linux-x86_64.sh
- sudo ./cmake-3.1.3-Linux-x86_64.sh --skip-license --prefix=/usr/local
- export PATH=/usr/local/bin:$PATH
- cmake --version
-
- if [ "$CC" = gcc ]; then
- sudo apt-get install -qq --allow-unauthenticated --force-yes --fix-missing gcc-4.8 g++-4.8 || echo "ignore install failure"
-
- sudo update-alternatives --remove-all gcc || echo "ignore remove failure"
- sudo update-alternatives --remove-all g++ || echo "ignore remove failure"
-
- sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-4.8 20
- sudo update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-4.8 20
+ echo "installing for linux..."
- sudo update-alternatives --config gcc
- sudo update-alternatives --config g++
+ wget http://www.cmake.org/files/v3.2/cmake-3.2.3-Linux-x86_64.sh
+ chmod a+x cmake-3.2.3-Linux-x86_64.sh
+ sudo ./cmake-3.2.3-Linux-x86_64.sh --skip-license --prefix=/usr/local
+ export PATH=/usr/local/bin:$PATH
- g++ --version
-
- sudo apt-get install --allow-unauthenticated --force-yes --fix-missing doxygen
- sudo apt-get install --allow-unauthenticated --force-yes --fix-missing graphviz
- doxygen --version
- dot -V
- fi
+ cmake --version
elif [ "$TRAVIS_OS_NAME" = osx ]; then
+ echo "installing for osx..."
+
xcode-select --install
brew update || echo "suppress failures in order to ignore warnings"
brew doctor || echo "suppress failures in order to ignore warnings"
- brew list cmake || brew install cmake || echo "suppress failures in order to ignore warnings"
+ brew list cmake || echo "suppress failures in order to ignore warnings"
+ sudo brew uninstall --force cmake || "suppress failures in order to ignore warnings"
+ brew search cmake || echo "suppress failures in order to ignore warnings"
+ brew install cmake || echo "suppress failures in order to ignore warnings"
+ brew upgrade cmake || echo "suppress failures in order to ignore warnings"
+
+ cmake --version
fi
+