diff --git a/.astylerc b/.astylerc new file mode 100644 index 0000000..ded2a30 --- /dev/null +++ b/.astylerc @@ -0,0 +1,19 @@ +--convert-tabs # 4.2 +--indent=spaces=2 # 4.2 +--indent-namespaces +--style=break # 4.3.1 +--indent-cases # 4.3.2 +--pad-comma # 4.5.1 +--pad-header # 4.5.5 +--pad-oper # 4.5.6 +--align-pointer=type # 4.5.7 +--align-reference=type # 4.5.7 +--indent-col1-comments +--mode=c +# --indent-preproc-block +# --delete-empty-lines +# --remove-braces +# --attach-return-type +# --close-templates +# --max-code-length=80 +# --break-after-logical \ No newline at end of file diff --git a/.gitignore b/.gitignore index e68ec28..e9558d2 100644 --- a/.gitignore +++ b/.gitignore @@ -1,5 +1,8 @@ *.dat .idea/ +*build*/ +*logs*/ *.swp +.DS_Store *build*/ *install*/ diff --git a/.gitmodules b/.gitmodules index 3db41bd..a80f7a9 100644 --- a/.gitmodules +++ b/.gitmodules @@ -1,9 +1,3 @@ -[submodule "vendor/curl"] - path = vendor/curl - url = https://github.com/curl/curl.git -[submodule "vendor/pugixml"] - path = vendor/pugixml - url = https://github.com/zeux/pugixml.git -[submodule "vendor/openssl"] - path = vendor/openssl - url = https://github.com/openssl/openssl +[submodule "tools/polly"] + path = tools/polly + url = https://github.com/ruslo/polly diff --git a/.travis.yml b/.travis.yml index c404f71..6b6e7b6 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,37 +1,51 @@ language: generic -cache: ccache dist: trusty - +sudo: required +git: + depth: 1 + submodules: true addons: - apt: - packages: - - ccache - - clang-3.6 - - gcc-5 - sources: - - llvm-toolchain-trusty-3.6 - - ubuntu-toolchain-r-test - + apt: + packages: + - clang-3.6 + - gcc-5 + sources: + - llvm-toolchain-trusty-3.6 + - ubuntu-toolchain-r-test matrix: - include: - - os: linux - compiler: gcc-5 - env: COMPILER="g++-5" - - os: linux - compiler: clang-3.6 - env: COMPILER="clang++-3.6" - - os: osx - compiler: gcc-5 - env: COMPILER="g++-5" - - os: osx - compiler: clang-3.6 - env: COMPILER="clang++-3.6" - + include: + - os: linux + compiler: gcc-5 + env: COMPILER="g++-5" BUILD_TYPE=Debug + - os: linux + compiler: clang-3.6 + env: COMPILER="clang++-3.6" BUILD_TYPE=Debug + - os: osx + compiler: clang-3.6 + env: COMPILER="clang++-3.6" BUILD_TYPE=Debug + - os: linux + compiler: gcc-5 + addons: + apt: + packages: + - lcov + env: COMPILER="g++-5" BUILD_TYPE=Coverage +install: +- if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then wget https://cmake.org/files/v3.9/cmake-3.9.0-Linux-x86_64.tar.gz; + sudo tar -xf cmake-3.9.0-Linux-x86_64.tar.gz -C /usr/local/ --strip-components=1; + fi +- if [ "${BUILD_TYPE}" == "Coverage" -a "${TRAVIS_OS_NAME}" == "linux" ]; then PATH=~/.local/bin:${PATH}; + pip install --user --upgrade pip; pip install --user cpp-coveralls; fi +cache: + directories: + - "$HOME/.hunter" script: -- cmake -H. -B_builds -DBUILD_TESTS=ON -DCMAKE_INSTALL_PREFIX=install +- cmake -H. -B_builds -DBUILD_TESTS=ON -DCMAKE_INSTALL_PREFIX=install -DCMAKE_BUILD_TYPE=${BUILD_TYPE} - cmake --build _builds -- cmake --build _builds --target test -- ARGS=--verbose -- cmake --build _builds --target install - +- cmake --build _builds --target test -- ARGS="--verbose -C=${BUILD_TYPE}" after_success: - - bash <(curl -s https://codecov.io/bash) +- if [ "${BUILD_TYPE}" == "Coverage" -a "${TRAVIS_OS_NAME}" == "linux" ]; then coveralls + --include sources --include include --gcov-options '\-lp' --root . --build-root + _builds; fi +env: + secure: RTTk3A2/YE3onv4sdwI+UyNE2LwY+WI3GqEzODlJZHEUwDEU+qXLMXUIMP+XcO6Rd9rZ2J7vLf8aq9fajbMxxt9fNqiO42DprywLetGDtg+FhPQPD6hRrT8oQm5k9ss8gJqmC3u+QsmflmSsfv4MzBiHc6gunKw0sv1tWck+CTQ= diff --git a/BUGS.md b/BUGS.md deleted file mode 100644 index 8b13789..0000000 --- a/BUGS.md +++ /dev/null @@ -1 +0,0 @@ - diff --git a/CMakeLists.txt b/CMakeLists.txt index 6f50add..eda3bde 100755 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -2,14 +2,14 @@ # __ __ _____ _____ # Project | | | | | \ / ___| # | |__| | | |\ \ / / -# | | | | ) ) ( ( +# | | | | ) ) ( ( # | /\ | | |/ / \ \___ # \_/ \_/ |_____/ \_____| # -# Copyright (C) 2016, The WDC Project, , et al. +# Copyright (C) 2018, The WDC Project, , et al. # # This software is licensed as described in the file LICENSE, which -# you should have received as part of this distribution. +# you should have received as part of this distribution. # # You may opt to use, copy, modify, merge, publish, distribute and/or sell # copies of the Software, and permit persons to whom the Software is @@ -20,68 +20,140 @@ # ############################################################################ -cmake_minimum_required(VERSION 3.1) +cmake_minimum_required(VERSION 3.4) include("cmake/HunterGate.cmake") -HunterGate( - URL "https://github.com/designerror/hunter/archive/v0.18.14.23.tar.gz" - SHA1 "4ba5c303245faed28548d4a47f496cf645cf67ed" +huntergate( + URL "https://github.com/ruslo/hunter/archive/v0.23.83.tar.gz" + SHA1 "12dec078717539eb7b03e6d2a17797cba9be9ba9" ) -project(wdc) - set(WDC_VERSION_MAJOR 1) -set(WDC_VERSION_MINOR 0) -set(WDC_VERSION_PATCH 2) +set(WDC_VERSION_MINOR 1) +set(WDC_VERSION_PATCH 5) +set(WDC_VERSION_TWEAK 1) set(WDC_VERSION ${WDC_VERSION_MAJOR}.${WDC_VERSION_MINOR}.${WDC_VERSION_PATCH}) +project(WDC VERSION ${WDC_VERSION}) + set(CMAKE_CXX_STANDARD 11) set(CMAKE_CXX_STANDARD_REQUIRED ON) -set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fPIC") option(BUILD_TESTS "Build tests" OFF) -option(BUILD_PKGCONFIG "Build in PKGCONFIG mode" OFF) +option(BUILD_EXAMPLES "Build Examples" OFF) +option(WDC_VERBOSE "Print verbose information" OFF) +hunter_add_package(Boost) hunter_add_package(OpenSSL) hunter_add_package(CURL) hunter_add_package(pugixml) +find_package(Boost CONFIG REQUIRED) find_package(OpenSSL REQUIRED) find_package(CURL CONFIG REQUIRED) find_package(pugixml CONFIG REQUIRED) -file(GLOB ${PROJECT_NAME}_SOURCES "${CMAKE_CURRENT_SOURCE_DIR}/sources/*.cpp") -include_directories(${CMAKE_CURRENT_SOURCE_DIR}/include/) +file(GLOB WDC_SOURCES "${CMAKE_CURRENT_SOURCE_DIR}/sources/*.cpp") -add_library(${PROJECT_NAME} ${${PROJECT_NAME}_SOURCES}) +add_library(libwdc ${${PROJECT_NAME}_SOURCES}) +set_target_properties(libwdc PROPERTIES PREFIX "") +set_target_properties(libwdc PROPERTIES IMPORT_PREFIX "") +if(WDC_VERBOSE) + target_compile_definitions(libwdc PUBLIC WDC_VERBOSE=1) +endif() -target_link_libraries(${PROJECT_NAME} OpenSSL::SSL OpenSSL::Crypto CURL::libcurl pugixml) +target_link_libraries(libwdc + PUBLIC OpenSSL::SSL OpenSSL::Crypto CURL::libcurl pugixml +) -target_include_directories(${PROJECT_NAME} PUBLIC +target_include_directories(libwdc + PRIVATE $ +) +target_include_directories(libwdc PUBLIC $ $ ) -install(TARGETS ${PROJECT_NAME} - EXPORT ${PROJECT_NAME}-config - RUNTIME DESTINATION bin - ARCHIVE DESTINATION lib - LIBRARY DESTINATION lib +set(GENERATED_DIR "${CMAKE_CURRENT_BINARY_DIR}/generated") + +set(CONFIG_INSTALL_DIR "lib/cmake/${PROJECT_NAME}") +set(INCLUDE_INSTALL_DIR "include") + +set(VERSION_CONFIG "${GENERATED_DIR}/${PROJECT_NAME}ConfigVersion.cmake") +set(PROJECT_CONFIG "${GENERATED_DIR}/${PROJECT_NAME}Config.cmake") +set(TARGETS_EXPORT_NAME "${PROJECT_NAME}Targets") +set(NAMESPACE "${PROJECT_NAME}::") + +include(CMakePackageConfigHelpers) +write_basic_package_version_file( + "${VERSION_CONFIG}" COMPATIBILITY SameMajorVersion +) + +configure_package_config_file( + "${PROJECT_SOURCE_DIR}/cmake/Config.cmake.in" + "${PROJECT_CONFIG}" + INSTALL_DESTINATION "${CONFIG_INSTALL_DIR}" +) + +install(TARGETS libwdc + EXPORT "${TARGETS_EXPORT_NAME}" + RUNTIME DESTINATION bin + ARCHIVE DESTINATION lib + LIBRARY DESTINATION lib ) + install(DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/include/ DESTINATION include) -install(EXPORT ${PROJECT_NAME}-config DESTINATION cmake) -if(BUILD_PKGCONFIG) - configure_file(scripts/wdc.pc.in ${PROJECT_BINARY_DIR}/wdc.pc @ONLY) - install(FILES ${PROJECT_BINARY_DIR}/wdc.pc DESTINATION ${CMAKE_INSTALL_PREFIX}/lib/pkgconfig) -endif() +install( + FILES "${PROJECT_CONFIG}" "${VERSION_CONFIG}" + DESTINATION "${CONFIG_INSTALL_DIR}" +) + +install(EXPORT "${TARGETS_EXPORT_NAME}" + NAMESPACE "${NAMESPACE}" + DESTINATION "${CONFIG_INSTALL_DIR}" +) if(BUILD_TESTS) - enable_testing() - file(GLOB ${PROJECT_NAME}_TEST_SOURCES tests/*.cpp) - add_executable(check ${${PROJECT_NAME}_TEST_SOURCES}) - target_link_libraries(check ${PROJECT_NAME} ${DEPENDS_LIBRARIES}) - add_test(NAME check COMMAND check "-s" "-r" "compact" "--use-colour" "yes") + hunter_add_package(Boost COMPONENTS system filesystem) + find_package(Boost CONFIG REQUIRED system filesystem) + hunter_add_package(Catch) + find_package(Catch2 CONFIG REQUIRED) + + enable_testing() + + file(GLOB ${PROJECT_NAME}_TEST_SOURCES tests/*.cpp) + add_executable(check ${${PROJECT_NAME}_TEST_SOURCES}) + target_link_libraries(check libwdc Catch2::Catch Boost::filesystem Boost::system) + + if(${CMAKE_BUILD_TYPE} MATCHES "Coverage") + set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_CURRENT_SOURCE_DIR}/cmake/") + include(CodeCoverage) + + set(CMAKE_CXX_FLAGS "-g -O0 -Wall -fprofile-arcs -ftest-coverage") + set(LCOV_REMOVE_EXTRA "'tests/*'") + add_executable(unit_tests ${${PROJECT_NAME}_SOURCES} ${${PROJECT_NAME}_TEST_SOURCES}) + target_link_libraries(unit_tests Catch2::Catch Boost::filesystem Boost::system libwdc OpenSSL::SSL OpenSSL::Crypto CURL::libcurl pugixml) + + setup_target_for_coverage(unit_tests_coverage unit_tests coverage) + else() + add_test(NAME unit_tests COMMAND check "-s" "-r" "compact" "--use-colour" "yes") + endif() + +endif() + +if(BUILD_EXAMPLES) + file(GLOB EXAMPLE_SOURCES "${CMAKE_CURRENT_SOURCE_DIR}/examples/*/*.cpp") + foreach(EXAMPLE_SOURCE ${EXAMPLE_SOURCES}) + get_filename_component(EXAMPLE_NAME ${EXAMPLE_SOURCE} NAME_WE) + set(EXAMPLE_TARGET_NAME example_${EXAMPLE_NAME}) + add_executable(${EXAMPLE_TARGET_NAME} ${EXAMPLE_SOURCE}) + target_link_libraries(${EXAMPLE_TARGET_NAME} libwdc) + set_target_properties(${EXAMPLE_TARGET_NAME} PROPERTIES OUTPUT_NAME ${EXAMPLE_NAME}) + install(TARGETS ${EXAMPLE_TARGET_NAME} + RUNTIME DESTINATION bin + ) + endforeach(EXAMPLE_SOURCE ${EXAMPLE_SOURCES}) endif() include(CPackConfig.cmake) diff --git a/ChangeLog.md b/ChangeLog.md index 641c505..93fbdf2 100644 --- a/ChangeLog.md +++ b/ChangeLog.md @@ -1,5 +1,110 @@ - * Tue Nov 8 2016 Changes between 1.0.1 and 1.0.0 - - Added ability to work with resources that take place in his name. - - Replaced deprecated curl_escape function to curl_easy_escape. - - Moved the release of resources to the method WebDAV::Client::Cleanup -``` +# Change Log + +## [v1.0.5](https://github.com/CloudPolis/webdav-client-cpp/tree/v1.0.5) (2017-07-26) +[Full Changelog](https://github.com/CloudPolis/webdav-client-cpp/compare/v1.0.4...v1.0.5) + +**Implemented enhancements:** + +- change webdav\_login to webdav\_username [\#27](https://github.com/CloudPolis/webdav-client-cpp/issues/27) + +## [v1.0.4](https://github.com/CloudPolis/webdav-client-cpp/tree/v1.0.4) (2017-07-26) +[Full Changelog](https://github.com/CloudPolis/webdav-client-cpp/compare/v1.0.3...v1.0.4) + +**Implemented enhancements:** + +- change webdav servers [\#26](https://github.com/CloudPolis/webdav-client-cpp/issues/26) +- Adding verbose flag [\#25](https://github.com/CloudPolis/webdav-client-cpp/issues/25) + +## [v1.0.3](https://github.com/CloudPolis/webdav-client-cpp/tree/v1.0.3) (2017-07-24) +[Full Changelog](https://github.com/CloudPolis/webdav-client-cpp/compare/v1.0.2...v1.0.3) + +**Implemented enhancements:** + +- Update CMakeLists.txt [\#24](https://github.com/CloudPolis/webdav-client-cpp/pull/24) ([designerror](https://github.com/designerror)) + +**Fixed bugs:** + +- Handling of XML namespaces in PROPFIND responds [\#17](https://github.com/CloudPolis/webdav-client-cpp/issues/17) + +**Closed issues:** + +- resource\_pah and target\_path differs in ::info when URL has subdirectory [\#18](https://github.com/CloudPolis/webdav-client-cpp/issues/18) + +**Merged pull requests:** + +- fixed \#18 [\#23](https://github.com/CloudPolis/webdav-client-cpp/pull/23) ([rusdevops](https://github.com/rusdevops)) +- fixed \#17 [\#21](https://github.com/CloudPolis/webdav-client-cpp/pull/21) ([designerror](https://github.com/designerror)) + +## [v1.0.2](https://github.com/CloudPolis/webdav-client-cpp/tree/v1.0.2) (2017-07-23) +[Full Changelog](https://github.com/CloudPolis/webdav-client-cpp/compare/v1.0.1-hunter-p1...v1.0.2) + +**Fixed bugs:** + +- ::list returns the name of the root directory [\#19](https://github.com/CloudPolis/webdav-client-cpp/issues/19) + +**Merged pull requests:** + +- fixed \#19 [\#20](https://github.com/CloudPolis/webdav-client-cpp/pull/20) ([designerror](https://github.com/designerror)) + +## [v1.0.1-hunter-p1](https://github.com/CloudPolis/webdav-client-cpp/tree/v1.0.1-hunter-p1) (2017-03-20) +[Full Changelog](https://github.com/CloudPolis/webdav-client-cpp/compare/v1.0.1-hunter...v1.0.1-hunter-p1) + +## [v1.0.1-hunter](https://github.com/CloudPolis/webdav-client-cpp/tree/v1.0.1-hunter) (2017-03-17) +[Full Changelog](https://github.com/CloudPolis/webdav-client-cpp/compare/v1.0.1...v1.0.1-hunter) + +## [v1.0.1](https://github.com/CloudPolis/webdav-client-cpp/tree/v1.0.1) (2016-11-08) +[Full Changelog](https://github.com/CloudPolis/webdav-client-cpp/compare/v1.0.0...v1.0.1) + +**Merged pull requests:** + +- Update client.hpp [\#15](https://github.com/CloudPolis/webdav-client-cpp/pull/15) ([designerror](https://github.com/designerror)) + +## [v1.0.0](https://github.com/CloudPolis/webdav-client-cpp/tree/v1.0.0) (2016-10-22) +[Full Changelog](https://github.com/CloudPolis/webdav-client-cpp/compare/v0.9.9...v1.0.0) + +**Merged pull requests:** + +- Update .travis.yml [\#14](https://github.com/CloudPolis/webdav-client-cpp/pull/14) ([designerror](https://github.com/designerror)) +- ifndef/define xxx\_H and final/or\_virt\_destructor [\#13](https://github.com/CloudPolis/webdav-client-cpp/pull/13) ([x10mind](https://github.com/x10mind)) +- Update build\_requirements.unix.sh [\#10](https://github.com/CloudPolis/webdav-client-cpp/pull/10) ([designerror](https://github.com/designerror)) +- Update .travis.yml [\#9](https://github.com/CloudPolis/webdav-client-cpp/pull/9) ([designerror](https://github.com/designerror)) +- Update README.md [\#8](https://github.com/CloudPolis/webdav-client-cpp/pull/8) ([designerror](https://github.com/designerror)) +- fix some bugs for building on macOS [\#7](https://github.com/CloudPolis/webdav-client-cpp/pull/7) ([x10mind](https://github.com/x10mind)) +- Update README.md [\#6](https://github.com/CloudPolis/webdav-client-cpp/pull/6) ([x10mind](https://github.com/x10mind)) + +## [v0.9.9](https://github.com/CloudPolis/webdav-client-cpp/tree/v0.9.9) (2016-10-14) +[Full Changelog](https://github.com/CloudPolis/webdav-client-cpp/compare/v0.9.8...v0.9.9) + +**Merged pull requests:** + +- Update .travis.yml [\#4](https://github.com/CloudPolis/webdav-client-cpp/pull/4) ([x10mind](https://github.com/x10mind)) + +## [v0.9.8](https://github.com/CloudPolis/webdav-client-cpp/tree/v0.9.8) (2016-10-12) +[Full Changelog](https://github.com/CloudPolis/webdav-client-cpp/compare/v0.9.7...v0.9.8) + +## [v0.9.7](https://github.com/CloudPolis/webdav-client-cpp/tree/v0.9.7) (2016-10-12) +[Full Changelog](https://github.com/CloudPolis/webdav-client-cpp/compare/v0.9.6...v0.9.7) + +## [v0.9.6](https://github.com/CloudPolis/webdav-client-cpp/tree/v0.9.6) (2016-10-11) +[Full Changelog](https://github.com/CloudPolis/webdav-client-cpp/compare/v0.9.5...v0.9.6) + +**Closed issues:** + +- bug [\#2](https://github.com/CloudPolis/webdav-client-cpp/issues/2) + +## [v0.9.5](https://github.com/CloudPolis/webdav-client-cpp/tree/v0.9.5) (2016-04-06) +[Full Changelog](https://github.com/CloudPolis/webdav-client-cpp/compare/v0.9.4...v0.9.5) + +## [v0.9.4](https://github.com/CloudPolis/webdav-client-cpp/tree/v0.9.4) (2016-04-06) +[Full Changelog](https://github.com/CloudPolis/webdav-client-cpp/compare/v0.9.3...v0.9.4) + +## [v0.9.3](https://github.com/CloudPolis/webdav-client-cpp/tree/v0.9.3) (2016-04-05) +[Full Changelog](https://github.com/CloudPolis/webdav-client-cpp/compare/v0.9.2...v0.9.3) + +## [v0.9.2](https://github.com/CloudPolis/webdav-client-cpp/tree/v0.9.2) (2016-04-05) +[Full Changelog](https://github.com/CloudPolis/webdav-client-cpp/compare/v0.9.1...v0.9.2) + +## [v0.9.1](https://github.com/CloudPolis/webdav-client-cpp/tree/v0.9.1) (2015-07-15) + + +\* *This Change Log was automatically generated by [github_changelog_generator](https://github.com/skywinder/Github-Changelog-Generator)* \ No newline at end of file diff --git a/INSTALL.UNIX.md b/INSTALL.UNIX.md deleted file mode 100644 index 686f31b..0000000 --- a/INSTALL.UNIX.md +++ /dev/null @@ -1,52 +0,0 @@ - - [ ] 1. Install `OpenSSL@1.0.2g` -```bash -$ echo "Install OpenSSL@1.0.2g" -$ wget https://github.com/openssl/openssl/archive/OpenSSL_1_0_2g.tar.gz -O OpenSSL_1_0_2g.tar.gz -$ tar -xf OpenSSL_1_0_2g.tar.gz && cd openssl-OpenSSL_1_0_2g -$ ./config -$ make && sudo make install -$ cd .. && rm -rf openssl-OpenSSL_1_0_2g && rm -f OpenSSL_1_0_2g.tar.gz -``` - - - [ ] 2. Install `CURL@7.4.8` -```bash -$ echo "Install CURL@7.4.8" -$ wget https://github.com/curl/curl/archive/curl-7_48_0.tar.gz -O curl-7_48_0.tar.gz -$ tar -xf curl-7_48_0.tar.gz && cd curl-curl-7_48_0 -$ mkdir build && cd build -$ cmake .. -$ make && sudo make install -$ cd ../.. && rm -rf curl-curl-7_48_0 && rm -f curl-7_48_0.tar.gz -``` - - - [ ] 3. Install `pugixml@1.7.0` -```bash -$ echo "Install pugixml@1.7.0" -$ wget https://github.com/zeux/pugixml/releases/download/v1.7/pugixml-1.7.tar.gz -O pugixml-1.7.tar.gz -$ tar -xf pugixml-1.7.tar.gz && cd pugixml-1.7 -$ mkdir build && cd build -$ cmake ../scripts/ -$ make && sudo make install -$ cd ../.. && rm -rf pugixml-1.7 && rm -f pugixml-1.7.tar.gz -``` - - [ ] 4. Install `webdavclient@1.0.0` -```bash -$ echo "Install webdavclient@1.0.0" -$ wget https://github.com/designerror/webdav-client-cpp/archive/v1.0.0.tar.gz -O webdavclient-0.9.9.tar.gz -$ tar -xf webdavclient-1.0.0.tar.gz && cd webdav-client-cpp-1.0.0 -$ mkdir build && cd build -$ cmake .. -$ make && sudo make install -$ cd ../.. && rm -rf webdav-client-cpp-1.0.0 && rm -f webdavclient-1.0.0.tar.gz -``` - - - [ ] 5. Building tests for `webdavclient@1.0.0` -```bash -$ echo "Building tests for webdavclient@1.0.0" -$ wget https://github.com/designerror/webdav-client-cpp/archive/v1.0.0.tar.gz -O webdavclient-1.0.0.tar.gz -$ tar -xf webdavclient-1.0.0.tar.gz && cd webdav-client-cpp-1.0.0 -$ mkdir build && cd build -$ cmake .. && make -$ ctest -$ cd ../.. && rm -rf webdav-client-cpp-1.0.0 && rm -f webdavclient-1.0.0.tar.gz -``` diff --git a/INSTALL.WIN.md b/INSTALL.WIN.md deleted file mode 100644 index f8edcc6..0000000 --- a/INSTALL.WIN.md +++ /dev/null @@ -1,67 +0,0 @@ - - [ ] 1. Install [perl](https://www.perl.org/) - - [ ] 2. Install [nasm](http://www.nasm.us/) - - [ ] 3. Add nasm in environment variable `PATH` - - [ ] 4. Run `VS Cross Tools Command Prompt` - - - [ ] 5. Download repositoty with requirements -```bash -> git clone https://github.com/designerror/webdav-client-cpp -> cd webdav-client-cpp -> git submodule update --init -``` - - - [ ] 6. Set the build options -```bash -> set BUILD_TYPE=Release # Release | Debug -> set BUILD_SHARED_LIBS=FALSE # FALSE | TRUE -> set OPENSSL_BUILD_PLATFORM=VC-WIN64A # VC-WIN32 | VC-WIN64A | VC-WIN64I | VC-CE -> set INSTALL_PREFIX=%cd%\build -> set CMAKE_COMMON_FLAGS=-DCMAKE_BUILD_TYPE=%BUILD_TYPE% -DMSVC_SHRED_RT:BOOL=%BUILD_SHARED_LIBS% -``` - - - [ ] 7. Build and local install `openssl` - -```bash -> cd vendor\openssl/ -> mkdir build && cd build -> perl ../Configure --prefix=%INSTALL_PREFIX% --openssldir=%INSTALL_PREFIX%\ssl %OPENSSL_BUILD_PLATFORM% no-shared no-idea no-unit-test -> nmake -> nmake install -> cd ../.. -``` - - - [ ] 8. Build and local install `curl` - -```bash -> cd curl -> mkdir build && cd build -> cmake .. -DCMAKE_INSTALL_PREFIX=%INSTALL_PREFIX% -DCURL_STATICLIB:BOOL=ON -DBUILD_TESTING:BOOL=OFF -DBUILD_CURL_TESTS:BOOL=OFF -DBUILD_CURL_EXE:BOOL=OFF -DCURL_DISABLE_LDAP:BOOL=ON -DCURL_DISABLE_LDAPS=ON %CMAKE_COMMON_FLAGS% -> nmake -> nmake install -> cd ../.. -``` - - - [ ] 9. Build and local install `pugixml` - -```bash -> cd pugixml -> mkdir build && cd build -> cmake .. -DCMAKE_INSTALL_PREFIX=%INSTALL_PREFIX% %CMAKE_COMMON_FLAGS% -> nmake -> nmake install -> cd ../.. -``` - - - [ ] 10. Build and local install `webdavclient` - -```bash -> cd %INSTALL_PREFIX% -> set CURL_INCLUDE_DIR=%INSTALL_PREFIX%\include -> set CURL_LIBRARY=%INSTALL_PREFIX%\lib\libcurl.lib -> set CMAKE_PUGIXML_FLAGS=-DPUGIXML_LIBRARY=%INSTALL_PREFIX%\lib\pugixml.lib -DPUGIXML_INCLUDE_DIR=%INSTALL_PREFIX%\include -> set CMAKE_CURL_FLAGS=-DCURL_STATICLIB:BOOL=TRUE -DCURL_INCLUDE_DIR:STRING=%CURL_INCLUDE_DIR% -DCURL_LIBRARY=%CURL_LIBRARY% -> set CMAKE_OPENSSL_FLAGS=-DOPENSSL_LIBRARIES="%INSTALL_PREFIX%\lib\libcrypto.lib;%INSTALL_PREFIX%\lib\libssl.lib" -> cmake .. %CMAKE_PUGIXML_FLAGS% %CMAKE_CURL_FLAGS% %CMAKE_OPENSSL_FLAGS% %CMAKE_COMMON_FLAGS% -> nmake -> nmake install -``` diff --git a/INSTALL.macOS.md b/INSTALL.macOS.md deleted file mode 100644 index 1b49f73..0000000 --- a/INSTALL.macOS.md +++ /dev/null @@ -1,54 +0,0 @@ - - [ ] 1. Install `OpenSSL@1.0.2g` -```bash -$ echo "Install OpenSSL@1.0.2g" -$ wget https://github.com/openssl/openssl/archive/OpenSSL_1_0_2g.tar.gz -O OpenSSL_1_0_2g.tar.gz -$ tar -xf OpenSSL_1_0_2g.tar.gz && cd openssl-OpenSSL_1_0_2g -$ ./config -$ make && sudo make install -$ cd .. && rm -rf openssl-OpenSSL_1_0_2g && rm -f OpenSSL_1_0_2g.tar.gz -``` - - - [ ] 2. Install `CURL@7.4.8` -```bash -$ echo "Install CURL@7.4.8" -$ wget https://github.com/curl/curl/archive/curl-7_48_0.tar.gz -O curl-7_48_0.tar.gz -$ tar -xf curl-7_48_0.tar.gz && cd curl-curl-7_48_0 -$ mkdir build && cd build -$ cmake .. -$ make && sudo make install -$ cd ../.. && rm -rf curl-curl-7_48_0 && rm -f curl-7_48_0.tar.gz -``` - - - [ ] 3. Install `pugixml@1.7.0` -```bash -$ echo "Install pugixml@1.7.0" -$ wget https://github.com/zeux/pugixml/releases/download/v1.7/pugixml-1.7.tar.gz -O pugixml-1.7.tar.gz -$ tar -xf pugixml-1.7.tar.gz && cd pugixml-1.7 -$ mkdir build && cd build -$ cmake ../scripts/ -$ make && sudo make install -$ cd ../.. && rm -rf pugixml-1.7 && rm -f pugixml-1.7.tar.gz -``` - - [ ] 4. Install `webdavclient@1.0.0` -```bash -$ echo "Install webdavclient@1.0.0" -$ wget https://github.com/designerror/webdav-client-cpp/archive/v1.0.0.tar.gz -O webdavclient-0.9.9.tar.gz -$ tar -xf webdavclient-1.0.0.tar.gz && cd webdav-client-cpp-1.0.0 -$ export OPENSSL_ROOT_DIR=/usr/local/opt/openssl/ -$ mkdir build && cd build -$ cmake .. -$ make && sudo make install -$ cd ../.. && rm -rf webdav-client-cpp-1.0.0 && rm -f webdavclient-1.0.0.tar.gz -``` - - - [ ] 5. Building tests for `webdavclient@1.0.0` -```bash -$ echo "Building tests for webdavclient@1.0.0" -$ wget https://github.com/designerror/webdav-client-cpp/archive/v1.0.0.tar.gz -O webdavclient-1.0.0.tar.gz -$ tar -xf webdavclient-1.0.0.tar.gz && cd webdav-client-cpp-1.0.0 -$ export OPENSSL_ROOT_DIR=/usr/local/opt/openssl/ -$ mkdir build && cd build -$ cmake .. && make -$ ctest -$ cd ../.. && rm -rf webdav-client-cpp-1.0.0 && rm -f webdavclient-1.0.0.tar.gz -``` diff --git a/NEWS b/NEWS index 8b13789..c10e378 100644 --- a/NEWS +++ b/NEWS @@ -1 +1 @@ - +new package diff --git a/README.md b/README.md index ce64082..eb689f5 100644 --- a/README.md +++ b/README.md @@ -1,9 +1,10 @@ WebDAV Client === -[![version](https://img.shields.io/badge/version-1.0.2-brightgreen.svg)](https://github.com/designerror/webdav-client-cpp/releases/tag/v1.0.2) -[![Gitter](https://badges.gitter.im/designerror/webdav-client-cpp.svg)](https://gitter.im/designerror/webdav-client-cpp?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge) -[![Build Status](https://travis-ci.org/designerror/webdav-client-cpp.svg?branch=master)](https://travis-ci.org/designerror/webdav-client-cpp) -[![Build status](https://ci.appveyor.com/api/projects/status/l0nwebsyxwcc3lcs?svg=true)](https://ci.appveyor.com/project/designerror/webdav-client-cpp) +[![version](https://img.shields.io/badge/hunter-v0.23.86-blue.svg)](https://github.com/ruslo/hunter/releases/tag/v0.23.86) +[![version](https://img.shields.io/badge/wdc-v1.1.5-blue.svg)](https://github.com/CloudPolis/webdav-client-cpp/releases/tag/v1.1.4) +[![Build Status](https://travis-ci.org/CloudPolis/webdav-client-cpp.svg?branch=master)](https://travis-ci.org/CloudPolis/webdav-client-cpp) +[![Build status](https://ci.appveyor.com/api/projects/status/cr2xwpwe3iiafbwg?svg=true)](https://ci.appveyor.com/project/rusdevops/webdav-client-cpp) +[![Join the chat at https://gitter.im/CloudPolis/webdav-client-cpp](https://badges.gitter.im/CloudPolis/webdav-client-cpp.svg)](https://gitter.im/CloudPolis/webdav-client-cpp?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge) Package ```WebDAV Client``` provides easy and convenient to work with WebDAV-servers: @@ -12,9 +13,10 @@ Package ```WebDAV Client``` provides easy and convenient to work with WebDAV-ser - Google Drive - Box - 4shared + - ownCloud - ... -Install +Install old version === ```ShellSession @@ -25,87 +27,114 @@ $ brew install wdc Build === -**Building WebDAV Client from sources** +Building WebDAV Client from sources: -```bash -$ git clone https://github.com/designerror/webdav-client-cpp +```ShellSession +$ git clone --recursive https://github.com/CloudPolis/webdav-client-cpp $ cd webdav-client-cpp -$ cmake -H. -B_builds # -DCMAKE_INSTALL_PREFIX=install -$ cmake --build _builds -$ cmake --build _builds --target install +$ ./tools/polly/bin/polly --install +``` + +Building documentation: +```ShellSession +$ doxygen docs/doxygen.conf +$ open docs/html/index.html ``` -Documentation +Running tests === -```bash -$ cd docs -$ doxygen doxygen.conf -$ open html/index.html +For run tests you need to set environment variables `WEBDAV_HOSTNAME`, +`WEBDAV_USERNAME` and `WEBDAV_PASSWORD` (optional `WEBDAV_ROOT`). + +```ShellSession +$ export WEBDAV_HOSTNAME= +$ export WEBDAV_USERNAME= +$ export WEBDAV_PASSWORD= +$ ./tools/polly/bin/polly --test --reconfig --fwd BUILD_TESTS=yes ``` -Usage examples +Usage === -```c++ +```C++ +#include + #include +#include #include -#include int main() { std::map options = { - {"webdav_hostname", "https://webdav.yandex.ru"}, - {"webdav_login", "webdav_login"}, - {"webdav_password", "webdav_password"} + {"webdav_hostname", "https://webdav.yandex.ru"}, + {"webdav_username", "webdav_username"}, + {"webdav_password", "webdav_password"} }; // additional keys: // - webdav_root // - cert_path, key_path - // - proxy_hostname, proxy_login, proxy_password + // - proxy_hostname, proxy_username, proxy_password - std::shared_ptr client(WebDAV::Client::Init(options)); + std::unique_ptr client{ new WebDAV::Client{ options } }; - auto check_connection = client->check(); + bool check_connection = client->check(); std::cout << "test connection with WebDAV drive is " << (check_connection ? "" : "not ") << "successful"<< std::endl; - auto is_directory = client->is_dir("/path/to/remote/resource"); + bool is_dir = client->is_directory("/path/to/remote/resource"); std::cout << "remote resource is " - << (is_directory ? "" : "not ") + << (is_dir ? "" : "not ") << "directory" << std::endl; client->create_directory("/path/to/remote/directory/"); client->clean("/path/to/remote/directory/"); - + std::cout << "On WebDAV-disk available free space: " << client->free_size() << std::endl; std::cout << "remote_directory_name"; - for(auto& resource_name : client->list("/path/to/remote/directory/")) + for (const auto& resource_name : client->list("/path/to/remote/directory/")) { - std::cout << "\t" << "-" << resource_name; + std::cout << "\t" << "-" << resource_name; } std::cout << std::endl; client->download("/path/to/remote/file", "/path/to/local/file"); client->clean("/path/to/remote/file"); client->upload("/path/to/remote/file", "/path/to/local/file"); - - auto meta_info = client->info("/path/to/remote/resource"); - for(auto& field : meta_info) - { - std::cout << field.first << ":" << "\t" << field.second; + + const auto meta_info = client->info("/path/to/remote/resource"); + for (const auto& field : meta_info) { + std::cout << field.first << ":" << "\t" << field.second; } std::cout << std::endl; client->copy("/path/to/remote/file1", "/path/to/remote/file2"); client->move("/path/to/remote/file1", "/path/to/remote/file3"); - + client->async_upload("/path/to/remote/file", "/path/to/local/file"); client->async_download("/path/to/remote/file", "/path/to/local/file"); } ``` + +**CMakeLists.txt** +```cmake +cmake_minimum_required(VERSION 3.4) + +HunterGate( + URL "https://github.com/ruslo/hunter/archive/v0.23.83.tar.gz" + SHA1 "12dec078717539eb7b03e6d2a17797cba9be9ba9" +) + +project(example) + +hunter_add_package(WDC) +find_package(WDC CONFIG REQUIRED) + +add_executable(example example.cpp) +target_link_libraries(example WDC::libwdc) +``` diff --git a/REQUIREMENTS.UNIX.txt b/REQUIREMENTS.UNIX.txt deleted file mode 100644 index 14a0de9..0000000 --- a/REQUIREMENTS.UNIX.txt +++ /dev/null @@ -1,3 +0,0 @@ -libcurl-dev(>=7.38.0) -libssl-dev(>=1.0.1f) -libpugixml-dev(>=1.0.0) diff --git a/appveyor.yml b/appveyor.yml index ebf6129..ee2ede4 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -1,17 +1,22 @@ platform: - - x86 - - x64 - +- x86 +- x64 + environment: - matrix: - - VSVER: 14 + matrix: + - VSVER: 14 + WEBDAV_HOSTNAME: + secure: qMCWqchDp72RftbP5uTufNPtD0/7Jla3VJ/Yx3Xuwyc= + WEBDAV_USERNAME: + secure: 4IlY8dVOhjsf+RWnameAyQ2ELLifB2T1agRXsJ08pGE= + WEBDAV_PASSWORD: + secure: 4Us1bf4SKdfTiKKp6TcBf4Mtw/aRVv6sTvGc0SpSNmU= +build: + verbosity: minimal configuration: - - plain -# - shared - -install: - - set INSTALL_PREFIX=%APPVEYOR_BUILD_FOLDER%\build +- plain +- shared before_build: - ps: >- @@ -32,36 +37,13 @@ before_build: } - ps: $env:VSCOMNTOOLS=(Get-Content ("env:VS" + "$env:VSVER" + "0COMNTOOLS")) - call "%VSCOMNTOOLS%\..\..\VC\vcvarsall.bat" %VCVARS_PLATFORM% - - git submodule update --init - - echo "build openssl" - - cd vendor\openssl - - if not exist build (mkdir build && cd build) else (rmdir /S/Q build && mkdir build && cd build) - - perl ..\Configure %TARGET% no-asm no-idea no-unit-test %SHARED% --prefix=%INSTALL_PREFIX% --openssldir=%INSTALL_PREFIX%\ssl - - nmake - - nmake install - - cd ..\.. - - echo "build curl" - - cd curl - - if not exist build (mkdir build && cd build) else (rmdir /S/Q build && mkdir build && cd build) - - cmake .. -G "NMake Makefiles" -DCMAKE_INSTALL_PREFIX=%INSTALL_PREFIX% -DCURL_STATICLIB:BOOL=%BUILD_SHARED% -DBUILD_TESTING:BOOL=OFF -DBUILD_CURL_EXE:BOOL=OFF -DCURL_DISABLE_LDAP:BOOL=ON -DCURL_DISABLE_LDAPS=ON - - nmake - - nmake install - - cd ..\.. - - echo "build pugixml" - - cd pugixml - - if not exist build (mkdir build && cd build) else (rmdir /S/Q build && mkdir build && cd build) - - cmake .. -G "NMake Makefiles" -DCMAKE_INSTALL_PREFIX=%INSTALL_PREFIX% -DBUILD_SHARED_LIBS=%BUILD_SHARED% - - nmake - - nmake install - - cd ..\.. + +cache: +- 'C:\.hunter' build_script: - - cd %INSTALL_PREFIX% - - set CURL_INCLUDE_DIR=%INSTALL_PREFIX%\include - - set CURL_LIBRARY=%INSTALL_PREFIX%\lib\libcurl.lib - - set CMAKE_PUGIXML_FLAGS=-DPUGIXML_LIBRARY=%INSTALL_PREFIX%\lib\pugixml.lib -DPUGIXML_INCLUDE_DIR=%INSTALL_PREFIX%\include - - set CMAKE_CURL_FLAGS=-DCURL_STATICLIB:BOOL=%BUILD_SHARED% -DCURL_INCLUDE_DIR:STRING=%CURL_INCLUDE_DIR% -DCURL_LIBRARY=%CURL_LIBRARY% - - set CMAKE_OPENSSL_FLAGS=-DOPENSSL_LIBRARIES=%INSTALL_PREFIX%\lib\libcrypto.lib;%INSTALL_PREFIX%\lib\libssl.lib - - cmake .. -G "NMake Makefiles" %CMAKE_PUGIXML_FLAGS% %CMAKE_CURL_FLAGS% %CMAKE_OPENSSL_FLAGS% -DBUILD_SHARED_LIBS=%BUILD_SHARED% - - nmake - - nmake install +- cmake -H. -B_builds -DBUILD_TESTS=ON -DCMAKE_INSTALL_PREFIX=install -DCMAKE_BUILD_TYPE=Release +- cmake --build _builds +- cmake --build _builds --target RUN_TESTS +- cmake --build _builds --target install + diff --git a/cmake/CodeCoverage.cmake b/cmake/CodeCoverage.cmake new file mode 100644 index 0000000..92e404f --- /dev/null +++ b/cmake/CodeCoverage.cmake @@ -0,0 +1,204 @@ +# Copyright (c) 2012 - 2015, Lars Bilke +# All rights reserved. +# +# Redistribution and use in source and binary forms, with or without modification, +# are permitted provided that the following conditions are met: +# +# 1. Redistributions of source code must retain the above copyright notice, this +# list of conditions and the following disclaimer. +# +# 2. Redistributions in binary form must reproduce the above copyright notice, +# this list of conditions and the following disclaimer in the documentation +# and/or other materials provided with the distribution. +# +# 3. Neither the name of the copyright holder nor the names of its contributors +# may be used to endorse or promote products derived from this software without +# specific prior written permission. +# +# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +# DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR +# ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +# (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON +# ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +# +# +# +# 2012-01-31, Lars Bilke +# - Enable Code Coverage +# +# 2013-09-17, Joakim Söderberg +# - Added support for Clang. +# - Some additional usage instructions. +# +# USAGE: + +# 0. (Mac only) If you use Xcode 5.1 make sure to patch geninfo as described here: +# http://stackoverflow.com/a/22404544/80480 +# +# 1. Copy this file into your cmake modules path. +# +# 2. Add the following line to your CMakeLists.txt: +# INCLUDE(CodeCoverage) +# +# 3. Set compiler flags to turn off optimization and enable coverage: +# SET(CMAKE_CXX_FLAGS "-g -O0 -fprofile-arcs -ftest-coverage") +# SET(CMAKE_C_FLAGS "-g -O0 -fprofile-arcs -ftest-coverage") +# +# 3. Use the function SETUP_TARGET_FOR_COVERAGE to create a custom make target +# which runs your test executable and produces a lcov code coverage report: +# Example: +# SETUP_TARGET_FOR_COVERAGE( +# my_coverage_target # Name for custom target. +# test_driver # Name of the test driver executable that runs the tests. +# # NOTE! This should always have a ZERO as exit code +# # otherwise the coverage generation will not complete. +# coverage # Name of output directory. +# ) +# +# If you need to exclude additional directories from the report, specify them +# using the LCOV_REMOVE_EXTRA variable before calling SETUP_TARGET_FOR_COVERAGE. +# For example: +# +# set(LCOV_REMOVE_EXTRA "'thirdparty/*'") +# +# 4. Build a Debug build: +# cmake -DCMAKE_BUILD_TYPE=Debug .. +# make +# make my_coverage_target +# +# + +# Check prereqs +FIND_PROGRAM( GCOV_PATH gcov ) +FIND_PROGRAM( LCOV_PATH lcov ) +FIND_PROGRAM( GENHTML_PATH genhtml ) +FIND_PROGRAM( GCOVR_PATH gcovr PATHS ${CMAKE_SOURCE_DIR}/tests) + +IF(NOT GCOV_PATH) + MESSAGE(FATAL_ERROR "gcov not found! Aborting...") +ENDIF() # NOT GCOV_PATH + +IF("${CMAKE_CXX_COMPILER_ID}" MATCHES "(Apple)?[Cc]lang") + IF("${CMAKE_CXX_COMPILER_VERSION}" VERSION_LESS 3) + MESSAGE(FATAL_ERROR "Clang version must be 3.0.0 or greater! Aborting...") + ENDIF() +ELSEIF(NOT CMAKE_COMPILER_IS_GNUCXX) + MESSAGE(FATAL_ERROR "Compiler is not GNU gcc! Aborting...") +ENDIF() # CHECK VALID COMPILER + +SET(CMAKE_CXX_FLAGS_COVERAGE + "-g -O0 --coverage -fprofile-arcs -ftest-coverage" + CACHE STRING "Flags used by the C++ compiler during coverage builds." + FORCE ) +SET(CMAKE_C_FLAGS_COVERAGE + "-g -O0 --coverage -fprofile-arcs -ftest-coverage" + CACHE STRING "Flags used by the C compiler during coverage builds." + FORCE ) +SET(CMAKE_EXE_LINKER_FLAGS_COVERAGE + "" + CACHE STRING "Flags used for linking binaries during coverage builds." + FORCE ) +SET(CMAKE_SHARED_LINKER_FLAGS_COVERAGE + "" + CACHE STRING "Flags used by the shared libraries linker during coverage builds." + FORCE ) +MARK_AS_ADVANCED( + CMAKE_CXX_FLAGS_COVERAGE + CMAKE_C_FLAGS_COVERAGE + CMAKE_EXE_LINKER_FLAGS_COVERAGE + CMAKE_SHARED_LINKER_FLAGS_COVERAGE ) + +IF ( NOT (CMAKE_BUILD_TYPE STREQUAL "Debug" OR CMAKE_BUILD_TYPE STREQUAL "Coverage")) + MESSAGE( WARNING "Code coverage results with an optimized (non-Debug) build may be misleading" ) +ENDIF() # NOT CMAKE_BUILD_TYPE STREQUAL "Debug" + + +# Param _targetname The name of new the custom make target +# Param _testrunner The name of the target which runs the tests. +# MUST return ZERO always, even on errors. +# If not, no coverage report will be created! +# Param _outputname lcov output is generated as _outputname.info +# HTML report is generated in _outputname/index.html +# Optional fourth parameter is passed as arguments to _testrunner +# Pass them in list form, e.g.: "-j;2" for -j 2 +FUNCTION(SETUP_TARGET_FOR_COVERAGE _targetname _testrunner _outputname) + + IF(NOT LCOV_PATH) + MESSAGE(FATAL_ERROR "lcov not found! Aborting...") + ENDIF() # NOT LCOV_PATH + + IF(NOT GENHTML_PATH) + MESSAGE(FATAL_ERROR "genhtml not found! Aborting...") + ENDIF() # NOT GENHTML_PATH + + SET(coverage_info "${CMAKE_BINARY_DIR}/${_outputname}.info") + SET(coverage_cleaned "${coverage_info}.cleaned") + + SEPARATE_ARGUMENTS(test_command UNIX_COMMAND "${_testrunner}") + + # Setup target + ADD_CUSTOM_TARGET(${_targetname} + + # Cleanup lcov + ${LCOV_PATH} --directory . --zerocounters + + # Run tests + COMMAND ${test_command} ${ARGV3} + + # Capturing lcov counters and generating report + COMMAND ${LCOV_PATH} --directory . --capture --output-file ${coverage_info} + COMMAND ${LCOV_PATH} --remove ${coverage_info} 'tests/*' '/usr/*' ${LCOV_REMOVE_EXTRA} --output-file ${coverage_cleaned} + COMMAND ${GENHTML_PATH} -o ${_outputname} ${coverage_cleaned} + COMMAND ${CMAKE_COMMAND} -E remove ${coverage_info} ${coverage_cleaned} + + WORKING_DIRECTORY ${CMAKE_BINARY_DIR} + COMMENT "Resetting code coverage counters to zero.\nProcessing code coverage counters and generating report." + ) + + # Show info where to find the report + ADD_CUSTOM_COMMAND(TARGET ${_targetname} POST_BUILD + COMMAND ; + COMMENT "Open ./${_outputname}/index.html in your browser to view the coverage report." + ) + +ENDFUNCTION() # SETUP_TARGET_FOR_COVERAGE + +# Param _targetname The name of new the custom make target +# Param _testrunner The name of the target which runs the tests +# Param _outputname cobertura output is generated as _outputname.xml +# Optional fourth parameter is passed as arguments to _testrunner +# Pass them in list form, e.g.: "-j;2" for -j 2 +FUNCTION(SETUP_TARGET_FOR_COVERAGE_COBERTURA _targetname _testrunner _outputname) + + IF(NOT PYTHON_EXECUTABLE) + MESSAGE(FATAL_ERROR "Python not found! Aborting...") + ENDIF() # NOT PYTHON_EXECUTABLE + + IF(NOT GCOVR_PATH) + MESSAGE(FATAL_ERROR "gcovr not found! Aborting...") + ENDIF() # NOT GCOVR_PATH + + ADD_CUSTOM_TARGET(${_targetname} + + # Run tests + ${_testrunner} ${ARGV3} + + # Running gcovr + COMMAND ${GCOVR_PATH} -x -r ${CMAKE_SOURCE_DIR} -e '${CMAKE_SOURCE_DIR}/tests/' -o ${_outputname}.xml + WORKING_DIRECTORY ${CMAKE_BINARY_DIR} + COMMENT "Running gcovr to produce Cobertura code coverage report." + ) + + # Show info where to find the report + ADD_CUSTOM_COMMAND(TARGET ${_targetname} POST_BUILD + COMMAND ; + COMMENT "Cobertura code coverage report saved in ${_outputname}.xml." + ) + +ENDFUNCTION() # SETUP_TARGET_FOR_COVERAGE_COBERTURA + diff --git a/cmake/Config.cmake.in b/cmake/Config.cmake.in new file mode 100644 index 0000000..d0325c7 --- /dev/null +++ b/cmake/Config.cmake.in @@ -0,0 +1,8 @@ +@PACKAGE_INIT@ + +find_package(OpenSSL REQUIRED) +find_package(CURL CONFIG REQUIRED) +find_package(pugixml CONFIG REQUIRED) + +include("${CMAKE_CURRENT_LIST_DIR}/@TARGETS_EXPORT_NAME@.cmake") +check_required_components("@PROJECT_NAME@") diff --git a/cmake/HunterGate.cmake b/cmake/HunterGate.cmake index 99882d2..887557a 100644 --- a/cmake/HunterGate.cmake +++ b/cmake/HunterGate.cmake @@ -1,4 +1,4 @@ -# Copyright (c) 2013-2015, Ruslan Baratov +# Copyright (c) 2013-2018, Ruslan Baratov # All rights reserved. # # Redistribution and use in source and binary forms, with or without @@ -25,7 +25,7 @@ # This is a gate file to Hunter package manager. # Include this file using `include` command and add package you need, example: # -# cmake_minimum_required(VERSION 3.0) +# cmake_minimum_required(VERSION 3.2) # # include("cmake/HunterGate.cmake") # HunterGate( @@ -42,30 +42,41 @@ # * https://github.com/hunter-packages/gate/ # * https://github.com/ruslo/hunter -cmake_minimum_required(VERSION 3.0) # Minimum for Hunter +option(HUNTER_ENABLED "Enable Hunter package manager support" ON) + +if(HUNTER_ENABLED) + if(CMAKE_VERSION VERSION_LESS "3.2") + message( + FATAL_ERROR + "At least CMake version 3.2 required for Hunter dependency management." + " Update CMake or set HUNTER_ENABLED to OFF." + ) + endif() +endif() + include(CMakeParseArguments) # cmake_parse_arguments -option(HUNTER_ENABLED "Enable Hunter package manager support" ON) option(HUNTER_STATUS_PRINT "Print working status" ON) option(HUNTER_STATUS_DEBUG "Print a lot info" OFF) +option(HUNTER_TLS_VERIFY "Enable/disable TLS certificate checking on downloads" ON) set(HUNTER_WIKI "https://github.com/ruslo/hunter/wiki") function(hunter_gate_status_print) - foreach(print_message ${ARGV}) - if(HUNTER_STATUS_PRINT OR HUNTER_STATUS_DEBUG) + if(HUNTER_STATUS_PRINT OR HUNTER_STATUS_DEBUG) + foreach(print_message ${ARGV}) message(STATUS "[hunter] ${print_message}") - endif() - endforeach() + endforeach() + endif() endfunction() function(hunter_gate_status_debug) - foreach(print_message ${ARGV}) - if(HUNTER_STATUS_DEBUG) + if(HUNTER_STATUS_DEBUG) + foreach(print_message ${ARGV}) string(TIMESTAMP timestamp) message(STATUS "[hunter *** DEBUG *** ${timestamp}] ${print_message}") - endif() - endforeach() + endforeach() + endif() endfunction() function(hunter_gate_wiki wiki_page) @@ -188,20 +199,6 @@ function(hunter_gate_detect_root) ) endfunction() -macro(hunter_gate_lock dir) - if(NOT HUNTER_SKIP_LOCK) - if("${CMAKE_VERSION}" VERSION_LESS "3.2") - hunter_gate_fatal_error( - "Can't lock, upgrade to CMake 3.2 or use HUNTER_SKIP_LOCK" - WIKI "error.can.not.lock" - ) - endif() - hunter_gate_status_debug("Locking directory: ${dir}") - file(LOCK "${dir}" DIRECTORY GUARD FUNCTION) - hunter_gate_status_debug("Lock done") - endif() -endmacro() - function(hunter_gate_download dir) string( COMPARE @@ -241,7 +238,10 @@ function(hunter_gate_download dir) set(build_dir "${dir}/Build") set(cmakelists "${dir}/CMakeLists.txt") - hunter_gate_lock("${dir}") + hunter_gate_status_debug("Locking directory: ${dir}") + file(LOCK "${dir}" DIRECTORY GUARD FUNCTION) + hunter_gate_status_debug("Lock done") + if(EXISTS "${done_location}") # while waiting for lock other instance can do all the job hunter_gate_status_debug("File '${done_location}' found, skip install") @@ -258,7 +258,7 @@ function(hunter_gate_download dir) file( WRITE "${cmakelists}" - "cmake_minimum_required(VERSION 3.0)\n" + "cmake_minimum_required(VERSION 3.2)\n" "project(HunterDownload LANGUAGES NONE)\n" "include(ExternalProject)\n" "ExternalProject_Add(\n" @@ -269,6 +269,8 @@ function(hunter_gate_download dir) " SHA1=${HUNTER_GATE_SHA1}\n" " DOWNLOAD_DIR\n" " \"${dir}\"\n" + " TLS_VERIFY\n" + " ${HUNTER_TLS_VERIFY}\n" " SOURCE_DIR\n" " \"${dir}/Unpacked\"\n" " CONFIGURE_COMMAND\n" @@ -292,21 +294,40 @@ function(hunter_gate_download dir) # Otherwise on Visual Studio + MDD this will fail with error: # "Could not find an appropriate version of the Windows 10 SDK installed on this machine" if(EXISTS "${CMAKE_TOOLCHAIN_FILE}") - set(toolchain_arg "-DCMAKE_TOOLCHAIN_FILE=${CMAKE_TOOLCHAIN_FILE}") + get_filename_component(absolute_CMAKE_TOOLCHAIN_FILE "${CMAKE_TOOLCHAIN_FILE}" ABSOLUTE) + set(toolchain_arg "-DCMAKE_TOOLCHAIN_FILE=${absolute_CMAKE_TOOLCHAIN_FILE}") else() # 'toolchain_arg' can't be empty set(toolchain_arg "-DCMAKE_TOOLCHAIN_FILE=") endif() + string(COMPARE EQUAL "${CMAKE_MAKE_PROGRAM}" "" no_make) + if(no_make) + set(make_arg "") + else() + # Test case: remove Ninja from PATH but set it via CMAKE_MAKE_PROGRAM + set(make_arg "-DCMAKE_MAKE_PROGRAM=${CMAKE_MAKE_PROGRAM}") + endif() + execute_process( - COMMAND "${CMAKE_COMMAND}" "-H${dir}" "-B${build_dir}" "-G${CMAKE_GENERATOR}" "${toolchain_arg}" + COMMAND + "${CMAKE_COMMAND}" + "-H${dir}" + "-B${build_dir}" + "-G${CMAKE_GENERATOR}" + "${toolchain_arg}" + ${make_arg} WORKING_DIRECTORY "${dir}" RESULT_VARIABLE download_result ${logging_params} ) if(NOT download_result EQUAL 0) - hunter_gate_internal_error("Configure project failed") + hunter_gate_internal_error( + "Configure project failed." + "To reproduce the error run: ${CMAKE_COMMAND} -H${dir} -B${build_dir} -G${CMAKE_GENERATOR} ${toolchain_arg} ${make_arg}" + "In directory ${dir}" + ) endif() hunter_gate_status_print( @@ -351,6 +372,17 @@ macro(HunterGate) # Empty function to avoid error "unknown function" function(hunter_add_package) endfunction() + + set( + _hunter_gate_disabled_mode_dir + "${CMAKE_CURRENT_LIST_DIR}/cmake/Hunter/disabled-mode" + ) + if(EXISTS "${_hunter_gate_disabled_mode_dir}") + hunter_gate_status_debug( + "Adding \"disabled-mode\" modules: ${_hunter_gate_disabled_mode_dir}" + ) + list(APPEND CMAKE_PREFIX_PATH "${_hunter_gate_disabled_mode_dir}") + endif() elseif(_hunter_gate_done) hunter_gate_status_debug("Secondary HunterGate (use old settings)") hunter_gate_self( @@ -361,7 +393,7 @@ macro(HunterGate) ) include("${_hunter_self}/cmake/Hunter") else() - set(HUNTER_GATE_LOCATION "${CMAKE_CURRENT_LIST_DIR}") + set(HUNTER_GATE_LOCATION "${CMAKE_CURRENT_SOURCE_DIR}") string(COMPARE NOTEQUAL "${PROJECT_NAME}" "" _have_project_name) if(_have_project_name) diff --git a/docs/doxygen.conf b/docs/doxygen.conf index 588138f..4cbc510 100644 --- a/docs/doxygen.conf +++ b/docs/doxygen.conf @@ -32,7 +32,7 @@ DOXYFILE_ENCODING = UTF-8 # title of most generated pages and in a few other places. # The default value is: My Project. -PROJECT_NAME = "webdavclient" +PROJECT_NAME = "WebDAV Client" # The PROJECT_NUMBER tag can be used to enter a project or revision number. This # could be handy for archiving the generated documentation or if some version @@ -58,7 +58,7 @@ PROJECT_LOGO = # entered, it will be relative to the location where doxygen was started. If # left blank the current directory will be used. -OUTPUT_DIRECTORY = +OUTPUT_DIRECTORY = docs # If the CREATE_SUBDIRS tag is set to YES, then doxygen will create 4096 sub- # directories (in 2 levels) under the output directory of each output format and @@ -398,7 +398,7 @@ LOOKUP_CACHE_SIZE = 0 # normally produced when WARNINGS is set to YES. # The default value is: NO. -EXTRACT_ALL = NO +EXTRACT_ALL = YES # If the EXTRACT_PRIVATE tag is set to YES all private members of a class will # be included in the documentation. @@ -487,7 +487,7 @@ INTERNAL_DOCS = NO # and Mac users are advised to set this option to NO. # The default value is: system dependent. -CASE_SENSE_NAMES = YES +CASE_SENSE_NAMES = NO # If the HIDE_SCOPE_NAMES tag is set to NO then doxygen will show members with # their full class and namespace scopes in the documentation. If set to YES the @@ -743,7 +743,7 @@ WARN_LOGFILE = # spaces. # Note: If this tag is empty the current directory is searched. -INPUT = ../README.md ../include/webdav +INPUT = README.md include/webdav # This tag can be used to specify the character encoding of the source files # that doxygen parses. Internally doxygen uses the UTF-8 encoding. Doxygen uses @@ -811,7 +811,7 @@ EXCLUDE_SYMBOLS = # that contain example code fragments that are included (see the \include # command). -EXAMPLE_PATH = ../examples +EXAMPLE_PATH = examples # If the value of the EXAMPLE_PATH tag contains directories, you can use the # EXAMPLE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp and @@ -1779,7 +1779,7 @@ MAN_LINKS = NO # captures the structure of the code including all documentation. # The default value is: NO. -GENERATE_XML = NO +GENERATE_XML = YES # The XML_OUTPUT tag is used to specify where the XML pages will be put. If a # relative path is entered the value of OUTPUT_DIRECTORY will be put in front of @@ -1808,7 +1808,7 @@ XML_DTD = # The default value is: YES. # This tag requires that the tag GENERATE_XML is set to YES. -XML_PROGRAMLISTING = YES +XML_PROGRAMLISTING = NO #--------------------------------------------------------------------------- # Configuration options related to the DOCBOOK output @@ -1917,7 +1917,7 @@ SEARCH_INCLUDES = YES # preprocessor. # This tag requires that the tag SEARCH_INCLUDES is set to YES. -INCLUDE_PATH = ../examples +INCLUDE_PATH = examples # You can use the INCLUDE_FILE_PATTERNS tag to specify one or more wildcard # patterns (like *.h and *.hpp) to filter out the header-files in the diff --git a/examples/cli/cli.cpp b/examples/cli/cli.cpp new file mode 100644 index 0000000..25ccc35 --- /dev/null +++ b/examples/cli/cli.cpp @@ -0,0 +1,169 @@ +/*#*************************************************************************** +# __ __ _____ _____ +# Project | | | | | \ / ___| +# | |__| | | |\ \ / / +# | | | | ) ) ( ( +# | /\ | | |/ / \ \___ +# \_/ \_/ |_____/ \_____| +# +# Copyright (C) 2016, The WDC Project, , et al. +# +# This software is licensed as described in the file LICENSE, which +# you should have received as part of this distribution. +# +# You may opt to use, copy, modify, merge, publish, distribute and/or sell +# copies of the Software, and permit persons to whom the Software is +# furnished to do so, under the terms of the LICENSE file. +# +# This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY +# KIND, either express or implied. +# +############################################################################*/ + +#include + +#include +#include + +using dict_t = std::map; +using strings_t = std::vector; + +auto operator<<(std::ostream& out, const dict_t& dict) -> std::ostream& +{ + for (auto& item : dict) + { + out << item.first << ": " << item.second << std::endl; + } + return out; +} + +auto operator<<(std::ostream& out, const strings_t& dict) -> std::ostream& +{ + for (auto& item : dict) + { + out << "- " << item << std::endl; + } + return out; +} + +int main(int argc, char* argv[]) +{ + + try + { + + auto hostname_ptr = std::getenv("WEBDAV_HOSTNAME"); + auto username_ptr = std::getenv("WEBDAV_USERNAME"); + auto password_ptr = std::getenv("WEBDAV_PASSWORD"); + auto root_ptr = std::getenv("WEBDAV_ROOT"); + + if (hostname_ptr == nullptr) + { + throw std::runtime_error("undefined WEBDAV_HOSTNAME environment variable"); + } + if (username_ptr == nullptr) + { + throw std::runtime_error("undefined WEBDAV_USERNAME environment variable"); + } + if (password_ptr == nullptr) + { + throw std::runtime_error("undefined WEBDAV_PASSWORD environment variable"); + } + + if (argc < 2) + { + throw std::invalid_argument("command"); + } + + if (argc < 3) + { + throw std::invalid_argument("resource"); + } + + std::string command = argv[1]; + std::string remote_resource = argv[2]; + + std::map options = + { + {"webdav_hostname", hostname_ptr}, + {"webdav_username", username_ptr}, + {"webdav_password", password_ptr} + }; + + if (root_ptr != nullptr) + { + options["webdav_root"] = root_ptr; + } + + std::unique_ptr client{ new WebDAV::Client{ options } }; + + if (command == "check") + { + bool is_existed = client->check(remote_resource); + std::cout << "Resource: " << remote_resource << " is " << (is_existed ? "" : "not ") << "existed" + << std::endl; + } + else if (command == "copy") + { + if (argc < 4) + { + throw std::invalid_argument("to"); + } + std::string target_resource = argv[3]; + client->copy(remote_resource, target_resource); + } + else if (command == "download") + { + if (argc < 4) + { + throw std::invalid_argument("to"); + } + std::string target_resource = argv[3]; + client->download(remote_resource, target_resource); + } + else if (command == "info") + { + auto info = client->info(remote_resource); + std::cout << info << std::endl; + } + else if (command == "list") + { + auto list = client->list(remote_resource); + std::cout << list << std::endl; + } + else if (command == "mkdir") + { + client->create_directory(remote_resource); + } + else if (command == "move") + { + if (argc < 4) + { + throw std::invalid_argument("to"); + } + std::string target_resource = argv[3]; + client->move(remote_resource, target_resource); + } + else if (command == "remove") + { + client->clean(remote_resource); + } + else if (command == "upload") + { + if (argc < 4) + { + throw std::invalid_argument("from"); + } + std::string target_resource = argv[3]; + client->upload(remote_resource, target_resource); + } + } + catch (std::invalid_argument& error) + { + std::cout << "use: []" << std::endl; + } + catch (std::runtime_error& error) + { + std::cout << error.what() << std::endl; + } +} diff --git a/examples/client/check.cpp b/examples/client/check.cpp index 27f175e..dcc316c 100644 --- a/examples/client/check.cpp +++ b/examples/client/check.cpp @@ -2,14 +2,14 @@ # __ __ _____ _____ # Project | | | | | \ / ___| # | |__| | | |\ \ / / -# | | | | ) ) ( ( +# | | | | ) ) ( ( # | /\ | | |/ / \ \___ # \_/ \_/ |_____/ \_____| # # Copyright (C) 2016, The WDC Project, , et al. # # This software is licensed as described in the file LICENSE, which -# you should have received as part of this distribution. +# you should have received as part of this distribution. # # You may opt to use, copy, modify, merge, publish, distribute and/or sell # copies of the Software, and permit persons to whom the Software is @@ -22,30 +22,52 @@ #include -int main() { - - std::map options = - { - { "webdav_hostname", "https://webdav.yandex.ru" }, - { "webdav_login", "{webdav_login}" }, - { "webdav_password", "{webdav_password}" } - }; - - std::unique_ptr client(WebDAV::Client::Init(options)); - - auto remote_resources = { - "existing_file.dat", - "not_existing_file.dat", - "existing_directory", - "existing_directory/", - "not_existing_directory", - "not_existing_directory/" - }; - - for (auto remote_resource : remote_resources) { - bool is_existed = client->check(remote_resource); - std::cout << "Resource: " << remote_resource << " is " << is_existed ? "" : "not " << "existed" << std::endl; - } +#include +#include +#include +#include + +int main() +{ + auto hostname_ptr = std::getenv("WEBDAV_HOSTNAME"); + auto username_ptr = std::getenv("WEBDAV_USERNAME"); + auto password_ptr = std::getenv("WEBDAV_PASSWORD"); + auto root_ptr = std::getenv("WEBDAV_ROOT"); + + if (hostname_ptr == nullptr) return -1; + if (username_ptr == nullptr) return -1; + if (password_ptr == nullptr) return -1; + + std::map options = + { + { "webdav_hostname", hostname_ptr }, + { "webdav_username", username_ptr }, + { "webdav_password", password_ptr } + }; + + if (root_ptr != nullptr) + { + options["webdav_root"] = root_ptr; + } + + std::unique_ptr client{ new WebDAV::Client{ options } }; + + auto remote_resources = + { + "existing_file.dat", + "not_existing_file.dat", + "existing_directory", + "existing_directory/", + "not_existing_directory", + "not_existing_directory/" + }; + + for (const auto& remote_resource : remote_resources) + { + bool is_existed = client->check(remote_resource); + std::cout << "Resource: " << remote_resource + << " is " << (is_existed ? "" : "not ") << "existed" << std::endl; + } } /// Resource: existing_file.dat is existed diff --git a/examples/client/copy.cpp b/examples/client/copy.cpp index ff9e29c..99b4e4e 100644 --- a/examples/client/copy.cpp +++ b/examples/client/copy.cpp @@ -2,14 +2,14 @@ # __ __ _____ _____ # Project | | | | | \ / ___| # | |__| | | |\ \ / / -# | | | | ) ) ( ( +# | | | | ) ) ( ( # | /\ | | |/ / \ \___ # \_/ \_/ |_____/ \_____| # # Copyright (C) 2016, The WDC Project, , et al. # # This software is licensed as described in the file LICENSE, which -# you should have received as part of this distribution. +# you should have received as part of this distribution. # # You may opt to use, copy, modify, merge, publish, distribute and/or sell # copies of the Software, and permit persons to whom the Software is @@ -22,44 +22,63 @@ #include -std::ostream resources_to_string(std::vector & resources) +#include +#include +#include +#include + +std::string resources_to_string(const std::vector& resources) { - std::ostream stream; - for (auto resource : resources) - { - stream << "\t" << "- " << resource << std::endl; - } - return stream; + std::stringstream result; + for (const auto& resource : resources) + { + result << "\t" << "- " << resource << std::endl; + } + return result.str(); } -int main() { +int main() +{ + auto hostname_ptr = std::getenv("WEBDAV_HOSTNAME"); + auto username_ptr = std::getenv("WEBDAV_USERNAME"); + auto password_ptr = std::getenv("WEBDAV_PASSWORD"); + auto root_ptr = std::getenv("WEBDAV_ROOT"); + + if (hostname_ptr == nullptr) return -1; + if (username_ptr == nullptr) return -1; + if (password_ptr == nullptr) return -1; + + std::map options = + { + { "webdav_hostname", hostname_ptr }, + { "webdav_username", username_ptr }, + { "webdav_password", password_ptr } + }; - std::map options = - { - { "webdav_hostname", "https://webdav.yandex.ru" }, - { "webdav_login", "{webdav_login}" }, - { "webdav_password", "{webdav_password}" } - }; + if (root_ptr != nullptr) + { + options["webdav_root"] = root_ptr; + } - std::unique_ptr client(WebDAV::Client::Init(options)); + std::unique_ptr client{ new WebDAV::Client{ options } }; - auto remote_file = "file.dat"; - auto remote_directory = "dir/"; + auto remote_file = "file.dat"; + auto remote_directory = "dir/"; - auto copy_remote_file = "file2.dat"; - auto copy_remote_directory = "dir2/"; + auto copy_remote_file = "file2.dat"; + auto copy_remote_directory = "dir2/"; - auto resources = client.list(); - std::cout << "\"/\" resource contain:" << std::endl; - std::cout << resources_to_string(resources) << std::endl; + auto resources = client->list(); + std::cout << "\"/\" resource contain:" << std::endl; + std::cout << resources_to_string(resources) << std::endl; - client->copy(remote_file, copy_remote_file); - client->copy(remote_directory, copy_remote_directory); + client->copy(remote_file, copy_remote_file); + client->copy(remote_directory, copy_remote_directory); - resources = client->list(); + resources = client->list(); - std::cout << "\"/\" resource contain:" << std::endl; - std::cout << resources_to_string(resources) << std::endl; + std::cout << "\"/\" resource contain:" << std::endl; + std::cout << resources_to_string(resources) << std::endl; } /// "/" resource contain: diff --git a/examples/client/download.cpp b/examples/client/download.cpp index de9b87e..cd32b72 100644 --- a/examples/client/download.cpp +++ b/examples/client/download.cpp @@ -2,14 +2,14 @@ # __ __ _____ _____ # Project | | | | | \ / ___| # | |__| | | |\ \ / / -# | | | | ) ) ( ( +# | | | | ) ) ( ( # | /\ | | |/ / \ \___ # \_/ \_/ |_____/ \_____| # # Copyright (C) 2016, The WDC Project, , et al. # # This software is licensed as described in the file LICENSE, which -# you should have received as part of this distribution. +# you should have received as part of this distribution. # # You may opt to use, copy, modify, merge, publish, distribute and/or sell # copies of the Software, and permit persons to whom the Software is @@ -22,24 +22,27 @@ #include +#include +#include + //! [download_to_file] void download_to_file() { - std::map options = - { - {"webdav_hostname", "https://webdav.yandex.ru"}, - {"webdav_login", "{webdav_login}"}, - {"webdav_password", "{webdav_password}"} - }; + std::map options = + { + {"webdav_hostname", "https://webdav.yandex.ru"}, + {"webdav_username", "{webdav_username}"}, + {"webdav_password", "{webdav_password}"} + }; - std::unique_ptr client(WebDAV::Client::Init(options)); + std::unique_ptr client{ new WebDAV::Client{ options } }; - auto remote_file = "dir/file.dat"; - auto local_file = "/home/user/Downloads/file.dat"; - bool is_downloaded = client->download(remote_file, local_file); + std::string remote_file = "dir/file.dat"; + auto local_file = "/home/user/Downloads/file.dat"; + bool is_downloaded = client->download(remote_file, local_file); - std::cout << remote_file << " resource is" << is_downloaded ? "" : "not" << "downloaded" << std::endl; + std::cout << remote_file << " resource is" << (is_downloaded ? "" : "not") << "downloaded" << std::endl; } /// dir/file.dat resource is downloaded @@ -50,22 +53,22 @@ void download_to_file() void async_download_to_file() { - std::map options = - { - {"webdav_hostname", "https://webdav.yandex.ru"}, - {"webdav_login", "{webdav_login}"}, - {"webdav_password", "{webdav_password}"} - }; - - std::unique_ptr client(WebDAV::Client::Init(options)); - - auto remote_file = "dir/file.dat"; - auto local_file = "/home/user/Downloads/file.dat"; - - client->async_download(remote_file, local_file, [remote_file](bool is_downloaded) - { - std::cout << remote_file << " resource is" << is_downloaded ? "" : "not" << "downloaded" << std::endl; - }); + std::map options = + { + {"webdav_hostname", "https://webdav.yandex.ru"}, + {"webdav_username", "{webdav_username}"}, + {"webdav_password", "{webdav_password}"} + }; + + std::unique_ptr client{ new WebDAV::Client{ options } }; + + std::string remote_file = "dir/file.dat"; + std::string local_file = "/home/user/Downloads/file.dat"; + + client->async_download(remote_file, local_file, [remote_file](bool is_downloaded) + { + std::cout << remote_file << " resource is" << (is_downloaded ? "" : "not") << "downloaded" << std::endl; + }); } /// dir/file.dat resource is downloaded @@ -76,22 +79,22 @@ void async_download_to_file() void download_to_buffer() { - std::map options = - { - {"webdav_hostname", "https://webdav.yandex.ru"}, - {"webdav_login", "{webdav_login}"}, - {"webdav_password", "{webdav_password}"} - }; + std::map options = + { + {"webdav_hostname", "https://webdav.yandex.ru"}, + {"webdav_username", "{webdav_username}"}, + {"webdav_password", "{webdav_password}"} + }; - std::unique_ptr client(WebDAV::Client::Init(options)); + std::unique_ptr client{ new WebDAV::Client{ options } }; - auto remote_file = "dir/file.dat"; - char * buffer_ptr = nullptr; - long long int buffer_size = 0; + std::string remote_file = "dir/file.dat"; + char* buffer_ptr = nullptr; + unsigned long long buffer_size = 0; - bool is_downloaded = client->download(remote_file, buffer_ptr, buffer_size); + bool is_downloaded = client->download_to(remote_file, buffer_ptr, buffer_size); - std::cout << remote_file << " resource is" << is_downloaded ? "" : "not" << "downloaded" << std::endl; + std::cout << remote_file << " resource is" << (is_downloaded ? "" : "not") << "downloaded" << std::endl; } /// dir/file.dat resource is downloaded @@ -102,23 +105,25 @@ void download_to_buffer() void async_download_to_buffer() { - std::map options = - { - {"webdav_hostname", "https://webdav.yandex.ru"}, - {"webdav_login", "{webdav_login}"}, - {"webdav_password", "{webdav_password}"} - }; - - std::unique_ptr client(WebDAV::Client::Init(options)); - - auto remote_file = "dir/file.dat"; - char * buffer_ptr = nullptr; - long long int buffer_size = 0; - - client->async_download(remote_file, buffer_ptr, buffer_size, [remote_file](bool is_downloaded) - { - std::cout << remote_file << " resource is" << is_downloaded ? "" : "not" << "downloaded" << std::endl; - }); + /* + std::map options = + { + {"webdav_hostname", "https://webdav.yandex.ru"}, + {"webdav_username", "{webdav_username}"}, + {"webdav_password", "{webdav_password}"} + }; + + std::unique_ptr client{ new WebDAV::Client{ options } }; + + std::string remote_file = "dir/file.dat"; + char * buffer_ptr = nullptr; + unsigned long long buffer_size = 0; + + client->async_download(remote_file, buffer_ptr, buffer_size, [remote_file](bool is_downloaded) + { + std::cout << remote_file << " resource is" << (is_downloaded ? "" : "not") << "downloaded" << std::endl; + }); + */ } /// dir/file.dat resource is downloaded @@ -129,23 +134,32 @@ void async_download_to_buffer() void download_from_stream() { - std::map options = - { - {"webdav_hostname", "https://webdav.yandex.ru"}, - {"webdav_login", "{webdav_login}"}, - {"webdav_password", "{webdav_password}"} - }; + std::map options = + { + {"webdav_hostname", "https://webdav.yandex.ru"}, + {"webdav_username", "{webdav_username}"}, + {"webdav_password", "{webdav_password}"} + }; - std::unique_ptr client(WebDAV::Client::Init(options)); + std::unique_ptr client{ new WebDAV::Client{ options } }; - auto remote_file = "dir/file.dat"; - std::ofstream stream("/home/user/Downloads/file.dat"); + std::string remote_file = "dir/file.dat"; + std::ofstream stream("/home/user/Downloads/file.dat"); - bool is_downloaded = client->download_to(remote_file, stream); + bool is_downloaded = client->download_to(remote_file, stream); - std::cout << remote_file << " resource is" << is_downloaded ? "" : "not" << "downloaded" << std::endl; + std::cout << remote_file << " resource is" << (is_downloaded ? "" : "not") << "downloaded" << std::endl; } /// dir/file.dat resource is downloaded //! [download_from_stream] + +int main() +{ + download_to_file(); + download_to_buffer(); + async_download_to_file(); + async_download_to_buffer(); + download_from_stream(); +} diff --git a/examples/client/info.cpp b/examples/client/info.cpp index f64c048..5e79832 100644 --- a/examples/client/info.cpp +++ b/examples/client/info.cpp @@ -2,14 +2,14 @@ # __ __ _____ _____ # Project | | | | | \ / ___| # | |__| | | |\ \ / / -# | | | | ) ) ( ( +# | | | | ) ) ( ( # | /\ | | |/ / \ \___ # \_/ \_/ |_____/ \_____| # # Copyright (C) 2016, The WDC Project, , et al. # # This software is licensed as described in the file LICENSE, which -# you should have received as part of this distribution. +# you should have received as part of this distribution. # # You may opt to use, copy, modify, merge, publish, distribute and/or sell # copies of the Software, and permit persons to whom the Software is @@ -22,41 +22,61 @@ #include -std::ostream info_to_string(std::map & info) +#include +#include + +std::string info_to_string(std::map& info) { - std::ostream stream; - for (auto option :info) - { - stream << "/t" << option.first << ": " << option.second << std::endl; - } - return stream; + + std::stringstream stream; + for (const auto& option : info) + { + stream << "/t" << option.first << ": " << option.second << std::endl; + } + return stream.str(); } -int main() { +int main() +{ + + auto hostname_ptr = std::getenv("WEBDAV_HOSTNAME"); + auto username_ptr = std::getenv("WEBDAV_USERNAME"); + auto password_ptr = std::getenv("WEBDAV_PASSWORD"); + auto root_ptr = std::getenv("WEBDAV_ROOT"); + + if (hostname_ptr == nullptr) return -1; + if (username_ptr == nullptr) return -1; + if (password_ptr == nullptr) return -1; + + std::map options = + { + { "webdav_hostname", hostname_ptr }, + { "webdav_username", username_ptr }, + { "webdav_password", password_ptr } + }; - std::map options = - { - { "webdav_hostname", "https://webdav.yandex.ru" }, - { "webdav_login", "{webdav_login}" }, - { "webdav_password", "{webdav_password}" } - }; + if (root_ptr != nullptr) + { + options["webdav_root"] = root_ptr; + } - std::unique_ptr client(WebDAV::Client::Init(options)); + std::unique_ptr client{ new WebDAV::Client{ options } }; - auto remote_resources = { - "existing_file.dat", - "not_existing_file.dat", - "existing_directory", - "not_existing_directory" - }; + auto remote_resources = + { + "existing_file.dat", + "not_existing_file.dat", + "existing_directory", + "not_existing_directory" + }; - for (auto remote_resource : remote_resources) - { - auto info = client->info(remote_resource); - std::cout << "Information about " << remote_resource << ":" << std::endl; - std::cout << info_to_string(info); - std::cout << std::endl; - } + for (const auto& remote_resource : remote_resources) + { + auto info = client->info(remote_resource); + std::cout << "Information about " << remote_resource << ":" << std::endl; + std::cout << info_to_string(info); + std::cout << std::endl; + } } ///Information about existing_file: diff --git a/examples/client/init.cpp b/examples/client/init.cpp index c5e2f17..9615cab 100644 --- a/examples/client/init.cpp +++ b/examples/client/init.cpp @@ -2,14 +2,14 @@ # __ __ _____ _____ # Project | | | | | \ / ___| # | |__| | | |\ \ / / -# | | | | ) ) ( ( +# | | | | ) ) ( ( # | /\ | | |/ / \ \___ # \_/ \_/ |_____/ \_____| # # Copyright (C) 2016, The WDC Project, , et al. # # This software is licensed as described in the file LICENSE, which -# you should have received as part of this distribution. +# you should have received as part of this distribution. # # You may opt to use, copy, modify, merge, publish, distribute and/or sell # copies of the Software, and permit persons to whom the Software is @@ -22,58 +22,64 @@ #include +#include +#include + std::map base_options = - { - { "webdav_hostname", "https://webdav.yandex.ru" }, - { "webdav_login", "{webdav_login}" }, - { "webdav_password", "{webdav_password}" } - }; +{ + { "webdav_hostname", "https://webdav.yandex.ru" }, + { "webdav_username", "{webdav_username}" }, + { "webdav_password", "{webdav_password}" } +}; std::map options_with_proxy = - { - { "webdav_hostname", "https://webdav.yandex.ru" }, - { "webdav_login", "{webdav_login}" }, - { "webdav_password", "{webdav_password}" }, - { "proxy_hostname", "https://10.0.0.1:8080" }, - { "proxy_login", "{proxy_login}" }, - { "proxy_password", "{proxy_password}" } - }; +{ + { "webdav_hostname", "https://webdav.yandex.ru" }, + { "webdav_username", "{webdav_username}" }, + { "webdav_password", "{webdav_password}" }, + { "proxy_hostname", "https://10.0.0.1:8080" }, + { "proxy_username", "{proxy_username}" }, + { "proxy_password", "{proxy_password}" } +}; std::map options_with_cert = - { - { "webdav_hostname", "https://webdav.yandex.ru" }, - { "webdav_login", "{webdav_login}" }, - { "webdav_password", "{webdav_password}" }, - { "cert_path", "/etc/ssl/certs/client.crt" }, - { "key_path", "/etc/ssl/private/client.key" } - }; +{ + { "webdav_hostname", "https://webdav.yandex.ru" }, + { "webdav_username", "{webdav_username}" }, + { "webdav_password", "{webdav_password}" }, + { "cert_path", "/etc/ssl/certs/client.crt" }, + { "key_path", "/etc/ssl/private/client.key" } +}; -std::ostream options_to_string(std::map & options) +std::string options_to_string(const std::map& options) { - std::ostream stream; - for (auto option :options) - { - stream << "\t" << option.first << ": " << option.second << std::endl; - } - return stream; + std::stringstream stream; + for (const auto& option : options) + { + stream << "\t" << option.first << ": " << option.second << std::endl; + } + return stream.str(); } -int main() { +int main() +{ - auto various_options = { - base_options, - options_with_proxy, - options_with_cert - }; + auto various_options = + { + base_options, + options_with_proxy, + options_with_cert + }; - for (auto options : various_options) { - std::unique_ptr client(WebDAV::Client::Init(options)); - bool is_connected = client->check(); - std::cout << "Client with options: " << std::endl; - std::cout << options_to_string(options); - std::cout << " is " << is_connected ? " " : "not " << "connected" << std::endl; - std::cout << endl; - } + for (const auto& options : various_options) + { + std::unique_ptr client{ new WebDAV::Client{ options } }; + bool is_connected = client->check(); + std::cout << "Client with options: " << std::endl; + std::cout << options_to_string(options); + std::cout << " is " << (is_connected ? " " : "not ") << "connected" << std::endl; + std::cout << std::endl; + } } /// Client with options: diff --git a/examples/client/list.cpp b/examples/client/list.cpp index 0fe0f1d..7719075 100644 --- a/examples/client/list.cpp +++ b/examples/client/list.cpp @@ -2,14 +2,14 @@ # __ __ _____ _____ # Project | | | | | \ / ___| # | |__| | | |\ \ / / -# | | | | ) ) ( ( +# | | | | ) ) ( ( # | /\ | | |/ / \ \___ # \_/ \_/ |_____/ \_____| # # Copyright (C) 2016, The WDC Project, , et al. # # This software is licensed as described in the file LICENSE, which -# you should have received as part of this distribution. +# you should have received as part of this distribution. # # You may opt to use, copy, modify, merge, publish, distribute and/or sell # copies of the Software, and permit persons to whom the Software is @@ -22,40 +22,61 @@ #include -std::ostream resources_to_string(std::vector & resources) +#include +#include + +std::string resources_to_string(std::vector& resources) { - std::ostream stream; - for (auto resource : resources) - { - stream << "\t" << "- " << resource << std::endl; - } - return stream; + std::stringstream ss; + for (const auto& resource : resources) + { + ss << "\t" << "- " << resource << std::endl; + } + return ss.str(); } -int main() { +int main() +{ + + auto hostname_ptr = std::getenv("WEBDAV_HOSTNAME"); + auto username_ptr = std::getenv("WEBDAV_USERNAME"); + auto password_ptr = std::getenv("WEBDAV_PASSWORD"); + auto root_ptr = std::getenv("WEBDAV_ROOT"); + + if (hostname_ptr == nullptr) return -1; + if (username_ptr == nullptr) return -1; + if (password_ptr == nullptr) return -1; + + std::map options = + { + { "webdav_hostname", hostname_ptr }, + { "webdav_username", username_ptr }, + { "webdav_password", password_ptr } + }; - std::map options = - { - { "webdav_hostname", "https://webdav.yandex.ru" }, - { "webdav_login", "{webdav_login}" }, - { "webdav_password", "{webdav_password}" } - }; + if (root_ptr != nullptr) + { + options["webdav_root"] = root_ptr; + } - std::unique_ptr client(WebDAV::Client::Init(options)); + std::unique_ptr client{ new WebDAV::Client{ options } }; - auto remote_resources = { - "existing_file.dat", - "not_existing_file.dat", - "existing_directory", - "not_existing_directory" - }; + auto remote_resources = + { + "/", + "existing_file.dat", + "not_existing_file.dat", + "existing_directory", + "not_existing_directory" + }; - for (auto remote_resource : remote_resources) { - auto resources = client->list(remote_resource); - std::cout << remote_resource << " resource contain:" << std::endl; - std::cout << resources_to_string(resources); - std::cout << std::endl; - } + for (const auto& remote_resource : remote_resources) + { + auto resources = client->list(remote_resource); + std::cout << remote_resource << " resource contain:" << std::endl; + std::cout << resources_to_string(resources); + std::cout << std::endl; + } } /// existing_file.dat resource contain: diff --git a/examples/client/mkdir.cpp b/examples/client/mkdir.cpp index a98d2cc..a0396c7 100644 --- a/examples/client/mkdir.cpp +++ b/examples/client/mkdir.cpp @@ -2,14 +2,14 @@ # __ __ _____ _____ # Project | | | | | \ / ___| # | |__| | | |\ \ / / -# | | | | ) ) ( ( +# | | | | ) ) ( ( # | /\ | | |/ / \ \___ # \_/ \_/ |_____/ \_____| # # Copyright (C) 2016, The WDC Project, , et al. # # This software is licensed as described in the file LICENSE, which -# you should have received as part of this distribution. +# you should have received as part of this distribution. # # You may opt to use, copy, modify, merge, publish, distribute and/or sell # copies of the Software, and permit persons to whom the Software is @@ -22,32 +22,37 @@ #include -int main() { - - std::map options = - { - { "webdav_hostname", "https://webdav.yandex.ru" }, - { "webdav_login", "{webdav_login}" }, - { "webdav_password", "{webdav_password}" } - }; - - std::unique_ptr client(WebDAV::Client::Init(options)); - - auto remote_directories = { - "existing_directory", - "existing_directory/new_directory", - "not_existing_directory/new_directory", - }; - - for (auto remote_directory : remote_directories) { - bool is_created = client->create_directory(remote_directory); - std::cout << "Directory: " << remote_directory << " is " << is_existed ? "" : "not " << "created" << std::endl; - } - - auto remote_directory = "not_existing_directory/new_directory"; - bool recursive = true; - bool is_created = client->create_directory("not_existing_directory/new_directory", recursive); - std::cout << "Directory: " << remote_directory << " is " << is_existed ? "" : "not " << "created" << std::endl; +#include + +int main() +{ + + std::map options = + { + { "webdav_hostname", "https://webdav.yandex.ru" }, + { "webdav_username", "{webdav_username}" }, + { "webdav_password", "{webdav_password}" } + }; + + std::unique_ptr client{ new WebDAV::Client{ options } }; + + auto remote_directories = + { + "existing_directory", + "existing_directory/new_directory", + "not_existing_directory/new_directory", + }; + + for (const auto& remote_directory : remote_directories) + { + bool is_created = client->create_directory(remote_directory); + std::cout << "Directory: " << remote_directory << " is " << (is_created ? "" : "not ") << "created" << std::endl; + } + + auto remote_directory = "not_existing_directory/new_directory"; + bool recursive = true; + bool is_created = client->create_directory("not_existing_directory/new_directory", recursive); + std::cout << "Directory: " << remote_directory << " is " << (is_created ? "" : "not ") << "created" << std::endl; } /// Directory: existing_directory is created diff --git a/examples/client/move.cpp b/examples/client/move.cpp index 500197a..d72f09a 100644 --- a/examples/client/move.cpp +++ b/examples/client/move.cpp @@ -2,14 +2,14 @@ # __ __ _____ _____ # Project | | | | | \ / ___| # | |__| | | |\ \ / / -# | | | | ) ) ( ( +# | | | | ) ) ( ( # | /\ | | |/ / \ \___ # \_/ \_/ |_____/ \_____| # # Copyright (C) 2016, The WDC Project, , et al. # # This software is licensed as described in the file LICENSE, which -# you should have received as part of this distribution. +# you should have received as part of this distribution. # # You may opt to use, copy, modify, merge, publish, distribute and/or sell # copies of the Software, and permit persons to whom the Software is @@ -22,42 +22,46 @@ #include -std::ostream resources_to_string(std::vector & resources) +#include +#include + +std::string resources_to_string(const std::vector& resources) { - std::ostream stream; - for (auto resource : resources) - { - stream << "\t" << "- " << resource << std::endl; - } - return stream; + std::stringstream stream; + for (const auto& resource : resources) + { + stream << "\t" << "- " << resource << std::endl; + } + return stream.str(); } -int main() { +int main() +{ - std::map options = - { - { "webdav_hostname", "https://webdav.yandex.ru" }, - { "webdav_login", "{webdav_login}" }, - { "webdav_password", "{webdav_password}" } - }; + std::map options = + { + { "webdav_hostname", "https://webdav.yandex.ru" }, + { "webdav_username", "{webdav_username}" }, + { "webdav_password", "{webdav_password}" } + }; - std::unique_ptr client(WebDAV::Client::Init(options)); + std::unique_ptr client{ new WebDAV::Client{ options } }; - auto remote_file = "file.dat"; - auto remote_directory = "dir/"; - auto new_remote_file = "file2.dat"; - auto new_remote_directory = "dir2/"; + auto remote_file = "file.dat"; + auto remote_directory = "dir/"; + auto new_remote_file = "file2.dat"; + auto new_remote_directory = "dir2/"; - auto resources = client->list(); - std::cout << "\"/\" resource contain:" << std::endl; - std::cout << resources_to_string(resources) << std::endl; + auto resources = client->list(); + std::cout << "\"/\" resource contain:" << std::endl; + std::cout << resources_to_string(resources) << std::endl; - client->move(remote_file, new_remote_file); - client->move(remote_directory, new_remote_directory); + client->move(remote_file, new_remote_file); + client->move(remote_directory, new_remote_directory); - resources = client.list(); - std::cout << "\"/\" resource contain:" << std::endl; - std::cout << resources_to_string(resources) << std::endl; + resources = client->list(); + std::cout << "\"/\" resource contain:" << std::endl; + std::cout << resources_to_string(resources) << std::endl; } /// "/" resource contain: diff --git a/examples/client/clean.cpp b/examples/client/remove.cpp similarity index 55% rename from examples/client/clean.cpp rename to examples/client/remove.cpp index 36eb6a1..78aa6cb 100644 --- a/examples/client/clean.cpp +++ b/examples/client/remove.cpp @@ -2,14 +2,14 @@ # __ __ _____ _____ # Project | | | | | \ / ___| # | |__| | | |\ \ / / -# | | | | ) ) ( ( +# | | | | ) ) ( ( # | /\ | | |/ / \ \___ # \_/ \_/ |_____/ \_____| # # Copyright (C) 2016, The WDC Project, , et al. # # This software is licensed as described in the file LICENSE, which -# you should have received as part of this distribution. +# you should have received as part of this distribution. # # You may opt to use, copy, modify, merge, publish, distribute and/or sell # copies of the Software, and permit persons to whom the Software is @@ -22,31 +22,37 @@ #include -int main() { - - std::map options = - { - { "webdav_hostname", "https://webdav.yandex.ru" }, - { "webdav_login", "{webdav_login}" }, - { "webdav_password", "{webdav_password}" } - }; - - std::unique_ptr client(WebDAV::Client::Init(options)); - bool is_connected = client->check(); - - auto remote_resources = { - "existing_file.dat", - "not_existing_file.dat", - "existing_directory", - "existing_directory/", - "not_existing_directory", - "not_existing_directory/" - }; - - for (auto remote_resource : remote_resources) { - bool is_clean = client->clean(remote_resource); - std::cout << "Resource: " << remote_resource << " is " << is_clean ? "" : "not " << "clean" << std::endl; - } +#include + +int main() +{ + + std::map options = + { + { "webdav_hostname", "https://webdav.yandex.ru" }, + { "webdav_username", "{webdav_username}" }, + { "webdav_password", "{webdav_password}" } + }; + + std::unique_ptr client{ new WebDAV::Client{ options } }; + + bool is_connected = client->check(); + + auto remote_resources = + { + "existing_file.dat", + "not_existing_file.dat", + "existing_directory", + "existing_directory/", + "not_existing_directory", + "not_existing_directory/" + }; + + for (const auto& remote_resource : remote_resources) + { + bool is_clean = client->clean(remote_resource); + std::cout << "Resource: " << remote_resource << " is " << (is_clean ? "" : "not ") << "clean" << std::endl; + } } /// Resource: existing_file.dat is clean diff --git a/examples/client/size.cpp b/examples/client/size.cpp index e112de4..69f0b2a 100644 --- a/examples/client/size.cpp +++ b/examples/client/size.cpp @@ -2,14 +2,14 @@ # __ __ _____ _____ # Project | | | | | \ / ___| # | |__| | | |\ \ / / -# | | | | ) ) ( ( +# | | | | ) ) ( ( # | /\ | | |/ / \ \___ # \_/ \_/ |_____/ \_____| # # Copyright (C) 2016, The WDC Project, , et al. # # This software is licensed as described in the file LICENSE, which -# you should have received as part of this distribution. +# you should have received as part of this distribution. # # You may opt to use, copy, modify, merge, publish, distribute and/or sell # copies of the Software, and permit persons to whom the Software is @@ -22,18 +22,22 @@ #include -int main() { +#include - std::map options = - { - { "webdav_hostname", "https://webdav.yandex.ru" }, - { "webdav_login", "{webdav_login}" }, - { "webdav_password", "{webdav_password}" } - }; +int main() +{ - std::unique_ptr client(WebDAV::Client::Init(options)); - auto free_size = client->free_size(); - std::cout << "Free size: " << free_size << " bytes" << std::endl; + std::map options = + { + { "webdav_hostname", "https://webdav.yandex.ru" }, + { "webdav_username", "{webdav_username}" }, + { "webdav_password", "{webdav_password}" } + }; + + std::unique_ptr client{ new WebDAV::Client{ options } }; + + auto free_size = client->free_size(); + std::cout << "Free size: " << free_size << " bytes" << std::endl; } /// Free size: 8234213123 bytes diff --git a/examples/client/upload.cpp b/examples/client/upload.cpp index eb6b505..0ae6284 100644 --- a/examples/client/upload.cpp +++ b/examples/client/upload.cpp @@ -2,14 +2,14 @@ # __ __ _____ _____ # Project | | | | | \ / ___| # | |__| | | |\ \ / / -# | | | | ) ) ( ( +# | | | | ) ) ( ( # | /\ | | |/ / \ \___ # \_/ \_/ |_____/ \_____| # # Copyright (C) 2016, The WDC Project, , et al. # # This software is licensed as described in the file LICENSE, which -# you should have received as part of this distribution. +# you should have received as part of this distribution. # # You may opt to use, copy, modify, merge, publish, distribute and/or sell # copies of the Software, and permit persons to whom the Software is @@ -22,26 +22,28 @@ #include +#include +#include + //! [upload_from_file] void upload_from_file() { - std::map options = - { - {"webdav_hostname", "https://webdav.yandex.ru"}, - {"webdav_login", "{webdav_login}"}, - {"webdav_password", "{webdav_password}"} - }; - + std::map options = + { + {"webdav_hostname", "https://webdav.yandex.ru"}, + {"webdav_username", "{webdav_username}"}, + {"webdav_password", "{webdav_password}"} + }; - std::unique_ptr client(WebDAV::Client::Init(options)); + std::unique_ptr client{ new WebDAV::Client{ options } }; - auto remote_file = "dir/file.dat"; - auto local_file = "/home/user/Downloads/file.dat"; + std::string remote_file = "dir/file.dat"; + std::string local_file = "/home/user/Downloads/file.dat"; - bool is_uploaded = client->upload(remote_file, local_file); + bool is_uploaded = client->upload(remote_file, local_file); - std::cout << remote_file << " resource is" << is_uploaded ? "" : "not" << "uploaded" << std::endl; + std::cout << remote_file << " resource is" << (is_uploaded ? "" : "not") << "uploaded" << std::endl; } /// dir/file.dat resource is uploaded @@ -52,22 +54,22 @@ void upload_from_file() void async_upload_from_file() { - std::map options = - { - {"webdav_hostname", "https://webdav.yandex.ru"}, - {"webdav_login", "{webdav_login}"}, - {"webdav_password", "{webdav_password}"} - }; - - std::unique_ptr client(WebDAV::Client::Init(options)); - - auto remote_file = "dir/file.dat"; - auto local_file = "/home/user/Downloads/file.dat"; - - client->async_upload(remote_file, local_file, [remote_file](bool is_uploaded) - { - std::cout << remote_file << " resource is" << is_uploaded ? "" : "not" << "uploaded" << std::endl; - }); + std::map options = + { + {"webdav_hostname", "https://webdav.yandex.ru"}, + {"webdav_username", "{webdav_username}"}, + {"webdav_password", "{webdav_password}"} + }; + + std::unique_ptr client{ new WebDAV::Client{ options } }; + + std::string remote_file = "dir/file.dat"; + std::string local_file = "/home/user/Downloads/file.dat"; + + client->async_upload(remote_file, local_file, [remote_file](bool is_uploaded) + { + std::cout << remote_file << " resource is" << (is_uploaded ? "" : "not") << "uploaded" << std::endl; + }); } /// dir/file.dat resource is uploaded @@ -78,22 +80,22 @@ void async_upload_from_file() void upload_from_buffer() { - std::map options = - { - {"webdav_hostname", "https://webdav.yandex.ru"}, - {"webdav_login", "{webdav_login}"}, - {"webdav_password", "{webdav_password}"} - }; + std::map options = + { + {"webdav_hostname", "https://webdav.yandex.ru"}, + {"webdav_username", "{webdav_username}"}, + {"webdav_password", "{webdav_password}"} + }; - std::unique_ptr client(WebDAV::Client::Init(options)); + std::unique_ptr client{ new WebDAV::Client{ options } }; - auto remote_file = "dir/file.dat"; - char * buffer_ptr = nullptr; - long long int buffer_size = 0; + std::string remote_file = "dir/file.dat"; + char* buffer_ptr = nullptr; + unsigned long long buffer_size = 0; - bool is_uploaded = client->upload(remote_file, buffer_ptr, buffer_size); + bool is_uploaded = client->upload_from(remote_file, buffer_ptr, buffer_size); - std::cout << remote_file << " resource is" << is_uploaded ? "" : "not" << "uploaded" << std::endl; + std::cout << remote_file << " resource is" << (is_uploaded ? "" : "not") << "uploaded" << std::endl; } /// dir/file.dat resource is uploaded @@ -104,23 +106,24 @@ void upload_from_buffer() void async_upload_from_buffer() { - std::map options = - { - {"webdav_hostname", "https://webdav.yandex.ru"}, - {"webdav_login", "{webdav_login}"}, - {"webdav_password", "{webdav_password}"} - }; - - std::unique_ptr client(WebDAV::Client::Init(options)); - - auto remote_file = "dir/file.dat"; - char * buffer_ptr = nullptr; - long long int buffer_size = 0; - - client->async_upload(remote_file, buffer_ptr, buffer_size, [remote_file](bool is_uploaded) - { - std::cout << remote_file << " resource is" << is_uploaded ? "" : "not" << "uploaded" << std::endl; - }); + /*std::map options = + { + {"webdav_hostname", "https://webdav.yandex.ru"}, + {"webdav_username", "{webdav_username}"}, + {"webdav_password", "{webdav_password}"} + }; + + std::unique_ptr client{ new WebDAV::Client{ options } }; + + std::string remote_file = "dir/file.dat"; + char * buffer_ptr = nullptr; + unsigned long long buffer_size = 0; + + client->async_upload(remote_file, buffer_ptr, buffer_size, [remote_file](bool is_uploaded) + { + std::cout << remote_file << " resource is" << (is_uploaded ? "" : "not") << "uploaded" << std::endl; + }); + */ } /// dir/file.dat resource is uploaded @@ -131,23 +134,32 @@ void async_upload_from_buffer() void upload_from_stream() { - std::map options = - { - {"webdav_hostname", "https://webdav.yandex.ru"}, - {"webdav_login", "{webdav_login}"}, - {"webdav_password", "{webdav_password}"} - }; + std::map options = + { + {"webdav_hostname", "https://webdav.yandex.ru"}, + {"webdav_username", "{webdav_username}"}, + {"webdav_password", "{webdav_password}"} + }; - std::unique_ptr client(WebDAV::Client::Init(options)); + std::unique_ptr client{ new WebDAV::Client{ options } }; - auto remote_file = "dir/file.dat"; - std::ifstream stream("/home/user/Downloads/file.dat"); + std::string remote_file = "dir/file.dat"; + std::ifstream stream("/home/user/Downloads/file.dat"); - bool is_uploaded = client->upload_from(remote_file, stream); + bool is_uploaded = client->upload_from(remote_file, stream); - std::cout << remote_file << " resource is" << is_uploaded ? "" : "not" << "uploaded" << std::endl; + std::cout << remote_file << " resource is" << (is_uploaded ? "" : "not") << "uploaded" << std::endl; } /// dir/file.dat resource is uploaded //! [upload_from_stream] + +int main() +{ + upload_from_file(); + upload_from_buffer(); + upload_from_stream(); + async_upload_from_file(); + async_upload_from_buffer(); +} diff --git a/include/webdav/client.hpp b/include/webdav/client.hpp index 9b7c993..51efd1d 100644 --- a/include/webdav/client.hpp +++ b/include/webdav/client.hpp @@ -2,14 +2,14 @@ # __ __ _____ _____ # Project | | | | | \ / ___| # | |__| | | |\ \ / / -# | | | | ) ) ( ( +# | | | | ) ) ( ( # | /\ | | |/ / \ \___ # \_/ \_/ |_____/ \_____| # -# Copyright (C) 2016, The WDC Project, , et al. +# Copyright (C) 2018, The WDC Project, , et al. # # This software is licensed as described in the file LICENSE, which -# you should have received as part of this distribution. +# you should have received as part of this distribution. # # You may opt to use, copy, modify, merge, publish, distribute and/or sell # copies of the Software, and permit persons to whom the Software is @@ -20,9 +20,8 @@ # ############################################################################*/ -#ifndef WEBDAV_CLIENT_H -#define WEBDAV_CLIENT_H -#pragma once +#ifndef WEBDAV_CLIENT_HPP +#define WEBDAV_CLIENT_HPP #include #include @@ -32,239 +31,289 @@ namespace WebDAV { - using progress_t = std::function ; - - using callback_t = std::function ; - - using strings_t = std::vector; - using dict_t = std::map; - - /// - /// \brief WebDAV Client - /// \author designerror - /// \version 1.0.1 - /// \date 08/11/2016 - /// - class Client - { - public: - - /// - /// \param[in] webdav_hostname - /// \param[in] webdav_root - /// \param[in] webdav_login - /// \param[in] webdav_password - /// \param[in] proxy_hostname - /// \param[in] proxy_login - /// \param[in] proxy_password - /// \param[in] cert_path - /// \param[in] key_path - /// \include client/init.cpp - /// - static auto Init(const dict_t& options) noexcept -> Client *; - - /// This function releases resources acquired by curl_global_init - static void Cleanup() noexcept; - - /// - /// Get free size of the WebDAV server - /// \return size in bytes - /// \include client/size.cpp - /// - auto free_size() const noexcept -> unsigned long long; - - /// - /// Check for existence of a remote resource - /// \param[in] remote_resource - /// \include client/check.cpp - /// - auto check(const std::string& remote_resource = "/") const noexcept -> bool; - - /// - /// Get information of a remote resource - /// \param[in] remote_resource - /// \include client/info.cpp - /// - auto info(const std::string& remote_resource) const noexcept -> dict_t; - - /// - /// Clean an remote resource - /// \param[in] remote_resource - /// \include client/clean.cpp - /// - auto clean(const std::string& remote_resource) const noexcept -> bool; - - /// - /// Checks whether the resource directory - /// \param[in] remote_resource - /// - auto is_dir(const std::string& remote_resource) const noexcept -> bool; - - /// - /// List a remote directory - /// \param[in] remote_directory - /// \include client/list.cpp - /// - auto list(const std::string& remote_directory = "") const noexcept -> strings_t; - - /// - /// Create a remote directory - /// \param[in] remote_directory - /// \param[in] recursive - /// \include client/mkdir.cpp - /// - auto create_directory( - const std::string& remote_directory, - bool recursive = false - ) const noexcept -> bool; - - /// - /// Move a remote resource - /// \param[in] remote_source_resource - /// \param[in] remote_destination_resource - /// \include client/move.cpp - /// - auto move( - const std::string& remote_source_resource, - const std::string& remote_destination_resource - ) const noexcept -> bool; - - /// - /// Copy a remote resource - /// \param[in] remote_source_resource - /// \param[in] remote_destination_resource - /// \include client/copy.cpp - /// - auto copy( - const std::string& remote_source_resource, - const std::string& remote_destination_resource - ) const noexcept -> bool; - - /// - /// Download a remote file to a local file - /// \param[in] remote_file - /// \param[in] local_file - /// \param[in] progress - /// \snippet client/download.cpp download_to_file - /// - auto download( - const std::string& remote_file, - const std::string& local_file, - progress_t progress = nullptr - ) const noexcept -> bool; - - /// - /// Download a remote file to a buffer - /// \param[in] remote_file - /// \param[out] buffer_ptr - /// \param[out] buffer_size - /// \param[in] progress - /// \snippet client/download.cpp download_to_buffer - /// - auto download_to( - const std::string& remote_file, - char * & buffer_ptr, - unsigned long long int & buffer_size, - progress_t progress = nullptr - ) const noexcept -> bool; - - /// - /// Download a remote file to a stream - /// \param[in] remote_file - /// \param[out] stream - /// \param[in] progress - /// \snippet client/download.cpp download_to_stream - /// - auto download_to( - const std::string& remote_file, - std::ostream& stream, - progress_t progress = nullptr - ) const noexcept -> bool; - - /// - /// Asynchronously download a remote file to a local file - /// \param[in] remote_file - /// \param[in] local_file - /// \param[in] callback - /// \param[in] progress - /// \snippet client/download.cpp async_download_to_file - /// - auto async_download( - const std::string& remote_file, - const std::string& local_file, - callback_t callback = nullptr, - progress_t progress = nullptr - ) const noexcept -> void; - - /// - /// Upload a remote file from a local file - /// \param[in] remote_file - /// \param[in] local_file - /// \param[in] progress - /// \snippet client/upload.cpp upload_from_file - /// - auto upload( - const std::string& remote_file, - const std::string& local_file, - progress_t progress = nullptr - ) const noexcept -> bool; - - /// - /// Upload a remote file from a buffer - /// \param[in] remote_file - /// \param[in] buffer_ptr - /// \param[in] buffer_size - /// \param[in] progress - /// \snippet client/upload.cpp upload_from_buffer - /// - auto upload_from( - const std::string& remote_file, - char * buffer_ptr, - unsigned long long int buffer_size, - progress_t progress = nullptr - ) const noexcept -> bool; - - /// - /// Upload a remote file from a stream - /// \param[in] remote_file - /// \param[in] stream - /// \param[in] progress - /// \snippet client/upload.cpp upload_from_stream - /// - auto upload_from( - const std::string& remote_file, - std::istream& stream, - progress_t progress = nullptr - ) const noexcept -> bool; - - /// - /// Asynchronously upload a remote file from a local file - /// \param[in] remote_file - /// \param[in] local_file - /// \param[in] callback - /// \param[in] progress - /// \snippet client/upload.cpp async_upload_from_file - /// - auto async_upload( - const std::string& remote_file, - const std::string& local_file, - callback_t callback = nullptr, - progress_t progress = nullptr - ) const noexcept -> void; - - - virtual ~Client() {}; - - protected: - - enum { buffer_size = 1000 * 1000 }; - - Client() {} - }; -} + using progress_t = std::function ; + + using callback_t = std::function ; + + using strings_t = std::vector; + using dict_t = std::map; + + /// + /// \brief WebDAV Client + /// \author designerror + /// \version 1.1.4 + /// \date 3/16/2018 + /// + class Client + { + public: + + /// + /// \param[in] webdav_hostname + /// \param[in] webdav_root + /// \param[in] webdav_username + /// \param[in] webdav_password + /// \param[in] proxy_hostname + /// \param[in] proxy_username + /// \param[in] proxy_password + /// \param[in] cert_path + /// \param[in] key_path + /// \include client/init.cpp + /// + explicit Client(const dict_t& options); + + /// + /// Get free size of the WebDAV server + /// \return size in bytes + /// \include client/size.cpp + /// + auto free_size() const -> unsigned long long; + + /// + /// Check for existence of a remote resource + /// \param[in] remote_resource + /// \include client/check.cpp + /// + auto check(const std::string& remote_resource = "/") const -> bool; + + /// + /// Get information of a remote resource + /// \param[in] remote_resource + /// \include client/info.cpp + /// + auto info(const std::string& remote_resource) const -> dict_t; + + /// + /// Clean an remote resource + /// \param[in] remote_resource + /// \include client/clean.cpp + /// + auto clean(const std::string& remote_resource) const -> bool; + + /// + /// Checks whether the resource directory + /// \param[in] remote_resource + /// + auto is_directory(const std::string& remote_resource) const -> bool; + + /// + /// List a remote directory + /// \param[in] remote_directory + /// \include client/list.cpp + /// + auto list(const std::string& remote_directory = "") const -> strings_t; + + /// + /// Create a remote directory + /// \param[in] remote_directory + /// \param[in] recursive + /// \include client/mkdir.cpp + /// + auto create_directory( + const std::string& remote_directory, + bool recursive = false + ) const -> bool; + + /// + /// Move a remote resource + /// \param[in] remote_source_resource + /// \param[in] remote_destination_resource + /// \include client/move.cpp + /// + auto move( + const std::string& remote_source_resource, + const std::string& remote_destination_resource + ) const -> bool; + + /// + /// Copy a remote resource + /// \param[in] remote_source_resource + /// \param[in] remote_destination_resource + /// \include client/copy.cpp + /// + auto copy( + const std::string& remote_source_resource, + const std::string& remote_destination_resource + ) const -> bool; + + /// + /// Download a remote file to a local file + /// \param[in] remote_file + /// \param[in] local_file + /// \param[in] progress + /// \snippet client/download.cpp download_to_file + /// + auto download( + const std::string& remote_file, + const std::string& local_file, + progress_t progress = nullptr + ) const -> bool; + + /// + /// Download a remote file to a buffer + /// \param[in] remote_file + /// \param[out] buffer_ptr + /// \param[out] buffer_size + /// \param[in] progress + /// \snippet client/download.cpp download_to_buffer + /// + auto download_to( + const std::string& remote_file, + char*& buffer_ptr, + unsigned long long& buffer_size, + progress_t progress = nullptr + ) const -> bool; + + /// + /// Download a remote file to a stream + /// \param[in] remote_file + /// \param[out] stream + /// \param[in] progress + /// \snippet client/download.cpp download_to_stream + /// + auto download_to( + const std::string& remote_file, + std::ostream& stream, + progress_t progress = nullptr + ) const -> bool; + + /// + /// Asynchronously download a remote file to a local file + /// \param[in] remote_file + /// \param[in] local_file + /// \param[in] callback + /// \param[in] progress + /// \snippet client/download.cpp async_download_to_file + /// + auto async_download( + const std::string& remote_file, + const std::string& local_file, + callback_t callback = nullptr, + progress_t progress = nullptr + ) const -> void; + + /// + /// Upload a remote file from a local file + /// \param[in] remote_file + /// \param[in] local_file + /// \param[in] progress + /// \snippet client/upload.cpp upload_from_file + /// + auto upload( + const std::string& remote_file, + const std::string& local_file, + progress_t progress = nullptr + ) const -> bool; + + /// + /// Upload a remote file from a buffer + /// \param[in] remote_file + /// \param[in] buffer_ptr + /// \param[in] buffer_size + /// \param[in] progress + /// \snippet client/upload.cpp upload_from_buffer + /// + auto upload_from( + const std::string& remote_file, + char* buffer_ptr, + unsigned long long buffer_size, + progress_t progress = nullptr + ) const -> bool; + + /// + /// Upload a remote file from a stream + /// \param[in] remote_file + /// \param[in] stream + /// \param[in] progress + /// \snippet client/upload.cpp upload_from_stream + /// + auto upload_from( + const std::string& remote_file, + std::istream& stream, + progress_t progress = nullptr + ) const -> bool; + + /// + /// Asynchronously upload a remote file from a local file + /// \param[in] remote_file + /// \param[in] local_file + /// \param[in] callback + /// \param[in] progress + /// \snippet client/upload.cpp async_upload_from_file + /// + auto async_upload( + const std::string& remote_file, + const std::string& local_file, + callback_t callback = nullptr, + progress_t progress = nullptr + ) const -> void; + + private: + + auto sync_download( + const std::string& remote_file, + const std::string& local_file, + callback_t callback = nullptr, + progress_t progress = nullptr + ) const -> bool; + + auto sync_download_to( + const std::string& remote_file, + char*& buffer_ptr, + unsigned long long& buffer_size, + callback_t callback = nullptr, + progress_t progress = nullptr + ) const -> bool; + + bool sync_download_to( + const std::string& remote_file, + std::ostream& stream, + callback_t callback = nullptr, + progress_t progress = nullptr + ) const ; + + bool sync_upload( + const std::string& remote_file, + const std::string& local_file, + callback_t callback = nullptr, + progress_t progress = nullptr + ) const ; + + auto sync_upload_from( + const std::string& remote_file, + char* buffer_ptr, + unsigned long long buffer_size, + callback_t callback = nullptr, + progress_t progress = nullptr + ) const -> bool; + + auto sync_upload_from( + const std::string& remote_file, + std::istream& stream, + callback_t callback = nullptr, + progress_t progress = nullptr + ) const -> bool; + + enum { buffer_size = 1000 * 1000 }; + + std::string webdav_hostname; + std::string webdav_root; + std::string webdav_username; + std::string webdav_password; + + std::string proxy_hostname; + std::string proxy_username; + std::string proxy_password; + + std::string cert_path; + std::string key_path; + + dict_t options() const ; + }; +} // namespace WebDAV #endif diff --git a/scripts/wdc.pc.in b/scripts/wdc.pc.in deleted file mode 100644 index 9541c3a..0000000 --- a/scripts/wdc.pc.in +++ /dev/null @@ -1,10 +0,0 @@ -prefix=@CMAKE_INSTALL_PREFIX@ -exec_prefix=${prefix} -libdir=${exec_prefix}/lib -includedir=${exec_prefix}/include -Name: wdc -Description: Modern and convenient C++ WebDAV Client library -Version: @WDC_VERSION@ -Libs: -L${libdir} -lwdc -Libs.private: -lpthread -lpugixml -lm -lcurl -lssl -lcrypto -Cflags: -I${includedir} diff --git a/sources/callback.cpp b/sources/callback.cpp index cfa92b3..d67a612 100644 --- a/sources/callback.cpp +++ b/sources/callback.cpp @@ -2,14 +2,14 @@ # __ __ _____ _____ # Project | | | | | \ / ___| # | |__| | | |\ \ / / -# | | | | ) ) ( ( +# | | | | ) ) ( ( # | /\ | | |/ / \ \___ # \_/ \_/ |_____/ \_____| # -# Copyright (C) 2016, The WDC Project, , et al. +# Copyright (C) 2018, The WDC Project, , et al. # # This software is licensed as described in the file LICENSE, which -# you should have received as part of this distribution. +# you should have received as part of this distribution. # # You may opt to use, copy, modify, merge, publish, distribute and/or sell # copies of the Software, and permit persons to whom the Software is @@ -28,82 +28,82 @@ namespace WebDAV { - namespace Callback - { - namespace Read - { - size_t stream(char * ptr, size_t item_size, size_t item_count, void * stream) - { - auto in_stream = (std::istream *)stream; - auto read_bytes = static_cast(item_size * item_count); - auto position = static_cast(in_stream->tellg()); - in_stream->seekg(0, std::ios::end); - auto size = static_cast(in_stream->tellg()); - in_stream->seekg(position, std::ios::beg); - auto rest_bytes = size - position; - read_bytes = std::min(read_bytes, rest_bytes); - in_stream->read(ptr, read_bytes); - return read_bytes; - } - - size_t buffer(char * ptr, size_t item_size, size_t item_count, void * buffer) - { - auto data = (Data*)buffer; - auto size = static_cast(item_size * item_count); - auto rest_bytes = data->size - data->position; - auto copied_bytes = std::min(size, rest_bytes); - memcpy(ptr, data->buffer, copied_bytes); - data->position += copied_bytes; - return copied_bytes; - } - } - - namespace Write - { - size_t stream(char * ptr, size_t item_size, size_t item_count, void * stream) - { - auto out_stream = (std::ostream *)stream; - size_t write_bytes = item_size * item_count; - out_stream->write(ptr, write_bytes); - return write_bytes; - } - - size_t buffer(char * ptr, size_t item_size, size_t item_count, void * buffer) - { - auto data = (Data*)buffer; - auto size = static_cast(item_size * item_count); - auto rest_bytes = data->size - data->position; - auto copied_bytes = std::min(size, rest_bytes); - memcpy(data->buffer, data->buffer, copied_bytes); - data->position += copied_bytes; - return copied_bytes; - } - } - - namespace Append - { - size_t buffer(char * ptr, size_t item_size, size_t item_count, void * buffer) - { - auto data = (Data*)buffer; - auto append_size = item_size * item_count; - auto new_buffer_size = data->size + append_size; - auto new_buffer = new char[new_buffer_size]; - if (data->size != 0) memcpy(new_buffer, data->buffer, data->size); - memcpy(new_buffer + data->size, ptr, append_size); - delete[] data->buffer; - data->buffer = new_buffer; - data->size = new_buffer_size; - return append_size; - } - - size_t stream(char * ptr, size_t item_size, size_t item_count, void * stream) - { - auto out_stream = (std::ostream *)stream; - size_t write_bytes = item_size * item_count; - out_stream->seekp(0, std::ios::end); - out_stream->write(ptr, write_bytes); - return write_bytes; - } - } - } -} + namespace Callback + { + namespace Read + { + size_t stream(char* ptr, size_t item_size, size_t item_count, void* stream) + { + auto in_stream = reinterpret_cast(stream); + auto read_bytes = static_cast(item_size * item_count); + auto position = static_cast(in_stream->tellg()); + in_stream->seekg(0, std::ios::end); + auto size = static_cast(in_stream->tellg()); + in_stream->seekg(position, std::ios::beg); + auto rest_bytes = size - position; + read_bytes = std::min(read_bytes, rest_bytes); + in_stream->read(ptr, read_bytes); + return read_bytes; + } + + size_t buffer(char* ptr, size_t item_size, size_t item_count, void* buffer) + { + auto data = (Data*)buffer; + auto size = static_cast(item_size * item_count); + auto rest_bytes = data->size - data->position; + auto copied_bytes = std::min(size, rest_bytes); + memcpy(ptr, data->buffer, copied_bytes); + data->position += copied_bytes; + return copied_bytes; + } + } // namespace Read + + namespace Write + { + size_t stream(char* ptr, size_t item_size, size_t item_count, void* stream) + { + auto out_stream = reinterpret_cast(stream); + size_t write_bytes = item_size * item_count; + out_stream->write(ptr, write_bytes); + return write_bytes; + } + + size_t buffer(char* ptr, size_t item_size, size_t item_count, void* buffer) + { + auto data = reinterpret_cast(buffer); + auto size = static_cast(item_size * item_count); + auto rest_bytes = data->size - data->position; + auto copied_bytes = std::min(size, rest_bytes); + memcpy(data->buffer, ptr, copied_bytes); + data->position += copied_bytes; + return copied_bytes; + } + } // namespace Write + + namespace Append + { + size_t buffer(char* ptr, size_t item_size, size_t item_count, void* buffer) + { + auto data = reinterpret_cast(buffer); + auto append_size = item_size * item_count; + auto new_buffer_size = data->size + append_size; + auto new_buffer = new char[new_buffer_size]; + if (data->size != 0) memcpy(new_buffer, data->buffer, data->size); + memcpy(new_buffer + data->size, ptr, append_size); + delete[] data->buffer; + data->buffer = new_buffer; + data->size = new_buffer_size; + return append_size; + } + + size_t stream(char* ptr, size_t item_size, size_t item_count, void* stream) + { + auto out_stream = reinterpret_cast(stream); + size_t write_bytes = item_size * item_count; + out_stream->seekp(0, std::ios::end); + out_stream->write(ptr, write_bytes); + return write_bytes; + } + } // namespace Append + } // namespace Callback +} // namespace WebDAV diff --git a/sources/callback.hpp b/sources/callback.hpp index 223b53d..c5c700d 100644 --- a/sources/callback.hpp +++ b/sources/callback.hpp @@ -2,14 +2,14 @@ # __ __ _____ _____ # Project | | | | | \ / ___| # | |__| | | |\ \ / / -# | | | | ) ) ( ( +# | | | | ) ) ( ( # | /\ | | |/ / \ \___ # \_/ \_/ |_____/ \_____| # -# Copyright (C) 2016, The WDC Project, , et al. +# Copyright (C) 2018, The WDC Project, , et al. # # This software is licensed as described in the file LICENSE, which -# you should have received as part of this distribution. +# you should have received as part of this distribution. # # You may opt to use, copy, modify, merge, publish, distribute and/or sell # copies of the Software, and permit persons to whom the Software is @@ -20,39 +20,48 @@ # ############################################################################*/ -#ifndef WEBDAV_CALLBACK_H -#define WEBDAV_CALLBACK_H -#pragma once +#ifndef WEBDAV_CALLBACK_HPP +#define WEBDAV_CALLBACK_HPP namespace WebDAV { - struct Data - { - char * buffer; - unsigned long long position; - unsigned long long size; - }; - - namespace Callback - { - namespace Read - { - size_t stream(char * data, size_t size, size_t count, void * stream); - size_t buffer(char * data, size_t size, size_t count, void * buffer); - } - - namespace Write - { - size_t stream(char * data, size_t size, size_t count, void * stream); - size_t buffer(char * data, size_t size, size_t count, void * buffer); - } - - namespace Append - { - size_t stream(char * data, size_t size, size_t count, void * stream); - size_t buffer(char * data, size_t size, size_t count, void * buffer); - } - } -} + struct Data + { + char* buffer; + unsigned long long position; + unsigned long long size; + void reset() + { + buffer = nullptr; + position = 0; + size = 0; + } + ~Data() + { + delete[] buffer; + } + }; + + namespace Callback + { + namespace Read + { + size_t stream(char* data, size_t size, size_t count, void* stream); + size_t buffer(char* data, size_t size, size_t count, void* buffer); + } + + namespace Write + { + size_t stream(char* data, size_t size, size_t count, void* stream); + size_t buffer(char* data, size_t size, size_t count, void* buffer); + } + + namespace Append + { + size_t stream(char* data, size_t size, size_t count, void* stream); + size_t buffer(char* data, size_t size, size_t count, void* buffer); + } + } +} // namespace WebDAV #endif diff --git a/sources/client.cpp b/sources/client.cpp index 7aedf17..9f2e7b2 100644 --- a/sources/client.cpp +++ b/sources/client.cpp @@ -6,7 +6,7 @@ # | /\ | | |/ / \ \___ # \_/ \_/ |_____/ \_____| # -# Copyright (C) 2016, The WDC Project, , et al. +# Copyright (C) 2018, The WDC Project, , et al. # # This software is licensed as described in the file LICENSE, which # you should have received as part of this distribution. @@ -20,794 +20,774 @@ # ############################################################################*/ -#include #include -#include "pugiext.hpp" + +#include "callback.hpp" +#include "fsinfo.hpp" #include "header.hpp" +#include "pugiext.hpp" #include "request.hpp" #include "urn.hpp" -#include "fsinfo.hpp" -#include "callback.hpp" + +#include + +#include +#include namespace WebDAV { - using Urn::Path; - - using progress_funptr = int(*)(void *context, size_t dltotal, size_t dlnow, size_t ultotal, size_t ulnow); - - auto inline get(const dict_t& options, const std::string&& name) -> std::string - { - auto it = options.find(name); - if (it == options.end()) return ""; - else return it->second; - } - - class ClientImpl : public Client - { - public: - - void init() const noexcept; - - std::string webdav_hostname; - std::string webdav_root; - std::string webdav_login; - std::string webdav_password; - - std::string proxy_hostname; - std::string proxy_login; - std::string proxy_password; - - std::string cert_path; - std::string key_path; - - dict_t options() const noexcept; - - bool sync_download( - const std::string& remote_file, - const std::string& local_file, - callback_t callback = nullptr, - progress_t progress = nullptr - ) const noexcept; - - bool sync_download_to( - const std::string& remote_file, - char * & buffer_ptr, - unsigned long long int & buffer_size, - callback_t callback = nullptr, - progress_t progress = nullptr - ) const noexcept; - - bool sync_download_to( - const std::string& remote_file, - std::ostream& stream, - callback_t callback = nullptr, - progress_t progress = nullptr - ) const noexcept; - - bool sync_upload( - const std::string& remote_file, - const std::string& local_file, - callback_t callback = nullptr, - progress_t progress = nullptr - ) const noexcept; - - bool sync_upload_from( - const std::string& remote_file, - char * buffer_ptr, - unsigned long long int buffer_size, - callback_t callback = nullptr, - progress_t progress = nullptr - ) const noexcept; - - bool sync_upload_from( - const std::string& remote_file, - std::istream& stream, - callback_t callback = nullptr, - progress_t progress = nullptr - ) const noexcept; - - ClientImpl(const dict_t & options); - - ~ClientImpl(); - }; - - inline ClientImpl * GetImpl(Client * ptr) { return (ClientImpl *)ptr; } - inline const ClientImpl * GetImpl(const Client * ptr) { return (const ClientImpl *)ptr; } - - ClientImpl::ClientImpl(const dict_t& options) - { - this->webdav_hostname = get(options, "webdav_hostname"); - this->webdav_root = get(options, "webdav_root"); - this->webdav_login = get(options, "webdav_login"); - this->webdav_password = get(options, "webdav_password"); - - this->proxy_hostname = get(options, "proxy_hostname"); - this->proxy_login = get(options, "proxy_login"); - this->proxy_password = get(options, "proxy_password"); - - this->cert_path = get(options, "cert_path"); - this->key_path = get(options, "key_path"); - - this->init(); - } - - void - ClientImpl::init() const noexcept - { - curl_global_init(CURL_GLOBAL_DEFAULT); - } - - dict_t - ClientImpl::options() const noexcept - { - return dict_t - { - { "webdav_hostname", this->webdav_hostname }, - { "webdav_root", this->webdav_root }, - { "webdav_login", this->webdav_login }, - { "webdav_password", this->webdav_password }, - { "proxy_hostname", this->proxy_hostname }, - { "proxy_login", this->proxy_login }, - { "proxy_password", this->proxy_password }, - { "cert_path", this->cert_path }, - { "key_path", this->key_path }, - }; - } - - bool - ClientImpl::sync_download( - const std::string& remote_file, - const std::string& local_file, - callback_t callback, - progress_t progress - ) const noexcept - - { - bool is_existed = this->check(remote_file); - if (!is_existed) return false; - - auto root_urn = Path(this->webdav_root, true); - auto file_urn = root_urn + remote_file; - - std::ofstream file_stream(local_file, std::ios::binary); - - Request request(this->options()); - - auto url = this->webdav_hostname + file_urn.quote(request.handle); - - request.set(CURLOPT_CUSTOMREQUEST, "GET"); - request.set(CURLOPT_URL, url.c_str()); - request.set(CURLOPT_HEADER, 0L); - request.set(CURLOPT_WRITEDATA, (size_t)&file_stream); - request.set(CURLOPT_WRITEFUNCTION, (size_t)Callback::Write::stream); - if (progress != nullptr) { - request.set(CURLOPT_XFERINFOFUNCTION, (size_t)progress.target()); - request.set(CURLOPT_NOPROGRESS, 0L); - } - - bool is_performed = request.perform(); - - if (callback != nullptr) callback(is_performed); - return is_performed; - } - - bool - ClientImpl::sync_download_to( - const std::string& remote_file, - char * & buffer_ptr, - unsigned long long int & buffer_size, - callback_t callback, - progress_t progress - ) const noexcept - { - bool is_existed = this->check(remote_file); - if (!is_existed) return false; - - auto root_urn = Path(this->webdav_root, true); - auto file_urn = root_urn + remote_file; - - Data data = { 0, 0, 0 }; - - Request request(this->options()); - - auto url = this->webdav_hostname + file_urn.quote(request.handle); - - request.set(CURLOPT_CUSTOMREQUEST, "GET"); - request.set(CURLOPT_URL, url.c_str()); - request.set(CURLOPT_HEADER, 0L); - request.set(CURLOPT_WRITEDATA, (size_t)&data); - request.set(CURLOPT_WRITEFUNCTION, (size_t)Callback::Append::buffer); - if (progress != nullptr) { - request.set(CURLOPT_XFERINFOFUNCTION, (size_t)progress.target()); - request.set(CURLOPT_NOPROGRESS, 0L); - } - - bool is_performed = request.perform(); - if (callback != nullptr) callback(is_performed); - if (!is_performed) return false; - - buffer_ptr = data.buffer; - buffer_size = data.size; - return true; - } - - bool - ClientImpl::sync_download_to( - const std::string& remote_file, - std::ostream & stream, - callback_t callback, - progress_t progress - ) const noexcept - { - bool is_existed = this->check(remote_file); - if (!is_existed) return false; - - auto root_urn = Path(this->webdav_root, true); - auto file_urn = root_urn + remote_file; - - Request request(this->options()); - - auto url = this->webdav_hostname + file_urn.quote(request.handle); - - request.set(CURLOPT_CUSTOMREQUEST, "GET"); - request.set(CURLOPT_URL, url.c_str()); - request.set(CURLOPT_HEADER, 0L); - request.set(CURLOPT_WRITEDATA, (size_t)&stream); - request.set(CURLOPT_WRITEFUNCTION, (size_t)Callback::Write::stream); - if (progress != nullptr) { - request.set(CURLOPT_XFERINFOFUNCTION, (size_t)progress.target()); - request.set(CURLOPT_NOPROGRESS, 0L); - } - - bool is_performed = request.perform(); - if (callback != nullptr) callback(is_performed); - if (!is_performed) return false; - - return true; - } - - bool - ClientImpl::sync_upload( - const std::string& remote_file, - const std::string& local_file, - callback_t callback, - progress_t progress - ) const noexcept - { - bool is_existed = FileInfo::exists(local_file); - if (!is_existed) return false; - - auto root_urn = Path(this->webdav_root, true); - auto file_urn = root_urn + remote_file; - - std::ifstream file_stream(local_file, std::ios::binary); - auto size = FileInfo::size(local_file); - - Request request(this->options()); - - auto url = this->webdav_hostname + file_urn.quote(request.handle); - - Data response = { 0, 0, 0 }; - - request.set(CURLOPT_UPLOAD, 1L); - request.set(CURLOPT_URL, url.c_str()); - request.set(CURLOPT_READDATA, (size_t)&file_stream); - request.set(CURLOPT_READFUNCTION, (size_t)Callback::Read::stream); - request.set(CURLOPT_INFILESIZE_LARGE, (curl_off_t)size); - request.set(CURLOPT_BUFFERSIZE, (long)Client::buffer_size); - request.set(CURLOPT_WRITEDATA, (size_t)&response); - request.set(CURLOPT_WRITEFUNCTION, (size_t)Callback::Append::buffer); - if (progress != nullptr) { - request.set(CURLOPT_XFERINFOFUNCTION, (size_t)progress.target()); - request.set(CURLOPT_NOPROGRESS, 0L); - } - - bool is_performed = request.perform(); - - if (callback != nullptr) callback(is_performed); - return is_performed; - } - - bool - ClientImpl::sync_upload_from( - const std::string& remote_file, - char * buffer, - unsigned long long int buffer_size, - callback_t callback, - progress_t progress - ) const noexcept - { - auto root_urn = Path(this->webdav_root, true); - auto file_urn = root_urn + remote_file; - - Data data = { buffer, 0, buffer_size }; - - Request request(this->options()); - - auto url = this->webdav_hostname + file_urn.quote(request.handle); - - Data response = { 0, 0, 0 }; - - request.set(CURLOPT_UPLOAD, 1L); - request.set(CURLOPT_URL, url.c_str()); - request.set(CURLOPT_READDATA, (size_t)&data); - request.set(CURLOPT_READFUNCTION, (size_t)Callback::Read::buffer); - request.set(CURLOPT_INFILESIZE_LARGE, (curl_off_t)buffer_size); - request.set(CURLOPT_BUFFERSIZE, (long)Client::buffer_size); - request.set(CURLOPT_WRITEDATA, (size_t)&response); - request.set(CURLOPT_WRITEFUNCTION, (size_t)Callback::Append::buffer); - if (progress != nullptr) { - request.set(CURLOPT_XFERINFOFUNCTION, (size_t)progress.target()); - request.set(CURLOPT_NOPROGRESS, 0L); - } - - bool is_performed = request.perform(); - - if (callback != nullptr) callback(is_performed); - return is_performed; - } - - bool - ClientImpl::sync_upload_from( - const std::string& remote_file, - std::istream& stream, - callback_t callback, - progress_t progress - ) const noexcept - { - auto root_urn = Path(this->webdav_root, true); - auto file_urn = root_urn + remote_file; - - Request request(this->options()); - - auto url = this->webdav_hostname + file_urn.quote(request.handle); - stream.seekg(0, std::ios::end); - size_t stream_size = stream.tellg(); - stream.seekg(0, std::ios::beg); - - Data response = { 0, 0, 0 }; - - request.set(CURLOPT_UPLOAD, 1L); - request.set(CURLOPT_URL, url.c_str()); - request.set(CURLOPT_READDATA, (size_t)&stream); - request.set(CURLOPT_READFUNCTION, (size_t)Callback::Read::stream); - request.set(CURLOPT_INFILESIZE_LARGE, (curl_off_t)stream_size); - request.set(CURLOPT_BUFFERSIZE, (long)Client::buffer_size); - request.set(CURLOPT_WRITEDATA, (size_t)&response); - request.set(CURLOPT_WRITEFUNCTION, (size_t)Callback::Append::buffer); - if (progress != nullptr) { - request.set(CURLOPT_XFERINFOFUNCTION, (size_t)progress.target()); - request.set(CURLOPT_NOPROGRESS, 0L); - } - - bool is_performed = request.perform(); - - if (callback != nullptr) callback(is_performed); - return is_performed; - } - - Client* Client::Init(const dict_t& options) noexcept - { - return new ClientImpl(options); - } - - ClientImpl::~ClientImpl() { - } - - void Client::Cleanup() noexcept - { - curl_global_cleanup(); - } - - unsigned long long - Client::free_size() const noexcept - { - Header header = { - "Accept: */*", - "Depth: 0", - "Content-Type: text/xml" - }; - - pugi::xml_document document; - auto propfind = document.append_child("D:propfind"); - propfind.append_attribute("xmlns:D") = "DAV:"; - - auto prop = propfind.append_child("D:prop"); - prop.append_child("D:quokta-available-bytes"); - prop.append_child("D:quota-used-bytes"); - - auto document_print = pugi::node_to_string(document); - size_t size = document_print.length() * sizeof((document_print.c_str())[0]); - - Data data = { 0, 0, 0 }; - - Request request(GetImpl(this)->options()); - - request.set(CURLOPT_CUSTOMREQUEST, "PROPFIND"); - request.set(CURLOPT_HTTPHEADER, (struct curl_slist *)header.handle); - request.set(CURLOPT_POSTFIELDS, document_print.c_str()); - request.set(CURLOPT_POSTFIELDSIZE, (long)size); - request.set(CURLOPT_HEADER, 0); - request.set(CURLOPT_WRITEDATA, (size_t)&data); - request.set(CURLOPT_WRITEFUNCTION, (size_t)Callback::Append::buffer); - - auto is_performed = request.perform(); - if (!is_performed) return 0; - - document.load_buffer(data.buffer, (size_t)data.size); - - pugi::xml_node multistatus = document.select_single_node("d:multistatus").node(); - pugi::xml_node response = multistatus.select_single_node("d:response").node(); - pugi::xml_node propstat = response.select_single_node("d:propstat").node(); - prop = propstat.select_single_node("d:prop").node(); - pugi::xml_node quota_available_bytes = prop.select_single_node("d:quota-available-bytes").node(); - std::string free_size_text = quota_available_bytes.first_child().value(); - - auto free_size = atol(free_size_text.c_str()); - return free_size; - } - - bool - Client::check(const std::string& remote_resource) const noexcept - { - auto clientImpl = GetImpl(this); - auto root_urn = Path(clientImpl->webdav_root, true); - auto resource_urn = root_urn + remote_resource; - - Header header = { - "Accept: */*", - "Depth: 1" - }; - - Data data = { 0, 0, 0 }; - - Request request(clientImpl->options()); - - auto url = clientImpl->webdav_hostname + resource_urn.quote(request.handle); - - request.set(CURLOPT_CUSTOMREQUEST, "PROPFIND"); - request.set(CURLOPT_URL, url.c_str()); - request.set(CURLOPT_HTTPHEADER, (struct curl_slist *)header.handle); - request.set(CURLOPT_WRITEDATA, (size_t)&data); - request.set(CURLOPT_WRITEFUNCTION, (size_t)Callback::Append::buffer); - - return request.perform(); - } - - dict_t - Client::info(const std::string& remote_resource) const noexcept - { - auto clientImpl = GetImpl(this); - auto root_urn = Path(clientImpl->webdav_root, true); - auto target_urn = root_urn + remote_resource; - - Header header = { - "Accept: */*", - "Depth: 1" - }; - - Data data = { 0, 0, 0 }; - - Request request(clientImpl->options()); - - auto url = clientImpl->webdav_hostname + target_urn.quote(request.handle); - - request.set(CURLOPT_CUSTOMREQUEST, "PROPFIND"); - request.set(CURLOPT_URL, url.c_str()); - request.set(CURLOPT_HTTPHEADER, (struct curl_slist *)header.handle); - request.set(CURLOPT_WRITEDATA, (size_t)&data); - request.set(CURLOPT_WRITEFUNCTION, (size_t)Callback::Append::buffer); - - bool is_performed = request.perform(); - - if (!is_performed) return dict_t(); - - pugi::xml_document document; - document.load_buffer(data.buffer, (size_t)data.size); - auto multistatus = document.select_single_node("d:multistatus").node(); - auto responses = multistatus.select_nodes("d:response"); - for (auto response : responses) - { - pugi::xml_node href = response.node().select_single_node("d:href").node(); - std::string encode_file_name = href.first_child().value(); - std::string resource_path = curl_unescape(encode_file_name.c_str(), (int)encode_file_name.length()); - auto target_path = target_urn.path(); - auto target_path_without_sep = std::string(target_path, 0, target_path.rfind("/") + 1); - auto resource_path_without_sep = std::string(resource_path, 0, resource_path.rfind("/") + 1); - if (resource_path_without_sep.compare(target_path_without_sep) == 0) { - auto propstat = response.node().select_single_node("d:propstat").node(); - auto prop = propstat.select_single_node("d:prop").node(); - auto creation_date = prop.select_single_node("d:creationdate").node(); - auto display_name = prop.select_single_node("d:displayname").node(); - auto content_length = prop.select_single_node("d:getcontentlength").node(); - auto modified_date = prop.select_single_node("d:getlastmodified").node(); - auto resource_type = prop.select_single_node("d:resourcetype").node(); - - dict_t information = { - { "created", creation_date.first_child().value() }, - { "name", display_name.first_child().value() }, - { "size", content_length.first_child().value() }, - { "modified", modified_date.first_child().value() }, - { "type", resource_type.first_child().name() } - }; - - return information; - } - } - - return dict_t(); - } - - bool - Client::is_dir(const std::string& remote_resource) const noexcept - { - auto information = this->info(remote_resource); - auto resource_type = information["type"]; - bool is_directory = resource_type.compare("d:collection") == 0; - return is_directory; - } - - strings_t - Client::list(const std::string& remote_directory) const noexcept - { - auto clientImpl = GetImpl(this); - bool is_existed = this->check(remote_directory); - if (!is_existed) return strings_t(); - - bool is_directory = this->is_dir(remote_directory); - if (!is_directory) return strings_t(); - auto target_urn = Path(clientImpl->webdav_root, true) + remote_directory; - target_urn = Path(target_urn.path(), true); - - Header header = { - "Accept: */*", - "Depth: 1" - }; - - Data data = { 0, 0, 0 }; - - Request request(clientImpl->options()); - - auto url = clientImpl->webdav_hostname + target_urn.quote(request.handle); - - request.set(CURLOPT_CUSTOMREQUEST, "PROPFIND"); - request.set(CURLOPT_URL, url.c_str()); - request.set(CURLOPT_HTTPHEADER, (struct curl_slist *)header.handle); - request.set(CURLOPT_HEADER, 0); - request.set(CURLOPT_WRITEDATA, (size_t)&data); - request.set(CURLOPT_WRITEFUNCTION, (size_t)Callback::Append::buffer); - - bool is_performed = request.perform(); - - if (!is_performed) return strings_t(); - - strings_t resources; - - pugi::xml_document document; - document.load_buffer(data.buffer, (size_t)data.size); - auto multistatus = document.select_single_node("d:multistatus").node(); - auto responses = multistatus.select_nodes("d:response"); - for (auto response : responses) - { - pugi::xml_node href = response.node().select_single_node("d:href").node(); - std::string encode_file_name = href.first_child().value(); - std::string resource_path = curl_unescape(encode_file_name.c_str(), (int)encode_file_name.length()); - auto target_path = target_urn.path(); - Path resource_urn(resource_path); - if (resource_urn == target_urn) continue; - resources.push_back(resource_urn.name()); - } - - return resources; - } - - bool Client::download( - const std::string& remote_file, - const std::string& local_file, - progress_t progress - ) const noexcept - { - auto clientImpl = GetImpl(this); - return clientImpl->sync_download(remote_file, local_file, nullptr, progress); - } - - void - Client::async_download( - const std::string& remote_file, - const std::string& local_file, - callback_t callback, - progress_t progress - ) const noexcept - { - auto clientImpl = GetImpl(this); - std::thread downloading([&]() { clientImpl->sync_download(remote_file, local_file, callback, progress); }); - downloading.detach(); - } - - bool - Client::download_to( - const std::string& remote_file, - char * & buffer_ptr, - unsigned long long int & buffer_size, - progress_t progress - ) const noexcept - { - auto clientImpl = GetImpl(this); - return clientImpl->sync_download_to(remote_file, buffer_ptr, buffer_size, nullptr, progress); - } - - bool - Client::download_to( - const std::string& remote_file, - std::ostream& stream, - progress_t progress - ) const noexcept - { - auto clientImpl = GetImpl(this); - return clientImpl->sync_download_to(remote_file, stream, nullptr, progress); - } - - bool - Client::create_directory(const std::string& remote_directory, bool recursive) const noexcept - { - auto clientImpl = GetImpl(this); - bool is_existed = this->check(remote_directory); - if (is_existed) return true; - - bool resource_is_dir = true; - Path directory_urn(remote_directory, resource_is_dir); - - if (recursive) { - auto remote_parent_directory = directory_urn.parent().path(); - bool is_created = this->create_directory(remote_parent_directory, true); - if (!is_created) return false; - } - - Header header = { - "Accept: */*", - "Connection: Keep-Alive" - }; - - auto target_urn = Path(clientImpl->webdav_root, true) + remote_directory; - target_urn = Path(target_urn.path(), true); - - Request request(clientImpl->options()); - - auto url = clientImpl->webdav_hostname + target_urn.quote(request.handle); - - request.set(CURLOPT_CUSTOMREQUEST, "MKCOL"); - request.set(CURLOPT_URL, url.c_str()); - request.set(CURLOPT_HTTPHEADER, (struct curl_slist *)header.handle); - - return request.perform(); - } - - bool - Client::move(const std::string& remote_source_resource, const std::string& remote_destination_resource) const noexcept - { - auto clientImpl = GetImpl(this); - bool is_existed = this->check(remote_source_resource); - if (!is_existed) return false; - - Path root_urn(clientImpl->webdav_root, true); - - auto source_resource_urn = root_urn + remote_source_resource; - auto destination_resource_urn = root_urn + remote_destination_resource; - - Header header = { - "Accept: */*", - "Destination: " + destination_resource_urn.path() - }; - - Request request(clientImpl->options()); - - auto url = clientImpl->webdav_hostname + source_resource_urn.quote(request.handle); - - request.set(CURLOPT_CUSTOMREQUEST, "MOVE"); - request.set(CURLOPT_URL, url.c_str()); - request.set(CURLOPT_HTTPHEADER, (struct curl_slist *)header.handle); - - return request.perform(); - } - - bool - Client::copy(const std::string& remote_source_resource, const std::string& remote_destination_resource) const noexcept - { - auto clientImpl = GetImpl(this); - bool is_existed = this->check(remote_source_resource); - if (!is_existed) return false; - - Path root_urn(clientImpl->webdav_root, true); - - auto source_resource_urn = root_urn + remote_source_resource; - auto destination_resource_urn = root_urn + remote_destination_resource; - - Header header = { - "Accept: */*", - "Destination: " + destination_resource_urn.path() - }; - - Request request(clientImpl->options()); - - auto url = clientImpl->webdav_hostname + source_resource_urn.quote(request.handle); - - request.set(CURLOPT_CUSTOMREQUEST, "COPY"); - request.set(CURLOPT_URL, url.c_str()); - request.set(CURLOPT_HTTPHEADER, (struct curl_slist *)header.handle); - - return request.perform(); - } - - bool - Client::upload( - const std::string& remote_file, - const std::string& local_file, - progress_t progress - ) const noexcept - { - auto clientImpl = GetImpl(this); - return clientImpl->sync_upload(remote_file, local_file, nullptr, progress); - } - - void - Client::async_upload( - const std::string& remote_file, - const std::string& local_file, - callback_t callback, - progress_t progress - ) const noexcept - { - auto clientImpl = GetImpl(this); - std::thread uploading([&]() { clientImpl->sync_upload(remote_file, local_file, callback, progress); }); - uploading.detach(); - } - - bool - Client::upload_from( - const std::string& remote_file, - std::istream& stream, - progress_t progress - ) const noexcept - { - auto clientImpl = GetImpl(this); - return clientImpl->sync_upload_from(remote_file, stream, nullptr, progress); - } - - bool - Client::upload_from( - const std::string& remote_file, - char * buffer_ptr, - unsigned long long int buffer_size, - progress_t progress - ) const noexcept - { - auto clientImpl = GetImpl(this); - return clientImpl->sync_upload_from(remote_file, buffer_ptr, buffer_size, nullptr, progress); - } - - bool - Client::clean(const std::string& remote_resource) const noexcept - { - auto clientImpl = GetImpl(this); - bool is_existed = this->check(remote_resource); - if (!is_existed) return true; - - auto root_urn = Path(clientImpl->webdav_root, true); - auto resource_urn = root_urn + remote_resource; - - Header header = { - "Accept: */*", - "Connection: Keep-Alive" - }; - - Request request(clientImpl->options()); - - auto url = clientImpl->webdav_hostname + resource_urn.quote(request.handle); - - request.set(CURLOPT_CUSTOMREQUEST, "DELETE"); - request.set(CURLOPT_URL, url.c_str()); - request.set(CURLOPT_HTTPHEADER, (struct curl_slist *)header.handle); - - return request.perform(); - } -} + auto inline get(const dict_t& options, const std::string&& name) -> std::string + { + auto it = options.find(name); + if (it == options.end()) return ""; + else return it->second; + } + + using Urn::Path; + + using progress_funptr = int(*)(void* context, size_t dltotal, size_t dlnow, size_t ultotal, size_t ulnow); + + dict_t + Client::options() const + { + return dict_t + { + { "webdav_hostname", this->webdav_hostname }, + { "webdav_root", this->webdav_root }, + { "webdav_username", this->webdav_username }, + { "webdav_password", this->webdav_password }, + { "proxy_hostname", this->proxy_hostname }, + { "proxy_username", this->proxy_username }, + { "proxy_password", this->proxy_password }, + { "cert_path", this->cert_path }, + { "key_path", this->key_path }, + }; + } + + bool + Client::sync_download( + const std::string& remote_file, + const std::string& local_file, + callback_t callback, + progress_t progress + ) const + { + bool is_existed = this->check(remote_file); + if (!is_existed) return false; + + auto root_urn = Path(this->webdav_root, true); + auto file_urn = root_urn + remote_file; + + std::ofstream file_stream(local_file, std::ios::binary); + + Request request(this->options()); + + auto url = this->webdav_hostname + file_urn.quote(request.handle); + + request.set(CURLOPT_CUSTOMREQUEST, "GET"); + request.set(CURLOPT_URL, url.c_str()); + request.set(CURLOPT_HEADER, 0L); + request.set(CURLOPT_WRITEDATA, reinterpret_cast(&file_stream)); + request.set(CURLOPT_WRITEFUNCTION, reinterpret_cast(Callback::Write::stream)); +#ifdef WDC_VERBOSE + request.set(CURLOPT_VERBOSE, 1); +#endif + if (progress != nullptr) + { + request.set(CURLOPT_XFERINFOFUNCTION, reinterpret_cast(progress.target())); + request.set(CURLOPT_NOPROGRESS, 0L); + } + + bool is_performed = request.perform(); + + if (callback != nullptr) callback(is_performed); + return is_performed; + } + + bool + Client::sync_download_to( + const std::string& remote_file, + char*& buffer_ptr, + unsigned long long& buffer_size, + callback_t callback, + progress_t progress + ) const + { + bool is_existed = this->check(remote_file); + if (!is_existed) return false; + + auto root_urn = Path(this->webdav_root, true); + auto file_urn = root_urn + remote_file; + + Data data = { nullptr, 0, 0 }; + + Request request(this->options()); + + auto url = this->webdav_hostname + file_urn.quote(request.handle); + + request.set(CURLOPT_CUSTOMREQUEST, "GET"); + request.set(CURLOPT_URL, url.c_str()); + request.set(CURLOPT_HEADER, 0L); + request.set(CURLOPT_WRITEDATA, reinterpret_cast(&data)); + request.set(CURLOPT_WRITEFUNCTION, reinterpret_cast(Callback::Append::buffer)); +#ifdef WDC_VERBOSE + request.set(CURLOPT_VERBOSE, 1); +#endif + if (progress != nullptr) + { + request.set(CURLOPT_XFERINFOFUNCTION, reinterpret_cast(progress.target())); + request.set(CURLOPT_NOPROGRESS, 0L); + } + + bool is_performed = request.perform(); + if (callback != nullptr) callback(is_performed); + if (!is_performed) return false; + + buffer_ptr = data.buffer; + buffer_size = data.size; + data.reset(); + return true; + } + + bool + Client::sync_download_to( + const std::string& remote_file, + std::ostream& stream, + callback_t callback, + progress_t progress + ) const + { + bool is_existed = this->check(remote_file); + if (!is_existed) return false; + + auto root_urn = Path(this->webdav_root, true); + auto file_urn = root_urn + remote_file; + + Request request(this->options()); + + auto url = this->webdav_hostname + file_urn.quote(request.handle); + + request.set(CURLOPT_CUSTOMREQUEST, "GET"); + request.set(CURLOPT_URL, url.c_str()); + request.set(CURLOPT_HEADER, 0L); + request.set(CURLOPT_WRITEDATA, reinterpret_cast(&stream)); + request.set(CURLOPT_WRITEFUNCTION, reinterpret_cast(Callback::Write::stream)); +#ifdef WDC_VERBOSE + request.set(CURLOPT_VERBOSE, 1); +#endif + if (progress != nullptr) + { + request.set(CURLOPT_XFERINFOFUNCTION, reinterpret_cast(progress.target())); + request.set(CURLOPT_NOPROGRESS, 0L); + } + + bool is_performed = request.perform(); + if (callback != nullptr) callback(is_performed); + + return is_performed; + } + + bool + Client::sync_upload( + const std::string& remote_file, + const std::string& local_file, + callback_t callback, + progress_t progress + ) const + { + bool is_existed = FileInfo::exists(local_file); + if (!is_existed) return false; + + auto root_urn = Path(this->webdav_root, true); + auto file_urn = root_urn + remote_file; + + std::ifstream file_stream(local_file, std::ios::binary); + auto size = FileInfo::size(local_file); + + Request request(this->options()); + + auto url = this->webdav_hostname + file_urn.quote(request.handle); + + Data response = { nullptr, 0, 0 }; + + request.set(CURLOPT_UPLOAD, 1L); + request.set(CURLOPT_URL, url.c_str()); + request.set(CURLOPT_READDATA, reinterpret_cast(&file_stream)); + request.set(CURLOPT_READFUNCTION, reinterpret_cast(Callback::Read::stream)); + request.set(CURLOPT_INFILESIZE_LARGE, static_cast(size)); + request.set(CURLOPT_BUFFERSIZE, static_cast(Client::buffer_size)); + request.set(CURLOPT_WRITEDATA, reinterpret_cast(&response)); + request.set(CURLOPT_WRITEFUNCTION, reinterpret_cast(Callback::Append::buffer)); +#ifdef WDC_VERBOSE + request.set(CURLOPT_VERBOSE, 1); +#endif + if (progress != nullptr) + { + request.set(CURLOPT_XFERINFOFUNCTION, reinterpret_cast(progress.target())); + request.set(CURLOPT_NOPROGRESS, 0L); + } + + bool is_performed = request.perform(); + + if (callback != nullptr) callback(is_performed); + return is_performed; + } + + bool + Client::sync_upload_from( + const std::string& remote_file, + char* buffer_ptr, + unsigned long long buffer_size, + callback_t callback, + progress_t progress + ) const + { + auto root_urn = Path(this->webdav_root, true); + auto file_urn = root_urn + remote_file; + + Data data = { buffer_ptr, 0, buffer_size }; + + Request request(this->options()); + + auto url = this->webdav_hostname + file_urn.quote(request.handle); + + Data response = { nullptr, 0, 0 }; + + request.set(CURLOPT_UPLOAD, 1L); + request.set(CURLOPT_URL, url.c_str()); + request.set(CURLOPT_READDATA, reinterpret_cast(&data)); + request.set(CURLOPT_READFUNCTION, reinterpret_cast(Callback::Read::buffer)); + request.set(CURLOPT_INFILESIZE_LARGE, static_cast(buffer_size)); + request.set(CURLOPT_BUFFERSIZE, static_cast(Client::buffer_size)); + request.set(CURLOPT_WRITEDATA, reinterpret_cast(&response)); + request.set(CURLOPT_WRITEFUNCTION, reinterpret_cast(Callback::Append::buffer)); +#ifdef WDC_VERBOSE + request.set(CURLOPT_VERBOSE, 1); +#endif + if (progress != nullptr) + { + request.set(CURLOPT_XFERINFOFUNCTION, reinterpret_cast(progress.target())); + request.set(CURLOPT_NOPROGRESS, 0L); + } + + bool is_performed = request.perform(); + + if (callback != nullptr) callback(is_performed); + + data.reset(); + return is_performed; + } + + bool + Client::sync_upload_from( + const std::string& remote_file, + std::istream& stream, + callback_t callback, + progress_t progress + ) const + { + auto root_urn = Path(this->webdav_root, true); + auto file_urn = root_urn + remote_file; + + Request request(this->options()); + + auto url = this->webdav_hostname + file_urn.quote(request.handle); + stream.seekg(0, std::ios::end); + size_t stream_size = stream.tellg(); + stream.seekg(0, std::ios::beg); + + Data response = { nullptr, 0, 0 }; + + request.set(CURLOPT_UPLOAD, 1L); + request.set(CURLOPT_URL, url.c_str()); + request.set(CURLOPT_READDATA, reinterpret_cast(&stream)); + request.set(CURLOPT_READFUNCTION, reinterpret_cast(Callback::Read::stream)); + request.set(CURLOPT_INFILESIZE_LARGE, static_cast(stream_size)); + request.set(CURLOPT_BUFFERSIZE, static_cast(Client::buffer_size)); + request.set(CURLOPT_WRITEDATA, reinterpret_cast(&response)); + request.set(CURLOPT_WRITEFUNCTION, reinterpret_cast(Callback::Append::buffer)); +#ifdef WDC_VERBOSE + request.set(CURLOPT_VERBOSE, 1); +#endif + if (progress != nullptr) + { + request.set(CURLOPT_XFERINFOFUNCTION, reinterpret_cast(progress.target())); + request.set(CURLOPT_NOPROGRESS, 0L); + } + + bool is_performed = request.perform(); + + if (callback != nullptr) callback(is_performed); + return is_performed; + } + + Client::Client(const dict_t& options) + { + this->webdav_hostname = get(options, "webdav_hostname"); + this->webdav_root = get(options, "webdav_root"); + this->webdav_username = get(options, "webdav_username"); + this->webdav_password = get(options, "webdav_password"); + + this->proxy_hostname = get(options, "proxy_hostname"); + this->proxy_username = get(options, "proxy_username"); + this->proxy_password = get(options, "proxy_password"); + + this->cert_path = get(options, "cert_path"); + this->key_path = get(options, "key_path"); + } + + unsigned long long + Client::free_size() const + { + Header header = + { + "Accept: */*", + "Depth: 0", + "Content-Type: text/xml" + }; + + pugi::xml_document document; + auto propfind = document.append_child("D:propfind"); + propfind.append_attribute("xmlns:D") = "DAV:"; + + auto prop = propfind.append_child("D:prop"); + prop.append_child("D:quokta-available-bytes"); + prop.append_child("D:quota-used-bytes"); + + auto document_print = pugi::node_to_string(document); + size_t size = document_print.length() * sizeof((document_print.c_str())[0]); + + Data data = { nullptr, 0, 0 }; + + Request request(this->options()); + + request.set(CURLOPT_CUSTOMREQUEST, "PROPFIND"); + request.set(CURLOPT_HTTPHEADER, reinterpret_cast(header.handle)); + request.set(CURLOPT_POSTFIELDS, document_print.c_str()); + request.set(CURLOPT_POSTFIELDSIZE, static_cast(size)); + request.set(CURLOPT_HEADER, 0); + request.set(CURLOPT_WRITEDATA, reinterpret_cast(&data)); + request.set(CURLOPT_WRITEFUNCTION, reinterpret_cast(Callback::Append::buffer)); +#ifdef WDC_VERBOSE + request.set(CURLOPT_VERBOSE, 1); +#endif + + auto is_performed = request.perform(); + if (!is_performed) return 0; + + document.load_buffer(data.buffer, static_cast(data.size)); + + pugi::xml_node multistatus = document.select_node("*[local-name()='multistatus']").node(); + pugi::xml_node response = multistatus.select_node("*[local-name()='response']").node(); + pugi::xml_node propstat = response.select_node("*[local-name()='propstat']").node(); + prop = propstat.select_node("*[local-name()='prop']").node(); + pugi::xml_node quota_available_bytes = prop.select_node("*[local-name()='quota-available-bytes']").node(); + std::string free_size_text = quota_available_bytes.first_child().value(); + + return boost::lexical_cast(free_size_text); + } + + bool + Client::check(const std::string& remote_resource) const + { + auto root_urn = Path(this->webdav_root, true); + auto resource_urn = root_urn + remote_resource; + + Header header = + { + "Accept: */*", + "Depth: 1" + }; + + Data data = { nullptr, 0, 0 }; + + Request request(this->options()); + + auto url = this->webdav_hostname + resource_urn.quote(request.handle); + + request.set(CURLOPT_CUSTOMREQUEST, "PROPFIND"); + request.set(CURLOPT_URL, url.c_str()); + request.set(CURLOPT_HTTPHEADER, reinterpret_cast(header.handle)); + request.set(CURLOPT_WRITEDATA, reinterpret_cast(&data)); + request.set(CURLOPT_WRITEFUNCTION, reinterpret_cast(Callback::Append::buffer)); +#ifdef WDC_VERBOSE + request.set(CURLOPT_VERBOSE, 1); +#endif + + return request.perform(); + } + + dict_t + Client::info(const std::string& remote_resource) const + { + auto root_urn = Path(this->webdav_root, true); + auto target_urn = root_urn + remote_resource; + + Header header = + { + "Accept: */*", + "Depth: 1" + }; + + Data data = { nullptr, 0, 0 }; + + Request request(this->options()); + + auto url = this->webdav_hostname + target_urn.quote(request.handle); + + request.set(CURLOPT_CUSTOMREQUEST, "PROPFIND"); + request.set(CURLOPT_URL, url.c_str()); + request.set(CURLOPT_HTTPHEADER, reinterpret_cast(header.handle)); + request.set(CURLOPT_WRITEDATA, reinterpret_cast(&data)); + request.set(CURLOPT_WRITEFUNCTION, reinterpret_cast(Callback::Append::buffer)); +#ifdef WDC_VERBOSE + request.set(CURLOPT_VERBOSE, 1); +#endif + bool is_performed = request.perform(); + + if (!is_performed) return dict_t{}; + + pugi::xml_document document; + document.load_buffer(data.buffer, static_cast(data.size)); +#ifdef WDC_VERBOSE + document.save(std::cout); +#endif + auto multistatus = document.select_node("*[local-name()='multistatus']").node(); + auto responses = multistatus.select_nodes("*[local-name()='response']"); + for (auto response : responses) + { + pugi::xml_node href = response.node().select_node("*[local-name()='href']").node(); + std::string encode_file_name = href.first_child().value(); + std::string resource_path = curl_unescape(encode_file_name.c_str(), static_cast(encode_file_name.length())); + auto target_path = target_urn.path(); + auto target_path_without_sep = target_urn.path(); + if (!target_path_without_sep.empty() && target_path_without_sep.back() == '/') + target_path_without_sep.resize(target_path_without_sep.length() - 1); + auto resource_path_without_sep = std::string(resource_path, 0, resource_path.rfind('/') + 1); + if (resource_path_without_sep == target_path_without_sep) + { + auto propstat = response.node().select_node("*[local-name()='propstat']").node(); + auto prop = propstat.select_node("*[local-name()='prop']").node(); + auto creation_date = prop.select_node("*[local-name()='creationdate']").node(); + auto display_name = prop.select_node("*[local-name()='displayname']").node(); + auto content_length = prop.select_node("*[local-name()='getcontentlength']").node(); + auto modified_date = prop.select_node("*[local-name()='getlastmodified']").node(); + auto resource_type = prop.select_node("*[local-name()='resourcetype']").node(); + + dict_t information = + { + { "created", creation_date.first_child().value() }, + { "name", display_name.first_child().value() }, + { "size", content_length.first_child().value() }, + { "modified", modified_date.first_child().value() }, + { "type", resource_type.first_child().name() } + }; + + return information; + } + } + + return dict_t{}; + } + + bool + Client::is_directory(const std::string& remote_resource) const + { + auto information = this->info(remote_resource); + auto resource_type = information["type"]; + bool is_dir = resource_type == "d:collection" || resource_type == "D:collection"; + return is_dir; + } + + strings_t + Client::list(const std::string& remote_directory) const + { + bool is_existed = this->check(remote_directory); + if (!is_existed) return strings_t{}; + + auto target_urn = Path(this->webdav_root, true) + remote_directory; + target_urn = Path(target_urn.path(), true); + + Header header = + { + "Accept: */*", + "Depth: 1" + }; + + Data data = { nullptr, 0, 0 }; + + Request request(this->options()); + + auto url = this->webdav_hostname + target_urn.quote(request.handle); + + request.set(CURLOPT_CUSTOMREQUEST, "PROPFIND"); + request.set(CURLOPT_URL, url.c_str()); + request.set(CURLOPT_HTTPHEADER, reinterpret_cast(header.handle)); + request.set(CURLOPT_HEADER, 0); + request.set(CURLOPT_WRITEDATA, reinterpret_cast(&data)); + request.set(CURLOPT_WRITEFUNCTION, reinterpret_cast(Callback::Append::buffer)); +#ifdef WDC_VERBOSE + request.set(CURLOPT_VERBOSE, 1); +#endif + + bool is_performed = request.perform(); + + if (!is_performed) return strings_t{}; + + strings_t resources; + + pugi::xml_document document; + document.load_buffer(data.buffer, static_cast(data.size)); + auto multistatus = document.select_node("*[local-name()='multistatus']").node(); + auto responses = multistatus.select_nodes("*[local-name()='response']"); + for (auto response : responses) + { + pugi::xml_node href = response.node().select_node("*[local-name()='href']").node(); + std::string encode_file_name = href.first_child().value(); + std::string resource_path = curl_unescape(encode_file_name.c_str(), static_cast(encode_file_name.length())); + auto target_path = target_urn.path(); + Path resource_urn(resource_path); + if (resource_urn == target_urn) continue; + resources.push_back(resource_urn.name()); + } + + return resources; + } + + bool Client::download( + const std::string& remote_file, + const std::string& local_file, + progress_t progress + ) const + { + return this->sync_download(remote_file, local_file, nullptr, std::move(progress)); + } + + void + Client::async_download( + const std::string& remote_file, + const std::string& local_file, + callback_t callback, + progress_t progress + ) const + { + std::thread downloading([ = ]() + { + this->sync_download(remote_file, local_file, callback, std::move(progress)); + }); + downloading.detach(); + } + + bool + Client::download_to( + const std::string& remote_file, + char*& buffer_ptr, + unsigned long long& buffer_size, + progress_t progress + ) const + { + return this->sync_download_to(remote_file, buffer_ptr, buffer_size, nullptr, std::move(progress)); + } + + bool + Client::download_to( + const std::string& remote_file, + std::ostream& stream, + progress_t progress + ) const + { + return this->sync_download_to(remote_file, stream, nullptr, std::move(progress)); + } + + bool + Client::create_directory(const std::string& remote_directory, bool recursive) const + { + bool is_existed = this->check(remote_directory); + if (is_existed) return true; + + bool resource_is_dir = true; + Path directory_urn(remote_directory, resource_is_dir); + + if (recursive) + { + auto remote_parent_directory = directory_urn.parent().path(); + if (remote_parent_directory == remote_directory) return false; + bool is_created = this->create_directory(remote_parent_directory, true); + if (!is_created) return false; + } + + Header header = + { + "Accept: */*", + "Connection: Keep-Alive" + }; + + auto target_urn = Path(this->webdav_root, true) + remote_directory; + target_urn = Path(target_urn.path(), true); + + Request request(this->options()); + + auto url = this->webdav_hostname + target_urn.quote(request.handle); + + request.set(CURLOPT_CUSTOMREQUEST, "MKCOL"); + request.set(CURLOPT_URL, url.c_str()); + request.set(CURLOPT_HTTPHEADER, reinterpret_cast(header.handle)); +#ifdef WDC_VERBOSE + request.set(CURLOPT_VERBOSE, 1); +#endif + + return request.perform(); + } + + bool + Client::move(const std::string& remote_source_resource, const std::string& remote_destination_resource) const + { + bool is_existed = this->check(remote_source_resource); + if (!is_existed) return false; + + Path root_urn(this->webdav_root, true); + + auto source_resource_urn = root_urn + remote_source_resource; + auto destination_resource_urn = root_urn + remote_destination_resource; + + Header header = + { + "Accept: */*", + "Destination: " + destination_resource_urn.path() + }; + + Request request(this->options()); + + auto url = this->webdav_hostname + source_resource_urn.quote(request.handle); + + request.set(CURLOPT_CUSTOMREQUEST, "MOVE"); + request.set(CURLOPT_URL, url.c_str()); + request.set(CURLOPT_HTTPHEADER, reinterpret_cast(header.handle)); +#ifdef WDC_VERBOSE + request.set(CURLOPT_VERBOSE, 1); +#endif + + return request.perform(); + } + + bool + Client::copy(const std::string& remote_source_resource, const std::string& remote_destination_resource) const + { + bool is_existed = this->check(remote_source_resource); + if (!is_existed) return false; + + Path root_urn(this->webdav_root, true); + + auto source_resource_urn = root_urn + remote_source_resource; + auto destination_resource_urn = root_urn + remote_destination_resource; + + Header header = + { + "Accept: */*", + "Destination: " + destination_resource_urn.path() + }; + + Request request(this->options()); + + auto url = this->webdav_hostname + source_resource_urn.quote(request.handle); + + request.set(CURLOPT_CUSTOMREQUEST, "COPY"); + request.set(CURLOPT_URL, url.c_str()); + request.set(CURLOPT_HTTPHEADER, reinterpret_cast(header.handle)); +#ifdef WDC_VERBOSE + request.set(CURLOPT_VERBOSE, 1); +#endif + + return request.perform(); + } + + bool + Client::upload( + const std::string& remote_file, + const std::string& local_file, + progress_t progress + ) const + { + return this->sync_upload(remote_file, local_file, nullptr, std::move(progress)); + } + + void + Client::async_upload( + const std::string& remote_file, + const std::string& local_file, + callback_t callback, + progress_t progress + ) const + { + std::thread uploading([ = ]() + { + this->sync_upload(remote_file, local_file, callback, std::move(progress)); + }); + uploading.detach(); + } + + bool + Client::upload_from( + const std::string& remote_file, + std::istream& stream, + progress_t progress + ) const + { + return this->sync_upload_from(remote_file, stream, nullptr, std::move(progress)); + } + + bool + Client::upload_from( + const std::string& remote_file, + char* buffer_ptr, + unsigned long long buffer_size, + progress_t progress + ) const + { + return this->sync_upload_from(remote_file, buffer_ptr, buffer_size, nullptr, std::move(progress)); + } + + bool + Client::clean(const std::string& remote_resource) const + { + bool is_existed = this->check(remote_resource); + if (!is_existed) return true; + + auto root_urn = Path(this->webdav_root, true); + auto resource_urn = root_urn + remote_resource; + + Header header = + { + "Accept: */*", + "Connection: Keep-Alive" + }; + + Request request(this->options()); + + auto url = this->webdav_hostname + resource_urn.quote(request.handle); + + request.set(CURLOPT_CUSTOMREQUEST, "DELETE"); + request.set(CURLOPT_URL, url.c_str()); + request.set(CURLOPT_HTTPHEADER, reinterpret_cast(header.handle)); +#ifdef WDC_VERBOSE + request.set(CURLOPT_VERBOSE, 1); +#endif + + return request.perform(); + } + + class Environment + { + public: + Environment() + { + curl_global_init(CURL_GLOBAL_ALL); + } + ~Environment() + { + curl_global_cleanup(); + } + }; +} // namespace WebDAV + +static const WebDAV::Environment env; diff --git a/sources/fsinfo.cpp b/sources/fsinfo.cpp index 9e3b5d2..0f15205 100644 --- a/sources/fsinfo.cpp +++ b/sources/fsinfo.cpp @@ -2,14 +2,14 @@ # __ __ _____ _____ # Project | | | | | \ / ___| # | |__| | | |\ \ / / -# | | | | ) ) ( ( +# | | | | ) ) ( ( # | /\ | | |/ / \ \___ # \_/ \_/ |_____/ \_____| # -# Copyright (C) 2016, The WDC Project, , et al. +# Copyright (C) 2018, The WDC Project, , et al. # # This software is licensed as described in the file LICENSE, which -# you should have received as part of this distribution. +# you should have received as part of this distribution. # # You may opt to use, copy, modify, merge, publish, distribute and/or sell # copies of the Software, and permit persons to whom the Software is @@ -20,23 +20,23 @@ # ############################################################################*/ - #include "fsinfo.hpp" +#include namespace WebDAV { - namespace FileInfo - { - auto exists(const std::string& path) -> bool - { - std::ifstream file(path); - return file.good(); - } - - auto size(const std::string& path_file) -> unsigned long long - { - std::ifstream file(path_file, std::ios::binary | std::ios::ate); - return (unsigned long long)file.tellg(); - } - } -} + namespace FileInfo + { + auto exists(const std::string& path) -> bool + { + std::ifstream file(path); + return file.good(); + } + + auto size(const std::string& path_file) -> unsigned long long + { + std::ifstream file(path_file, std::ios::binary | std::ios::ate); + return static_cast(file.tellg()); + } + } // namespace FileInfo +} // namespace WebDAV diff --git a/sources/fsinfo.hpp b/sources/fsinfo.hpp index 8f05acc..94b927b 100644 --- a/sources/fsinfo.hpp +++ b/sources/fsinfo.hpp @@ -2,14 +2,14 @@ # __ __ _____ _____ # Project | | | | | \ / ___| # | |__| | | |\ \ / / -# | | | | ) ) ( ( +# | | | | ) ) ( ( # | /\ | | |/ / \ \___ # \_/ \_/ |_____/ \_____| # -# Copyright (C) 2016, The WDC Project, , et al. +# Copyright (C) 2018, The WDC Project, , et al. # # This software is licensed as described in the file LICENSE, which -# you should have received as part of this distribution. +# you should have received as part of this distribution. # # You may opt to use, copy, modify, merge, publish, distribute and/or sell # copies of the Software, and permit persons to whom the Software is @@ -20,21 +20,19 @@ # ############################################################################*/ -#ifndef WEBDAV_FSINFO_H -#define WEBDAV_FSINFO_H -#pragma once +#ifndef WEBDAV_FSINFO_HPP +#define WEBDAV_FSINFO_HPP -#include #include +#include namespace WebDAV { - namespace FileInfo - { - auto exists(const std::string& path) -> bool; - - auto size(const std::string& path_file) -> unsigned long long; - } -} + namespace FileInfo + { + auto exists(const std::string& path) -> bool; + auto size(const std::string& path_file) -> unsigned long long; + } // namespace FileInfo +} // namespace WebDAV #endif diff --git a/sources/header.cpp b/sources/header.cpp index f4f61fe..fef6fdf 100644 --- a/sources/header.cpp +++ b/sources/header.cpp @@ -2,14 +2,14 @@ # __ __ _____ _____ # Project | | | | | \ / ___| # | |__| | | |\ \ / / -# | | | | ) ) ( ( +# | | | | ) ) ( ( # | /\ | | |/ / \ \___ # \_/ \_/ |_____/ \_____| # -# Copyright (C) 2016, The WDC Project, , et al. +# Copyright (C) 2018, The WDC Project, , et al. # # This software is licensed as described in the file LICENSE, which -# you should have received as part of this distribution. +# you should have received as part of this distribution. # # You may opt to use, copy, modify, merge, publish, distribute and/or sell # copies of the Software, and permit persons to whom the Software is @@ -26,22 +26,44 @@ namespace WebDAV { - Header::Header(const std::initializer_list& init_list) noexcept : handle(nullptr) + Header::Header(const std::initializer_list& init_list) noexcept : handle(nullptr) + { + for (auto& item : init_list) { - for (auto& item : init_list) - { - this->append(item); - } + this->append(item); } + } - Header::~Header() - { - curl_slist_free_all((curl_slist*)this->handle); - } + Header::~Header() noexcept + { + curl_slist_free_all(reinterpret_cast(this->handle)); + } + + Header::Header(Header&& other) noexcept + { + handle = other.handle; + other.handle = nullptr; + } - void - Header::append(const std::string& item) noexcept + auto Header::operator=(Header&& other) noexcept -> Header& + { + if (this != &other) { - this->handle = curl_slist_append((curl_slist*)this->handle, item.c_str()); + Header(std::move(other)).swap(*this); } -} + + return *this; + } + + auto Header::swap(Header& other) noexcept -> void + { + using std::swap; + swap(handle, other.handle); + } + + void + Header::append(const std::string& item) noexcept + { + this->handle = curl_slist_append(reinterpret_cast(this->handle), item.c_str()); + } +} // namespace WebDAV diff --git a/sources/header.hpp b/sources/header.hpp index b28d377..1e1fc7c 100644 --- a/sources/header.hpp +++ b/sources/header.hpp @@ -2,14 +2,14 @@ # __ __ _____ _____ # Project | | | | | \ / ___| # | |__| | | |\ \ / / -# | | | | ) ) ( ( +# | | | | ) ) ( ( # | /\ | | |/ / \ \___ # \_/ \_/ |_____/ \_____| # -# Copyright (C) 2016, The WDC Project, , et al. +# Copyright (C) 2018, The WDC Project, , et al. # # This software is licensed as described in the file LICENSE, which -# you should have received as part of this distribution. +# you should have received as part of this distribution. # # You may opt to use, copy, modify, merge, publish, distribute and/or sell # copies of the Software, and permit persons to whom the Software is @@ -20,26 +20,32 @@ # ############################################################################*/ -#ifndef WEBDAV_HEADER_H -#define WEBDAV_HEADER_H -#pragma once +#ifndef WEBDAV_HEADER_HPP +#define WEBDAV_HEADER_HPP -#include #include +#include namespace WebDAV { - class Header final - { - public: - void * handle; + class Header final + { + public: + void* handle; + + Header(const std::initializer_list& init_list) noexcept; + Header(const Header& other) = delete; + Header(Header&& other) noexcept; + ~Header() noexcept; - Header(const std::initializer_list& init_list) noexcept; + auto operator=(const Header& other) -> Header& = delete; + auto operator=(Header&& other) noexcept -> Header&; - ~Header(); + void append(const std::string& item) noexcept; - void append(const std::string& item) noexcept; - }; -} + private: + auto swap(Header& other) noexcept -> void; + }; +} // namespace WebDAV #endif diff --git a/sources/pugiext.hpp b/sources/pugiext.hpp index 7f5bf0c..a071cb1 100644 --- a/sources/pugiext.hpp +++ b/sources/pugiext.hpp @@ -2,14 +2,14 @@ # __ __ _____ _____ # Project | | | | | \ / ___| # | |__| | | |\ \ / / -# | | | | ) ) ( ( +# | | | | ) ) ( ( # | /\ | | |/ / \ \___ # \_/ \_/ |_____/ \_____| # -# Copyright (C) 2016, The WDC Project, , et al. +# Copyright (C) 2018, The WDC Project, , et al. # # This software is licensed as described in the file LICENSE, which -# you should have received as part of this distribution. +# you should have received as part of this distribution. # # You may opt to use, copy, modify, merge, publish, distribute and/or sell # copies of the Software, and permit persons to whom the Software is @@ -20,31 +20,31 @@ # ############################################################################*/ -#ifndef WEBDAV_PUGIEXT_H -#define WEBDAV_PUGIEXT_H -#pragma once +#ifndef WEBDAV_PUGIEXT_HPP +#define WEBDAV_PUGIEXT_HPP + #include namespace pugi { - class PUGIXML_CLASS xml_string_writer: public xml_writer - { - public: - std::string result; + class PUGIXML_CLASS xml_string_writer: public xml_writer + { + public: + std::string result; - virtual void write(const void* data, size_t size) - { - result += std::string(static_cast(data), size); - } - }; + void write(const void* data, size_t size) final + { + result += std::string(static_cast(data), size); + } + }; - std::string node_to_string(pugi::xml_node node) - { - xml_string_writer writer; - node.print(writer); + inline std::string node_to_string(const pugi::xml_node& node) + { + xml_string_writer writer; + node.print(writer); - return writer.result; - } -} + return writer.result; + } +} // namespace pugi #endif diff --git a/sources/request.cpp b/sources/request.cpp index 5d536b2..b017e8b 100644 --- a/sources/request.cpp +++ b/sources/request.cpp @@ -2,14 +2,14 @@ # __ __ _____ _____ # Project | | | | | \ / ___| # | |__| | | |\ \ / / -# | | | | ) ) ( ( +# | | | | ) ) ( ( # | /\ | | |/ / \ \___ # \_/ \_/ |_____/ \_____| # -# Copyright (C) 2016, The WDC Project, , et al. +# Copyright (C) 2018, The WDC Project, , et al. # # This software is licensed as described in the file LICENSE, which -# you should have received as part of this distribution. +# you should have received as part of this distribution. # # You may opt to use, copy, modify, merge, publish, distribute and/or sell # copies of the Software, and permit persons to whom the Software is @@ -25,106 +25,134 @@ namespace WebDAV { - auto inline get(const dict_t& options, const std::string&& name) -> std::string - { - auto it = options.find(name); - if (it == options.end()) return ""; - else return it->second; - } - - Request::Request(dict_t&& options_) : options(options_) - { - auto webdav_hostname = get(options, "webdav_hostname"); - auto webdav_login = get(options, "webdav_login"); - auto webdav_password = get(options, "webdav_password"); - - auto proxy_hostname = get(options, "proxy_hostname"); - auto proxy_login = get(options, "proxy_login"); - auto proxy_password = get(options, "proxy_password"); - - auto cert_path = get(options, "cert_path"); - auto key_path = get(options, "key_path"); - - this->handle = curl_easy_init(); - - this->set(CURLOPT_SSL_VERIFYHOST, 0); - this->set(CURLOPT_SSL_VERIFYPEER, 0); + auto inline get(const dict_t& options, const std::string&& name) -> std::string + { + auto it = options.find(name); + if (it == options.end()) + { + return std::string{""}; + } + else + { + return it->second; + } + } + + Request::Request(dict_t&& options_) : options(options_) + { + auto webdav_hostname = get(options, "webdav_hostname"); + auto webdav_username = get(options, "webdav_username"); + auto webdav_password = get(options, "webdav_password"); + + auto proxy_hostname = get(options, "proxy_hostname"); + auto proxy_username = get(options, "proxy_username"); + auto proxy_password = get(options, "proxy_password"); + + auto cert_path = get(options, "cert_path"); + auto key_path = get(options, "key_path"); + + this->handle = curl_easy_init(); + + this->set(CURLOPT_SSL_VERIFYHOST, 0); + this->set(CURLOPT_SSL_VERIFYPEER, 0); #ifdef _DEBUG - this->set(CURLOPT_VERBOSE, 1); + this->set(CURLOPT_VERBOSE, 1); #else - this->set(CURLOPT_VERBOSE, 0); + this->set(CURLOPT_VERBOSE, 0); #endif - if (this->cert_required()){ - - this->set(CURLOPT_SSLCERTTYPE, "PEM"); - this->set(CURLOPT_SSLKEYTYPE, "PEM"); - this->set(CURLOPT_SSLCERT, (char *)cert_path.c_str()); - this->set(CURLOPT_SSLKEY, (char *)key_path.c_str()); - - } - - this->set(CURLOPT_URL, (char *)webdav_hostname.c_str()); - this->set(CURLOPT_HTTPAUTH, (int)CURLAUTH_BASIC); - auto token = webdav_login + ":" + webdav_password; - this->set(CURLOPT_USERPWD, (char *)token.c_str()); - - if (!this->proxy_enabled()) return; - - this->set(CURLOPT_PROXY, (char *)proxy_hostname.c_str()); - this->set(CURLOPT_PROXYAUTH, (int)CURLAUTH_BASIC); - - if (proxy_login.empty()) return; - - if (proxy_password.empty()) - { - this->set(CURLOPT_PROXYUSERNAME, (char *)proxy_login.c_str()); - } - else - { - token = proxy_login + ":" + proxy_password; - this->set(CURLOPT_PROXYUSERPWD, (char *)token.c_str()); - } - } - - Request::~Request() noexcept - { - if (this->handle != nullptr) curl_easy_cleanup(this->handle); - } - - - bool Request::perform() const noexcept - { - if (this->handle == nullptr) return false; - auto is_performed = check_code(curl_easy_perform(this->handle)); - if (!is_performed) return false; - long http_code = 0; - curl_easy_getinfo(this->handle, CURLINFO_RESPONSE_CODE, &http_code); - if (http_code < 200 || http_code > 299) return false; - return true; - } - - bool Request::proxy_enabled() const noexcept - { - auto proxy_hostname = get(options, "proxy_hostname"); - auto proxy_login = get(options, "proxy_login"); - auto proxy_password = get(options, "proxy_password"); - bool proxy_hostname_presented = !proxy_hostname.empty(); - if (!proxy_hostname_presented) return false; - bool proxy_login_presented = !proxy_login.empty(); - bool proxy_password_presented = !proxy_password.empty(); - if (proxy_password_presented && !proxy_login_presented) return false; - return true; - } - - bool Request::cert_required() const noexcept - { - const auto cert_path = get(options, "cert_path"); - const auto key_path = get(options, "key_path"); - if (cert_path.empty()) return false; - bool cert_is_existed = FileInfo::exists(cert_path); - if (!cert_is_existed) return false; - if (key_path.empty()) return false; - return FileInfo::exists(key_path); - } -} + if (this->cert_required()) + { + this->set(CURLOPT_SSLCERTTYPE, "PEM"); + this->set(CURLOPT_SSLKEYTYPE, "PEM"); + this->set(CURLOPT_SSLCERT, const_cast(cert_path.c_str())); + this->set(CURLOPT_SSLKEY, const_cast(key_path.c_str())); + } + + this->set(CURLOPT_URL, const_cast(webdav_hostname.c_str())); + this->set(CURLOPT_HTTPAUTH, static_cast(CURLAUTH_BASIC)); + auto token = webdav_username + ":" + webdav_password; + this->set(CURLOPT_USERPWD, const_cast(token.c_str())); + + if (!this->proxy_enabled()) return; + + this->set(CURLOPT_PROXY, const_cast(proxy_hostname.c_str())); + this->set(CURLOPT_PROXYAUTH, static_cast(CURLAUTH_BASIC)); + + if (proxy_username.empty()) return; + + if (proxy_password.empty()) + { + this->set(CURLOPT_PROXYUSERNAME, const_cast(proxy_username.c_str())); + } + else + { + token = proxy_username + ":" + proxy_password; + this->set(CURLOPT_PROXYUSERPWD, const_cast(token.c_str())); + } + } + + Request::~Request() noexcept + { + if (this->handle != nullptr) curl_easy_cleanup(this->handle); + } + + + auto Request::swap(Request& other) noexcept -> void + { + using std::swap; + swap(handle, other.handle); + } + + Request::Request(Request&& other) noexcept : handle + { + other.handle + } + { + other.handle = nullptr; + } + + auto Request::operator=(Request&& other) noexcept -> Request& + { + if (this != &other) + { + Request(std::move(other)).swap(*this); + } + return *this; + } + + bool Request::perform() const noexcept + { + if (this->handle == nullptr) return false; + auto is_performed = check_code(curl_easy_perform(this->handle)); + if (!is_performed) return false; + long http_code = 0; + curl_easy_getinfo(this->handle, CURLINFO_RESPONSE_CODE, &http_code); + if (http_code < 200 || http_code > 299) return false; + return true; + } + + bool Request::proxy_enabled() const noexcept + { + auto proxy_hostname = get(options, "proxy_hostname"); + auto proxy_username = get(options, "proxy_username"); + auto proxy_password = get(options, "proxy_password"); + bool proxy_hostname_presented = !proxy_hostname.empty(); + if (!proxy_hostname_presented) return false; + bool proxy_username_presented = !proxy_username.empty(); + bool proxy_password_presented = !proxy_password.empty(); + if (proxy_password_presented && !proxy_username_presented) return false; + return true; + } + + bool Request::cert_required() const noexcept + { + const auto cert_path = get(options, "cert_path"); + const auto key_path = get(options, "key_path"); + if (cert_path.empty()) return false; + bool cert_is_existed = FileInfo::exists(cert_path); + if (!cert_is_existed) return false; + if (key_path.empty()) return false; + return FileInfo::exists(key_path); + } +} // namespace WebDAV diff --git a/sources/request.hpp b/sources/request.hpp index c134762..1881f96 100644 --- a/sources/request.hpp +++ b/sources/request.hpp @@ -2,14 +2,14 @@ # __ __ _____ _____ # Project | | | | | \ / ___| # | |__| | | |\ \ / / -# | | | | ) ) ( ( +# | | | | ) ) ( ( # | /\ | | |/ / \ \___ # \_/ \_/ |_____/ \_____| # -# Copyright (C) 2016, The WDC Project, , et al. +# Copyright (C) 2018, The WDC Project, , et al. # # This software is licensed as described in the file LICENSE, which -# you should have received as part of this distribution. +# you should have received as part of this distribution. # # You may opt to use, copy, modify, merge, publish, distribute and/or sell # copies of the Software, and permit persons to whom the Software is @@ -20,48 +20,49 @@ # ############################################################################*/ -#ifndef WEBDAV_REQUEST_H -#define WEBDAV_REQUEST_H -#pragma once +#ifndef WEBDAV_REQUEST_HPP +#define WEBDAV_REQUEST_HPP #include -#include #include +#include namespace WebDAV { - bool inline check_code(CURLcode code) - { - return code == CURLE_OK; - } - - using dict_t = std::map; - - class Request - { - const dict_t options; - - bool proxy_enabled() const noexcept; + bool inline check_code(CURLcode code) + { + return code == CURLE_OK; + } - bool cert_required() const noexcept; + using dict_t = std::map; - public: + class Request + { + public: + explicit Request(dict_t&& options_); + Request(const Request& other) = delete; + Request(Request&& other) noexcept; + ~Request() noexcept; - Request(dict_t&& options); + auto operator=(const Request& other) -> Request& = delete; + auto operator=(Request&& other) noexcept -> Request &; - ~Request() noexcept; + template + auto set(CURLoption option, T value) const noexcept -> bool + { + if (this->handle == nullptr) return false; + return check_code(curl_easy_setopt(this->handle, option, value)); + } - template - auto set(CURLoption option, T value) const noexcept -> bool - { - if (this->handle == nullptr) return false; - return check_code(curl_easy_setopt(this->handle, option, value)); - } - - bool perform() const noexcept; + bool perform() const noexcept; + void* handle; - void * handle; - }; -} + private: + const dict_t options; + bool proxy_enabled() const noexcept; + bool cert_required() const noexcept; + auto swap(Request& other) noexcept -> void; + }; +} // namespace WebDAV #endif diff --git a/sources/urn.cpp b/sources/urn.cpp index 04c2148..7ddbace 100644 --- a/sources/urn.cpp +++ b/sources/urn.cpp @@ -2,14 +2,14 @@ # __ __ _____ _____ # Project | | | | | \ / ___| # | |__| | | |\ \ / / -# | | | | ) ) ( ( +# | | | | ) ) ( ( # | /\ | | |/ / \ \___ # \_/ \_/ |_____/ \_____| # -# Copyright (C) 2016, The WDC Project, , et al. +# Copyright (C) 2018, The WDC Project, , et al. # # This software is licensed as described in the file LICENSE, which -# you should have received as part of this distribution. +# you should have received as part of this distribution. # # You may opt to use, copy, modify, merge, publish, distribute and/or sell # copies of the Software, and permit persons to whom the Software is @@ -20,176 +20,192 @@ # ############################################################################*/ +#include + #include +#include +#include #include #include -#include using std::string; using std::vector; #include "urn.hpp" -namespace WebDAV { - - namespace Urn { - - const string Path::separate = "/"; - const string Path::root = "/"; - - Path::Path(const string& path_, bool force_dir) { - - string path = path_; - if (path_.empty()) path = Path::root; - auto first_position = path.find(Path::separate); - if (first_position != 0) path = Path::root + path; - auto last_symbol_index = path.length() - 1; - auto last_symbol = string{ path[last_symbol_index] }; - auto is_dir = Path::separate.compare(last_symbol) == 0; - if (force_dir && !is_dir) path += Path::separate; - m_path = path; - - auto double_separte = Path::separate + Path::separate; - bool is_find = false; - do { - auto first_position = m_path.find(double_separte); - is_find = first_position != string::npos; - if (is_find) { - m_path.replace(first_position, double_separte.size(), Path::separate); - } - } while (is_find); - } - - Path::Path(std::nullptr_t) { - m_path = nullptr; - } - - auto Path::path() const -> string { - return m_path; - } - - auto escape(void * request, const string& name) -> string { - - string path = curl_easy_escape(request, name.c_str(), (int)name.length()); - return path; - } - - auto split(const string& text, const string& delims) -> vector { - - vector tokens; - std::size_t start = text.find_first_not_of(delims), end = 0; - - while ((end = text.find_first_of(delims, start)) != string::npos) - { - tokens.push_back(text.substr(start, end - start)); - start = text.find_first_not_of(delims, end); - } - if (start != string::npos) - tokens.push_back(text.substr(start)); - - return tokens; - } - - auto Path::quote(void *request) const -> string { - - if (this->is_root()) return m_path; - - auto names = split(m_path, Path::separate); - std::string quote_path; - - std::for_each(names.begin(), names.end(), ["e_path, request](string& name) { - auto escape_name = escape(request, name); - quote_path.append(Path::separate); - quote_path.append(escape_name); - }); - - if (is_directory()) { - quote_path.append(Path::separate); - } - return quote_path; +namespace WebDAV +{ + namespace Urn + { + + const string Path::separate = "/"; + const string Path::root = "/"; + + Path::Path(const string& path_, bool force_dir) + { + string path = path_; + if (path_.empty()) path = Path::root; + auto first_position = path.find(Path::separate); + if (first_position != 0) path = Path::root + path; + + auto last_symbol_index = path.length() - 1; + auto last_symbol = path.substr(last_symbol_index, 1); + auto is_dir = last_symbol == Path::separate; + + if (force_dir && !is_dir) path += Path::separate; + m_path = path; + + auto double_separte = Path::separate + Path::separate; + bool is_find = false; + do + { + auto first_position = m_path.find(double_separte); + is_find = first_position != m_path.npos; + if (is_find) + { + m_path.replace(first_position, double_separte.size(), Path::separate); } + } + while (is_find); + } - auto Path::name() const -> string { - - auto path = this->path(); - auto is_root = Path::separate.compare(path) == 0; - if (is_root) return string{""}; - - if (this->is_directory()) { + Path::Path(std::nullptr_t) + { + m_path = nullptr; + } - auto path_without_slash = path.substr(0, path.length() - 1); - auto pre_last_separate_position = path_without_slash.rfind(Path::separate); - auto name = path.substr(pre_last_separate_position + 1); - return name; - } - else { + auto Path::path() const -> string + { + return m_path; + } - auto last_separate_position = path.rfind(Path::separate); - auto name = path.substr(last_separate_position + 1); - return name; - } - } + auto escape(void* request, const string& name) -> string + { + string path = curl_easy_escape(request, name.c_str(), static_cast(name.length())); + return path; + } - auto Path::parent() const -> Path { + auto split(const string& text, const string& delims) -> vector + { + vector tokens; + auto start = text.find_first_not_of(delims); + auto end = text.npos; + + while ((end = text.find_first_of(delims, start)) != text.npos) + { + tokens.push_back(text.substr(start, end - start)); + start = text.find_first_not_of(delims, end); + } + if (start != text.npos) + { + tokens.push_back(text.substr(start)); + } + return tokens; + } - if (this->is_root()) return m_path; + auto Path::quote(void* request) const -> string + { + if (this->is_root()) return m_path; + + auto names = split(m_path, Path::separate); + string quote_path; + + std::for_each(names.begin(), names.end(), ["e_path, request](string & name) + { + auto escape_name = escape(request, name); + quote_path.append(Path::separate); + quote_path.append(escape_name); + }); + + if (is_directory()) + { + quote_path.append(Path::separate); + } + return quote_path; + } - auto last_separate_position = m_path.rfind(Path::separate); - if (last_separate_position == 0) return Path::separate; + auto Path::name() const -> string + { + auto path = this->path(); + auto is_root = path == Path::separate; + if (is_root) return string{""}; + + if (this->is_directory()) + { + auto path_without_slash = path.substr(0, path.length() - 1); + auto pre_last_separate_position = path_without_slash.rfind(Path::separate); + auto name = path.substr(pre_last_separate_position + 1); + return name; + } + else + { + auto last_separate_position = path.rfind(Path::separate); + auto name = path.substr(last_separate_position + 1); + return name; + } + } - auto parent = m_path.substr(0, last_separate_position + 1); - return parent; - } + auto Path::parent() const -> Path + { + if (this->is_root()) return Path{m_path}; - auto Path::is_directory() const -> bool { + auto last_separate_position = m_path.rfind(Path::separate, m_path.length() - 2); + if (last_separate_position == 0) return Path{Path::separate}; - auto path = this->path(); - auto last_symbol_index = path.length() - 1; - auto last_symbol = std::string{path[last_symbol_index]}; - auto is_equal = Path::separate.compare(last_symbol) == 0; - return is_equal; - } + auto parent = m_path.substr(0, last_separate_position + 1); + return Path{parent}; + } - auto Path::is_root() const -> bool { - return Path::separate.compare(m_path) == 0; - } + auto Path::is_directory() const -> bool + { + auto path = this->path(); + auto last_symbol_index = path.length() - 1; + auto last_symbol = path.substr(last_symbol_index, 1); + auto is_equal = last_symbol == Path::separate; + return is_equal; + } - auto Path::operator+(const string& resource_path) const -> Path { + auto Path::is_root() const -> bool + { + return m_path == Path::separate; + } - return Path{ m_path + resource_path }; - } + auto Path::operator+(const string& rhs) const -> Path + { + return Path{ m_path + rhs }; + } - auto Path::operator==(const Path& rhs) const -> bool { - - if (this->is_root()) { - if (rhs.is_root()) { - return true; - } - else { - return false; - } - } - else if (rhs.is_root()) { - return false; - } - - string lhs_path; - bool is_dir = is_directory(); - if (is_dir) { - lhs_path = m_path.substr(0, m_path.length()-1); - } - else { - lhs_path = m_path; - } - string rhs_path; - if (rhs.is_directory()) { - rhs_path = rhs.path(); - rhs_path = rhs_path.substr(0, rhs_path.length()-1); - } - else { - rhs_path = rhs.path(); - } - return lhs_path == rhs_path; - } + auto Path::operator==(const Path& rhs) const -> bool + { + if (this->is_root() && rhs.is_root()) return true; + if (!this->is_root() && rhs.is_root()) return false; + + string lhs_path; + bool is_dir = is_directory(); + if (is_dir) + { + lhs_path = m_path.substr(0, m_path.length() - 1); + } + else + { + lhs_path = m_path; + } + string rhs_path; + if (rhs.is_directory()) + { + rhs_path = rhs.path(); + rhs_path = rhs_path.substr(0, rhs_path.length() - 1); + } + else + { + rhs_path = rhs.path(); + } + return lhs_path == rhs_path; } + } // namespace Urn +} // namespace WebDAV + +auto operator<<(std::ostream& stream, const WebDAV::Urn::Path& path) -> std::ostream& +{ + return stream << path.path(); } diff --git a/sources/urn.hpp b/sources/urn.hpp index 009510f..aa082f9 100644 --- a/sources/urn.hpp +++ b/sources/urn.hpp @@ -2,14 +2,14 @@ # __ __ _____ _____ # Project | | | | | \ / ___| # | |__| | | |\ \ / / -# | | | | ) ) ( ( +# | | | | ) ) ( ( # | /\ | | |/ / \ \___ # \_/ \_/ |_____/ \_____| # -# Copyright (C) 2016, The WDC Project, , et al. +# Copyright (C) 2018, The WDC Project, , et al. # # This software is licensed as described in the file LICENSE, which -# you should have received as part of this distribution. +# you should have received as part of this distribution. # # You may opt to use, copy, modify, merge, publish, distribute and/or sell # copies of the Software, and permit persons to whom the Software is @@ -20,49 +20,47 @@ # ############################################################################*/ -#ifndef WEBDAV_URN_H -#define WEBDAV_URN_H -#pragma once +#ifndef WEBDAV_URN_HPP +#define WEBDAV_URN_HPP +#include +#include #include -using std::string; namespace WebDAV { - namespace Urn { + namespace Urn + { + using std::string; + using std::nullptr_t; - class Path { + class Path + { + public: - static const string separate; + explicit Path(const string& path_, bool force_dir = false); + explicit Path(nullptr_t); - static const string root; + auto operator+(const std::string& rhs) const -> Path; + auto operator==(const Path& rhs) const -> bool; - string m_path; + auto is_directory() const -> bool; + auto is_root() const -> bool; + auto name() const -> string; + auto parent() const -> Path; + auto path() const -> string; + auto quote(void* request) const -> string; - public: + private: - Path(const string& path, bool force_dir = false); + string m_path; - Path(std::nullptr_t); - - auto path() const -> string; - - auto quote(void * request) const -> string; - - auto name() const -> string; - - auto parent() const -> Path; - - auto is_directory() const -> bool; - - auto is_root() const -> bool; - - auto operator+(const std::string& rhs) const -> Path; - - auto operator==(const Path& rhs) const -> bool; - }; - - } + static const string separate; + static const string root; + }; + } } +auto operator<<(std::ostream& stream, const WebDAV::Urn::Path& path) -> std::ostream&; + #endif diff --git a/tests/catch.hpp b/tests/catch.hpp deleted file mode 100644 index b3ef370..0000000 --- a/tests/catch.hpp +++ /dev/null @@ -1,10525 +0,0 @@ -/* - * Catch v1.5.7 - * Generated: 2016-09-27 10:45:46.824849 - * ---------------------------------------------------------- - * This file has been merged from multiple headers. Please don't edit it directly - * Copyright (c) 2012 Two Blue Cubes Ltd. All rights reserved. - * - * Distributed under the Boost Software License, Version 1.0. (See accompanying - * file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) - */ -#ifndef TWOBLUECUBES_SINGLE_INCLUDE_CATCH_HPP_INCLUDED -#define TWOBLUECUBES_SINGLE_INCLUDE_CATCH_HPP_INCLUDED - -#define TWOBLUECUBES_CATCH_HPP_INCLUDED - -#ifdef __clang__ -# pragma clang system_header -#elif defined __GNUC__ -# pragma GCC system_header -#endif - -// #included from: internal/catch_suppress_warnings.h - -#ifdef __clang__ -# ifdef __ICC // icpc defines the __clang__ macro -# pragma warning(push) -# pragma warning(disable: 161 1682) -# else // __ICC -# pragma clang diagnostic ignored "-Wglobal-constructors" -# pragma clang diagnostic ignored "-Wvariadic-macros" -# pragma clang diagnostic ignored "-Wc99-extensions" -# pragma clang diagnostic ignored "-Wunused-variable" -# pragma clang diagnostic push -# pragma clang diagnostic ignored "-Wpadded" -# pragma clang diagnostic ignored "-Wc++98-compat" -# pragma clang diagnostic ignored "-Wc++98-compat-pedantic" -# pragma clang diagnostic ignored "-Wswitch-enum" -# pragma clang diagnostic ignored "-Wcovered-switch-default" -# endif -#elif defined __GNUC__ -# pragma GCC diagnostic ignored "-Wvariadic-macros" -# pragma GCC diagnostic ignored "-Wunused-variable" -# pragma GCC diagnostic push -# pragma GCC diagnostic ignored "-Wpadded" -#endif -#if defined(CATCH_CONFIG_MAIN) || defined(CATCH_CONFIG_RUNNER) -# define CATCH_IMPL -#endif - -#ifdef CATCH_IMPL -# ifndef CLARA_CONFIG_MAIN -# define CLARA_CONFIG_MAIN_NOT_DEFINED -# define CLARA_CONFIG_MAIN -# endif -#endif - -// #included from: internal/catch_notimplemented_exception.h -#define TWOBLUECUBES_CATCH_NOTIMPLEMENTED_EXCEPTION_H_INCLUDED - -// #included from: catch_common.h -#define TWOBLUECUBES_CATCH_COMMON_H_INCLUDED - -#define INTERNAL_CATCH_UNIQUE_NAME_LINE2( name, line ) name##line -#define INTERNAL_CATCH_UNIQUE_NAME_LINE( name, line ) INTERNAL_CATCH_UNIQUE_NAME_LINE2( name, line ) -#ifdef CATCH_CONFIG_COUNTER -# define INTERNAL_CATCH_UNIQUE_NAME( name ) INTERNAL_CATCH_UNIQUE_NAME_LINE( name, __COUNTER__ ) -#else -# define INTERNAL_CATCH_UNIQUE_NAME( name ) INTERNAL_CATCH_UNIQUE_NAME_LINE( name, __LINE__ ) -#endif - -#define INTERNAL_CATCH_STRINGIFY2( expr ) #expr -#define INTERNAL_CATCH_STRINGIFY( expr ) INTERNAL_CATCH_STRINGIFY2( expr ) - -#include -#include -#include - -// #included from: catch_compiler_capabilities.h -#define TWOBLUECUBES_CATCH_COMPILER_CAPABILITIES_HPP_INCLUDED - -// Detect a number of compiler features - mostly C++11/14 conformance - by compiler -// The following features are defined: -// -// CATCH_CONFIG_CPP11_NULLPTR : is nullptr supported? -// CATCH_CONFIG_CPP11_NOEXCEPT : is noexcept supported? -// CATCH_CONFIG_CPP11_GENERATED_METHODS : The delete and default keywords for compiler generated methods -// CATCH_CONFIG_CPP11_IS_ENUM : std::is_enum is supported? -// CATCH_CONFIG_CPP11_TUPLE : std::tuple is supported -// CATCH_CONFIG_CPP11_LONG_LONG : is long long supported? -// CATCH_CONFIG_CPP11_OVERRIDE : is override supported? -// CATCH_CONFIG_CPP11_UNIQUE_PTR : is unique_ptr supported (otherwise use auto_ptr) - -// CATCH_CONFIG_CPP11_OR_GREATER : Is C++11 supported? - -// CATCH_CONFIG_VARIADIC_MACROS : are variadic macros supported? -// CATCH_CONFIG_COUNTER : is the __COUNTER__ macro supported? -// **************** -// Note to maintainers: if new toggles are added please document them -// in configuration.md, too -// **************** - -// In general each macro has a _NO_ form -// (e.g. CATCH_CONFIG_CPP11_NO_NULLPTR) which disables the feature. -// Many features, at point of detection, define an _INTERNAL_ macro, so they -// can be combined, en-mass, with the _NO_ forms later. - -// All the C++11 features can be disabled with CATCH_CONFIG_NO_CPP11 - -#ifdef __cplusplus - -# if __cplusplus >= 201103L -# define CATCH_CPP11_OR_GREATER -# endif - -# if __cplusplus >= 201402L -# define CATCH_CPP14_OR_GREATER -# endif - -#endif - -#ifdef __clang__ - -# if __has_feature(cxx_nullptr) -# define CATCH_INTERNAL_CONFIG_CPP11_NULLPTR -# endif - -# if __has_feature(cxx_noexcept) -# define CATCH_INTERNAL_CONFIG_CPP11_NOEXCEPT -# endif - -# if defined(CATCH_CPP11_OR_GREATER) -# define CATCH_INTERNAL_SUPPRESS_PARENTHESES_WARNINGS _Pragma( "clang diagnostic ignored \"-Wparentheses\"" ) -# endif - -#endif // __clang__ - -//////////////////////////////////////////////////////////////////////////////// -// Borland -#ifdef __BORLANDC__ - -#endif // __BORLANDC__ - -//////////////////////////////////////////////////////////////////////////////// -// EDG -#ifdef __EDG_VERSION__ - -#endif // __EDG_VERSION__ - -//////////////////////////////////////////////////////////////////////////////// -// Digital Mars -#ifdef __DMC__ - -#endif // __DMC__ - -//////////////////////////////////////////////////////////////////////////////// -// GCC -#ifdef __GNUC__ - -# if __GNUC__ == 4 && __GNUC_MINOR__ >= 6 && defined(__GXX_EXPERIMENTAL_CXX0X__) -# define CATCH_INTERNAL_CONFIG_CPP11_NULLPTR -# endif - -# if !defined(CATCH_INTERNAL_SUPPRESS_PARENTHESES_WARNINGS) && defined(CATCH_CPP11_OR_GREATER) -# define CATCH_INTERNAL_SUPPRESS_PARENTHESES_WARNINGS _Pragma( "GCC diagnostic ignored \"-Wparentheses\"" ) -# endif - -// - otherwise more recent versions define __cplusplus >= 201103L -// and will get picked up below - -#endif // __GNUC__ - -//////////////////////////////////////////////////////////////////////////////// -// Visual C++ -#ifdef _MSC_VER - -#if (_MSC_VER >= 1600) -# define CATCH_INTERNAL_CONFIG_CPP11_NULLPTR -# define CATCH_INTERNAL_CONFIG_CPP11_UNIQUE_PTR -#endif - -#if (_MSC_VER >= 1900 ) // (VC++ 13 (VS2015)) -#define CATCH_INTERNAL_CONFIG_CPP11_NOEXCEPT -#define CATCH_INTERNAL_CONFIG_CPP11_GENERATED_METHODS -#endif - -#endif // _MSC_VER - -//////////////////////////////////////////////////////////////////////////////// - -// Use variadic macros if the compiler supports them -#if ( defined _MSC_VER && _MSC_VER > 1400 && !defined __EDGE__) || \ - ( defined __WAVE__ && __WAVE_HAS_VARIADICS ) || \ - ( defined __GNUC__ && __GNUC__ >= 3 ) || \ - ( !defined __cplusplus && __STDC_VERSION__ >= 199901L || __cplusplus >= 201103L ) - -#define CATCH_INTERNAL_CONFIG_VARIADIC_MACROS - -#endif - -// Use __COUNTER__ if the compiler supports it -#if ( defined _MSC_VER && _MSC_VER >= 1300 ) || \ - ( defined __GNUC__ && __GNUC__ >= 4 && __GNUC_MINOR__ >= 3 ) || \ - ( defined __clang__ && __clang_major__ >= 3 ) - -#define CATCH_INTERNAL_CONFIG_COUNTER - -#endif - -//////////////////////////////////////////////////////////////////////////////// -// C++ language feature support - -// catch all support for C++11 -#if defined(CATCH_CPP11_OR_GREATER) - -# if !defined(CATCH_INTERNAL_CONFIG_CPP11_NULLPTR) -# define CATCH_INTERNAL_CONFIG_CPP11_NULLPTR -# endif - -# ifndef CATCH_INTERNAL_CONFIG_CPP11_NOEXCEPT -# define CATCH_INTERNAL_CONFIG_CPP11_NOEXCEPT -# endif - -# ifndef CATCH_INTERNAL_CONFIG_CPP11_GENERATED_METHODS -# define CATCH_INTERNAL_CONFIG_CPP11_GENERATED_METHODS -# endif - -# ifndef CATCH_INTERNAL_CONFIG_CPP11_IS_ENUM -# define CATCH_INTERNAL_CONFIG_CPP11_IS_ENUM -# endif - -# ifndef CATCH_INTERNAL_CONFIG_CPP11_TUPLE -# define CATCH_INTERNAL_CONFIG_CPP11_TUPLE -# endif - -# ifndef CATCH_INTERNAL_CONFIG_VARIADIC_MACROS -# define CATCH_INTERNAL_CONFIG_VARIADIC_MACROS -# endif - -# if !defined(CATCH_INTERNAL_CONFIG_CPP11_LONG_LONG) -# define CATCH_INTERNAL_CONFIG_CPP11_LONG_LONG -# endif - -# if !defined(CATCH_INTERNAL_CONFIG_CPP11_OVERRIDE) -# define CATCH_INTERNAL_CONFIG_CPP11_OVERRIDE -# endif -# if !defined(CATCH_INTERNAL_CONFIG_CPP11_UNIQUE_PTR) -# define CATCH_INTERNAL_CONFIG_CPP11_UNIQUE_PTR -# endif - -#endif // __cplusplus >= 201103L - -// Now set the actual defines based on the above + anything the user has configured -#if defined(CATCH_INTERNAL_CONFIG_CPP11_NULLPTR) && !defined(CATCH_CONFIG_CPP11_NO_NULLPTR) && !defined(CATCH_CONFIG_CPP11_NULLPTR) && !defined(CATCH_CONFIG_NO_CPP11) -# define CATCH_CONFIG_CPP11_NULLPTR -#endif -#if defined(CATCH_INTERNAL_CONFIG_CPP11_NOEXCEPT) && !defined(CATCH_CONFIG_CPP11_NO_NOEXCEPT) && !defined(CATCH_CONFIG_CPP11_NOEXCEPT) && !defined(CATCH_CONFIG_NO_CPP11) -# define CATCH_CONFIG_CPP11_NOEXCEPT -#endif -#if defined(CATCH_INTERNAL_CONFIG_CPP11_GENERATED_METHODS) && !defined(CATCH_CONFIG_CPP11_NO_GENERATED_METHODS) && !defined(CATCH_CONFIG_CPP11_GENERATED_METHODS) && !defined(CATCH_CONFIG_NO_CPP11) -# define CATCH_CONFIG_CPP11_GENERATED_METHODS -#endif -#if defined(CATCH_INTERNAL_CONFIG_CPP11_IS_ENUM) && !defined(CATCH_CONFIG_CPP11_NO_IS_ENUM) && !defined(CATCH_CONFIG_CPP11_IS_ENUM) && !defined(CATCH_CONFIG_NO_CPP11) -# define CATCH_CONFIG_CPP11_IS_ENUM -#endif -#if defined(CATCH_INTERNAL_CONFIG_CPP11_TUPLE) && !defined(CATCH_CONFIG_CPP11_NO_TUPLE) && !defined(CATCH_CONFIG_CPP11_TUPLE) && !defined(CATCH_CONFIG_NO_CPP11) -# define CATCH_CONFIG_CPP11_TUPLE -#endif -#if defined(CATCH_INTERNAL_CONFIG_VARIADIC_MACROS) && !defined(CATCH_CONFIG_NO_VARIADIC_MACROS) && !defined(CATCH_CONFIG_VARIADIC_MACROS) -# define CATCH_CONFIG_VARIADIC_MACROS -#endif -#if defined(CATCH_INTERNAL_CONFIG_CPP11_LONG_LONG) && !defined(CATCH_CONFIG_NO_LONG_LONG) && !defined(CATCH_CONFIG_CPP11_LONG_LONG) && !defined(CATCH_CONFIG_NO_CPP11) -# define CATCH_CONFIG_CPP11_LONG_LONG -#endif -#if defined(CATCH_INTERNAL_CONFIG_CPP11_OVERRIDE) && !defined(CATCH_CONFIG_NO_OVERRIDE) && !defined(CATCH_CONFIG_CPP11_OVERRIDE) && !defined(CATCH_CONFIG_NO_CPP11) -# define CATCH_CONFIG_CPP11_OVERRIDE -#endif -#if defined(CATCH_INTERNAL_CONFIG_CPP11_UNIQUE_PTR) && !defined(CATCH_CONFIG_NO_UNIQUE_PTR) && !defined(CATCH_CONFIG_CPP11_UNIQUE_PTR) && !defined(CATCH_CONFIG_NO_CPP11) -# define CATCH_CONFIG_CPP11_UNIQUE_PTR -#endif -#if defined(CATCH_INTERNAL_CONFIG_COUNTER) && !defined(CATCH_CONFIG_NO_COUNTER) && !defined(CATCH_CONFIG_COUNTER) -# define CATCH_CONFIG_COUNTER -#endif - -#if !defined(CATCH_INTERNAL_SUPPRESS_PARENTHESES_WARNINGS) -# define CATCH_INTERNAL_SUPPRESS_PARENTHESES_WARNINGS -#endif - -// noexcept support: -#if defined(CATCH_CONFIG_CPP11_NOEXCEPT) && !defined(CATCH_NOEXCEPT) -# define CATCH_NOEXCEPT noexcept -# define CATCH_NOEXCEPT_IS(x) noexcept(x) -#else -# define CATCH_NOEXCEPT throw() -# define CATCH_NOEXCEPT_IS(x) -#endif - -// nullptr support -#ifdef CATCH_CONFIG_CPP11_NULLPTR -# define CATCH_NULL nullptr -#else -# define CATCH_NULL NULL -#endif - -// override support -#ifdef CATCH_CONFIG_CPP11_OVERRIDE -# define CATCH_OVERRIDE override -#else -# define CATCH_OVERRIDE -#endif - -// unique_ptr support -#ifdef CATCH_CONFIG_CPP11_UNIQUE_PTR -# define CATCH_AUTO_PTR( T ) std::unique_ptr -#else -# define CATCH_AUTO_PTR( T ) std::auto_ptr -#endif - -namespace Catch { - - struct IConfig; - - struct CaseSensitive { enum Choice { - Yes, - No - }; }; - - class NonCopyable { -#ifdef CATCH_CONFIG_CPP11_GENERATED_METHODS - NonCopyable( NonCopyable const& ) = delete; - NonCopyable( NonCopyable && ) = delete; - NonCopyable& operator = ( NonCopyable const& ) = delete; - NonCopyable& operator = ( NonCopyable && ) = delete; -#else - NonCopyable( NonCopyable const& info ); - NonCopyable& operator = ( NonCopyable const& ); -#endif - - protected: - NonCopyable() {} - virtual ~NonCopyable(); - }; - - class SafeBool { - public: - typedef void (SafeBool::*type)() const; - - static type makeSafe( bool value ) { - return value ? &SafeBool::trueValue : 0; - } - private: - void trueValue() const {} - }; - - template - inline void deleteAll( ContainerT& container ) { - typename ContainerT::const_iterator it = container.begin(); - typename ContainerT::const_iterator itEnd = container.end(); - for(; it != itEnd; ++it ) - delete *it; - } - template - inline void deleteAllValues( AssociativeContainerT& container ) { - typename AssociativeContainerT::const_iterator it = container.begin(); - typename AssociativeContainerT::const_iterator itEnd = container.end(); - for(; it != itEnd; ++it ) - delete it->second; - } - - bool startsWith( std::string const& s, std::string const& prefix ); - bool endsWith( std::string const& s, std::string const& suffix ); - bool contains( std::string const& s, std::string const& infix ); - void toLowerInPlace( std::string& s ); - std::string toLower( std::string const& s ); - std::string trim( std::string const& str ); - bool replaceInPlace( std::string& str, std::string const& replaceThis, std::string const& withThis ); - - struct pluralise { - pluralise( std::size_t count, std::string const& label ); - - friend std::ostream& operator << ( std::ostream& os, pluralise const& pluraliser ); - - std::size_t m_count; - std::string m_label; - }; - - struct SourceLineInfo { - - SourceLineInfo(); - SourceLineInfo( char const* _file, std::size_t _line ); - SourceLineInfo( SourceLineInfo const& other ); -# ifdef CATCH_CONFIG_CPP11_GENERATED_METHODS - SourceLineInfo( SourceLineInfo && ) = default; - SourceLineInfo& operator = ( SourceLineInfo const& ) = default; - SourceLineInfo& operator = ( SourceLineInfo && ) = default; -# endif - bool empty() const; - bool operator == ( SourceLineInfo const& other ) const; - bool operator < ( SourceLineInfo const& other ) const; - - std::string file; - std::size_t line; - }; - - std::ostream& operator << ( std::ostream& os, SourceLineInfo const& info ); - - // This is just here to avoid compiler warnings with macro constants and boolean literals - inline bool isTrue( bool value ){ return value; } - inline bool alwaysTrue() { return true; } - inline bool alwaysFalse() { return false; } - - void throwLogicError( std::string const& message, SourceLineInfo const& locationInfo ); - - void seedRng( IConfig const& config ); - unsigned int rngSeed(); - - // Use this in variadic streaming macros to allow - // >> +StreamEndStop - // as well as - // >> stuff +StreamEndStop - struct StreamEndStop { - std::string operator+() { - return std::string(); - } - }; - template - T const& operator + ( T const& value, StreamEndStop ) { - return value; - } -} - -#define CATCH_INTERNAL_LINEINFO ::Catch::SourceLineInfo( __FILE__, static_cast( __LINE__ ) ) -#define CATCH_INTERNAL_ERROR( msg ) ::Catch::throwLogicError( msg, CATCH_INTERNAL_LINEINFO ); - -#include - -namespace Catch { - - class NotImplementedException : public std::exception - { - public: - NotImplementedException( SourceLineInfo const& lineInfo ); - NotImplementedException( NotImplementedException const& ) {} - - virtual ~NotImplementedException() CATCH_NOEXCEPT {} - - virtual const char* what() const CATCH_NOEXCEPT; - - private: - std::string m_what; - SourceLineInfo m_lineInfo; - }; - -} // end namespace Catch - -/////////////////////////////////////////////////////////////////////////////// -#define CATCH_NOT_IMPLEMENTED throw Catch::NotImplementedException( CATCH_INTERNAL_LINEINFO ) - -// #included from: internal/catch_context.h -#define TWOBLUECUBES_CATCH_CONTEXT_H_INCLUDED - -// #included from: catch_interfaces_generators.h -#define TWOBLUECUBES_CATCH_INTERFACES_GENERATORS_H_INCLUDED - -#include - -namespace Catch { - - struct IGeneratorInfo { - virtual ~IGeneratorInfo(); - virtual bool moveNext() = 0; - virtual std::size_t getCurrentIndex() const = 0; - }; - - struct IGeneratorsForTest { - virtual ~IGeneratorsForTest(); - - virtual IGeneratorInfo& getGeneratorInfo( std::string const& fileInfo, std::size_t size ) = 0; - virtual bool moveNext() = 0; - }; - - IGeneratorsForTest* createGeneratorsForTest(); - -} // end namespace Catch - -// #included from: catch_ptr.hpp -#define TWOBLUECUBES_CATCH_PTR_HPP_INCLUDED - -#ifdef __clang__ -#pragma clang diagnostic push -#pragma clang diagnostic ignored "-Wpadded" -#endif - -namespace Catch { - - // An intrusive reference counting smart pointer. - // T must implement addRef() and release() methods - // typically implementing the IShared interface - template - class Ptr { - public: - Ptr() : m_p( CATCH_NULL ){} - Ptr( T* p ) : m_p( p ){ - if( m_p ) - m_p->addRef(); - } - Ptr( Ptr const& other ) : m_p( other.m_p ){ - if( m_p ) - m_p->addRef(); - } - ~Ptr(){ - if( m_p ) - m_p->release(); - } - void reset() { - if( m_p ) - m_p->release(); - m_p = CATCH_NULL; - } - Ptr& operator = ( T* p ){ - Ptr temp( p ); - swap( temp ); - return *this; - } - Ptr& operator = ( Ptr const& other ){ - Ptr temp( other ); - swap( temp ); - return *this; - } - void swap( Ptr& other ) { std::swap( m_p, other.m_p ); } - T* get() const{ return m_p; } - T& operator*() const { return *m_p; } - T* operator->() const { return m_p; } - bool operator !() const { return m_p == CATCH_NULL; } - operator SafeBool::type() const { return SafeBool::makeSafe( m_p != CATCH_NULL ); } - - private: - T* m_p; - }; - - struct IShared : NonCopyable { - virtual ~IShared(); - virtual void addRef() const = 0; - virtual void release() const = 0; - }; - - template - struct SharedImpl : T { - - SharedImpl() : m_rc( 0 ){} - - virtual void addRef() const { - ++m_rc; - } - virtual void release() const { - if( --m_rc == 0 ) - delete this; - } - - mutable unsigned int m_rc; - }; - -} // end namespace Catch - -#ifdef __clang__ -#pragma clang diagnostic pop -#endif - -#include -#include -#include - -namespace Catch { - - class TestCase; - class Stream; - struct IResultCapture; - struct IRunner; - struct IGeneratorsForTest; - struct IConfig; - - struct IContext - { - virtual ~IContext(); - - virtual IResultCapture* getResultCapture() = 0; - virtual IRunner* getRunner() = 0; - virtual size_t getGeneratorIndex( std::string const& fileInfo, size_t totalSize ) = 0; - virtual bool advanceGeneratorsForCurrentTest() = 0; - virtual Ptr getConfig() const = 0; - }; - - struct IMutableContext : IContext - { - virtual ~IMutableContext(); - virtual void setResultCapture( IResultCapture* resultCapture ) = 0; - virtual void setRunner( IRunner* runner ) = 0; - virtual void setConfig( Ptr const& config ) = 0; - }; - - IContext& getCurrentContext(); - IMutableContext& getCurrentMutableContext(); - void cleanUpContext(); - Stream createStream( std::string const& streamName ); - -} - -// #included from: internal/catch_test_registry.hpp -#define TWOBLUECUBES_CATCH_TEST_REGISTRY_HPP_INCLUDED - -// #included from: catch_interfaces_testcase.h -#define TWOBLUECUBES_CATCH_INTERFACES_TESTCASE_H_INCLUDED - -#include - -namespace Catch { - - class TestSpec; - - struct ITestCase : IShared { - virtual void invoke () const = 0; - protected: - virtual ~ITestCase(); - }; - - class TestCase; - struct IConfig; - - struct ITestCaseRegistry { - virtual ~ITestCaseRegistry(); - virtual std::vector const& getAllTests() const = 0; - virtual std::vector const& getAllTestsSorted( IConfig const& config ) const = 0; - }; - - bool matchTest( TestCase const& testCase, TestSpec const& testSpec, IConfig const& config ); - std::vector filterTests( std::vector const& testCases, TestSpec const& testSpec, IConfig const& config ); - std::vector const& getAllTestCasesSorted( IConfig const& config ); - -} - -namespace Catch { - -template -class MethodTestCase : public SharedImpl { - -public: - MethodTestCase( void (C::*method)() ) : m_method( method ) {} - - virtual void invoke() const { - C obj; - (obj.*m_method)(); - } - -private: - virtual ~MethodTestCase() {} - - void (C::*m_method)(); -}; - -typedef void(*TestFunction)(); - -struct NameAndDesc { - NameAndDesc( const char* _name = "", const char* _description= "" ) - : name( _name ), description( _description ) - {} - - const char* name; - const char* description; -}; - -void registerTestCase - ( ITestCase* testCase, - char const* className, - NameAndDesc const& nameAndDesc, - SourceLineInfo const& lineInfo ); - -struct AutoReg { - - AutoReg - ( TestFunction function, - SourceLineInfo const& lineInfo, - NameAndDesc const& nameAndDesc ); - - template - AutoReg - ( void (C::*method)(), - char const* className, - NameAndDesc const& nameAndDesc, - SourceLineInfo const& lineInfo ) { - - registerTestCase - ( new MethodTestCase( method ), - className, - nameAndDesc, - lineInfo ); - } - - ~AutoReg(); - -private: - AutoReg( AutoReg const& ); - void operator= ( AutoReg const& ); -}; - -void registerTestCaseFunction - ( TestFunction function, - SourceLineInfo const& lineInfo, - NameAndDesc const& nameAndDesc ); - -} // end namespace Catch - -#ifdef CATCH_CONFIG_VARIADIC_MACROS - /////////////////////////////////////////////////////////////////////////////// - #define INTERNAL_CATCH_TESTCASE2( TestName, ... ) \ - static void TestName(); \ - namespace{ Catch::AutoReg INTERNAL_CATCH_UNIQUE_NAME( autoRegistrar )( &TestName, CATCH_INTERNAL_LINEINFO, Catch::NameAndDesc( __VA_ARGS__ ) ); }\ - static void TestName() - #define INTERNAL_CATCH_TESTCASE( ... ) \ - INTERNAL_CATCH_TESTCASE2( INTERNAL_CATCH_UNIQUE_NAME( ____C_A_T_C_H____T_E_S_T____ ), __VA_ARGS__ ) - - /////////////////////////////////////////////////////////////////////////////// - #define INTERNAL_CATCH_METHOD_AS_TEST_CASE( QualifiedMethod, ... ) \ - namespace{ Catch::AutoReg INTERNAL_CATCH_UNIQUE_NAME( autoRegistrar )( &QualifiedMethod, "&" #QualifiedMethod, Catch::NameAndDesc( __VA_ARGS__ ), CATCH_INTERNAL_LINEINFO ); } - - /////////////////////////////////////////////////////////////////////////////// - #define INTERNAL_CATCH_TEST_CASE_METHOD2( TestName, ClassName, ... )\ - namespace{ \ - struct TestName : ClassName{ \ - void test(); \ - }; \ - Catch::AutoReg INTERNAL_CATCH_UNIQUE_NAME( autoRegistrar ) ( &TestName::test, #ClassName, Catch::NameAndDesc( __VA_ARGS__ ), CATCH_INTERNAL_LINEINFO ); \ - } \ - void TestName::test() - #define INTERNAL_CATCH_TEST_CASE_METHOD( ClassName, ... ) \ - INTERNAL_CATCH_TEST_CASE_METHOD2( INTERNAL_CATCH_UNIQUE_NAME( ____C_A_T_C_H____T_E_S_T____ ), ClassName, __VA_ARGS__ ) - - /////////////////////////////////////////////////////////////////////////////// - #define INTERNAL_CATCH_REGISTER_TESTCASE( Function, ... ) \ - Catch::AutoReg( Function, CATCH_INTERNAL_LINEINFO, Catch::NameAndDesc( __VA_ARGS__ ) ); - -#else - /////////////////////////////////////////////////////////////////////////////// - #define INTERNAL_CATCH_TESTCASE2( TestName, Name, Desc ) \ - static void TestName(); \ - namespace{ Catch::AutoReg INTERNAL_CATCH_UNIQUE_NAME( autoRegistrar )( &TestName, CATCH_INTERNAL_LINEINFO, Catch::NameAndDesc( Name, Desc ) ); }\ - static void TestName() - #define INTERNAL_CATCH_TESTCASE( Name, Desc ) \ - INTERNAL_CATCH_TESTCASE2( INTERNAL_CATCH_UNIQUE_NAME( ____C_A_T_C_H____T_E_S_T____ ), Name, Desc ) - - /////////////////////////////////////////////////////////////////////////////// - #define INTERNAL_CATCH_METHOD_AS_TEST_CASE( QualifiedMethod, Name, Desc ) \ - namespace{ Catch::AutoReg INTERNAL_CATCH_UNIQUE_NAME( autoRegistrar )( &QualifiedMethod, "&" #QualifiedMethod, Catch::NameAndDesc( Name, Desc ), CATCH_INTERNAL_LINEINFO ); } - - /////////////////////////////////////////////////////////////////////////////// - #define INTERNAL_CATCH_TEST_CASE_METHOD2( TestCaseName, ClassName, TestName, Desc )\ - namespace{ \ - struct TestCaseName : ClassName{ \ - void test(); \ - }; \ - Catch::AutoReg INTERNAL_CATCH_UNIQUE_NAME( autoRegistrar ) ( &TestCaseName::test, #ClassName, Catch::NameAndDesc( TestName, Desc ), CATCH_INTERNAL_LINEINFO ); \ - } \ - void TestCaseName::test() - #define INTERNAL_CATCH_TEST_CASE_METHOD( ClassName, TestName, Desc )\ - INTERNAL_CATCH_TEST_CASE_METHOD2( INTERNAL_CATCH_UNIQUE_NAME( ____C_A_T_C_H____T_E_S_T____ ), ClassName, TestName, Desc ) - - /////////////////////////////////////////////////////////////////////////////// - #define INTERNAL_CATCH_REGISTER_TESTCASE( Function, Name, Desc ) \ - Catch::AutoReg( Function, CATCH_INTERNAL_LINEINFO, Catch::NameAndDesc( Name, Desc ) ); -#endif - -// #included from: internal/catch_capture.hpp -#define TWOBLUECUBES_CATCH_CAPTURE_HPP_INCLUDED - -// #included from: catch_result_builder.h -#define TWOBLUECUBES_CATCH_RESULT_BUILDER_H_INCLUDED - -// #included from: catch_result_type.h -#define TWOBLUECUBES_CATCH_RESULT_TYPE_H_INCLUDED - -namespace Catch { - - // ResultWas::OfType enum - struct ResultWas { enum OfType { - Unknown = -1, - Ok = 0, - Info = 1, - Warning = 2, - - FailureBit = 0x10, - - ExpressionFailed = FailureBit | 1, - ExplicitFailure = FailureBit | 2, - - Exception = 0x100 | FailureBit, - - ThrewException = Exception | 1, - DidntThrowException = Exception | 2, - - FatalErrorCondition = 0x200 | FailureBit - - }; }; - - inline bool isOk( ResultWas::OfType resultType ) { - return ( resultType & ResultWas::FailureBit ) == 0; - } - inline bool isJustInfo( int flags ) { - return flags == ResultWas::Info; - } - - // ResultDisposition::Flags enum - struct ResultDisposition { enum Flags { - Normal = 0x01, - - ContinueOnFailure = 0x02, // Failures fail test, but execution continues - FalseTest = 0x04, // Prefix expression with ! - SuppressFail = 0x08 // Failures are reported but do not fail the test - }; }; - - inline ResultDisposition::Flags operator | ( ResultDisposition::Flags lhs, ResultDisposition::Flags rhs ) { - return static_cast( static_cast( lhs ) | static_cast( rhs ) ); - } - - inline bool shouldContinueOnFailure( int flags ) { return ( flags & ResultDisposition::ContinueOnFailure ) != 0; } - inline bool isFalseTest( int flags ) { return ( flags & ResultDisposition::FalseTest ) != 0; } - inline bool shouldSuppressFailure( int flags ) { return ( flags & ResultDisposition::SuppressFail ) != 0; } - -} // end namespace Catch - -// #included from: catch_assertionresult.h -#define TWOBLUECUBES_CATCH_ASSERTIONRESULT_H_INCLUDED - -#include - -namespace Catch { - - struct AssertionInfo - { - AssertionInfo() {} - AssertionInfo( std::string const& _macroName, - SourceLineInfo const& _lineInfo, - std::string const& _capturedExpression, - ResultDisposition::Flags _resultDisposition ); - - std::string macroName; - SourceLineInfo lineInfo; - std::string capturedExpression; - ResultDisposition::Flags resultDisposition; - }; - - struct AssertionResultData - { - AssertionResultData() : resultType( ResultWas::Unknown ) {} - - std::string reconstructedExpression; - std::string message; - ResultWas::OfType resultType; - }; - - class AssertionResult { - public: - AssertionResult(); - AssertionResult( AssertionInfo const& info, AssertionResultData const& data ); - ~AssertionResult(); -# ifdef CATCH_CONFIG_CPP11_GENERATED_METHODS - AssertionResult( AssertionResult const& ) = default; - AssertionResult( AssertionResult && ) = default; - AssertionResult& operator = ( AssertionResult const& ) = default; - AssertionResult& operator = ( AssertionResult && ) = default; -# endif - - bool isOk() const; - bool succeeded() const; - ResultWas::OfType getResultType() const; - bool hasExpression() const; - bool hasMessage() const; - std::string getExpression() const; - std::string getExpressionInMacro() const; - bool hasExpandedExpression() const; - std::string getExpandedExpression() const; - std::string getMessage() const; - SourceLineInfo getSourceInfo() const; - std::string getTestMacroName() const; - - protected: - AssertionInfo m_info; - AssertionResultData m_resultData; - }; - -} // end namespace Catch - -// #included from: catch_matchers.hpp -#define TWOBLUECUBES_CATCH_MATCHERS_HPP_INCLUDED - -namespace Catch { -namespace Matchers { - namespace Impl { - - namespace Generic { - template class AllOf; - template class AnyOf; - template class Not; - } - - template - struct Matcher : SharedImpl - { - typedef ExpressionT ExpressionType; - - virtual ~Matcher() {} - virtual Ptr clone() const = 0; - virtual bool match( ExpressionT const& expr ) const = 0; - virtual std::string toString() const = 0; - - Generic::AllOf operator && ( Matcher const& other ) const; - Generic::AnyOf operator || ( Matcher const& other ) const; - Generic::Not operator ! () const; - }; - - template - struct MatcherImpl : Matcher { - - virtual Ptr > clone() const { - return Ptr >( new DerivedT( static_cast( *this ) ) ); - } - }; - - namespace Generic { - template - class Not : public MatcherImpl, ExpressionT> { - public: - explicit Not( Matcher const& matcher ) : m_matcher(matcher.clone()) {} - Not( Not const& other ) : m_matcher( other.m_matcher ) {} - - virtual bool match( ExpressionT const& expr ) const CATCH_OVERRIDE { - return !m_matcher->match( expr ); - } - - virtual std::string toString() const CATCH_OVERRIDE { - return "not " + m_matcher->toString(); - } - private: - Ptr< Matcher > m_matcher; - }; - - template - class AllOf : public MatcherImpl, ExpressionT> { - public: - - AllOf() {} - AllOf( AllOf const& other ) : m_matchers( other.m_matchers ) {} - - AllOf& add( Matcher const& matcher ) { - m_matchers.push_back( matcher.clone() ); - return *this; - } - virtual bool match( ExpressionT const& expr ) const - { - for( std::size_t i = 0; i < m_matchers.size(); ++i ) - if( !m_matchers[i]->match( expr ) ) - return false; - return true; - } - virtual std::string toString() const { - std::ostringstream oss; - oss << "( "; - for( std::size_t i = 0; i < m_matchers.size(); ++i ) { - if( i != 0 ) - oss << " and "; - oss << m_matchers[i]->toString(); - } - oss << " )"; - return oss.str(); - } - - AllOf operator && ( Matcher const& other ) const { - AllOf allOfExpr( *this ); - allOfExpr.add( other ); - return allOfExpr; - } - - private: - std::vector > > m_matchers; - }; - - template - class AnyOf : public MatcherImpl, ExpressionT> { - public: - - AnyOf() {} - AnyOf( AnyOf const& other ) : m_matchers( other.m_matchers ) {} - - AnyOf& add( Matcher const& matcher ) { - m_matchers.push_back( matcher.clone() ); - return *this; - } - virtual bool match( ExpressionT const& expr ) const - { - for( std::size_t i = 0; i < m_matchers.size(); ++i ) - if( m_matchers[i]->match( expr ) ) - return true; - return false; - } - virtual std::string toString() const { - std::ostringstream oss; - oss << "( "; - for( std::size_t i = 0; i < m_matchers.size(); ++i ) { - if( i != 0 ) - oss << " or "; - oss << m_matchers[i]->toString(); - } - oss << " )"; - return oss.str(); - } - - AnyOf operator || ( Matcher const& other ) const { - AnyOf anyOfExpr( *this ); - anyOfExpr.add( other ); - return anyOfExpr; - } - - private: - std::vector > > m_matchers; - }; - - } // namespace Generic - - template - Generic::AllOf Matcher::operator && ( Matcher const& other ) const { - Generic::AllOf allOfExpr; - allOfExpr.add( *this ); - allOfExpr.add( other ); - return allOfExpr; - } - - template - Generic::AnyOf Matcher::operator || ( Matcher const& other ) const { - Generic::AnyOf anyOfExpr; - anyOfExpr.add( *this ); - anyOfExpr.add( other ); - return anyOfExpr; - } - - template - Generic::Not Matcher::operator ! () const { - return Generic::Not( *this ); - } - - namespace StdString { - - inline std::string makeString( std::string const& str ) { return str; } - inline std::string makeString( const char* str ) { return str ? std::string( str ) : std::string(); } - - struct CasedString - { - CasedString( std::string const& str, CaseSensitive::Choice caseSensitivity ) - : m_caseSensitivity( caseSensitivity ), - m_str( adjustString( str ) ) - {} - std::string adjustString( std::string const& str ) const { - return m_caseSensitivity == CaseSensitive::No - ? toLower( str ) - : str; - - } - std::string toStringSuffix() const - { - return m_caseSensitivity == CaseSensitive::No - ? " (case insensitive)" - : ""; - } - CaseSensitive::Choice m_caseSensitivity; - std::string m_str; - }; - - struct Equals : MatcherImpl { - Equals( std::string const& str, CaseSensitive::Choice caseSensitivity = CaseSensitive::Yes ) - : m_data( str, caseSensitivity ) - {} - Equals( Equals const& other ) : m_data( other.m_data ){} - - virtual ~Equals(); - - virtual bool match( std::string const& expr ) const { - return m_data.m_str == m_data.adjustString( expr );; - } - virtual std::string toString() const { - return "equals: \"" + m_data.m_str + "\"" + m_data.toStringSuffix(); - } - - CasedString m_data; - }; - - struct Contains : MatcherImpl { - Contains( std::string const& substr, CaseSensitive::Choice caseSensitivity = CaseSensitive::Yes ) - : m_data( substr, caseSensitivity ){} - Contains( Contains const& other ) : m_data( other.m_data ){} - - virtual ~Contains(); - - virtual bool match( std::string const& expr ) const { - return m_data.adjustString( expr ).find( m_data.m_str ) != std::string::npos; - } - virtual std::string toString() const { - return "contains: \"" + m_data.m_str + "\"" + m_data.toStringSuffix(); - } - - CasedString m_data; - }; - - struct StartsWith : MatcherImpl { - StartsWith( std::string const& substr, CaseSensitive::Choice caseSensitivity = CaseSensitive::Yes ) - : m_data( substr, caseSensitivity ){} - - StartsWith( StartsWith const& other ) : m_data( other.m_data ){} - - virtual ~StartsWith(); - - virtual bool match( std::string const& expr ) const { - return startsWith( m_data.adjustString( expr ), m_data.m_str ); - } - virtual std::string toString() const { - return "starts with: \"" + m_data.m_str + "\"" + m_data.toStringSuffix(); - } - - CasedString m_data; - }; - - struct EndsWith : MatcherImpl { - EndsWith( std::string const& substr, CaseSensitive::Choice caseSensitivity = CaseSensitive::Yes ) - : m_data( substr, caseSensitivity ){} - EndsWith( EndsWith const& other ) : m_data( other.m_data ){} - - virtual ~EndsWith(); - - virtual bool match( std::string const& expr ) const { - return endsWith( m_data.adjustString( expr ), m_data.m_str ); - } - virtual std::string toString() const { - return "ends with: \"" + m_data.m_str + "\"" + m_data.toStringSuffix(); - } - - CasedString m_data; - }; - } // namespace StdString - } // namespace Impl - - // The following functions create the actual matcher objects. - // This allows the types to be inferred - template - inline Impl::Generic::Not Not( Impl::Matcher const& m ) { - return Impl::Generic::Not( m ); - } - - template - inline Impl::Generic::AllOf AllOf( Impl::Matcher const& m1, - Impl::Matcher const& m2 ) { - return Impl::Generic::AllOf().add( m1 ).add( m2 ); - } - template - inline Impl::Generic::AllOf AllOf( Impl::Matcher const& m1, - Impl::Matcher const& m2, - Impl::Matcher const& m3 ) { - return Impl::Generic::AllOf().add( m1 ).add( m2 ).add( m3 ); - } - template - inline Impl::Generic::AnyOf AnyOf( Impl::Matcher const& m1, - Impl::Matcher const& m2 ) { - return Impl::Generic::AnyOf().add( m1 ).add( m2 ); - } - template - inline Impl::Generic::AnyOf AnyOf( Impl::Matcher const& m1, - Impl::Matcher const& m2, - Impl::Matcher const& m3 ) { - return Impl::Generic::AnyOf().add( m1 ).add( m2 ).add( m3 ); - } - - inline Impl::StdString::Equals Equals( std::string const& str, CaseSensitive::Choice caseSensitivity = CaseSensitive::Yes ) { - return Impl::StdString::Equals( str, caseSensitivity ); - } - inline Impl::StdString::Equals Equals( const char* str, CaseSensitive::Choice caseSensitivity = CaseSensitive::Yes ) { - return Impl::StdString::Equals( Impl::StdString::makeString( str ), caseSensitivity ); - } - inline Impl::StdString::Contains Contains( std::string const& substr, CaseSensitive::Choice caseSensitivity = CaseSensitive::Yes ) { - return Impl::StdString::Contains( substr, caseSensitivity ); - } - inline Impl::StdString::Contains Contains( const char* substr, CaseSensitive::Choice caseSensitivity = CaseSensitive::Yes ) { - return Impl::StdString::Contains( Impl::StdString::makeString( substr ), caseSensitivity ); - } - inline Impl::StdString::StartsWith StartsWith( std::string const& substr ) { - return Impl::StdString::StartsWith( substr ); - } - inline Impl::StdString::StartsWith StartsWith( const char* substr ) { - return Impl::StdString::StartsWith( Impl::StdString::makeString( substr ) ); - } - inline Impl::StdString::EndsWith EndsWith( std::string const& substr ) { - return Impl::StdString::EndsWith( substr ); - } - inline Impl::StdString::EndsWith EndsWith( const char* substr ) { - return Impl::StdString::EndsWith( Impl::StdString::makeString( substr ) ); - } - -} // namespace Matchers - -using namespace Matchers; - -} // namespace Catch - -namespace Catch { - - struct TestFailureException{}; - - template class ExpressionLhs; - - struct STATIC_ASSERT_Expression_Too_Complex_Please_Rewrite_As_Binary_Comparison; - - struct CopyableStream { - CopyableStream() {} - CopyableStream( CopyableStream const& other ) { - oss << other.oss.str(); - } - CopyableStream& operator=( CopyableStream const& other ) { - oss.str(""); - oss << other.oss.str(); - return *this; - } - std::ostringstream oss; - }; - - class ResultBuilder { - public: - ResultBuilder( char const* macroName, - SourceLineInfo const& lineInfo, - char const* capturedExpression, - ResultDisposition::Flags resultDisposition, - char const* secondArg = "" ); - - template - ExpressionLhs operator <= ( T const& operand ); - ExpressionLhs operator <= ( bool value ); - - template - ResultBuilder& operator << ( T const& value ) { - m_stream.oss << value; - return *this; - } - - template STATIC_ASSERT_Expression_Too_Complex_Please_Rewrite_As_Binary_Comparison& operator && ( RhsT const& ); - template STATIC_ASSERT_Expression_Too_Complex_Please_Rewrite_As_Binary_Comparison& operator || ( RhsT const& ); - - ResultBuilder& setResultType( ResultWas::OfType result ); - ResultBuilder& setResultType( bool result ); - ResultBuilder& setLhs( std::string const& lhs ); - ResultBuilder& setRhs( std::string const& rhs ); - ResultBuilder& setOp( std::string const& op ); - - void endExpression(); - - std::string reconstructExpression() const; - AssertionResult build() const; - - void useActiveException( ResultDisposition::Flags resultDisposition = ResultDisposition::Normal ); - void captureResult( ResultWas::OfType resultType ); - void captureExpression(); - void captureExpectedException( std::string const& expectedMessage ); - void captureExpectedException( Matchers::Impl::Matcher const& matcher ); - void handleResult( AssertionResult const& result ); - void react(); - bool shouldDebugBreak() const; - bool allowThrows() const; - - private: - AssertionInfo m_assertionInfo; - AssertionResultData m_data; - struct ExprComponents { - ExprComponents() : testFalse( false ) {} - bool testFalse; - std::string lhs, rhs, op; - } m_exprComponents; - CopyableStream m_stream; - - bool m_shouldDebugBreak; - bool m_shouldThrow; - }; - -} // namespace Catch - -// Include after due to circular dependency: -// #included from: catch_expression_lhs.hpp -#define TWOBLUECUBES_CATCH_EXPRESSION_LHS_HPP_INCLUDED - -// #included from: catch_evaluate.hpp -#define TWOBLUECUBES_CATCH_EVALUATE_HPP_INCLUDED - -#ifdef _MSC_VER -#pragma warning(push) -#pragma warning(disable:4389) // '==' : signed/unsigned mismatch -#endif - -#include - -namespace Catch { -namespace Internal { - - enum Operator { - IsEqualTo, - IsNotEqualTo, - IsLessThan, - IsGreaterThan, - IsLessThanOrEqualTo, - IsGreaterThanOrEqualTo - }; - - template struct OperatorTraits { static const char* getName(){ return "*error*"; } }; - template<> struct OperatorTraits { static const char* getName(){ return "=="; } }; - template<> struct OperatorTraits { static const char* getName(){ return "!="; } }; - template<> struct OperatorTraits { static const char* getName(){ return "<"; } }; - template<> struct OperatorTraits { static const char* getName(){ return ">"; } }; - template<> struct OperatorTraits { static const char* getName(){ return "<="; } }; - template<> struct OperatorTraits{ static const char* getName(){ return ">="; } }; - - template - inline T& opCast(T const& t) { return const_cast(t); } - -// nullptr_t support based on pull request #154 from Konstantin Baumann -#ifdef CATCH_CONFIG_CPP11_NULLPTR - inline std::nullptr_t opCast(std::nullptr_t) { return nullptr; } -#endif // CATCH_CONFIG_CPP11_NULLPTR - - // So the compare overloads can be operator agnostic we convey the operator as a template - // enum, which is used to specialise an Evaluator for doing the comparison. - template - class Evaluator{}; - - template - struct Evaluator { - static bool evaluate( T1 const& lhs, T2 const& rhs) { - return bool( opCast( lhs ) == opCast( rhs ) ); - } - }; - template - struct Evaluator { - static bool evaluate( T1 const& lhs, T2 const& rhs ) { - return bool( opCast( lhs ) != opCast( rhs ) ); - } - }; - template - struct Evaluator { - static bool evaluate( T1 const& lhs, T2 const& rhs ) { - return bool( opCast( lhs ) < opCast( rhs ) ); - } - }; - template - struct Evaluator { - static bool evaluate( T1 const& lhs, T2 const& rhs ) { - return bool( opCast( lhs ) > opCast( rhs ) ); - } - }; - template - struct Evaluator { - static bool evaluate( T1 const& lhs, T2 const& rhs ) { - return bool( opCast( lhs ) >= opCast( rhs ) ); - } - }; - template - struct Evaluator { - static bool evaluate( T1 const& lhs, T2 const& rhs ) { - return bool( opCast( lhs ) <= opCast( rhs ) ); - } - }; - - template - bool applyEvaluator( T1 const& lhs, T2 const& rhs ) { - return Evaluator::evaluate( lhs, rhs ); - } - - // This level of indirection allows us to specialise for integer types - // to avoid signed/ unsigned warnings - - // "base" overload - template - bool compare( T1 const& lhs, T2 const& rhs ) { - return Evaluator::evaluate( lhs, rhs ); - } - - // unsigned X to int - template bool compare( unsigned int lhs, int rhs ) { - return applyEvaluator( lhs, static_cast( rhs ) ); - } - template bool compare( unsigned long lhs, int rhs ) { - return applyEvaluator( lhs, static_cast( rhs ) ); - } - template bool compare( unsigned char lhs, int rhs ) { - return applyEvaluator( lhs, static_cast( rhs ) ); - } - - // unsigned X to long - template bool compare( unsigned int lhs, long rhs ) { - return applyEvaluator( lhs, static_cast( rhs ) ); - } - template bool compare( unsigned long lhs, long rhs ) { - return applyEvaluator( lhs, static_cast( rhs ) ); - } - template bool compare( unsigned char lhs, long rhs ) { - return applyEvaluator( lhs, static_cast( rhs ) ); - } - - // int to unsigned X - template bool compare( int lhs, unsigned int rhs ) { - return applyEvaluator( static_cast( lhs ), rhs ); - } - template bool compare( int lhs, unsigned long rhs ) { - return applyEvaluator( static_cast( lhs ), rhs ); - } - template bool compare( int lhs, unsigned char rhs ) { - return applyEvaluator( static_cast( lhs ), rhs ); - } - - // long to unsigned X - template bool compare( long lhs, unsigned int rhs ) { - return applyEvaluator( static_cast( lhs ), rhs ); - } - template bool compare( long lhs, unsigned long rhs ) { - return applyEvaluator( static_cast( lhs ), rhs ); - } - template bool compare( long lhs, unsigned char rhs ) { - return applyEvaluator( static_cast( lhs ), rhs ); - } - - // pointer to long (when comparing against NULL) - template bool compare( long lhs, T* rhs ) { - return Evaluator::evaluate( reinterpret_cast( lhs ), rhs ); - } - template bool compare( T* lhs, long rhs ) { - return Evaluator::evaluate( lhs, reinterpret_cast( rhs ) ); - } - - // pointer to int (when comparing against NULL) - template bool compare( int lhs, T* rhs ) { - return Evaluator::evaluate( reinterpret_cast( lhs ), rhs ); - } - template bool compare( T* lhs, int rhs ) { - return Evaluator::evaluate( lhs, reinterpret_cast( rhs ) ); - } - -#ifdef CATCH_CONFIG_CPP11_LONG_LONG - // long long to unsigned X - template bool compare( long long lhs, unsigned int rhs ) { - return applyEvaluator( static_cast( lhs ), rhs ); - } - template bool compare( long long lhs, unsigned long rhs ) { - return applyEvaluator( static_cast( lhs ), rhs ); - } - template bool compare( long long lhs, unsigned long long rhs ) { - return applyEvaluator( static_cast( lhs ), rhs ); - } - template bool compare( long long lhs, unsigned char rhs ) { - return applyEvaluator( static_cast( lhs ), rhs ); - } - - // unsigned long long to X - template bool compare( unsigned long long lhs, int rhs ) { - return applyEvaluator( static_cast( lhs ), rhs ); - } - template bool compare( unsigned long long lhs, long rhs ) { - return applyEvaluator( static_cast( lhs ), rhs ); - } - template bool compare( unsigned long long lhs, long long rhs ) { - return applyEvaluator( static_cast( lhs ), rhs ); - } - template bool compare( unsigned long long lhs, char rhs ) { - return applyEvaluator( static_cast( lhs ), rhs ); - } - - // pointer to long long (when comparing against NULL) - template bool compare( long long lhs, T* rhs ) { - return Evaluator::evaluate( reinterpret_cast( lhs ), rhs ); - } - template bool compare( T* lhs, long long rhs ) { - return Evaluator::evaluate( lhs, reinterpret_cast( rhs ) ); - } -#endif // CATCH_CONFIG_CPP11_LONG_LONG - -#ifdef CATCH_CONFIG_CPP11_NULLPTR - // pointer to nullptr_t (when comparing against nullptr) - template bool compare( std::nullptr_t, T* rhs ) { - return Evaluator::evaluate( nullptr, rhs ); - } - template bool compare( T* lhs, std::nullptr_t ) { - return Evaluator::evaluate( lhs, nullptr ); - } -#endif // CATCH_CONFIG_CPP11_NULLPTR - -} // end of namespace Internal -} // end of namespace Catch - -#ifdef _MSC_VER -#pragma warning(pop) -#endif - -// #included from: catch_tostring.h -#define TWOBLUECUBES_CATCH_TOSTRING_H_INCLUDED - -#include -#include -#include -#include -#include - -#ifdef __OBJC__ -// #included from: catch_objc_arc.hpp -#define TWOBLUECUBES_CATCH_OBJC_ARC_HPP_INCLUDED - -#import - -#ifdef __has_feature -#define CATCH_ARC_ENABLED __has_feature(objc_arc) -#else -#define CATCH_ARC_ENABLED 0 -#endif - -void arcSafeRelease( NSObject* obj ); -id performOptionalSelector( id obj, SEL sel ); - -#if !CATCH_ARC_ENABLED -inline void arcSafeRelease( NSObject* obj ) { - [obj release]; -} -inline id performOptionalSelector( id obj, SEL sel ) { - if( [obj respondsToSelector: sel] ) - return [obj performSelector: sel]; - return nil; -} -#define CATCH_UNSAFE_UNRETAINED -#define CATCH_ARC_STRONG -#else -inline void arcSafeRelease( NSObject* ){} -inline id performOptionalSelector( id obj, SEL sel ) { -#ifdef __clang__ -#pragma clang diagnostic push -#pragma clang diagnostic ignored "-Warc-performSelector-leaks" -#endif - if( [obj respondsToSelector: sel] ) - return [obj performSelector: sel]; -#ifdef __clang__ -#pragma clang diagnostic pop -#endif - return nil; -} -#define CATCH_UNSAFE_UNRETAINED __unsafe_unretained -#define CATCH_ARC_STRONG __strong -#endif - -#endif - -#ifdef CATCH_CONFIG_CPP11_TUPLE -#include -#endif - -#ifdef CATCH_CONFIG_CPP11_IS_ENUM -#include -#endif - -namespace Catch { - -// Why we're here. -template -std::string toString( T const& value ); - -// Built in overloads - -std::string toString( std::string const& value ); -std::string toString( std::wstring const& value ); -std::string toString( const char* const value ); -std::string toString( char* const value ); -std::string toString( const wchar_t* const value ); -std::string toString( wchar_t* const value ); -std::string toString( int value ); -std::string toString( unsigned long value ); -std::string toString( unsigned int value ); -std::string toString( const double value ); -std::string toString( const float value ); -std::string toString( bool value ); -std::string toString( char value ); -std::string toString( signed char value ); -std::string toString( unsigned char value ); - -#ifdef CATCH_CONFIG_CPP11_LONG_LONG -std::string toString( long long value ); -std::string toString( unsigned long long value ); -#endif - -#ifdef CATCH_CONFIG_CPP11_NULLPTR -std::string toString( std::nullptr_t ); -#endif - -#ifdef __OBJC__ - std::string toString( NSString const * const& nsstring ); - std::string toString( NSString * CATCH_ARC_STRONG const& nsstring ); - std::string toString( NSObject* const& nsObject ); -#endif - -namespace Detail { - - extern const std::string unprintableString; - - struct BorgType { - template BorgType( T const& ); - }; - - struct TrueType { char sizer[1]; }; - struct FalseType { char sizer[2]; }; - - TrueType& testStreamable( std::ostream& ); - FalseType testStreamable( FalseType ); - - FalseType operator<<( std::ostream const&, BorgType const& ); - - template - struct IsStreamInsertable { - static std::ostream &s; - static T const&t; - enum { value = sizeof( testStreamable(s << t) ) == sizeof( TrueType ) }; - }; - -#if defined(CATCH_CONFIG_CPP11_IS_ENUM) - template::value - > - struct EnumStringMaker - { - static std::string convert( T const& ) { return unprintableString; } - }; - - template - struct EnumStringMaker - { - static std::string convert( T const& v ) - { - return ::Catch::toString( - static_cast::type>(v) - ); - } - }; -#endif - template - struct StringMakerBase { -#if defined(CATCH_CONFIG_CPP11_IS_ENUM) - template - static std::string convert( T const& v ) - { - return EnumStringMaker::convert( v ); - } -#else - template - static std::string convert( T const& ) { return unprintableString; } -#endif - }; - - template<> - struct StringMakerBase { - template - static std::string convert( T const& _value ) { - std::ostringstream oss; - oss << _value; - return oss.str(); - } - }; - - std::string rawMemoryToString( const void *object, std::size_t size ); - - template - inline std::string rawMemoryToString( const T& object ) { - return rawMemoryToString( &object, sizeof(object) ); - } - -} // end namespace Detail - -template -struct StringMaker : - Detail::StringMakerBase::value> {}; - -template -struct StringMaker { - template - static std::string convert( U* p ) { - if( !p ) - return "NULL"; - else - return Detail::rawMemoryToString( p ); - } -}; - -template -struct StringMaker { - static std::string convert( R C::* p ) { - if( !p ) - return "NULL"; - else - return Detail::rawMemoryToString( p ); - } -}; - -namespace Detail { - template - std::string rangeToString( InputIterator first, InputIterator last ); -} - -//template -//struct StringMaker > { -// static std::string convert( std::vector const& v ) { -// return Detail::rangeToString( v.begin(), v.end() ); -// } -//}; - -template -std::string toString( std::vector const& v ) { - return Detail::rangeToString( v.begin(), v.end() ); -} - -#ifdef CATCH_CONFIG_CPP11_TUPLE - -// toString for tuples -namespace TupleDetail { - template< - typename Tuple, - std::size_t N = 0, - bool = (N < std::tuple_size::value) - > - struct ElementPrinter { - static void print( const Tuple& tuple, std::ostream& os ) - { - os << ( N ? ", " : " " ) - << Catch::toString(std::get(tuple)); - ElementPrinter::print(tuple,os); - } - }; - - template< - typename Tuple, - std::size_t N - > - struct ElementPrinter { - static void print( const Tuple&, std::ostream& ) {} - }; - -} - -template -struct StringMaker> { - - static std::string convert( const std::tuple& tuple ) - { - std::ostringstream os; - os << '{'; - TupleDetail::ElementPrinter>::print( tuple, os ); - os << " }"; - return os.str(); - } -}; -#endif // CATCH_CONFIG_CPP11_TUPLE - -namespace Detail { - template - std::string makeString( T const& value ) { - return StringMaker::convert( value ); - } -} // end namespace Detail - -/// \brief converts any type to a string -/// -/// The default template forwards on to ostringstream - except when an -/// ostringstream overload does not exist - in which case it attempts to detect -/// that and writes {?}. -/// Overload (not specialise) this template for custom typs that you don't want -/// to provide an ostream overload for. -template -std::string toString( T const& value ) { - return StringMaker::convert( value ); -} - - namespace Detail { - template - std::string rangeToString( InputIterator first, InputIterator last ) { - std::ostringstream oss; - oss << "{ "; - if( first != last ) { - oss << Catch::toString( *first ); - for( ++first ; first != last ; ++first ) - oss << ", " << Catch::toString( *first ); - } - oss << " }"; - return oss.str(); - } -} - -} // end namespace Catch - -namespace Catch { - -// Wraps the LHS of an expression and captures the operator and RHS (if any) - -// wrapping them all in a ResultBuilder object -template -class ExpressionLhs { - ExpressionLhs& operator = ( ExpressionLhs const& ); -# ifdef CATCH_CONFIG_CPP11_GENERATED_METHODS - ExpressionLhs& operator = ( ExpressionLhs && ) = delete; -# endif - -public: - ExpressionLhs( ResultBuilder& rb, T lhs ) : m_rb( rb ), m_lhs( lhs ) {} -# ifdef CATCH_CONFIG_CPP11_GENERATED_METHODS - ExpressionLhs( ExpressionLhs const& ) = default; - ExpressionLhs( ExpressionLhs && ) = default; -# endif - - template - ResultBuilder& operator == ( RhsT const& rhs ) { - return captureExpression( rhs ); - } - - template - ResultBuilder& operator != ( RhsT const& rhs ) { - return captureExpression( rhs ); - } - - template - ResultBuilder& operator < ( RhsT const& rhs ) { - return captureExpression( rhs ); - } - - template - ResultBuilder& operator > ( RhsT const& rhs ) { - return captureExpression( rhs ); - } - - template - ResultBuilder& operator <= ( RhsT const& rhs ) { - return captureExpression( rhs ); - } - - template - ResultBuilder& operator >= ( RhsT const& rhs ) { - return captureExpression( rhs ); - } - - ResultBuilder& operator == ( bool rhs ) { - return captureExpression( rhs ); - } - - ResultBuilder& operator != ( bool rhs ) { - return captureExpression( rhs ); - } - - void endExpression() { - bool value = m_lhs ? true : false; - m_rb - .setLhs( Catch::toString( value ) ) - .setResultType( value ) - .endExpression(); - } - - // Only simple binary expressions are allowed on the LHS. - // If more complex compositions are required then place the sub expression in parentheses - template STATIC_ASSERT_Expression_Too_Complex_Please_Rewrite_As_Binary_Comparison& operator + ( RhsT const& ); - template STATIC_ASSERT_Expression_Too_Complex_Please_Rewrite_As_Binary_Comparison& operator - ( RhsT const& ); - template STATIC_ASSERT_Expression_Too_Complex_Please_Rewrite_As_Binary_Comparison& operator / ( RhsT const& ); - template STATIC_ASSERT_Expression_Too_Complex_Please_Rewrite_As_Binary_Comparison& operator * ( RhsT const& ); - template STATIC_ASSERT_Expression_Too_Complex_Please_Rewrite_As_Binary_Comparison& operator && ( RhsT const& ); - template STATIC_ASSERT_Expression_Too_Complex_Please_Rewrite_As_Binary_Comparison& operator || ( RhsT const& ); - -private: - template - ResultBuilder& captureExpression( RhsT const& rhs ) { - return m_rb - .setResultType( Internal::compare( m_lhs, rhs ) ) - .setLhs( Catch::toString( m_lhs ) ) - .setRhs( Catch::toString( rhs ) ) - .setOp( Internal::OperatorTraits::getName() ); - } - -private: - ResultBuilder& m_rb; - T m_lhs; -}; - -} // end namespace Catch - - -namespace Catch { - - template - inline ExpressionLhs ResultBuilder::operator <= ( T const& operand ) { - return ExpressionLhs( *this, operand ); - } - - inline ExpressionLhs ResultBuilder::operator <= ( bool value ) { - return ExpressionLhs( *this, value ); - } - -} // namespace Catch - -// #included from: catch_message.h -#define TWOBLUECUBES_CATCH_MESSAGE_H_INCLUDED - -#include - -namespace Catch { - - struct MessageInfo { - MessageInfo( std::string const& _macroName, - SourceLineInfo const& _lineInfo, - ResultWas::OfType _type ); - - std::string macroName; - SourceLineInfo lineInfo; - ResultWas::OfType type; - std::string message; - unsigned int sequence; - - bool operator == ( MessageInfo const& other ) const { - return sequence == other.sequence; - } - bool operator < ( MessageInfo const& other ) const { - return sequence < other.sequence; - } - private: - static unsigned int globalCount; - }; - - struct MessageBuilder { - MessageBuilder( std::string const& macroName, - SourceLineInfo const& lineInfo, - ResultWas::OfType type ) - : m_info( macroName, lineInfo, type ) - {} - - template - MessageBuilder& operator << ( T const& value ) { - m_stream << value; - return *this; - } - - MessageInfo m_info; - std::ostringstream m_stream; - }; - - class ScopedMessage { - public: - ScopedMessage( MessageBuilder const& builder ); - ScopedMessage( ScopedMessage const& other ); - ~ScopedMessage(); - - MessageInfo m_info; - }; - -} // end namespace Catch - -// #included from: catch_interfaces_capture.h -#define TWOBLUECUBES_CATCH_INTERFACES_CAPTURE_H_INCLUDED - -#include - -namespace Catch { - - class TestCase; - class AssertionResult; - struct AssertionInfo; - struct SectionInfo; - struct SectionEndInfo; - struct MessageInfo; - class ScopedMessageBuilder; - struct Counts; - - struct IResultCapture { - - virtual ~IResultCapture(); - - virtual void assertionEnded( AssertionResult const& result ) = 0; - virtual bool sectionStarted( SectionInfo const& sectionInfo, - Counts& assertions ) = 0; - virtual void sectionEnded( SectionEndInfo const& endInfo ) = 0; - virtual void sectionEndedEarly( SectionEndInfo const& endInfo ) = 0; - virtual void pushScopedMessage( MessageInfo const& message ) = 0; - virtual void popScopedMessage( MessageInfo const& message ) = 0; - - virtual std::string getCurrentTestName() const = 0; - virtual const AssertionResult* getLastResult() const = 0; - - virtual void handleFatalErrorCondition( std::string const& message ) = 0; - }; - - IResultCapture& getResultCapture(); -} - -// #included from: catch_debugger.h -#define TWOBLUECUBES_CATCH_DEBUGGER_H_INCLUDED - -// #included from: catch_platform.h -#define TWOBLUECUBES_CATCH_PLATFORM_H_INCLUDED - -#if defined(__MAC_OS_X_VERSION_MIN_REQUIRED) -#define CATCH_PLATFORM_MAC -#elif defined(__IPHONE_OS_VERSION_MIN_REQUIRED) -#define CATCH_PLATFORM_IPHONE -#elif defined(WIN32) || defined(__WIN32__) || defined(_WIN32) || defined(_MSC_VER) -#define CATCH_PLATFORM_WINDOWS -#endif - -#include - -namespace Catch{ - - bool isDebuggerActive(); - void writeToDebugConsole( std::string const& text ); -} - -#ifdef CATCH_PLATFORM_MAC - - // The following code snippet based on: - // http://cocoawithlove.com/2008/03/break-into-debugger.html - #ifdef DEBUG - #if defined(__ppc64__) || defined(__ppc__) - #define CATCH_BREAK_INTO_DEBUGGER() \ - if( Catch::isDebuggerActive() ) { \ - __asm__("li r0, 20\nsc\nnop\nli r0, 37\nli r4, 2\nsc\nnop\n" \ - : : : "memory","r0","r3","r4" ); \ - } - #else - #define CATCH_BREAK_INTO_DEBUGGER() if( Catch::isDebuggerActive() ) {__asm__("int $3\n" : : );} - #endif - #endif - -#elif defined(_MSC_VER) - #define CATCH_BREAK_INTO_DEBUGGER() if( Catch::isDebuggerActive() ) { __debugbreak(); } -#elif defined(__MINGW32__) - extern "C" __declspec(dllimport) void __stdcall DebugBreak(); - #define CATCH_BREAK_INTO_DEBUGGER() if( Catch::isDebuggerActive() ) { DebugBreak(); } -#endif - -#ifndef CATCH_BREAK_INTO_DEBUGGER -#define CATCH_BREAK_INTO_DEBUGGER() Catch::alwaysTrue(); -#endif - -// #included from: catch_interfaces_runner.h -#define TWOBLUECUBES_CATCH_INTERFACES_RUNNER_H_INCLUDED - -namespace Catch { - class TestCase; - - struct IRunner { - virtual ~IRunner(); - virtual bool aborting() const = 0; - }; -} - -/////////////////////////////////////////////////////////////////////////////// -// In the event of a failure works out if the debugger needs to be invoked -// and/or an exception thrown and takes appropriate action. -// This needs to be done as a macro so the debugger will stop in the user -// source code rather than in Catch library code -#define INTERNAL_CATCH_REACT( resultBuilder ) \ - if( resultBuilder.shouldDebugBreak() ) CATCH_BREAK_INTO_DEBUGGER(); \ - resultBuilder.react(); - -/////////////////////////////////////////////////////////////////////////////// -#define INTERNAL_CATCH_TEST( expr, resultDisposition, macroName ) \ - do { \ - Catch::ResultBuilder __catchResult( macroName, CATCH_INTERNAL_LINEINFO, #expr, resultDisposition ); \ - try { \ - CATCH_INTERNAL_SUPPRESS_PARENTHESES_WARNINGS \ - ( __catchResult <= expr ).endExpression(); \ - } \ - catch( ... ) { \ - __catchResult.useActiveException( Catch::ResultDisposition::Normal ); \ - } \ - INTERNAL_CATCH_REACT( __catchResult ) \ - } while( Catch::isTrue( false && !!(expr) ) ) // expr here is never evaluated at runtime but it forces the compiler to give it a look - -/////////////////////////////////////////////////////////////////////////////// -#define INTERNAL_CATCH_IF( expr, resultDisposition, macroName ) \ - INTERNAL_CATCH_TEST( expr, resultDisposition, macroName ); \ - if( Catch::getResultCapture().getLastResult()->succeeded() ) - -/////////////////////////////////////////////////////////////////////////////// -#define INTERNAL_CATCH_ELSE( expr, resultDisposition, macroName ) \ - INTERNAL_CATCH_TEST( expr, resultDisposition, macroName ); \ - if( !Catch::getResultCapture().getLastResult()->succeeded() ) - -/////////////////////////////////////////////////////////////////////////////// -#define INTERNAL_CATCH_NO_THROW( expr, resultDisposition, macroName ) \ - do { \ - Catch::ResultBuilder __catchResult( macroName, CATCH_INTERNAL_LINEINFO, #expr, resultDisposition ); \ - try { \ - expr; \ - __catchResult.captureResult( Catch::ResultWas::Ok ); \ - } \ - catch( ... ) { \ - __catchResult.useActiveException( resultDisposition ); \ - } \ - INTERNAL_CATCH_REACT( __catchResult ) \ - } while( Catch::alwaysFalse() ) - -/////////////////////////////////////////////////////////////////////////////// -#define INTERNAL_CATCH_THROWS( expr, resultDisposition, matcher, macroName ) \ - do { \ - Catch::ResultBuilder __catchResult( macroName, CATCH_INTERNAL_LINEINFO, #expr, resultDisposition, #matcher ); \ - if( __catchResult.allowThrows() ) \ - try { \ - expr; \ - __catchResult.captureResult( Catch::ResultWas::DidntThrowException ); \ - } \ - catch( ... ) { \ - __catchResult.captureExpectedException( matcher ); \ - } \ - else \ - __catchResult.captureResult( Catch::ResultWas::Ok ); \ - INTERNAL_CATCH_REACT( __catchResult ) \ - } while( Catch::alwaysFalse() ) - -/////////////////////////////////////////////////////////////////////////////// -#define INTERNAL_CATCH_THROWS_AS( expr, exceptionType, resultDisposition, macroName ) \ - do { \ - Catch::ResultBuilder __catchResult( macroName, CATCH_INTERNAL_LINEINFO, #expr, resultDisposition ); \ - if( __catchResult.allowThrows() ) \ - try { \ - expr; \ - __catchResult.captureResult( Catch::ResultWas::DidntThrowException ); \ - } \ - catch( exceptionType ) { \ - __catchResult.captureResult( Catch::ResultWas::Ok ); \ - } \ - catch( ... ) { \ - __catchResult.useActiveException( resultDisposition ); \ - } \ - else \ - __catchResult.captureResult( Catch::ResultWas::Ok ); \ - INTERNAL_CATCH_REACT( __catchResult ) \ - } while( Catch::alwaysFalse() ) - -/////////////////////////////////////////////////////////////////////////////// -#ifdef CATCH_CONFIG_VARIADIC_MACROS - #define INTERNAL_CATCH_MSG( messageType, resultDisposition, macroName, ... ) \ - do { \ - Catch::ResultBuilder __catchResult( macroName, CATCH_INTERNAL_LINEINFO, "", resultDisposition ); \ - __catchResult << __VA_ARGS__ + ::Catch::StreamEndStop(); \ - __catchResult.captureResult( messageType ); \ - INTERNAL_CATCH_REACT( __catchResult ) \ - } while( Catch::alwaysFalse() ) -#else - #define INTERNAL_CATCH_MSG( messageType, resultDisposition, macroName, log ) \ - do { \ - Catch::ResultBuilder __catchResult( macroName, CATCH_INTERNAL_LINEINFO, "", resultDisposition ); \ - __catchResult << log + ::Catch::StreamEndStop(); \ - __catchResult.captureResult( messageType ); \ - INTERNAL_CATCH_REACT( __catchResult ) \ - } while( Catch::alwaysFalse() ) -#endif - -/////////////////////////////////////////////////////////////////////////////// -#define INTERNAL_CATCH_INFO( log, macroName ) \ - Catch::ScopedMessage INTERNAL_CATCH_UNIQUE_NAME( scopedMessage ) = Catch::MessageBuilder( macroName, CATCH_INTERNAL_LINEINFO, Catch::ResultWas::Info ) << log; - -/////////////////////////////////////////////////////////////////////////////// -#define INTERNAL_CHECK_THAT( arg, matcher, resultDisposition, macroName ) \ - do { \ - Catch::ResultBuilder __catchResult( macroName, CATCH_INTERNAL_LINEINFO, #arg ", " #matcher, resultDisposition ); \ - try { \ - std::string matcherAsString = (matcher).toString(); \ - __catchResult \ - .setLhs( Catch::toString( arg ) ) \ - .setRhs( matcherAsString == Catch::Detail::unprintableString ? #matcher : matcherAsString ) \ - .setOp( "matches" ) \ - .setResultType( (matcher).match( arg ) ); \ - __catchResult.captureExpression(); \ - } catch( ... ) { \ - __catchResult.useActiveException( resultDisposition | Catch::ResultDisposition::ContinueOnFailure ); \ - } \ - INTERNAL_CATCH_REACT( __catchResult ) \ - } while( Catch::alwaysFalse() ) - -// #included from: internal/catch_section.h -#define TWOBLUECUBES_CATCH_SECTION_H_INCLUDED - -// #included from: catch_section_info.h -#define TWOBLUECUBES_CATCH_SECTION_INFO_H_INCLUDED - -// #included from: catch_totals.hpp -#define TWOBLUECUBES_CATCH_TOTALS_HPP_INCLUDED - -#include - -namespace Catch { - - struct Counts { - Counts() : passed( 0 ), failed( 0 ), failedButOk( 0 ) {} - - Counts operator - ( Counts const& other ) const { - Counts diff; - diff.passed = passed - other.passed; - diff.failed = failed - other.failed; - diff.failedButOk = failedButOk - other.failedButOk; - return diff; - } - Counts& operator += ( Counts const& other ) { - passed += other.passed; - failed += other.failed; - failedButOk += other.failedButOk; - return *this; - } - - std::size_t total() const { - return passed + failed + failedButOk; - } - bool allPassed() const { - return failed == 0 && failedButOk == 0; - } - bool allOk() const { - return failed == 0; - } - - std::size_t passed; - std::size_t failed; - std::size_t failedButOk; - }; - - struct Totals { - - Totals operator - ( Totals const& other ) const { - Totals diff; - diff.assertions = assertions - other.assertions; - diff.testCases = testCases - other.testCases; - return diff; - } - - Totals delta( Totals const& prevTotals ) const { - Totals diff = *this - prevTotals; - if( diff.assertions.failed > 0 ) - ++diff.testCases.failed; - else if( diff.assertions.failedButOk > 0 ) - ++diff.testCases.failedButOk; - else - ++diff.testCases.passed; - return diff; - } - - Totals& operator += ( Totals const& other ) { - assertions += other.assertions; - testCases += other.testCases; - return *this; - } - - Counts assertions; - Counts testCases; - }; -} - -namespace Catch { - - struct SectionInfo { - SectionInfo - ( SourceLineInfo const& _lineInfo, - std::string const& _name, - std::string const& _description = std::string() ); - - std::string name; - std::string description; - SourceLineInfo lineInfo; - }; - - struct SectionEndInfo { - SectionEndInfo( SectionInfo const& _sectionInfo, Counts const& _prevAssertions, double _durationInSeconds ) - : sectionInfo( _sectionInfo ), prevAssertions( _prevAssertions ), durationInSeconds( _durationInSeconds ) - {} - - SectionInfo sectionInfo; - Counts prevAssertions; - double durationInSeconds; - }; - -} // end namespace Catch - -// #included from: catch_timer.h -#define TWOBLUECUBES_CATCH_TIMER_H_INCLUDED - -#ifdef CATCH_PLATFORM_WINDOWS -typedef unsigned long long uint64_t; -#else -#include -#endif - -namespace Catch { - - class Timer { - public: - Timer() : m_ticks( 0 ) {} - void start(); - unsigned int getElapsedMicroseconds() const; - unsigned int getElapsedMilliseconds() const; - double getElapsedSeconds() const; - - private: - uint64_t m_ticks; - }; - -} // namespace Catch - -#include - -namespace Catch { - - class Section : NonCopyable { - public: - Section( SectionInfo const& info ); - ~Section(); - - // This indicates whether the section should be executed or not - operator bool() const; - - private: - SectionInfo m_info; - - std::string m_name; - Counts m_assertions; - bool m_sectionIncluded; - Timer m_timer; - }; - -} // end namespace Catch - -#ifdef CATCH_CONFIG_VARIADIC_MACROS - #define INTERNAL_CATCH_SECTION( ... ) \ - if( Catch::Section const& INTERNAL_CATCH_UNIQUE_NAME( catch_internal_Section ) = Catch::SectionInfo( CATCH_INTERNAL_LINEINFO, __VA_ARGS__ ) ) -#else - #define INTERNAL_CATCH_SECTION( name, desc ) \ - if( Catch::Section const& INTERNAL_CATCH_UNIQUE_NAME( catch_internal_Section ) = Catch::SectionInfo( CATCH_INTERNAL_LINEINFO, name, desc ) ) -#endif - -// #included from: internal/catch_generators.hpp -#define TWOBLUECUBES_CATCH_GENERATORS_HPP_INCLUDED - -#include -#include -#include -#include - -namespace Catch { - -template -struct IGenerator { - virtual ~IGenerator() {} - virtual T getValue( std::size_t index ) const = 0; - virtual std::size_t size () const = 0; -}; - -template -class BetweenGenerator : public IGenerator { -public: - BetweenGenerator( T from, T to ) : m_from( from ), m_to( to ){} - - virtual T getValue( std::size_t index ) const { - return m_from+static_cast( index ); - } - - virtual std::size_t size() const { - return static_cast( 1+m_to-m_from ); - } - -private: - - T m_from; - T m_to; -}; - -template -class ValuesGenerator : public IGenerator { -public: - ValuesGenerator(){} - - void add( T value ) { - m_values.push_back( value ); - } - - virtual T getValue( std::size_t index ) const { - return m_values[index]; - } - - virtual std::size_t size() const { - return m_values.size(); - } - -private: - std::vector m_values; -}; - -template -class CompositeGenerator { -public: - CompositeGenerator() : m_totalSize( 0 ) {} - - // *** Move semantics, similar to auto_ptr *** - CompositeGenerator( CompositeGenerator& other ) - : m_fileInfo( other.m_fileInfo ), - m_totalSize( 0 ) - { - move( other ); - } - - CompositeGenerator& setFileInfo( const char* fileInfo ) { - m_fileInfo = fileInfo; - return *this; - } - - ~CompositeGenerator() { - deleteAll( m_composed ); - } - - operator T () const { - size_t overallIndex = getCurrentContext().getGeneratorIndex( m_fileInfo, m_totalSize ); - - typename std::vector*>::const_iterator it = m_composed.begin(); - typename std::vector*>::const_iterator itEnd = m_composed.end(); - for( size_t index = 0; it != itEnd; ++it ) - { - const IGenerator* generator = *it; - if( overallIndex >= index && overallIndex < index + generator->size() ) - { - return generator->getValue( overallIndex-index ); - } - index += generator->size(); - } - CATCH_INTERNAL_ERROR( "Indexed past end of generated range" ); - return T(); // Suppress spurious "not all control paths return a value" warning in Visual Studio - if you know how to fix this please do so - } - - void add( const IGenerator* generator ) { - m_totalSize += generator->size(); - m_composed.push_back( generator ); - } - - CompositeGenerator& then( CompositeGenerator& other ) { - move( other ); - return *this; - } - - CompositeGenerator& then( T value ) { - ValuesGenerator* valuesGen = new ValuesGenerator(); - valuesGen->add( value ); - add( valuesGen ); - return *this; - } - -private: - - void move( CompositeGenerator& other ) { - std::copy( other.m_composed.begin(), other.m_composed.end(), std::back_inserter( m_composed ) ); - m_totalSize += other.m_totalSize; - other.m_composed.clear(); - } - - std::vector*> m_composed; - std::string m_fileInfo; - size_t m_totalSize; -}; - -namespace Generators -{ - template - CompositeGenerator between( T from, T to ) { - CompositeGenerator generators; - generators.add( new BetweenGenerator( from, to ) ); - return generators; - } - - template - CompositeGenerator values( T val1, T val2 ) { - CompositeGenerator generators; - ValuesGenerator* valuesGen = new ValuesGenerator(); - valuesGen->add( val1 ); - valuesGen->add( val2 ); - generators.add( valuesGen ); - return generators; - } - - template - CompositeGenerator values( T val1, T val2, T val3 ){ - CompositeGenerator generators; - ValuesGenerator* valuesGen = new ValuesGenerator(); - valuesGen->add( val1 ); - valuesGen->add( val2 ); - valuesGen->add( val3 ); - generators.add( valuesGen ); - return generators; - } - - template - CompositeGenerator values( T val1, T val2, T val3, T val4 ) { - CompositeGenerator generators; - ValuesGenerator* valuesGen = new ValuesGenerator(); - valuesGen->add( val1 ); - valuesGen->add( val2 ); - valuesGen->add( val3 ); - valuesGen->add( val4 ); - generators.add( valuesGen ); - return generators; - } - -} // end namespace Generators - -using namespace Generators; - -} // end namespace Catch - -#define INTERNAL_CATCH_LINESTR2( line ) #line -#define INTERNAL_CATCH_LINESTR( line ) INTERNAL_CATCH_LINESTR2( line ) - -#define INTERNAL_CATCH_GENERATE( expr ) expr.setFileInfo( __FILE__ "(" INTERNAL_CATCH_LINESTR( __LINE__ ) ")" ) - -// #included from: internal/catch_interfaces_exception.h -#define TWOBLUECUBES_CATCH_INTERFACES_EXCEPTION_H_INCLUDED - -#include -#include - -// #included from: catch_interfaces_registry_hub.h -#define TWOBLUECUBES_CATCH_INTERFACES_REGISTRY_HUB_H_INCLUDED - -#include - -namespace Catch { - - class TestCase; - struct ITestCaseRegistry; - struct IExceptionTranslatorRegistry; - struct IExceptionTranslator; - struct IReporterRegistry; - struct IReporterFactory; - - struct IRegistryHub { - virtual ~IRegistryHub(); - - virtual IReporterRegistry const& getReporterRegistry() const = 0; - virtual ITestCaseRegistry const& getTestCaseRegistry() const = 0; - virtual IExceptionTranslatorRegistry& getExceptionTranslatorRegistry() = 0; - }; - - struct IMutableRegistryHub { - virtual ~IMutableRegistryHub(); - virtual void registerReporter( std::string const& name, Ptr const& factory ) = 0; - virtual void registerListener( Ptr const& factory ) = 0; - virtual void registerTest( TestCase const& testInfo ) = 0; - virtual void registerTranslator( const IExceptionTranslator* translator ) = 0; - }; - - IRegistryHub& getRegistryHub(); - IMutableRegistryHub& getMutableRegistryHub(); - void cleanUp(); - std::string translateActiveException(); - -} - -namespace Catch { - - typedef std::string(*exceptionTranslateFunction)(); - - struct IExceptionTranslator; - typedef std::vector ExceptionTranslators; - - struct IExceptionTranslator { - virtual ~IExceptionTranslator(); - virtual std::string translate( ExceptionTranslators::const_iterator it, ExceptionTranslators::const_iterator itEnd ) const = 0; - }; - - struct IExceptionTranslatorRegistry { - virtual ~IExceptionTranslatorRegistry(); - - virtual std::string translateActiveException() const = 0; - }; - - class ExceptionTranslatorRegistrar { - template - class ExceptionTranslator : public IExceptionTranslator { - public: - - ExceptionTranslator( std::string(*translateFunction)( T& ) ) - : m_translateFunction( translateFunction ) - {} - - virtual std::string translate( ExceptionTranslators::const_iterator it, ExceptionTranslators::const_iterator itEnd ) const CATCH_OVERRIDE { - try { - if( it == itEnd ) - throw; - else - return (*it)->translate( it+1, itEnd ); - } - catch( T& ex ) { - return m_translateFunction( ex ); - } - } - - protected: - std::string(*m_translateFunction)( T& ); - }; - - public: - template - ExceptionTranslatorRegistrar( std::string(*translateFunction)( T& ) ) { - getMutableRegistryHub().registerTranslator - ( new ExceptionTranslator( translateFunction ) ); - } - }; -} - -/////////////////////////////////////////////////////////////////////////////// -#define INTERNAL_CATCH_TRANSLATE_EXCEPTION2( translatorName, signature ) \ - static std::string translatorName( signature ); \ - namespace{ Catch::ExceptionTranslatorRegistrar INTERNAL_CATCH_UNIQUE_NAME( catch_internal_ExceptionRegistrar )( &translatorName ); }\ - static std::string translatorName( signature ) - -#define INTERNAL_CATCH_TRANSLATE_EXCEPTION( signature ) INTERNAL_CATCH_TRANSLATE_EXCEPTION2( INTERNAL_CATCH_UNIQUE_NAME( catch_internal_ExceptionTranslator ), signature ) - -// #included from: internal/catch_approx.hpp -#define TWOBLUECUBES_CATCH_APPROX_HPP_INCLUDED - -#include -#include - -namespace Catch { -namespace Detail { - - class Approx { - public: - explicit Approx ( double value ) - : m_epsilon( std::numeric_limits::epsilon()*100 ), - m_scale( 1.0 ), - m_value( value ) - {} - - Approx( Approx const& other ) - : m_epsilon( other.m_epsilon ), - m_scale( other.m_scale ), - m_value( other.m_value ) - {} - - static Approx custom() { - return Approx( 0 ); - } - - Approx operator()( double value ) { - Approx approx( value ); - approx.epsilon( m_epsilon ); - approx.scale( m_scale ); - return approx; - } - - friend bool operator == ( double lhs, Approx const& rhs ) { - // Thanks to Richard Harris for his help refining this formula - return fabs( lhs - rhs.m_value ) < rhs.m_epsilon * (rhs.m_scale + (std::max)( fabs(lhs), fabs(rhs.m_value) ) ); - } - - friend bool operator == ( Approx const& lhs, double rhs ) { - return operator==( rhs, lhs ); - } - - friend bool operator != ( double lhs, Approx const& rhs ) { - return !operator==( lhs, rhs ); - } - - friend bool operator != ( Approx const& lhs, double rhs ) { - return !operator==( rhs, lhs ); - } - - Approx& epsilon( double newEpsilon ) { - m_epsilon = newEpsilon; - return *this; - } - - Approx& scale( double newScale ) { - m_scale = newScale; - return *this; - } - - std::string toString() const { - std::ostringstream oss; - oss << "Approx( " << Catch::toString( m_value ) << " )"; - return oss.str(); - } - - private: - double m_epsilon; - double m_scale; - double m_value; - }; -} - -template<> -inline std::string toString( Detail::Approx const& value ) { - return value.toString(); -} - -} // end namespace Catch - -// #included from: internal/catch_interfaces_tag_alias_registry.h -#define TWOBLUECUBES_CATCH_INTERFACES_TAG_ALIAS_REGISTRY_H_INCLUDED - -// #included from: catch_tag_alias.h -#define TWOBLUECUBES_CATCH_TAG_ALIAS_H_INCLUDED - -#include - -namespace Catch { - - struct TagAlias { - TagAlias( std::string _tag, SourceLineInfo _lineInfo ) : tag( _tag ), lineInfo( _lineInfo ) {} - - std::string tag; - SourceLineInfo lineInfo; - }; - - struct RegistrarForTagAliases { - RegistrarForTagAliases( char const* alias, char const* tag, SourceLineInfo const& lineInfo ); - }; - -} // end namespace Catch - -#define CATCH_REGISTER_TAG_ALIAS( alias, spec ) namespace{ Catch::RegistrarForTagAliases INTERNAL_CATCH_UNIQUE_NAME( AutoRegisterTagAlias )( alias, spec, CATCH_INTERNAL_LINEINFO ); } -// #included from: catch_option.hpp -#define TWOBLUECUBES_CATCH_OPTION_HPP_INCLUDED - -namespace Catch { - - // An optional type - template - class Option { - public: - Option() : nullableValue( CATCH_NULL ) {} - Option( T const& _value ) - : nullableValue( new( storage ) T( _value ) ) - {} - Option( Option const& _other ) - : nullableValue( _other ? new( storage ) T( *_other ) : CATCH_NULL ) - {} - - ~Option() { - reset(); - } - - Option& operator= ( Option const& _other ) { - if( &_other != this ) { - reset(); - if( _other ) - nullableValue = new( storage ) T( *_other ); - } - return *this; - } - Option& operator = ( T const& _value ) { - reset(); - nullableValue = new( storage ) T( _value ); - return *this; - } - - void reset() { - if( nullableValue ) - nullableValue->~T(); - nullableValue = CATCH_NULL; - } - - T& operator*() { return *nullableValue; } - T const& operator*() const { return *nullableValue; } - T* operator->() { return nullableValue; } - const T* operator->() const { return nullableValue; } - - T valueOr( T const& defaultValue ) const { - return nullableValue ? *nullableValue : defaultValue; - } - - bool some() const { return nullableValue != CATCH_NULL; } - bool none() const { return nullableValue == CATCH_NULL; } - - bool operator !() const { return nullableValue == CATCH_NULL; } - operator SafeBool::type() const { - return SafeBool::makeSafe( some() ); - } - - private: - T* nullableValue; - char storage[sizeof(T)]; - }; - -} // end namespace Catch - -namespace Catch { - - struct ITagAliasRegistry { - virtual ~ITagAliasRegistry(); - virtual Option find( std::string const& alias ) const = 0; - virtual std::string expandAliases( std::string const& unexpandedTestSpec ) const = 0; - - static ITagAliasRegistry const& get(); - }; - -} // end namespace Catch - -// These files are included here so the single_include script doesn't put them -// in the conditionally compiled sections -// #included from: internal/catch_test_case_info.h -#define TWOBLUECUBES_CATCH_TEST_CASE_INFO_H_INCLUDED - -#include -#include - -#ifdef __clang__ -#pragma clang diagnostic push -#pragma clang diagnostic ignored "-Wpadded" -#endif - -namespace Catch { - - struct ITestCase; - - struct TestCaseInfo { - enum SpecialProperties{ - None = 0, - IsHidden = 1 << 1, - ShouldFail = 1 << 2, - MayFail = 1 << 3, - Throws = 1 << 4 - }; - - TestCaseInfo( std::string const& _name, - std::string const& _className, - std::string const& _description, - std::set const& _tags, - SourceLineInfo const& _lineInfo ); - - TestCaseInfo( TestCaseInfo const& other ); - - friend void setTags( TestCaseInfo& testCaseInfo, std::set const& tags ); - - bool isHidden() const; - bool throws() const; - bool okToFail() const; - bool expectedToFail() const; - - std::string name; - std::string className; - std::string description; - std::set tags; - std::set lcaseTags; - std::string tagsAsString; - SourceLineInfo lineInfo; - SpecialProperties properties; - }; - - class TestCase : public TestCaseInfo { - public: - - TestCase( ITestCase* testCase, TestCaseInfo const& info ); - TestCase( TestCase const& other ); - - TestCase withName( std::string const& _newName ) const; - - void invoke() const; - - TestCaseInfo const& getTestCaseInfo() const; - - void swap( TestCase& other ); - bool operator == ( TestCase const& other ) const; - bool operator < ( TestCase const& other ) const; - TestCase& operator = ( TestCase const& other ); - - private: - Ptr test; - }; - - TestCase makeTestCase( ITestCase* testCase, - std::string const& className, - std::string const& name, - std::string const& description, - SourceLineInfo const& lineInfo ); -} - -#ifdef __clang__ -#pragma clang diagnostic pop -#endif - - -#ifdef __OBJC__ -// #included from: internal/catch_objc.hpp -#define TWOBLUECUBES_CATCH_OBJC_HPP_INCLUDED - -#import - -#include - -// NB. Any general catch headers included here must be included -// in catch.hpp first to make sure they are included by the single -// header for non obj-usage - -/////////////////////////////////////////////////////////////////////////////// -// This protocol is really only here for (self) documenting purposes, since -// all its methods are optional. -@protocol OcFixture - -@optional - --(void) setUp; --(void) tearDown; - -@end - -namespace Catch { - - class OcMethod : public SharedImpl { - - public: - OcMethod( Class cls, SEL sel ) : m_cls( cls ), m_sel( sel ) {} - - virtual void invoke() const { - id obj = [[m_cls alloc] init]; - - performOptionalSelector( obj, @selector(setUp) ); - performOptionalSelector( obj, m_sel ); - performOptionalSelector( obj, @selector(tearDown) ); - - arcSafeRelease( obj ); - } - private: - virtual ~OcMethod() {} - - Class m_cls; - SEL m_sel; - }; - - namespace Detail{ - - inline std::string getAnnotation( Class cls, - std::string const& annotationName, - std::string const& testCaseName ) { - NSString* selStr = [[NSString alloc] initWithFormat:@"Catch_%s_%s", annotationName.c_str(), testCaseName.c_str()]; - SEL sel = NSSelectorFromString( selStr ); - arcSafeRelease( selStr ); - id value = performOptionalSelector( cls, sel ); - if( value ) - return [(NSString*)value UTF8String]; - return ""; - } - } - - inline size_t registerTestMethods() { - size_t noTestMethods = 0; - int noClasses = objc_getClassList( CATCH_NULL, 0 ); - - Class* classes = (CATCH_UNSAFE_UNRETAINED Class *)malloc( sizeof(Class) * noClasses); - objc_getClassList( classes, noClasses ); - - for( int c = 0; c < noClasses; c++ ) { - Class cls = classes[c]; - { - u_int count; - Method* methods = class_copyMethodList( cls, &count ); - for( u_int m = 0; m < count ; m++ ) { - SEL selector = method_getName(methods[m]); - std::string methodName = sel_getName(selector); - if( startsWith( methodName, "Catch_TestCase_" ) ) { - std::string testCaseName = methodName.substr( 15 ); - std::string name = Detail::getAnnotation( cls, "Name", testCaseName ); - std::string desc = Detail::getAnnotation( cls, "Description", testCaseName ); - const char* className = class_getName( cls ); - - getMutableRegistryHub().registerTest( makeTestCase( new OcMethod( cls, selector ), className, name.c_str(), desc.c_str(), SourceLineInfo() ) ); - noTestMethods++; - } - } - free(methods); - } - } - return noTestMethods; - } - - namespace Matchers { - namespace Impl { - namespace NSStringMatchers { - - template - struct StringHolder : MatcherImpl{ - StringHolder( NSString* substr ) : m_substr( [substr copy] ){} - StringHolder( StringHolder const& other ) : m_substr( [other.m_substr copy] ){} - StringHolder() { - arcSafeRelease( m_substr ); - } - - NSString* m_substr; - }; - - struct Equals : StringHolder { - Equals( NSString* substr ) : StringHolder( substr ){} - - virtual bool match( ExpressionType const& str ) const { - return (str != nil || m_substr == nil ) && - [str isEqualToString:m_substr]; - } - - virtual std::string toString() const { - return "equals string: " + Catch::toString( m_substr ); - } - }; - - struct Contains : StringHolder { - Contains( NSString* substr ) : StringHolder( substr ){} - - virtual bool match( ExpressionType const& str ) const { - return (str != nil || m_substr == nil ) && - [str rangeOfString:m_substr].location != NSNotFound; - } - - virtual std::string toString() const { - return "contains string: " + Catch::toString( m_substr ); - } - }; - - struct StartsWith : StringHolder { - StartsWith( NSString* substr ) : StringHolder( substr ){} - - virtual bool match( ExpressionType const& str ) const { - return (str != nil || m_substr == nil ) && - [str rangeOfString:m_substr].location == 0; - } - - virtual std::string toString() const { - return "starts with: " + Catch::toString( m_substr ); - } - }; - struct EndsWith : StringHolder { - EndsWith( NSString* substr ) : StringHolder( substr ){} - - virtual bool match( ExpressionType const& str ) const { - return (str != nil || m_substr == nil ) && - [str rangeOfString:m_substr].location == [str length] - [m_substr length]; - } - - virtual std::string toString() const { - return "ends with: " + Catch::toString( m_substr ); - } - }; - - } // namespace NSStringMatchers - } // namespace Impl - - inline Impl::NSStringMatchers::Equals - Equals( NSString* substr ){ return Impl::NSStringMatchers::Equals( substr ); } - - inline Impl::NSStringMatchers::Contains - Contains( NSString* substr ){ return Impl::NSStringMatchers::Contains( substr ); } - - inline Impl::NSStringMatchers::StartsWith - StartsWith( NSString* substr ){ return Impl::NSStringMatchers::StartsWith( substr ); } - - inline Impl::NSStringMatchers::EndsWith - EndsWith( NSString* substr ){ return Impl::NSStringMatchers::EndsWith( substr ); } - - } // namespace Matchers - - using namespace Matchers; - -} // namespace Catch - -/////////////////////////////////////////////////////////////////////////////// -#define OC_TEST_CASE( name, desc )\ -+(NSString*) INTERNAL_CATCH_UNIQUE_NAME( Catch_Name_test ) \ -{\ -return @ name; \ -}\ -+(NSString*) INTERNAL_CATCH_UNIQUE_NAME( Catch_Description_test ) \ -{ \ -return @ desc; \ -} \ --(void) INTERNAL_CATCH_UNIQUE_NAME( Catch_TestCase_test ) - -#endif - -#ifdef CATCH_IMPL -// #included from: internal/catch_impl.hpp -#define TWOBLUECUBES_CATCH_IMPL_HPP_INCLUDED - -// Collect all the implementation files together here -// These are the equivalent of what would usually be cpp files - -#ifdef __clang__ -#pragma clang diagnostic push -#pragma clang diagnostic ignored "-Wweak-vtables" -#endif - -// #included from: ../catch_session.hpp -#define TWOBLUECUBES_CATCH_RUNNER_HPP_INCLUDED - -// #included from: internal/catch_commandline.hpp -#define TWOBLUECUBES_CATCH_COMMANDLINE_HPP_INCLUDED - -// #included from: catch_config.hpp -#define TWOBLUECUBES_CATCH_CONFIG_HPP_INCLUDED - -// #included from: catch_test_spec_parser.hpp -#define TWOBLUECUBES_CATCH_TEST_SPEC_PARSER_HPP_INCLUDED - -#ifdef __clang__ -#pragma clang diagnostic push -#pragma clang diagnostic ignored "-Wpadded" -#endif - -// #included from: catch_test_spec.hpp -#define TWOBLUECUBES_CATCH_TEST_SPEC_HPP_INCLUDED - -#ifdef __clang__ -#pragma clang diagnostic push -#pragma clang diagnostic ignored "-Wpadded" -#endif - -// #included from: catch_wildcard_pattern.hpp -#define TWOBLUECUBES_CATCH_WILDCARD_PATTERN_HPP_INCLUDED - -namespace Catch -{ - class WildcardPattern { - enum WildcardPosition { - NoWildcard = 0, - WildcardAtStart = 1, - WildcardAtEnd = 2, - WildcardAtBothEnds = WildcardAtStart | WildcardAtEnd - }; - - public: - - WildcardPattern( std::string const& pattern, CaseSensitive::Choice caseSensitivity ) - : m_caseSensitivity( caseSensitivity ), - m_wildcard( NoWildcard ), - m_pattern( adjustCase( pattern ) ) - { - if( startsWith( m_pattern, "*" ) ) { - m_pattern = m_pattern.substr( 1 ); - m_wildcard = WildcardAtStart; - } - if( endsWith( m_pattern, "*" ) ) { - m_pattern = m_pattern.substr( 0, m_pattern.size()-1 ); - m_wildcard = static_cast( m_wildcard | WildcardAtEnd ); - } - } - virtual ~WildcardPattern(); - virtual bool matches( std::string const& str ) const { - switch( m_wildcard ) { - case NoWildcard: - return m_pattern == adjustCase( str ); - case WildcardAtStart: - return endsWith( adjustCase( str ), m_pattern ); - case WildcardAtEnd: - return startsWith( adjustCase( str ), m_pattern ); - case WildcardAtBothEnds: - return contains( adjustCase( str ), m_pattern ); - } - -#ifdef __clang__ -#pragma clang diagnostic push -#pragma clang diagnostic ignored "-Wunreachable-code" -#endif - throw std::logic_error( "Unknown enum" ); -#ifdef __clang__ -#pragma clang diagnostic pop -#endif - } - private: - std::string adjustCase( std::string const& str ) const { - return m_caseSensitivity == CaseSensitive::No ? toLower( str ) : str; - } - CaseSensitive::Choice m_caseSensitivity; - WildcardPosition m_wildcard; - std::string m_pattern; - }; -} - -#include -#include - -namespace Catch { - - class TestSpec { - struct Pattern : SharedImpl<> { - virtual ~Pattern(); - virtual bool matches( TestCaseInfo const& testCase ) const = 0; - }; - class NamePattern : public Pattern { - public: - NamePattern( std::string const& name ) - : m_wildcardPattern( toLower( name ), CaseSensitive::No ) - {} - virtual ~NamePattern(); - virtual bool matches( TestCaseInfo const& testCase ) const { - return m_wildcardPattern.matches( toLower( testCase.name ) ); - } - private: - WildcardPattern m_wildcardPattern; - }; - - class TagPattern : public Pattern { - public: - TagPattern( std::string const& tag ) : m_tag( toLower( tag ) ) {} - virtual ~TagPattern(); - virtual bool matches( TestCaseInfo const& testCase ) const { - return testCase.lcaseTags.find( m_tag ) != testCase.lcaseTags.end(); - } - private: - std::string m_tag; - }; - - class ExcludedPattern : public Pattern { - public: - ExcludedPattern( Ptr const& underlyingPattern ) : m_underlyingPattern( underlyingPattern ) {} - virtual ~ExcludedPattern(); - virtual bool matches( TestCaseInfo const& testCase ) const { return !m_underlyingPattern->matches( testCase ); } - private: - Ptr m_underlyingPattern; - }; - - struct Filter { - std::vector > m_patterns; - - bool matches( TestCaseInfo const& testCase ) const { - // All patterns in a filter must match for the filter to be a match - for( std::vector >::const_iterator it = m_patterns.begin(), itEnd = m_patterns.end(); it != itEnd; ++it ) { - if( !(*it)->matches( testCase ) ) - return false; - } - return true; - } - }; - - public: - bool hasFilters() const { - return !m_filters.empty(); - } - bool matches( TestCaseInfo const& testCase ) const { - // A TestSpec matches if any filter matches - for( std::vector::const_iterator it = m_filters.begin(), itEnd = m_filters.end(); it != itEnd; ++it ) - if( it->matches( testCase ) ) - return true; - return false; - } - - private: - std::vector m_filters; - - friend class TestSpecParser; - }; -} - -#ifdef __clang__ -#pragma clang diagnostic pop -#endif - -namespace Catch { - - class TestSpecParser { - enum Mode{ None, Name, QuotedName, Tag }; - Mode m_mode; - bool m_exclusion; - std::size_t m_start, m_pos; - std::string m_arg; - TestSpec::Filter m_currentFilter; - TestSpec m_testSpec; - ITagAliasRegistry const* m_tagAliases; - - public: - TestSpecParser( ITagAliasRegistry const& tagAliases ) : m_tagAliases( &tagAliases ) {} - - TestSpecParser& parse( std::string const& arg ) { - m_mode = None; - m_exclusion = false; - m_start = std::string::npos; - m_arg = m_tagAliases->expandAliases( arg ); - for( m_pos = 0; m_pos < m_arg.size(); ++m_pos ) - visitChar( m_arg[m_pos] ); - if( m_mode == Name ) - addPattern(); - return *this; - } - TestSpec testSpec() { - addFilter(); - return m_testSpec; - } - private: - void visitChar( char c ) { - if( m_mode == None ) { - switch( c ) { - case ' ': return; - case '~': m_exclusion = true; return; - case '[': return startNewMode( Tag, ++m_pos ); - case '"': return startNewMode( QuotedName, ++m_pos ); - default: startNewMode( Name, m_pos ); break; - } - } - if( m_mode == Name ) { - if( c == ',' ) { - addPattern(); - addFilter(); - } - else if( c == '[' ) { - if( subString() == "exclude:" ) - m_exclusion = true; - else - addPattern(); - startNewMode( Tag, ++m_pos ); - } - } - else if( m_mode == QuotedName && c == '"' ) - addPattern(); - else if( m_mode == Tag && c == ']' ) - addPattern(); - } - void startNewMode( Mode mode, std::size_t start ) { - m_mode = mode; - m_start = start; - } - std::string subString() const { return m_arg.substr( m_start, m_pos - m_start ); } - template - void addPattern() { - std::string token = subString(); - if( startsWith( token, "exclude:" ) ) { - m_exclusion = true; - token = token.substr( 8 ); - } - if( !token.empty() ) { - Ptr pattern = new T( token ); - if( m_exclusion ) - pattern = new TestSpec::ExcludedPattern( pattern ); - m_currentFilter.m_patterns.push_back( pattern ); - } - m_exclusion = false; - m_mode = None; - } - void addFilter() { - if( !m_currentFilter.m_patterns.empty() ) { - m_testSpec.m_filters.push_back( m_currentFilter ); - m_currentFilter = TestSpec::Filter(); - } - } - }; - inline TestSpec parseTestSpec( std::string const& arg ) { - return TestSpecParser( ITagAliasRegistry::get() ).parse( arg ).testSpec(); - } - -} // namespace Catch - -#ifdef __clang__ -#pragma clang diagnostic pop -#endif - -// #included from: catch_interfaces_config.h -#define TWOBLUECUBES_CATCH_INTERFACES_CONFIG_H_INCLUDED - -#include -#include -#include - -namespace Catch { - - struct Verbosity { enum Level { - NoOutput = 0, - Quiet, - Normal - }; }; - - struct WarnAbout { enum What { - Nothing = 0x00, - NoAssertions = 0x01 - }; }; - - struct ShowDurations { enum OrNot { - DefaultForReporter, - Always, - Never - }; }; - struct RunTests { enum InWhatOrder { - InDeclarationOrder, - InLexicographicalOrder, - InRandomOrder - }; }; - struct UseColour { enum YesOrNo { - Auto, - Yes, - No - }; }; - - class TestSpec; - - struct IConfig : IShared { - - virtual ~IConfig(); - - virtual bool allowThrows() const = 0; - virtual std::ostream& stream() const = 0; - virtual std::string name() const = 0; - virtual bool includeSuccessfulResults() const = 0; - virtual bool shouldDebugBreak() const = 0; - virtual bool warnAboutMissingAssertions() const = 0; - virtual int abortAfter() const = 0; - virtual bool showInvisibles() const = 0; - virtual ShowDurations::OrNot showDurations() const = 0; - virtual TestSpec const& testSpec() const = 0; - virtual RunTests::InWhatOrder runOrder() const = 0; - virtual unsigned int rngSeed() const = 0; - virtual UseColour::YesOrNo useColour() const = 0; - }; -} - -// #included from: catch_stream.h -#define TWOBLUECUBES_CATCH_STREAM_H_INCLUDED - -// #included from: catch_streambuf.h -#define TWOBLUECUBES_CATCH_STREAMBUF_H_INCLUDED - -#include - -namespace Catch { - - class StreamBufBase : public std::streambuf { - public: - virtual ~StreamBufBase() CATCH_NOEXCEPT; - }; -} - -#include -#include -#include - -namespace Catch { - - std::ostream& cout(); - std::ostream& cerr(); - - struct IStream { - virtual ~IStream() CATCH_NOEXCEPT; - virtual std::ostream& stream() const = 0; - }; - - class FileStream : public IStream { - mutable std::ofstream m_ofs; - public: - FileStream( std::string const& filename ); - virtual ~FileStream() CATCH_NOEXCEPT; - public: // IStream - virtual std::ostream& stream() const CATCH_OVERRIDE; - }; - - class CoutStream : public IStream { - mutable std::ostream m_os; - public: - CoutStream(); - virtual ~CoutStream() CATCH_NOEXCEPT; - - public: // IStream - virtual std::ostream& stream() const CATCH_OVERRIDE; - }; - - class DebugOutStream : public IStream { - CATCH_AUTO_PTR( StreamBufBase ) m_streamBuf; - mutable std::ostream m_os; - public: - DebugOutStream(); - virtual ~DebugOutStream() CATCH_NOEXCEPT; - - public: // IStream - virtual std::ostream& stream() const CATCH_OVERRIDE; - }; -} - -#include -#include -#include -#include -#include - -#ifndef CATCH_CONFIG_CONSOLE_WIDTH -#define CATCH_CONFIG_CONSOLE_WIDTH 80 -#endif - -namespace Catch { - - struct ConfigData { - - ConfigData() - : listTests( false ), - listTags( false ), - listReporters( false ), - listTestNamesOnly( false ), - showSuccessfulTests( false ), - shouldDebugBreak( false ), - noThrow( false ), - showHelp( false ), - showInvisibles( false ), - filenamesAsTags( false ), - abortAfter( -1 ), - rngSeed( 0 ), - verbosity( Verbosity::Normal ), - warnings( WarnAbout::Nothing ), - showDurations( ShowDurations::DefaultForReporter ), - runOrder( RunTests::InDeclarationOrder ), - useColour( UseColour::Auto ) - {} - - bool listTests; - bool listTags; - bool listReporters; - bool listTestNamesOnly; - - bool showSuccessfulTests; - bool shouldDebugBreak; - bool noThrow; - bool showHelp; - bool showInvisibles; - bool filenamesAsTags; - - int abortAfter; - unsigned int rngSeed; - - Verbosity::Level verbosity; - WarnAbout::What warnings; - ShowDurations::OrNot showDurations; - RunTests::InWhatOrder runOrder; - UseColour::YesOrNo useColour; - - std::string outputFilename; - std::string name; - std::string processName; - - std::vector reporterNames; - std::vector testsOrTags; - }; - - class Config : public SharedImpl { - private: - Config( Config const& other ); - Config& operator = ( Config const& other ); - virtual void dummy(); - public: - - Config() - {} - - Config( ConfigData const& data ) - : m_data( data ), - m_stream( openStream() ) - { - if( !data.testsOrTags.empty() ) { - TestSpecParser parser( ITagAliasRegistry::get() ); - for( std::size_t i = 0; i < data.testsOrTags.size(); ++i ) - parser.parse( data.testsOrTags[i] ); - m_testSpec = parser.testSpec(); - } - } - - virtual ~Config() { - } - - std::string const& getFilename() const { - return m_data.outputFilename ; - } - - bool listTests() const { return m_data.listTests; } - bool listTestNamesOnly() const { return m_data.listTestNamesOnly; } - bool listTags() const { return m_data.listTags; } - bool listReporters() const { return m_data.listReporters; } - - std::string getProcessName() const { return m_data.processName; } - - bool shouldDebugBreak() const { return m_data.shouldDebugBreak; } - - std::vector getReporterNames() const { return m_data.reporterNames; } - - int abortAfter() const { return m_data.abortAfter; } - - TestSpec const& testSpec() const { return m_testSpec; } - - bool showHelp() const { return m_data.showHelp; } - bool showInvisibles() const { return m_data.showInvisibles; } - - // IConfig interface - virtual bool allowThrows() const { return !m_data.noThrow; } - virtual std::ostream& stream() const { return m_stream->stream(); } - virtual std::string name() const { return m_data.name.empty() ? m_data.processName : m_data.name; } - virtual bool includeSuccessfulResults() const { return m_data.showSuccessfulTests; } - virtual bool warnAboutMissingAssertions() const { return m_data.warnings & WarnAbout::NoAssertions; } - virtual ShowDurations::OrNot showDurations() const { return m_data.showDurations; } - virtual RunTests::InWhatOrder runOrder() const { return m_data.runOrder; } - virtual unsigned int rngSeed() const { return m_data.rngSeed; } - virtual UseColour::YesOrNo useColour() const { return m_data.useColour; } - - private: - - IStream const* openStream() { - if( m_data.outputFilename.empty() ) - return new CoutStream(); - else if( m_data.outputFilename[0] == '%' ) { - if( m_data.outputFilename == "%debug" ) - return new DebugOutStream(); - else - throw std::domain_error( "Unrecognised stream: " + m_data.outputFilename ); - } - else - return new FileStream( m_data.outputFilename ); - } - ConfigData m_data; - - CATCH_AUTO_PTR( IStream const ) m_stream; - TestSpec m_testSpec; - }; - -} // end namespace Catch - -// #included from: catch_clara.h -#define TWOBLUECUBES_CATCH_CLARA_H_INCLUDED - -// Use Catch's value for console width (store Clara's off to the side, if present) -#ifdef CLARA_CONFIG_CONSOLE_WIDTH -#define CATCH_TEMP_CLARA_CONFIG_CONSOLE_WIDTH CLARA_CONFIG_CONSOLE_WIDTH -#undef CLARA_CONFIG_CONSOLE_WIDTH -#endif -#define CLARA_CONFIG_CONSOLE_WIDTH CATCH_CONFIG_CONSOLE_WIDTH - -// Declare Clara inside the Catch namespace -#define STITCH_CLARA_OPEN_NAMESPACE namespace Catch { -// #included from: ../external/clara.h - -// Version 0.0.2.4 - -// Only use header guard if we are not using an outer namespace -#if !defined(TWOBLUECUBES_CLARA_H_INCLUDED) || defined(STITCH_CLARA_OPEN_NAMESPACE) - -#ifndef STITCH_CLARA_OPEN_NAMESPACE -#define TWOBLUECUBES_CLARA_H_INCLUDED -#define STITCH_CLARA_OPEN_NAMESPACE -#define STITCH_CLARA_CLOSE_NAMESPACE -#else -#define STITCH_CLARA_CLOSE_NAMESPACE } -#endif - -#define STITCH_TBC_TEXT_FORMAT_OPEN_NAMESPACE STITCH_CLARA_OPEN_NAMESPACE - -// ----------- #included from tbc_text_format.h ----------- - -// Only use header guard if we are not using an outer namespace -#if !defined(TBC_TEXT_FORMAT_H_INCLUDED) || defined(STITCH_TBC_TEXT_FORMAT_OUTER_NAMESPACE) -#ifndef STITCH_TBC_TEXT_FORMAT_OUTER_NAMESPACE -#define TBC_TEXT_FORMAT_H_INCLUDED -#endif - -#include -#include -#include -#include - -// Use optional outer namespace -#ifdef STITCH_TBC_TEXT_FORMAT_OUTER_NAMESPACE -namespace STITCH_TBC_TEXT_FORMAT_OUTER_NAMESPACE { -#endif - -namespace Tbc { - -#ifdef TBC_TEXT_FORMAT_CONSOLE_WIDTH - const unsigned int consoleWidth = TBC_TEXT_FORMAT_CONSOLE_WIDTH; -#else - const unsigned int consoleWidth = 80; -#endif - - struct TextAttributes { - TextAttributes() - : initialIndent( std::string::npos ), - indent( 0 ), - width( consoleWidth-1 ), - tabChar( '\t' ) - {} - - TextAttributes& setInitialIndent( std::size_t _value ) { initialIndent = _value; return *this; } - TextAttributes& setIndent( std::size_t _value ) { indent = _value; return *this; } - TextAttributes& setWidth( std::size_t _value ) { width = _value; return *this; } - TextAttributes& setTabChar( char _value ) { tabChar = _value; return *this; } - - std::size_t initialIndent; // indent of first line, or npos - std::size_t indent; // indent of subsequent lines, or all if initialIndent is npos - std::size_t width; // maximum width of text, including indent. Longer text will wrap - char tabChar; // If this char is seen the indent is changed to current pos - }; - - class Text { - public: - Text( std::string const& _str, TextAttributes const& _attr = TextAttributes() ) - : attr( _attr ) - { - std::string wrappableChars = " [({.,/|\\-"; - std::size_t indent = _attr.initialIndent != std::string::npos - ? _attr.initialIndent - : _attr.indent; - std::string remainder = _str; - - while( !remainder.empty() ) { - if( lines.size() >= 1000 ) { - lines.push_back( "... message truncated due to excessive size" ); - return; - } - std::size_t tabPos = std::string::npos; - std::size_t width = (std::min)( remainder.size(), _attr.width - indent ); - std::size_t pos = remainder.find_first_of( '\n' ); - if( pos <= width ) { - width = pos; - } - pos = remainder.find_last_of( _attr.tabChar, width ); - if( pos != std::string::npos ) { - tabPos = pos; - if( remainder[width] == '\n' ) - width--; - remainder = remainder.substr( 0, tabPos ) + remainder.substr( tabPos+1 ); - } - - if( width == remainder.size() ) { - spliceLine( indent, remainder, width ); - } - else if( remainder[width] == '\n' ) { - spliceLine( indent, remainder, width ); - if( width <= 1 || remainder.size() != 1 ) - remainder = remainder.substr( 1 ); - indent = _attr.indent; - } - else { - pos = remainder.find_last_of( wrappableChars, width ); - if( pos != std::string::npos && pos > 0 ) { - spliceLine( indent, remainder, pos ); - if( remainder[0] == ' ' ) - remainder = remainder.substr( 1 ); - } - else { - spliceLine( indent, remainder, width-1 ); - lines.back() += "-"; - } - if( lines.size() == 1 ) - indent = _attr.indent; - if( tabPos != std::string::npos ) - indent += tabPos; - } - } - } - - void spliceLine( std::size_t _indent, std::string& _remainder, std::size_t _pos ) { - lines.push_back( std::string( _indent, ' ' ) + _remainder.substr( 0, _pos ) ); - _remainder = _remainder.substr( _pos ); - } - - typedef std::vector::const_iterator const_iterator; - - const_iterator begin() const { return lines.begin(); } - const_iterator end() const { return lines.end(); } - std::string const& last() const { return lines.back(); } - std::size_t size() const { return lines.size(); } - std::string const& operator[]( std::size_t _index ) const { return lines[_index]; } - std::string toString() const { - std::ostringstream oss; - oss << *this; - return oss.str(); - } - - inline friend std::ostream& operator << ( std::ostream& _stream, Text const& _text ) { - for( Text::const_iterator it = _text.begin(), itEnd = _text.end(); - it != itEnd; ++it ) { - if( it != _text.begin() ) - _stream << "\n"; - _stream << *it; - } - return _stream; - } - - private: - std::string str; - TextAttributes attr; - std::vector lines; - }; - -} // end namespace Tbc - -#ifdef STITCH_TBC_TEXT_FORMAT_OUTER_NAMESPACE -} // end outer namespace -#endif - -#endif // TBC_TEXT_FORMAT_H_INCLUDED - -// ----------- end of #include from tbc_text_format.h ----------- -// ........... back in clara.h - -#undef STITCH_TBC_TEXT_FORMAT_OPEN_NAMESPACE - -// ----------- #included from clara_compilers.h ----------- - -#ifndef TWOBLUECUBES_CLARA_COMPILERS_H_INCLUDED -#define TWOBLUECUBES_CLARA_COMPILERS_H_INCLUDED - -// Detect a number of compiler features - mostly C++11/14 conformance - by compiler -// The following features are defined: -// -// CLARA_CONFIG_CPP11_NULLPTR : is nullptr supported? -// CLARA_CONFIG_CPP11_NOEXCEPT : is noexcept supported? -// CLARA_CONFIG_CPP11_GENERATED_METHODS : The delete and default keywords for compiler generated methods -// CLARA_CONFIG_CPP11_OVERRIDE : is override supported? -// CLARA_CONFIG_CPP11_UNIQUE_PTR : is unique_ptr supported (otherwise use auto_ptr) - -// CLARA_CONFIG_CPP11_OR_GREATER : Is C++11 supported? - -// CLARA_CONFIG_VARIADIC_MACROS : are variadic macros supported? - -// In general each macro has a _NO_ form -// (e.g. CLARA_CONFIG_CPP11_NO_NULLPTR) which disables the feature. -// Many features, at point of detection, define an _INTERNAL_ macro, so they -// can be combined, en-mass, with the _NO_ forms later. - -// All the C++11 features can be disabled with CLARA_CONFIG_NO_CPP11 - -#ifdef __clang__ - -#if __has_feature(cxx_nullptr) -#define CLARA_INTERNAL_CONFIG_CPP11_NULLPTR -#endif - -#if __has_feature(cxx_noexcept) -#define CLARA_INTERNAL_CONFIG_CPP11_NOEXCEPT -#endif - -#endif // __clang__ - -//////////////////////////////////////////////////////////////////////////////// -// GCC -#ifdef __GNUC__ - -#if __GNUC__ == 4 && __GNUC_MINOR__ >= 6 && defined(__GXX_EXPERIMENTAL_CXX0X__) -#define CLARA_INTERNAL_CONFIG_CPP11_NULLPTR -#endif - -// - otherwise more recent versions define __cplusplus >= 201103L -// and will get picked up below - -#endif // __GNUC__ - -//////////////////////////////////////////////////////////////////////////////// -// Visual C++ -#ifdef _MSC_VER - -#if (_MSC_VER >= 1600) -#define CLARA_INTERNAL_CONFIG_CPP11_NULLPTR -#define CLARA_INTERNAL_CONFIG_CPP11_UNIQUE_PTR -#endif - -#if (_MSC_VER >= 1900 ) // (VC++ 13 (VS2015)) -#define CLARA_INTERNAL_CONFIG_CPP11_NOEXCEPT -#define CLARA_INTERNAL_CONFIG_CPP11_GENERATED_METHODS -#endif - -#endif // _MSC_VER - -//////////////////////////////////////////////////////////////////////////////// -// C++ language feature support - -// catch all support for C++11 -#if defined(__cplusplus) && __cplusplus >= 201103L - -#define CLARA_CPP11_OR_GREATER - -#if !defined(CLARA_INTERNAL_CONFIG_CPP11_NULLPTR) -#define CLARA_INTERNAL_CONFIG_CPP11_NULLPTR -#endif - -#ifndef CLARA_INTERNAL_CONFIG_CPP11_NOEXCEPT -#define CLARA_INTERNAL_CONFIG_CPP11_NOEXCEPT -#endif - -#ifndef CLARA_INTERNAL_CONFIG_CPP11_GENERATED_METHODS -#define CLARA_INTERNAL_CONFIG_CPP11_GENERATED_METHODS -#endif - -#if !defined(CLARA_INTERNAL_CONFIG_CPP11_OVERRIDE) -#define CLARA_INTERNAL_CONFIG_CPP11_OVERRIDE -#endif -#if !defined(CLARA_INTERNAL_CONFIG_CPP11_UNIQUE_PTR) -#define CLARA_INTERNAL_CONFIG_CPP11_UNIQUE_PTR -#endif - -#endif // __cplusplus >= 201103L - -// Now set the actual defines based on the above + anything the user has configured -#if defined(CLARA_INTERNAL_CONFIG_CPP11_NULLPTR) && !defined(CLARA_CONFIG_CPP11_NO_NULLPTR) && !defined(CLARA_CONFIG_CPP11_NULLPTR) && !defined(CLARA_CONFIG_NO_CPP11) -#define CLARA_CONFIG_CPP11_NULLPTR -#endif -#if defined(CLARA_INTERNAL_CONFIG_CPP11_NOEXCEPT) && !defined(CLARA_CONFIG_CPP11_NO_NOEXCEPT) && !defined(CLARA_CONFIG_CPP11_NOEXCEPT) && !defined(CLARA_CONFIG_NO_CPP11) -#define CLARA_CONFIG_CPP11_NOEXCEPT -#endif -#if defined(CLARA_INTERNAL_CONFIG_CPP11_GENERATED_METHODS) && !defined(CLARA_CONFIG_CPP11_NO_GENERATED_METHODS) && !defined(CLARA_CONFIG_CPP11_GENERATED_METHODS) && !defined(CLARA_CONFIG_NO_CPP11) -#define CLARA_CONFIG_CPP11_GENERATED_METHODS -#endif -#if defined(CLARA_INTERNAL_CONFIG_CPP11_OVERRIDE) && !defined(CLARA_CONFIG_NO_OVERRIDE) && !defined(CLARA_CONFIG_CPP11_OVERRIDE) && !defined(CLARA_CONFIG_NO_CPP11) -#define CLARA_CONFIG_CPP11_OVERRIDE -#endif -#if defined(CLARA_INTERNAL_CONFIG_CPP11_UNIQUE_PTR) && !defined(CLARA_CONFIG_NO_UNIQUE_PTR) && !defined(CLARA_CONFIG_CPP11_UNIQUE_PTR) && !defined(CLARA_CONFIG_NO_CPP11) -#define CLARA_CONFIG_CPP11_UNIQUE_PTR -#endif - -// noexcept support: -#if defined(CLARA_CONFIG_CPP11_NOEXCEPT) && !defined(CLARA_NOEXCEPT) -#define CLARA_NOEXCEPT noexcept -# define CLARA_NOEXCEPT_IS(x) noexcept(x) -#else -#define CLARA_NOEXCEPT throw() -# define CLARA_NOEXCEPT_IS(x) -#endif - -// nullptr support -#ifdef CLARA_CONFIG_CPP11_NULLPTR -#define CLARA_NULL nullptr -#else -#define CLARA_NULL NULL -#endif - -// override support -#ifdef CLARA_CONFIG_CPP11_OVERRIDE -#define CLARA_OVERRIDE override -#else -#define CLARA_OVERRIDE -#endif - -// unique_ptr support -#ifdef CLARA_CONFIG_CPP11_UNIQUE_PTR -# define CLARA_AUTO_PTR( T ) std::unique_ptr -#else -# define CLARA_AUTO_PTR( T ) std::auto_ptr -#endif - -#endif // TWOBLUECUBES_CLARA_COMPILERS_H_INCLUDED - -// ----------- end of #include from clara_compilers.h ----------- -// ........... back in clara.h - -#include -#include -#include - -#if defined(WIN32) || defined(__WIN32__) || defined(_WIN32) || defined(_MSC_VER) -#define CLARA_PLATFORM_WINDOWS -#endif - -// Use optional outer namespace -#ifdef STITCH_CLARA_OPEN_NAMESPACE -STITCH_CLARA_OPEN_NAMESPACE -#endif - -namespace Clara { - - struct UnpositionalTag {}; - - extern UnpositionalTag _; - -#ifdef CLARA_CONFIG_MAIN - UnpositionalTag _; -#endif - - namespace Detail { - -#ifdef CLARA_CONSOLE_WIDTH - const unsigned int consoleWidth = CLARA_CONFIG_CONSOLE_WIDTH; -#else - const unsigned int consoleWidth = 80; -#endif - - using namespace Tbc; - - inline bool startsWith( std::string const& str, std::string const& prefix ) { - return str.size() >= prefix.size() && str.substr( 0, prefix.size() ) == prefix; - } - - template struct RemoveConstRef{ typedef T type; }; - template struct RemoveConstRef{ typedef T type; }; - template struct RemoveConstRef{ typedef T type; }; - template struct RemoveConstRef{ typedef T type; }; - - template struct IsBool { static const bool value = false; }; - template<> struct IsBool { static const bool value = true; }; - - template - void convertInto( std::string const& _source, T& _dest ) { - std::stringstream ss; - ss << _source; - ss >> _dest; - if( ss.fail() ) - throw std::runtime_error( "Unable to convert " + _source + " to destination type" ); - } - inline void convertInto( std::string const& _source, std::string& _dest ) { - _dest = _source; - } - inline void convertInto( std::string const& _source, bool& _dest ) { - std::string sourceLC = _source; - std::transform( sourceLC.begin(), sourceLC.end(), sourceLC.begin(), ::tolower ); - if( sourceLC == "y" || sourceLC == "1" || sourceLC == "true" || sourceLC == "yes" || sourceLC == "on" ) - _dest = true; - else if( sourceLC == "n" || sourceLC == "0" || sourceLC == "false" || sourceLC == "no" || sourceLC == "off" ) - _dest = false; - else - throw std::runtime_error( "Expected a boolean value but did not recognise:\n '" + _source + "'" ); - } - - template - struct IArgFunction { - virtual ~IArgFunction() {} -#ifdef CLARA_CONFIG_CPP11_GENERATED_METHODS - IArgFunction() = default; - IArgFunction( IArgFunction const& ) = default; -#endif - virtual void set( ConfigT& config, std::string const& value ) const = 0; - virtual bool takesArg() const = 0; - virtual IArgFunction* clone() const = 0; - }; - - template - class BoundArgFunction { - public: - BoundArgFunction() : functionObj( CLARA_NULL ) {} - BoundArgFunction( IArgFunction* _functionObj ) : functionObj( _functionObj ) {} - BoundArgFunction( BoundArgFunction const& other ) : functionObj( other.functionObj ? other.functionObj->clone() : CLARA_NULL ) {} - BoundArgFunction& operator = ( BoundArgFunction const& other ) { - IArgFunction* newFunctionObj = other.functionObj ? other.functionObj->clone() : CLARA_NULL; - delete functionObj; - functionObj = newFunctionObj; - return *this; - } - ~BoundArgFunction() { delete functionObj; } - - void set( ConfigT& config, std::string const& value ) const { - functionObj->set( config, value ); - } - bool takesArg() const { return functionObj->takesArg(); } - - bool isSet() const { - return functionObj != CLARA_NULL; - } - private: - IArgFunction* functionObj; - }; - - template - struct NullBinder : IArgFunction{ - virtual void set( C&, std::string const& ) const {} - virtual bool takesArg() const { return true; } - virtual IArgFunction* clone() const { return new NullBinder( *this ); } - }; - - template - struct BoundDataMember : IArgFunction{ - BoundDataMember( M C::* _member ) : member( _member ) {} - virtual void set( C& p, std::string const& stringValue ) const { - convertInto( stringValue, p.*member ); - } - virtual bool takesArg() const { return !IsBool::value; } - virtual IArgFunction* clone() const { return new BoundDataMember( *this ); } - M C::* member; - }; - template - struct BoundUnaryMethod : IArgFunction{ - BoundUnaryMethod( void (C::*_member)( M ) ) : member( _member ) {} - virtual void set( C& p, std::string const& stringValue ) const { - typename RemoveConstRef::type value; - convertInto( stringValue, value ); - (p.*member)( value ); - } - virtual bool takesArg() const { return !IsBool::value; } - virtual IArgFunction* clone() const { return new BoundUnaryMethod( *this ); } - void (C::*member)( M ); - }; - template - struct BoundNullaryMethod : IArgFunction{ - BoundNullaryMethod( void (C::*_member)() ) : member( _member ) {} - virtual void set( C& p, std::string const& stringValue ) const { - bool value; - convertInto( stringValue, value ); - if( value ) - (p.*member)(); - } - virtual bool takesArg() const { return false; } - virtual IArgFunction* clone() const { return new BoundNullaryMethod( *this ); } - void (C::*member)(); - }; - - template - struct BoundUnaryFunction : IArgFunction{ - BoundUnaryFunction( void (*_function)( C& ) ) : function( _function ) {} - virtual void set( C& obj, std::string const& stringValue ) const { - bool value; - convertInto( stringValue, value ); - if( value ) - function( obj ); - } - virtual bool takesArg() const { return false; } - virtual IArgFunction* clone() const { return new BoundUnaryFunction( *this ); } - void (*function)( C& ); - }; - - template - struct BoundBinaryFunction : IArgFunction{ - BoundBinaryFunction( void (*_function)( C&, T ) ) : function( _function ) {} - virtual void set( C& obj, std::string const& stringValue ) const { - typename RemoveConstRef::type value; - convertInto( stringValue, value ); - function( obj, value ); - } - virtual bool takesArg() const { return !IsBool::value; } - virtual IArgFunction* clone() const { return new BoundBinaryFunction( *this ); } - void (*function)( C&, T ); - }; - - } // namespace Detail - - inline std::vector argsToVector( int argc, char const* const* const argv ) { - std::vector args( static_cast( argc ) ); - for( std::size_t i = 0; i < static_cast( argc ); ++i ) - args[i] = argv[i]; - - return args; - } - - class Parser { - enum Mode { None, MaybeShortOpt, SlashOpt, ShortOpt, LongOpt, Positional }; - Mode mode; - std::size_t from; - bool inQuotes; - public: - - struct Token { - enum Type { Positional, ShortOpt, LongOpt }; - Token( Type _type, std::string const& _data ) : type( _type ), data( _data ) {} - Type type; - std::string data; - }; - - Parser() : mode( None ), from( 0 ), inQuotes( false ){} - - void parseIntoTokens( std::vector const& args, std::vector& tokens ) { - const std::string doubleDash = "--"; - for( std::size_t i = 1; i < args.size() && args[i] != doubleDash; ++i ) - parseIntoTokens( args[i], tokens); - } - - void parseIntoTokens( std::string const& arg, std::vector& tokens ) { - for( std::size_t i = 0; i <= arg.size(); ++i ) { - char c = arg[i]; - if( c == '"' ) - inQuotes = !inQuotes; - mode = handleMode( i, c, arg, tokens ); - } - } - Mode handleMode( std::size_t i, char c, std::string const& arg, std::vector& tokens ) { - switch( mode ) { - case None: return handleNone( i, c ); - case MaybeShortOpt: return handleMaybeShortOpt( i, c ); - case ShortOpt: - case LongOpt: - case SlashOpt: return handleOpt( i, c, arg, tokens ); - case Positional: return handlePositional( i, c, arg, tokens ); - default: throw std::logic_error( "Unknown mode" ); - } - } - - Mode handleNone( std::size_t i, char c ) { - if( inQuotes ) { - from = i; - return Positional; - } - switch( c ) { - case '-': return MaybeShortOpt; -#ifdef CLARA_PLATFORM_WINDOWS - case '/': from = i+1; return SlashOpt; -#endif - default: from = i; return Positional; - } - } - Mode handleMaybeShortOpt( std::size_t i, char c ) { - switch( c ) { - case '-': from = i+1; return LongOpt; - default: from = i; return ShortOpt; - } - } - Mode handleOpt( std::size_t i, char c, std::string const& arg, std::vector& tokens ) { - if( std::string( ":=\0", 3 ).find( c ) == std::string::npos ) - return mode; - - std::string optName = arg.substr( from, i-from ); - if( mode == ShortOpt ) - for( std::size_t j = 0; j < optName.size(); ++j ) - tokens.push_back( Token( Token::ShortOpt, optName.substr( j, 1 ) ) ); - else if( mode == SlashOpt && optName.size() == 1 ) - tokens.push_back( Token( Token::ShortOpt, optName ) ); - else - tokens.push_back( Token( Token::LongOpt, optName ) ); - return None; - } - Mode handlePositional( std::size_t i, char c, std::string const& arg, std::vector& tokens ) { - if( inQuotes || std::string( "\0", 1 ).find( c ) == std::string::npos ) - return mode; - - std::string data = arg.substr( from, i-from ); - tokens.push_back( Token( Token::Positional, data ) ); - return None; - } - }; - - template - struct CommonArgProperties { - CommonArgProperties() {} - CommonArgProperties( Detail::BoundArgFunction const& _boundField ) : boundField( _boundField ) {} - - Detail::BoundArgFunction boundField; - std::string description; - std::string detail; - std::string placeholder; // Only value if boundField takes an arg - - bool takesArg() const { - return !placeholder.empty(); - } - void validate() const { - if( !boundField.isSet() ) - throw std::logic_error( "option not bound" ); - } - }; - struct OptionArgProperties { - std::vector shortNames; - std::string longName; - - bool hasShortName( std::string const& shortName ) const { - return std::find( shortNames.begin(), shortNames.end(), shortName ) != shortNames.end(); - } - bool hasLongName( std::string const& _longName ) const { - return _longName == longName; - } - }; - struct PositionalArgProperties { - PositionalArgProperties() : position( -1 ) {} - int position; // -1 means non-positional (floating) - - bool isFixedPositional() const { - return position != -1; - } - }; - - template - class CommandLine { - - struct Arg : CommonArgProperties, OptionArgProperties, PositionalArgProperties { - Arg() {} - Arg( Detail::BoundArgFunction const& _boundField ) : CommonArgProperties( _boundField ) {} - - using CommonArgProperties::placeholder; // !TBD - - std::string dbgName() const { - if( !longName.empty() ) - return "--" + longName; - if( !shortNames.empty() ) - return "-" + shortNames[0]; - return "positional args"; - } - std::string commands() const { - std::ostringstream oss; - bool first = true; - std::vector::const_iterator it = shortNames.begin(), itEnd = shortNames.end(); - for(; it != itEnd; ++it ) { - if( first ) - first = false; - else - oss << ", "; - oss << "-" << *it; - } - if( !longName.empty() ) { - if( !first ) - oss << ", "; - oss << "--" << longName; - } - if( !placeholder.empty() ) - oss << " <" << placeholder << ">"; - return oss.str(); - } - }; - - typedef CLARA_AUTO_PTR( Arg ) ArgAutoPtr; - - friend void addOptName( Arg& arg, std::string const& optName ) - { - if( optName.empty() ) - return; - if( Detail::startsWith( optName, "--" ) ) { - if( !arg.longName.empty() ) - throw std::logic_error( "Only one long opt may be specified. '" - + arg.longName - + "' already specified, now attempting to add '" - + optName + "'" ); - arg.longName = optName.substr( 2 ); - } - else if( Detail::startsWith( optName, "-" ) ) - arg.shortNames.push_back( optName.substr( 1 ) ); - else - throw std::logic_error( "option must begin with - or --. Option was: '" + optName + "'" ); - } - friend void setPositionalArg( Arg& arg, int position ) - { - arg.position = position; - } - - class ArgBuilder { - public: - ArgBuilder( Arg* arg ) : m_arg( arg ) {} - - // Bind a non-boolean data member (requires placeholder string) - template - void bind( M C::* field, std::string const& placeholder ) { - m_arg->boundField = new Detail::BoundDataMember( field ); - m_arg->placeholder = placeholder; - } - // Bind a boolean data member (no placeholder required) - template - void bind( bool C::* field ) { - m_arg->boundField = new Detail::BoundDataMember( field ); - } - - // Bind a method taking a single, non-boolean argument (requires a placeholder string) - template - void bind( void (C::* unaryMethod)( M ), std::string const& placeholder ) { - m_arg->boundField = new Detail::BoundUnaryMethod( unaryMethod ); - m_arg->placeholder = placeholder; - } - - // Bind a method taking a single, boolean argument (no placeholder string required) - template - void bind( void (C::* unaryMethod)( bool ) ) { - m_arg->boundField = new Detail::BoundUnaryMethod( unaryMethod ); - } - - // Bind a method that takes no arguments (will be called if opt is present) - template - void bind( void (C::* nullaryMethod)() ) { - m_arg->boundField = new Detail::BoundNullaryMethod( nullaryMethod ); - } - - // Bind a free function taking a single argument - the object to operate on (no placeholder string required) - template - void bind( void (* unaryFunction)( C& ) ) { - m_arg->boundField = new Detail::BoundUnaryFunction( unaryFunction ); - } - - // Bind a free function taking a single argument - the object to operate on (requires a placeholder string) - template - void bind( void (* binaryFunction)( C&, T ), std::string const& placeholder ) { - m_arg->boundField = new Detail::BoundBinaryFunction( binaryFunction ); - m_arg->placeholder = placeholder; - } - - ArgBuilder& describe( std::string const& description ) { - m_arg->description = description; - return *this; - } - ArgBuilder& detail( std::string const& detail ) { - m_arg->detail = detail; - return *this; - } - - protected: - Arg* m_arg; - }; - - class OptBuilder : public ArgBuilder { - public: - OptBuilder( Arg* arg ) : ArgBuilder( arg ) {} - OptBuilder( OptBuilder& other ) : ArgBuilder( other ) {} - - OptBuilder& operator[]( std::string const& optName ) { - addOptName( *ArgBuilder::m_arg, optName ); - return *this; - } - }; - - public: - - CommandLine() - : m_boundProcessName( new Detail::NullBinder() ), - m_highestSpecifiedArgPosition( 0 ), - m_throwOnUnrecognisedTokens( false ) - {} - CommandLine( CommandLine const& other ) - : m_boundProcessName( other.m_boundProcessName ), - m_options ( other.m_options ), - m_positionalArgs( other.m_positionalArgs ), - m_highestSpecifiedArgPosition( other.m_highestSpecifiedArgPosition ), - m_throwOnUnrecognisedTokens( other.m_throwOnUnrecognisedTokens ) - { - if( other.m_floatingArg.get() ) - m_floatingArg.reset( new Arg( *other.m_floatingArg ) ); - } - - CommandLine& setThrowOnUnrecognisedTokens( bool shouldThrow = true ) { - m_throwOnUnrecognisedTokens = shouldThrow; - return *this; - } - - OptBuilder operator[]( std::string const& optName ) { - m_options.push_back( Arg() ); - addOptName( m_options.back(), optName ); - OptBuilder builder( &m_options.back() ); - return builder; - } - - ArgBuilder operator[]( int position ) { - m_positionalArgs.insert( std::make_pair( position, Arg() ) ); - if( position > m_highestSpecifiedArgPosition ) - m_highestSpecifiedArgPosition = position; - setPositionalArg( m_positionalArgs[position], position ); - ArgBuilder builder( &m_positionalArgs[position] ); - return builder; - } - - // Invoke this with the _ instance - ArgBuilder operator[]( UnpositionalTag ) { - if( m_floatingArg.get() ) - throw std::logic_error( "Only one unpositional argument can be added" ); - m_floatingArg.reset( new Arg() ); - ArgBuilder builder( m_floatingArg.get() ); - return builder; - } - - template - void bindProcessName( M C::* field ) { - m_boundProcessName = new Detail::BoundDataMember( field ); - } - template - void bindProcessName( void (C::*_unaryMethod)( M ) ) { - m_boundProcessName = new Detail::BoundUnaryMethod( _unaryMethod ); - } - - void optUsage( std::ostream& os, std::size_t indent = 0, std::size_t width = Detail::consoleWidth ) const { - typename std::vector::const_iterator itBegin = m_options.begin(), itEnd = m_options.end(), it; - std::size_t maxWidth = 0; - for( it = itBegin; it != itEnd; ++it ) - maxWidth = (std::max)( maxWidth, it->commands().size() ); - - for( it = itBegin; it != itEnd; ++it ) { - Detail::Text usage( it->commands(), Detail::TextAttributes() - .setWidth( maxWidth+indent ) - .setIndent( indent ) ); - Detail::Text desc( it->description, Detail::TextAttributes() - .setWidth( width - maxWidth - 3 ) ); - - for( std::size_t i = 0; i < (std::max)( usage.size(), desc.size() ); ++i ) { - std::string usageCol = i < usage.size() ? usage[i] : ""; - os << usageCol; - - if( i < desc.size() && !desc[i].empty() ) - os << std::string( indent + 2 + maxWidth - usageCol.size(), ' ' ) - << desc[i]; - os << "\n"; - } - } - } - std::string optUsage() const { - std::ostringstream oss; - optUsage( oss ); - return oss.str(); - } - - void argSynopsis( std::ostream& os ) const { - for( int i = 1; i <= m_highestSpecifiedArgPosition; ++i ) { - if( i > 1 ) - os << " "; - typename std::map::const_iterator it = m_positionalArgs.find( i ); - if( it != m_positionalArgs.end() ) - os << "<" << it->second.placeholder << ">"; - else if( m_floatingArg.get() ) - os << "<" << m_floatingArg->placeholder << ">"; - else - throw std::logic_error( "non consecutive positional arguments with no floating args" ); - } - // !TBD No indication of mandatory args - if( m_floatingArg.get() ) { - if( m_highestSpecifiedArgPosition > 1 ) - os << " "; - os << "[<" << m_floatingArg->placeholder << "> ...]"; - } - } - std::string argSynopsis() const { - std::ostringstream oss; - argSynopsis( oss ); - return oss.str(); - } - - void usage( std::ostream& os, std::string const& procName ) const { - validate(); - os << "usage:\n " << procName << " "; - argSynopsis( os ); - if( !m_options.empty() ) { - os << " [options]\n\nwhere options are: \n"; - optUsage( os, 2 ); - } - os << "\n"; - } - std::string usage( std::string const& procName ) const { - std::ostringstream oss; - usage( oss, procName ); - return oss.str(); - } - - ConfigT parse( std::vector const& args ) const { - ConfigT config; - parseInto( args, config ); - return config; - } - - std::vector parseInto( std::vector const& args, ConfigT& config ) const { - std::string processName = args[0]; - std::size_t lastSlash = processName.find_last_of( "/\\" ); - if( lastSlash != std::string::npos ) - processName = processName.substr( lastSlash+1 ); - m_boundProcessName.set( config, processName ); - std::vector tokens; - Parser parser; - parser.parseIntoTokens( args, tokens ); - return populate( tokens, config ); - } - - std::vector populate( std::vector const& tokens, ConfigT& config ) const { - validate(); - std::vector unusedTokens = populateOptions( tokens, config ); - unusedTokens = populateFixedArgs( unusedTokens, config ); - unusedTokens = populateFloatingArgs( unusedTokens, config ); - return unusedTokens; - } - - std::vector populateOptions( std::vector const& tokens, ConfigT& config ) const { - std::vector unusedTokens; - std::vector errors; - for( std::size_t i = 0; i < tokens.size(); ++i ) { - Parser::Token const& token = tokens[i]; - typename std::vector::const_iterator it = m_options.begin(), itEnd = m_options.end(); - for(; it != itEnd; ++it ) { - Arg const& arg = *it; - - try { - if( ( token.type == Parser::Token::ShortOpt && arg.hasShortName( token.data ) ) || - ( token.type == Parser::Token::LongOpt && arg.hasLongName( token.data ) ) ) { - if( arg.takesArg() ) { - if( i == tokens.size()-1 || tokens[i+1].type != Parser::Token::Positional ) - errors.push_back( "Expected argument to option: " + token.data ); - else - arg.boundField.set( config, tokens[++i].data ); - } - else { - arg.boundField.set( config, "true" ); - } - break; - } - } - catch( std::exception& ex ) { - errors.push_back( std::string( ex.what() ) + "\n- while parsing: (" + arg.commands() + ")" ); - } - } - if( it == itEnd ) { - if( token.type == Parser::Token::Positional || !m_throwOnUnrecognisedTokens ) - unusedTokens.push_back( token ); - else if( errors.empty() && m_throwOnUnrecognisedTokens ) - errors.push_back( "unrecognised option: " + token.data ); - } - } - if( !errors.empty() ) { - std::ostringstream oss; - for( std::vector::const_iterator it = errors.begin(), itEnd = errors.end(); - it != itEnd; - ++it ) { - if( it != errors.begin() ) - oss << "\n"; - oss << *it; - } - throw std::runtime_error( oss.str() ); - } - return unusedTokens; - } - std::vector populateFixedArgs( std::vector const& tokens, ConfigT& config ) const { - std::vector unusedTokens; - int position = 1; - for( std::size_t i = 0; i < tokens.size(); ++i ) { - Parser::Token const& token = tokens[i]; - typename std::map::const_iterator it = m_positionalArgs.find( position ); - if( it != m_positionalArgs.end() ) - it->second.boundField.set( config, token.data ); - else - unusedTokens.push_back( token ); - if( token.type == Parser::Token::Positional ) - position++; - } - return unusedTokens; - } - std::vector populateFloatingArgs( std::vector const& tokens, ConfigT& config ) const { - if( !m_floatingArg.get() ) - return tokens; - std::vector unusedTokens; - for( std::size_t i = 0; i < tokens.size(); ++i ) { - Parser::Token const& token = tokens[i]; - if( token.type == Parser::Token::Positional ) - m_floatingArg->boundField.set( config, token.data ); - else - unusedTokens.push_back( token ); - } - return unusedTokens; - } - - void validate() const - { - if( m_options.empty() && m_positionalArgs.empty() && !m_floatingArg.get() ) - throw std::logic_error( "No options or arguments specified" ); - - for( typename std::vector::const_iterator it = m_options.begin(), - itEnd = m_options.end(); - it != itEnd; ++it ) - it->validate(); - } - - private: - Detail::BoundArgFunction m_boundProcessName; - std::vector m_options; - std::map m_positionalArgs; - ArgAutoPtr m_floatingArg; - int m_highestSpecifiedArgPosition; - bool m_throwOnUnrecognisedTokens; - }; - -} // end namespace Clara - -STITCH_CLARA_CLOSE_NAMESPACE -#undef STITCH_CLARA_OPEN_NAMESPACE -#undef STITCH_CLARA_CLOSE_NAMESPACE - -#endif // TWOBLUECUBES_CLARA_H_INCLUDED -#undef STITCH_CLARA_OPEN_NAMESPACE - -// Restore Clara's value for console width, if present -#ifdef CATCH_TEMP_CLARA_CONFIG_CONSOLE_WIDTH -#define CLARA_CONFIG_CONSOLE_WIDTH CATCH_TEMP_CLARA_CONFIG_CONSOLE_WIDTH -#undef CATCH_TEMP_CLARA_CONFIG_CONSOLE_WIDTH -#endif - -#include - -namespace Catch { - - inline void abortAfterFirst( ConfigData& config ) { config.abortAfter = 1; } - inline void abortAfterX( ConfigData& config, int x ) { - if( x < 1 ) - throw std::runtime_error( "Value after -x or --abortAfter must be greater than zero" ); - config.abortAfter = x; - } - inline void addTestOrTags( ConfigData& config, std::string const& _testSpec ) { config.testsOrTags.push_back( _testSpec ); } - inline void addReporterName( ConfigData& config, std::string const& _reporterName ) { config.reporterNames.push_back( _reporterName ); } - - inline void addWarning( ConfigData& config, std::string const& _warning ) { - if( _warning == "NoAssertions" ) - config.warnings = static_cast( config.warnings | WarnAbout::NoAssertions ); - else - throw std::runtime_error( "Unrecognised warning: '" + _warning + "'" ); - } - inline void setOrder( ConfigData& config, std::string const& order ) { - if( startsWith( "declared", order ) ) - config.runOrder = RunTests::InDeclarationOrder; - else if( startsWith( "lexical", order ) ) - config.runOrder = RunTests::InLexicographicalOrder; - else if( startsWith( "random", order ) ) - config.runOrder = RunTests::InRandomOrder; - else - throw std::runtime_error( "Unrecognised ordering: '" + order + "'" ); - } - inline void setRngSeed( ConfigData& config, std::string const& seed ) { - if( seed == "time" ) { - config.rngSeed = static_cast( std::time(0) ); - } - else { - std::stringstream ss; - ss << seed; - ss >> config.rngSeed; - if( ss.fail() ) - throw std::runtime_error( "Argment to --rng-seed should be the word 'time' or a number" ); - } - } - inline void setVerbosity( ConfigData& config, int level ) { - // !TBD: accept strings? - config.verbosity = static_cast( level ); - } - inline void setShowDurations( ConfigData& config, bool _showDurations ) { - config.showDurations = _showDurations - ? ShowDurations::Always - : ShowDurations::Never; - } - inline void setUseColour( ConfigData& config, std::string const& value ) { - std::string mode = toLower( value ); - - if( mode == "yes" ) - config.useColour = UseColour::Yes; - else if( mode == "no" ) - config.useColour = UseColour::No; - else if( mode == "auto" ) - config.useColour = UseColour::Auto; - else - throw std::runtime_error( "colour mode must be one of: auto, yes or no" ); - } - inline void forceColour( ConfigData& config ) { - config.useColour = UseColour::Yes; - } - inline void loadTestNamesFromFile( ConfigData& config, std::string const& _filename ) { - std::ifstream f( _filename.c_str() ); - if( !f.is_open() ) - throw std::domain_error( "Unable to load input file: " + _filename ); - - std::string line; - while( std::getline( f, line ) ) { - line = trim(line); - if( !line.empty() && !startsWith( line, "#" ) ) { - if( !startsWith( line, "\"" ) ) - line = "\"" + line + "\""; - addTestOrTags( config, line + "," ); - } - } - } - - inline Clara::CommandLine makeCommandLineParser() { - - using namespace Clara; - CommandLine cli; - - cli.bindProcessName( &ConfigData::processName ); - - cli["-?"]["-h"]["--help"] - .describe( "display usage information" ) - .bind( &ConfigData::showHelp ); - - cli["-l"]["--list-tests"] - .describe( "list all/matching test cases" ) - .bind( &ConfigData::listTests ); - - cli["-t"]["--list-tags"] - .describe( "list all/matching tags" ) - .bind( &ConfigData::listTags ); - - cli["-s"]["--success"] - .describe( "include successful tests in output" ) - .bind( &ConfigData::showSuccessfulTests ); - - cli["-b"]["--break"] - .describe( "break into debugger on failure" ) - .bind( &ConfigData::shouldDebugBreak ); - - cli["-e"]["--nothrow"] - .describe( "skip exception tests" ) - .bind( &ConfigData::noThrow ); - - cli["-i"]["--invisibles"] - .describe( "show invisibles (tabs, newlines)" ) - .bind( &ConfigData::showInvisibles ); - - cli["-o"]["--out"] - .describe( "output filename" ) - .bind( &ConfigData::outputFilename, "filename" ); - - cli["-r"]["--reporter"] -// .placeholder( "name[:filename]" ) - .describe( "reporter to use (defaults to console)" ) - .bind( &addReporterName, "name" ); - - cli["-n"]["--name"] - .describe( "suite name" ) - .bind( &ConfigData::name, "name" ); - - cli["-a"]["--abort"] - .describe( "abort at first failure" ) - .bind( &abortAfterFirst ); - - cli["-x"]["--abortx"] - .describe( "abort after x failures" ) - .bind( &abortAfterX, "no. failures" ); - - cli["-w"]["--warn"] - .describe( "enable warnings" ) - .bind( &addWarning, "warning name" ); - -// - needs updating if reinstated -// cli.into( &setVerbosity ) -// .describe( "level of verbosity (0=no output)" ) -// .shortOpt( "v") -// .longOpt( "verbosity" ) -// .placeholder( "level" ); - - cli[_] - .describe( "which test or tests to use" ) - .bind( &addTestOrTags, "test name, pattern or tags" ); - - cli["-d"]["--durations"] - .describe( "show test durations" ) - .bind( &setShowDurations, "yes|no" ); - - cli["-f"]["--input-file"] - .describe( "load test names to run from a file" ) - .bind( &loadTestNamesFromFile, "filename" ); - - cli["-#"]["--filenames-as-tags"] - .describe( "adds a tag for the filename" ) - .bind( &ConfigData::filenamesAsTags ); - - // Less common commands which don't have a short form - cli["--list-test-names-only"] - .describe( "list all/matching test cases names only" ) - .bind( &ConfigData::listTestNamesOnly ); - - cli["--list-reporters"] - .describe( "list all reporters" ) - .bind( &ConfigData::listReporters ); - - cli["--order"] - .describe( "test case order (defaults to decl)" ) - .bind( &setOrder, "decl|lex|rand" ); - - cli["--rng-seed"] - .describe( "set a specific seed for random numbers" ) - .bind( &setRngSeed, "'time'|number" ); - - cli["--force-colour"] - .describe( "force colourised output (deprecated)" ) - .bind( &forceColour ); - - cli["--use-colour"] - .describe( "should output be colourised" ) - .bind( &setUseColour, "yes|no" ); - - return cli; - } - -} // end namespace Catch - -// #included from: internal/catch_list.hpp -#define TWOBLUECUBES_CATCH_LIST_HPP_INCLUDED - -// #included from: catch_text.h -#define TWOBLUECUBES_CATCH_TEXT_H_INCLUDED - -#define TBC_TEXT_FORMAT_CONSOLE_WIDTH CATCH_CONFIG_CONSOLE_WIDTH - -#define CLICHE_TBC_TEXT_FORMAT_OUTER_NAMESPACE Catch -// #included from: ../external/tbc_text_format.h -// Only use header guard if we are not using an outer namespace -#ifndef CLICHE_TBC_TEXT_FORMAT_OUTER_NAMESPACE -# ifdef TWOBLUECUBES_TEXT_FORMAT_H_INCLUDED -# ifndef TWOBLUECUBES_TEXT_FORMAT_H_ALREADY_INCLUDED -# define TWOBLUECUBES_TEXT_FORMAT_H_ALREADY_INCLUDED -# endif -# else -# define TWOBLUECUBES_TEXT_FORMAT_H_INCLUDED -# endif -#endif -#ifndef TWOBLUECUBES_TEXT_FORMAT_H_ALREADY_INCLUDED -#include -#include -#include - -// Use optional outer namespace -#ifdef CLICHE_TBC_TEXT_FORMAT_OUTER_NAMESPACE -namespace CLICHE_TBC_TEXT_FORMAT_OUTER_NAMESPACE { -#endif - -namespace Tbc { - -#ifdef TBC_TEXT_FORMAT_CONSOLE_WIDTH - const unsigned int consoleWidth = TBC_TEXT_FORMAT_CONSOLE_WIDTH; -#else - const unsigned int consoleWidth = 80; -#endif - - struct TextAttributes { - TextAttributes() - : initialIndent( std::string::npos ), - indent( 0 ), - width( consoleWidth-1 ), - tabChar( '\t' ) - {} - - TextAttributes& setInitialIndent( std::size_t _value ) { initialIndent = _value; return *this; } - TextAttributes& setIndent( std::size_t _value ) { indent = _value; return *this; } - TextAttributes& setWidth( std::size_t _value ) { width = _value; return *this; } - TextAttributes& setTabChar( char _value ) { tabChar = _value; return *this; } - - std::size_t initialIndent; // indent of first line, or npos - std::size_t indent; // indent of subsequent lines, or all if initialIndent is npos - std::size_t width; // maximum width of text, including indent. Longer text will wrap - char tabChar; // If this char is seen the indent is changed to current pos - }; - - class Text { - public: - Text( std::string const& _str, TextAttributes const& _attr = TextAttributes() ) - : attr( _attr ) - { - std::string wrappableChars = " [({.,/|\\-"; - std::size_t indent = _attr.initialIndent != std::string::npos - ? _attr.initialIndent - : _attr.indent; - std::string remainder = _str; - - while( !remainder.empty() ) { - if( lines.size() >= 1000 ) { - lines.push_back( "... message truncated due to excessive size" ); - return; - } - std::size_t tabPos = std::string::npos; - std::size_t width = (std::min)( remainder.size(), _attr.width - indent ); - std::size_t pos = remainder.find_first_of( '\n' ); - if( pos <= width ) { - width = pos; - } - pos = remainder.find_last_of( _attr.tabChar, width ); - if( pos != std::string::npos ) { - tabPos = pos; - if( remainder[width] == '\n' ) - width--; - remainder = remainder.substr( 0, tabPos ) + remainder.substr( tabPos+1 ); - } - - if( width == remainder.size() ) { - spliceLine( indent, remainder, width ); - } - else if( remainder[width] == '\n' ) { - spliceLine( indent, remainder, width ); - if( width <= 1 || remainder.size() != 1 ) - remainder = remainder.substr( 1 ); - indent = _attr.indent; - } - else { - pos = remainder.find_last_of( wrappableChars, width ); - if( pos != std::string::npos && pos > 0 ) { - spliceLine( indent, remainder, pos ); - if( remainder[0] == ' ' ) - remainder = remainder.substr( 1 ); - } - else { - spliceLine( indent, remainder, width-1 ); - lines.back() += "-"; - } - if( lines.size() == 1 ) - indent = _attr.indent; - if( tabPos != std::string::npos ) - indent += tabPos; - } - } - } - - void spliceLine( std::size_t _indent, std::string& _remainder, std::size_t _pos ) { - lines.push_back( std::string( _indent, ' ' ) + _remainder.substr( 0, _pos ) ); - _remainder = _remainder.substr( _pos ); - } - - typedef std::vector::const_iterator const_iterator; - - const_iterator begin() const { return lines.begin(); } - const_iterator end() const { return lines.end(); } - std::string const& last() const { return lines.back(); } - std::size_t size() const { return lines.size(); } - std::string const& operator[]( std::size_t _index ) const { return lines[_index]; } - std::string toString() const { - std::ostringstream oss; - oss << *this; - return oss.str(); - } - - inline friend std::ostream& operator << ( std::ostream& _stream, Text const& _text ) { - for( Text::const_iterator it = _text.begin(), itEnd = _text.end(); - it != itEnd; ++it ) { - if( it != _text.begin() ) - _stream << "\n"; - _stream << *it; - } - return _stream; - } - - private: - std::string str; - TextAttributes attr; - std::vector lines; - }; - -} // end namespace Tbc - -#ifdef CLICHE_TBC_TEXT_FORMAT_OUTER_NAMESPACE -} // end outer namespace -#endif - -#endif // TWOBLUECUBES_TEXT_FORMAT_H_ALREADY_INCLUDED -#undef CLICHE_TBC_TEXT_FORMAT_OUTER_NAMESPACE - -namespace Catch { - using Tbc::Text; - using Tbc::TextAttributes; -} - -// #included from: catch_console_colour.hpp -#define TWOBLUECUBES_CATCH_CONSOLE_COLOUR_HPP_INCLUDED - -namespace Catch { - - struct Colour { - enum Code { - None = 0, - - White, - Red, - Green, - Blue, - Cyan, - Yellow, - Grey, - - Bright = 0x10, - - BrightRed = Bright | Red, - BrightGreen = Bright | Green, - LightGrey = Bright | Grey, - BrightWhite = Bright | White, - - // By intention - FileName = LightGrey, - Warning = Yellow, - ResultError = BrightRed, - ResultSuccess = BrightGreen, - ResultExpectedFailure = Warning, - - Error = BrightRed, - Success = Green, - - OriginalExpression = Cyan, - ReconstructedExpression = Yellow, - - SecondaryText = LightGrey, - Headers = White - }; - - // Use constructed object for RAII guard - Colour( Code _colourCode ); - Colour( Colour const& other ); - ~Colour(); - - // Use static method for one-shot changes - static void use( Code _colourCode ); - - private: - bool m_moved; - }; - - inline std::ostream& operator << ( std::ostream& os, Colour const& ) { return os; } - -} // end namespace Catch - -// #included from: catch_interfaces_reporter.h -#define TWOBLUECUBES_CATCH_INTERFACES_REPORTER_H_INCLUDED - -#include -#include -#include -#include - -namespace Catch -{ - struct ReporterConfig { - explicit ReporterConfig( Ptr const& _fullConfig ) - : m_stream( &_fullConfig->stream() ), m_fullConfig( _fullConfig ) {} - - ReporterConfig( Ptr const& _fullConfig, std::ostream& _stream ) - : m_stream( &_stream ), m_fullConfig( _fullConfig ) {} - - std::ostream& stream() const { return *m_stream; } - Ptr fullConfig() const { return m_fullConfig; } - - private: - std::ostream* m_stream; - Ptr m_fullConfig; - }; - - struct ReporterPreferences { - ReporterPreferences() - : shouldRedirectStdOut( false ) - {} - - bool shouldRedirectStdOut; - }; - - template - struct LazyStat : Option { - LazyStat() : used( false ) {} - LazyStat& operator=( T const& _value ) { - Option::operator=( _value ); - used = false; - return *this; - } - void reset() { - Option::reset(); - used = false; - } - bool used; - }; - - struct TestRunInfo { - TestRunInfo( std::string const& _name ) : name( _name ) {} - std::string name; - }; - struct GroupInfo { - GroupInfo( std::string const& _name, - std::size_t _groupIndex, - std::size_t _groupsCount ) - : name( _name ), - groupIndex( _groupIndex ), - groupsCounts( _groupsCount ) - {} - - std::string name; - std::size_t groupIndex; - std::size_t groupsCounts; - }; - - struct AssertionStats { - AssertionStats( AssertionResult const& _assertionResult, - std::vector const& _infoMessages, - Totals const& _totals ) - : assertionResult( _assertionResult ), - infoMessages( _infoMessages ), - totals( _totals ) - { - if( assertionResult.hasMessage() ) { - // Copy message into messages list. - // !TBD This should have been done earlier, somewhere - MessageBuilder builder( assertionResult.getTestMacroName(), assertionResult.getSourceInfo(), assertionResult.getResultType() ); - builder << assertionResult.getMessage(); - builder.m_info.message = builder.m_stream.str(); - - infoMessages.push_back( builder.m_info ); - } - } - virtual ~AssertionStats(); - -# ifdef CATCH_CONFIG_CPP11_GENERATED_METHODS - AssertionStats( AssertionStats const& ) = default; - AssertionStats( AssertionStats && ) = default; - AssertionStats& operator = ( AssertionStats const& ) = default; - AssertionStats& operator = ( AssertionStats && ) = default; -# endif - - AssertionResult assertionResult; - std::vector infoMessages; - Totals totals; - }; - - struct SectionStats { - SectionStats( SectionInfo const& _sectionInfo, - Counts const& _assertions, - double _durationInSeconds, - bool _missingAssertions ) - : sectionInfo( _sectionInfo ), - assertions( _assertions ), - durationInSeconds( _durationInSeconds ), - missingAssertions( _missingAssertions ) - {} - virtual ~SectionStats(); -# ifdef CATCH_CONFIG_CPP11_GENERATED_METHODS - SectionStats( SectionStats const& ) = default; - SectionStats( SectionStats && ) = default; - SectionStats& operator = ( SectionStats const& ) = default; - SectionStats& operator = ( SectionStats && ) = default; -# endif - - SectionInfo sectionInfo; - Counts assertions; - double durationInSeconds; - bool missingAssertions; - }; - - struct TestCaseStats { - TestCaseStats( TestCaseInfo const& _testInfo, - Totals const& _totals, - std::string const& _stdOut, - std::string const& _stdErr, - bool _aborting ) - : testInfo( _testInfo ), - totals( _totals ), - stdOut( _stdOut ), - stdErr( _stdErr ), - aborting( _aborting ) - {} - virtual ~TestCaseStats(); - -# ifdef CATCH_CONFIG_CPP11_GENERATED_METHODS - TestCaseStats( TestCaseStats const& ) = default; - TestCaseStats( TestCaseStats && ) = default; - TestCaseStats& operator = ( TestCaseStats const& ) = default; - TestCaseStats& operator = ( TestCaseStats && ) = default; -# endif - - TestCaseInfo testInfo; - Totals totals; - std::string stdOut; - std::string stdErr; - bool aborting; - }; - - struct TestGroupStats { - TestGroupStats( GroupInfo const& _groupInfo, - Totals const& _totals, - bool _aborting ) - : groupInfo( _groupInfo ), - totals( _totals ), - aborting( _aborting ) - {} - TestGroupStats( GroupInfo const& _groupInfo ) - : groupInfo( _groupInfo ), - aborting( false ) - {} - virtual ~TestGroupStats(); - -# ifdef CATCH_CONFIG_CPP11_GENERATED_METHODS - TestGroupStats( TestGroupStats const& ) = default; - TestGroupStats( TestGroupStats && ) = default; - TestGroupStats& operator = ( TestGroupStats const& ) = default; - TestGroupStats& operator = ( TestGroupStats && ) = default; -# endif - - GroupInfo groupInfo; - Totals totals; - bool aborting; - }; - - struct TestRunStats { - TestRunStats( TestRunInfo const& _runInfo, - Totals const& _totals, - bool _aborting ) - : runInfo( _runInfo ), - totals( _totals ), - aborting( _aborting ) - {} - virtual ~TestRunStats(); - -# ifndef CATCH_CONFIG_CPP11_GENERATED_METHODS - TestRunStats( TestRunStats const& _other ) - : runInfo( _other.runInfo ), - totals( _other.totals ), - aborting( _other.aborting ) - {} -# else - TestRunStats( TestRunStats const& ) = default; - TestRunStats( TestRunStats && ) = default; - TestRunStats& operator = ( TestRunStats const& ) = default; - TestRunStats& operator = ( TestRunStats && ) = default; -# endif - - TestRunInfo runInfo; - Totals totals; - bool aborting; - }; - - class MultipleReporters; - - struct IStreamingReporter : IShared { - virtual ~IStreamingReporter(); - - // Implementing class must also provide the following static method: - // static std::string getDescription(); - - virtual ReporterPreferences getPreferences() const = 0; - - virtual void noMatchingTestCases( std::string const& spec ) = 0; - - virtual void testRunStarting( TestRunInfo const& testRunInfo ) = 0; - virtual void testGroupStarting( GroupInfo const& groupInfo ) = 0; - - virtual void testCaseStarting( TestCaseInfo const& testInfo ) = 0; - virtual void sectionStarting( SectionInfo const& sectionInfo ) = 0; - - virtual void assertionStarting( AssertionInfo const& assertionInfo ) = 0; - - // The return value indicates if the messages buffer should be cleared: - virtual bool assertionEnded( AssertionStats const& assertionStats ) = 0; - - virtual void sectionEnded( SectionStats const& sectionStats ) = 0; - virtual void testCaseEnded( TestCaseStats const& testCaseStats ) = 0; - virtual void testGroupEnded( TestGroupStats const& testGroupStats ) = 0; - virtual void testRunEnded( TestRunStats const& testRunStats ) = 0; - - virtual void skipTest( TestCaseInfo const& testInfo ) = 0; - - virtual MultipleReporters* tryAsMulti() { return CATCH_NULL; } - }; - - struct IReporterFactory : IShared { - virtual ~IReporterFactory(); - virtual IStreamingReporter* create( ReporterConfig const& config ) const = 0; - virtual std::string getDescription() const = 0; - }; - - struct IReporterRegistry { - typedef std::map > FactoryMap; - typedef std::vector > Listeners; - - virtual ~IReporterRegistry(); - virtual IStreamingReporter* create( std::string const& name, Ptr const& config ) const = 0; - virtual FactoryMap const& getFactories() const = 0; - virtual Listeners const& getListeners() const = 0; - }; - - Ptr addReporter( Ptr const& existingReporter, Ptr const& additionalReporter ); - -} - -#include -#include - -namespace Catch { - - inline std::size_t listTests( Config const& config ) { - - TestSpec testSpec = config.testSpec(); - if( config.testSpec().hasFilters() ) - Catch::cout() << "Matching test cases:\n"; - else { - Catch::cout() << "All available test cases:\n"; - testSpec = TestSpecParser( ITagAliasRegistry::get() ).parse( "*" ).testSpec(); - } - - std::size_t matchedTests = 0; - TextAttributes nameAttr, tagsAttr; - nameAttr.setInitialIndent( 2 ).setIndent( 4 ); - tagsAttr.setIndent( 6 ); - - std::vector matchedTestCases = filterTests( getAllTestCasesSorted( config ), testSpec, config ); - for( std::vector::const_iterator it = matchedTestCases.begin(), itEnd = matchedTestCases.end(); - it != itEnd; - ++it ) { - matchedTests++; - TestCaseInfo const& testCaseInfo = it->getTestCaseInfo(); - Colour::Code colour = testCaseInfo.isHidden() - ? Colour::SecondaryText - : Colour::None; - Colour colourGuard( colour ); - - Catch::cout() << Text( testCaseInfo.name, nameAttr ) << std::endl; - if( !testCaseInfo.tags.empty() ) - Catch::cout() << Text( testCaseInfo.tagsAsString, tagsAttr ) << std::endl; - } - - if( !config.testSpec().hasFilters() ) - Catch::cout() << pluralise( matchedTests, "test case" ) << "\n" << std::endl; - else - Catch::cout() << pluralise( matchedTests, "matching test case" ) << "\n" << std::endl; - return matchedTests; - } - - inline std::size_t listTestsNamesOnly( Config const& config ) { - TestSpec testSpec = config.testSpec(); - if( !config.testSpec().hasFilters() ) - testSpec = TestSpecParser( ITagAliasRegistry::get() ).parse( "*" ).testSpec(); - std::size_t matchedTests = 0; - std::vector matchedTestCases = filterTests( getAllTestCasesSorted( config ), testSpec, config ); - for( std::vector::const_iterator it = matchedTestCases.begin(), itEnd = matchedTestCases.end(); - it != itEnd; - ++it ) { - matchedTests++; - TestCaseInfo const& testCaseInfo = it->getTestCaseInfo(); - if( startsWith( testCaseInfo.name, "#" ) ) - Catch::cout() << "\"" << testCaseInfo.name << "\"" << std::endl; - else - Catch::cout() << testCaseInfo.name << std::endl; - } - return matchedTests; - } - - struct TagInfo { - TagInfo() : count ( 0 ) {} - void add( std::string const& spelling ) { - ++count; - spellings.insert( spelling ); - } - std::string all() const { - std::string out; - for( std::set::const_iterator it = spellings.begin(), itEnd = spellings.end(); - it != itEnd; - ++it ) - out += "[" + *it + "]"; - return out; - } - std::set spellings; - std::size_t count; - }; - - inline std::size_t listTags( Config const& config ) { - TestSpec testSpec = config.testSpec(); - if( config.testSpec().hasFilters() ) - Catch::cout() << "Tags for matching test cases:\n"; - else { - Catch::cout() << "All available tags:\n"; - testSpec = TestSpecParser( ITagAliasRegistry::get() ).parse( "*" ).testSpec(); - } - - std::map tagCounts; - - std::vector matchedTestCases = filterTests( getAllTestCasesSorted( config ), testSpec, config ); - for( std::vector::const_iterator it = matchedTestCases.begin(), itEnd = matchedTestCases.end(); - it != itEnd; - ++it ) { - for( std::set::const_iterator tagIt = it->getTestCaseInfo().tags.begin(), - tagItEnd = it->getTestCaseInfo().tags.end(); - tagIt != tagItEnd; - ++tagIt ) { - std::string tagName = *tagIt; - std::string lcaseTagName = toLower( tagName ); - std::map::iterator countIt = tagCounts.find( lcaseTagName ); - if( countIt == tagCounts.end() ) - countIt = tagCounts.insert( std::make_pair( lcaseTagName, TagInfo() ) ).first; - countIt->second.add( tagName ); - } - } - - for( std::map::const_iterator countIt = tagCounts.begin(), - countItEnd = tagCounts.end(); - countIt != countItEnd; - ++countIt ) { - std::ostringstream oss; - oss << " " << std::setw(2) << countIt->second.count << " "; - Text wrapper( countIt->second.all(), TextAttributes() - .setInitialIndent( 0 ) - .setIndent( oss.str().size() ) - .setWidth( CATCH_CONFIG_CONSOLE_WIDTH-10 ) ); - Catch::cout() << oss.str() << wrapper << "\n"; - } - Catch::cout() << pluralise( tagCounts.size(), "tag" ) << "\n" << std::endl; - return tagCounts.size(); - } - - inline std::size_t listReporters( Config const& /*config*/ ) { - Catch::cout() << "Available reporters:\n"; - IReporterRegistry::FactoryMap const& factories = getRegistryHub().getReporterRegistry().getFactories(); - IReporterRegistry::FactoryMap::const_iterator itBegin = factories.begin(), itEnd = factories.end(), it; - std::size_t maxNameLen = 0; - for(it = itBegin; it != itEnd; ++it ) - maxNameLen = (std::max)( maxNameLen, it->first.size() ); - - for(it = itBegin; it != itEnd; ++it ) { - Text wrapper( it->second->getDescription(), TextAttributes() - .setInitialIndent( 0 ) - .setIndent( 7+maxNameLen ) - .setWidth( CATCH_CONFIG_CONSOLE_WIDTH - maxNameLen-8 ) ); - Catch::cout() << " " - << it->first - << ":" - << std::string( maxNameLen - it->first.size() + 2, ' ' ) - << wrapper << "\n"; - } - Catch::cout() << std::endl; - return factories.size(); - } - - inline Option list( Config const& config ) { - Option listedCount; - if( config.listTests() ) - listedCount = listedCount.valueOr(0) + listTests( config ); - if( config.listTestNamesOnly() ) - listedCount = listedCount.valueOr(0) + listTestsNamesOnly( config ); - if( config.listTags() ) - listedCount = listedCount.valueOr(0) + listTags( config ); - if( config.listReporters() ) - listedCount = listedCount.valueOr(0) + listReporters( config ); - return listedCount; - } - -} // end namespace Catch - -// #included from: internal/catch_run_context.hpp -#define TWOBLUECUBES_CATCH_RUNNER_IMPL_HPP_INCLUDED - -// #included from: catch_test_case_tracker.hpp -#define TWOBLUECUBES_CATCH_TEST_CASE_TRACKER_HPP_INCLUDED - -#include -#include -#include -#include - -namespace Catch { -namespace TestCaseTracking { - - struct ITracker : SharedImpl<> { - virtual ~ITracker(); - - // static queries - virtual std::string name() const = 0; - - // dynamic queries - virtual bool isComplete() const = 0; // Successfully completed or failed - virtual bool isSuccessfullyCompleted() const = 0; - virtual bool isOpen() const = 0; // Started but not complete - virtual bool hasChildren() const = 0; - - virtual ITracker& parent() = 0; - - // actions - virtual void close() = 0; // Successfully complete - virtual void fail() = 0; - virtual void markAsNeedingAnotherRun() = 0; - - virtual void addChild( Ptr const& child ) = 0; - virtual ITracker* findChild( std::string const& name ) = 0; - virtual void openChild() = 0; - - // Debug/ checking - virtual bool isSectionTracker() const = 0; - virtual bool isIndexTracker() const = 0; - }; - - class TrackerContext { - - enum RunState { - NotStarted, - Executing, - CompletedCycle - }; - - Ptr m_rootTracker; - ITracker* m_currentTracker; - RunState m_runState; - - public: - - static TrackerContext& instance() { - static TrackerContext s_instance; - return s_instance; - } - - TrackerContext() - : m_currentTracker( CATCH_NULL ), - m_runState( NotStarted ) - {} - - ITracker& startRun(); - - void endRun() { - m_rootTracker.reset(); - m_currentTracker = CATCH_NULL; - m_runState = NotStarted; - } - - void startCycle() { - m_currentTracker = m_rootTracker.get(); - m_runState = Executing; - } - void completeCycle() { - m_runState = CompletedCycle; - } - - bool completedCycle() const { - return m_runState == CompletedCycle; - } - ITracker& currentTracker() { - return *m_currentTracker; - } - void setCurrentTracker( ITracker* tracker ) { - m_currentTracker = tracker; - } - }; - - class TrackerBase : public ITracker { - protected: - enum CycleState { - NotStarted, - Executing, - ExecutingChildren, - NeedsAnotherRun, - CompletedSuccessfully, - Failed - }; - class TrackerHasName { - std::string m_name; - public: - TrackerHasName( std::string const& name ) : m_name( name ) {} - bool operator ()( Ptr const& tracker ) { - return tracker->name() == m_name; - } - }; - typedef std::vector > Children; - std::string m_name; - TrackerContext& m_ctx; - ITracker* m_parent; - Children m_children; - CycleState m_runState; - public: - TrackerBase( std::string const& name, TrackerContext& ctx, ITracker* parent ) - : m_name( name ), - m_ctx( ctx ), - m_parent( parent ), - m_runState( NotStarted ) - {} - virtual ~TrackerBase(); - - virtual std::string name() const CATCH_OVERRIDE { - return m_name; - } - virtual bool isComplete() const CATCH_OVERRIDE { - return m_runState == CompletedSuccessfully || m_runState == Failed; - } - virtual bool isSuccessfullyCompleted() const CATCH_OVERRIDE { - return m_runState == CompletedSuccessfully; - } - virtual bool isOpen() const CATCH_OVERRIDE { - return m_runState != NotStarted && !isComplete(); - } - virtual bool hasChildren() const CATCH_OVERRIDE { - return !m_children.empty(); - } - - virtual void addChild( Ptr const& child ) CATCH_OVERRIDE { - m_children.push_back( child ); - } - - virtual ITracker* findChild( std::string const& name ) CATCH_OVERRIDE { - Children::const_iterator it = std::find_if( m_children.begin(), m_children.end(), TrackerHasName( name ) ); - return( it != m_children.end() ) - ? it->get() - : CATCH_NULL; - } - virtual ITracker& parent() CATCH_OVERRIDE { - assert( m_parent ); // Should always be non-null except for root - return *m_parent; - } - - virtual void openChild() CATCH_OVERRIDE { - if( m_runState != ExecutingChildren ) { - m_runState = ExecutingChildren; - if( m_parent ) - m_parent->openChild(); - } - } - - virtual bool isSectionTracker() const CATCH_OVERRIDE { return false; } - virtual bool isIndexTracker() const CATCH_OVERRIDE { return false; } - - void open() { - m_runState = Executing; - moveToThis(); - if( m_parent ) - m_parent->openChild(); - } - - virtual void close() CATCH_OVERRIDE { - - // Close any still open children (e.g. generators) - while( &m_ctx.currentTracker() != this ) - m_ctx.currentTracker().close(); - - switch( m_runState ) { - case NotStarted: - case CompletedSuccessfully: - case Failed: - throw std::logic_error( "Illogical state" ); - - case NeedsAnotherRun: - break;; - - case Executing: - m_runState = CompletedSuccessfully; - break; - case ExecutingChildren: - if( m_children.empty() || m_children.back()->isComplete() ) - m_runState = CompletedSuccessfully; - break; - - default: - throw std::logic_error( "Unexpected state" ); - } - moveToParent(); - m_ctx.completeCycle(); - } - virtual void fail() CATCH_OVERRIDE { - m_runState = Failed; - if( m_parent ) - m_parent->markAsNeedingAnotherRun(); - moveToParent(); - m_ctx.completeCycle(); - } - virtual void markAsNeedingAnotherRun() CATCH_OVERRIDE { - m_runState = NeedsAnotherRun; - } - private: - void moveToParent() { - assert( m_parent ); - m_ctx.setCurrentTracker( m_parent ); - } - void moveToThis() { - m_ctx.setCurrentTracker( this ); - } - }; - - class SectionTracker : public TrackerBase { - public: - SectionTracker( std::string const& name, TrackerContext& ctx, ITracker* parent ) - : TrackerBase( name, ctx, parent ) - {} - virtual ~SectionTracker(); - - virtual bool isSectionTracker() const CATCH_OVERRIDE { return true; } - - static SectionTracker& acquire( TrackerContext& ctx, std::string const& name ) { - SectionTracker* section = CATCH_NULL; - - ITracker& currentTracker = ctx.currentTracker(); - if( ITracker* childTracker = currentTracker.findChild( name ) ) { - assert( childTracker ); - assert( childTracker->isSectionTracker() ); - section = static_cast( childTracker ); - } - else { - section = new SectionTracker( name, ctx, ¤tTracker ); - currentTracker.addChild( section ); - } - if( !ctx.completedCycle() && !section->isComplete() ) { - - section->open(); - } - return *section; - } - }; - - class IndexTracker : public TrackerBase { - int m_size; - int m_index; - public: - IndexTracker( std::string const& name, TrackerContext& ctx, ITracker* parent, int size ) - : TrackerBase( name, ctx, parent ), - m_size( size ), - m_index( -1 ) - {} - virtual ~IndexTracker(); - - virtual bool isIndexTracker() const CATCH_OVERRIDE { return true; } - - static IndexTracker& acquire( TrackerContext& ctx, std::string const& name, int size ) { - IndexTracker* tracker = CATCH_NULL; - - ITracker& currentTracker = ctx.currentTracker(); - if( ITracker* childTracker = currentTracker.findChild( name ) ) { - assert( childTracker ); - assert( childTracker->isIndexTracker() ); - tracker = static_cast( childTracker ); - } - else { - tracker = new IndexTracker( name, ctx, ¤tTracker, size ); - currentTracker.addChild( tracker ); - } - - if( !ctx.completedCycle() && !tracker->isComplete() ) { - if( tracker->m_runState != ExecutingChildren && tracker->m_runState != NeedsAnotherRun ) - tracker->moveNext(); - tracker->open(); - } - - return *tracker; - } - - int index() const { return m_index; } - - void moveNext() { - m_index++; - m_children.clear(); - } - - virtual void close() CATCH_OVERRIDE { - TrackerBase::close(); - if( m_runState == CompletedSuccessfully && m_index < m_size-1 ) - m_runState = Executing; - } - }; - - inline ITracker& TrackerContext::startRun() { - m_rootTracker = new SectionTracker( "{root}", *this, CATCH_NULL ); - m_currentTracker = CATCH_NULL; - m_runState = Executing; - return *m_rootTracker; - } - -} // namespace TestCaseTracking - -using TestCaseTracking::ITracker; -using TestCaseTracking::TrackerContext; -using TestCaseTracking::SectionTracker; -using TestCaseTracking::IndexTracker; - -} // namespace Catch - -// #included from: catch_fatal_condition.hpp -#define TWOBLUECUBES_CATCH_FATAL_CONDITION_H_INCLUDED - -namespace Catch { - - // Report the error condition then exit the process - inline void fatal( std::string const& message, int exitCode ) { - IContext& context = Catch::getCurrentContext(); - IResultCapture* resultCapture = context.getResultCapture(); - resultCapture->handleFatalErrorCondition( message ); - - if( Catch::alwaysTrue() ) // avoids "no return" warnings - exit( exitCode ); - } - -} // namespace Catch - -#if defined ( CATCH_PLATFORM_WINDOWS ) ///////////////////////////////////////// - -namespace Catch { - - struct FatalConditionHandler { - void reset() {} - }; - -} // namespace Catch - -#else // Not Windows - assumed to be POSIX compatible ////////////////////////// - -#include - -namespace Catch { - - struct SignalDefs { int id; const char* name; }; - extern SignalDefs signalDefs[]; - SignalDefs signalDefs[] = { - { SIGINT, "SIGINT - Terminal interrupt signal" }, - { SIGILL, "SIGILL - Illegal instruction signal" }, - { SIGFPE, "SIGFPE - Floating point error signal" }, - { SIGSEGV, "SIGSEGV - Segmentation violation signal" }, - { SIGTERM, "SIGTERM - Termination request signal" }, - { SIGABRT, "SIGABRT - Abort (abnormal termination) signal" } - }; - - struct FatalConditionHandler { - - static void handleSignal( int sig ) { - for( std::size_t i = 0; i < sizeof(signalDefs)/sizeof(SignalDefs); ++i ) - if( sig == signalDefs[i].id ) - fatal( signalDefs[i].name, -sig ); - fatal( "", -sig ); - } - - FatalConditionHandler() : m_isSet( true ) { - for( std::size_t i = 0; i < sizeof(signalDefs)/sizeof(SignalDefs); ++i ) - signal( signalDefs[i].id, handleSignal ); - } - ~FatalConditionHandler() { - reset(); - } - void reset() { - if( m_isSet ) { - for( std::size_t i = 0; i < sizeof(signalDefs)/sizeof(SignalDefs); ++i ) - signal( signalDefs[i].id, SIG_DFL ); - m_isSet = false; - } - } - - bool m_isSet; - }; - -} // namespace Catch - -#endif // not Windows - -#include -#include - -namespace Catch { - - class StreamRedirect { - - public: - StreamRedirect( std::ostream& stream, std::string& targetString ) - : m_stream( stream ), - m_prevBuf( stream.rdbuf() ), - m_targetString( targetString ) - { - stream.rdbuf( m_oss.rdbuf() ); - } - - ~StreamRedirect() { - m_targetString += m_oss.str(); - m_stream.rdbuf( m_prevBuf ); - } - - private: - std::ostream& m_stream; - std::streambuf* m_prevBuf; - std::ostringstream m_oss; - std::string& m_targetString; - }; - - /////////////////////////////////////////////////////////////////////////// - - class RunContext : public IResultCapture, public IRunner { - - RunContext( RunContext const& ); - void operator =( RunContext const& ); - - public: - - explicit RunContext( Ptr const& _config, Ptr const& reporter ) - : m_runInfo( _config->name() ), - m_context( getCurrentMutableContext() ), - m_activeTestCase( CATCH_NULL ), - m_config( _config ), - m_reporter( reporter ) - { - m_context.setRunner( this ); - m_context.setConfig( m_config ); - m_context.setResultCapture( this ); - m_reporter->testRunStarting( m_runInfo ); - } - - virtual ~RunContext() { - m_reporter->testRunEnded( TestRunStats( m_runInfo, m_totals, aborting() ) ); - } - - void testGroupStarting( std::string const& testSpec, std::size_t groupIndex, std::size_t groupsCount ) { - m_reporter->testGroupStarting( GroupInfo( testSpec, groupIndex, groupsCount ) ); - } - void testGroupEnded( std::string const& testSpec, Totals const& totals, std::size_t groupIndex, std::size_t groupsCount ) { - m_reporter->testGroupEnded( TestGroupStats( GroupInfo( testSpec, groupIndex, groupsCount ), totals, aborting() ) ); - } - - Totals runTest( TestCase const& testCase ) { - Totals prevTotals = m_totals; - - std::string redirectedCout; - std::string redirectedCerr; - - TestCaseInfo testInfo = testCase.getTestCaseInfo(); - - m_reporter->testCaseStarting( testInfo ); - - m_activeTestCase = &testCase; - - do { - m_trackerContext.startRun(); - do { - m_trackerContext.startCycle(); - m_testCaseTracker = &SectionTracker::acquire( m_trackerContext, testInfo.name ); - runCurrentTest( redirectedCout, redirectedCerr ); - } - while( !m_testCaseTracker->isSuccessfullyCompleted() && !aborting() ); - } - // !TBD: deprecated - this will be replaced by indexed trackers - while( getCurrentContext().advanceGeneratorsForCurrentTest() && !aborting() ); - - Totals deltaTotals = m_totals.delta( prevTotals ); - if( testInfo.expectedToFail() && deltaTotals.testCases.passed > 0 ) { - deltaTotals.assertions.failed++; - deltaTotals.testCases.passed--; - deltaTotals.testCases.failed++; - } - m_totals.testCases += deltaTotals.testCases; - m_reporter->testCaseEnded( TestCaseStats( testInfo, - deltaTotals, - redirectedCout, - redirectedCerr, - aborting() ) ); - - m_activeTestCase = CATCH_NULL; - m_testCaseTracker = CATCH_NULL; - - return deltaTotals; - } - - Ptr config() const { - return m_config; - } - - private: // IResultCapture - - virtual void assertionEnded( AssertionResult const& result ) { - if( result.getResultType() == ResultWas::Ok ) { - m_totals.assertions.passed++; - } - else if( !result.isOk() ) { - m_totals.assertions.failed++; - } - - if( m_reporter->assertionEnded( AssertionStats( result, m_messages, m_totals ) ) ) - m_messages.clear(); - - // Reset working state - m_lastAssertionInfo = AssertionInfo( "", m_lastAssertionInfo.lineInfo, "{Unknown expression after the reported line}" , m_lastAssertionInfo.resultDisposition ); - m_lastResult = result; - } - - virtual bool sectionStarted ( - SectionInfo const& sectionInfo, - Counts& assertions - ) - { - std::ostringstream oss; - oss << sectionInfo.name << "@" << sectionInfo.lineInfo; - - ITracker& sectionTracker = SectionTracker::acquire( m_trackerContext, oss.str() ); - if( !sectionTracker.isOpen() ) - return false; - m_activeSections.push_back( §ionTracker ); - - m_lastAssertionInfo.lineInfo = sectionInfo.lineInfo; - - m_reporter->sectionStarting( sectionInfo ); - - assertions = m_totals.assertions; - - return true; - } - bool testForMissingAssertions( Counts& assertions ) { - if( assertions.total() != 0 ) - return false; - if( !m_config->warnAboutMissingAssertions() ) - return false; - if( m_trackerContext.currentTracker().hasChildren() ) - return false; - m_totals.assertions.failed++; - assertions.failed++; - return true; - } - - virtual void sectionEnded( SectionEndInfo const& endInfo ) { - Counts assertions = m_totals.assertions - endInfo.prevAssertions; - bool missingAssertions = testForMissingAssertions( assertions ); - - if( !m_activeSections.empty() ) { - m_activeSections.back()->close(); - m_activeSections.pop_back(); - } - - m_reporter->sectionEnded( SectionStats( endInfo.sectionInfo, assertions, endInfo.durationInSeconds, missingAssertions ) ); - m_messages.clear(); - } - - virtual void sectionEndedEarly( SectionEndInfo const& endInfo ) { - if( m_unfinishedSections.empty() ) - m_activeSections.back()->fail(); - else - m_activeSections.back()->close(); - m_activeSections.pop_back(); - - m_unfinishedSections.push_back( endInfo ); - } - - virtual void pushScopedMessage( MessageInfo const& message ) { - m_messages.push_back( message ); - } - - virtual void popScopedMessage( MessageInfo const& message ) { - m_messages.erase( std::remove( m_messages.begin(), m_messages.end(), message ), m_messages.end() ); - } - - virtual std::string getCurrentTestName() const { - return m_activeTestCase - ? m_activeTestCase->getTestCaseInfo().name - : ""; - } - - virtual const AssertionResult* getLastResult() const { - return &m_lastResult; - } - - virtual void handleFatalErrorCondition( std::string const& message ) { - ResultBuilder resultBuilder = makeUnexpectedResultBuilder(); - resultBuilder.setResultType( ResultWas::FatalErrorCondition ); - resultBuilder << message; - resultBuilder.captureExpression(); - - handleUnfinishedSections(); - - // Recreate section for test case (as we will lose the one that was in scope) - TestCaseInfo const& testCaseInfo = m_activeTestCase->getTestCaseInfo(); - SectionInfo testCaseSection( testCaseInfo.lineInfo, testCaseInfo.name, testCaseInfo.description ); - - Counts assertions; - assertions.failed = 1; - SectionStats testCaseSectionStats( testCaseSection, assertions, 0, false ); - m_reporter->sectionEnded( testCaseSectionStats ); - - TestCaseInfo testInfo = m_activeTestCase->getTestCaseInfo(); - - Totals deltaTotals; - deltaTotals.testCases.failed = 1; - m_reporter->testCaseEnded( TestCaseStats( testInfo, - deltaTotals, - "", - "", - false ) ); - m_totals.testCases.failed++; - testGroupEnded( "", m_totals, 1, 1 ); - m_reporter->testRunEnded( TestRunStats( m_runInfo, m_totals, false ) ); - } - - public: - // !TBD We need to do this another way! - bool aborting() const { - return m_totals.assertions.failed == static_cast( m_config->abortAfter() ); - } - - private: - - void runCurrentTest( std::string& redirectedCout, std::string& redirectedCerr ) { - TestCaseInfo const& testCaseInfo = m_activeTestCase->getTestCaseInfo(); - SectionInfo testCaseSection( testCaseInfo.lineInfo, testCaseInfo.name, testCaseInfo.description ); - m_reporter->sectionStarting( testCaseSection ); - Counts prevAssertions = m_totals.assertions; - double duration = 0; - try { - m_lastAssertionInfo = AssertionInfo( "TEST_CASE", testCaseInfo.lineInfo, "", ResultDisposition::Normal ); - - seedRng( *m_config ); - - Timer timer; - timer.start(); - if( m_reporter->getPreferences().shouldRedirectStdOut ) { - StreamRedirect coutRedir( Catch::cout(), redirectedCout ); - StreamRedirect cerrRedir( Catch::cerr(), redirectedCerr ); - invokeActiveTestCase(); - } - else { - invokeActiveTestCase(); - } - duration = timer.getElapsedSeconds(); - } - catch( TestFailureException& ) { - // This just means the test was aborted due to failure - } - catch(...) { - makeUnexpectedResultBuilder().useActiveException(); - } - m_testCaseTracker->close(); - handleUnfinishedSections(); - m_messages.clear(); - - Counts assertions = m_totals.assertions - prevAssertions; - bool missingAssertions = testForMissingAssertions( assertions ); - - if( testCaseInfo.okToFail() ) { - std::swap( assertions.failedButOk, assertions.failed ); - m_totals.assertions.failed -= assertions.failedButOk; - m_totals.assertions.failedButOk += assertions.failedButOk; - } - - SectionStats testCaseSectionStats( testCaseSection, assertions, duration, missingAssertions ); - m_reporter->sectionEnded( testCaseSectionStats ); - } - - void invokeActiveTestCase() { - FatalConditionHandler fatalConditionHandler; // Handle signals - m_activeTestCase->invoke(); - fatalConditionHandler.reset(); - } - - private: - - ResultBuilder makeUnexpectedResultBuilder() const { - return ResultBuilder( m_lastAssertionInfo.macroName.c_str(), - m_lastAssertionInfo.lineInfo, - m_lastAssertionInfo.capturedExpression.c_str(), - m_lastAssertionInfo.resultDisposition ); - } - - void handleUnfinishedSections() { - // If sections ended prematurely due to an exception we stored their - // infos here so we can tear them down outside the unwind process. - for( std::vector::const_reverse_iterator it = m_unfinishedSections.rbegin(), - itEnd = m_unfinishedSections.rend(); - it != itEnd; - ++it ) - sectionEnded( *it ); - m_unfinishedSections.clear(); - } - - TestRunInfo m_runInfo; - IMutableContext& m_context; - TestCase const* m_activeTestCase; - ITracker* m_testCaseTracker; - ITracker* m_currentSectionTracker; - AssertionResult m_lastResult; - - Ptr m_config; - Totals m_totals; - Ptr m_reporter; - std::vector m_messages; - AssertionInfo m_lastAssertionInfo; - std::vector m_unfinishedSections; - std::vector m_activeSections; - TrackerContext m_trackerContext; - }; - - IResultCapture& getResultCapture() { - if( IResultCapture* capture = getCurrentContext().getResultCapture() ) - return *capture; - else - throw std::logic_error( "No result capture instance" ); - } - -} // end namespace Catch - -// #included from: internal/catch_version.h -#define TWOBLUECUBES_CATCH_VERSION_H_INCLUDED - -namespace Catch { - - // Versioning information - struct Version { - Version( unsigned int _majorVersion, - unsigned int _minorVersion, - unsigned int _patchNumber, - std::string const& _branchName, - unsigned int _buildNumber ); - - unsigned int const majorVersion; - unsigned int const minorVersion; - unsigned int const patchNumber; - - // buildNumber is only used if branchName is not null - std::string const branchName; - unsigned int const buildNumber; - - friend std::ostream& operator << ( std::ostream& os, Version const& version ); - - private: - void operator=( Version const& ); - }; - - extern Version libraryVersion; -} - -#include -#include -#include - -namespace Catch { - - Ptr createReporter( std::string const& reporterName, Ptr const& config ) { - Ptr reporter = getRegistryHub().getReporterRegistry().create( reporterName, config.get() ); - if( !reporter ) { - std::ostringstream oss; - oss << "No reporter registered with name: '" << reporterName << "'"; - throw std::domain_error( oss.str() ); - } - return reporter; - } - - Ptr makeReporter( Ptr const& config ) { - std::vector reporters = config->getReporterNames(); - if( reporters.empty() ) - reporters.push_back( "console" ); - - Ptr reporter; - for( std::vector::const_iterator it = reporters.begin(), itEnd = reporters.end(); - it != itEnd; - ++it ) - reporter = addReporter( reporter, createReporter( *it, config ) ); - return reporter; - } - Ptr addListeners( Ptr const& config, Ptr reporters ) { - IReporterRegistry::Listeners listeners = getRegistryHub().getReporterRegistry().getListeners(); - for( IReporterRegistry::Listeners::const_iterator it = listeners.begin(), itEnd = listeners.end(); - it != itEnd; - ++it ) - reporters = addReporter(reporters, (*it)->create( ReporterConfig( config ) ) ); - return reporters; - } - - Totals runTests( Ptr const& config ) { - - Ptr iconfig = config.get(); - - Ptr reporter = makeReporter( config ); - reporter = addListeners( iconfig, reporter ); - - RunContext context( iconfig, reporter ); - - Totals totals; - - context.testGroupStarting( config->name(), 1, 1 ); - - TestSpec testSpec = config->testSpec(); - if( !testSpec.hasFilters() ) - testSpec = TestSpecParser( ITagAliasRegistry::get() ).parse( "~[.]" ).testSpec(); // All not hidden tests - - std::vector const& allTestCases = getAllTestCasesSorted( *iconfig ); - for( std::vector::const_iterator it = allTestCases.begin(), itEnd = allTestCases.end(); - it != itEnd; - ++it ) { - if( !context.aborting() && matchTest( *it, testSpec, *iconfig ) ) - totals += context.runTest( *it ); - else - reporter->skipTest( *it ); - } - - context.testGroupEnded( iconfig->name(), totals, 1, 1 ); - return totals; - } - - void applyFilenamesAsTags( IConfig const& config ) { - std::vector const& tests = getAllTestCasesSorted( config ); - for(std::size_t i = 0; i < tests.size(); ++i ) { - TestCase& test = const_cast( tests[i] ); - std::set tags = test.tags; - - std::string filename = test.lineInfo.file; - std::string::size_type lastSlash = filename.find_last_of( "\\/" ); - if( lastSlash != std::string::npos ) - filename = filename.substr( lastSlash+1 ); - - std::string::size_type lastDot = filename.find_last_of( "." ); - if( lastDot != std::string::npos ) - filename = filename.substr( 0, lastDot ); - - tags.insert( "#" + filename ); - setTags( test, tags ); - } - } - - class Session : NonCopyable { - static bool alreadyInstantiated; - - public: - - struct OnUnusedOptions { enum DoWhat { Ignore, Fail }; }; - - Session() - : m_cli( makeCommandLineParser() ) { - if( alreadyInstantiated ) { - std::string msg = "Only one instance of Catch::Session can ever be used"; - Catch::cerr() << msg << std::endl; - throw std::logic_error( msg ); - } - alreadyInstantiated = true; - } - ~Session() { - Catch::cleanUp(); - } - - void showHelp( std::string const& processName ) { - Catch::cout() << "\nCatch v" << libraryVersion << "\n"; - - m_cli.usage( Catch::cout(), processName ); - Catch::cout() << "For more detail usage please see the project docs\n" << std::endl; - } - - int applyCommandLine( int argc, char const* const* const argv, OnUnusedOptions::DoWhat unusedOptionBehaviour = OnUnusedOptions::Fail ) { - try { - m_cli.setThrowOnUnrecognisedTokens( unusedOptionBehaviour == OnUnusedOptions::Fail ); - m_unusedTokens = m_cli.parseInto( Clara::argsToVector( argc, argv ), m_configData ); - if( m_configData.showHelp ) - showHelp( m_configData.processName ); - m_config.reset(); - } - catch( std::exception& ex ) { - { - Colour colourGuard( Colour::Red ); - Catch::cerr() - << "\nError(s) in input:\n" - << Text( ex.what(), TextAttributes().setIndent(2) ) - << "\n\n"; - } - m_cli.usage( Catch::cout(), m_configData.processName ); - return (std::numeric_limits::max)(); - } - return 0; - } - - void useConfigData( ConfigData const& _configData ) { - m_configData = _configData; - m_config.reset(); - } - - int run( int argc, char const* const* const argv ) { - - int returnCode = applyCommandLine( argc, argv ); - if( returnCode == 0 ) - returnCode = run(); - return returnCode; - } - - int run() { - if( m_configData.showHelp ) - return 0; - - try - { - config(); // Force config to be constructed - - seedRng( *m_config ); - - if( m_configData.filenamesAsTags ) - applyFilenamesAsTags( *m_config ); - - // Handle list request - if( Option listed = list( config() ) ) - return static_cast( *listed ); - - return static_cast( runTests( m_config ).assertions.failed ); - } - catch( std::exception& ex ) { - Catch::cerr() << ex.what() << std::endl; - return (std::numeric_limits::max)(); - } - } - - Clara::CommandLine const& cli() const { - return m_cli; - } - std::vector const& unusedTokens() const { - return m_unusedTokens; - } - ConfigData& configData() { - return m_configData; - } - Config& config() { - if( !m_config ) - m_config = new Config( m_configData ); - return *m_config; - } - private: - Clara::CommandLine m_cli; - std::vector m_unusedTokens; - ConfigData m_configData; - Ptr m_config; - }; - - bool Session::alreadyInstantiated = false; - -} // end namespace Catch - -// #included from: catch_registry_hub.hpp -#define TWOBLUECUBES_CATCH_REGISTRY_HUB_HPP_INCLUDED - -// #included from: catch_test_case_registry_impl.hpp -#define TWOBLUECUBES_CATCH_TEST_CASE_REGISTRY_IMPL_HPP_INCLUDED - -#include -#include -#include -#include -#include - -#ifdef CATCH_CPP14_OR_GREATER -#include -#endif - -namespace Catch { - - struct RandomNumberGenerator { - typedef int result_type; - - result_type operator()( result_type n ) const { return std::rand() % n; } - -#ifdef CATCH_CPP14_OR_GREATER - static constexpr result_type min() { return 0; } - static constexpr result_type max() { return 1000000; } - result_type operator()() const { return std::rand() % max(); } -#endif - template - static void shuffle( V& vector ) { - RandomNumberGenerator rng; -#ifdef CATCH_CPP14_OR_GREATER - std::shuffle( vector.begin(), vector.end(), rng ); -#else - std::random_shuffle( vector.begin(), vector.end(), rng ); -#endif - } - }; - - inline std::vector sortTests( IConfig const& config, std::vector const& unsortedTestCases ) { - - std::vector sorted = unsortedTestCases; - - switch( config.runOrder() ) { - case RunTests::InLexicographicalOrder: - std::sort( sorted.begin(), sorted.end() ); - break; - case RunTests::InRandomOrder: - { - seedRng( config ); - RandomNumberGenerator::shuffle( sorted ); - } - break; - case RunTests::InDeclarationOrder: - // already in declaration order - break; - } - return sorted; - } - bool matchTest( TestCase const& testCase, TestSpec const& testSpec, IConfig const& config ) { - return testSpec.matches( testCase ) && ( config.allowThrows() || !testCase.throws() ); - } - - void enforceNoDuplicateTestCases( std::vector const& functions ) { - std::set seenFunctions; - for( std::vector::const_iterator it = functions.begin(), itEnd = functions.end(); - it != itEnd; - ++it ) { - std::pair::const_iterator, bool> prev = seenFunctions.insert( *it ); - if( !prev.second ) { - std::ostringstream ss; - - ss << Colour( Colour::Red ) - << "error: TEST_CASE( \"" << it->name << "\" ) already defined.\n" - << "\tFirst seen at " << prev.first->getTestCaseInfo().lineInfo << "\n" - << "\tRedefined at " << it->getTestCaseInfo().lineInfo << std::endl; - - throw std::runtime_error(ss.str()); - } - } - } - - std::vector filterTests( std::vector const& testCases, TestSpec const& testSpec, IConfig const& config ) { - std::vector filtered; - filtered.reserve( testCases.size() ); - for( std::vector::const_iterator it = testCases.begin(), itEnd = testCases.end(); - it != itEnd; - ++it ) - if( matchTest( *it, testSpec, config ) ) - filtered.push_back( *it ); - return filtered; - } - std::vector const& getAllTestCasesSorted( IConfig const& config ) { - return getRegistryHub().getTestCaseRegistry().getAllTestsSorted( config ); - } - - class TestRegistry : public ITestCaseRegistry { - public: - TestRegistry() - : m_currentSortOrder( RunTests::InDeclarationOrder ), - m_unnamedCount( 0 ) - {} - virtual ~TestRegistry(); - - virtual void registerTest( TestCase const& testCase ) { - std::string name = testCase.getTestCaseInfo().name; - if( name == "" ) { - std::ostringstream oss; - oss << "Anonymous test case " << ++m_unnamedCount; - return registerTest( testCase.withName( oss.str() ) ); - } - m_functions.push_back( testCase ); - } - - virtual std::vector const& getAllTests() const { - return m_functions; - } - virtual std::vector const& getAllTestsSorted( IConfig const& config ) const { - if( m_sortedFunctions.empty() ) - enforceNoDuplicateTestCases( m_functions ); - - if( m_currentSortOrder != config.runOrder() || m_sortedFunctions.empty() ) { - m_sortedFunctions = sortTests( config, m_functions ); - m_currentSortOrder = config.runOrder(); - } - return m_sortedFunctions; - } - - private: - std::vector m_functions; - mutable RunTests::InWhatOrder m_currentSortOrder; - mutable std::vector m_sortedFunctions; - size_t m_unnamedCount; - std::ios_base::Init m_ostreamInit; // Forces cout/ cerr to be initialised - }; - - /////////////////////////////////////////////////////////////////////////// - - class FreeFunctionTestCase : public SharedImpl { - public: - - FreeFunctionTestCase( TestFunction fun ) : m_fun( fun ) {} - - virtual void invoke() const { - m_fun(); - } - - private: - virtual ~FreeFunctionTestCase(); - - TestFunction m_fun; - }; - - inline std::string extractClassName( std::string const& classOrQualifiedMethodName ) { - std::string className = classOrQualifiedMethodName; - if( startsWith( className, "&" ) ) - { - std::size_t lastColons = className.rfind( "::" ); - std::size_t penultimateColons = className.rfind( "::", lastColons-1 ); - if( penultimateColons == std::string::npos ) - penultimateColons = 1; - className = className.substr( penultimateColons, lastColons-penultimateColons ); - } - return className; - } - - void registerTestCase - ( ITestCase* testCase, - char const* classOrQualifiedMethodName, - NameAndDesc const& nameAndDesc, - SourceLineInfo const& lineInfo ) { - - getMutableRegistryHub().registerTest - ( makeTestCase - ( testCase, - extractClassName( classOrQualifiedMethodName ), - nameAndDesc.name, - nameAndDesc.description, - lineInfo ) ); - } - void registerTestCaseFunction - ( TestFunction function, - SourceLineInfo const& lineInfo, - NameAndDesc const& nameAndDesc ) { - registerTestCase( new FreeFunctionTestCase( function ), "", nameAndDesc, lineInfo ); - } - - /////////////////////////////////////////////////////////////////////////// - - AutoReg::AutoReg - ( TestFunction function, - SourceLineInfo const& lineInfo, - NameAndDesc const& nameAndDesc ) { - registerTestCaseFunction( function, lineInfo, nameAndDesc ); - } - - AutoReg::~AutoReg() {} - -} // end namespace Catch - -// #included from: catch_reporter_registry.hpp -#define TWOBLUECUBES_CATCH_REPORTER_REGISTRY_HPP_INCLUDED - -#include - -namespace Catch { - - class ReporterRegistry : public IReporterRegistry { - - public: - - virtual ~ReporterRegistry() CATCH_OVERRIDE {} - - virtual IStreamingReporter* create( std::string const& name, Ptr const& config ) const CATCH_OVERRIDE { - FactoryMap::const_iterator it = m_factories.find( name ); - if( it == m_factories.end() ) - return CATCH_NULL; - return it->second->create( ReporterConfig( config ) ); - } - - void registerReporter( std::string const& name, Ptr const& factory ) { - m_factories.insert( std::make_pair( name, factory ) ); - } - void registerListener( Ptr const& factory ) { - m_listeners.push_back( factory ); - } - - virtual FactoryMap const& getFactories() const CATCH_OVERRIDE { - return m_factories; - } - virtual Listeners const& getListeners() const CATCH_OVERRIDE { - return m_listeners; - } - - private: - FactoryMap m_factories; - Listeners m_listeners; - }; -} - -// #included from: catch_exception_translator_registry.hpp -#define TWOBLUECUBES_CATCH_EXCEPTION_TRANSLATOR_REGISTRY_HPP_INCLUDED - -#ifdef __OBJC__ -#import "Foundation/Foundation.h" -#endif - -namespace Catch { - - class ExceptionTranslatorRegistry : public IExceptionTranslatorRegistry { - public: - ~ExceptionTranslatorRegistry() { - deleteAll( m_translators ); - } - - virtual void registerTranslator( const IExceptionTranslator* translator ) { - m_translators.push_back( translator ); - } - - virtual std::string translateActiveException() const { - try { -#ifdef __OBJC__ - // In Objective-C try objective-c exceptions first - @try { - return tryTranslators(); - } - @catch (NSException *exception) { - return Catch::toString( [exception description] ); - } -#else - return tryTranslators(); -#endif - } - catch( TestFailureException& ) { - throw; - } - catch( std::exception& ex ) { - return ex.what(); - } - catch( std::string& msg ) { - return msg; - } - catch( const char* msg ) { - return msg; - } - catch(...) { - return "Unknown exception"; - } - } - - std::string tryTranslators() const { - if( m_translators.empty() ) - throw; - else - return m_translators[0]->translate( m_translators.begin()+1, m_translators.end() ); - } - - private: - std::vector m_translators; - }; -} - -namespace Catch { - - namespace { - - class RegistryHub : public IRegistryHub, public IMutableRegistryHub { - - RegistryHub( RegistryHub const& ); - void operator=( RegistryHub const& ); - - public: // IRegistryHub - RegistryHub() { - } - virtual IReporterRegistry const& getReporterRegistry() const CATCH_OVERRIDE { - return m_reporterRegistry; - } - virtual ITestCaseRegistry const& getTestCaseRegistry() const CATCH_OVERRIDE { - return m_testCaseRegistry; - } - virtual IExceptionTranslatorRegistry& getExceptionTranslatorRegistry() CATCH_OVERRIDE { - return m_exceptionTranslatorRegistry; - } - - public: // IMutableRegistryHub - virtual void registerReporter( std::string const& name, Ptr const& factory ) CATCH_OVERRIDE { - m_reporterRegistry.registerReporter( name, factory ); - } - virtual void registerListener( Ptr const& factory ) CATCH_OVERRIDE { - m_reporterRegistry.registerListener( factory ); - } - virtual void registerTest( TestCase const& testInfo ) CATCH_OVERRIDE { - m_testCaseRegistry.registerTest( testInfo ); - } - virtual void registerTranslator( const IExceptionTranslator* translator ) CATCH_OVERRIDE { - m_exceptionTranslatorRegistry.registerTranslator( translator ); - } - - private: - TestRegistry m_testCaseRegistry; - ReporterRegistry m_reporterRegistry; - ExceptionTranslatorRegistry m_exceptionTranslatorRegistry; - }; - - // Single, global, instance - inline RegistryHub*& getTheRegistryHub() { - static RegistryHub* theRegistryHub = CATCH_NULL; - if( !theRegistryHub ) - theRegistryHub = new RegistryHub(); - return theRegistryHub; - } - } - - IRegistryHub& getRegistryHub() { - return *getTheRegistryHub(); - } - IMutableRegistryHub& getMutableRegistryHub() { - return *getTheRegistryHub(); - } - void cleanUp() { - delete getTheRegistryHub(); - getTheRegistryHub() = CATCH_NULL; - cleanUpContext(); - } - std::string translateActiveException() { - return getRegistryHub().getExceptionTranslatorRegistry().translateActiveException(); - } - -} // end namespace Catch - -// #included from: catch_notimplemented_exception.hpp -#define TWOBLUECUBES_CATCH_NOTIMPLEMENTED_EXCEPTION_HPP_INCLUDED - -#include - -namespace Catch { - - NotImplementedException::NotImplementedException( SourceLineInfo const& lineInfo ) - : m_lineInfo( lineInfo ) { - std::ostringstream oss; - oss << lineInfo << ": function "; - oss << "not implemented"; - m_what = oss.str(); - } - - const char* NotImplementedException::what() const CATCH_NOEXCEPT { - return m_what.c_str(); - } - -} // end namespace Catch - -// #included from: catch_context_impl.hpp -#define TWOBLUECUBES_CATCH_CONTEXT_IMPL_HPP_INCLUDED - -// #included from: catch_stream.hpp -#define TWOBLUECUBES_CATCH_STREAM_HPP_INCLUDED - -#include -#include -#include - -namespace Catch { - - template - class StreamBufImpl : public StreamBufBase { - char data[bufferSize]; - WriterF m_writer; - - public: - StreamBufImpl() { - setp( data, data + sizeof(data) ); - } - - ~StreamBufImpl() CATCH_NOEXCEPT { - sync(); - } - - private: - int overflow( int c ) { - sync(); - - if( c != EOF ) { - if( pbase() == epptr() ) - m_writer( std::string( 1, static_cast( c ) ) ); - else - sputc( static_cast( c ) ); - } - return 0; - } - - int sync() { - if( pbase() != pptr() ) { - m_writer( std::string( pbase(), static_cast( pptr() - pbase() ) ) ); - setp( pbase(), epptr() ); - } - return 0; - } - }; - - /////////////////////////////////////////////////////////////////////////// - - FileStream::FileStream( std::string const& filename ) { - m_ofs.open( filename.c_str() ); - if( m_ofs.fail() ) { - std::ostringstream oss; - oss << "Unable to open file: '" << filename << "'"; - throw std::domain_error( oss.str() ); - } - } - - std::ostream& FileStream::stream() const { - return m_ofs; - } - - struct OutputDebugWriter { - - void operator()( std::string const&str ) { - writeToDebugConsole( str ); - } - }; - - DebugOutStream::DebugOutStream() - : m_streamBuf( new StreamBufImpl() ), - m_os( m_streamBuf.get() ) - {} - - std::ostream& DebugOutStream::stream() const { - return m_os; - } - - // Store the streambuf from cout up-front because - // cout may get redirected when running tests - CoutStream::CoutStream() - : m_os( Catch::cout().rdbuf() ) - {} - - std::ostream& CoutStream::stream() const { - return m_os; - } - -#ifndef CATCH_CONFIG_NOSTDOUT // If you #define this you must implement these functions - std::ostream& cout() { - return std::cout; - } - std::ostream& cerr() { - return std::cerr; - } -#endif -} - -namespace Catch { - - class Context : public IMutableContext { - - Context() : m_config( CATCH_NULL ), m_runner( CATCH_NULL ), m_resultCapture( CATCH_NULL ) {} - Context( Context const& ); - void operator=( Context const& ); - - public: // IContext - virtual IResultCapture* getResultCapture() { - return m_resultCapture; - } - virtual IRunner* getRunner() { - return m_runner; - } - virtual size_t getGeneratorIndex( std::string const& fileInfo, size_t totalSize ) { - return getGeneratorsForCurrentTest() - .getGeneratorInfo( fileInfo, totalSize ) - .getCurrentIndex(); - } - virtual bool advanceGeneratorsForCurrentTest() { - IGeneratorsForTest* generators = findGeneratorsForCurrentTest(); - return generators && generators->moveNext(); - } - - virtual Ptr getConfig() const { - return m_config; - } - - public: // IMutableContext - virtual void setResultCapture( IResultCapture* resultCapture ) { - m_resultCapture = resultCapture; - } - virtual void setRunner( IRunner* runner ) { - m_runner = runner; - } - virtual void setConfig( Ptr const& config ) { - m_config = config; - } - - friend IMutableContext& getCurrentMutableContext(); - - private: - IGeneratorsForTest* findGeneratorsForCurrentTest() { - std::string testName = getResultCapture()->getCurrentTestName(); - - std::map::const_iterator it = - m_generatorsByTestName.find( testName ); - return it != m_generatorsByTestName.end() - ? it->second - : CATCH_NULL; - } - - IGeneratorsForTest& getGeneratorsForCurrentTest() { - IGeneratorsForTest* generators = findGeneratorsForCurrentTest(); - if( !generators ) { - std::string testName = getResultCapture()->getCurrentTestName(); - generators = createGeneratorsForTest(); - m_generatorsByTestName.insert( std::make_pair( testName, generators ) ); - } - return *generators; - } - - private: - Ptr m_config; - IRunner* m_runner; - IResultCapture* m_resultCapture; - std::map m_generatorsByTestName; - }; - - namespace { - Context* currentContext = CATCH_NULL; - } - IMutableContext& getCurrentMutableContext() { - if( !currentContext ) - currentContext = new Context(); - return *currentContext; - } - IContext& getCurrentContext() { - return getCurrentMutableContext(); - } - - void cleanUpContext() { - delete currentContext; - currentContext = CATCH_NULL; - } -} - -// #included from: catch_console_colour_impl.hpp -#define TWOBLUECUBES_CATCH_CONSOLE_COLOUR_IMPL_HPP_INCLUDED - -namespace Catch { - namespace { - - struct IColourImpl { - virtual ~IColourImpl() {} - virtual void use( Colour::Code _colourCode ) = 0; - }; - - struct NoColourImpl : IColourImpl { - void use( Colour::Code ) {} - - static IColourImpl* instance() { - static NoColourImpl s_instance; - return &s_instance; - } - }; - - } // anon namespace -} // namespace Catch - -#if !defined( CATCH_CONFIG_COLOUR_NONE ) && !defined( CATCH_CONFIG_COLOUR_WINDOWS ) && !defined( CATCH_CONFIG_COLOUR_ANSI ) -# ifdef CATCH_PLATFORM_WINDOWS -# define CATCH_CONFIG_COLOUR_WINDOWS -# else -# define CATCH_CONFIG_COLOUR_ANSI -# endif -#endif - -#if defined ( CATCH_CONFIG_COLOUR_WINDOWS ) ///////////////////////////////////////// - -#ifndef NOMINMAX -#define NOMINMAX -#endif - -#ifdef __AFXDLL -#include -#else -#include -#endif - -namespace Catch { -namespace { - - class Win32ColourImpl : public IColourImpl { - public: - Win32ColourImpl() : stdoutHandle( GetStdHandle(STD_OUTPUT_HANDLE) ) - { - CONSOLE_SCREEN_BUFFER_INFO csbiInfo; - GetConsoleScreenBufferInfo( stdoutHandle, &csbiInfo ); - originalForegroundAttributes = csbiInfo.wAttributes & ~( BACKGROUND_GREEN | BACKGROUND_RED | BACKGROUND_BLUE | BACKGROUND_INTENSITY ); - originalBackgroundAttributes = csbiInfo.wAttributes & ~( FOREGROUND_GREEN | FOREGROUND_RED | FOREGROUND_BLUE | FOREGROUND_INTENSITY ); - } - - virtual void use( Colour::Code _colourCode ) { - switch( _colourCode ) { - case Colour::None: return setTextAttribute( originalForegroundAttributes ); - case Colour::White: return setTextAttribute( FOREGROUND_GREEN | FOREGROUND_RED | FOREGROUND_BLUE ); - case Colour::Red: return setTextAttribute( FOREGROUND_RED ); - case Colour::Green: return setTextAttribute( FOREGROUND_GREEN ); - case Colour::Blue: return setTextAttribute( FOREGROUND_BLUE ); - case Colour::Cyan: return setTextAttribute( FOREGROUND_BLUE | FOREGROUND_GREEN ); - case Colour::Yellow: return setTextAttribute( FOREGROUND_RED | FOREGROUND_GREEN ); - case Colour::Grey: return setTextAttribute( 0 ); - - case Colour::LightGrey: return setTextAttribute( FOREGROUND_INTENSITY ); - case Colour::BrightRed: return setTextAttribute( FOREGROUND_INTENSITY | FOREGROUND_RED ); - case Colour::BrightGreen: return setTextAttribute( FOREGROUND_INTENSITY | FOREGROUND_GREEN ); - case Colour::BrightWhite: return setTextAttribute( FOREGROUND_INTENSITY | FOREGROUND_GREEN | FOREGROUND_RED | FOREGROUND_BLUE ); - - case Colour::Bright: throw std::logic_error( "not a colour" ); - } - } - - private: - void setTextAttribute( WORD _textAttribute ) { - SetConsoleTextAttribute( stdoutHandle, _textAttribute | originalBackgroundAttributes ); - } - HANDLE stdoutHandle; - WORD originalForegroundAttributes; - WORD originalBackgroundAttributes; - }; - - IColourImpl* platformColourInstance() { - static Win32ColourImpl s_instance; - - Ptr config = getCurrentContext().getConfig(); - UseColour::YesOrNo colourMode = config - ? config->useColour() - : UseColour::Auto; - if( colourMode == UseColour::Auto ) - colourMode = !isDebuggerActive() - ? UseColour::Yes - : UseColour::No; - return colourMode == UseColour::Yes - ? &s_instance - : NoColourImpl::instance(); - } - -} // end anon namespace -} // end namespace Catch - -#elif defined( CATCH_CONFIG_COLOUR_ANSI ) ////////////////////////////////////// - -#include - -namespace Catch { -namespace { - - // use POSIX/ ANSI console terminal codes - // Thanks to Adam Strzelecki for original contribution - // (http://github.com/nanoant) - // https://github.com/philsquared/Catch/pull/131 - class PosixColourImpl : public IColourImpl { - public: - virtual void use( Colour::Code _colourCode ) { - switch( _colourCode ) { - case Colour::None: - case Colour::White: return setColour( "[0m" ); - case Colour::Red: return setColour( "[0;31m" ); - case Colour::Green: return setColour( "[0;32m" ); - case Colour::Blue: return setColour( "[0:34m" ); - case Colour::Cyan: return setColour( "[0;36m" ); - case Colour::Yellow: return setColour( "[0;33m" ); - case Colour::Grey: return setColour( "[1;30m" ); - - case Colour::LightGrey: return setColour( "[0;37m" ); - case Colour::BrightRed: return setColour( "[1;31m" ); - case Colour::BrightGreen: return setColour( "[1;32m" ); - case Colour::BrightWhite: return setColour( "[1;37m" ); - - case Colour::Bright: throw std::logic_error( "not a colour" ); - } - } - static IColourImpl* instance() { - static PosixColourImpl s_instance; - return &s_instance; - } - - private: - void setColour( const char* _escapeCode ) { - Catch::cout() << '\033' << _escapeCode; - } - }; - - IColourImpl* platformColourInstance() { - Ptr config = getCurrentContext().getConfig(); - UseColour::YesOrNo colourMode = config - ? config->useColour() - : UseColour::Auto; - if( colourMode == UseColour::Auto ) - colourMode = (!isDebuggerActive() && isatty(STDOUT_FILENO) ) - ? UseColour::Yes - : UseColour::No; - return colourMode == UseColour::Yes - ? PosixColourImpl::instance() - : NoColourImpl::instance(); - } - -} // end anon namespace -} // end namespace Catch - -#else // not Windows or ANSI /////////////////////////////////////////////// - -namespace Catch { - - static IColourImpl* platformColourInstance() { return NoColourImpl::instance(); } - -} // end namespace Catch - -#endif // Windows/ ANSI/ None - -namespace Catch { - - Colour::Colour( Code _colourCode ) : m_moved( false ) { use( _colourCode ); } - Colour::Colour( Colour const& _other ) : m_moved( false ) { const_cast( _other ).m_moved = true; } - Colour::~Colour(){ if( !m_moved ) use( None ); } - - void Colour::use( Code _colourCode ) { - static IColourImpl* impl = platformColourInstance(); - impl->use( _colourCode ); - } - -} // end namespace Catch - -// #included from: catch_generators_impl.hpp -#define TWOBLUECUBES_CATCH_GENERATORS_IMPL_HPP_INCLUDED - -#include -#include -#include - -namespace Catch { - - struct GeneratorInfo : IGeneratorInfo { - - GeneratorInfo( std::size_t size ) - : m_size( size ), - m_currentIndex( 0 ) - {} - - bool moveNext() { - if( ++m_currentIndex == m_size ) { - m_currentIndex = 0; - return false; - } - return true; - } - - std::size_t getCurrentIndex() const { - return m_currentIndex; - } - - std::size_t m_size; - std::size_t m_currentIndex; - }; - - /////////////////////////////////////////////////////////////////////////// - - class GeneratorsForTest : public IGeneratorsForTest { - - public: - ~GeneratorsForTest() { - deleteAll( m_generatorsInOrder ); - } - - IGeneratorInfo& getGeneratorInfo( std::string const& fileInfo, std::size_t size ) { - std::map::const_iterator it = m_generatorsByName.find( fileInfo ); - if( it == m_generatorsByName.end() ) { - IGeneratorInfo* info = new GeneratorInfo( size ); - m_generatorsByName.insert( std::make_pair( fileInfo, info ) ); - m_generatorsInOrder.push_back( info ); - return *info; - } - return *it->second; - } - - bool moveNext() { - std::vector::const_iterator it = m_generatorsInOrder.begin(); - std::vector::const_iterator itEnd = m_generatorsInOrder.end(); - for(; it != itEnd; ++it ) { - if( (*it)->moveNext() ) - return true; - } - return false; - } - - private: - std::map m_generatorsByName; - std::vector m_generatorsInOrder; - }; - - IGeneratorsForTest* createGeneratorsForTest() - { - return new GeneratorsForTest(); - } - -} // end namespace Catch - -// #included from: catch_assertionresult.hpp -#define TWOBLUECUBES_CATCH_ASSERTIONRESULT_HPP_INCLUDED - -namespace Catch { - - AssertionInfo::AssertionInfo( std::string const& _macroName, - SourceLineInfo const& _lineInfo, - std::string const& _capturedExpression, - ResultDisposition::Flags _resultDisposition ) - : macroName( _macroName ), - lineInfo( _lineInfo ), - capturedExpression( _capturedExpression ), - resultDisposition( _resultDisposition ) - {} - - AssertionResult::AssertionResult() {} - - AssertionResult::AssertionResult( AssertionInfo const& info, AssertionResultData const& data ) - : m_info( info ), - m_resultData( data ) - {} - - AssertionResult::~AssertionResult() {} - - // Result was a success - bool AssertionResult::succeeded() const { - return Catch::isOk( m_resultData.resultType ); - } - - // Result was a success, or failure is suppressed - bool AssertionResult::isOk() const { - return Catch::isOk( m_resultData.resultType ) || shouldSuppressFailure( m_info.resultDisposition ); - } - - ResultWas::OfType AssertionResult::getResultType() const { - return m_resultData.resultType; - } - - bool AssertionResult::hasExpression() const { - return !m_info.capturedExpression.empty(); - } - - bool AssertionResult::hasMessage() const { - return !m_resultData.message.empty(); - } - - std::string AssertionResult::getExpression() const { - if( isFalseTest( m_info.resultDisposition ) ) - return "!" + m_info.capturedExpression; - else - return m_info.capturedExpression; - } - std::string AssertionResult::getExpressionInMacro() const { - if( m_info.macroName.empty() ) - return m_info.capturedExpression; - else - return m_info.macroName + "( " + m_info.capturedExpression + " )"; - } - - bool AssertionResult::hasExpandedExpression() const { - return hasExpression() && getExpandedExpression() != getExpression(); - } - - std::string AssertionResult::getExpandedExpression() const { - return m_resultData.reconstructedExpression; - } - - std::string AssertionResult::getMessage() const { - return m_resultData.message; - } - SourceLineInfo AssertionResult::getSourceInfo() const { - return m_info.lineInfo; - } - - std::string AssertionResult::getTestMacroName() const { - return m_info.macroName; - } - -} // end namespace Catch - -// #included from: catch_test_case_info.hpp -#define TWOBLUECUBES_CATCH_TEST_CASE_INFO_HPP_INCLUDED - -namespace Catch { - - inline TestCaseInfo::SpecialProperties parseSpecialTag( std::string const& tag ) { - if( startsWith( tag, "." ) || - tag == "hide" || - tag == "!hide" ) - return TestCaseInfo::IsHidden; - else if( tag == "!throws" ) - return TestCaseInfo::Throws; - else if( tag == "!shouldfail" ) - return TestCaseInfo::ShouldFail; - else if( tag == "!mayfail" ) - return TestCaseInfo::MayFail; - else - return TestCaseInfo::None; - } - inline bool isReservedTag( std::string const& tag ) { - return parseSpecialTag( tag ) == TestCaseInfo::None && tag.size() > 0 && !isalnum( tag[0] ); - } - inline void enforceNotReservedTag( std::string const& tag, SourceLineInfo const& _lineInfo ) { - if( isReservedTag( tag ) ) { - { - Colour colourGuard( Colour::Red ); - Catch::cerr() - << "Tag name [" << tag << "] not allowed.\n" - << "Tag names starting with non alpha-numeric characters are reserved\n"; - } - { - Colour colourGuard( Colour::FileName ); - Catch::cerr() << _lineInfo << std::endl; - } - exit(1); - } - } - - TestCase makeTestCase( ITestCase* _testCase, - std::string const& _className, - std::string const& _name, - std::string const& _descOrTags, - SourceLineInfo const& _lineInfo ) - { - bool isHidden( startsWith( _name, "./" ) ); // Legacy support - - // Parse out tags - std::set tags; - std::string desc, tag; - bool inTag = false; - for( std::size_t i = 0; i < _descOrTags.size(); ++i ) { - char c = _descOrTags[i]; - if( !inTag ) { - if( c == '[' ) - inTag = true; - else - desc += c; - } - else { - if( c == ']' ) { - TestCaseInfo::SpecialProperties prop = parseSpecialTag( tag ); - if( prop == TestCaseInfo::IsHidden ) - isHidden = true; - else if( prop == TestCaseInfo::None ) - enforceNotReservedTag( tag, _lineInfo ); - - tags.insert( tag ); - tag.clear(); - inTag = false; - } - else - tag += c; - } - } - if( isHidden ) { - tags.insert( "hide" ); - tags.insert( "." ); - } - - TestCaseInfo info( _name, _className, desc, tags, _lineInfo ); - return TestCase( _testCase, info ); - } - - void setTags( TestCaseInfo& testCaseInfo, std::set const& tags ) - { - testCaseInfo.tags = tags; - testCaseInfo.lcaseTags.clear(); - - std::ostringstream oss; - for( std::set::const_iterator it = tags.begin(), itEnd = tags.end(); it != itEnd; ++it ) { - oss << "[" << *it << "]"; - std::string lcaseTag = toLower( *it ); - testCaseInfo.properties = static_cast( testCaseInfo.properties | parseSpecialTag( lcaseTag ) ); - testCaseInfo.lcaseTags.insert( lcaseTag ); - } - testCaseInfo.tagsAsString = oss.str(); - } - - TestCaseInfo::TestCaseInfo( std::string const& _name, - std::string const& _className, - std::string const& _description, - std::set const& _tags, - SourceLineInfo const& _lineInfo ) - : name( _name ), - className( _className ), - description( _description ), - lineInfo( _lineInfo ), - properties( None ) - { - setTags( *this, _tags ); - } - - TestCaseInfo::TestCaseInfo( TestCaseInfo const& other ) - : name( other.name ), - className( other.className ), - description( other.description ), - tags( other.tags ), - lcaseTags( other.lcaseTags ), - tagsAsString( other.tagsAsString ), - lineInfo( other.lineInfo ), - properties( other.properties ) - {} - - bool TestCaseInfo::isHidden() const { - return ( properties & IsHidden ) != 0; - } - bool TestCaseInfo::throws() const { - return ( properties & Throws ) != 0; - } - bool TestCaseInfo::okToFail() const { - return ( properties & (ShouldFail | MayFail ) ) != 0; - } - bool TestCaseInfo::expectedToFail() const { - return ( properties & (ShouldFail ) ) != 0; - } - - TestCase::TestCase( ITestCase* testCase, TestCaseInfo const& info ) : TestCaseInfo( info ), test( testCase ) {} - - TestCase::TestCase( TestCase const& other ) - : TestCaseInfo( other ), - test( other.test ) - {} - - TestCase TestCase::withName( std::string const& _newName ) const { - TestCase other( *this ); - other.name = _newName; - return other; - } - - void TestCase::swap( TestCase& other ) { - test.swap( other.test ); - name.swap( other.name ); - className.swap( other.className ); - description.swap( other.description ); - tags.swap( other.tags ); - lcaseTags.swap( other.lcaseTags ); - tagsAsString.swap( other.tagsAsString ); - std::swap( TestCaseInfo::properties, static_cast( other ).properties ); - std::swap( lineInfo, other.lineInfo ); - } - - void TestCase::invoke() const { - test->invoke(); - } - - bool TestCase::operator == ( TestCase const& other ) const { - return test.get() == other.test.get() && - name == other.name && - className == other.className; - } - - bool TestCase::operator < ( TestCase const& other ) const { - return name < other.name; - } - TestCase& TestCase::operator = ( TestCase const& other ) { - TestCase temp( other ); - swap( temp ); - return *this; - } - - TestCaseInfo const& TestCase::getTestCaseInfo() const - { - return *this; - } - -} // end namespace Catch - -// #included from: catch_version.hpp -#define TWOBLUECUBES_CATCH_VERSION_HPP_INCLUDED - -namespace Catch { - - Version::Version - ( unsigned int _majorVersion, - unsigned int _minorVersion, - unsigned int _patchNumber, - std::string const& _branchName, - unsigned int _buildNumber ) - : majorVersion( _majorVersion ), - minorVersion( _minorVersion ), - patchNumber( _patchNumber ), - branchName( _branchName ), - buildNumber( _buildNumber ) - {} - - std::ostream& operator << ( std::ostream& os, Version const& version ) { - os << version.majorVersion << "." - << version.minorVersion << "." - << version.patchNumber; - - if( !version.branchName.empty() ) { - os << "-" << version.branchName - << "." << version.buildNumber; - } - return os; - } - - Version libraryVersion( 1, 5, 7, "", 0 ); - -} - -// #included from: catch_message.hpp -#define TWOBLUECUBES_CATCH_MESSAGE_HPP_INCLUDED - -namespace Catch { - - MessageInfo::MessageInfo( std::string const& _macroName, - SourceLineInfo const& _lineInfo, - ResultWas::OfType _type ) - : macroName( _macroName ), - lineInfo( _lineInfo ), - type( _type ), - sequence( ++globalCount ) - {} - - // This may need protecting if threading support is added - unsigned int MessageInfo::globalCount = 0; - - //////////////////////////////////////////////////////////////////////////// - - ScopedMessage::ScopedMessage( MessageBuilder const& builder ) - : m_info( builder.m_info ) - { - m_info.message = builder.m_stream.str(); - getResultCapture().pushScopedMessage( m_info ); - } - ScopedMessage::ScopedMessage( ScopedMessage const& other ) - : m_info( other.m_info ) - {} - - ScopedMessage::~ScopedMessage() { - getResultCapture().popScopedMessage( m_info ); - } - -} // end namespace Catch - -// #included from: catch_legacy_reporter_adapter.hpp -#define TWOBLUECUBES_CATCH_LEGACY_REPORTER_ADAPTER_HPP_INCLUDED - -// #included from: catch_legacy_reporter_adapter.h -#define TWOBLUECUBES_CATCH_LEGACY_REPORTER_ADAPTER_H_INCLUDED - -namespace Catch -{ - // Deprecated - struct IReporter : IShared { - virtual ~IReporter(); - - virtual bool shouldRedirectStdout() const = 0; - - virtual void StartTesting() = 0; - virtual void EndTesting( Totals const& totals ) = 0; - virtual void StartGroup( std::string const& groupName ) = 0; - virtual void EndGroup( std::string const& groupName, Totals const& totals ) = 0; - virtual void StartTestCase( TestCaseInfo const& testInfo ) = 0; - virtual void EndTestCase( TestCaseInfo const& testInfo, Totals const& totals, std::string const& stdOut, std::string const& stdErr ) = 0; - virtual void StartSection( std::string const& sectionName, std::string const& description ) = 0; - virtual void EndSection( std::string const& sectionName, Counts const& assertions ) = 0; - virtual void NoAssertionsInSection( std::string const& sectionName ) = 0; - virtual void NoAssertionsInTestCase( std::string const& testName ) = 0; - virtual void Aborted() = 0; - virtual void Result( AssertionResult const& result ) = 0; - }; - - class LegacyReporterAdapter : public SharedImpl - { - public: - LegacyReporterAdapter( Ptr const& legacyReporter ); - virtual ~LegacyReporterAdapter(); - - virtual ReporterPreferences getPreferences() const; - virtual void noMatchingTestCases( std::string const& ); - virtual void testRunStarting( TestRunInfo const& ); - virtual void testGroupStarting( GroupInfo const& groupInfo ); - virtual void testCaseStarting( TestCaseInfo const& testInfo ); - virtual void sectionStarting( SectionInfo const& sectionInfo ); - virtual void assertionStarting( AssertionInfo const& ); - virtual bool assertionEnded( AssertionStats const& assertionStats ); - virtual void sectionEnded( SectionStats const& sectionStats ); - virtual void testCaseEnded( TestCaseStats const& testCaseStats ); - virtual void testGroupEnded( TestGroupStats const& testGroupStats ); - virtual void testRunEnded( TestRunStats const& testRunStats ); - virtual void skipTest( TestCaseInfo const& ); - - private: - Ptr m_legacyReporter; - }; -} - -namespace Catch -{ - LegacyReporterAdapter::LegacyReporterAdapter( Ptr const& legacyReporter ) - : m_legacyReporter( legacyReporter ) - {} - LegacyReporterAdapter::~LegacyReporterAdapter() {} - - ReporterPreferences LegacyReporterAdapter::getPreferences() const { - ReporterPreferences prefs; - prefs.shouldRedirectStdOut = m_legacyReporter->shouldRedirectStdout(); - return prefs; - } - - void LegacyReporterAdapter::noMatchingTestCases( std::string const& ) {} - void LegacyReporterAdapter::testRunStarting( TestRunInfo const& ) { - m_legacyReporter->StartTesting(); - } - void LegacyReporterAdapter::testGroupStarting( GroupInfo const& groupInfo ) { - m_legacyReporter->StartGroup( groupInfo.name ); - } - void LegacyReporterAdapter::testCaseStarting( TestCaseInfo const& testInfo ) { - m_legacyReporter->StartTestCase( testInfo ); - } - void LegacyReporterAdapter::sectionStarting( SectionInfo const& sectionInfo ) { - m_legacyReporter->StartSection( sectionInfo.name, sectionInfo.description ); - } - void LegacyReporterAdapter::assertionStarting( AssertionInfo const& ) { - // Not on legacy interface - } - - bool LegacyReporterAdapter::assertionEnded( AssertionStats const& assertionStats ) { - if( assertionStats.assertionResult.getResultType() != ResultWas::Ok ) { - for( std::vector::const_iterator it = assertionStats.infoMessages.begin(), itEnd = assertionStats.infoMessages.end(); - it != itEnd; - ++it ) { - if( it->type == ResultWas::Info ) { - ResultBuilder rb( it->macroName.c_str(), it->lineInfo, "", ResultDisposition::Normal ); - rb << it->message; - rb.setResultType( ResultWas::Info ); - AssertionResult result = rb.build(); - m_legacyReporter->Result( result ); - } - } - } - m_legacyReporter->Result( assertionStats.assertionResult ); - return true; - } - void LegacyReporterAdapter::sectionEnded( SectionStats const& sectionStats ) { - if( sectionStats.missingAssertions ) - m_legacyReporter->NoAssertionsInSection( sectionStats.sectionInfo.name ); - m_legacyReporter->EndSection( sectionStats.sectionInfo.name, sectionStats.assertions ); - } - void LegacyReporterAdapter::testCaseEnded( TestCaseStats const& testCaseStats ) { - m_legacyReporter->EndTestCase - ( testCaseStats.testInfo, - testCaseStats.totals, - testCaseStats.stdOut, - testCaseStats.stdErr ); - } - void LegacyReporterAdapter::testGroupEnded( TestGroupStats const& testGroupStats ) { - if( testGroupStats.aborting ) - m_legacyReporter->Aborted(); - m_legacyReporter->EndGroup( testGroupStats.groupInfo.name, testGroupStats.totals ); - } - void LegacyReporterAdapter::testRunEnded( TestRunStats const& testRunStats ) { - m_legacyReporter->EndTesting( testRunStats.totals ); - } - void LegacyReporterAdapter::skipTest( TestCaseInfo const& ) { - } -} - -// #included from: catch_timer.hpp - -#ifdef __clang__ -#pragma clang diagnostic push -#pragma clang diagnostic ignored "-Wc++11-long-long" -#endif - -#ifdef CATCH_PLATFORM_WINDOWS -#include -#else -#include -#endif - -namespace Catch { - - namespace { -#ifdef CATCH_PLATFORM_WINDOWS - uint64_t getCurrentTicks() { - static uint64_t hz=0, hzo=0; - if (!hz) { - QueryPerformanceFrequency( reinterpret_cast( &hz ) ); - QueryPerformanceCounter( reinterpret_cast( &hzo ) ); - } - uint64_t t; - QueryPerformanceCounter( reinterpret_cast( &t ) ); - return ((t-hzo)*1000000)/hz; - } -#else - uint64_t getCurrentTicks() { - timeval t; - gettimeofday(&t,CATCH_NULL); - return static_cast( t.tv_sec ) * 1000000ull + static_cast( t.tv_usec ); - } -#endif - } - - void Timer::start() { - m_ticks = getCurrentTicks(); - } - unsigned int Timer::getElapsedMicroseconds() const { - return static_cast(getCurrentTicks() - m_ticks); - } - unsigned int Timer::getElapsedMilliseconds() const { - return static_cast(getElapsedMicroseconds()/1000); - } - double Timer::getElapsedSeconds() const { - return getElapsedMicroseconds()/1000000.0; - } - -} // namespace Catch - -#ifdef __clang__ -#pragma clang diagnostic pop -#endif -// #included from: catch_common.hpp -#define TWOBLUECUBES_CATCH_COMMON_HPP_INCLUDED - -namespace Catch { - - bool startsWith( std::string const& s, std::string const& prefix ) { - return s.size() >= prefix.size() && s.substr( 0, prefix.size() ) == prefix; - } - bool endsWith( std::string const& s, std::string const& suffix ) { - return s.size() >= suffix.size() && s.substr( s.size()-suffix.size(), suffix.size() ) == suffix; - } - bool contains( std::string const& s, std::string const& infix ) { - return s.find( infix ) != std::string::npos; - } - void toLowerInPlace( std::string& s ) { - std::transform( s.begin(), s.end(), s.begin(), ::tolower ); - } - std::string toLower( std::string const& s ) { - std::string lc = s; - toLowerInPlace( lc ); - return lc; - } - std::string trim( std::string const& str ) { - static char const* whitespaceChars = "\n\r\t "; - std::string::size_type start = str.find_first_not_of( whitespaceChars ); - std::string::size_type end = str.find_last_not_of( whitespaceChars ); - - return start != std::string::npos ? str.substr( start, 1+end-start ) : ""; - } - - bool replaceInPlace( std::string& str, std::string const& replaceThis, std::string const& withThis ) { - bool replaced = false; - std::size_t i = str.find( replaceThis ); - while( i != std::string::npos ) { - replaced = true; - str = str.substr( 0, i ) + withThis + str.substr( i+replaceThis.size() ); - if( i < str.size()-withThis.size() ) - i = str.find( replaceThis, i+withThis.size() ); - else - i = std::string::npos; - } - return replaced; - } - - pluralise::pluralise( std::size_t count, std::string const& label ) - : m_count( count ), - m_label( label ) - {} - - std::ostream& operator << ( std::ostream& os, pluralise const& pluraliser ) { - os << pluraliser.m_count << " " << pluraliser.m_label; - if( pluraliser.m_count != 1 ) - os << "s"; - return os; - } - - SourceLineInfo::SourceLineInfo() : line( 0 ){} - SourceLineInfo::SourceLineInfo( char const* _file, std::size_t _line ) - : file( _file ), - line( _line ) - {} - SourceLineInfo::SourceLineInfo( SourceLineInfo const& other ) - : file( other.file ), - line( other.line ) - {} - bool SourceLineInfo::empty() const { - return file.empty(); - } - bool SourceLineInfo::operator == ( SourceLineInfo const& other ) const { - return line == other.line && file == other.file; - } - bool SourceLineInfo::operator < ( SourceLineInfo const& other ) const { - return line < other.line || ( line == other.line && file < other.file ); - } - - void seedRng( IConfig const& config ) { - if( config.rngSeed() != 0 ) - std::srand( config.rngSeed() ); - } - unsigned int rngSeed() { - return getCurrentContext().getConfig()->rngSeed(); - } - - std::ostream& operator << ( std::ostream& os, SourceLineInfo const& info ) { -#ifndef __GNUG__ - os << info.file << "(" << info.line << ")"; -#else - os << info.file << ":" << info.line; -#endif - return os; - } - - void throwLogicError( std::string const& message, SourceLineInfo const& locationInfo ) { - std::ostringstream oss; - oss << locationInfo << ": Internal Catch error: '" << message << "'"; - if( alwaysTrue() ) - throw std::logic_error( oss.str() ); - } -} - -// #included from: catch_section.hpp -#define TWOBLUECUBES_CATCH_SECTION_HPP_INCLUDED - -namespace Catch { - - SectionInfo::SectionInfo - ( SourceLineInfo const& _lineInfo, - std::string const& _name, - std::string const& _description ) - : name( _name ), - description( _description ), - lineInfo( _lineInfo ) - {} - - Section::Section( SectionInfo const& info ) - : m_info( info ), - m_sectionIncluded( getResultCapture().sectionStarted( m_info, m_assertions ) ) - { - m_timer.start(); - } - - Section::~Section() { - if( m_sectionIncluded ) { - SectionEndInfo endInfo( m_info, m_assertions, m_timer.getElapsedSeconds() ); - if( std::uncaught_exception() ) - getResultCapture().sectionEndedEarly( endInfo ); - else - getResultCapture().sectionEnded( endInfo ); - } - } - - // This indicates whether the section should be executed or not - Section::operator bool() const { - return m_sectionIncluded; - } - -} // end namespace Catch - -// #included from: catch_debugger.hpp -#define TWOBLUECUBES_CATCH_DEBUGGER_HPP_INCLUDED - -#include - -#ifdef CATCH_PLATFORM_MAC - - #include - #include - #include - #include - #include - - namespace Catch{ - - // The following function is taken directly from the following technical note: - // http://developer.apple.com/library/mac/#qa/qa2004/qa1361.html - - // Returns true if the current process is being debugged (either - // running under the debugger or has a debugger attached post facto). - bool isDebuggerActive(){ - - int mib[4]; - struct kinfo_proc info; - size_t size; - - // Initialize the flags so that, if sysctl fails for some bizarre - // reason, we get a predictable result. - - info.kp_proc.p_flag = 0; - - // Initialize mib, which tells sysctl the info we want, in this case - // we're looking for information about a specific process ID. - - mib[0] = CTL_KERN; - mib[1] = KERN_PROC; - mib[2] = KERN_PROC_PID; - mib[3] = getpid(); - - // Call sysctl. - - size = sizeof(info); - if( sysctl(mib, sizeof(mib) / sizeof(*mib), &info, &size, CATCH_NULL, 0) != 0 ) { - Catch::cerr() << "\n** Call to sysctl failed - unable to determine if debugger is active **\n" << std::endl; - return false; - } - - // We're being debugged if the P_TRACED flag is set. - - return ( (info.kp_proc.p_flag & P_TRACED) != 0 ); - } - } // namespace Catch - -#elif defined(_MSC_VER) - extern "C" __declspec(dllimport) int __stdcall IsDebuggerPresent(); - namespace Catch { - bool isDebuggerActive() { - return IsDebuggerPresent() != 0; - } - } -#elif defined(__MINGW32__) - extern "C" __declspec(dllimport) int __stdcall IsDebuggerPresent(); - namespace Catch { - bool isDebuggerActive() { - return IsDebuggerPresent() != 0; - } - } -#else - namespace Catch { - inline bool isDebuggerActive() { return false; } - } -#endif // Platform - -#ifdef CATCH_PLATFORM_WINDOWS - extern "C" __declspec(dllimport) void __stdcall OutputDebugStringA( const char* ); - namespace Catch { - void writeToDebugConsole( std::string const& text ) { - ::OutputDebugStringA( text.c_str() ); - } - } -#else - namespace Catch { - void writeToDebugConsole( std::string const& text ) { - // !TBD: Need a version for Mac/ XCode and other IDEs - Catch::cout() << text; - } - } -#endif // Platform - -// #included from: catch_tostring.hpp -#define TWOBLUECUBES_CATCH_TOSTRING_HPP_INCLUDED - -namespace Catch { - -namespace Detail { - - const std::string unprintableString = "{?}"; - - namespace { - const int hexThreshold = 255; - - struct Endianness { - enum Arch { Big, Little }; - - static Arch which() { - union _{ - int asInt; - char asChar[sizeof (int)]; - } u; - - u.asInt = 1; - return ( u.asChar[sizeof(int)-1] == 1 ) ? Big : Little; - } - }; - } - - std::string rawMemoryToString( const void *object, std::size_t size ) - { - // Reverse order for little endian architectures - int i = 0, end = static_cast( size ), inc = 1; - if( Endianness::which() == Endianness::Little ) { - i = end-1; - end = inc = -1; - } - - unsigned char const *bytes = static_cast(object); - std::ostringstream os; - os << "0x" << std::setfill('0') << std::hex; - for( ; i != end; i += inc ) - os << std::setw(2) << static_cast(bytes[i]); - return os.str(); - } -} - -std::string toString( std::string const& value ) { - std::string s = value; - if( getCurrentContext().getConfig()->showInvisibles() ) { - for(size_t i = 0; i < s.size(); ++i ) { - std::string subs; - switch( s[i] ) { - case '\n': subs = "\\n"; break; - case '\t': subs = "\\t"; break; - default: break; - } - if( !subs.empty() ) { - s = s.substr( 0, i ) + subs + s.substr( i+1 ); - ++i; - } - } - } - return "\"" + s + "\""; -} -std::string toString( std::wstring const& value ) { - - std::string s; - s.reserve( value.size() ); - for(size_t i = 0; i < value.size(); ++i ) - s += value[i] <= 0xff ? static_cast( value[i] ) : '?'; - return Catch::toString( s ); -} - -std::string toString( const char* const value ) { - return value ? Catch::toString( std::string( value ) ) : std::string( "{null string}" ); -} - -std::string toString( char* const value ) { - return Catch::toString( static_cast( value ) ); -} - -std::string toString( const wchar_t* const value ) -{ - return value ? Catch::toString( std::wstring(value) ) : std::string( "{null string}" ); -} - -std::string toString( wchar_t* const value ) -{ - return Catch::toString( static_cast( value ) ); -} - -std::string toString( int value ) { - std::ostringstream oss; - oss << value; - if( value > Detail::hexThreshold ) - oss << " (0x" << std::hex << value << ")"; - return oss.str(); -} - -std::string toString( unsigned long value ) { - std::ostringstream oss; - oss << value; - if( value > Detail::hexThreshold ) - oss << " (0x" << std::hex << value << ")"; - return oss.str(); -} - -std::string toString( unsigned int value ) { - return Catch::toString( static_cast( value ) ); -} - -template -std::string fpToString( T value, int precision ) { - std::ostringstream oss; - oss << std::setprecision( precision ) - << std::fixed - << value; - std::string d = oss.str(); - std::size_t i = d.find_last_not_of( '0' ); - if( i != std::string::npos && i != d.size()-1 ) { - if( d[i] == '.' ) - i++; - d = d.substr( 0, i+1 ); - } - return d; -} - -std::string toString( const double value ) { - return fpToString( value, 10 ); -} -std::string toString( const float value ) { - return fpToString( value, 5 ) + "f"; -} - -std::string toString( bool value ) { - return value ? "true" : "false"; -} - -std::string toString( char value ) { - return value < ' ' - ? toString( static_cast( value ) ) - : Detail::makeString( value ); -} - -std::string toString( signed char value ) { - return toString( static_cast( value ) ); -} - -std::string toString( unsigned char value ) { - return toString( static_cast( value ) ); -} - -#ifdef CATCH_CONFIG_CPP11_LONG_LONG -std::string toString( long long value ) { - std::ostringstream oss; - oss << value; - if( value > Detail::hexThreshold ) - oss << " (0x" << std::hex << value << ")"; - return oss.str(); -} -std::string toString( unsigned long long value ) { - std::ostringstream oss; - oss << value; - if( value > Detail::hexThreshold ) - oss << " (0x" << std::hex << value << ")"; - return oss.str(); -} -#endif - -#ifdef CATCH_CONFIG_CPP11_NULLPTR -std::string toString( std::nullptr_t ) { - return "nullptr"; -} -#endif - -#ifdef __OBJC__ - std::string toString( NSString const * const& nsstring ) { - if( !nsstring ) - return "nil"; - return "@" + toString([nsstring UTF8String]); - } - std::string toString( NSString * CATCH_ARC_STRONG const& nsstring ) { - if( !nsstring ) - return "nil"; - return "@" + toString([nsstring UTF8String]); - } - std::string toString( NSObject* const& nsObject ) { - return toString( [nsObject description] ); - } -#endif - -} // end namespace Catch - -// #included from: catch_result_builder.hpp -#define TWOBLUECUBES_CATCH_RESULT_BUILDER_HPP_INCLUDED - -namespace Catch { - - std::string capturedExpressionWithSecondArgument( std::string const& capturedExpression, std::string const& secondArg ) { - return secondArg.empty() || secondArg == "\"\"" - ? capturedExpression - : capturedExpression + ", " + secondArg; - } - ResultBuilder::ResultBuilder( char const* macroName, - SourceLineInfo const& lineInfo, - char const* capturedExpression, - ResultDisposition::Flags resultDisposition, - char const* secondArg ) - : m_assertionInfo( macroName, lineInfo, capturedExpressionWithSecondArgument( capturedExpression, secondArg ), resultDisposition ), - m_shouldDebugBreak( false ), - m_shouldThrow( false ) - {} - - ResultBuilder& ResultBuilder::setResultType( ResultWas::OfType result ) { - m_data.resultType = result; - return *this; - } - ResultBuilder& ResultBuilder::setResultType( bool result ) { - m_data.resultType = result ? ResultWas::Ok : ResultWas::ExpressionFailed; - return *this; - } - ResultBuilder& ResultBuilder::setLhs( std::string const& lhs ) { - m_exprComponents.lhs = lhs; - return *this; - } - ResultBuilder& ResultBuilder::setRhs( std::string const& rhs ) { - m_exprComponents.rhs = rhs; - return *this; - } - ResultBuilder& ResultBuilder::setOp( std::string const& op ) { - m_exprComponents.op = op; - return *this; - } - - void ResultBuilder::endExpression() { - m_exprComponents.testFalse = isFalseTest( m_assertionInfo.resultDisposition ); - captureExpression(); - } - - void ResultBuilder::useActiveException( ResultDisposition::Flags resultDisposition ) { - m_assertionInfo.resultDisposition = resultDisposition; - m_stream.oss << Catch::translateActiveException(); - captureResult( ResultWas::ThrewException ); - } - - void ResultBuilder::captureResult( ResultWas::OfType resultType ) { - setResultType( resultType ); - captureExpression(); - } - void ResultBuilder::captureExpectedException( std::string const& expectedMessage ) { - if( expectedMessage.empty() ) - captureExpectedException( Matchers::Impl::Generic::AllOf() ); - else - captureExpectedException( Matchers::Equals( expectedMessage ) ); - } - - void ResultBuilder::captureExpectedException( Matchers::Impl::Matcher const& matcher ) { - - assert( m_exprComponents.testFalse == false ); - AssertionResultData data = m_data; - data.resultType = ResultWas::Ok; - data.reconstructedExpression = m_assertionInfo.capturedExpression; - - std::string actualMessage = Catch::translateActiveException(); - if( !matcher.match( actualMessage ) ) { - data.resultType = ResultWas::ExpressionFailed; - data.reconstructedExpression = actualMessage; - } - AssertionResult result( m_assertionInfo, data ); - handleResult( result ); - } - - void ResultBuilder::captureExpression() { - AssertionResult result = build(); - handleResult( result ); - } - void ResultBuilder::handleResult( AssertionResult const& result ) - { - getResultCapture().assertionEnded( result ); - - if( !result.isOk() ) { - if( getCurrentContext().getConfig()->shouldDebugBreak() ) - m_shouldDebugBreak = true; - if( getCurrentContext().getRunner()->aborting() || (m_assertionInfo.resultDisposition & ResultDisposition::Normal) ) - m_shouldThrow = true; - } - } - void ResultBuilder::react() { - if( m_shouldThrow ) - throw Catch::TestFailureException(); - } - - bool ResultBuilder::shouldDebugBreak() const { return m_shouldDebugBreak; } - bool ResultBuilder::allowThrows() const { return getCurrentContext().getConfig()->allowThrows(); } - - AssertionResult ResultBuilder::build() const - { - assert( m_data.resultType != ResultWas::Unknown ); - - AssertionResultData data = m_data; - - // Flip bool results if testFalse is set - if( m_exprComponents.testFalse ) { - if( data.resultType == ResultWas::Ok ) - data.resultType = ResultWas::ExpressionFailed; - else if( data.resultType == ResultWas::ExpressionFailed ) - data.resultType = ResultWas::Ok; - } - - data.message = m_stream.oss.str(); - data.reconstructedExpression = reconstructExpression(); - if( m_exprComponents.testFalse ) { - if( m_exprComponents.op == "" ) - data.reconstructedExpression = "!" + data.reconstructedExpression; - else - data.reconstructedExpression = "!(" + data.reconstructedExpression + ")"; - } - return AssertionResult( m_assertionInfo, data ); - } - std::string ResultBuilder::reconstructExpression() const { - if( m_exprComponents.op == "" ) - return m_exprComponents.lhs.empty() ? m_assertionInfo.capturedExpression : m_exprComponents.op + m_exprComponents.lhs; - else if( m_exprComponents.op == "matches" ) - return m_exprComponents.lhs + " " + m_exprComponents.rhs; - else if( m_exprComponents.op != "!" ) { - if( m_exprComponents.lhs.size() + m_exprComponents.rhs.size() < 40 && - m_exprComponents.lhs.find("\n") == std::string::npos && - m_exprComponents.rhs.find("\n") == std::string::npos ) - return m_exprComponents.lhs + " " + m_exprComponents.op + " " + m_exprComponents.rhs; - else - return m_exprComponents.lhs + "\n" + m_exprComponents.op + "\n" + m_exprComponents.rhs; - } - else - return "{can't expand - use " + m_assertionInfo.macroName + "_FALSE( " + m_assertionInfo.capturedExpression.substr(1) + " ) instead of " + m_assertionInfo.macroName + "( " + m_assertionInfo.capturedExpression + " ) for better diagnostics}"; - } - -} // end namespace Catch - -// #included from: catch_tag_alias_registry.hpp -#define TWOBLUECUBES_CATCH_TAG_ALIAS_REGISTRY_HPP_INCLUDED - -// #included from: catch_tag_alias_registry.h -#define TWOBLUECUBES_CATCH_TAG_ALIAS_REGISTRY_H_INCLUDED - -#include - -namespace Catch { - - class TagAliasRegistry : public ITagAliasRegistry { - public: - virtual ~TagAliasRegistry(); - virtual Option find( std::string const& alias ) const; - virtual std::string expandAliases( std::string const& unexpandedTestSpec ) const; - void add( char const* alias, char const* tag, SourceLineInfo const& lineInfo ); - static TagAliasRegistry& get(); - - private: - std::map m_registry; - }; - -} // end namespace Catch - -#include -#include - -namespace Catch { - - TagAliasRegistry::~TagAliasRegistry() {} - - Option TagAliasRegistry::find( std::string const& alias ) const { - std::map::const_iterator it = m_registry.find( alias ); - if( it != m_registry.end() ) - return it->second; - else - return Option(); - } - - std::string TagAliasRegistry::expandAliases( std::string const& unexpandedTestSpec ) const { - std::string expandedTestSpec = unexpandedTestSpec; - for( std::map::const_iterator it = m_registry.begin(), itEnd = m_registry.end(); - it != itEnd; - ++it ) { - std::size_t pos = expandedTestSpec.find( it->first ); - if( pos != std::string::npos ) { - expandedTestSpec = expandedTestSpec.substr( 0, pos ) + - it->second.tag + - expandedTestSpec.substr( pos + it->first.size() ); - } - } - return expandedTestSpec; - } - - void TagAliasRegistry::add( char const* alias, char const* tag, SourceLineInfo const& lineInfo ) { - - if( !startsWith( alias, "[@" ) || !endsWith( alias, "]" ) ) { - std::ostringstream oss; - oss << "error: tag alias, \"" << alias << "\" is not of the form [@alias name].\n" << lineInfo; - throw std::domain_error( oss.str().c_str() ); - } - if( !m_registry.insert( std::make_pair( alias, TagAlias( tag, lineInfo ) ) ).second ) { - std::ostringstream oss; - oss << "error: tag alias, \"" << alias << "\" already registered.\n" - << "\tFirst seen at " << find(alias)->lineInfo << "\n" - << "\tRedefined at " << lineInfo; - throw std::domain_error( oss.str().c_str() ); - } - } - - TagAliasRegistry& TagAliasRegistry::get() { - static TagAliasRegistry instance; - return instance; - - } - - ITagAliasRegistry::~ITagAliasRegistry() {} - ITagAliasRegistry const& ITagAliasRegistry::get() { return TagAliasRegistry::get(); } - - RegistrarForTagAliases::RegistrarForTagAliases( char const* alias, char const* tag, SourceLineInfo const& lineInfo ) { - try { - TagAliasRegistry::get().add( alias, tag, lineInfo ); - } - catch( std::exception& ex ) { - Colour colourGuard( Colour::Red ); - Catch::cerr() << ex.what() << std::endl; - exit(1); - } - } - -} // end namespace Catch - -// #included from: ../reporters/catch_reporter_multi.hpp -#define TWOBLUECUBES_CATCH_REPORTER_MULTI_HPP_INCLUDED - -namespace Catch { - -class MultipleReporters : public SharedImpl { - typedef std::vector > Reporters; - Reporters m_reporters; - -public: - void add( Ptr const& reporter ) { - m_reporters.push_back( reporter ); - } - -public: // IStreamingReporter - - virtual ReporterPreferences getPreferences() const CATCH_OVERRIDE { - return m_reporters[0]->getPreferences(); - } - - virtual void noMatchingTestCases( std::string const& spec ) CATCH_OVERRIDE { - for( Reporters::const_iterator it = m_reporters.begin(), itEnd = m_reporters.end(); - it != itEnd; - ++it ) - (*it)->noMatchingTestCases( spec ); - } - - virtual void testRunStarting( TestRunInfo const& testRunInfo ) CATCH_OVERRIDE { - for( Reporters::const_iterator it = m_reporters.begin(), itEnd = m_reporters.end(); - it != itEnd; - ++it ) - (*it)->testRunStarting( testRunInfo ); - } - - virtual void testGroupStarting( GroupInfo const& groupInfo ) CATCH_OVERRIDE { - for( Reporters::const_iterator it = m_reporters.begin(), itEnd = m_reporters.end(); - it != itEnd; - ++it ) - (*it)->testGroupStarting( groupInfo ); - } - - virtual void testCaseStarting( TestCaseInfo const& testInfo ) CATCH_OVERRIDE { - for( Reporters::const_iterator it = m_reporters.begin(), itEnd = m_reporters.end(); - it != itEnd; - ++it ) - (*it)->testCaseStarting( testInfo ); - } - - virtual void sectionStarting( SectionInfo const& sectionInfo ) CATCH_OVERRIDE { - for( Reporters::const_iterator it = m_reporters.begin(), itEnd = m_reporters.end(); - it != itEnd; - ++it ) - (*it)->sectionStarting( sectionInfo ); - } - - virtual void assertionStarting( AssertionInfo const& assertionInfo ) CATCH_OVERRIDE { - for( Reporters::const_iterator it = m_reporters.begin(), itEnd = m_reporters.end(); - it != itEnd; - ++it ) - (*it)->assertionStarting( assertionInfo ); - } - - // The return value indicates if the messages buffer should be cleared: - virtual bool assertionEnded( AssertionStats const& assertionStats ) CATCH_OVERRIDE { - bool clearBuffer = false; - for( Reporters::const_iterator it = m_reporters.begin(), itEnd = m_reporters.end(); - it != itEnd; - ++it ) - clearBuffer |= (*it)->assertionEnded( assertionStats ); - return clearBuffer; - } - - virtual void sectionEnded( SectionStats const& sectionStats ) CATCH_OVERRIDE { - for( Reporters::const_iterator it = m_reporters.begin(), itEnd = m_reporters.end(); - it != itEnd; - ++it ) - (*it)->sectionEnded( sectionStats ); - } - - virtual void testCaseEnded( TestCaseStats const& testCaseStats ) CATCH_OVERRIDE { - for( Reporters::const_iterator it = m_reporters.begin(), itEnd = m_reporters.end(); - it != itEnd; - ++it ) - (*it)->testCaseEnded( testCaseStats ); - } - - virtual void testGroupEnded( TestGroupStats const& testGroupStats ) CATCH_OVERRIDE { - for( Reporters::const_iterator it = m_reporters.begin(), itEnd = m_reporters.end(); - it != itEnd; - ++it ) - (*it)->testGroupEnded( testGroupStats ); - } - - virtual void testRunEnded( TestRunStats const& testRunStats ) CATCH_OVERRIDE { - for( Reporters::const_iterator it = m_reporters.begin(), itEnd = m_reporters.end(); - it != itEnd; - ++it ) - (*it)->testRunEnded( testRunStats ); - } - - virtual void skipTest( TestCaseInfo const& testInfo ) CATCH_OVERRIDE { - for( Reporters::const_iterator it = m_reporters.begin(), itEnd = m_reporters.end(); - it != itEnd; - ++it ) - (*it)->skipTest( testInfo ); - } - - virtual MultipleReporters* tryAsMulti() CATCH_OVERRIDE { - return this; - } - -}; - -Ptr addReporter( Ptr const& existingReporter, Ptr const& additionalReporter ) { - Ptr resultingReporter; - - if( existingReporter ) { - MultipleReporters* multi = existingReporter->tryAsMulti(); - if( !multi ) { - multi = new MultipleReporters; - resultingReporter = Ptr( multi ); - if( existingReporter ) - multi->add( existingReporter ); - } - else - resultingReporter = existingReporter; - multi->add( additionalReporter ); - } - else - resultingReporter = additionalReporter; - - return resultingReporter; -} - -} // end namespace Catch - -// #included from: ../reporters/catch_reporter_xml.hpp -#define TWOBLUECUBES_CATCH_REPORTER_XML_HPP_INCLUDED - -// #included from: catch_reporter_bases.hpp -#define TWOBLUECUBES_CATCH_REPORTER_BASES_HPP_INCLUDED - -#include - -namespace Catch { - - struct StreamingReporterBase : SharedImpl { - - StreamingReporterBase( ReporterConfig const& _config ) - : m_config( _config.fullConfig() ), - stream( _config.stream() ) - { - m_reporterPrefs.shouldRedirectStdOut = false; - } - - virtual ReporterPreferences getPreferences() const CATCH_OVERRIDE { - return m_reporterPrefs; - } - - virtual ~StreamingReporterBase() CATCH_OVERRIDE; - - virtual void noMatchingTestCases( std::string const& ) CATCH_OVERRIDE {} - - virtual void testRunStarting( TestRunInfo const& _testRunInfo ) CATCH_OVERRIDE { - currentTestRunInfo = _testRunInfo; - } - virtual void testGroupStarting( GroupInfo const& _groupInfo ) CATCH_OVERRIDE { - currentGroupInfo = _groupInfo; - } - - virtual void testCaseStarting( TestCaseInfo const& _testInfo ) CATCH_OVERRIDE { - currentTestCaseInfo = _testInfo; - } - virtual void sectionStarting( SectionInfo const& _sectionInfo ) CATCH_OVERRIDE { - m_sectionStack.push_back( _sectionInfo ); - } - - virtual void sectionEnded( SectionStats const& /* _sectionStats */ ) CATCH_OVERRIDE { - m_sectionStack.pop_back(); - } - virtual void testCaseEnded( TestCaseStats const& /* _testCaseStats */ ) CATCH_OVERRIDE { - currentTestCaseInfo.reset(); - } - virtual void testGroupEnded( TestGroupStats const& /* _testGroupStats */ ) CATCH_OVERRIDE { - currentGroupInfo.reset(); - } - virtual void testRunEnded( TestRunStats const& /* _testRunStats */ ) CATCH_OVERRIDE { - currentTestCaseInfo.reset(); - currentGroupInfo.reset(); - currentTestRunInfo.reset(); - } - - virtual void skipTest( TestCaseInfo const& ) CATCH_OVERRIDE { - // Don't do anything with this by default. - // It can optionally be overridden in the derived class. - } - - Ptr m_config; - std::ostream& stream; - - LazyStat currentTestRunInfo; - LazyStat currentGroupInfo; - LazyStat currentTestCaseInfo; - - std::vector m_sectionStack; - ReporterPreferences m_reporterPrefs; - }; - - struct CumulativeReporterBase : SharedImpl { - template - struct Node : SharedImpl<> { - explicit Node( T const& _value ) : value( _value ) {} - virtual ~Node() {} - - typedef std::vector > ChildNodes; - T value; - ChildNodes children; - }; - struct SectionNode : SharedImpl<> { - explicit SectionNode( SectionStats const& _stats ) : stats( _stats ) {} - virtual ~SectionNode(); - - bool operator == ( SectionNode const& other ) const { - return stats.sectionInfo.lineInfo == other.stats.sectionInfo.lineInfo; - } - bool operator == ( Ptr const& other ) const { - return operator==( *other ); - } - - SectionStats stats; - typedef std::vector > ChildSections; - typedef std::vector Assertions; - ChildSections childSections; - Assertions assertions; - std::string stdOut; - std::string stdErr; - }; - - struct BySectionInfo { - BySectionInfo( SectionInfo const& other ) : m_other( other ) {} - BySectionInfo( BySectionInfo const& other ) : m_other( other.m_other ) {} - bool operator() ( Ptr const& node ) const { - return node->stats.sectionInfo.lineInfo == m_other.lineInfo; - } - private: - void operator=( BySectionInfo const& ); - SectionInfo const& m_other; - }; - - typedef Node TestCaseNode; - typedef Node TestGroupNode; - typedef Node TestRunNode; - - CumulativeReporterBase( ReporterConfig const& _config ) - : m_config( _config.fullConfig() ), - stream( _config.stream() ) - { - m_reporterPrefs.shouldRedirectStdOut = false; - } - ~CumulativeReporterBase(); - - virtual ReporterPreferences getPreferences() const CATCH_OVERRIDE { - return m_reporterPrefs; - } - - virtual void testRunStarting( TestRunInfo const& ) CATCH_OVERRIDE {} - virtual void testGroupStarting( GroupInfo const& ) CATCH_OVERRIDE {} - - virtual void testCaseStarting( TestCaseInfo const& ) CATCH_OVERRIDE {} - - virtual void sectionStarting( SectionInfo const& sectionInfo ) CATCH_OVERRIDE { - SectionStats incompleteStats( sectionInfo, Counts(), 0, false ); - Ptr node; - if( m_sectionStack.empty() ) { - if( !m_rootSection ) - m_rootSection = new SectionNode( incompleteStats ); - node = m_rootSection; - } - else { - SectionNode& parentNode = *m_sectionStack.back(); - SectionNode::ChildSections::const_iterator it = - std::find_if( parentNode.childSections.begin(), - parentNode.childSections.end(), - BySectionInfo( sectionInfo ) ); - if( it == parentNode.childSections.end() ) { - node = new SectionNode( incompleteStats ); - parentNode.childSections.push_back( node ); - } - else - node = *it; - } - m_sectionStack.push_back( node ); - m_deepestSection = node; - } - - virtual void assertionStarting( AssertionInfo const& ) CATCH_OVERRIDE {} - - virtual bool assertionEnded( AssertionStats const& assertionStats ) CATCH_OVERRIDE { - assert( !m_sectionStack.empty() ); - SectionNode& sectionNode = *m_sectionStack.back(); - sectionNode.assertions.push_back( assertionStats ); - return true; - } - virtual void sectionEnded( SectionStats const& sectionStats ) CATCH_OVERRIDE { - assert( !m_sectionStack.empty() ); - SectionNode& node = *m_sectionStack.back(); - node.stats = sectionStats; - m_sectionStack.pop_back(); - } - virtual void testCaseEnded( TestCaseStats const& testCaseStats ) CATCH_OVERRIDE { - Ptr node = new TestCaseNode( testCaseStats ); - assert( m_sectionStack.size() == 0 ); - node->children.push_back( m_rootSection ); - m_testCases.push_back( node ); - m_rootSection.reset(); - - assert( m_deepestSection ); - m_deepestSection->stdOut = testCaseStats.stdOut; - m_deepestSection->stdErr = testCaseStats.stdErr; - } - virtual void testGroupEnded( TestGroupStats const& testGroupStats ) CATCH_OVERRIDE { - Ptr node = new TestGroupNode( testGroupStats ); - node->children.swap( m_testCases ); - m_testGroups.push_back( node ); - } - virtual void testRunEnded( TestRunStats const& testRunStats ) CATCH_OVERRIDE { - Ptr node = new TestRunNode( testRunStats ); - node->children.swap( m_testGroups ); - m_testRuns.push_back( node ); - testRunEndedCumulative(); - } - virtual void testRunEndedCumulative() = 0; - - virtual void skipTest( TestCaseInfo const& ) CATCH_OVERRIDE {} - - Ptr m_config; - std::ostream& stream; - std::vector m_assertions; - std::vector > > m_sections; - std::vector > m_testCases; - std::vector > m_testGroups; - - std::vector > m_testRuns; - - Ptr m_rootSection; - Ptr m_deepestSection; - std::vector > m_sectionStack; - ReporterPreferences m_reporterPrefs; - - }; - - template - char const* getLineOfChars() { - static char line[CATCH_CONFIG_CONSOLE_WIDTH] = {0}; - if( !*line ) { - memset( line, C, CATCH_CONFIG_CONSOLE_WIDTH-1 ); - line[CATCH_CONFIG_CONSOLE_WIDTH-1] = 0; - } - return line; - } - - struct TestEventListenerBase : StreamingReporterBase { - TestEventListenerBase( ReporterConfig const& _config ) - : StreamingReporterBase( _config ) - {} - - virtual void assertionStarting( AssertionInfo const& ) CATCH_OVERRIDE {} - virtual bool assertionEnded( AssertionStats const& ) CATCH_OVERRIDE { - return false; - } - }; - -} // end namespace Catch - -// #included from: ../internal/catch_reporter_registrars.hpp -#define TWOBLUECUBES_CATCH_REPORTER_REGISTRARS_HPP_INCLUDED - -namespace Catch { - - template - class LegacyReporterRegistrar { - - class ReporterFactory : public IReporterFactory { - virtual IStreamingReporter* create( ReporterConfig const& config ) const { - return new LegacyReporterAdapter( new T( config ) ); - } - - virtual std::string getDescription() const { - return T::getDescription(); - } - }; - - public: - - LegacyReporterRegistrar( std::string const& name ) { - getMutableRegistryHub().registerReporter( name, new ReporterFactory() ); - } - }; - - template - class ReporterRegistrar { - - class ReporterFactory : public SharedImpl { - - // *** Please Note ***: - // - If you end up here looking at a compiler error because it's trying to register - // your custom reporter class be aware that the native reporter interface has changed - // to IStreamingReporter. The "legacy" interface, IReporter, is still supported via - // an adapter. Just use REGISTER_LEGACY_REPORTER to take advantage of the adapter. - // However please consider updating to the new interface as the old one is now - // deprecated and will probably be removed quite soon! - // Please contact me via github if you have any questions at all about this. - // In fact, ideally, please contact me anyway to let me know you've hit this - as I have - // no idea who is actually using custom reporters at all (possibly no-one!). - // The new interface is designed to minimise exposure to interface changes in the future. - virtual IStreamingReporter* create( ReporterConfig const& config ) const { - return new T( config ); - } - - virtual std::string getDescription() const { - return T::getDescription(); - } - }; - - public: - - ReporterRegistrar( std::string const& name ) { - getMutableRegistryHub().registerReporter( name, new ReporterFactory() ); - } - }; - - template - class ListenerRegistrar { - - class ListenerFactory : public SharedImpl { - - virtual IStreamingReporter* create( ReporterConfig const& config ) const { - return new T( config ); - } - virtual std::string getDescription() const { - return ""; - } - }; - - public: - - ListenerRegistrar() { - getMutableRegistryHub().registerListener( new ListenerFactory() ); - } - }; -} - -#define INTERNAL_CATCH_REGISTER_LEGACY_REPORTER( name, reporterType ) \ - namespace{ Catch::LegacyReporterRegistrar catch_internal_RegistrarFor##reporterType( name ); } - -#define INTERNAL_CATCH_REGISTER_REPORTER( name, reporterType ) \ - namespace{ Catch::ReporterRegistrar catch_internal_RegistrarFor##reporterType( name ); } - -#define INTERNAL_CATCH_REGISTER_LISTENER( listenerType ) \ - namespace{ Catch::ListenerRegistrar catch_internal_RegistrarFor##listenerType; } - -// #included from: ../internal/catch_xmlwriter.hpp -#define TWOBLUECUBES_CATCH_XMLWRITER_HPP_INCLUDED - -#include -#include -#include -#include - -namespace Catch { - - class XmlEncode { - public: - enum ForWhat { ForTextNodes, ForAttributes }; - - XmlEncode( std::string const& str, ForWhat forWhat = ForTextNodes ) - : m_str( str ), - m_forWhat( forWhat ) - {} - - void encodeTo( std::ostream& os ) const { - - // Apostrophe escaping not necessary if we always use " to write attributes - // (see: http://www.w3.org/TR/xml/#syntax) - - for( std::size_t i = 0; i < m_str.size(); ++ i ) { - char c = m_str[i]; - switch( c ) { - case '<': os << "<"; break; - case '&': os << "&"; break; - - case '>': - // See: http://www.w3.org/TR/xml/#syntax - if( i > 2 && m_str[i-1] == ']' && m_str[i-2] == ']' ) - os << ">"; - else - os << c; - break; - - case '\"': - if( m_forWhat == ForAttributes ) - os << """; - else - os << c; - break; - - default: - // Escape control chars - based on contribution by @espenalb in PR #465 and - // by @mrpi PR #588 - if ( ( c < '\x09' ) || ( c > '\x0D' && c < '\x20') || c=='\x7F' ) - os << "&#x" << std::uppercase << std::hex << std::setfill('0') << std::setw(2) << static_cast( c ) << ';'; - else - os << c; - } - } - } - - friend std::ostream& operator << ( std::ostream& os, XmlEncode const& xmlEncode ) { - xmlEncode.encodeTo( os ); - return os; - } - - private: - std::string m_str; - ForWhat m_forWhat; - }; - - class XmlWriter { - public: - - class ScopedElement { - public: - ScopedElement( XmlWriter* writer ) - : m_writer( writer ) - {} - - ScopedElement( ScopedElement const& other ) - : m_writer( other.m_writer ){ - other.m_writer = CATCH_NULL; - } - - ~ScopedElement() { - if( m_writer ) - m_writer->endElement(); - } - - ScopedElement& writeText( std::string const& text, bool indent = true ) { - m_writer->writeText( text, indent ); - return *this; - } - - template - ScopedElement& writeAttribute( std::string const& name, T const& attribute ) { - m_writer->writeAttribute( name, attribute ); - return *this; - } - - private: - mutable XmlWriter* m_writer; - }; - - XmlWriter() - : m_tagIsOpen( false ), - m_needsNewline( false ), - m_os( &Catch::cout() ) - { - // We encode control characters, which requires - // XML 1.1 - // see http://stackoverflow.com/questions/404107/why-are-control-characters-illegal-in-xml-1-0 - *m_os << "\n"; - } - - XmlWriter( std::ostream& os ) - : m_tagIsOpen( false ), - m_needsNewline( false ), - m_os( &os ) - { - *m_os << "\n"; - } - - ~XmlWriter() { - while( !m_tags.empty() ) - endElement(); - } - - XmlWriter& startElement( std::string const& name ) { - ensureTagClosed(); - newlineIfNecessary(); - stream() << m_indent << "<" << name; - m_tags.push_back( name ); - m_indent += " "; - m_tagIsOpen = true; - return *this; - } - - ScopedElement scopedElement( std::string const& name ) { - ScopedElement scoped( this ); - startElement( name ); - return scoped; - } - - XmlWriter& endElement() { - newlineIfNecessary(); - m_indent = m_indent.substr( 0, m_indent.size()-2 ); - if( m_tagIsOpen ) { - stream() << "/>\n"; - m_tagIsOpen = false; - } - else { - stream() << m_indent << "\n"; - } - m_tags.pop_back(); - return *this; - } - - XmlWriter& writeAttribute( std::string const& name, std::string const& attribute ) { - if( !name.empty() && !attribute.empty() ) - stream() << " " << name << "=\"" << XmlEncode( attribute, XmlEncode::ForAttributes ) << "\""; - return *this; - } - - XmlWriter& writeAttribute( std::string const& name, bool attribute ) { - stream() << " " << name << "=\"" << ( attribute ? "true" : "false" ) << "\""; - return *this; - } - - template - XmlWriter& writeAttribute( std::string const& name, T const& attribute ) { - std::ostringstream oss; - oss << attribute; - return writeAttribute( name, oss.str() ); - } - - XmlWriter& writeText( std::string const& text, bool indent = true ) { - if( !text.empty() ){ - bool tagWasOpen = m_tagIsOpen; - ensureTagClosed(); - if( tagWasOpen && indent ) - stream() << m_indent; - stream() << XmlEncode( text ); - m_needsNewline = true; - } - return *this; - } - - XmlWriter& writeComment( std::string const& text ) { - ensureTagClosed(); - stream() << m_indent << ""; - m_needsNewline = true; - return *this; - } - - XmlWriter& writeBlankLine() { - ensureTagClosed(); - stream() << "\n"; - return *this; - } - - void setStream( std::ostream& os ) { - m_os = &os; - } - - private: - XmlWriter( XmlWriter const& ); - void operator=( XmlWriter const& ); - - std::ostream& stream() { - return *m_os; - } - - void ensureTagClosed() { - if( m_tagIsOpen ) { - stream() << ">\n"; - m_tagIsOpen = false; - } - } - - void newlineIfNecessary() { - if( m_needsNewline ) { - stream() << "\n"; - m_needsNewline = false; - } - } - - bool m_tagIsOpen; - bool m_needsNewline; - std::vector m_tags; - std::string m_indent; - std::ostream* m_os; - }; - -} -// #included from: catch_reenable_warnings.h - -#define TWOBLUECUBES_CATCH_REENABLE_WARNINGS_H_INCLUDED - -#ifdef __clang__ -# ifdef __ICC // icpc defines the __clang__ macro -# pragma warning(pop) -# else -# pragma clang diagnostic pop -# endif -#elif defined __GNUC__ -# pragma GCC diagnostic pop -#endif - - -namespace Catch { - class XmlReporter : public StreamingReporterBase { - public: - XmlReporter( ReporterConfig const& _config ) - : StreamingReporterBase( _config ), - m_sectionDepth( 0 ) - { - m_reporterPrefs.shouldRedirectStdOut = true; - } - - virtual ~XmlReporter() CATCH_OVERRIDE; - - static std::string getDescription() { - return "Reports test results as an XML document"; - } - - public: // StreamingReporterBase - - virtual void noMatchingTestCases( std::string const& s ) CATCH_OVERRIDE { - StreamingReporterBase::noMatchingTestCases( s ); - } - - virtual void testRunStarting( TestRunInfo const& testInfo ) CATCH_OVERRIDE { - StreamingReporterBase::testRunStarting( testInfo ); - m_xml.setStream( stream ); - m_xml.startElement( "Catch" ); - if( !m_config->name().empty() ) - m_xml.writeAttribute( "name", m_config->name() ); - } - - virtual void testGroupStarting( GroupInfo const& groupInfo ) CATCH_OVERRIDE { - StreamingReporterBase::testGroupStarting( groupInfo ); - m_xml.startElement( "Group" ) - .writeAttribute( "name", groupInfo.name ); - } - - virtual void testCaseStarting( TestCaseInfo const& testInfo ) CATCH_OVERRIDE { - StreamingReporterBase::testCaseStarting(testInfo); - m_xml.startElement( "TestCase" ).writeAttribute( "name", testInfo.name ); - - if ( m_config->showDurations() == ShowDurations::Always ) - m_testCaseTimer.start(); - } - - virtual void sectionStarting( SectionInfo const& sectionInfo ) CATCH_OVERRIDE { - StreamingReporterBase::sectionStarting( sectionInfo ); - if( m_sectionDepth++ > 0 ) { - m_xml.startElement( "Section" ) - .writeAttribute( "name", trim( sectionInfo.name ) ) - .writeAttribute( "description", sectionInfo.description ); - } - } - - virtual void assertionStarting( AssertionInfo const& ) CATCH_OVERRIDE { } - - virtual bool assertionEnded( AssertionStats const& assertionStats ) CATCH_OVERRIDE { - const AssertionResult& assertionResult = assertionStats.assertionResult; - - // Print any info messages in tags. - if( assertionStats.assertionResult.getResultType() != ResultWas::Ok ) { - for( std::vector::const_iterator it = assertionStats.infoMessages.begin(), itEnd = assertionStats.infoMessages.end(); - it != itEnd; - ++it ) { - if( it->type == ResultWas::Info ) { - m_xml.scopedElement( "Info" ) - .writeText( it->message ); - } else if ( it->type == ResultWas::Warning ) { - m_xml.scopedElement( "Warning" ) - .writeText( it->message ); - } - } - } - - // Drop out if result was successful but we're not printing them. - if( !m_config->includeSuccessfulResults() && isOk(assertionResult.getResultType()) ) - return true; - - // Print the expression if there is one. - if( assertionResult.hasExpression() ) { - m_xml.startElement( "Expression" ) - .writeAttribute( "success", assertionResult.succeeded() ) - .writeAttribute( "type", assertionResult.getTestMacroName() ) - .writeAttribute( "filename", assertionResult.getSourceInfo().file ) - .writeAttribute( "line", assertionResult.getSourceInfo().line ); - - m_xml.scopedElement( "Original" ) - .writeText( assertionResult.getExpression() ); - m_xml.scopedElement( "Expanded" ) - .writeText( assertionResult.getExpandedExpression() ); - } - - // And... Print a result applicable to each result type. - switch( assertionResult.getResultType() ) { - case ResultWas::ThrewException: - m_xml.scopedElement( "Exception" ) - .writeAttribute( "filename", assertionResult.getSourceInfo().file ) - .writeAttribute( "line", assertionResult.getSourceInfo().line ) - .writeText( assertionResult.getMessage() ); - break; - case ResultWas::FatalErrorCondition: - m_xml.scopedElement( "Fatal Error Condition" ) - .writeAttribute( "filename", assertionResult.getSourceInfo().file ) - .writeAttribute( "line", assertionResult.getSourceInfo().line ) - .writeText( assertionResult.getMessage() ); - break; - case ResultWas::Info: - m_xml.scopedElement( "Info" ) - .writeText( assertionResult.getMessage() ); - break; - case ResultWas::Warning: - // Warning will already have been written - break; - case ResultWas::ExplicitFailure: - m_xml.scopedElement( "Failure" ) - .writeText( assertionResult.getMessage() ); - break; - default: - break; - } - - if( assertionResult.hasExpression() ) - m_xml.endElement(); - - return true; - } - - virtual void sectionEnded( SectionStats const& sectionStats ) CATCH_OVERRIDE { - StreamingReporterBase::sectionEnded( sectionStats ); - if( --m_sectionDepth > 0 ) { - XmlWriter::ScopedElement e = m_xml.scopedElement( "OverallResults" ); - e.writeAttribute( "successes", sectionStats.assertions.passed ); - e.writeAttribute( "failures", sectionStats.assertions.failed ); - e.writeAttribute( "expectedFailures", sectionStats.assertions.failedButOk ); - - if ( m_config->showDurations() == ShowDurations::Always ) - e.writeAttribute( "durationInSeconds", sectionStats.durationInSeconds ); - - m_xml.endElement(); - } - } - - virtual void testCaseEnded( TestCaseStats const& testCaseStats ) CATCH_OVERRIDE { - StreamingReporterBase::testCaseEnded( testCaseStats ); - XmlWriter::ScopedElement e = m_xml.scopedElement( "OverallResult" ); - e.writeAttribute( "success", testCaseStats.totals.assertions.allOk() ); - - if ( m_config->showDurations() == ShowDurations::Always ) - e.writeAttribute( "durationInSeconds", m_testCaseTimer.getElapsedSeconds() ); - - m_xml.endElement(); - } - - virtual void testGroupEnded( TestGroupStats const& testGroupStats ) CATCH_OVERRIDE { - StreamingReporterBase::testGroupEnded( testGroupStats ); - // TODO: Check testGroupStats.aborting and act accordingly. - m_xml.scopedElement( "OverallResults" ) - .writeAttribute( "successes", testGroupStats.totals.assertions.passed ) - .writeAttribute( "failures", testGroupStats.totals.assertions.failed ) - .writeAttribute( "expectedFailures", testGroupStats.totals.assertions.failedButOk ); - m_xml.endElement(); - } - - virtual void testRunEnded( TestRunStats const& testRunStats ) CATCH_OVERRIDE { - StreamingReporterBase::testRunEnded( testRunStats ); - m_xml.scopedElement( "OverallResults" ) - .writeAttribute( "successes", testRunStats.totals.assertions.passed ) - .writeAttribute( "failures", testRunStats.totals.assertions.failed ) - .writeAttribute( "expectedFailures", testRunStats.totals.assertions.failedButOk ); - m_xml.endElement(); - } - - private: - Timer m_testCaseTimer; - XmlWriter m_xml; - int m_sectionDepth; - }; - - INTERNAL_CATCH_REGISTER_REPORTER( "xml", XmlReporter ) - -} // end namespace Catch - -// #included from: ../reporters/catch_reporter_junit.hpp -#define TWOBLUECUBES_CATCH_REPORTER_JUNIT_HPP_INCLUDED - -#include - -namespace Catch { - - class JunitReporter : public CumulativeReporterBase { - public: - JunitReporter( ReporterConfig const& _config ) - : CumulativeReporterBase( _config ), - xml( _config.stream() ) - { - m_reporterPrefs.shouldRedirectStdOut = true; - } - - virtual ~JunitReporter() CATCH_OVERRIDE; - - static std::string getDescription() { - return "Reports test results in an XML format that looks like Ant's junitreport target"; - } - - virtual void noMatchingTestCases( std::string const& /*spec*/ ) CATCH_OVERRIDE {} - - virtual void testRunStarting( TestRunInfo const& runInfo ) CATCH_OVERRIDE { - CumulativeReporterBase::testRunStarting( runInfo ); - xml.startElement( "testsuites" ); - } - - virtual void testGroupStarting( GroupInfo const& groupInfo ) CATCH_OVERRIDE { - suiteTimer.start(); - stdOutForSuite.str(""); - stdErrForSuite.str(""); - unexpectedExceptions = 0; - CumulativeReporterBase::testGroupStarting( groupInfo ); - } - - virtual bool assertionEnded( AssertionStats const& assertionStats ) CATCH_OVERRIDE { - if( assertionStats.assertionResult.getResultType() == ResultWas::ThrewException ) - unexpectedExceptions++; - return CumulativeReporterBase::assertionEnded( assertionStats ); - } - - virtual void testCaseEnded( TestCaseStats const& testCaseStats ) CATCH_OVERRIDE { - stdOutForSuite << testCaseStats.stdOut; - stdErrForSuite << testCaseStats.stdErr; - CumulativeReporterBase::testCaseEnded( testCaseStats ); - } - - virtual void testGroupEnded( TestGroupStats const& testGroupStats ) CATCH_OVERRIDE { - double suiteTime = suiteTimer.getElapsedSeconds(); - CumulativeReporterBase::testGroupEnded( testGroupStats ); - writeGroup( *m_testGroups.back(), suiteTime ); - } - - virtual void testRunEndedCumulative() CATCH_OVERRIDE { - xml.endElement(); - } - - void writeGroup( TestGroupNode const& groupNode, double suiteTime ) { - XmlWriter::ScopedElement e = xml.scopedElement( "testsuite" ); - TestGroupStats const& stats = groupNode.value; - xml.writeAttribute( "name", stats.groupInfo.name ); - xml.writeAttribute( "errors", unexpectedExceptions ); - xml.writeAttribute( "failures", stats.totals.assertions.failed-unexpectedExceptions ); - xml.writeAttribute( "tests", stats.totals.assertions.total() ); - xml.writeAttribute( "hostname", "tbd" ); // !TBD - if( m_config->showDurations() == ShowDurations::Never ) - xml.writeAttribute( "time", "" ); - else - xml.writeAttribute( "time", suiteTime ); - xml.writeAttribute( "timestamp", "tbd" ); // !TBD - - // Write test cases - for( TestGroupNode::ChildNodes::const_iterator - it = groupNode.children.begin(), itEnd = groupNode.children.end(); - it != itEnd; - ++it ) - writeTestCase( **it ); - - xml.scopedElement( "system-out" ).writeText( trim( stdOutForSuite.str() ), false ); - xml.scopedElement( "system-err" ).writeText( trim( stdErrForSuite.str() ), false ); - } - - void writeTestCase( TestCaseNode const& testCaseNode ) { - TestCaseStats const& stats = testCaseNode.value; - - // All test cases have exactly one section - which represents the - // test case itself. That section may have 0-n nested sections - assert( testCaseNode.children.size() == 1 ); - SectionNode const& rootSection = *testCaseNode.children.front(); - - std::string className = stats.testInfo.className; - - if( className.empty() ) { - if( rootSection.childSections.empty() ) - className = "global"; - } - writeSection( className, "", rootSection ); - } - - void writeSection( std::string const& className, - std::string const& rootName, - SectionNode const& sectionNode ) { - std::string name = trim( sectionNode.stats.sectionInfo.name ); - if( !rootName.empty() ) - name = rootName + "/" + name; - - if( !sectionNode.assertions.empty() || - !sectionNode.stdOut.empty() || - !sectionNode.stdErr.empty() ) { - XmlWriter::ScopedElement e = xml.scopedElement( "testcase" ); - if( className.empty() ) { - xml.writeAttribute( "classname", name ); - xml.writeAttribute( "name", "root" ); - } - else { - xml.writeAttribute( "classname", className ); - xml.writeAttribute( "name", name ); - } - xml.writeAttribute( "time", Catch::toString( sectionNode.stats.durationInSeconds ) ); - - writeAssertions( sectionNode ); - - if( !sectionNode.stdOut.empty() ) - xml.scopedElement( "system-out" ).writeText( trim( sectionNode.stdOut ), false ); - if( !sectionNode.stdErr.empty() ) - xml.scopedElement( "system-err" ).writeText( trim( sectionNode.stdErr ), false ); - } - for( SectionNode::ChildSections::const_iterator - it = sectionNode.childSections.begin(), - itEnd = sectionNode.childSections.end(); - it != itEnd; - ++it ) - if( className.empty() ) - writeSection( name, "", **it ); - else - writeSection( className, name, **it ); - } - - void writeAssertions( SectionNode const& sectionNode ) { - for( SectionNode::Assertions::const_iterator - it = sectionNode.assertions.begin(), itEnd = sectionNode.assertions.end(); - it != itEnd; - ++it ) - writeAssertion( *it ); - } - void writeAssertion( AssertionStats const& stats ) { - AssertionResult const& result = stats.assertionResult; - if( !result.isOk() ) { - std::string elementName; - switch( result.getResultType() ) { - case ResultWas::ThrewException: - case ResultWas::FatalErrorCondition: - elementName = "error"; - break; - case ResultWas::ExplicitFailure: - elementName = "failure"; - break; - case ResultWas::ExpressionFailed: - elementName = "failure"; - break; - case ResultWas::DidntThrowException: - elementName = "failure"; - break; - - // We should never see these here: - case ResultWas::Info: - case ResultWas::Warning: - case ResultWas::Ok: - case ResultWas::Unknown: - case ResultWas::FailureBit: - case ResultWas::Exception: - elementName = "internalError"; - break; - } - - XmlWriter::ScopedElement e = xml.scopedElement( elementName ); - - xml.writeAttribute( "message", result.getExpandedExpression() ); - xml.writeAttribute( "type", result.getTestMacroName() ); - - std::ostringstream oss; - if( !result.getMessage().empty() ) - oss << result.getMessage() << "\n"; - for( std::vector::const_iterator - it = stats.infoMessages.begin(), - itEnd = stats.infoMessages.end(); - it != itEnd; - ++it ) - if( it->type == ResultWas::Info ) - oss << it->message << "\n"; - - oss << "at " << result.getSourceInfo(); - xml.writeText( oss.str(), false ); - } - } - - XmlWriter xml; - Timer suiteTimer; - std::ostringstream stdOutForSuite; - std::ostringstream stdErrForSuite; - unsigned int unexpectedExceptions; - }; - - INTERNAL_CATCH_REGISTER_REPORTER( "junit", JunitReporter ) - -} // end namespace Catch - -// #included from: ../reporters/catch_reporter_console.hpp -#define TWOBLUECUBES_CATCH_REPORTER_CONSOLE_HPP_INCLUDED - -namespace Catch { - - struct ConsoleReporter : StreamingReporterBase { - ConsoleReporter( ReporterConfig const& _config ) - : StreamingReporterBase( _config ), - m_headerPrinted( false ) - {} - - virtual ~ConsoleReporter() CATCH_OVERRIDE; - static std::string getDescription() { - return "Reports test results as plain lines of text"; - } - - virtual void noMatchingTestCases( std::string const& spec ) CATCH_OVERRIDE { - stream << "No test cases matched '" << spec << "'" << std::endl; - } - - virtual void assertionStarting( AssertionInfo const& ) CATCH_OVERRIDE { - } - - virtual bool assertionEnded( AssertionStats const& _assertionStats ) CATCH_OVERRIDE { - AssertionResult const& result = _assertionStats.assertionResult; - - bool printInfoMessages = true; - - // Drop out if result was successful and we're not printing those - if( !m_config->includeSuccessfulResults() && result.isOk() ) { - if( result.getResultType() != ResultWas::Warning ) - return false; - printInfoMessages = false; - } - - lazyPrint(); - - AssertionPrinter printer( stream, _assertionStats, printInfoMessages ); - printer.print(); - stream << std::endl; - return true; - } - - virtual void sectionStarting( SectionInfo const& _sectionInfo ) CATCH_OVERRIDE { - m_headerPrinted = false; - StreamingReporterBase::sectionStarting( _sectionInfo ); - } - virtual void sectionEnded( SectionStats const& _sectionStats ) CATCH_OVERRIDE { - if( _sectionStats.missingAssertions ) { - lazyPrint(); - Colour colour( Colour::ResultError ); - if( m_sectionStack.size() > 1 ) - stream << "\nNo assertions in section"; - else - stream << "\nNo assertions in test case"; - stream << " '" << _sectionStats.sectionInfo.name << "'\n" << std::endl; - } - if( m_headerPrinted ) { - if( m_config->showDurations() == ShowDurations::Always ) - stream << "Completed in " << _sectionStats.durationInSeconds << "s" << std::endl; - m_headerPrinted = false; - } - else { - if( m_config->showDurations() == ShowDurations::Always ) - stream << _sectionStats.sectionInfo.name << " completed in " << _sectionStats.durationInSeconds << "s" << std::endl; - } - StreamingReporterBase::sectionEnded( _sectionStats ); - } - - virtual void testCaseEnded( TestCaseStats const& _testCaseStats ) CATCH_OVERRIDE { - StreamingReporterBase::testCaseEnded( _testCaseStats ); - m_headerPrinted = false; - } - virtual void testGroupEnded( TestGroupStats const& _testGroupStats ) CATCH_OVERRIDE { - if( currentGroupInfo.used ) { - printSummaryDivider(); - stream << "Summary for group '" << _testGroupStats.groupInfo.name << "':\n"; - printTotals( _testGroupStats.totals ); - stream << "\n" << std::endl; - } - StreamingReporterBase::testGroupEnded( _testGroupStats ); - } - virtual void testRunEnded( TestRunStats const& _testRunStats ) CATCH_OVERRIDE { - printTotalsDivider( _testRunStats.totals ); - printTotals( _testRunStats.totals ); - stream << std::endl; - StreamingReporterBase::testRunEnded( _testRunStats ); - } - - private: - - class AssertionPrinter { - void operator= ( AssertionPrinter const& ); - public: - AssertionPrinter( std::ostream& _stream, AssertionStats const& _stats, bool _printInfoMessages ) - : stream( _stream ), - stats( _stats ), - result( _stats.assertionResult ), - colour( Colour::None ), - message( result.getMessage() ), - messages( _stats.infoMessages ), - printInfoMessages( _printInfoMessages ) - { - switch( result.getResultType() ) { - case ResultWas::Ok: - colour = Colour::Success; - passOrFail = "PASSED"; - //if( result.hasMessage() ) - if( _stats.infoMessages.size() == 1 ) - messageLabel = "with message"; - if( _stats.infoMessages.size() > 1 ) - messageLabel = "with messages"; - break; - case ResultWas::ExpressionFailed: - if( result.isOk() ) { - colour = Colour::Success; - passOrFail = "FAILED - but was ok"; - } - else { - colour = Colour::Error; - passOrFail = "FAILED"; - } - if( _stats.infoMessages.size() == 1 ) - messageLabel = "with message"; - if( _stats.infoMessages.size() > 1 ) - messageLabel = "with messages"; - break; - case ResultWas::ThrewException: - colour = Colour::Error; - passOrFail = "FAILED"; - messageLabel = "due to unexpected exception with message"; - break; - case ResultWas::FatalErrorCondition: - colour = Colour::Error; - passOrFail = "FAILED"; - messageLabel = "due to a fatal error condition"; - break; - case ResultWas::DidntThrowException: - colour = Colour::Error; - passOrFail = "FAILED"; - messageLabel = "because no exception was thrown where one was expected"; - break; - case ResultWas::Info: - messageLabel = "info"; - break; - case ResultWas::Warning: - messageLabel = "warning"; - break; - case ResultWas::ExplicitFailure: - passOrFail = "FAILED"; - colour = Colour::Error; - if( _stats.infoMessages.size() == 1 ) - messageLabel = "explicitly with message"; - if( _stats.infoMessages.size() > 1 ) - messageLabel = "explicitly with messages"; - break; - // These cases are here to prevent compiler warnings - case ResultWas::Unknown: - case ResultWas::FailureBit: - case ResultWas::Exception: - passOrFail = "** internal error **"; - colour = Colour::Error; - break; - } - } - - void print() const { - printSourceInfo(); - if( stats.totals.assertions.total() > 0 ) { - if( result.isOk() ) - stream << "\n"; - printResultType(); - printOriginalExpression(); - printReconstructedExpression(); - } - else { - stream << "\n"; - } - printMessage(); - } - - private: - void printResultType() const { - if( !passOrFail.empty() ) { - Colour colourGuard( colour ); - stream << passOrFail << ":\n"; - } - } - void printOriginalExpression() const { - if( result.hasExpression() ) { - Colour colourGuard( Colour::OriginalExpression ); - stream << " "; - stream << result.getExpressionInMacro(); - stream << "\n"; - } - } - void printReconstructedExpression() const { - if( result.hasExpandedExpression() ) { - stream << "with expansion:\n"; - Colour colourGuard( Colour::ReconstructedExpression ); - stream << Text( result.getExpandedExpression(), TextAttributes().setIndent(2) ) << "\n"; - } - } - void printMessage() const { - if( !messageLabel.empty() ) - stream << messageLabel << ":" << "\n"; - for( std::vector::const_iterator it = messages.begin(), itEnd = messages.end(); - it != itEnd; - ++it ) { - // If this assertion is a warning ignore any INFO messages - if( printInfoMessages || it->type != ResultWas::Info ) - stream << Text( it->message, TextAttributes().setIndent(2) ) << "\n"; - } - } - void printSourceInfo() const { - Colour colourGuard( Colour::FileName ); - stream << result.getSourceInfo() << ": "; - } - - std::ostream& stream; - AssertionStats const& stats; - AssertionResult const& result; - Colour::Code colour; - std::string passOrFail; - std::string messageLabel; - std::string message; - std::vector messages; - bool printInfoMessages; - }; - - void lazyPrint() { - - if( !currentTestRunInfo.used ) - lazyPrintRunInfo(); - if( !currentGroupInfo.used ) - lazyPrintGroupInfo(); - - if( !m_headerPrinted ) { - printTestCaseAndSectionHeader(); - m_headerPrinted = true; - } - } - void lazyPrintRunInfo() { - stream << "\n" << getLineOfChars<'~'>() << "\n"; - Colour colour( Colour::SecondaryText ); - stream << currentTestRunInfo->name - << " is a Catch v" << libraryVersion << " host application.\n" - << "Run with -? for options\n\n"; - - if( m_config->rngSeed() != 0 ) - stream << "Randomness seeded to: " << m_config->rngSeed() << "\n\n"; - - currentTestRunInfo.used = true; - } - void lazyPrintGroupInfo() { - if( !currentGroupInfo->name.empty() && currentGroupInfo->groupsCounts > 1 ) { - printClosedHeader( "Group: " + currentGroupInfo->name ); - currentGroupInfo.used = true; - } - } - void printTestCaseAndSectionHeader() { - assert( !m_sectionStack.empty() ); - printOpenHeader( currentTestCaseInfo->name ); - - if( m_sectionStack.size() > 1 ) { - Colour colourGuard( Colour::Headers ); - - std::vector::const_iterator - it = m_sectionStack.begin()+1, // Skip first section (test case) - itEnd = m_sectionStack.end(); - for( ; it != itEnd; ++it ) - printHeaderString( it->name, 2 ); - } - - SourceLineInfo lineInfo = m_sectionStack.front().lineInfo; - - if( !lineInfo.empty() ){ - stream << getLineOfChars<'-'>() << "\n"; - Colour colourGuard( Colour::FileName ); - stream << lineInfo << "\n"; - } - stream << getLineOfChars<'.'>() << "\n" << std::endl; - } - - void printClosedHeader( std::string const& _name ) { - printOpenHeader( _name ); - stream << getLineOfChars<'.'>() << "\n"; - } - void printOpenHeader( std::string const& _name ) { - stream << getLineOfChars<'-'>() << "\n"; - { - Colour colourGuard( Colour::Headers ); - printHeaderString( _name ); - } - } - - // if string has a : in first line will set indent to follow it on - // subsequent lines - void printHeaderString( std::string const& _string, std::size_t indent = 0 ) { - std::size_t i = _string.find( ": " ); - if( i != std::string::npos ) - i+=2; - else - i = 0; - stream << Text( _string, TextAttributes() - .setIndent( indent+i) - .setInitialIndent( indent ) ) << "\n"; - } - - struct SummaryColumn { - - SummaryColumn( std::string const& _label, Colour::Code _colour ) - : label( _label ), - colour( _colour ) - {} - SummaryColumn addRow( std::size_t count ) { - std::ostringstream oss; - oss << count; - std::string row = oss.str(); - for( std::vector::iterator it = rows.begin(); it != rows.end(); ++it ) { - while( it->size() < row.size() ) - *it = " " + *it; - while( it->size() > row.size() ) - row = " " + row; - } - rows.push_back( row ); - return *this; - } - - std::string label; - Colour::Code colour; - std::vector rows; - - }; - - void printTotals( Totals const& totals ) { - if( totals.testCases.total() == 0 ) { - stream << Colour( Colour::Warning ) << "No tests ran\n"; - } - else if( totals.assertions.total() > 0 && totals.testCases.allPassed() ) { - stream << Colour( Colour::ResultSuccess ) << "All tests passed"; - stream << " (" - << pluralise( totals.assertions.passed, "assertion" ) << " in " - << pluralise( totals.testCases.passed, "test case" ) << ")" - << "\n"; - } - else { - - std::vector columns; - columns.push_back( SummaryColumn( "", Colour::None ) - .addRow( totals.testCases.total() ) - .addRow( totals.assertions.total() ) ); - columns.push_back( SummaryColumn( "passed", Colour::Success ) - .addRow( totals.testCases.passed ) - .addRow( totals.assertions.passed ) ); - columns.push_back( SummaryColumn( "failed", Colour::ResultError ) - .addRow( totals.testCases.failed ) - .addRow( totals.assertions.failed ) ); - columns.push_back( SummaryColumn( "failed as expected", Colour::ResultExpectedFailure ) - .addRow( totals.testCases.failedButOk ) - .addRow( totals.assertions.failedButOk ) ); - - printSummaryRow( "test cases", columns, 0 ); - printSummaryRow( "assertions", columns, 1 ); - } - } - void printSummaryRow( std::string const& label, std::vector const& cols, std::size_t row ) { - for( std::vector::const_iterator it = cols.begin(); it != cols.end(); ++it ) { - std::string value = it->rows[row]; - if( it->label.empty() ) { - stream << label << ": "; - if( value != "0" ) - stream << value; - else - stream << Colour( Colour::Warning ) << "- none -"; - } - else if( value != "0" ) { - stream << Colour( Colour::LightGrey ) << " | "; - stream << Colour( it->colour ) - << value << " " << it->label; - } - } - stream << "\n"; - } - - static std::size_t makeRatio( std::size_t number, std::size_t total ) { - std::size_t ratio = total > 0 ? CATCH_CONFIG_CONSOLE_WIDTH * number/ total : 0; - return ( ratio == 0 && number > 0 ) ? 1 : ratio; - } - static std::size_t& findMax( std::size_t& i, std::size_t& j, std::size_t& k ) { - if( i > j && i > k ) - return i; - else if( j > k ) - return j; - else - return k; - } - - void printTotalsDivider( Totals const& totals ) { - if( totals.testCases.total() > 0 ) { - std::size_t failedRatio = makeRatio( totals.testCases.failed, totals.testCases.total() ); - std::size_t failedButOkRatio = makeRatio( totals.testCases.failedButOk, totals.testCases.total() ); - std::size_t passedRatio = makeRatio( totals.testCases.passed, totals.testCases.total() ); - while( failedRatio + failedButOkRatio + passedRatio < CATCH_CONFIG_CONSOLE_WIDTH-1 ) - findMax( failedRatio, failedButOkRatio, passedRatio )++; - while( failedRatio + failedButOkRatio + passedRatio > CATCH_CONFIG_CONSOLE_WIDTH-1 ) - findMax( failedRatio, failedButOkRatio, passedRatio )--; - - stream << Colour( Colour::Error ) << std::string( failedRatio, '=' ); - stream << Colour( Colour::ResultExpectedFailure ) << std::string( failedButOkRatio, '=' ); - if( totals.testCases.allPassed() ) - stream << Colour( Colour::ResultSuccess ) << std::string( passedRatio, '=' ); - else - stream << Colour( Colour::Success ) << std::string( passedRatio, '=' ); - } - else { - stream << Colour( Colour::Warning ) << std::string( CATCH_CONFIG_CONSOLE_WIDTH-1, '=' ); - } - stream << "\n"; - } - void printSummaryDivider() { - stream << getLineOfChars<'-'>() << "\n"; - } - - private: - bool m_headerPrinted; - }; - - INTERNAL_CATCH_REGISTER_REPORTER( "console", ConsoleReporter ) - -} // end namespace Catch - -// #included from: ../reporters/catch_reporter_compact.hpp -#define TWOBLUECUBES_CATCH_REPORTER_COMPACT_HPP_INCLUDED - -namespace Catch { - - struct CompactReporter : StreamingReporterBase { - - CompactReporter( ReporterConfig const& _config ) - : StreamingReporterBase( _config ) - {} - - virtual ~CompactReporter(); - - static std::string getDescription() { - return "Reports test results on a single line, suitable for IDEs"; - } - - virtual ReporterPreferences getPreferences() const { - ReporterPreferences prefs; - prefs.shouldRedirectStdOut = false; - return prefs; - } - - virtual void noMatchingTestCases( std::string const& spec ) { - stream << "No test cases matched '" << spec << "'" << std::endl; - } - - virtual void assertionStarting( AssertionInfo const& ) { - } - - virtual bool assertionEnded( AssertionStats const& _assertionStats ) { - AssertionResult const& result = _assertionStats.assertionResult; - - bool printInfoMessages = true; - - // Drop out if result was successful and we're not printing those - if( !m_config->includeSuccessfulResults() && result.isOk() ) { - if( result.getResultType() != ResultWas::Warning ) - return false; - printInfoMessages = false; - } - - AssertionPrinter printer( stream, _assertionStats, printInfoMessages ); - printer.print(); - - stream << std::endl; - return true; - } - - virtual void testRunEnded( TestRunStats const& _testRunStats ) { - printTotals( _testRunStats.totals ); - stream << "\n" << std::endl; - StreamingReporterBase::testRunEnded( _testRunStats ); - } - - private: - class AssertionPrinter { - void operator= ( AssertionPrinter const& ); - public: - AssertionPrinter( std::ostream& _stream, AssertionStats const& _stats, bool _printInfoMessages ) - : stream( _stream ) - , stats( _stats ) - , result( _stats.assertionResult ) - , messages( _stats.infoMessages ) - , itMessage( _stats.infoMessages.begin() ) - , printInfoMessages( _printInfoMessages ) - {} - - void print() { - printSourceInfo(); - - itMessage = messages.begin(); - - switch( result.getResultType() ) { - case ResultWas::Ok: - printResultType( Colour::ResultSuccess, passedString() ); - printOriginalExpression(); - printReconstructedExpression(); - if ( ! result.hasExpression() ) - printRemainingMessages( Colour::None ); - else - printRemainingMessages(); - break; - case ResultWas::ExpressionFailed: - if( result.isOk() ) - printResultType( Colour::ResultSuccess, failedString() + std::string( " - but was ok" ) ); - else - printResultType( Colour::Error, failedString() ); - printOriginalExpression(); - printReconstructedExpression(); - printRemainingMessages(); - break; - case ResultWas::ThrewException: - printResultType( Colour::Error, failedString() ); - printIssue( "unexpected exception with message:" ); - printMessage(); - printExpressionWas(); - printRemainingMessages(); - break; - case ResultWas::FatalErrorCondition: - printResultType( Colour::Error, failedString() ); - printIssue( "fatal error condition with message:" ); - printMessage(); - printExpressionWas(); - printRemainingMessages(); - break; - case ResultWas::DidntThrowException: - printResultType( Colour::Error, failedString() ); - printIssue( "expected exception, got none" ); - printExpressionWas(); - printRemainingMessages(); - break; - case ResultWas::Info: - printResultType( Colour::None, "info" ); - printMessage(); - printRemainingMessages(); - break; - case ResultWas::Warning: - printResultType( Colour::None, "warning" ); - printMessage(); - printRemainingMessages(); - break; - case ResultWas::ExplicitFailure: - printResultType( Colour::Error, failedString() ); - printIssue( "explicitly" ); - printRemainingMessages( Colour::None ); - break; - // These cases are here to prevent compiler warnings - case ResultWas::Unknown: - case ResultWas::FailureBit: - case ResultWas::Exception: - printResultType( Colour::Error, "** internal error **" ); - break; - } - } - - private: - // Colour::LightGrey - - static Colour::Code dimColour() { return Colour::FileName; } - -#ifdef CATCH_PLATFORM_MAC - static const char* failedString() { return "FAILED"; } - static const char* passedString() { return "PASSED"; } -#else - static const char* failedString() { return "failed"; } - static const char* passedString() { return "passed"; } -#endif - - void printSourceInfo() const { - Colour colourGuard( Colour::FileName ); - stream << result.getSourceInfo() << ":"; - } - - void printResultType( Colour::Code colour, std::string passOrFail ) const { - if( !passOrFail.empty() ) { - { - Colour colourGuard( colour ); - stream << " " << passOrFail; - } - stream << ":"; - } - } - - void printIssue( std::string issue ) const { - stream << " " << issue; - } - - void printExpressionWas() { - if( result.hasExpression() ) { - stream << ";"; - { - Colour colour( dimColour() ); - stream << " expression was:"; - } - printOriginalExpression(); - } - } - - void printOriginalExpression() const { - if( result.hasExpression() ) { - stream << " " << result.getExpression(); - } - } - - void printReconstructedExpression() const { - if( result.hasExpandedExpression() ) { - { - Colour colour( dimColour() ); - stream << " for: "; - } - stream << result.getExpandedExpression(); - } - } - - void printMessage() { - if ( itMessage != messages.end() ) { - stream << " '" << itMessage->message << "'"; - ++itMessage; - } - } - - void printRemainingMessages( Colour::Code colour = dimColour() ) { - if ( itMessage == messages.end() ) - return; - - // using messages.end() directly yields compilation error: - std::vector::const_iterator itEnd = messages.end(); - const std::size_t N = static_cast( std::distance( itMessage, itEnd ) ); - - { - Colour colourGuard( colour ); - stream << " with " << pluralise( N, "message" ) << ":"; - } - - for(; itMessage != itEnd; ) { - // If this assertion is a warning ignore any INFO messages - if( printInfoMessages || itMessage->type != ResultWas::Info ) { - stream << " '" << itMessage->message << "'"; - if ( ++itMessage != itEnd ) { - Colour colourGuard( dimColour() ); - stream << " and"; - } - } - } - } - - private: - std::ostream& stream; - AssertionStats const& stats; - AssertionResult const& result; - std::vector messages; - std::vector::const_iterator itMessage; - bool printInfoMessages; - }; - - // Colour, message variants: - // - white: No tests ran. - // - red: Failed [both/all] N test cases, failed [both/all] M assertions. - // - white: Passed [both/all] N test cases (no assertions). - // - red: Failed N tests cases, failed M assertions. - // - green: Passed [both/all] N tests cases with M assertions. - - std::string bothOrAll( std::size_t count ) const { - return count == 1 ? "" : count == 2 ? "both " : "all " ; - } - - void printTotals( const Totals& totals ) const { - if( totals.testCases.total() == 0 ) { - stream << "No tests ran."; - } - else if( totals.testCases.failed == totals.testCases.total() ) { - Colour colour( Colour::ResultError ); - const std::string qualify_assertions_failed = - totals.assertions.failed == totals.assertions.total() ? - bothOrAll( totals.assertions.failed ) : ""; - stream << - "Failed " << bothOrAll( totals.testCases.failed ) - << pluralise( totals.testCases.failed, "test case" ) << ", " - "failed " << qualify_assertions_failed << - pluralise( totals.assertions.failed, "assertion" ) << "."; - } - else if( totals.assertions.total() == 0 ) { - stream << - "Passed " << bothOrAll( totals.testCases.total() ) - << pluralise( totals.testCases.total(), "test case" ) - << " (no assertions)."; - } - else if( totals.assertions.failed ) { - Colour colour( Colour::ResultError ); - stream << - "Failed " << pluralise( totals.testCases.failed, "test case" ) << ", " - "failed " << pluralise( totals.assertions.failed, "assertion" ) << "."; - } - else { - Colour colour( Colour::ResultSuccess ); - stream << - "Passed " << bothOrAll( totals.testCases.passed ) - << pluralise( totals.testCases.passed, "test case" ) << - " with " << pluralise( totals.assertions.passed, "assertion" ) << "."; - } - } - }; - - INTERNAL_CATCH_REGISTER_REPORTER( "compact", CompactReporter ) - -} // end namespace Catch - -namespace Catch { - // These are all here to avoid warnings about not having any out of line - // virtual methods - NonCopyable::~NonCopyable() {} - IShared::~IShared() {} - IStream::~IStream() CATCH_NOEXCEPT {} - FileStream::~FileStream() CATCH_NOEXCEPT {} - CoutStream::~CoutStream() CATCH_NOEXCEPT {} - DebugOutStream::~DebugOutStream() CATCH_NOEXCEPT {} - StreamBufBase::~StreamBufBase() CATCH_NOEXCEPT {} - IContext::~IContext() {} - IResultCapture::~IResultCapture() {} - ITestCase::~ITestCase() {} - ITestCaseRegistry::~ITestCaseRegistry() {} - IRegistryHub::~IRegistryHub() {} - IMutableRegistryHub::~IMutableRegistryHub() {} - IExceptionTranslator::~IExceptionTranslator() {} - IExceptionTranslatorRegistry::~IExceptionTranslatorRegistry() {} - IReporter::~IReporter() {} - IReporterFactory::~IReporterFactory() {} - IReporterRegistry::~IReporterRegistry() {} - IStreamingReporter::~IStreamingReporter() {} - AssertionStats::~AssertionStats() {} - SectionStats::~SectionStats() {} - TestCaseStats::~TestCaseStats() {} - TestGroupStats::~TestGroupStats() {} - TestRunStats::~TestRunStats() {} - CumulativeReporterBase::SectionNode::~SectionNode() {} - CumulativeReporterBase::~CumulativeReporterBase() {} - - StreamingReporterBase::~StreamingReporterBase() {} - ConsoleReporter::~ConsoleReporter() {} - CompactReporter::~CompactReporter() {} - IRunner::~IRunner() {} - IMutableContext::~IMutableContext() {} - IConfig::~IConfig() {} - XmlReporter::~XmlReporter() {} - JunitReporter::~JunitReporter() {} - TestRegistry::~TestRegistry() {} - FreeFunctionTestCase::~FreeFunctionTestCase() {} - IGeneratorInfo::~IGeneratorInfo() {} - IGeneratorsForTest::~IGeneratorsForTest() {} - WildcardPattern::~WildcardPattern() {} - TestSpec::Pattern::~Pattern() {} - TestSpec::NamePattern::~NamePattern() {} - TestSpec::TagPattern::~TagPattern() {} - TestSpec::ExcludedPattern::~ExcludedPattern() {} - - Matchers::Impl::StdString::Equals::~Equals() {} - Matchers::Impl::StdString::Contains::~Contains() {} - Matchers::Impl::StdString::StartsWith::~StartsWith() {} - Matchers::Impl::StdString::EndsWith::~EndsWith() {} - - void Config::dummy() {} - - namespace TestCaseTracking { - ITracker::~ITracker() {} - TrackerBase::~TrackerBase() {} - SectionTracker::~SectionTracker() {} - IndexTracker::~IndexTracker() {} - } -} - -#ifdef __clang__ -#pragma clang diagnostic pop -#endif - -#endif - -#ifdef CATCH_CONFIG_MAIN -// #included from: internal/catch_default_main.hpp -#define TWOBLUECUBES_CATCH_DEFAULT_MAIN_HPP_INCLUDED - -#ifndef __OBJC__ - -// Standard C/C++ main entry point -int main (int argc, char * argv[]) { - return Catch::Session().run( argc, argv ); -} - -#else // __OBJC__ - -// Objective-C entry point -int main (int argc, char * const argv[]) { -#if !CATCH_ARC_ENABLED - NSAutoreleasePool * pool = [[NSAutoreleasePool alloc] init]; -#endif - - Catch::registerTestMethods(); - int result = Catch::Session().run( argc, (char* const*)argv ); - -#if !CATCH_ARC_ENABLED - [pool drain]; -#endif - - return result; -} - -#endif // __OBJC__ - -#endif - -#ifdef CLARA_CONFIG_MAIN_NOT_DEFINED -# undef CLARA_CONFIG_MAIN -#endif - -////// - -// If this config identifier is defined then all CATCH macros are prefixed with CATCH_ -#ifdef CATCH_CONFIG_PREFIX_ALL - -#define CATCH_REQUIRE( expr ) INTERNAL_CATCH_TEST( expr, Catch::ResultDisposition::Normal, "CATCH_REQUIRE" ) -#define CATCH_REQUIRE_FALSE( expr ) INTERNAL_CATCH_TEST( expr, Catch::ResultDisposition::Normal | Catch::ResultDisposition::FalseTest, "CATCH_REQUIRE_FALSE" ) - -#define CATCH_REQUIRE_THROWS( expr ) INTERNAL_CATCH_THROWS( expr, Catch::ResultDisposition::Normal, "", "CATCH_REQUIRE_THROWS" ) -#define CATCH_REQUIRE_THROWS_AS( expr, exceptionType ) INTERNAL_CATCH_THROWS_AS( expr, exceptionType, Catch::ResultDisposition::Normal, "CATCH_REQUIRE_THROWS_AS" ) -#define CATCH_REQUIRE_THROWS_WITH( expr, matcher ) INTERNAL_CATCH_THROWS( expr, Catch::ResultDisposition::Normal, matcher, "CATCH_REQUIRE_THROWS_WITH" ) -#define CATCH_REQUIRE_NOTHROW( expr ) INTERNAL_CATCH_NO_THROW( expr, Catch::ResultDisposition::Normal, "CATCH_REQUIRE_NOTHROW" ) - -#define CATCH_CHECK( expr ) INTERNAL_CATCH_TEST( expr, Catch::ResultDisposition::ContinueOnFailure, "CATCH_CHECK" ) -#define CATCH_CHECK_FALSE( expr ) INTERNAL_CATCH_TEST( expr, Catch::ResultDisposition::ContinueOnFailure | Catch::ResultDisposition::FalseTest, "CATCH_CHECK_FALSE" ) -#define CATCH_CHECKED_IF( expr ) INTERNAL_CATCH_IF( expr, Catch::ResultDisposition::ContinueOnFailure, "CATCH_CHECKED_IF" ) -#define CATCH_CHECKED_ELSE( expr ) INTERNAL_CATCH_ELSE( expr, Catch::ResultDisposition::ContinueOnFailure, "CATCH_CHECKED_ELSE" ) -#define CATCH_CHECK_NOFAIL( expr ) INTERNAL_CATCH_TEST( expr, Catch::ResultDisposition::ContinueOnFailure | Catch::ResultDisposition::SuppressFail, "CATCH_CHECK_NOFAIL" ) - -#define CATCH_CHECK_THROWS( expr ) INTERNAL_CATCH_THROWS( expr, Catch::ResultDisposition::ContinueOnFailure, "CATCH_CHECK_THROWS" ) -#define CATCH_CHECK_THROWS_AS( expr, exceptionType ) INTERNAL_CATCH_THROWS_AS( expr, exceptionType, Catch::ResultDisposition::ContinueOnFailure, "CATCH_CHECK_THROWS_AS" ) -#define CATCH_CHECK_THROWS_WITH( expr, matcher ) INTERNAL_CATCH_THROWS( expr, Catch::ResultDisposition::ContinueOnFailure, matcher, "CATCH_CHECK_THROWS_WITH" ) -#define CATCH_CHECK_NOTHROW( expr ) INTERNAL_CATCH_NO_THROW( expr, Catch::ResultDisposition::ContinueOnFailure, "CATCH_CHECK_NOTHROW" ) - -#define CHECK_THAT( arg, matcher ) INTERNAL_CHECK_THAT( arg, matcher, Catch::ResultDisposition::ContinueOnFailure, "CATCH_CHECK_THAT" ) -#define CATCH_REQUIRE_THAT( arg, matcher ) INTERNAL_CHECK_THAT( arg, matcher, Catch::ResultDisposition::Normal, "CATCH_REQUIRE_THAT" ) - -#define CATCH_INFO( msg ) INTERNAL_CATCH_INFO( msg, "CATCH_INFO" ) -#define CATCH_WARN( msg ) INTERNAL_CATCH_MSG( Catch::ResultWas::Warning, Catch::ResultDisposition::ContinueOnFailure, "CATCH_WARN", msg ) -#define CATCH_SCOPED_INFO( msg ) INTERNAL_CATCH_INFO( msg, "CATCH_INFO" ) -#define CATCH_CAPTURE( msg ) INTERNAL_CATCH_INFO( #msg " := " << msg, "CATCH_CAPTURE" ) -#define CATCH_SCOPED_CAPTURE( msg ) INTERNAL_CATCH_INFO( #msg " := " << msg, "CATCH_CAPTURE" ) - -#ifdef CATCH_CONFIG_VARIADIC_MACROS - #define CATCH_TEST_CASE( ... ) INTERNAL_CATCH_TESTCASE( __VA_ARGS__ ) - #define CATCH_TEST_CASE_METHOD( className, ... ) INTERNAL_CATCH_TEST_CASE_METHOD( className, __VA_ARGS__ ) - #define CATCH_METHOD_AS_TEST_CASE( method, ... ) INTERNAL_CATCH_METHOD_AS_TEST_CASE( method, __VA_ARGS__ ) - #define CATCH_REGISTER_TEST_CASE( Function, ... ) INTERNAL_CATCH_REGISTER_TESTCASE( Function, __VA_ARGS__ ) - #define CATCH_SECTION( ... ) INTERNAL_CATCH_SECTION( __VA_ARGS__ ) - #define CATCH_FAIL( ... ) INTERNAL_CATCH_MSG( Catch::ResultWas::ExplicitFailure, Catch::ResultDisposition::Normal, "CATCH_FAIL", __VA_ARGS__ ) - #define CATCH_SUCCEED( ... ) INTERNAL_CATCH_MSG( Catch::ResultWas::Ok, Catch::ResultDisposition::ContinueOnFailure, "CATCH_SUCCEED", __VA_ARGS__ ) -#else - #define CATCH_TEST_CASE( name, description ) INTERNAL_CATCH_TESTCASE( name, description ) - #define CATCH_TEST_CASE_METHOD( className, name, description ) INTERNAL_CATCH_TEST_CASE_METHOD( className, name, description ) - #define CATCH_METHOD_AS_TEST_CASE( method, name, description ) INTERNAL_CATCH_METHOD_AS_TEST_CASE( method, name, description ) - #define CATCH_REGISTER_TEST_CASE( function, name, description ) INTERNAL_CATCH_REGISTER_TESTCASE( function, name, description ) - #define CATCH_SECTION( name, description ) INTERNAL_CATCH_SECTION( name, description ) - #define CATCH_FAIL( msg ) INTERNAL_CATCH_MSG( Catch::ResultWas::ExplicitFailure, Catch::ResultDisposition::Normal, "CATCH_FAIL", msg ) - #define CATCH_SUCCEED( msg ) INTERNAL_CATCH_MSG( Catch::ResultWas::Ok, Catch::ResultDisposition::ContinueOnFailure, "CATCH_SUCCEED", msg ) -#endif -#define CATCH_ANON_TEST_CASE() INTERNAL_CATCH_TESTCASE( "", "" ) - -#define CATCH_REGISTER_REPORTER( name, reporterType ) INTERNAL_CATCH_REGISTER_REPORTER( name, reporterType ) -#define CATCH_REGISTER_LEGACY_REPORTER( name, reporterType ) INTERNAL_CATCH_REGISTER_LEGACY_REPORTER( name, reporterType ) - -#define CATCH_GENERATE( expr) INTERNAL_CATCH_GENERATE( expr ) - -// "BDD-style" convenience wrappers -#ifdef CATCH_CONFIG_VARIADIC_MACROS -#define CATCH_SCENARIO( ... ) CATCH_TEST_CASE( "Scenario: " __VA_ARGS__ ) -#define CATCH_SCENARIO_METHOD( className, ... ) INTERNAL_CATCH_TEST_CASE_METHOD( className, "Scenario: " __VA_ARGS__ ) -#else -#define CATCH_SCENARIO( name, tags ) CATCH_TEST_CASE( "Scenario: " name, tags ) -#define CATCH_SCENARIO_METHOD( className, name, tags ) INTERNAL_CATCH_TEST_CASE_METHOD( className, "Scenario: " name, tags ) -#endif -#define CATCH_GIVEN( desc ) CATCH_SECTION( std::string( "Given: ") + desc, "" ) -#define CATCH_WHEN( desc ) CATCH_SECTION( std::string( " When: ") + desc, "" ) -#define CATCH_AND_WHEN( desc ) CATCH_SECTION( std::string( " And: ") + desc, "" ) -#define CATCH_THEN( desc ) CATCH_SECTION( std::string( " Then: ") + desc, "" ) -#define CATCH_AND_THEN( desc ) CATCH_SECTION( std::string( " And: ") + desc, "" ) - -// If CATCH_CONFIG_PREFIX_ALL is not defined then the CATCH_ prefix is not required -#else - -#define REQUIRE( expr ) INTERNAL_CATCH_TEST( expr, Catch::ResultDisposition::Normal, "REQUIRE" ) -#define REQUIRE_FALSE( expr ) INTERNAL_CATCH_TEST( expr, Catch::ResultDisposition::Normal | Catch::ResultDisposition::FalseTest, "REQUIRE_FALSE" ) - -#define REQUIRE_THROWS( expr ) INTERNAL_CATCH_THROWS( expr, Catch::ResultDisposition::Normal, "", "REQUIRE_THROWS" ) -#define REQUIRE_THROWS_AS( expr, exceptionType ) INTERNAL_CATCH_THROWS_AS( expr, exceptionType, Catch::ResultDisposition::Normal, "REQUIRE_THROWS_AS" ) -#define REQUIRE_THROWS_WITH( expr, matcher ) INTERNAL_CATCH_THROWS( expr, Catch::ResultDisposition::Normal, matcher, "REQUIRE_THROWS_WITH" ) -#define REQUIRE_NOTHROW( expr ) INTERNAL_CATCH_NO_THROW( expr, Catch::ResultDisposition::Normal, "REQUIRE_NOTHROW" ) - -#define CHECK( expr ) INTERNAL_CATCH_TEST( expr, Catch::ResultDisposition::ContinueOnFailure, "CHECK" ) -#define CHECK_FALSE( expr ) INTERNAL_CATCH_TEST( expr, Catch::ResultDisposition::ContinueOnFailure | Catch::ResultDisposition::FalseTest, "CHECK_FALSE" ) -#define CHECKED_IF( expr ) INTERNAL_CATCH_IF( expr, Catch::ResultDisposition::ContinueOnFailure, "CHECKED_IF" ) -#define CHECKED_ELSE( expr ) INTERNAL_CATCH_ELSE( expr, Catch::ResultDisposition::ContinueOnFailure, "CHECKED_ELSE" ) -#define CHECK_NOFAIL( expr ) INTERNAL_CATCH_TEST( expr, Catch::ResultDisposition::ContinueOnFailure | Catch::ResultDisposition::SuppressFail, "CHECK_NOFAIL" ) - -#define CHECK_THROWS( expr ) INTERNAL_CATCH_THROWS( expr, Catch::ResultDisposition::ContinueOnFailure, "", "CHECK_THROWS" ) -#define CHECK_THROWS_AS( expr, exceptionType ) INTERNAL_CATCH_THROWS_AS( expr, exceptionType, Catch::ResultDisposition::ContinueOnFailure, "CHECK_THROWS_AS" ) -#define CHECK_THROWS_WITH( expr, matcher ) INTERNAL_CATCH_THROWS( expr, Catch::ResultDisposition::ContinueOnFailure, matcher, "CHECK_THROWS_WITH" ) -#define CHECK_NOTHROW( expr ) INTERNAL_CATCH_NO_THROW( expr, Catch::ResultDisposition::ContinueOnFailure, "CHECK_NOTHROW" ) - -#define CHECK_THAT( arg, matcher ) INTERNAL_CHECK_THAT( arg, matcher, Catch::ResultDisposition::ContinueOnFailure, "CHECK_THAT" ) -#define REQUIRE_THAT( arg, matcher ) INTERNAL_CHECK_THAT( arg, matcher, Catch::ResultDisposition::Normal, "REQUIRE_THAT" ) - -#define INFO( msg ) INTERNAL_CATCH_INFO( msg, "INFO" ) -#define WARN( msg ) INTERNAL_CATCH_MSG( Catch::ResultWas::Warning, Catch::ResultDisposition::ContinueOnFailure, "WARN", msg ) -#define SCOPED_INFO( msg ) INTERNAL_CATCH_INFO( msg, "INFO" ) -#define CAPTURE( msg ) INTERNAL_CATCH_INFO( #msg " := " << msg, "CAPTURE" ) -#define SCOPED_CAPTURE( msg ) INTERNAL_CATCH_INFO( #msg " := " << msg, "CAPTURE" ) - -#ifdef CATCH_CONFIG_VARIADIC_MACROS - #define TEST_CASE( ... ) INTERNAL_CATCH_TESTCASE( __VA_ARGS__ ) - #define TEST_CASE_METHOD( className, ... ) INTERNAL_CATCH_TEST_CASE_METHOD( className, __VA_ARGS__ ) - #define METHOD_AS_TEST_CASE( method, ... ) INTERNAL_CATCH_METHOD_AS_TEST_CASE( method, __VA_ARGS__ ) - #define REGISTER_TEST_CASE( Function, ... ) INTERNAL_CATCH_REGISTER_TESTCASE( Function, __VA_ARGS__ ) - #define SECTION( ... ) INTERNAL_CATCH_SECTION( __VA_ARGS__ ) - #define FAIL( ... ) INTERNAL_CATCH_MSG( Catch::ResultWas::ExplicitFailure, Catch::ResultDisposition::Normal, "FAIL", __VA_ARGS__ ) - #define SUCCEED( ... ) INTERNAL_CATCH_MSG( Catch::ResultWas::Ok, Catch::ResultDisposition::ContinueOnFailure, "SUCCEED", __VA_ARGS__ ) -#else - #define TEST_CASE( name, description ) INTERNAL_CATCH_TESTCASE( name, description ) - #define TEST_CASE_METHOD( className, name, description ) INTERNAL_CATCH_TEST_CASE_METHOD( className, name, description ) - #define METHOD_AS_TEST_CASE( method, name, description ) INTERNAL_CATCH_METHOD_AS_TEST_CASE( method, name, description ) - #define REGISTER_TEST_CASE( method, name, description ) INTERNAL_CATCH_REGISTER_TESTCASE( method, name, description ) - #define SECTION( name, description ) INTERNAL_CATCH_SECTION( name, description ) - #define FAIL( msg ) INTERNAL_CATCH_MSG( Catch::ResultWas::ExplicitFailure, Catch::ResultDisposition::Normal, "FAIL", msg ) - #define SUCCEED( msg ) INTERNAL_CATCH_MSG( Catch::ResultWas::Ok, Catch::ResultDisposition::ContinueOnFailure, "SUCCEED", msg ) -#endif -#define ANON_TEST_CASE() INTERNAL_CATCH_TESTCASE( "", "" ) - -#define REGISTER_REPORTER( name, reporterType ) INTERNAL_CATCH_REGISTER_REPORTER( name, reporterType ) -#define REGISTER_LEGACY_REPORTER( name, reporterType ) INTERNAL_CATCH_REGISTER_LEGACY_REPORTER( name, reporterType ) - -#define GENERATE( expr) INTERNAL_CATCH_GENERATE( expr ) - -#endif - -#define CATCH_TRANSLATE_EXCEPTION( signature ) INTERNAL_CATCH_TRANSLATE_EXCEPTION( signature ) - -// "BDD-style" convenience wrappers -#ifdef CATCH_CONFIG_VARIADIC_MACROS -#define SCENARIO( ... ) TEST_CASE( "Scenario: " __VA_ARGS__ ) -#define SCENARIO_METHOD( className, ... ) INTERNAL_CATCH_TEST_CASE_METHOD( className, "Scenario: " __VA_ARGS__ ) -#else -#define SCENARIO( name, tags ) TEST_CASE( "Scenario: " name, tags ) -#define SCENARIO_METHOD( className, name, tags ) INTERNAL_CATCH_TEST_CASE_METHOD( className, "Scenario: " name, tags ) -#endif -#define GIVEN( desc ) SECTION( std::string(" Given: ") + desc, "" ) -#define WHEN( desc ) SECTION( std::string(" When: ") + desc, "" ) -#define AND_WHEN( desc ) SECTION( std::string("And when: ") + desc, "" ) -#define THEN( desc ) SECTION( std::string(" Then: ") + desc, "" ) -#define AND_THEN( desc ) SECTION( std::string(" And: ") + desc, "" ) - -using Catch::Detail::Approx; - -#endif // TWOBLUECUBES_SINGLE_INCLUDE_CATCH_HPP_INCLUDED - - diff --git a/tests/check.cpp b/tests/check.cpp index 1695223..6306169 100644 --- a/tests/check.cpp +++ b/tests/check.cpp @@ -2,14 +2,14 @@ # __ __ _____ _____ # Project | | | | | \ / ___| # | |__| | | |\ \ / / -# | | | | ) ) ( ( +# | | | | ) ) ( ( # | /\ | | |/ / \ \___ # \_/ \_/ |_____/ \_____| # -# Copyright (C) 2016, The WDC Project, , et al. +# Copyright (C) 2018, The WDC Project, , et al. # # This software is licensed as described in the file LICENSE, which -# you should have received as part of this distribution. +# you should have received as part of this distribution. # # You may opt to use, copy, modify, merge, publish, distribute and/or sell # copies of the Software, and permit persons to whom the Software is @@ -20,78 +20,94 @@ # ############################################################################*/ -#include "stdafx.h" -#include "catch.hpp" +#include -SCENARIO("Client must check an existing remote resources", "[check]") { +#include "fixture.hpp" - std::unique_ptr client(WebDAV::Client::Init(options)); +#include - GIVEN("An existing remote resource") { +#include - std::string existing_file = "file.dat"; - std::string existing_directory = "dir/"; +SCENARIO("Client must check an existing remote resources", "[check]") +{ + auto options = fixture::get_options(); + auto content = fixture::get_buff_content(); + auto dirname = fixture::get_dir_name(); + auto filename = fixture::get_file_name(); - client->upload_from(existing_file, (char *)file_content.c_str(), file_content.length()); - client->create_directory(existing_directory); + CAPTURE(dirname); + CAPTURE(filename); - WHEN("Check for existence of an existing remote file") { + std::unique_ptr client{ new WebDAV::Client{ options } }; - REQUIRE(client->check(existing_file)); + GIVEN("An existing remote resource") + { + std::string existing_file = filename; + std::string existing_directory = dirname; - auto is_success = client->check(existing_file); + client->upload_from(existing_file, (char*)content.c_str(), content.length()); + client->create_directory(existing_directory); - THEN("Check must be success") { + WHEN("Check for existence of an existing remote file") + { + REQUIRE(client->check(existing_file)); - CHECK(is_success); - } - } + auto is_success = client->check(existing_file); - WHEN("Check for existence of an existing remote directory") { + THEN("Check must be success") + { + CHECK(is_success); + } + } - REQUIRE(client->check(existing_directory)); + WHEN("Check for existence of an existing remote directory") + { + REQUIRE(client->check(existing_directory)); - auto is_success = client->check(existing_directory); + auto is_success = client->check(existing_directory); - THEN("The directory is cleaning") { - - CHECK(is_success); - } - } - } + THEN("The directory is cleaning") + { + CHECK(is_success); + } + } + } } -SCENARIO("Client must check not an existing remote resources", "[check]") { - - std::unique_ptr client(WebDAV::Client::Init(options)); - - GIVEN("Not an existing remote resource") { +SCENARIO("Client must check not an existing remote resources", "[check]") +{ + auto options = fixture::get_options(); - std::string not_existing_file = "not_existing_file.dat"; - std::string not_existing_directory = "not_existing_directory/"; + std::unique_ptr client{ new WebDAV::Client{ options } }; - WHEN("Check for existence of not an existing remote file") { + GIVEN("Not an existing remote resource") + { + std::string not_existing_file = "not_existing_file.dat"; + std::string not_existing_directory = "not_existing_directory/"; - REQUIRE(client->clean(not_existing_file)); + WHEN("Check for existence of not an existing remote file") + { + REQUIRE(client->clean(not_existing_file)); - auto is_success = client->check(not_existing_file); + auto is_success = client->check(not_existing_file); - THEN("Check must be not success") { + THEN("Check must be not success") + { - CHECK_FALSE(is_success); - } - } + CHECK_FALSE(is_success); + } + } - WHEN("Check for existence of an existing remote directory") { + WHEN("Check for existence of an existing remote directory") + { + REQUIRE(client->clean(not_existing_directory)); - REQUIRE(client->clean(not_existing_directory)); + auto is_success = client->check(not_existing_directory); - auto is_success = client->check(not_existing_directory); - - THEN("Check must be not success") { - - CHECK_FALSE(is_success); - } - } - } -} \ No newline at end of file + THEN("Check must be not success") + { + CHECK_FALSE(is_success); + } + } + } +} diff --git a/tests/clean.cpp b/tests/clean.cpp index 34a0083..4d1049c 100644 --- a/tests/clean.cpp +++ b/tests/clean.cpp @@ -2,14 +2,14 @@ # __ __ _____ _____ # Project | | | | | \ / ___| # | |__| | | |\ \ / / -# | | | | ) ) ( ( +# | | | | ) ) ( ( # | /\ | | |/ / \ \___ # \_/ \_/ |_____/ \_____| # -# Copyright (C) 2016, The WDC Project, , et al. +# Copyright (C) 2018, The WDC Project, , et al. # # This software is licensed as described in the file LICENSE, which -# you should have received as part of this distribution. +# you should have received as part of this distribution. # # You may opt to use, copy, modify, merge, publish, distribute and/or sell # copies of the Software, and permit persons to whom the Software is @@ -20,139 +20,167 @@ # ############################################################################*/ -#include "stdafx.h" -#include "catch.hpp" +#include -SCENARIO("Client must clean an existing remote resources", "[clean]") { +#include "fixture.hpp" - std::unique_ptr client(WebDAV::Client::Init(options)); +#include - GIVEN("An existing remote resource") { +#include - std::string existing_file = "file.dat"; - std::string existing_directory = "existing_directory/"; +SCENARIO("Client must clean an existing remote resources", "[clean]") +{ + auto options = fixture::get_options(); + auto content = fixture::get_buff_content(); + auto dirname = fixture::get_dir_name(); + auto filename = fixture::get_file_name(); - client->upload_from(existing_file, (char *)file_content.c_str(), file_content.length()); - client->create_directory(existing_directory); + CAPTURE(dirname); + CAPTURE(filename); - WHEN("Clean an existing remote file") { + std::unique_ptr client{ new WebDAV::Client{ options } }; - REQUIRE(client->check(existing_file)); + GIVEN("An existing remote resource") + { + std::string existing_file = filename; + std::string existing_directory = dirname; - auto is_success = client->clean(existing_file); + client->upload_from(existing_file, (char*)content.c_str(), content.length()); + client->create_directory(existing_directory); - THEN("The file is cleaning") { + WHEN("Clean an existing remote file") + { + REQUIRE(client->check(existing_file)); - CHECK(is_success); - CHECK_FALSE(client->check(existing_file)); - } - } + auto is_success = client->clean(existing_file); - WHEN("Clean an existing directory") { + THEN("The file is cleaning") + { + CHECK(is_success); + CHECK_FALSE(client->check(existing_file)); + } + } - REQUIRE(client->check(existing_directory)); + WHEN("Clean an existing directory") + { + REQUIRE(client->check(existing_directory)); - auto is_success = client->clean(existing_directory); + auto is_success = client->clean(existing_directory); - THEN("The directory is cleaning") { - - CHECK(is_success); - CHECK_FALSE(client->check(existing_directory)); - } - } - } + THEN("The directory is cleaning") + { + CHECK(is_success); + CHECK_FALSE(client->check(existing_directory)); + } + } + } } -SCENARIO("Client must clean not an existing remote resources", "[clean]") { - - std::unique_ptr client(WebDAV::Client::Init(options)); - - GIVEN("Not an existing remote resource") { - - std::string not_existing_file = "not_existing_file.dat"; - std::string not_existing_directory = "not_existing_directory/"; - - WHEN("Clean not an existing remote file") { +SCENARIO("Client must clean not an existing remote resources", "[clean]") +{ + auto options = fixture::get_options(); - REQUIRE_FALSE(client->check(not_existing_file)); + std::unique_ptr client{ new WebDAV::Client{ options } }; - auto is_success = client->clean(not_existing_file); + GIVEN("Not an existing remote resource") + { + std::string not_existing_file = "not_existing_file.dat"; + std::string not_existing_directory = "not_existing_directory/"; - THEN("The file is cleaning") { + WHEN("Clean not an existing remote file") + { + REQUIRE_FALSE(client->check(not_existing_file)); - CHECK(is_success); - CHECK_FALSE(client->check(not_existing_file)); - } - } + auto is_success = client->clean(not_existing_file); - WHEN("Clean not an existing directory") { + THEN("The file is cleaning") + { + CHECK(is_success); + CHECK_FALSE(client->check(not_existing_file)); + } + } - REQUIRE_FALSE(client->check(not_existing_directory)); + WHEN("Clean not an existing directory") + { + REQUIRE_FALSE(client->check(not_existing_directory)); - auto is_success = client->clean(not_existing_directory); + auto is_success = client->clean(not_existing_directory); - THEN("The directory is cleaning") { - - CHECK(is_success); - CHECK_FALSE(client->check(not_existing_directory)); - } - } - } + THEN("The directory is cleaning") + { + CHECK(is_success); + CHECK_FALSE(client->check(not_existing_directory)); + } + } + } } -SCENARIO("Client must clean not an empty remote directories", "[clean]") { - - std::unique_ptr client(WebDAV::Client::Init(options)); +SCENARIO("Client must clean not an empty remote directories", "[clean]") +{ + auto options = fixture::get_options(); + auto content = fixture::get_buff_content(); + auto dirname = fixture::get_dir_name(); - GIVEN("Not an empty remote directory") { + CAPTURE(dirname); - std::string not_empty_directory = "not_empty_directory/"; - std::string attached_file = "not_empty_directory/attached_file.dat"; - std::string attached_directory = "not_empty_directory/attached_directory/"; + std::unique_ptr client{ new WebDAV::Client{ options } }; - client->create_directory(not_empty_directory); - client->upload_from(attached_file, (char *)file_content.c_str(), file_content.length()); - client->create_directory(attached_directory); + GIVEN("Not an empty remote directory") + { + std::string not_empty_directory = dirname; + std::string attached_file = not_empty_directory + "/" + "attached_file.dat"; + std::string attached_directory = not_empty_directory + "/" + "attached_directory/"; - WHEN("Clean not an empty directory") { + client->create_directory(not_empty_directory); + client->upload_from(attached_file, (char*)content.c_str(), content.length()); + client->create_directory(attached_directory); - REQUIRE(client->check(not_empty_directory)); - REQUIRE(client->check(attached_file)); - REQUIRE(client->check(attached_directory)); + WHEN("Clean not an empty directory") + { + REQUIRE(client->check(not_empty_directory)); + REQUIRE(client->check(attached_file)); + REQUIRE(client->check(attached_directory)); - auto is_success = client->clean(not_empty_directory); + auto is_success = client->clean(not_empty_directory); - REQUIRE(is_success); + REQUIRE(is_success); - THEN("The directory and the attached resources are cleaning") { - - CHECK_FALSE(client->check(not_empty_directory)); - CHECK_FALSE(client->check(attached_file)); - CHECK_FALSE(client->check(attached_directory)); - } - } - } + THEN("The directory and the attached resources are cleaning") + { + CHECK_FALSE(client->check(not_empty_directory)); + CHECK_FALSE(client->check(attached_file)); + CHECK_FALSE(client->check(attached_directory)); + } + } + } } -SCENARIO("Client must clean a remote directory", "[clean]") { +SCENARIO("Client must clean a remote directory", "[clean]") +{ + auto options = fixture::get_options(); + auto dirname = fixture::get_dir_name(); - std::unique_ptr client(WebDAV::Client::Init(options)); + CAPTURE(dirname); - GIVEN("An existing directory") { - - std::string directory_name = "directory"; - client->create_directory(directory_name); + std::unique_ptr client{ new WebDAV::Client{ options } }; - WHEN("Clean directory by a name") { + GIVEN("An existing directory") + { + std::string directory_name = dirname; + client->create_directory(directory_name); - REQUIRE(client->check(directory_name)); + WHEN("Clean directory by a name") + { + REQUIRE(client->check(directory_name)); - auto is_success = client->clean(directory_name); + auto is_success = client->clean(directory_name); - THEN("The directory is cleaning") { + REQUIRE(is_success); - CHECK_FALSE(client->check(directory_name)); - } - } - } -} \ No newline at end of file + THEN("The directory is cleaning") + { + CHECK_FALSE(client->check(directory_name)); + } + } + } +} diff --git a/tests/config.hpp b/tests/config.hpp deleted file mode 100644 index 7031195..0000000 --- a/tests/config.hpp +++ /dev/null @@ -1,50 +0,0 @@ -/*#*************************************************************************** -# __ __ _____ _____ -# Project | | | | | \ / ___| -# | |__| | | |\ \ / / -# | | | | ) ) ( ( -# | /\ | | |/ / \ \___ -# \_/ \_/ |_____/ \_____| -# -# Copyright (C) 2016, The WDC Project, , et al. -# -# This software is licensed as described in the file LICENSE, which -# you should have received as part of this distribution. -# -# You may opt to use, copy, modify, merge, publish, distribute and/or sell -# copies of the Software, and permit persons to whom the Software is -# furnished to do so, under the terms of the LICENSE file. -# -# This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY -# KIND, either express or implied. -# -############################################################################*/ - -//#define WITH_PROXY - -#include - -static std::map options_with_proxy = -{ - { "webdav_hostname", "https://webdav.yandex.ru" }, - { "webdav_login", "webdav.test.login" }, - { "webdav_password", "webdav.test.password" }, - { "proxy_hostname", "{proxy_hostname}" }, - { "proxy_login", "{proxy_login}" }, - { "proxy_password", "{proxy_password}" } -}; - -static std::map options_without_proxy = -{ - { "webdav_hostname", "https://webdav.yandex.ru" }, - { "webdav_login", "webdav.test.login" }, - { "webdav_password", "webdav.test.password" } -}; - -#ifdef WITH_PROXY -static std::map options = options_with_proxy; -#else -static std::map options = options_without_proxy; -#endif - -static std::string file_content = "static std::wstring file_content = L\"static std::wstring file_content = ...\";"; diff --git a/tests/download.cpp b/tests/download.cpp index 3b2d597..2521d2e 100644 --- a/tests/download.cpp +++ b/tests/download.cpp @@ -2,14 +2,14 @@ # __ __ _____ _____ # Project | | | | | \ / ___| # | |__| | | |\ \ / / -# | | | | ) ) ( ( +# | | | | ) ) ( ( # | /\ | | |/ / \ \___ # \_/ \_/ |_____/ \_____| # -# Copyright (C) 2016, The WDC Project, , et al. +# Copyright (C) 2018, The WDC Project, , et al. # # This software is licensed as described in the file LICENSE, which -# you should have received as part of this distribution. +# you should have received as part of this distribution. # # You may opt to use, copy, modify, merge, publish, distribute and/or sell # copies of the Software, and permit persons to whom the Software is @@ -20,70 +20,87 @@ # ############################################################################*/ -#include "stdafx.h" -#include "catch.hpp" +#include -SCENARIO("Client must download into buffer", "[download][buffer]") { +#include "fixture.hpp" - std::unique_ptr client(WebDAV::Client::Init(options)); +#include - GIVEN("A buffer") { +#include +#include - std::string source_buffer = "content of the buffer"; - std::string remote_resource = "file.dat"; +SCENARIO("Client must download into buffer", "[download][buffer]") +{ + auto options = fixture::get_options(); + auto content = fixture::get_buff_content(); + auto filename = fixture::get_file_name(); - auto buffer_pointer = const_cast(source_buffer.c_str()); - unsigned long long buffer_size = (source_buffer.length() + 1)* sizeof(source_buffer.c_str()[0]); + CAPTURE(filename); - auto is_success = client->upload_from(remote_resource, buffer_pointer, buffer_size); - REQUIRE(is_success); + std::unique_ptr client{ new WebDAV::Client{ options } }; - WHEN("Download into the buffer") { + GIVEN("A buffer") + { + std::string source_buffer = content; + std::string remote_resource = filename; - REQUIRE(client->check(remote_resource)); + auto buffer_pointer = const_cast(source_buffer.c_str()); + unsigned long long buffer_size = (source_buffer.length() + 1) * sizeof(source_buffer.c_str()[0]); - auto is_success = client->download_to(remote_resource, buffer_pointer, buffer_size); + auto is_success = client->upload_from(remote_resource, buffer_pointer, buffer_size); + REQUIRE(is_success); - THEN("buffer must be downloaded") { + WHEN("Download into the buffer") + { + REQUIRE(client->check(remote_resource)); - CHECK(is_success); - std::string destination_buffer(buffer_pointer); - CHECK(destination_buffer == source_buffer); - } - } - } -} - -SCENARIO("Client must download stream", "[download][stream]") { - - std::unique_ptr client(WebDAV::Client::Init(options)); + auto is_success = client->download_to(remote_resource, buffer_pointer, buffer_size); - GIVEN("A stream") { + THEN("buffer must be downloaded") + { + CHECK(is_success); + std::string destination_buffer(buffer_pointer); + CHECK(destination_buffer == source_buffer); + } + } + } +} - std::stringstream destination_stream; +SCENARIO("Client must download stream", "[download][stream]") +{ + auto options = fixture::get_options(); + auto content = fixture::get_buff_content(); + auto filename = fixture::get_file_name(); - std::stringstream source_stream("content of the stream"); - std::string remote_resource = "file.dat"; + CAPTURE(filename); - auto is_success = client->upload_from(remote_resource, source_stream); - REQUIRE(is_success); + std::unique_ptr client{ new WebDAV::Client{ options } }; - WHEN("Upload the stream") { + GIVEN("A stream") + { + std::stringstream destination_stream; - REQUIRE(client->check(remote_resource)); + std::stringstream source_stream(content); + std::string remote_resource = filename; - auto is_success = client->download_to(remote_resource, destination_stream); + auto is_success = client->upload_from(remote_resource, source_stream); + REQUIRE(is_success); - THEN("stream must be uploaded") { + WHEN("Upload the stream") + { + REQUIRE(client->check(remote_resource)); - CHECK(is_success); + auto is_success = client->download_to(remote_resource, destination_stream); - std::string source_buffer = source_stream.str(); - std::string destination_buffer = source_stream.str(); + THEN("stream must be uploaded") + { + CHECK(is_success); - CHECK(destination_buffer == source_buffer); + std::string source_buffer = source_stream.str(); + std::string destination_buffer = source_stream.str(); - } - } - } -} \ No newline at end of file + CHECK(destination_buffer == source_buffer); + } + } + } +} diff --git a/tests/fixture.cpp b/tests/fixture.cpp new file mode 100644 index 0000000..2c8f976 --- /dev/null +++ b/tests/fixture.cpp @@ -0,0 +1,117 @@ +/*#*************************************************************************** +# __ __ _____ _____ +# Project | | | | | \ / ___| +# | |__| | | |\ \ / / +# | | | | ) ) ( ( +# | /\ | | |/ / \ \___ +# \_/ \_/ |_____/ \_____| +# +# Copyright (C) 2018, The WDC Project, , et al. +# +# This software is licensed as described in the file LICENSE, which +# you should have received as part of this distribution. +# +# You may opt to use, copy, modify, merge, publish, distribute and/or sell +# copies of the Software, and permit persons to whom the Software is +# furnished to do so, under the terms of the LICENSE file. +# +# This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY +# KIND, either express or implied. +# +############################################################################*/ + +#include "fixture.hpp" + +#include +#include +#include + +#include +#include +#include + +using dict_t = std::map; + +std::string file_ext = ".txt"; +std::string file_content = "static std::wstring file_content = L\"static std::wstring file_content = ...\";"; +std::string buff_content = "static std::wstring buff_content = L\"static std::wstring buff_content = ...\";"; + +namespace fixture +{ + auto get_file_content() -> std::string + { + return file_content; + } + + auto get_buff_content() -> std::string + { + return buff_content; + } + + auto get_file_name() -> std::string + { + boost::uuids::random_generator gen; + boost::uuids::uuid id = gen(); + auto ciid = to_string(id); + return ciid + file_ext;; + } + + auto get_dir_name() -> std::string + { + boost::uuids::random_generator gen; + boost::uuids::uuid id = gen(); + auto ciid = to_string(id); + return ciid + "/"; + } + + auto get_options() -> dict_t + { + auto hostname_ptr = std::getenv("WEBDAV_HOSTNAME"); + auto username_ptr = std::getenv("WEBDAV_USERNAME"); + auto password_ptr = std::getenv("WEBDAV_PASSWORD"); + auto root_ptr = std::getenv("WEBDAV_ROOT"); + + if (hostname_ptr == nullptr) + { + throw std::runtime_error("undefined WEBDAV_HOSTNAME environment variable"); + } + if (username_ptr == nullptr) + { + throw std::runtime_error("undefined WEBDAV_USERNAME environment variable"); + } + if (password_ptr == nullptr) + { + throw std::runtime_error("undefined WEBDAV_PASSWORD environment variable"); + } + + std::map options = + { + {"webdav_hostname", hostname_ptr}, + {"webdav_username", username_ptr}, + {"webdav_password", password_ptr} + }; + + if (root_ptr != nullptr) + { + options["webdav_root"] = root_ptr; + } + + const auto proxy_hostname_ptr = std::getenv("PROXY_HOSTNAME"); + const auto proxy_username_ptr = std::getenv("PROXY_USERNAME"); + const auto proxy_password_ptr = std::getenv("PROXY_PASSWORD"); + + if (proxy_hostname_ptr != nullptr) + { + options["proxy_hostname"] = proxy_hostname_ptr; + } + if (proxy_username_ptr != nullptr) + { + options["proxy_username"] = proxy_username_ptr; + } + if (proxy_password_ptr != nullptr && proxy_username_ptr != nullptr) + { + options["proxy_password"] = proxy_password_ptr; + } + return options; + } +} diff --git a/tests/stdafx.h b/tests/fixture.hpp similarity index 63% rename from tests/stdafx.h rename to tests/fixture.hpp index b62a11b..d3666f8 100644 --- a/tests/stdafx.h +++ b/tests/fixture.hpp @@ -2,14 +2,14 @@ # __ __ _____ _____ # Project | | | | | \ / ___| # | |__| | | |\ \ / / -# | | | | ) ) ( ( +# | | | | ) ) ( ( # | /\ | | |/ / \ \___ # \_/ \_/ |_____/ \_____| # -# Copyright (C) 2016, The WDC Project, , et al. +# Copyright (C) 2018, The WDC Project, , et al. # # This software is licensed as described in the file LICENSE, which -# you should have received as part of this distribution. +# you should have received as part of this distribution. # # You may opt to use, copy, modify, merge, publish, distribute and/or sell # copies of the Software, and permit persons to whom the Software is @@ -20,11 +20,16 @@ # ############################################################################*/ -#pragma once +#include +#include -#include -#include -#include +using dict_t = std::map; -#include -#include "config.hpp" +namespace fixture +{ + auto get_buff_content() -> std::string; + auto get_dir_name() -> std::string; + auto get_file_content() -> std::string; + auto get_file_name() -> std::string; + auto get_options() -> dict_t; +} diff --git a/tests/list.cpp b/tests/list.cpp index 58bb223..1ae461e 100644 --- a/tests/list.cpp +++ b/tests/list.cpp @@ -2,14 +2,14 @@ # __ __ _____ _____ # Project | | | | | \ / ___| # | |__| | | |\ \ / / -# | | | | ) ) ( ( +# | | | | ) ) ( ( # | /\ | | |/ / \ \___ # \_/ \_/ |_____/ \_____| # -# Copyright (C) 2016, The WDC Project, , et al. +# Copyright (C) 2018, The WDC Project, , et al. # # This software is licensed as described in the file LICENSE, which -# you should have received as part of this distribution. +# you should have received as part of this distribution. # # You may opt to use, copy, modify, merge, publish, distribute and/or sell # copies of the Software, and permit persons to whom the Software is @@ -20,17 +20,27 @@ # ############################################################################*/ -#include "stdafx.h" -#include "catch.hpp" +#include -SCENARIO("Client must list a remote files and a remote directories", "[list]") { +#include "fixture.hpp" - std::unique_ptr client(WebDAV::Client::Init(options)); +#include - GIVEN("A remote directory with 5 files and 5 directories") { +#include - std::string root = "dir_with_files_and_dirs/"; +SCENARIO("Client must list a remote files and a remote directories", "[list]") +{ + auto options = fixture::get_options(); + auto content = fixture::get_buff_content(); + auto dirname = fixture::get_dir_name(); + CAPTURE(dirname); + + std::unique_ptr client{ new WebDAV::Client{ options } }; + + GIVEN("A remote directory with 5 files and 5 directories") + { + std::string root = dirname; std::string template_filename = "file"; std::string template_dirname = "dir"; @@ -40,68 +50,79 @@ SCENARIO("Client must list a remote files and a remote directories", "[list]") { for (auto i = 1; i <= 5; ++i) { auto number = std::to_string(i); - auto directory = root + template_dirname + number; - auto file = root + template_filename + number; + auto directory = root + "/" + template_dirname + number; + auto file = root + "/" + template_filename + number; client->create_directory(directory); - client->upload_from(file, (char *)file_content.c_str(), file_content.length()); + client->upload_from(file, (char*)content.c_str(), content.length()); } - WHEN("List the directory") { - + WHEN("List the directory") + { auto resources = client->list(root); - THEN("Get 10 resources") { - + THEN("Get 10 resources") + { CHECK(resources.size() == 10); } } } } -SCENARIO("Client can not list a remote file", "[list][file]") { - - std::unique_ptr client(WebDAV::Client::Init(options)); +SCENARIO("Client can not list a remote file", "[list][file]") +{ + auto options = fixture::get_options(); + auto content = fixture::get_buff_content(); + auto filename = fixture::get_file_name(); - GIVEN("An existing remote file") { + CAPTURE(filename); - std::string existing_file = "file.dat"; + std::unique_ptr client{ new WebDAV::Client{ options } }; - client->upload_from(existing_file, (char *)file_content.c_str(), file_content.length()); + GIVEN("An existing remote file") + { + std::string existing_file = filename; - WHEN("List content of the file") { + client->upload_from(existing_file, (char*)content.c_str(), content.length()); + WHEN("List content of the file") + { REQUIRE(client->check(existing_file)); auto resources = client->list(existing_file); - THEN("Get an empty list") { - + THEN("Get an empty list") + { CHECK(resources.empty()); } } } } -SCENARIO("Client can list an empty remote directory", "[list][empty]") { +SCENARIO("Client can list an empty remote directory", "[list][empty]") +{ + auto options = fixture::get_options(); + auto dirname = fixture::get_dir_name(); - std::unique_ptr client(WebDAV::Client::Init(options)); + CAPTURE(dirname); - GIVEN("An empty remote directory") { + std::unique_ptr client{ new WebDAV::Client{ options } }; - std::string empty_directory = "empty_directory/"; + GIVEN("An empty remote directory") + { + std::string empty_directory = dirname; client->create_directory(empty_directory); - WHEN("List content of the directory") { - + WHEN("List content of the directory") + { REQUIRE(client->check(empty_directory)); auto resources = client->list(empty_directory); - THEN("Get an empty list") { - + THEN("Get an empty list") + { CHECK(resources.empty()); } } } -} \ No newline at end of file +} diff --git a/tests/main.cpp b/tests/main.cpp index 2c8a2ca..4985851 100644 --- a/tests/main.cpp +++ b/tests/main.cpp @@ -2,14 +2,14 @@ # __ __ _____ _____ # Project | | | | | \ / ___| # | |__| | | |\ \ / / -# | | | | ) ) ( ( +# | | | | ) ) ( ( # | /\ | | |/ / \ \___ # \_/ \_/ |_____/ \_____| # -# Copyright (C) 2016, The WDC Project, , et al. +# Copyright (C) 2018, The WDC Project, , et al. # # This software is licensed as described in the file LICENSE, which -# you should have received as part of this distribution. +# you should have received as part of this distribution. # # You may opt to use, copy, modify, merge, publish, distribute and/or sell # copies of the Software, and permit persons to whom the Software is @@ -20,7 +20,5 @@ # ############################################################################*/ -#include "stdafx.h" - #define CATCH_CONFIG_MAIN -#include "catch.hpp" \ No newline at end of file +#include diff --git a/tests/stdafx.cpp b/tests/stdafx.cpp deleted file mode 100644 index f1f22fc..0000000 --- a/tests/stdafx.cpp +++ /dev/null @@ -1,23 +0,0 @@ -/*#*************************************************************************** -# __ __ _____ _____ -# Project | | | | | \ / ___| -# | |__| | | |\ \ / / -# | | | | ) ) ( ( -# | /\ | | |/ / \ \___ -# \_/ \_/ |_____/ \_____| -# -# Copyright (C) 2016, The WDC Project, , et al. -# -# This software is licensed as described in the file LICENSE, which -# you should have received as part of this distribution. -# -# You may opt to use, copy, modify, merge, publish, distribute and/or sell -# copies of the Software, and permit persons to whom the Software is -# furnished to do so, under the terms of the LICENSE file. -# -# This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY -# KIND, either express or implied. -# -############################################################################*/ - -#include "stdafx.h" \ No newline at end of file diff --git a/tests/upload.cpp b/tests/upload.cpp index 88feeb2..83f940e 100644 --- a/tests/upload.cpp +++ b/tests/upload.cpp @@ -2,14 +2,14 @@ # __ __ _____ _____ # Project | | | | | \ / ___| # | |__| | | |\ \ / / -# | | | | ) ) ( ( +# | | | | ) ) ( ( # | /\ | | |/ / \ \___ # \_/ \_/ |_____/ \_____| # -# Copyright (C) 2016, The WDC Project, , et al. +# Copyright (C) 2018, The WDC Project, , et al. # # This software is licensed as described in the file LICENSE, which -# you should have received as part of this distribution. +# you should have received as part of this distribution. # # You may opt to use, copy, modify, merge, publish, distribute and/or sell # copies of the Software, and permit persons to whom the Software is @@ -20,83 +20,111 @@ # ############################################################################*/ -#include "stdafx.h" -#include "catch.hpp" +#include -SCENARIO("Client must upload buffer", "[upload][buffer]") { +#include "fixture.hpp" - std::unique_ptr client(WebDAV::Client::Init(options)); +#include - GIVEN("A buffer") { +#include +#include +#include - std::string buffer = "content of the buffer"; - std::string remote_resource = "file.dat"; +SCENARIO("Client must upload buffer", "[upload][buffer]") +{ + auto options = fixture::get_options(); + auto content = fixture::get_buff_content(); + auto filename = fixture::get_file_name(); - auto buffer_pointer = const_cast(buffer.c_str()); - auto buffer_size = buffer.length() * sizeof(buffer.c_str()[0]); + CAPTURE(filename); - WHEN("Upload the buffer") { + std::unique_ptr client{ new WebDAV::Client{ options } }; - REQUIRE(client->clean(remote_resource)); - REQUIRE(!client->check(remote_resource)); + GIVEN("A buffer") + { + std::string remote_resource = filename; - auto is_success = client->upload_from(remote_resource, buffer_pointer, buffer_size); + auto buffer_pointer = const_cast(content.c_str()); + auto buffer_size = content.length() * sizeof(content.c_str()[0]); - THEN("buffer must be uploaded") { + WHEN("Upload the buffer") + { + REQUIRE(client->clean(remote_resource)); + REQUIRE(!client->check(remote_resource)); - CHECK(is_success); - CHECK(client->check(remote_resource)); - } - } - } -} - -SCENARIO("Client must upload stream", "[upload][string][stream]") { + auto is_success = client->upload_from(remote_resource, buffer_pointer, buffer_size); - std::unique_ptr client(WebDAV::Client::Init(options)); + THEN("buffer must be uploaded") + { - GIVEN("A stream") { + CHECK(is_success); + CHECK(client->check(remote_resource)); + } + } + } +} - std::stringstream stream("content of the stream"); - std::string remote_resource = "file.dat"; +SCENARIO("Client must upload string stream", "[upload][string][stream]") +{ + auto options = fixture::get_options(); + auto content = fixture::get_buff_content(); + auto filename = fixture::get_file_name(); - WHEN("Upload the stream") { + CAPTURE(filename); - REQUIRE(client->clean(remote_resource)); - REQUIRE(!client->check(remote_resource)); + std::unique_ptr client{ new WebDAV::Client{ options } }; - auto is_success = client->upload_from(remote_resource, stream); + GIVEN("A stream") + { + std::stringstream stream(content); + std::string remote_resource = filename; - THEN("stream must be uploaded") { + WHEN("Upload the stream") + { + REQUIRE(client->clean(remote_resource)); + REQUIRE(!client->check(remote_resource)); - CHECK(is_success); - CHECK(client->check(remote_resource)); - } - } - } -} + auto is_success = client->upload_from(remote_resource, stream); -SCENARIO("Client must upload file stream", "[upload][file][stream]") { + THEN("stream must be uploaded") + { + CHECK(is_success); + CHECK(client->check(remote_resource)); + } + } + } +} - std::unique_ptr client(WebDAV::Client::Init(options)); +SCENARIO("Client must upload file stream", "[upload][file][stream]") +{ + auto options = fixture::get_options(); + auto content = fixture::get_file_content(); + auto filename = fixture::get_file_name(); - GIVEN("A stream") { + CAPTURE(filename); - std::fstream stream("C:\\Users\\host\\Downloads\\libyaml-master.zip", std::ios::binary | std::ios::in | std::ios::out); - std::string remote_resource = "libyaml-master.zip"; + std::unique_ptr client{ new WebDAV::Client{ options } }; - WHEN("Upload the stream") { + GIVEN("A stream") + { + std::ofstream out(filename); + out << content; - REQUIRE(client->clean(remote_resource)); - REQUIRE(!client->check(remote_resource)); + std::ifstream in(filename, std::ios::binary); + std::string remote_resource = filename; - auto is_success = client->upload_from(remote_resource, stream); + WHEN("Upload the stream") + { + REQUIRE(client->clean(remote_resource)); + REQUIRE(!client->check(remote_resource)); - THEN("stream must be uploaded") { + auto is_success = client->upload_from(remote_resource, in); - CHECK(is_success); - CHECK(client->check(remote_resource)); - } - } - } -} \ No newline at end of file + THEN("stream must be uploaded") + { + CHECK(is_success); + CHECK(client->check(remote_resource)); + } + } + } +} diff --git a/tools/build_package.deb.sh b/tools/build_package.deb.sh deleted file mode 100755 index 49f1e59..0000000 --- a/tools/build_package.deb.sh +++ /dev/null @@ -1,19 +0,0 @@ -mkdir doc-pak -cp ../AUTHORS ../LICENSE ./doc-pak -cp ../README.md ./doc-pak/README -cp ../DESCRIPTION ./description-pak - -checkinstall -y --type=debian \ - --install=no \ - --pkgname=libwdc-dev \ - --pkgversion=$(git describe --abbrev=0 --tags | sed 's,^v,,') \ - --pkglicense=MIT \ - --pkgrelease=1 \ - --pkgsource="https://github.com/designerror/webdav-client-cpp" \ - --requires="$(cat ../REQUIREMENTS.UNIX.txt | sed ':a;N;$!ba;s/\n/,/g' | sed 's/(/\\(/g' | sed 's/)/\\)/g' | sed 's/>/\\>/g')" \ - --provides=wdc \ - --backup=no \ - --nodoc \ - --maintainer="designerror@ya.ru" \ - --pkggroup="wdc" - diff --git a/tools/build_package.rpm.sh b/tools/build_package.rpm.sh deleted file mode 100755 index c3fa253..0000000 --- a/tools/build_package.rpm.sh +++ /dev/null @@ -1,20 +0,0 @@ -mkdir doc-pak -cp ../AUTHORS ../LICENSE ./doc-pak -cp ../README.md ./doc-pak/README -cp ../DESCRIPTION ./description-pak - -checkinstall -y --type=rpm \ - --install=no \ - --fstrans=yes \ - --pkgname=libwdc-dev \ - --pkgversion=$(git describe --abbrev=0 --tags | sed 's,^v,,') \ - --pkglicense=MIT \ - --pkgrelease=1 \ - --pkgsource="https://github.com/designerror/webdav-client-cpp" \ - --requires="$(cat ../REQUIREMENTS.UNIX.txt | sed ':a;N;$!ba;s/\n/,/g' | sed 's/(/\\(/g' | sed 's/)/\\)/g' | sed 's/>/\\>/g')" \ - --provides=wdc \ - --backup=no \ - --nodoc \ - --maintainer="designerror@ya.ru" \ - --pkggroup="wdc" - diff --git a/tools/build_requirements.cygwin.sh b/tools/build_requirements.cygwin.sh deleted file mode 100644 index 11cb1fe..0000000 --- a/tools/build_requirements.cygwin.sh +++ /dev/null @@ -1,20 +0,0 @@ -echo "Install OpenSSL@1.0.2g" -wget https://github.com/openssl/openssl/archive/OpenSSL_1_0_2g.tar.gz -O OpenSSL_1_0_2g.tar.gz -tar -xf OpenSSL_1_0_2g.tar.gz && cd openssl-OpenSSL_1_0_2g -./config -make && make install_sw -cd .. && rm -rf openssl-OpenSSL_1_0_2g && rm -f OpenSSL_1_0_2g.tar.gz - -echo "Install CURL@7.4.8" -wget https://github.com/curl/curl/archive/curl-7_48_0.tar.gz -O curl-7_48_0.tar.gz -tar -xf curl-7_48_0.tar.gz && cd curl-curl-7_48_0 -mkdir build && cd build && cmake .. -make && make install -cd ../.. && rm -rf curl-curl-7_48_0 && rm -f curl-7_48_0.tar.gz - -echo "Install pugixml@1.7.0" -wget https://github.com/zeux/pugixml/releases/download/v1.7/pugixml-1.7.tar.gz -O pugixml-1.7.tar.gz -tar -xf pugixml-1.7.tar.gz && cd pugixml-1.7 -mkdir build && cd build && cmake ../scripts/ -make && make install -cd ../.. && rm -rf pugixml-1.7 && rm -f pugixml-1.7.tar.gz diff --git a/tools/build_requirements.unix.sh b/tools/build_requirements.unix.sh deleted file mode 100755 index 5b115d2..0000000 --- a/tools/build_requirements.unix.sh +++ /dev/null @@ -1,20 +0,0 @@ -echo "Install OpenSSL@1.0.2g" -wget https://github.com/openssl/openssl/archive/OpenSSL_1_0_2g.tar.gz -O OpenSSL_1_0_2g.tar.gz -tar -xf OpenSSL_1_0_2g.tar.gz && cd openssl-OpenSSL_1_0_2g -./config -make && sudo make install_sw -cd .. && rm -rf openssl-OpenSSL_1_0_2g && rm -f OpenSSL_1_0_2g.tar.gz - -echo "Install CURL@7.4.8" -wget https://github.com/curl/curl/archive/curl-7_48_0.tar.gz -O curl-7_48_0.tar.gz -tar -xf curl-7_48_0.tar.gz && cd curl-curl-7_48_0 -mkdir build && cd build && cmake .. -make && sudo make install -cd ../.. && rm -rf curl-curl-7_48_0 && rm -f curl-7_48_0.tar.gz - -echo "Install pugixml@1.7.0" -wget https://github.com/zeux/pugixml/releases/download/v1.7/pugixml-1.7.tar.gz -O pugixml-1.7.tar.gz -tar -xf pugixml-1.7.tar.gz && cd pugixml-1.7 -mkdir build && cd build && cmake ../scripts/ -make && sudo make install -cd ../.. && rm -rf pugixml-1.7 && rm -f pugixml-1.7.tar.gz diff --git a/tools/build_requirements.win.bat b/tools/build_requirements.win.bat deleted file mode 100755 index 9a7610e..0000000 --- a/tools/build_requirements.win.bat +++ /dev/null @@ -1,37 +0,0 @@ -rem 1. Download requirements -git submodule update --init - -rem 2. Set the build options -set BUILD_TYPE=Release -set BUILD_SHARED_LIBS=FALSE -set OPENSSL_BUILD_PLATFORM=VC-WIN64A -set INSTALL_PREFIX=%cd%\build -set CMAKE_COMMON_FLAGS=-DCMAKE_BUILD_TYPE=%BUILD_TYPE% -DMSVC_SHRED_RT:BOOL=%BUILD_SHARED_LIBS% - -rem 3. Build and local install openssl -cd vendor\openssl -if not exist build (mkdir build && cd build) else (rmdir /S/Q build && mkdir build && cd build) -perl ../Configure --prefix=%INSTALL_PREFIX% --openssldir=%INSTALL_PREFIX%\ssl %OPENSSL_BUILD_PLATFORM% no-shared no-idea no-unit-test -nmake -nmake install -cd ..\.. - -rem 4. Build and local install curl -cd curl -if not exist build (mkdir build && cd build) else (rmdir /S/Q build && mkdir build && cd build) -cmake .. -DCMAKE_INSTALL_PREFIX=%INSTALL_PREFIX% -DCURL_STATICLIB:BOOL=ON -DBUILD_TESTING:BOOL=OFF -DBUILD_CURL_TESTS:BOOL=OFF -DBUILD_CURL_EXE:BOOL=OFF -DCURL_DISABLE_LDAP:BOOL=ON -DCURL_DISABLE_LDAPS=ON %CMAKE_COMMON_FLAGS% -nmake -nmake install -cd ..\.. - -rem 5. Build and local install pugixml -cd pugixml -if not exist build (mkdir build && cd build) else (rmdir /S/Q build && mkdir build && cd build) -cmake .. -DCMAKE_INSTALL_PREFIX=%INSTALL_PREFIX% %CMAKE_COMMON_FLAGS% -nmake -nmake install -cd ..\.. - - -rem 6. Go back -cd .. diff --git a/tools/polly/.gitignore b/tools/polly/.gitignore new file mode 100644 index 0000000..f4f7a55 --- /dev/null +++ b/tools/polly/.gitignore @@ -0,0 +1,11 @@ +.DS_Store +*/.DS_Store +*/*/.DS_Store +*.*~ + +docs/_build +docs/activate.sh + +bin/detail/__pycache__ +*.pyc +/.vs diff --git a/tools/polly/.gitmodules b/tools/polly/.gitmodules new file mode 100644 index 0000000..3d2ca01 --- /dev/null +++ b/tools/polly/.gitmodules @@ -0,0 +1,3 @@ +[submodule "docs/rtfd-css"] + path = docs/rtfd-css + url = https://github.com/ruslo/rtfd-css diff --git a/tools/polly/.travis.yml b/tools/polly/.travis.yml new file mode 100644 index 0000000..793fc46 --- /dev/null +++ b/tools/polly/.travis.yml @@ -0,0 +1,117 @@ +# OSX/Linux (https://github.com/travis-ci-tester/toolchain-table) + +# Workaround for https://github.com/travis-ci/travis-ci/issues/8363 +language: + - minimal + +# Container-based infrastructure (Linux) +# * https://docs.travis-ci.com/user/migrating-from-legacy/#How-can-I-use-container-based-infrastructure%3F +sudo: + - false + +# Install packages differs for container-based infrastructure +# * https://docs.travis-ci.com/user/migrating-from-legacy/#How-do-I-install-APT-sources-and-packages%3F +addons: + apt: + sources: + - ubuntu-toolchain-r-test + packages: + - python3-pip + + - g++-5 + - gcc-5 + - g++-7 + - gcc-7 + +dist: + - trusty + +matrix: + include: + # Linux { + + - os: linux + env: EXAMPLE=01-executable TOOLCHAIN=gcc CONFIG=Release + + - os: linux + env: EXAMPLE=01-executable TOOLCHAIN=android-ndk-r15c-api-21-armeabi-v7a-neon-clang-libcxx CONFIG=Release + + - os: linux + env: EXAMPLE=01-executable TOOLCHAIN=gcc-5-cxx14-c11 CONFIG=Release + + - os: linux + env: EXAMPLE=01-executable TOOLCHAIN=gcc-7-cxx17 CONFIG=Release + + # Clang5 included in Travis CI trusty image + - os: linux + env: EXAMPLE=01-executable TOOLCHAIN=clang-5-cxx14 CONFIG=Release + - os: linux + env: EXAMPLE=01-executable TOOLCHAIN=clang-5-cxx17 CONFIG=Release + + - os: linux + env: EXAMPLE=02-library TOOLCHAIN=gcc CONFIG=Release + + - os: linux + env: EXAMPLE=03-shared-link TOOLCHAIN=gcc CONFIG=Release + + # } + + # osx { + + - os: osx + osx_image: xcode9.4 + env: EXAMPLE=01-executable TOOLCHAIN=osx-10-13 CONFIG=Release + + - os: osx + osx_image: xcode9.4 + env: EXAMPLE=01-executable TOOLCHAIN=ios-nocodesign-11-4-dep-9-3-armv7 CONFIG=Release + + - os: osx + osx_image: xcode10.1 + env: EXAMPLE=01-executable TOOLCHAIN=ios-nocodesign-12-1-dep-9-3-armv7 CONFIG=Release + + # } + +install: + # Info about OS + - uname -a + + - export HOMEBREW_NO_AUTO_UPDATE=1 + + # Install Python 3 + - if [[ "`uname`" == "Darwin" ]]; then travis_retry brew install python3; fi + + # Install Python package 'requests' + # 'easy_install3' is not installed by 'brew install python3' on OS X 10.9 Maverick + - if [[ "`uname`" == "Darwin" ]]; then pip3 install requests; fi + - if [[ "`uname`" == "Linux" ]]; then travis_retry pip3 install --user requests; fi + # fix broken clang link on Travis-CI + - if [[ "`uname`" == "Linux" ]]; then mkdir clang-bin; ln -s /usr/local/clang-5.0.0/bin/clang++ clang-bin/clang++-5.0; fi + - if [[ "`uname`" == "Darwin" ]]; then mkdir clang-bin; ln -s /usr/bin/clang++ clang-bin/clang++-5.0; fi + + # Install dependencies (CMake, Android NDK) + - POLLY_SOURCE_DIR="`pwd`" + - python3 "${POLLY_SOURCE_DIR}/bin/install-ci-dependencies.py" + + # Tune locations + - export PATH="`pwd`/_ci/cmake/bin:`pwd`/clang-bin:${PATH}" + # Installed if toolchain is Android (otherwise directory doesn't exist) + - export ANDROID_NDK_r10e="`pwd`/_ci/android-ndk-r10e" + - export ANDROID_NDK_r11c="`pwd`/_ci/android-ndk-r11c" + - export ANDROID_NDK_r15c="`pwd`/_ci/android-ndk-r15c" + - export ANDROID_NDK_r17="`pwd`/_ci/android-ndk-r17" + +script: + - > + python3 "${POLLY_SOURCE_DIR}/bin/build.py" + --home examples/${EXAMPLE} + --toolchain ${TOOLCHAIN} + --config ${CONFIG} + --verbose + --clear + --install + --test + +branches: + except: + - /^pr\..*/ diff --git a/tools/polly/CONTRIBUTING.md b/tools/polly/CONTRIBUTING.md new file mode 100644 index 0000000..e4c1417 --- /dev/null +++ b/tools/polly/CONTRIBUTING.md @@ -0,0 +1,7 @@ +Please send a patch as a pull request against the branch master. + +Also try to follow general notes from here: +* https://github.com/ruslo/hunter/wiki/dev.contribution + +Add new toolchain to toolchain table: +* https://github.com/ruslo/polly/blob/master/bin/detail/toolchain_table.py diff --git a/tools/polly/LICENSE b/tools/polly/LICENSE new file mode 100644 index 0000000..4fddff1 --- /dev/null +++ b/tools/polly/LICENSE @@ -0,0 +1,23 @@ +Copyright (c) 2013, Ruslan Baratov +All rights reserved. + +Redistribution and use in source and binary forms, with or without modification, +are permitted provided that the following conditions are met: + +* Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + +* Redistributions in binary form must reproduce the above copyright notice, this + list of conditions and the following disclaimer in the documentation and/or + other materials provided with the distribution. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR +ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON +ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/tools/polly/README.md b/tools/polly/README.md new file mode 100644 index 0000000..3c90196 --- /dev/null +++ b/tools/polly/README.md @@ -0,0 +1,168 @@ +### Polly + +[![Join the chat at https://gitter.im/polly-cmake/Lobby](https://badges.gitter.im/polly-cmake/Lobby.svg)](https://gitter.im/polly-cmake/Lobby?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge) + +Collection of CMake toolchain files and scripts. + +| Linux/OSX | Windows | +|-------------------------------------------------|-----------------------------------------------------| +| [![Build Status][travis_status]][travis_builds] | [![Build Status][appveyor_status]][appveyor_builds] | + +[travis_status]: https://travis-ci.org/ruslo/polly.svg?branch=master +[travis_builds]: https://travis-ci.org/ruslo/polly/builds + +[appveyor_status]: https://ci.appveyor.com/api/projects/status/8x6thwc05mhvdxmo?svg=true +[appveyor_builds]: https://ci.appveyor.com/project/ruslo/polly/history + +Every toolchain defines compiler/flags and two variables: +* `POLLY_TOOLCHAIN_NAME` +* `POLLY_TOOLCHAIN_TAG` + +[First](https://github.com/ruslo/polly/wiki/Used-variables#polly_toolchain_name) +variable will be printed while processing file: +``` +-- [polly] Used toolchain: Name of toolchain A +-- The CXX compiler identification is Clang 5.0.0 +-- Check for working CXX compiler: /usr/bin/c++ +-- [polly] Used toolchain: Name of toolchain A +-- Check for working CXX compiler: /usr/bin/c++ -- works +-- Detecting CXX compiler ABI info +-- [polly] Used toolchain: Name of toolchain A +-- Detecting CXX compiler ABI info - done +-- [polly] Used toolchain: Name of toolchain A +-- Configuring done +-- Generating done +-- Build files have been written to: ... +``` +[Second](https://github.com/ruslo/polly/wiki/Used-variables#polly_toolchain_tag) +variable coincide with toolchain file name and *can* be used to define `CMAKE_INSTALL_PREFIX` like: +```cmake +set(CMAKE_INSTALL_PREFIX "${PROJECT_SOURCE_DIR}/_install/${POLLY_TOOLCHAIN_TAG}") +``` +In this case targets can coexist simultaneously: +``` + - Project\ - + - CMakeLists.txt + - sources\ + - documentation\ + - ... + - _install\ - + - toolchain-A\ + - toolchain-B\ + - toolchain-C\ + - ... +``` + +*Note*: This is a core idea of the tagged builds in [hunter](https://github.com/ruslo/hunter#tagged-builds) package manager. + +## New documentation + +* https://polly.readthedocs.io + +## Toolchains + +* [default](https://github.com/ruslo/polly/wiki/Toolchain-list#default) +* [libcxx](https://github.com/ruslo/polly/wiki/Toolchain-list#libcxx) +* [clang-lto](https://github.com/ruslo/polly/wiki/Toolchain-list#clang-lto) +* [clang-libstdcxx](https://github.com/ruslo/polly/wiki/Toolchain-list#clang-libstdcxx) +* [custom-libcxx](https://github.com/ruslo/polly/wiki/Toolchain-list#custom-libcxx) +* [xcode](https://github.com/ruslo/polly/wiki/Toolchain-list#xcode) +* [osx-*](https://github.com/ruslo/polly/wiki/Toolchain-list#osx-a-b) +* [gcc](https://github.com/ruslo/polly/wiki/Toolchain-list#gcc) +* [gcc-4-8](https://github.com/ruslo/polly/wiki/Toolchain-list#gcc-4-8) +* Android + * [android-ndk-*](https://github.com/ruslo/polly/wiki/Toolchain-list#android-ndk-xxx) +* iOS + * [ios](https://github.com/ruslo/polly/wiki/Toolchain-list#ios) + * [ios-i386-armv7](https://github.com/ruslo/polly/wiki/Toolchain-list#ios-i386-armv7) + * [ios-nocodesign](https://github.com/ruslo/polly/wiki/Toolchain-list#ios-nocodesign) +* Raspberry Pi + * [raspberrypi2-cxx11](https://github.com/ruslo/polly/wiki/Toolchain-list#raspberrypi2-cxx11) +* Clang tools + * [analyze](https://github.com/ruslo/polly/wiki/Toolchain-list#analyze) + * [sanitize-address](https://github.com/ruslo/polly/wiki/Toolchain-list#sanitize-address) + * [sanitize-leak](https://github.com/ruslo/polly/wiki/Toolchain-list#sanitize-leak) + * [sanitize-memory](https://github.com/ruslo/polly/wiki/Toolchain-list#sanitize-memory) + * [sanitize-thread](https://github.com/ruslo/polly/wiki/Toolchain-list#sanitize-thread) +* Windows + * [vs-12-2013-win64](https://github.com/ruslo/polly/wiki/Toolchain-list#vs-12-2013-win64) + * [vs-12-2013](https://github.com/ruslo/polly/wiki/Toolchain-list#vs-12-2013) + * [vs-12-2013-xp](https://github.com/ruslo/polly/wiki/Toolchain-list#vs-12-2013-xp) + * [cygwin](https://github.com/ruslo/polly/wiki/Toolchain-list#cygwin) + * [mingw](https://github.com/ruslo/polly/wiki/Toolchain-list#mingw) + * [msys](https://github.com/ruslo/polly/wiki/Toolchain-list#msys) + * [nmake-vs-12-2013-win64](https://github.com/ruslo/polly/wiki/Toolchain-list#nmake-vs-12-2013-win64) + * [nmake-vs-12-2013](https://github.com/ruslo/polly/wiki/Toolchain-list#nmake-vs-12-2013) +* Cross compiling + * [linux-gcc-x64](https://github.com/ruslo/polly/wiki/Toolchain-list#linux-gcc-x64) + +## Usage +Just define [CMAKE_TOOLCHAIN_FILE][3] variable: +```bash +> cmake -H. -B_builds/clang-libstdcxx -DCMAKE_TOOLCHAIN_FILE=${POLLY_ROOT}/clang-libstdcxx.cmake -DCMAKE_VERBOSE_MAKEFILE=ON +-- [polly] Used toolchain: clang / GNU Standard C++ Library (libstdc++) / c++11 support +-- The CXX compiler identification is Clang 5.0.0 +-- Check for working CXX compiler: /usr/bin/c++ +-- [polly] Used toolchain: clang / GNU Standard C++ Library (libstdc++) / c++11 support +-- Check for working CXX compiler: /usr/bin/c++ -- works +-- Detecting CXX compiler ABI info +-- [polly] Used toolchain: clang / GNU Standard C++ Library (libstdc++) / c++11 support +-- Detecting CXX compiler ABI info - done +-- Configuring done +-- Generating done +-- Build files have been written to: /.../_builds/make-debug +``` +Take a look at make output, you must [see][6] `-stdlib=libstdc++` string: +``` +> cmake --build _builds/clang_libstdcxx +/usr/bin/c++ -std=c++11 -stdlib=libstdc++ -o CMakeFiles/.../main.cpp.o -c /.../main.cpp +``` + +## polly.py + +This is a python [script](https://github.com/ruslo/polly/tree/master/bin) that wrap cmake for you and automatically set: +* build directory for your toolchain. E.g. `_builds/xcode`, `_builds/libcxx-Debug`, `_builds/nmake-Release` +* local install directory. E.g. `_install/vs-12-2013-x64`, `_install/libcxx` +* start an IDE project (Xcode, Visual Studio) if option `--open` passed +* run `ctest` after the build done if option `--test` passed +* run `cpack` after the build done if option `--pack` passed +* create `OS X`/`iOS` framework if option `--framework` passed (can be used for broken iOS framework creation on CMake) + +Example of usage (also see `polly.py --help`): +* build Debug Xcode project: + * `polly.py --toolchain xcode --config Debug` (`_builds/xcode`) +* build and test Release Makefile project with `libcxx`: + * `polly.py --toolchain libcxx --config Release --test` (`_builds/libcxx-Release`) +* install Debug Xcode project: + * `polly.py --toolchain xcode --config Debug --install` (`_builds/xcode`, `_install/xcode`) + +## Examples +See [examples](https://github.com/ruslo/polly/tree/master/examples). +Please [read](https://github.com/ruslo/0/wiki/CMake) coding style and +agreements before start looking through examples (may explain a lot). +Take a look at the [Travis](https://travis-ci.org/) config files: +[mac](https://github.com/ruslo/polly/blob/master/.travis.yml) and [linux](https://github.com/ruslo/polly/blob/linux/.travis.yml), +it's quite self-explanatory. + +## Contributing + +See [CONTRIBUTING.md](https://github.com/ruslo/polly/blob/master/CONTRIBUTING.md). + +## Links + +* [Hunter package manager](https://github.com/ruslo/hunter) +* [Installation on Jenkins](https://github.com/ruslo/polly/wiki/Jenkins) +* Travis example: +[Mac OS X](https://travis-ci.org/forexample/hunter-simple/builds/28155372) and +[Linux](https://travis-ci.org/forexample/hunter-simple/builds/28154503) +* [Table of toolchains available for Travis CI/AppVeyor][7] +* [Travis, AppVeyor => GitHub deploy example](https://github.com/forexample/github-binary-release) + +[1]: https://github.com/ruslo/sugar/tree/master/cmake/core#sugar_install_ios_library +[2]: https://github.com/ruslo/sugar/tree/master/cmake/core#sugar_install_library +[3]: http://www.cmake.org/Wiki/CMake_Cross_Compiling#The_toolchain_file +[4]: https://github.com/ruslo/gitenv/blob/master/gitenv/paths.sh +[5]: https://github.com/ruslo/configs +[6]: https://travis-ci.org/ruslo/polly/jobs/14486268#L939 +[7]: https://github.com/ruslo/polly/wiki/Travis-CI-AppVeyor-support-table +[8]: https://github.com/ruslo/polly/blob/master/bin/polly.py diff --git a/tools/polly/analyze-cxx17.cmake b/tools/polly/analyze-cxx17.cmake new file mode 100644 index 0000000..91d9bc7 --- /dev/null +++ b/tools/polly/analyze-cxx17.cmake @@ -0,0 +1,26 @@ +# Copyright (c) 2014, 2018 Ruslan Baratov +# All rights reserved. + +if(DEFINED POLLY_ANALYZE_CXX17_CMAKE_) + return() +else() + set(POLLY_ANALYZE_CXX17_CMAKE_ 1) +endif() + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_init.cmake") + +polly_init( + "Clang static analyzer / c++17 support" + "Unix Makefiles" +) + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_common.cmake") + +include("${CMAKE_CURRENT_LIST_DIR}/flags/cxx17.cmake") + +set(CMAKE_CXX_COMPILER "${CMAKE_CURRENT_LIST_DIR}/scripts/clangxx-analyze.sh") +set(CMAKE_C_COMPILER "${CMAKE_CURRENT_LIST_DIR}/scripts/clang-analyze.sh") + +list(APPEND HUNTER_TOOLCHAIN_UNDETECTABLE_ID "analyze") + +include("${CMAKE_CURRENT_LIST_DIR}/os/osx.cmake") diff --git a/tools/polly/analyze.cmake b/tools/polly/analyze.cmake new file mode 100644 index 0000000..db498a4 --- /dev/null +++ b/tools/polly/analyze.cmake @@ -0,0 +1,26 @@ +# Copyright (c) 2014, Ruslan Baratov +# All rights reserved. + +if(DEFINED POLLY_ANALYZE_CMAKE_) + return() +else() + set(POLLY_ANALYZE_CMAKE_ 1) +endif() + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_init.cmake") + +polly_init( + "Clang static analyzer / c++11 support" + "Unix Makefiles" +) + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_common.cmake") + +include("${CMAKE_CURRENT_LIST_DIR}/flags/cxx11.cmake") + +set(CMAKE_CXX_COMPILER "${CMAKE_CURRENT_LIST_DIR}/scripts/clangxx-analyze.sh") +set(CMAKE_C_COMPILER "${CMAKE_CURRENT_LIST_DIR}/scripts/clang-analyze.sh") + +list(APPEND HUNTER_TOOLCHAIN_UNDETECTABLE_ID "analyze") + +include("${CMAKE_CURRENT_LIST_DIR}/os/osx.cmake") diff --git a/tools/polly/android-ndk-r10e-api-16-armeabi-v7a-neon-clang-35-hid-sections.cmake b/tools/polly/android-ndk-r10e-api-16-armeabi-v7a-neon-clang-35-hid-sections.cmake new file mode 100644 index 0000000..e1542ec --- /dev/null +++ b/tools/polly/android-ndk-r10e-api-16-armeabi-v7a-neon-clang-35-hid-sections.cmake @@ -0,0 +1,35 @@ +# Copyright (c) 2015, Ruslan Baratov +# Copyright (c) 2015, David Hirvonen +# All rights reserved. + +if(DEFINED POLLY_ANDROID_NDK_R10E_API_16_ARMEABI_V7A_NEON_CLANG_35_HID_SECTIONS_CMAKE_) + return() +else() + set(POLLY_ANDROID_NDK_R10E_API_16_ARMEABI_V7A_NEON_CLANG_35_HID_SECTIONS_CMAKE_ 1) +endif() + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_clear_environment_variables.cmake") + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_init.cmake") + +set(ANDROID_NDK_VERSION "r10e") +set(CMAKE_SYSTEM_VERSION "16") +set(CMAKE_ANDROID_ARCH_ABI "armeabi-v7a") +set(CMAKE_ANDROID_ARM_NEON TRUE) +set(CMAKE_ANDROID_ARM_MODE TRUE) # 32-bit ARM +set(CMAKE_ANDROID_NDK_TOOLCHAIN_VERSION "clang3.5") + +polly_init( + "Android NDK ${ANDROID_NDK_VERSION} / \ +API ${CMAKE_SYSTEM_VERSION} / ${CMAKE_ANDROID_ARCH_ABI} / \ +NEON / 32-bit ARM / Clang 3.5 / c++11 support / data-sections / function-sections" + "Unix Makefiles" +) + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_common.cmake") + +include("${CMAKE_CURRENT_LIST_DIR}/flags/cxx11.cmake") # before toolchain! +include("${CMAKE_CURRENT_LIST_DIR}/flags/hidden.cmake") +include("${CMAKE_CURRENT_LIST_DIR}/flags/function-sections.cmake") +include("${CMAKE_CURRENT_LIST_DIR}/flags/data-sections.cmake") +include("${CMAKE_CURRENT_LIST_DIR}/os/android.cmake") diff --git a/tools/polly/android-ndk-r10e-api-16-armeabi-v7a-neon-clang-35-hid.cmake b/tools/polly/android-ndk-r10e-api-16-armeabi-v7a-neon-clang-35-hid.cmake new file mode 100644 index 0000000..4e58606 --- /dev/null +++ b/tools/polly/android-ndk-r10e-api-16-armeabi-v7a-neon-clang-35-hid.cmake @@ -0,0 +1,33 @@ +# Copyright (c) 2015, Ruslan Baratov +# Copyright (c) 2015, David Hirvonen +# All rights reserved. + +if(DEFINED POLLY_ANDROID_NDK_R10E_API_16_ARMEABI_V7A_NEON_CLANG_35_HID_CMAKE_) + return() +else() + set(POLLY_ANDROID_NDK_R10E_API_16_ARMEABI_V7A_NEON_CLANG_35_HID_CMAKE_ 1) +endif() + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_clear_environment_variables.cmake") + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_init.cmake") + +set(ANDROID_NDK_VERSION "r10e") +set(CMAKE_SYSTEM_VERSION "16") +set(CMAKE_ANDROID_ARCH_ABI "armeabi-v7a") +set(CMAKE_ANDROID_ARM_NEON TRUE) +set(CMAKE_ANDROID_ARM_MODE TRUE) # 32-bit ARM +set(CMAKE_ANDROID_NDK_TOOLCHAIN_VERSION "clang3.5") + +polly_init( + "Android NDK ${ANDROID_NDK_VERSION} / \ +API ${CMAKE_SYSTEM_VERSION} / ${CMAKE_ANDROID_ARCH_ABI} / \ +NEON / 32-bit ARM / Clang 3.5 / c++11 support" + "Unix Makefiles" +) + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_common.cmake") + +include("${CMAKE_CURRENT_LIST_DIR}/flags/cxx11.cmake") # before toolchain! +include("${CMAKE_CURRENT_LIST_DIR}/flags/hidden.cmake") +include("${CMAKE_CURRENT_LIST_DIR}/os/android.cmake") diff --git a/tools/polly/android-ndk-r10e-api-16-armeabi-v7a-neon-clang-35.cmake b/tools/polly/android-ndk-r10e-api-16-armeabi-v7a-neon-clang-35.cmake new file mode 100644 index 0000000..8c3f282 --- /dev/null +++ b/tools/polly/android-ndk-r10e-api-16-armeabi-v7a-neon-clang-35.cmake @@ -0,0 +1,33 @@ +# Copyright (c) 2015, Ruslan Baratov +# Copyright (c) 2015, David Hirvonen +# All rights reserved. + +if(DEFINED POLLY_ANDROID_NDK_R10E_API_16_ARMEABI_V7A_NEON_CLANG_35_CMAKE_) + return() +else() + set(POLLY_ANDROID_NDK_R10E_API_16_ARMEABI_V7A_NEON_CLANG_35_CMAKE_ 1) +endif() + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_clear_environment_variables.cmake") + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_init.cmake") + +set(ANDROID_NDK_VERSION "r10e") +set(CMAKE_SYSTEM_VERSION "16") +set(CMAKE_ANDROID_ARCH_ABI "armeabi-v7a") +set(CMAKE_ANDROID_ARM_NEON TRUE) +set(CMAKE_ANDROID_ARM_MODE TRUE) # 32-bit ARM +set(CMAKE_ANDROID_NDK_TOOLCHAIN_VERSION "clang3.5") + +polly_init( + "Android NDK ${ANDROID_NDK_VERSION} / \ +API ${CMAKE_SYSTEM_VERSION} / ${CMAKE_ANDROID_ARCH_ABI} / \ +NEON / 32-bit ARM / Clang 3.5 / c++11 support" + "Unix Makefiles" +) + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_common.cmake") + +include("${CMAKE_CURRENT_LIST_DIR}/flags/cxx11.cmake") # before toolchain! + +include("${CMAKE_CURRENT_LIST_DIR}/os/android.cmake") diff --git a/tools/polly/android-ndk-r10e-api-16-armeabi-v7a-neon.cmake b/tools/polly/android-ndk-r10e-api-16-armeabi-v7a-neon.cmake new file mode 100644 index 0000000..a36e074 --- /dev/null +++ b/tools/polly/android-ndk-r10e-api-16-armeabi-v7a-neon.cmake @@ -0,0 +1,32 @@ +# Copyright (c) 2015, Ruslan Baratov +# Copyright (c) 2015, David Hirvonen +# All rights reserved. + +if(DEFINED POLLY_ANDROID_NDK_R10E_API_16_ARMEABI_V7A_NEON_CMAKE_) + return() +else() + set(POLLY_ANDROID_NDK_R10E_API_16_ARMEABI_V7A_NEON_CMAKE_ 1) +endif() + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_clear_environment_variables.cmake") + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_init.cmake") + +set(ANDROID_NDK_VERSION "r10e") +set(CMAKE_SYSTEM_VERSION "16") +set(CMAKE_ANDROID_ARCH_ABI "armeabi-v7a") +set(CMAKE_ANDROID_ARM_NEON TRUE) +set(CMAKE_ANDROID_ARM_MODE TRUE) # 32-bit ARM + +polly_init( + "Android NDK ${ANDROID_NDK_VERSION} / \ +API ${CMAKE_SYSTEM_VERSION} / ${CMAKE_ANDROID_ARCH_ABI} / \ +NEON / 32-bit ARM / c++11 support" + "Unix Makefiles" +) + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_common.cmake") + +include("${CMAKE_CURRENT_LIST_DIR}/flags/cxx11.cmake") # before toolchain! + +include("${CMAKE_CURRENT_LIST_DIR}/os/android.cmake") diff --git a/tools/polly/android-ndk-r10e-api-16-x86-hid-sections.cmake b/tools/polly/android-ndk-r10e-api-16-x86-hid-sections.cmake new file mode 100644 index 0000000..e1af18a --- /dev/null +++ b/tools/polly/android-ndk-r10e-api-16-x86-hid-sections.cmake @@ -0,0 +1,36 @@ +# Copyright (c) 2015, Ruslan Baratov, David Hirvonen +# All rights reserved. + +if(DEFINED POLLY_ANDROID_NDK_R10E_API_16_X86_HID_SECTIONS_CMAKE_) + return() +else() + set(POLLY_ANDROID_NDK_R10E_API_16_X86_HID_SECTIONS_CMAKE_ 1) +endif() + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_clear_environment_variables.cmake") + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_init.cmake") + +set(ANDROID_NDK_VERSION "r10e") +set(CMAKE_SYSTEM_VERSION "16") +set(CMAKE_ANDROID_ARCH_ABI "x86") + +polly_init( + "Android NDK ${ANDROID_NDK_VERSION} / \ +API ${CMAKE_SYSTEM_VERSION} / ${CMAKE_ANDROID_ARCH_ABI} / \ +hidden visibility / function-sections / data-sections / \ +c++11 support" + "Unix Makefiles" +) + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_common.cmake") + +include("${CMAKE_CURRENT_LIST_DIR}/flags/cxx11.cmake") # before toolchain! + +include("${CMAKE_CURRENT_LIST_DIR}/flags/hidden.cmake") + +include("${CMAKE_CURRENT_LIST_DIR}/flags/function-sections.cmake") + +include("${CMAKE_CURRENT_LIST_DIR}/flags/data-sections.cmake") + +include("${CMAKE_CURRENT_LIST_DIR}/os/android.cmake") diff --git a/tools/polly/android-ndk-r10e-api-16-x86-hid.cmake b/tools/polly/android-ndk-r10e-api-16-x86-hid.cmake new file mode 100644 index 0000000..2e7b8f3 --- /dev/null +++ b/tools/polly/android-ndk-r10e-api-16-x86-hid.cmake @@ -0,0 +1,32 @@ +# Copyright (c) 2015, Ruslan Baratov, David Hirvonen +# All rights reserved. + +if(DEFINED POLLY_ANDROID_NDK_R10E_API_16_X86_HID_CMAKE_) + return() +else() + set(POLLY_ANDROID_NDK_R10E_API_16_X86_HID_CMAKE_ 1) +endif() + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_clear_environment_variables.cmake") + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_init.cmake") + +set(ANDROID_NDK_VERSION "r10e") +set(CMAKE_SYSTEM_VERSION "16") +set(CMAKE_ANDROID_ARCH_ABI "x86") + +polly_init( + "Android NDK ${ANDROID_NDK_VERSION} / \ +API ${CMAKE_SYSTEM_VERSION} / ${CMAKE_ANDROID_ARCH_ABI} / \ +hidden visibility / \ +c++11 support" + "Unix Makefiles" +) + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_common.cmake") + +include("${CMAKE_CURRENT_LIST_DIR}/flags/cxx11.cmake") # before toolchain! + +include("${CMAKE_CURRENT_LIST_DIR}/flags/hidden.cmake") + +include("${CMAKE_CURRENT_LIST_DIR}/os/android.cmake") diff --git a/tools/polly/android-ndk-r10e-api-16-x86.cmake b/tools/polly/android-ndk-r10e-api-16-x86.cmake new file mode 100644 index 0000000..2496a68 --- /dev/null +++ b/tools/polly/android-ndk-r10e-api-16-x86.cmake @@ -0,0 +1,29 @@ +# Copyright (c) 2015, Ruslan Baratov, David Hirvonen +# All rights reserved. + +if(DEFINED POLLY_ANDROID_NDK_R10E_API_16_X86_CMAKE_) + return() +else() + set(POLLY_ANDROID_NDK_R10E_API_16_X86_CMAKE_ 1) +endif() + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_clear_environment_variables.cmake") + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_init.cmake") + +set(ANDROID_NDK_VERSION "r10e") +set(CMAKE_SYSTEM_VERSION "16") +set(CMAKE_ANDROID_ARCH_ABI "x86") + +polly_init( + "Android NDK ${ANDROID_NDK_VERSION} / \ +API ${CMAKE_SYSTEM_VERSION} / ${CMAKE_ANDROID_ARCH_ABI} / \ +c++11 support" + "Unix Makefiles" +) + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_common.cmake") + +include("${CMAKE_CURRENT_LIST_DIR}/flags/cxx11.cmake") # before toolchain! + +include("${CMAKE_CURRENT_LIST_DIR}/os/android.cmake") diff --git a/tools/polly/android-ndk-r10e-api-19-armeabi-v7a-neon-c11.cmake b/tools/polly/android-ndk-r10e-api-19-armeabi-v7a-neon-c11.cmake new file mode 100644 index 0000000..0ad6b45 --- /dev/null +++ b/tools/polly/android-ndk-r10e-api-19-armeabi-v7a-neon-c11.cmake @@ -0,0 +1,35 @@ +# Copyright (c) 2015-2017, Ruslan Baratov +# Copyright (c) 2015, David Hirvonen +# Copyright (c) 2015, Alexandre Pretyman +# All rights reserved. + +if(DEFINED POLLY_ANDROID_NDK_R10E_API_19_ARMEABI_V7A_NEON_C11_CMAKE_) + return() +else() + set(POLLY_ANDROID_NDK_R10E_API_19_ARMEABI_V7A_NEON_C11_CMAKE_ 1) +endif() + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_clear_environment_variables.cmake") + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_init.cmake") + +set(ANDROID_NDK_VERSION "r10e") +set(CMAKE_SYSTEM_VERSION "19") +set(CMAKE_ANDROID_ARCH_ABI "armeabi-v7a") +set(CMAKE_ANDROID_ARM_NEON TRUE) +set(CMAKE_ANDROID_ARM_MODE TRUE) # 32-bit ARM + +polly_init( + "Android NDK ${ANDROID_NDK_VERSION} / \ +API ${CMAKE_SYSTEM_VERSION} / ${CMAKE_ANDROID_ARCH_ABI} / \ +NEON / 32-bit ARM / c++11 / c11" + "Unix Makefiles" +) + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_common.cmake") + +include("${CMAKE_CURRENT_LIST_DIR}/flags/cxx11.cmake") # before toolchain! + +include("${CMAKE_CURRENT_LIST_DIR}/os/android.cmake") + +include("${CMAKE_CURRENT_LIST_DIR}/flags/c11.cmake") diff --git a/tools/polly/android-ndk-r10e-api-19-armeabi-v7a-neon-clang-libcxx.cmake b/tools/polly/android-ndk-r10e-api-19-armeabi-v7a-neon-clang-libcxx.cmake new file mode 100644 index 0000000..ff69f25 --- /dev/null +++ b/tools/polly/android-ndk-r10e-api-19-armeabi-v7a-neon-clang-libcxx.cmake @@ -0,0 +1,35 @@ +# Copyright (c) 2015, Ruslan Baratov +# Copyright (c) 2015, David Hirvonen +# Copyright (c) 2015, Alexandre Pretyman +# All rights reserved. + +if(DEFINED POLLY_ANDROID_NDK_R10E_API_19_ARMEABI_V7A_NEON_CLANG_LIBCXX_CMAKE_) + return() +else() + set(POLLY_ANDROID_NDK_R10E_API_19_ARMEABI_V7A_NEON_CLANG_LIBCXX_CMAKE_ 1) +endif() + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_clear_environment_variables.cmake") + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_init.cmake") + +set(ANDROID_NDK_VERSION "r10e") +set(CMAKE_SYSTEM_VERSION "19") +set(CMAKE_ANDROID_ARCH_ABI "armeabi-v7a") +set(CMAKE_ANDROID_ARM_NEON TRUE) +set(CMAKE_ANDROID_ARM_MODE TRUE) # 32-bit ARM +set(CMAKE_ANDROID_NDK_TOOLCHAIN_VERSION "clang") +set(CMAKE_ANDROID_STL_TYPE "c++_static") # LLVM libc++ static + +polly_init( + "Android NDK ${ANDROID_NDK_VERSION} / \ +API ${CMAKE_SYSTEM_VERSION} / ${CMAKE_ANDROID_ARCH_ABI} / \ +NEON / 32-bit ARM / Clang / c++11 support / libc++ static" + "Unix Makefiles" +) + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_common.cmake") + +include("${CMAKE_CURRENT_LIST_DIR}/flags/cxx11.cmake") # before toolchain! + +include("${CMAKE_CURRENT_LIST_DIR}/os/android.cmake") diff --git a/tools/polly/android-ndk-r10e-api-19-armeabi-v7a-neon-hid-sections-lto.cmake b/tools/polly/android-ndk-r10e-api-19-armeabi-v7a-neon-hid-sections-lto.cmake new file mode 100644 index 0000000..d6a8799 --- /dev/null +++ b/tools/polly/android-ndk-r10e-api-19-armeabi-v7a-neon-hid-sections-lto.cmake @@ -0,0 +1,41 @@ +# Copyright (c) 2015-2017, Ruslan Baratov +# Copyright (c) 2015, David Hirvonen +# Copyright (c) 2015, Alexandre Pretyman +# All rights reserved. + +if(DEFINED POLLY_ANDROID_NDK_R10E_API_19_ARMEABI_V7A_NEON_HID_SECTIONS_LTO_CMAKE_) + return() +else() + set(POLLY_ANDROID_NDK_R10E_API_19_ARMEABI_V7A_NEON_HID_SECTIONS_LTO_CMAKE_ 1) +endif() + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_clear_environment_variables.cmake") + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_init.cmake") + +set(ANDROID_NDK_VERSION "r10e") +set(CMAKE_SYSTEM_VERSION "19") +set(CMAKE_ANDROID_ARCH_ABI "armeabi-v7a") +set(CMAKE_ANDROID_ARM_NEON TRUE) +set(CMAKE_ANDROID_ARM_MODE TRUE) # 32-bit ARM + +polly_init( + "Android NDK ${ANDROID_NDK_VERSION} / \ +API ${CMAKE_SYSTEM_VERSION} / ${CMAKE_ANDROID_ARCH_ABI} / \ +NEON / 32-bit ARM / c++11 support / hidden / function-sections / data-sections / LTO" + "Unix Makefiles" +) + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_common.cmake") + +include("${CMAKE_CURRENT_LIST_DIR}/flags/cxx11.cmake") # before toolchain! + +include("${CMAKE_CURRENT_LIST_DIR}/flags/function-sections.cmake") + +include("${CMAKE_CURRENT_LIST_DIR}/flags/data-sections.cmake") + +include("${CMAKE_CURRENT_LIST_DIR}/flags/hidden.cmake") + +include("${CMAKE_CURRENT_LIST_DIR}/os/android.cmake") + +include("${CMAKE_CURRENT_LIST_DIR}/flags/lto.cmake") # after 'os/android.cmake' diff --git a/tools/polly/android-ndk-r10e-api-19-armeabi-v7a-neon-hid-sections.cmake b/tools/polly/android-ndk-r10e-api-19-armeabi-v7a-neon-hid-sections.cmake new file mode 100644 index 0000000..4a655a4 --- /dev/null +++ b/tools/polly/android-ndk-r10e-api-19-armeabi-v7a-neon-hid-sections.cmake @@ -0,0 +1,39 @@ +# Copyright (c) 2015, Ruslan Baratov +# Copyright (c) 2015, David Hirvonen +# Copyright (c) 2015, Alexandre Pretyman +# All rights reserved. + +if(DEFINED POLLY_ANDROID_NDK_R10E_API_19_ARMEABI_V7A_NEON_HID_SECTIONS_CMAKE_) + return() +else() + set(POLLY_ANDROID_NDK_R10E_API_19_ARMEABI_V7A_NEON_HID_SECTIONS_CMAKE_ 1) +endif() + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_clear_environment_variables.cmake") + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_init.cmake") + +set(ANDROID_NDK_VERSION "r10e") +set(CMAKE_SYSTEM_VERSION "19") +set(CMAKE_ANDROID_ARCH_ABI "armeabi-v7a") +set(CMAKE_ANDROID_ARM_NEON TRUE) +set(CMAKE_ANDROID_ARM_MODE TRUE) # 32-bit ARM + +polly_init( + "Android NDK ${ANDROID_NDK_VERSION} / \ +API ${CMAKE_SYSTEM_VERSION} / ${CMAKE_ANDROID_ARCH_ABI} / \ +NEON / 32-bit ARM / c++11 support / hidden / function-sections / data-sections" + "Unix Makefiles" +) + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_common.cmake") + +include("${CMAKE_CURRENT_LIST_DIR}/flags/cxx11.cmake") # before toolchain! + +include("${CMAKE_CURRENT_LIST_DIR}/flags/function-sections.cmake") + +include("${CMAKE_CURRENT_LIST_DIR}/flags/data-sections.cmake") + +include("${CMAKE_CURRENT_LIST_DIR}/flags/hidden.cmake") + +include("${CMAKE_CURRENT_LIST_DIR}/os/android.cmake") diff --git a/tools/polly/android-ndk-r10e-api-19-armeabi-v7a-neon.cmake b/tools/polly/android-ndk-r10e-api-19-armeabi-v7a-neon.cmake new file mode 100644 index 0000000..690f1c5 --- /dev/null +++ b/tools/polly/android-ndk-r10e-api-19-armeabi-v7a-neon.cmake @@ -0,0 +1,33 @@ +# Copyright (c) 2015, Ruslan Baratov +# Copyright (c) 2015, David Hirvonen +# Copyright (c) 2015, Alexandre Pretyman +# All rights reserved. + +if(DEFINED POLLY_ANDROID_NDK_R10E_API_19_ARMEABI_V7A_NEON_CMAKE_) + return() +else() + set(POLLY_ANDROID_NDK_R10E_API_19_ARMEABI_V7A_NEON_CMAKE_ 1) +endif() + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_clear_environment_variables.cmake") + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_init.cmake") + +set(ANDROID_NDK_VERSION "r10e") +set(CMAKE_SYSTEM_VERSION "19") +set(CMAKE_ANDROID_ARCH_ABI "armeabi-v7a") +set(CMAKE_ANDROID_ARM_NEON TRUE) +set(CMAKE_ANDROID_ARM_MODE TRUE) # 32-bit ARM + +polly_init( + "Android NDK ${ANDROID_NDK_VERSION} / \ +API ${CMAKE_SYSTEM_VERSION} / ${CMAKE_ANDROID_ARCH_ABI} / \ +NEON / 32-bit ARM / c++11 support" + "Unix Makefiles" +) + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_common.cmake") + +include("${CMAKE_CURRENT_LIST_DIR}/flags/cxx11.cmake") # before toolchain! + +include("${CMAKE_CURRENT_LIST_DIR}/os/android.cmake") diff --git a/tools/polly/android-ndk-r10e-api-21-arm64-v8a-clang-35.cmake b/tools/polly/android-ndk-r10e-api-21-arm64-v8a-clang-35.cmake new file mode 100644 index 0000000..b91e622 --- /dev/null +++ b/tools/polly/android-ndk-r10e-api-21-arm64-v8a-clang-35.cmake @@ -0,0 +1,31 @@ +# Copyright (c) 2015, Ruslan Baratov +# Copyright (c) 2015, David Hirvonen +# All rights reserved. + +if(DEFINED POLLY_ANDROID_NDK_R10E_API_21_ARM64_V8A_CLANG_35_CMAKE_) + return() +else() + set(POLLY_ANDROID_NDK_R10E_API_21_ARM64_V8A_CLANG_35_CMAKE_ 1) +endif() + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_clear_environment_variables.cmake") + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_init.cmake") + +set(ANDROID_NDK_VERSION "r10e") +set(CMAKE_SYSTEM_VERSION "21") +set(CMAKE_ANDROID_ARCH_ABI "arm64-v8a") +set(CMAKE_ANDROID_NDK_TOOLCHAIN_VERSION "clang3.5") + +polly_init( + "Android NDK ${ANDROID_NDK_VERSION} / \ +API ${CMAKE_SYSTEM_VERSION} / ${CMAKE_ANDROID_ARCH_ABI} / \ +Clang 3.5 / c++11 support" + "Unix Makefiles" +) + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_common.cmake") + +include("${CMAKE_CURRENT_LIST_DIR}/flags/cxx11.cmake") # before toolchain! + +include("${CMAKE_CURRENT_LIST_DIR}/os/android.cmake") diff --git a/tools/polly/android-ndk-r10e-api-21-arm64-v8a-gcc-49-hid-sections.cmake b/tools/polly/android-ndk-r10e-api-21-arm64-v8a-gcc-49-hid-sections.cmake new file mode 100644 index 0000000..f3fa00c --- /dev/null +++ b/tools/polly/android-ndk-r10e-api-21-arm64-v8a-gcc-49-hid-sections.cmake @@ -0,0 +1,33 @@ +# Copyright (c) 2015, Ruslan Baratov +# Copyright (c) 2015, David Hirvonen +# All rights reserved. + +if(DEFINED POLLY_ANDROID_NDK_R10E_API_21_ARM64_V8A_GCC_49_HID_SECTIONS_CMAKE_) + return() +else() + set(POLLY_ANDROID_NDK_R10E_API_21_ARM64_V8A_GCC_49_HID_SECTIONS_CMAKE_ 1) +endif() + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_clear_environment_variables.cmake") + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_init.cmake") + +set(ANDROID_NDK_VERSION "r10e") +set(CMAKE_SYSTEM_VERSION "21") +set(CMAKE_ANDROID_ARCH_ABI "arm64-v8a") +set(CMAKE_ANDROID_NDK_TOOLCHAIN_VERSION "4.9") + +polly_init( + "Android NDK ${ANDROID_NDK_VERSION} / \ +API ${CMAKE_SYSTEM_VERSION} / ${CMAKE_ANDROID_ARCH_ABI} / \ +GCC 4.9 / c++11 support" + "Unix Makefiles" +) + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_common.cmake") + +include("${CMAKE_CURRENT_LIST_DIR}/flags/cxx11.cmake") # before toolchain! +include("${CMAKE_CURRENT_LIST_DIR}/flags/hidden.cmake") +include("${CMAKE_CURRENT_LIST_DIR}/flags/function-sections.cmake") +include("${CMAKE_CURRENT_LIST_DIR}/flags/data-sections.cmake") +include("${CMAKE_CURRENT_LIST_DIR}/os/android.cmake") diff --git a/tools/polly/android-ndk-r10e-api-21-arm64-v8a-gcc-49-hid.cmake b/tools/polly/android-ndk-r10e-api-21-arm64-v8a-gcc-49-hid.cmake new file mode 100644 index 0000000..69c5c7d --- /dev/null +++ b/tools/polly/android-ndk-r10e-api-21-arm64-v8a-gcc-49-hid.cmake @@ -0,0 +1,31 @@ +# Copyright (c) 2015, Ruslan Baratov +# Copyright (c) 2015, David Hirvonen +# All rights reserved. + +if(DEFINED POLLY_ANDROID_NDK_R10E_API_21_ARM64_V8A_GCC_49_HID_CMAKE_) + return() +else() + set(POLLY_ANDROID_NDK_R10E_API_21_ARM64_V8A_GCC_49_HID_CMAKE_ 1) +endif() + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_clear_environment_variables.cmake") + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_init.cmake") + +set(ANDROID_NDK_VERSION "r10e") +set(CMAKE_SYSTEM_VERSION "21") +set(CMAKE_ANDROID_ARCH_ABI "arm64-v8a") +set(CMAKE_ANDROID_NDK_TOOLCHAIN_VERSION "4.9") + +polly_init( + "Android NDK ${ANDROID_NDK_VERSION} / \ +API ${CMAKE_SYSTEM_VERSION} / ${CMAKE_ANDROID_ARCH_ABI} / \ +GCC 4.9 / c++11 support" + "Unix Makefiles" +) + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_common.cmake") + +include("${CMAKE_CURRENT_LIST_DIR}/flags/cxx11.cmake") # before toolchain! +include("${CMAKE_CURRENT_LIST_DIR}/flags/hidden.cmake") +include("${CMAKE_CURRENT_LIST_DIR}/os/android.cmake") diff --git a/tools/polly/android-ndk-r10e-api-21-arm64-v8a-gcc-49.cmake b/tools/polly/android-ndk-r10e-api-21-arm64-v8a-gcc-49.cmake new file mode 100644 index 0000000..f5e47ed --- /dev/null +++ b/tools/polly/android-ndk-r10e-api-21-arm64-v8a-gcc-49.cmake @@ -0,0 +1,31 @@ +# Copyright (c) 2015, Ruslan Baratov +# Copyright (c) 2015, David Hirvonen +# All rights reserved. + +if(DEFINED POLLY_ANDROID_NDK_R10E_API_21_ARM64_V8A_GCC_49_CMAKE_) + return() +else() + set(POLLY_ANDROID_NDK_R10E_API_21_ARM64_V8A_GCC_49_CMAKE_ 1) +endif() + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_clear_environment_variables.cmake") + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_init.cmake") + +set(ANDROID_NDK_VERSION "r10e") +set(CMAKE_SYSTEM_VERSION "21") +set(CMAKE_ANDROID_ARCH_ABI "arm64-v8a") +set(CMAKE_ANDROID_NDK_TOOLCHAIN_VERSION "4.9") + +polly_init( + "Android NDK ${ANDROID_NDK_VERSION} / \ +API ${CMAKE_SYSTEM_VERSION} / ${CMAKE_ANDROID_ARCH_ABI} / \ +GCC 4.9 / c++11 support" + "Unix Makefiles" +) + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_common.cmake") + +include("${CMAKE_CURRENT_LIST_DIR}/flags/cxx11.cmake") # before toolchain! + +include("${CMAKE_CURRENT_LIST_DIR}/os/android.cmake") diff --git a/tools/polly/android-ndk-r10e-api-21-arm64-v8a.cmake b/tools/polly/android-ndk-r10e-api-21-arm64-v8a.cmake new file mode 100644 index 0000000..d194d2b --- /dev/null +++ b/tools/polly/android-ndk-r10e-api-21-arm64-v8a.cmake @@ -0,0 +1,29 @@ +# Copyright (c) 2015, Ruslan Baratov +# All rights reserved. + +if(DEFINED POLLY_ANDROID_NDK_R10E_API_21_ARM64_V8A_CMAKE_) + return() +else() + set(POLLY_ANDROID_NDK_R10E_API_21_ARM64_V8A_CMAKE_ 1) +endif() + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_clear_environment_variables.cmake") + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_init.cmake") + +set(ANDROID_NDK_VERSION "r10e") +set(CMAKE_SYSTEM_VERSION "21") +set(CMAKE_ANDROID_ARCH_ABI "arm64-v8a") + +polly_init( + "Android NDK ${ANDROID_NDK_VERSION} / \ +API ${CMAKE_SYSTEM_VERSION} / ${CMAKE_ANDROID_ARCH_ABI} / \ +c++11 support" + "Unix Makefiles" +) + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_common.cmake") + +include("${CMAKE_CURRENT_LIST_DIR}/flags/cxx11.cmake") # before toolchain! + +include("${CMAKE_CURRENT_LIST_DIR}/os/android.cmake") diff --git a/tools/polly/android-ndk-r10e-api-21-armeabi-clang-libcxx.cmake b/tools/polly/android-ndk-r10e-api-21-armeabi-clang-libcxx.cmake new file mode 100644 index 0000000..34412d4 --- /dev/null +++ b/tools/polly/android-ndk-r10e-api-21-armeabi-clang-libcxx.cmake @@ -0,0 +1,34 @@ +# Copyright (c) 2015, Ruslan Baratov +# Copyright (c) 2015, David Hirvonen +# Copyright (c) 2015, Alexandre Pretyman +# All rights reserved. + +if(DEFINED POLLY_ANDROID_NDK_R10E_API_21_ARMEABI_CLANG_LIBCXX_CMAKE_) + return() +else() + set(POLLY_ANDROID_NDK_R10E_API_21_ARMEABI_CLANG_LIBCXX_CMAKE_ 1) +endif() + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_clear_environment_variables.cmake") + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_init.cmake") + +set(ANDROID_NDK_VERSION "r10e") +set(CMAKE_SYSTEM_VERSION "21") +set(CMAKE_ANDROID_ARCH_ABI "armeabi") +set(CMAKE_ANDROID_ARM_MODE TRUE) # 32-bit ARM +set(CMAKE_ANDROID_NDK_TOOLCHAIN_VERSION "clang") +set(CMAKE_ANDROID_STL_TYPE "c++_static") # LLVM libc++ static + +polly_init( + "Android NDK ${ANDROID_NDK_VERSION} / \ +API ${CMAKE_SYSTEM_VERSION} / ${CMAKE_ANDROID_ARCH_ABI} / \ +32-bit ARM / Clang / c++11 support / libc++ static" + "Unix Makefiles" +) + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_common.cmake") + +include("${CMAKE_CURRENT_LIST_DIR}/flags/cxx11.cmake") # before toolchain! + +include("${CMAKE_CURRENT_LIST_DIR}/os/android.cmake") diff --git a/tools/polly/android-ndk-r10e-api-21-armeabi-v7a-neon-clang-35.cmake b/tools/polly/android-ndk-r10e-api-21-armeabi-v7a-neon-clang-35.cmake new file mode 100644 index 0000000..3fdc584 --- /dev/null +++ b/tools/polly/android-ndk-r10e-api-21-armeabi-v7a-neon-clang-35.cmake @@ -0,0 +1,33 @@ +# Copyright (c) 2015, Ruslan Baratov +# Copyright (c) 2015, David Hirvonen +# All rights reserved. + +if(DEFINED POLLY_ANDROID_NDK_R10E_API_21_ARMEABI_V7A_NEON_CLANG_35_CMAKE_) + return() +else() + set(POLLY_ANDROID_NDK_R10E_API_21_ARMEABI_V7A_NEON_CLANG_35_CMAKE_ 1) +endif() + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_clear_environment_variables.cmake") + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_init.cmake") + +set(ANDROID_NDK_VERSION "r10e") +set(CMAKE_SYSTEM_VERSION "21") +set(CMAKE_ANDROID_ARCH_ABI "armeabi-v7a") +set(CMAKE_ANDROID_ARM_NEON TRUE) +set(CMAKE_ANDROID_ARM_MODE TRUE) # 32-bit ARM +set(CMAKE_ANDROID_NDK_TOOLCHAIN_VERSION "clang3.5") + +polly_init( + "Android NDK ${ANDROID_NDK_VERSION} / \ +API ${CMAKE_SYSTEM_VERSION} / ${CMAKE_ANDROID_ARCH_ABI} / \ +NEON / 32-bit ARM / Clang 3.5 / c++11 support" + "Unix Makefiles" +) + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_common.cmake") + +include("${CMAKE_CURRENT_LIST_DIR}/flags/cxx11.cmake") # before toolchain! + +include("${CMAKE_CURRENT_LIST_DIR}/os/android.cmake") diff --git a/tools/polly/android-ndk-r10e-api-21-armeabi-v7a-neon-clang-libcxx.cmake b/tools/polly/android-ndk-r10e-api-21-armeabi-v7a-neon-clang-libcxx.cmake new file mode 100644 index 0000000..109225b --- /dev/null +++ b/tools/polly/android-ndk-r10e-api-21-armeabi-v7a-neon-clang-libcxx.cmake @@ -0,0 +1,35 @@ +# Copyright (c) 2015, Ruslan Baratov +# Copyright (c) 2015, David Hirvonen +# Copyright (c) 2015, Alexandre Pretyman +# All rights reserved. + +if(DEFINED POLLY_ANDROID_NDK_R10E_API_21_ARMEABI_V7A_NEON_CLANG_LIBCXX_CMAKE_) + return() +else() + set(POLLY_ANDROID_NDK_R10E_API_21_ARMEABI_V7A_NEON_CLANG_LIBCXX_CMAKE_ 1) +endif() + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_clear_environment_variables.cmake") + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_init.cmake") + +set(ANDROID_NDK_VERSION "r10e") +set(CMAKE_SYSTEM_VERSION "21") +set(CMAKE_ANDROID_ARCH_ABI "armeabi-v7a") +set(CMAKE_ANDROID_ARM_NEON TRUE) +set(CMAKE_ANDROID_ARM_MODE TRUE) # 32-bit ARM +set(CMAKE_ANDROID_NDK_TOOLCHAIN_VERSION "clang") +set(CMAKE_ANDROID_STL_TYPE "c++_static") # LLVM libc++ static + +polly_init( + "Android NDK ${ANDROID_NDK_VERSION} / \ +API ${CMAKE_SYSTEM_VERSION} / ${CMAKE_ANDROID_ARCH_ABI} / \ +NEON / 32-bit ARM / Clang / c++11 support / libc++ static" + "Unix Makefiles" +) + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_common.cmake") + +include("${CMAKE_CURRENT_LIST_DIR}/flags/cxx11.cmake") # before toolchain! + +include("${CMAKE_CURRENT_LIST_DIR}/os/android.cmake") diff --git a/tools/polly/android-ndk-r10e-api-21-armeabi-v7a-neon-hid-sections.cmake b/tools/polly/android-ndk-r10e-api-21-armeabi-v7a-neon-hid-sections.cmake new file mode 100644 index 0000000..79be94d --- /dev/null +++ b/tools/polly/android-ndk-r10e-api-21-armeabi-v7a-neon-hid-sections.cmake @@ -0,0 +1,39 @@ +# Copyright (c) 2015, Ruslan Baratov +# Copyright (c) 2015, David Hirvonen +# Copyright (c) 2015, Alexandre Pretyman +# All rights reserved. + +if(DEFINED POLLY_ANDROID_NDK_R10E_API_21_ARMEABI_V7A_NEON_HID_SECTIONS_CMAKE_) + return() +else() + set(POLLY_ANDROID_NDK_R10E_API_21_ARMEABI_V7A_NEON_HID_SECTIONS_CMAKE_ 1) +endif() + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_clear_environment_variables.cmake") + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_init.cmake") + +set(ANDROID_NDK_VERSION "r10e") +set(CMAKE_SYSTEM_VERSION "21") +set(CMAKE_ANDROID_ARCH_ABI "armeabi-v7a") +set(CMAKE_ANDROID_ARM_NEON TRUE) +set(CMAKE_ANDROID_ARM_MODE TRUE) # 32-bit ARM + +polly_init( + "Android NDK ${ANDROID_NDK_VERSION} / \ +API ${CMAKE_SYSTEM_VERSION} / ${CMAKE_ANDROID_ARCH_ABI} / \ +NEON / 32-bit ARM / c++11 support / hidden / function-sections / data-sections" + "Unix Makefiles" +) + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_common.cmake") + +include("${CMAKE_CURRENT_LIST_DIR}/flags/cxx11.cmake") # before toolchain! + +include("${CMAKE_CURRENT_LIST_DIR}/flags/function-sections.cmake") + +include("${CMAKE_CURRENT_LIST_DIR}/flags/data-sections.cmake") + +include("${CMAKE_CURRENT_LIST_DIR}/flags/hidden.cmake") + +include("${CMAKE_CURRENT_LIST_DIR}/os/android.cmake") diff --git a/tools/polly/android-ndk-r10e-api-21-armeabi-v7a-neon.cmake b/tools/polly/android-ndk-r10e-api-21-armeabi-v7a-neon.cmake new file mode 100644 index 0000000..2997b0c --- /dev/null +++ b/tools/polly/android-ndk-r10e-api-21-armeabi-v7a-neon.cmake @@ -0,0 +1,32 @@ +# Copyright (c) 2015, Ruslan Baratov +# Copyright (c) 2015, David Hirvonen +# All rights reserved. + +if(DEFINED POLLY_ANDROID_NDK_R10E_API_21_ARMEABI_V7A_NEON_CMAKE_) + return() +else() + set(POLLY_ANDROID_NDK_R10E_API_21_ARMEABI_V7A_NEON_CMAKE_ 1) +endif() + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_clear_environment_variables.cmake") + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_init.cmake") + +set(ANDROID_NDK_VERSION "r10e") +set(CMAKE_SYSTEM_VERSION "21") +set(CMAKE_ANDROID_ARCH_ABI "armeabi-v7a") +set(CMAKE_ANDROID_ARM_NEON TRUE) +set(CMAKE_ANDROID_ARM_MODE TRUE) # 32-bit ARM + +polly_init( + "Android NDK ${ANDROID_NDK_VERSION} / \ +API ${CMAKE_SYSTEM_VERSION} / ${CMAKE_ANDROID_ARCH_ABI} / \ +NEON / 32-bit ARM / c++11 support" + "Unix Makefiles" +) + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_common.cmake") + +include("${CMAKE_CURRENT_LIST_DIR}/flags/cxx11.cmake") # before toolchain! + +include("${CMAKE_CURRENT_LIST_DIR}/os/android.cmake") diff --git a/tools/polly/android-ndk-r10e-api-21-armeabi-v7a.cmake b/tools/polly/android-ndk-r10e-api-21-armeabi-v7a.cmake new file mode 100644 index 0000000..0cb8c24 --- /dev/null +++ b/tools/polly/android-ndk-r10e-api-21-armeabi-v7a.cmake @@ -0,0 +1,31 @@ +# Copyright (c) 2015, Ruslan Baratov +# All rights reserved. + +if(DEFINED POLLY_ANDROID_NDK_R10E_API_21_ARMEABI_V7A_CMAKE_) + return() +else() + set(POLLY_ANDROID_NDK_R10E_API_21_ARMEABI_V7A_CMAKE_ 1) +endif() + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_clear_environment_variables.cmake") + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_init.cmake") + +set(ANDROID_NDK_VERSION "r10e") +set(CMAKE_SYSTEM_VERSION "21") +set(CMAKE_ANDROID_ARCH_ABI "armeabi-v7a") +set(CMAKE_ANDROID_ARM_NEON FALSE) +set(CMAKE_ANDROID_ARM_MODE TRUE) # 32-bit ARM + +polly_init( + "Android NDK ${ANDROID_NDK_VERSION} / \ +API ${CMAKE_SYSTEM_VERSION} / ${CMAKE_ANDROID_ARCH_ABI} / \ +32-bit ARM / c++11 support" + "Unix Makefiles" +) + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_common.cmake") + +include("${CMAKE_CURRENT_LIST_DIR}/flags/cxx11.cmake") # before toolchain! + +include("${CMAKE_CURRENT_LIST_DIR}/os/android.cmake") diff --git a/tools/polly/android-ndk-r10e-api-21-armeabi.cmake b/tools/polly/android-ndk-r10e-api-21-armeabi.cmake new file mode 100644 index 0000000..7a0ea9b --- /dev/null +++ b/tools/polly/android-ndk-r10e-api-21-armeabi.cmake @@ -0,0 +1,31 @@ +# Copyright (c) 2015, Ruslan Baratov +# Copyright (c) 2015, Michele Caini +# All rights reserved. + +if(DEFINED POLLY_ANDROID_NDK_R10E_API_21_ARMEABI_CMAKE_) + return() +else() + set(POLLY_ANDROID_NDK_R10E_API_21_ARMEABI_CMAKE_ 1) +endif() + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_clear_environment_variables.cmake") + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_init.cmake") + +set(ANDROID_NDK_VERSION "r10e") +set(CMAKE_SYSTEM_VERSION "21") +set(CMAKE_ANDROID_ARCH_ABI "armeabi") +set(CMAKE_ANDROID_ARM_MODE TRUE) # 32-bit ARM + +polly_init( + "Android NDK ${ANDROID_NDK_VERSION} / \ +API ${CMAKE_SYSTEM_VERSION} / ${CMAKE_ANDROID_ARCH_ABI} / \ +32-bit ARM / c++11 support" + "Unix Makefiles" +) + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_common.cmake") + +include("${CMAKE_CURRENT_LIST_DIR}/flags/cxx11.cmake") # before toolchain! + +include("${CMAKE_CURRENT_LIST_DIR}/os/android.cmake") diff --git a/tools/polly/android-ndk-r10e-api-21-mips-clang-libcxx.cmake b/tools/polly/android-ndk-r10e-api-21-mips-clang-libcxx.cmake new file mode 100644 index 0000000..6565084 --- /dev/null +++ b/tools/polly/android-ndk-r10e-api-21-mips-clang-libcxx.cmake @@ -0,0 +1,32 @@ +# Copyright (c) 2015, Ruslan Baratov +# Copyright (c) 2015, Michele Caini +# All rights reserved. + +if(DEFINED POLLY_ANDROID_NDK_R10E_API_21_MIPS_CLANG_LIBCXX_CMAKE_) + return() +else() + set(POLLY_ANDROID_NDK_R10E_API_21_MIPS_CLANG_LIBCXX_CMAKE_ 1) +endif() + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_clear_environment_variables.cmake") + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_init.cmake") + +set(ANDROID_NDK_VERSION "r10e") +set(CMAKE_SYSTEM_VERSION "21") +set(CMAKE_ANDROID_ARCH_ABI "mips") +set(CMAKE_ANDROID_NDK_TOOLCHAIN_VERSION "clang") +set(CMAKE_ANDROID_STL_TYPE "c++_static") # LLVM libc++ static + +polly_init( + "Android NDK ${ANDROID_NDK_VERSION} / \ +API ${CMAKE_SYSTEM_VERSION} / ${CMAKE_ANDROID_ARCH_ABI} / \ +Clang / c++11 support / libc++ static" + "Unix Makefiles" +) + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_common.cmake") + +include("${CMAKE_CURRENT_LIST_DIR}/flags/cxx11.cmake") # before toolchain! + +include("${CMAKE_CURRENT_LIST_DIR}/os/android.cmake") diff --git a/tools/polly/android-ndk-r10e-api-21-mips.cmake b/tools/polly/android-ndk-r10e-api-21-mips.cmake new file mode 100644 index 0000000..48b489a --- /dev/null +++ b/tools/polly/android-ndk-r10e-api-21-mips.cmake @@ -0,0 +1,30 @@ +# Copyright (c) 2015, Ruslan Baratov +# Copyright (c) 2015, Michele Caini +# All rights reserved. + +if(DEFINED POLLY_ANDROID_NDK_R10E_API_21_MIPS_CMAKE_) + return() +else() + set(POLLY_ANDROID_NDK_R10E_API_21_MIPS_CMAKE_ 1) +endif() + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_clear_environment_variables.cmake") + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_init.cmake") + +set(ANDROID_NDK_VERSION "r10e") +set(CMAKE_SYSTEM_VERSION "21") +set(CMAKE_ANDROID_ARCH_ABI "mips") + +polly_init( + "Android NDK ${ANDROID_NDK_VERSION} / \ +API ${CMAKE_SYSTEM_VERSION} / ${CMAKE_ANDROID_ARCH_ABI} / \ +c++11 support" + "Unix Makefiles" +) + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_common.cmake") + +include("${CMAKE_CURRENT_LIST_DIR}/flags/cxx11.cmake") # before toolchain! + +include("${CMAKE_CURRENT_LIST_DIR}/os/android.cmake") diff --git a/tools/polly/android-ndk-r10e-api-21-mips64.cmake b/tools/polly/android-ndk-r10e-api-21-mips64.cmake new file mode 100644 index 0000000..d3d017f --- /dev/null +++ b/tools/polly/android-ndk-r10e-api-21-mips64.cmake @@ -0,0 +1,30 @@ +# Copyright (c) 2015, Ruslan Baratov +# Copyright (c) 2015, Michele Caini +# All rights reserved. + +if(DEFINED POLLY_ANDROID_NDK_R10E_API_21_MIPS64_CMAKE_) + return() +else() + set(POLLY_ANDROID_NDK_R10E_API_21_MIPS64_CMAKE_ 1) +endif() + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_clear_environment_variables.cmake") + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_init.cmake") + +set(ANDROID_NDK_VERSION "r10e") +set(CMAKE_SYSTEM_VERSION "21") +set(CMAKE_ANDROID_ARCH_ABI "mips64") + +polly_init( + "Android NDK ${ANDROID_NDK_VERSION} / \ +API ${CMAKE_SYSTEM_VERSION} / ${CMAKE_ANDROID_ARCH_ABI} / \ +c++11 support" + "Unix Makefiles" +) + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_common.cmake") + +include("${CMAKE_CURRENT_LIST_DIR}/flags/cxx11.cmake") # before toolchain! + +include("${CMAKE_CURRENT_LIST_DIR}/os/android.cmake") diff --git a/tools/polly/android-ndk-r10e-api-21-x86-64-hid-sections.cmake b/tools/polly/android-ndk-r10e-api-21-x86-64-hid-sections.cmake new file mode 100644 index 0000000..b93b1e4 --- /dev/null +++ b/tools/polly/android-ndk-r10e-api-21-x86-64-hid-sections.cmake @@ -0,0 +1,36 @@ +# Copyright (c) 2015, Ruslan Baratov, David Hirvonen +# All rights reserved. + +if(DEFINED POLLY_ANDROID_NDK_R10E_API_21_X86_64_HID_SECTIONS_CMAKE_) + return() +else() + set(POLLY_ANDROID_NDK_R10E_API_21_X86_64_HID_SECTIONS_CMAKE_ 1) +endif() + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_clear_environment_variables.cmake") + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_init.cmake") + +set(ANDROID_NDK_VERSION "r10e") +set(CMAKE_SYSTEM_VERSION "21") +set(CMAKE_ANDROID_ARCH_ABI "x86_64") + +polly_init( + "Android NDK ${ANDROID_NDK_VERSION} / \ +API ${CMAKE_SYSTEM_VERSION} / ${CMAKE_ANDROID_ARCH_ABI} / \ +hidden visibility / function-sections / data-sections \ +c++11 support" + "Unix Makefiles" +) + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_common.cmake") + +include("${CMAKE_CURRENT_LIST_DIR}/flags/cxx11.cmake") # before toolchain! + +include("${CMAKE_CURRENT_LIST_DIR}/flags/hidden.cmake") + +include("${CMAKE_CURRENT_LIST_DIR}/flags/function-sections.cmake") + +include("${CMAKE_CURRENT_LIST_DIR}/flags/data-sections.cmake") + +include("${CMAKE_CURRENT_LIST_DIR}/os/android.cmake") diff --git a/tools/polly/android-ndk-r10e-api-21-x86-64-hid.cmake b/tools/polly/android-ndk-r10e-api-21-x86-64-hid.cmake new file mode 100644 index 0000000..6b9c141 --- /dev/null +++ b/tools/polly/android-ndk-r10e-api-21-x86-64-hid.cmake @@ -0,0 +1,32 @@ +# Copyright (c) 2015, Ruslan Baratov, David Hirvonen +# All rights reserved. + +if(DEFINED POLLY_ANDROID_NDK_R10E_API_21_X86_64_HID_CMAKE_) + return() +else() + set(POLLY_ANDROID_NDK_R10E_API_21_X86_64_HID_CMAKE_ 1) +endif() + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_clear_environment_variables.cmake") + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_init.cmake") + +set(ANDROID_NDK_VERSION "r10e") +set(CMAKE_SYSTEM_VERSION "21") +set(CMAKE_ANDROID_ARCH_ABI "x86_64") + +polly_init( + "Android NDK ${ANDROID_NDK_VERSION} / \ +API ${CMAKE_SYSTEM_VERSION} / ${CMAKE_ANDROID_ARCH_ABI} / \ +hidden visibility / \ +c++11 support" + "Unix Makefiles" +) + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_common.cmake") + +include("${CMAKE_CURRENT_LIST_DIR}/flags/cxx11.cmake") # before toolchain! + +include("${CMAKE_CURRENT_LIST_DIR}/flags/hidden.cmake") + +include("${CMAKE_CURRENT_LIST_DIR}/os/android.cmake") diff --git a/tools/polly/android-ndk-r10e-api-21-x86-64.cmake b/tools/polly/android-ndk-r10e-api-21-x86-64.cmake new file mode 100644 index 0000000..19aa140 --- /dev/null +++ b/tools/polly/android-ndk-r10e-api-21-x86-64.cmake @@ -0,0 +1,29 @@ +# Copyright (c) 2015, Ruslan Baratov, David Hirvonen +# All rights reserved. + +if(DEFINED POLLY_ANDROID_NDK_R10E_API_21_X86_64_CMAKE_) + return() +else() + set(POLLY_ANDROID_NDK_R10E_API_21_X86_64_CMAKE_ 1) +endif() + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_clear_environment_variables.cmake") + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_init.cmake") + +set(ANDROID_NDK_VERSION "r10e") +set(CMAKE_SYSTEM_VERSION "21") +set(CMAKE_ANDROID_ARCH_ABI "x86_64") + +polly_init( + "Android NDK ${ANDROID_NDK_VERSION} / \ +API ${CMAKE_SYSTEM_VERSION} / ${CMAKE_ANDROID_ARCH_ABI} / \ +c++11 support" + "Unix Makefiles" +) + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_common.cmake") + +include("${CMAKE_CURRENT_LIST_DIR}/flags/cxx11.cmake") # before toolchain! + +include("${CMAKE_CURRENT_LIST_DIR}/os/android.cmake") diff --git a/tools/polly/android-ndk-r10e-api-21-x86-clang-libcxx.cmake b/tools/polly/android-ndk-r10e-api-21-x86-clang-libcxx.cmake new file mode 100644 index 0000000..b962071 --- /dev/null +++ b/tools/polly/android-ndk-r10e-api-21-x86-clang-libcxx.cmake @@ -0,0 +1,31 @@ +# Copyright (c) 2015, Ruslan Baratov +# All rights reserved. + +if(DEFINED POLLY_ANDROID_NDK_R10E_API_21_X86_CLANG_LIBCXX_CMAKE_) + return() +else() + set(POLLY_ANDROID_NDK_R10E_API_21_X86_CLANG_LIBCXX_CMAKE_ 1) +endif() + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_clear_environment_variables.cmake") + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_init.cmake") + +set(ANDROID_NDK_VERSION "r10e") +set(CMAKE_SYSTEM_VERSION "21") +set(CMAKE_ANDROID_ARCH_ABI "x86") +set(CMAKE_ANDROID_NDK_TOOLCHAIN_VERSION "clang") +set(CMAKE_ANDROID_STL_TYPE "c++_static") # LLVM libc++ static + +polly_init( + "Android NDK ${ANDROID_NDK_VERSION} / \ +API ${CMAKE_SYSTEM_VERSION} / ${CMAKE_ANDROID_ARCH_ABI} / \ +Clang / c++11 support / libc++ static" + "Unix Makefiles" +) + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_common.cmake") + +include("${CMAKE_CURRENT_LIST_DIR}/flags/cxx11.cmake") # before toolchain! + +include("${CMAKE_CURRENT_LIST_DIR}/os/android.cmake") diff --git a/tools/polly/android-ndk-r10e-api-21-x86.cmake b/tools/polly/android-ndk-r10e-api-21-x86.cmake new file mode 100644 index 0000000..f1883e0 --- /dev/null +++ b/tools/polly/android-ndk-r10e-api-21-x86.cmake @@ -0,0 +1,29 @@ +# Copyright (c) 2015, Ruslan Baratov +# All rights reserved. + +if(DEFINED POLLY_ANDROID_NDK_R10E_API_21_X86_CMAKE_) + return() +else() + set(POLLY_ANDROID_NDK_R10E_API_21_X86_CMAKE_ 1) +endif() + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_clear_environment_variables.cmake") + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_init.cmake") + +set(ANDROID_NDK_VERSION "r10e") +set(CMAKE_SYSTEM_VERSION "21") +set(CMAKE_ANDROID_ARCH_ABI "x86") + +polly_init( + "Android NDK ${ANDROID_NDK_VERSION} / \ +API ${CMAKE_SYSTEM_VERSION} / ${CMAKE_ANDROID_ARCH_ABI} / \ +c++11 support" + "Unix Makefiles" +) + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_common.cmake") + +include("${CMAKE_CURRENT_LIST_DIR}/flags/cxx11.cmake") # before toolchain! + +include("${CMAKE_CURRENT_LIST_DIR}/os/android.cmake") diff --git a/tools/polly/android-ndk-r10e-api-8-armeabi-v7a.cmake b/tools/polly/android-ndk-r10e-api-8-armeabi-v7a.cmake new file mode 100644 index 0000000..aaa1c77 --- /dev/null +++ b/tools/polly/android-ndk-r10e-api-8-armeabi-v7a.cmake @@ -0,0 +1,31 @@ +# Copyright (c) 2015, Ruslan Baratov +# All rights reserved. + +if(DEFINED POLLY_ANDROID_NDK_R10E_API_8_ARMEABI_V7A_CMAKE_) + return() +else() + set(POLLY_ANDROID_NDK_R10E_API_8_ARMEABI_V7A_CMAKE_ 1) +endif() + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_clear_environment_variables.cmake") + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_init.cmake") + +set(ANDROID_NDK_VERSION "r10e") +set(CMAKE_SYSTEM_VERSION "8") +set(CMAKE_ANDROID_ARCH_ABI "armeabi-v7a") +set(CMAKE_ANDROID_ARM_NEON FALSE) +set(CMAKE_ANDROID_ARM_MODE TRUE) # 32-bit ARM + +polly_init( + "Android NDK ${ANDROID_NDK_VERSION} / \ +API ${CMAKE_SYSTEM_VERSION} / ${CMAKE_ANDROID_ARCH_ABI} / \ +32-bit ARM / c++11 support" + "Unix Makefiles" +) + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_common.cmake") + +include("${CMAKE_CURRENT_LIST_DIR}/flags/cxx11.cmake") # before toolchain! + +include("${CMAKE_CURRENT_LIST_DIR}/os/android.cmake") diff --git a/tools/polly/android-ndk-r11c-api-16-armeabi-cxx14.cmake b/tools/polly/android-ndk-r11c-api-16-armeabi-cxx14.cmake new file mode 100644 index 0000000..5ad35e0 --- /dev/null +++ b/tools/polly/android-ndk-r11c-api-16-armeabi-cxx14.cmake @@ -0,0 +1,30 @@ +# Copyright (c) 2016, Michele Caini +# All rights reserved. + +if(DEFINED POLLY_ANDROID_NDK_R11C_API_16_ARMEABI_CXX14_CMAKE_) + return() +else() + set(POLLY_ANDROID_NDK_R11C_API_16_ARMEABI_CXX14_CMAKE_ 1) +endif() + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_clear_environment_variables.cmake") + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_init.cmake") + +set(ANDROID_NDK_VERSION "r11c") +set(CMAKE_SYSTEM_VERSION "16") +set(CMAKE_ANDROID_ARCH_ABI "armeabi") +set(CMAKE_ANDROID_ARM_MODE TRUE) # 32-bit ARM + +polly_init( + "Android NDK ${ANDROID_NDK_VERSION} / \ +API ${CMAKE_SYSTEM_VERSION} / ${CMAKE_ANDROID_ARCH_ABI} / \ +32-bit ARM / c++14 support" + "Unix Makefiles" +) + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_common.cmake") + +include("${CMAKE_CURRENT_LIST_DIR}/flags/cxx14.cmake") # before toolchain! + +include("${CMAKE_CURRENT_LIST_DIR}/os/android.cmake") diff --git a/tools/polly/android-ndk-r11c-api-16-armeabi-v7a-cxx14.cmake b/tools/polly/android-ndk-r11c-api-16-armeabi-v7a-cxx14.cmake new file mode 100644 index 0000000..234df07 --- /dev/null +++ b/tools/polly/android-ndk-r11c-api-16-armeabi-v7a-cxx14.cmake @@ -0,0 +1,31 @@ +# Copyright (c) 2016, Michele Caini +# All rights reserved. + +if(DEFINED POLLY_ANDROID_NDK_R11C_API_16_ARMEABI_V7A_CXX14_CMAKE_) + return() +else() + set(POLLY_ANDROID_NDK_R11C_API_16_ARMEABI_V7A_CXX14_CMAKE_ 1) +endif() + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_clear_environment_variables.cmake") + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_init.cmake") + +set(ANDROID_NDK_VERSION "r11c") +set(CMAKE_SYSTEM_VERSION "16") +set(CMAKE_ANDROID_ARCH_ABI "armeabi-v7a") +set(CMAKE_ANDROID_ARM_NEON FALSE) +set(CMAKE_ANDROID_ARM_MODE TRUE) # 32-bit ARM + +polly_init( + "Android NDK ${ANDROID_NDK_VERSION} / \ +API ${CMAKE_SYSTEM_VERSION} / ${CMAKE_ANDROID_ARCH_ABI} / \ +32-bit ARM / c++14 support" + "Unix Makefiles" +) + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_common.cmake") + +include("${CMAKE_CURRENT_LIST_DIR}/flags/cxx14.cmake") # before toolchain! + +include("${CMAKE_CURRENT_LIST_DIR}/os/android.cmake") diff --git a/tools/polly/android-ndk-r11c-api-16-armeabi-v7a-neon-clang-35-hid.cmake b/tools/polly/android-ndk-r11c-api-16-armeabi-v7a-neon-clang-35-hid.cmake new file mode 100644 index 0000000..a2cab6a --- /dev/null +++ b/tools/polly/android-ndk-r11c-api-16-armeabi-v7a-neon-clang-35-hid.cmake @@ -0,0 +1,32 @@ +# Copyright (c) 2016, Michele Caini +# All rights reserved. + +if(DEFINED POLLY_ANDROID_NDK_R11C_API_16_ARMEABI_V7A_NEON_CLANG_35_HID_CMAKE_) + return() +else() + set(POLLY_ANDROID_NDK_R11C_API_16_ARMEABI_V7A_NEON_CLANG_35_HID_CMAKE_ 1) +endif() + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_clear_environment_variables.cmake") + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_init.cmake") + +set(ANDROID_NDK_VERSION "r11c") +set(CMAKE_SYSTEM_VERSION "16") +set(CMAKE_ANDROID_ARCH_ABI "armeabi-v7a") +set(CMAKE_ANDROID_ARM_NEON TRUE) +set(CMAKE_ANDROID_ARM_MODE TRUE) # 32-bit ARM +set(CMAKE_ANDROID_NDK_TOOLCHAIN_VERSION "clang3.5") + +polly_init( + "Android NDK ${ANDROID_NDK_VERSION} / \ +API ${CMAKE_SYSTEM_VERSION} / ${CMAKE_ANDROID_ARCH_ABI} / \ +NEON / 32-bit ARM / Clang 3.5 / c++11 support" + "Unix Makefiles" +) + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_common.cmake") + +include("${CMAKE_CURRENT_LIST_DIR}/flags/cxx11.cmake") # before toolchain! +include("${CMAKE_CURRENT_LIST_DIR}/flags/hidden.cmake") +include("${CMAKE_CURRENT_LIST_DIR}/os/android.cmake") diff --git a/tools/polly/android-ndk-r11c-api-16-armeabi-v7a-neon-clang-35.cmake b/tools/polly/android-ndk-r11c-api-16-armeabi-v7a-neon-clang-35.cmake new file mode 100644 index 0000000..2117ec0 --- /dev/null +++ b/tools/polly/android-ndk-r11c-api-16-armeabi-v7a-neon-clang-35.cmake @@ -0,0 +1,32 @@ +# Copyright (c) 2016, Michele Caini +# All rights reserved. + +if(DEFINED POLLY_ANDROID_NDK_R11C_API_16_ARMEABI_V7A_NEON_CLANG_35_CMAKE_) + return() +else() + set(POLLY_ANDROID_NDK_R11C_API_16_ARMEABI_V7A_NEON_CLANG_35_CMAKE_ 1) +endif() + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_clear_environment_variables.cmake") + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_init.cmake") + +set(ANDROID_NDK_VERSION "r11c") +set(CMAKE_SYSTEM_VERSION "16") +set(CMAKE_ANDROID_ARCH_ABI "armeabi-v7a") +set(CMAKE_ANDROID_ARM_NEON TRUE) +set(CMAKE_ANDROID_ARM_MODE TRUE) # 32-bit ARM +set(CMAKE_ANDROID_NDK_TOOLCHAIN_VERSION "clang3.5") + +polly_init( + "Android NDK ${ANDROID_NDK_VERSION} / \ +API ${CMAKE_SYSTEM_VERSION} / ${CMAKE_ANDROID_ARCH_ABI} / \ +NEON / 32-bit ARM / Clang 3.5 / c++11 support" + "Unix Makefiles" +) + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_common.cmake") + +include("${CMAKE_CURRENT_LIST_DIR}/flags/cxx11.cmake") # before toolchain! + +include("${CMAKE_CURRENT_LIST_DIR}/os/android.cmake") diff --git a/tools/polly/android-ndk-r11c-api-16-armeabi-v7a-neon-cxx14.cmake b/tools/polly/android-ndk-r11c-api-16-armeabi-v7a-neon-cxx14.cmake new file mode 100644 index 0000000..a898675 --- /dev/null +++ b/tools/polly/android-ndk-r11c-api-16-armeabi-v7a-neon-cxx14.cmake @@ -0,0 +1,31 @@ +# Copyright (c) 2016, Michele Caini +# All rights reserved. + +if(DEFINED POLLY_ANDROID_NDK_R11C_API_16_ARMEABI_V7A_NEON_CXX14_CMAKE_) + return() +else() + set(POLLY_ANDROID_NDK_R11C_API_16_ARMEABI_V7A_NEON_CXX14_CMAKE_ 1) +endif() + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_clear_environment_variables.cmake") + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_init.cmake") + +set(ANDROID_NDK_VERSION "r11c") +set(CMAKE_SYSTEM_VERSION "16") +set(CMAKE_ANDROID_ARCH_ABI "armeabi-v7a") +set(CMAKE_ANDROID_ARM_NEON TRUE) +set(CMAKE_ANDROID_ARM_MODE TRUE) # 32-bit ARM + +polly_init( + "Android NDK ${ANDROID_NDK_VERSION} / \ +API ${CMAKE_SYSTEM_VERSION} / ${CMAKE_ANDROID_ARCH_ABI} / \ +NEON / 32-bit ARM / c++14 support" + "Unix Makefiles" +) + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_common.cmake") + +include("${CMAKE_CURRENT_LIST_DIR}/flags/cxx14.cmake") # before toolchain! + +include("${CMAKE_CURRENT_LIST_DIR}/os/android.cmake") diff --git a/tools/polly/android-ndk-r11c-api-16-armeabi-v7a-neon.cmake b/tools/polly/android-ndk-r11c-api-16-armeabi-v7a-neon.cmake new file mode 100644 index 0000000..fe19039 --- /dev/null +++ b/tools/polly/android-ndk-r11c-api-16-armeabi-v7a-neon.cmake @@ -0,0 +1,31 @@ +# Copyright (c) 2016, Michele Caini +# All rights reserved. + +if(DEFINED POLLY_ANDROID_NDK_R11C_API_16_ARMEABI_V7A_NEON_CMAKE_) + return() +else() + set(POLLY_ANDROID_NDK_R11C_API_16_ARMEABI_V7A_NEON_CMAKE_ 1) +endif() + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_clear_environment_variables.cmake") + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_init.cmake") + +set(ANDROID_NDK_VERSION "r11c") +set(CMAKE_SYSTEM_VERSION "16") +set(CMAKE_ANDROID_ARCH_ABI "armeabi-v7a") +set(CMAKE_ANDROID_ARM_NEON TRUE) +set(CMAKE_ANDROID_ARM_MODE TRUE) # 32-bit ARM + +polly_init( + "Android NDK ${ANDROID_NDK_VERSION} / \ +API ${CMAKE_SYSTEM_VERSION} / ${CMAKE_ANDROID_ARCH_ABI} / \ +NEON / 32-bit ARM / c++11 support" + "Unix Makefiles" +) + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_common.cmake") + +include("${CMAKE_CURRENT_LIST_DIR}/flags/cxx11.cmake") # before toolchain! + +include("${CMAKE_CURRENT_LIST_DIR}/os/android.cmake") diff --git a/tools/polly/android-ndk-r11c-api-16-armeabi-v7a.cmake b/tools/polly/android-ndk-r11c-api-16-armeabi-v7a.cmake new file mode 100644 index 0000000..276e94e --- /dev/null +++ b/tools/polly/android-ndk-r11c-api-16-armeabi-v7a.cmake @@ -0,0 +1,31 @@ +# Copyright (c) 2016, Michele Caini +# All rights reserved. + +if(DEFINED POLLY_ANDROID_NDK_R11C_API_16_ARMEABI_V7A_CMAKE_) + return() +else() + set(POLLY_ANDROID_NDK_R11C_API_16_ARMEABI_V7A_CMAKE_ 1) +endif() + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_clear_environment_variables.cmake") + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_init.cmake") + +set(ANDROID_NDK_VERSION "r11c") +set(CMAKE_SYSTEM_VERSION "16") +set(CMAKE_ANDROID_ARCH_ABI "armeabi-v7a") +set(CMAKE_ANDROID_ARM_NEON FALSE) +set(CMAKE_ANDROID_ARM_MODE TRUE) # 32-bit ARM + +polly_init( + "Android NDK ${ANDROID_NDK_VERSION} / \ +API ${CMAKE_SYSTEM_VERSION} / ${CMAKE_ANDROID_ARCH_ABI} / \ +32-bit ARM / c++11 support" + "Unix Makefiles" +) + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_common.cmake") + +include("${CMAKE_CURRENT_LIST_DIR}/flags/cxx11.cmake") # before toolchain! + +include("${CMAKE_CURRENT_LIST_DIR}/os/android.cmake") diff --git a/tools/polly/android-ndk-r11c-api-16-armeabi.cmake b/tools/polly/android-ndk-r11c-api-16-armeabi.cmake new file mode 100644 index 0000000..6ec259d --- /dev/null +++ b/tools/polly/android-ndk-r11c-api-16-armeabi.cmake @@ -0,0 +1,30 @@ +# Copyright (c) 2016, Michele Caini +# All rights reserved. + +if(DEFINED POLLY_ANDROID_NDK_R11C_API_16_ARMEABI_CMAKE_) + return() +else() + set(POLLY_ANDROID_NDK_R11C_API_16_ARMEABI_CMAKE_ 1) +endif() + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_clear_environment_variables.cmake") + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_init.cmake") + +set(ANDROID_NDK_VERSION "r11c") +set(CMAKE_SYSTEM_VERSION "16") +set(CMAKE_ANDROID_ARCH_ABI "armeabi") +set(CMAKE_ANDROID_ARM_MODE TRUE) # 32-bit ARM + +polly_init( + "Android NDK ${ANDROID_NDK_VERSION} / \ +API ${CMAKE_SYSTEM_VERSION} / ${CMAKE_ANDROID_ARCH_ABI} / \ +32-bit ARM / c++11 support" + "Unix Makefiles" +) + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_common.cmake") + +include("${CMAKE_CURRENT_LIST_DIR}/flags/cxx11.cmake") # before toolchain! + +include("${CMAKE_CURRENT_LIST_DIR}/os/android.cmake") diff --git a/tools/polly/android-ndk-r11c-api-16-x86-hid.cmake b/tools/polly/android-ndk-r11c-api-16-x86-hid.cmake new file mode 100644 index 0000000..4f29b1b --- /dev/null +++ b/tools/polly/android-ndk-r11c-api-16-x86-hid.cmake @@ -0,0 +1,32 @@ +# Copyright (c) 2016, Michele Caini +# All rights reserved. + +if(DEFINED POLLY_ANDROID_NDK_R11C_API_16_X86_HID_CMAKE_) + return() +else() + set(POLLY_ANDROID_NDK_R11C_API_16_X86_HID_CMAKE_ 1) +endif() + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_clear_environment_variables.cmake") + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_init.cmake") + +set(ANDROID_NDK_VERSION "r11c") +set(CMAKE_SYSTEM_VERSION "16") +set(CMAKE_ANDROID_ARCH_ABI "x86") + +polly_init( + "Android NDK ${ANDROID_NDK_VERSION} / \ +API ${CMAKE_SYSTEM_VERSION} / ${CMAKE_ANDROID_ARCH_ABI} / \ +hidden visibility / \ +c++11 support" + "Unix Makefiles" +) + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_common.cmake") + +include("${CMAKE_CURRENT_LIST_DIR}/flags/cxx11.cmake") # before toolchain! + +include("${CMAKE_CURRENT_LIST_DIR}/flags/hidden.cmake") + +include("${CMAKE_CURRENT_LIST_DIR}/os/android.cmake") diff --git a/tools/polly/android-ndk-r11c-api-16-x86.cmake b/tools/polly/android-ndk-r11c-api-16-x86.cmake new file mode 100644 index 0000000..e99c6ab --- /dev/null +++ b/tools/polly/android-ndk-r11c-api-16-x86.cmake @@ -0,0 +1,29 @@ +# Copyright (c) 2016, Michele Caini +# All rights reserved. + +if(DEFINED POLLY_ANDROID_NDK_R11C_API_16_X86_CMAKE_) + return() +else() + set(POLLY_ANDROID_NDK_R11C_API_16_X86_CMAKE_ 1) +endif() + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_clear_environment_variables.cmake") + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_init.cmake") + +set(ANDROID_NDK_VERSION "r11c") +set(CMAKE_SYSTEM_VERSION "16") +set(CMAKE_ANDROID_ARCH_ABI "x86") + +polly_init( + "Android NDK ${ANDROID_NDK_VERSION} / \ +API ${CMAKE_SYSTEM_VERSION} / ${CMAKE_ANDROID_ARCH_ABI} / \ +c++11 support" + "Unix Makefiles" +) + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_common.cmake") + +include("${CMAKE_CURRENT_LIST_DIR}/flags/cxx11.cmake") # before toolchain! + +include("${CMAKE_CURRENT_LIST_DIR}/os/android.cmake") diff --git a/tools/polly/android-ndk-r11c-api-19-armeabi-v7a-neon.cmake b/tools/polly/android-ndk-r11c-api-19-armeabi-v7a-neon.cmake new file mode 100644 index 0000000..c120656 --- /dev/null +++ b/tools/polly/android-ndk-r11c-api-19-armeabi-v7a-neon.cmake @@ -0,0 +1,31 @@ +# Copyright (c) 2016, Michele Caini +# All rights reserved. + +if(DEFINED POLLY_ANDROID_NDK_R11C_API_19_ARMEABI_V7A_NEON_CMAKE_) + return() +else() + set(POLLY_ANDROID_NDK_R11C_API_19_ARMEABI_V7A_NEON_CMAKE_ 1) +endif() + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_clear_environment_variables.cmake") + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_init.cmake") + +set(ANDROID_NDK_VERSION "r11c") +set(CMAKE_SYSTEM_VERSION "19") +set(CMAKE_ANDROID_ARCH_ABI "armeabi-v7a") +set(CMAKE_ANDROID_ARM_NEON TRUE) +set(CMAKE_ANDROID_ARM_MODE TRUE) # 32-bit ARM + +polly_init( + "Android NDK ${ANDROID_NDK_VERSION} / \ +API ${CMAKE_SYSTEM_VERSION} / ${CMAKE_ANDROID_ARCH_ABI} / \ +NEON / 32-bit ARM / c++11 support" + "Unix Makefiles" +) + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_common.cmake") + +include("${CMAKE_CURRENT_LIST_DIR}/flags/cxx11.cmake") # before toolchain! + +include("${CMAKE_CURRENT_LIST_DIR}/os/android.cmake") diff --git a/tools/polly/android-ndk-r11c-api-21-arm64-v8a-clang-35.cmake b/tools/polly/android-ndk-r11c-api-21-arm64-v8a-clang-35.cmake new file mode 100644 index 0000000..83d70d8 --- /dev/null +++ b/tools/polly/android-ndk-r11c-api-21-arm64-v8a-clang-35.cmake @@ -0,0 +1,30 @@ +# Copyright (c) 2016, Michele Caini +# All rights reserved. + +if(DEFINED POLLY_ANDROID_NDK_R11C_API_21_ARM64_V8A_CLANG_35_CMAKE_) + return() +else() + set(POLLY_ANDROID_NDK_R11C_API_21_ARM64_V8A_CLANG_35_CMAKE_ 1) +endif() + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_clear_environment_variables.cmake") + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_init.cmake") + +set(ANDROID_NDK_VERSION "r11c") +set(CMAKE_SYSTEM_VERSION "21") +set(CMAKE_ANDROID_ARCH_ABI "arm64-v8a") +set(CMAKE_ANDROID_NDK_TOOLCHAIN_VERSION "clang3.5") + +polly_init( + "Android NDK ${ANDROID_NDK_VERSION} / \ +API ${CMAKE_SYSTEM_VERSION} / ${CMAKE_ANDROID_ARCH_ABI} / \ +Clang 3.5 / c++11 support" + "Unix Makefiles" +) + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_common.cmake") + +include("${CMAKE_CURRENT_LIST_DIR}/flags/cxx11.cmake") # before toolchain! + +include("${CMAKE_CURRENT_LIST_DIR}/os/android.cmake") diff --git a/tools/polly/android-ndk-r11c-api-21-arm64-v8a-gcc-49-hid.cmake b/tools/polly/android-ndk-r11c-api-21-arm64-v8a-gcc-49-hid.cmake new file mode 100644 index 0000000..592ccfb --- /dev/null +++ b/tools/polly/android-ndk-r11c-api-21-arm64-v8a-gcc-49-hid.cmake @@ -0,0 +1,30 @@ +# Copyright (c) 2016, Michele Caini +# All rights reserved. + +if(DEFINED POLLY_ANDROID_NDK_R11C_API_21_ARM64_V8A_GCC_49_HID_CMAKE_) + return() +else() + set(POLLY_ANDROID_NDK_R11C_API_21_ARM64_V8A_GCC_49_HID_CMAKE_ 1) +endif() + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_clear_environment_variables.cmake") + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_init.cmake") + +set(ANDROID_NDK_VERSION "r11c") +set(CMAKE_SYSTEM_VERSION "21") +set(CMAKE_ANDROID_ARCH_ABI "arm64-v8a") +set(CMAKE_ANDROID_NDK_TOOLCHAIN_VERSION "4.9") + +polly_init( + "Android NDK ${ANDROID_NDK_VERSION} / \ +API ${CMAKE_SYSTEM_VERSION} / ${CMAKE_ANDROID_ARCH_ABI} / \ +GCC 4.9 / c++11 support" + "Unix Makefiles" +) + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_common.cmake") + +include("${CMAKE_CURRENT_LIST_DIR}/flags/cxx11.cmake") # before toolchain! +include("${CMAKE_CURRENT_LIST_DIR}/flags/hidden.cmake") +include("${CMAKE_CURRENT_LIST_DIR}/os/android.cmake") diff --git a/tools/polly/android-ndk-r11c-api-21-arm64-v8a-gcc-49.cmake b/tools/polly/android-ndk-r11c-api-21-arm64-v8a-gcc-49.cmake new file mode 100644 index 0000000..9c24b97 --- /dev/null +++ b/tools/polly/android-ndk-r11c-api-21-arm64-v8a-gcc-49.cmake @@ -0,0 +1,30 @@ +# Copyright (c) 2016, Michele Caini +# All rights reserved. + +if(DEFINED POLLY_ANDROID_NDK_R11C_API_21_ARM64_V8A_GCC_49_CMAKE_) + return() +else() + set(POLLY_ANDROID_NDK_R11C_API_21_ARM64_V8A_GCC_49_CMAKE_ 1) +endif() + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_clear_environment_variables.cmake") + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_init.cmake") + +set(ANDROID_NDK_VERSION "r11c") +set(CMAKE_SYSTEM_VERSION "21") +set(CMAKE_ANDROID_ARCH_ABI "arm64-v8a") +set(CMAKE_ANDROID_NDK_TOOLCHAIN_VERSION "4.9") + +polly_init( + "Android NDK ${ANDROID_NDK_VERSION} / \ +API ${CMAKE_SYSTEM_VERSION} / ${CMAKE_ANDROID_ARCH_ABI} / \ +GCC 4.9 / c++11 support" + "Unix Makefiles" +) + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_common.cmake") + +include("${CMAKE_CURRENT_LIST_DIR}/flags/cxx11.cmake") # before toolchain! + +include("${CMAKE_CURRENT_LIST_DIR}/os/android.cmake") diff --git a/tools/polly/android-ndk-r11c-api-21-arm64-v8a.cmake b/tools/polly/android-ndk-r11c-api-21-arm64-v8a.cmake new file mode 100644 index 0000000..2f531c3 --- /dev/null +++ b/tools/polly/android-ndk-r11c-api-21-arm64-v8a.cmake @@ -0,0 +1,29 @@ +# Copyright (c) 2016, Michele Caini +# All rights reserved. + +if(DEFINED POLLY_ANDROID_NDK_R11C_API_21_ARM64_V8A_CMAKE_) + return() +else() + set(POLLY_ANDROID_NDK_R11C_API_21_ARM64_V8A_CMAKE_ 1) +endif() + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_clear_environment_variables.cmake") + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_init.cmake") + +set(ANDROID_NDK_VERSION "r11c") +set(CMAKE_SYSTEM_VERSION "21") +set(CMAKE_ANDROID_ARCH_ABI "arm64-v8a") + +polly_init( + "Android NDK ${ANDROID_NDK_VERSION} / \ +API ${CMAKE_SYSTEM_VERSION} / ${CMAKE_ANDROID_ARCH_ABI} / \ +c++11 support" + "Unix Makefiles" +) + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_common.cmake") + +include("${CMAKE_CURRENT_LIST_DIR}/flags/cxx11.cmake") # before toolchain! + +include("${CMAKE_CURRENT_LIST_DIR}/os/android.cmake") diff --git a/tools/polly/android-ndk-r11c-api-21-armeabi-v7a-neon-clang-35.cmake b/tools/polly/android-ndk-r11c-api-21-armeabi-v7a-neon-clang-35.cmake new file mode 100644 index 0000000..0214027 --- /dev/null +++ b/tools/polly/android-ndk-r11c-api-21-armeabi-v7a-neon-clang-35.cmake @@ -0,0 +1,32 @@ +# Copyright (c) 2016, Michele Caini +# All rights reserved. + +if(DEFINED POLLY_ANDROID_NDK_R11C_API_21_ARMEABI_V7A_NEON_CLANG_35_CMAKE_) + return() +else() + set(POLLY_ANDROID_NDK_R11C_API_21_ARMEABI_V7A_NEON_CLANG_35_CMAKE_ 1) +endif() + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_clear_environment_variables.cmake") + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_init.cmake") + +set(ANDROID_NDK_VERSION "r11c") +set(CMAKE_SYSTEM_VERSION "21") +set(CMAKE_ANDROID_ARCH_ABI "armeabi-v7a") +set(CMAKE_ANDROID_ARM_NEON TRUE) +set(CMAKE_ANDROID_ARM_MODE TRUE) # 32-bit ARM +set(CMAKE_ANDROID_NDK_TOOLCHAIN_VERSION "clang3.5") + +polly_init( + "Android NDK ${ANDROID_NDK_VERSION} / \ +API ${CMAKE_SYSTEM_VERSION} / ${CMAKE_ANDROID_ARCH_ABI} / \ +NEON / 32-bit ARM / Clang 3.5 / c++11 support" + "Unix Makefiles" +) + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_common.cmake") + +include("${CMAKE_CURRENT_LIST_DIR}/flags/cxx11.cmake") # before toolchain! + +include("${CMAKE_CURRENT_LIST_DIR}/os/android.cmake") diff --git a/tools/polly/android-ndk-r11c-api-21-armeabi-v7a-neon.cmake b/tools/polly/android-ndk-r11c-api-21-armeabi-v7a-neon.cmake new file mode 100644 index 0000000..7648f6b --- /dev/null +++ b/tools/polly/android-ndk-r11c-api-21-armeabi-v7a-neon.cmake @@ -0,0 +1,31 @@ +# Copyright (c) 2016, Michele Caini +# All rights reserved. + +if(DEFINED POLLY_ANDROID_NDK_R11C_API_21_ARMEABI_V7A_NEON_CMAKE_) + return() +else() + set(POLLY_ANDROID_NDK_R11C_API_21_ARMEABI_V7A_NEON_CMAKE_ 1) +endif() + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_clear_environment_variables.cmake") + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_init.cmake") + +set(ANDROID_NDK_VERSION "r11c") +set(CMAKE_SYSTEM_VERSION "21") +set(CMAKE_ANDROID_ARCH_ABI "armeabi-v7a") +set(CMAKE_ANDROID_ARM_NEON TRUE) +set(CMAKE_ANDROID_ARM_MODE TRUE) # 32-bit ARM + +polly_init( + "Android NDK ${ANDROID_NDK_VERSION} / \ +API ${CMAKE_SYSTEM_VERSION} / ${CMAKE_ANDROID_ARCH_ABI} / \ +NEON / 32-bit ARM / c++11 support" + "Unix Makefiles" +) + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_common.cmake") + +include("${CMAKE_CURRENT_LIST_DIR}/flags/cxx11.cmake") # before toolchain! + +include("${CMAKE_CURRENT_LIST_DIR}/os/android.cmake") diff --git a/tools/polly/android-ndk-r11c-api-21-armeabi-v7a.cmake b/tools/polly/android-ndk-r11c-api-21-armeabi-v7a.cmake new file mode 100644 index 0000000..b8bd22d --- /dev/null +++ b/tools/polly/android-ndk-r11c-api-21-armeabi-v7a.cmake @@ -0,0 +1,31 @@ +# Copyright (c) 2016, Michele Caini +# All rights reserved. + +if(DEFINED POLLY_ANDROID_NDK_R11C_API_21_ARMEABI_V7A_CMAKE_) + return() +else() + set(POLLY_ANDROID_NDK_R11C_API_21_ARMEABI_V7A_CMAKE_ 1) +endif() + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_clear_environment_variables.cmake") + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_init.cmake") + +set(ANDROID_NDK_VERSION "r11c") +set(CMAKE_SYSTEM_VERSION "21") +set(CMAKE_ANDROID_ARCH_ABI "armeabi-v7a") +set(CMAKE_ANDROID_ARM_NEON FALSE) +set(CMAKE_ANDROID_ARM_MODE TRUE) # 32-bit ARM + +polly_init( + "Android NDK ${ANDROID_NDK_VERSION} / \ +API ${CMAKE_SYSTEM_VERSION} / ${CMAKE_ANDROID_ARCH_ABI} / \ +32-bit ARM / c++11 support" + "Unix Makefiles" +) + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_common.cmake") + +include("${CMAKE_CURRENT_LIST_DIR}/flags/cxx11.cmake") # before toolchain! + +include("${CMAKE_CURRENT_LIST_DIR}/os/android.cmake") diff --git a/tools/polly/android-ndk-r11c-api-21-armeabi.cmake b/tools/polly/android-ndk-r11c-api-21-armeabi.cmake new file mode 100644 index 0000000..5015903 --- /dev/null +++ b/tools/polly/android-ndk-r11c-api-21-armeabi.cmake @@ -0,0 +1,30 @@ +# Copyright (c) 2016, Michele Caini +# All rights reserved. + +if(DEFINED POLLY_ANDROID_NDK_R11C_API_21_ARMEABI_CMAKE_) + return() +else() + set(POLLY_ANDROID_NDK_R11C_API_21_ARMEABI_CMAKE_ 1) +endif() + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_clear_environment_variables.cmake") + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_init.cmake") + +set(ANDROID_NDK_VERSION "r11c") +set(CMAKE_SYSTEM_VERSION "21") +set(CMAKE_ANDROID_ARCH_ABI "armeabi") +set(CMAKE_ANDROID_ARM_MODE TRUE) # 32-bit ARM + +polly_init( + "Android NDK ${ANDROID_NDK_VERSION} / \ +API ${CMAKE_SYSTEM_VERSION} / ${CMAKE_ANDROID_ARCH_ABI} / \ +32-bit ARM / c++11 support" + "Unix Makefiles" +) + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_common.cmake") + +include("${CMAKE_CURRENT_LIST_DIR}/flags/cxx11.cmake") # before toolchain! + +include("${CMAKE_CURRENT_LIST_DIR}/os/android.cmake") diff --git a/tools/polly/android-ndk-r11c-api-21-mips.cmake b/tools/polly/android-ndk-r11c-api-21-mips.cmake new file mode 100644 index 0000000..1a80287 --- /dev/null +++ b/tools/polly/android-ndk-r11c-api-21-mips.cmake @@ -0,0 +1,29 @@ +# Copyright (c) 2016, Michele Caini +# All rights reserved. + +if(DEFINED POLLY_ANDROID_NDK_R11C_API_21_MIPS_CMAKE_) + return() +else() + set(POLLY_ANDROID_NDK_R11C_API_21_MIPS_CMAKE_ 1) +endif() + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_clear_environment_variables.cmake") + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_init.cmake") + +set(ANDROID_NDK_VERSION "r11c") +set(CMAKE_SYSTEM_VERSION "21") +set(CMAKE_ANDROID_ARCH_ABI "mips") + +polly_init( + "Android NDK ${ANDROID_NDK_VERSION} / \ +API ${CMAKE_SYSTEM_VERSION} / ${CMAKE_ANDROID_ARCH_ABI} / \ +c++11 support" + "Unix Makefiles" +) + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_common.cmake") + +include("${CMAKE_CURRENT_LIST_DIR}/flags/cxx11.cmake") # before toolchain! + +include("${CMAKE_CURRENT_LIST_DIR}/os/android.cmake") diff --git a/tools/polly/android-ndk-r11c-api-21-mips64.cmake b/tools/polly/android-ndk-r11c-api-21-mips64.cmake new file mode 100644 index 0000000..f44cdcb --- /dev/null +++ b/tools/polly/android-ndk-r11c-api-21-mips64.cmake @@ -0,0 +1,29 @@ +# Copyright (c) 2016, Michele Caini +# All rights reserved. + +if(DEFINED POLLY_ANDROID_NDK_R11C_API_21_MIPS64_CMAKE_) + return() +else() + set(POLLY_ANDROID_NDK_R11C_API_21_MIPS64_CMAKE_ 1) +endif() + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_clear_environment_variables.cmake") + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_init.cmake") + +set(ANDROID_NDK_VERSION "r11c") +set(CMAKE_SYSTEM_VERSION "21") +set(CMAKE_ANDROID_ARCH_ABI "mips64") + +polly_init( + "Android NDK ${ANDROID_NDK_VERSION} / \ +API ${CMAKE_SYSTEM_VERSION} / ${CMAKE_ANDROID_ARCH_ABI} / \ +c++11 support" + "Unix Makefiles" +) + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_common.cmake") + +include("${CMAKE_CURRENT_LIST_DIR}/flags/cxx11.cmake") # before toolchain! + +include("${CMAKE_CURRENT_LIST_DIR}/os/android.cmake") diff --git a/tools/polly/android-ndk-r11c-api-21-x86-64-hid.cmake b/tools/polly/android-ndk-r11c-api-21-x86-64-hid.cmake new file mode 100644 index 0000000..414110f --- /dev/null +++ b/tools/polly/android-ndk-r11c-api-21-x86-64-hid.cmake @@ -0,0 +1,32 @@ +# Copyright (c) 2016, Michele Caini +# All rights reserved. + +if(DEFINED POLLY_ANDROID_NDK_R11C_API_21_X86_64_HID_CMAKE_) + return() +else() + set(POLLY_ANDROID_NDK_R11C_API_21_X86_64_HID_CMAKE_ 1) +endif() + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_clear_environment_variables.cmake") + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_init.cmake") + +set(ANDROID_NDK_VERSION "r11c") +set(CMAKE_SYSTEM_VERSION "21") +set(CMAKE_ANDROID_ARCH_ABI "x86_64") + +polly_init( + "Android NDK ${ANDROID_NDK_VERSION} / \ +API ${CMAKE_SYSTEM_VERSION} / ${CMAKE_ANDROID_ARCH_ABI} / \ +hidden visibility / \ +c++11 support" + "Unix Makefiles" +) + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_common.cmake") + +include("${CMAKE_CURRENT_LIST_DIR}/flags/cxx11.cmake") # before toolchain! + +include("${CMAKE_CURRENT_LIST_DIR}/flags/hidden.cmake") + +include("${CMAKE_CURRENT_LIST_DIR}/os/android.cmake") diff --git a/tools/polly/android-ndk-r11c-api-21-x86-64.cmake b/tools/polly/android-ndk-r11c-api-21-x86-64.cmake new file mode 100644 index 0000000..9a7ee02 --- /dev/null +++ b/tools/polly/android-ndk-r11c-api-21-x86-64.cmake @@ -0,0 +1,29 @@ +# Copyright (c) 2016, Michele Caini +# All rights reserved. + +if(DEFINED POLLY_ANDROID_NDK_R11C_API_21_X86_64_CMAKE_) + return() +else() + set(POLLY_ANDROID_NDK_R11C_API_21_X86_64_CMAKE_ 1) +endif() + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_clear_environment_variables.cmake") + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_init.cmake") + +set(ANDROID_NDK_VERSION "r11c") +set(CMAKE_SYSTEM_VERSION "21") +set(CMAKE_ANDROID_ARCH_ABI "x86_64") + +polly_init( + "Android NDK ${ANDROID_NDK_VERSION} / \ +API ${CMAKE_SYSTEM_VERSION} / ${CMAKE_ANDROID_ARCH_ABI} / \ +c++11 support" + "Unix Makefiles" +) + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_common.cmake") + +include("${CMAKE_CURRENT_LIST_DIR}/flags/cxx11.cmake") # before toolchain! + +include("${CMAKE_CURRENT_LIST_DIR}/os/android.cmake") diff --git a/tools/polly/android-ndk-r11c-api-21-x86.cmake b/tools/polly/android-ndk-r11c-api-21-x86.cmake new file mode 100644 index 0000000..f413f63 --- /dev/null +++ b/tools/polly/android-ndk-r11c-api-21-x86.cmake @@ -0,0 +1,29 @@ +# Copyright (c) 2016, Michele Caini +# All rights reserved. + +if(DEFINED POLLY_ANDROID_NDK_R11C_API_21_X86_CMAKE_) + return() +else() + set(POLLY_ANDROID_NDK_R11C_API_21_X86_CMAKE_ 1) +endif() + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_clear_environment_variables.cmake") + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_init.cmake") + +set(ANDROID_NDK_VERSION "r11c") +set(CMAKE_SYSTEM_VERSION "21") +set(CMAKE_ANDROID_ARCH_ABI "x86") + +polly_init( + "Android NDK ${ANDROID_NDK_VERSION} / \ +API ${CMAKE_SYSTEM_VERSION} / ${CMAKE_ANDROID_ARCH_ABI} / \ +c++11 support" + "Unix Makefiles" +) + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_common.cmake") + +include("${CMAKE_CURRENT_LIST_DIR}/flags/cxx11.cmake") # before toolchain! + +include("${CMAKE_CURRENT_LIST_DIR}/os/android.cmake") diff --git a/tools/polly/android-ndk-r11c-api-8-armeabi-v7a.cmake b/tools/polly/android-ndk-r11c-api-8-armeabi-v7a.cmake new file mode 100644 index 0000000..c4eceb0 --- /dev/null +++ b/tools/polly/android-ndk-r11c-api-8-armeabi-v7a.cmake @@ -0,0 +1,31 @@ +# Copyright (c) 2016, Michele Caini +# All rights reserved. + +if(DEFINED POLLY_ANDROID_NDK_R11C_API_8_ARMEABI_V7A_CMAKE_) + return() +else() + set(POLLY_ANDROID_NDK_R11C_API_8_ARMEABI_V7A_CMAKE_ 1) +endif() + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_clear_environment_variables.cmake") + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_init.cmake") + +set(ANDROID_NDK_VERSION "r11c") +set(CMAKE_SYSTEM_VERSION "8") +set(CMAKE_ANDROID_ARCH_ABI "armeabi-v7a") +set(CMAKE_ANDROID_ARM_NEON FALSE) +set(CMAKE_ANDROID_ARM_MODE TRUE) # 32-bit ARM + +polly_init( + "Android NDK ${ANDROID_NDK_VERSION} / \ +API ${CMAKE_SYSTEM_VERSION} / ${CMAKE_ANDROID_ARCH_ABI} / \ +32-bit ARM / c++11 support" + "Unix Makefiles" +) + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_common.cmake") + +include("${CMAKE_CURRENT_LIST_DIR}/flags/cxx11.cmake") # before toolchain! + +include("${CMAKE_CURRENT_LIST_DIR}/os/android.cmake") diff --git a/tools/polly/android-ndk-r12b-api-19-armeabi-v7a-neon.cmake b/tools/polly/android-ndk-r12b-api-19-armeabi-v7a-neon.cmake new file mode 100644 index 0000000..e1d80ef --- /dev/null +++ b/tools/polly/android-ndk-r12b-api-19-armeabi-v7a-neon.cmake @@ -0,0 +1,33 @@ +# Copyright (c) 2015, Ruslan Baratov +# Copyright (c) 2015, David Hirvonen +# Copyright (c) 2015, Alexandre Pretyman +# All rights reserved. + +if(DEFINED POLLY_ANDROID_NDK_R12B_API_19_ARMEABI_V7A_NEON_CMAKE_) + return() +else() + set(POLLY_ANDROID_NDK_R12B_API_19_ARMEABI_V7A_NEON_CMAKE_ 1) +endif() + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_clear_environment_variables.cmake") + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_init.cmake") + +set(ANDROID_NDK_VERSION "r12b") +set(CMAKE_SYSTEM_VERSION "19") +set(CMAKE_ANDROID_ARCH_ABI "armeabi-v7a") +set(CMAKE_ANDROID_ARM_NEON TRUE) +set(CMAKE_ANDROID_ARM_MODE TRUE) # 32-bit ARM + +polly_init( + "Android NDK ${ANDROID_NDK_VERSION} / \ +API ${CMAKE_SYSTEM_VERSION} / ${CMAKE_ANDROID_ARCH_ABI} / \ +NEON / 32-bit ARM / c++11 support" + "Unix Makefiles" +) + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_common.cmake") + +include("${CMAKE_CURRENT_LIST_DIR}/flags/cxx11.cmake") # before toolchain! + +include("${CMAKE_CURRENT_LIST_DIR}/os/android.cmake") diff --git a/tools/polly/android-ndk-r13b-api-19-armeabi-v7a-neon.cmake b/tools/polly/android-ndk-r13b-api-19-armeabi-v7a-neon.cmake new file mode 100644 index 0000000..caf5cfd --- /dev/null +++ b/tools/polly/android-ndk-r13b-api-19-armeabi-v7a-neon.cmake @@ -0,0 +1,33 @@ +# Copyright (c) 2015, Ruslan Baratov +# Copyright (c) 2015, David Hirvonen +# Copyright (c) 2015, Alexandre Pretyman +# All rights reserved. + +if(DEFINED POLLY_ANDROID_NDK_R13B_API_19_ARMEABI_V7A_NEON_CMAKE_) + return() +else() + set(POLLY_ANDROID_NDK_R13B_API_19_ARMEABI_V7A_NEON_CMAKE_ 1) +endif() + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_clear_environment_variables.cmake") + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_init.cmake") + +set(ANDROID_NDK_VERSION "r13b") +set(CMAKE_SYSTEM_VERSION "19") +set(CMAKE_ANDROID_ARCH_ABI "armeabi-v7a") +set(CMAKE_ANDROID_ARM_NEON TRUE) +set(CMAKE_ANDROID_ARM_MODE TRUE) # 32-bit ARM + +polly_init( + "Android NDK ${ANDROID_NDK_VERSION} / \ +API ${CMAKE_SYSTEM_VERSION} / ${CMAKE_ANDROID_ARCH_ABI} / \ +NEON / 32-bit ARM / c++11 support" + "Unix Makefiles" +) + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_common.cmake") + +include("${CMAKE_CURRENT_LIST_DIR}/flags/cxx11.cmake") # before toolchain! + +include("${CMAKE_CURRENT_LIST_DIR}/os/android.cmake") diff --git a/tools/polly/android-ndk-r14-api-16-armeabi-v7a-neon-clang-hid-sections-lto.cmake b/tools/polly/android-ndk-r14-api-16-armeabi-v7a-neon-clang-hid-sections-lto.cmake new file mode 100644 index 0000000..b8bc4bd --- /dev/null +++ b/tools/polly/android-ndk-r14-api-16-armeabi-v7a-neon-clang-hid-sections-lto.cmake @@ -0,0 +1,36 @@ +# Copyright (c) 2015-2017, Ruslan Baratov +# Copyright (c) 2015, David Hirvonen +# All rights reserved. + +if(DEFINED POLLY_ANDROID_NDK_R14_API_16_ARMEABI_V7A_NEON_CLANG_HID_SECTIONS_LTO_CMAKE_) + return() +else() + set(POLLY_ANDROID_NDK_R14_API_16_ARMEABI_V7A_NEON_CLANG_HID_SECTIONS_LTO_CMAKE_ 1) +endif() + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_clear_environment_variables.cmake") + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_init.cmake") + +set(ANDROID_NDK_VERSION "r14") +set(CMAKE_SYSTEM_VERSION "16") +set(CMAKE_ANDROID_ARCH_ABI "armeabi-v7a") +set(CMAKE_ANDROID_ARM_NEON TRUE) +set(CMAKE_ANDROID_ARM_MODE TRUE) # 32-bit ARM +set(CMAKE_ANDROID_NDK_TOOLCHAIN_VERSION "clang") + +polly_init( + "Android NDK ${ANDROID_NDK_VERSION} / \ +API ${CMAKE_SYSTEM_VERSION} / ${CMAKE_ANDROID_ARCH_ABI} / \ +NEON / 32-bit ARM / Clang / c++11 support / data-sections / function-sections / LTO" + "Unix Makefiles" +) + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_common.cmake") + +include("${CMAKE_CURRENT_LIST_DIR}/flags/cxx11.cmake") # before toolchain! +include("${CMAKE_CURRENT_LIST_DIR}/flags/hidden.cmake") +include("${CMAKE_CURRENT_LIST_DIR}/flags/function-sections.cmake") +include("${CMAKE_CURRENT_LIST_DIR}/flags/data-sections.cmake") +include("${CMAKE_CURRENT_LIST_DIR}/os/android.cmake") +include("${CMAKE_CURRENT_LIST_DIR}/flags/lto.cmake") # after os/android.cmake diff --git a/tools/polly/android-ndk-r14-api-19-armeabi-v7a-neon-c11.cmake b/tools/polly/android-ndk-r14-api-19-armeabi-v7a-neon-c11.cmake new file mode 100644 index 0000000..5ff851e --- /dev/null +++ b/tools/polly/android-ndk-r14-api-19-armeabi-v7a-neon-c11.cmake @@ -0,0 +1,35 @@ +# Copyright (c) 2015-2017, Ruslan Baratov +# Copyright (c) 2015, David Hirvonen +# Copyright (c) 2015, Alexandre Pretyman +# All rights reserved. + +if(DEFINED POLLY_ANDROID_NDK_R14_API_19_ARMEABI_V7A_NEON_C11_CMAKE_) + return() +else() + set(POLLY_ANDROID_NDK_R14_API_19_ARMEABI_V7A_NEON_C11_CMAKE_ 1) +endif() + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_clear_environment_variables.cmake") + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_init.cmake") + +set(ANDROID_NDK_VERSION "r14") +set(CMAKE_SYSTEM_VERSION "19") +set(CMAKE_ANDROID_ARCH_ABI "armeabi-v7a") +set(CMAKE_ANDROID_ARM_NEON TRUE) +set(CMAKE_ANDROID_ARM_MODE TRUE) # 32-bit ARM + +polly_init( + "Android NDK ${ANDROID_NDK_VERSION} / \ +API ${CMAKE_SYSTEM_VERSION} / ${CMAKE_ANDROID_ARCH_ABI} / \ +NEON / 32-bit ARM / c++11 support / c11" + "Unix Makefiles" +) + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_common.cmake") + +include("${CMAKE_CURRENT_LIST_DIR}/flags/cxx11.cmake") # before toolchain! + +include("${CMAKE_CURRENT_LIST_DIR}/os/android.cmake") + +include("${CMAKE_CURRENT_LIST_DIR}/flags/c11.cmake") diff --git a/tools/polly/android-ndk-r14-api-19-armeabi-v7a-neon-clang-libcxx.cmake b/tools/polly/android-ndk-r14-api-19-armeabi-v7a-neon-clang-libcxx.cmake new file mode 100644 index 0000000..44e6213 --- /dev/null +++ b/tools/polly/android-ndk-r14-api-19-armeabi-v7a-neon-clang-libcxx.cmake @@ -0,0 +1,33 @@ +# Copyright (c) 2015-2017, Ruslan Baratov +# Copyright (c) 2015, David Hirvonen +# All rights reserved. + +if(DEFINED POLLY_ANDROID_NDK_R14_API_19_ARMEABI_V7A_NEON_CLANG_LIBCXX_CMAKE_) + return() +else() + set(POLLY_ANDROID_NDK_R14_API_19_ARMEABI_V7A_NEON_CLANG_LIBCXX_CMAKE_ 1) +endif() + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_clear_environment_variables.cmake") + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_init.cmake") + +set(ANDROID_NDK_VERSION "r14") +set(CMAKE_SYSTEM_VERSION "19") +set(CMAKE_ANDROID_ARCH_ABI "armeabi-v7a") +set(CMAKE_ANDROID_ARM_NEON TRUE) +set(CMAKE_ANDROID_ARM_MODE TRUE) # 32-bit ARM +set(CMAKE_ANDROID_NDK_TOOLCHAIN_VERSION "clang") +set(CMAKE_ANDROID_STL_TYPE "c++_static") # LLVM libc++ static + +polly_init( + "Android NDK ${ANDROID_NDK_VERSION} / \ +API ${CMAKE_SYSTEM_VERSION} / ${CMAKE_ANDROID_ARCH_ABI} / \ +NEON / 32-bit ARM / Clang / c++11 support / libc++ static" + "Unix Makefiles" +) + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_common.cmake") + +include("${CMAKE_CURRENT_LIST_DIR}/flags/cxx11.cmake") # before toolchain! +include("${CMAKE_CURRENT_LIST_DIR}/os/android.cmake") diff --git a/tools/polly/android-ndk-r14-api-19-armeabi-v7a-neon-clang.cmake b/tools/polly/android-ndk-r14-api-19-armeabi-v7a-neon-clang.cmake new file mode 100644 index 0000000..8123746 --- /dev/null +++ b/tools/polly/android-ndk-r14-api-19-armeabi-v7a-neon-clang.cmake @@ -0,0 +1,32 @@ +# Copyright (c) 2015-2017, Ruslan Baratov +# Copyright (c) 2015, David Hirvonen +# All rights reserved. + +if(DEFINED POLLY_ANDROID_NDK_R14_API_19_ARMEABI_V7A_NEON_CLANG_CMAKE_) + return() +else() + set(POLLY_ANDROID_NDK_R14_API_19_ARMEABI_V7A_NEON_CLANG_CMAKE_ 1) +endif() + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_clear_environment_variables.cmake") + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_init.cmake") + +set(ANDROID_NDK_VERSION "r14") +set(CMAKE_SYSTEM_VERSION "19") +set(CMAKE_ANDROID_ARCH_ABI "armeabi-v7a") +set(CMAKE_ANDROID_ARM_NEON TRUE) +set(CMAKE_ANDROID_ARM_MODE TRUE) # 32-bit ARM +set(CMAKE_ANDROID_NDK_TOOLCHAIN_VERSION "clang") + +polly_init( + "Android NDK ${ANDROID_NDK_VERSION} / \ +API ${CMAKE_SYSTEM_VERSION} / ${CMAKE_ANDROID_ARCH_ABI} / \ +NEON / 32-bit ARM / Clang / c++11 support" + "Unix Makefiles" +) + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_common.cmake") + +include("${CMAKE_CURRENT_LIST_DIR}/flags/cxx11.cmake") # before toolchain! +include("${CMAKE_CURRENT_LIST_DIR}/os/android.cmake") diff --git a/tools/polly/android-ndk-r14-api-19-armeabi-v7a-neon-hid-sections-lto.cmake b/tools/polly/android-ndk-r14-api-19-armeabi-v7a-neon-hid-sections-lto.cmake new file mode 100644 index 0000000..b6ea6a7 --- /dev/null +++ b/tools/polly/android-ndk-r14-api-19-armeabi-v7a-neon-hid-sections-lto.cmake @@ -0,0 +1,41 @@ +# Copyright (c) 2015-2017, Ruslan Baratov +# Copyright (c) 2015, David Hirvonen +# Copyright (c) 2015, Alexandre Pretyman +# All rights reserved. + +if(DEFINED POLLY_ANDROID_NDK_R14_API_19_ARMEABI_V7A_NEON_HID_SECTIONS_LTO_CMAKE_) + return() +else() + set(POLLY_ANDROID_NDK_R14_API_19_ARMEABI_V7A_NEON_HID_SECTIONS_LTO_CMAKE_ 1) +endif() + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_clear_environment_variables.cmake") + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_init.cmake") + +set(ANDROID_NDK_VERSION "r14") +set(CMAKE_SYSTEM_VERSION "19") +set(CMAKE_ANDROID_ARCH_ABI "armeabi-v7a") +set(CMAKE_ANDROID_ARM_NEON TRUE) +set(CMAKE_ANDROID_ARM_MODE TRUE) # 32-bit ARM + +polly_init( + "Android NDK ${ANDROID_NDK_VERSION} / \ +API ${CMAKE_SYSTEM_VERSION} / ${CMAKE_ANDROID_ARCH_ABI} / \ +NEON / 32-bit ARM / c++11 support / hidden / function-sections / data-sections / LTO" + "Unix Makefiles" +) + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_common.cmake") + +include("${CMAKE_CURRENT_LIST_DIR}/flags/cxx11.cmake") # before toolchain! + +include("${CMAKE_CURRENT_LIST_DIR}/flags/function-sections.cmake") + +include("${CMAKE_CURRENT_LIST_DIR}/flags/data-sections.cmake") + +include("${CMAKE_CURRENT_LIST_DIR}/flags/hidden.cmake") + +include("${CMAKE_CURRENT_LIST_DIR}/os/android.cmake") + +include("${CMAKE_CURRENT_LIST_DIR}/flags/lto.cmake") # after 'os/android.cmake' diff --git a/tools/polly/android-ndk-r14-api-21-arm64-v8a-clang-hid-sections-lto.cmake b/tools/polly/android-ndk-r14-api-21-arm64-v8a-clang-hid-sections-lto.cmake new file mode 100644 index 0000000..4976c42 --- /dev/null +++ b/tools/polly/android-ndk-r14-api-21-arm64-v8a-clang-hid-sections-lto.cmake @@ -0,0 +1,34 @@ +# Copyright (c) 2015-2017, Ruslan Baratov +# Copyright (c) 2015, David Hirvonen +# All rights reserved. + +if(DEFINED POLLY_ANDROID_NDK_R14_API_21_ARM64_V8A_CLANG_HID_SECTIONS_LTO_CMAKE_) + return() +else() + set(POLLY_ANDROID_NDK_R14_API_21_ARM64_V8A_CLANG_HID_SECTIONS_LTO_CMAKE_ 1) +endif() + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_clear_environment_variables.cmake") + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_init.cmake") + +set(ANDROID_NDK_VERSION "r14") +set(CMAKE_SYSTEM_VERSION "21") +set(CMAKE_ANDROID_ARCH_ABI "arm64-v8a") +set(CMAKE_ANDROID_NDK_TOOLCHAIN_VERSION "clang") + +polly_init( + "Android NDK ${ANDROID_NDK_VERSION} / \ +API ${CMAKE_SYSTEM_VERSION} / ${CMAKE_ANDROID_ARCH_ABI} / \ +Clang / c++11 support / data-sections / function-sections / LTO" + "Unix Makefiles" +) + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_common.cmake") + +include("${CMAKE_CURRENT_LIST_DIR}/flags/cxx11.cmake") # before toolchain! +include("${CMAKE_CURRENT_LIST_DIR}/flags/hidden.cmake") +include("${CMAKE_CURRENT_LIST_DIR}/flags/function-sections.cmake") +include("${CMAKE_CURRENT_LIST_DIR}/flags/data-sections.cmake") +include("${CMAKE_CURRENT_LIST_DIR}/os/android.cmake") +include("${CMAKE_CURRENT_LIST_DIR}/flags/lto.cmake") # after os/android.cmake diff --git a/tools/polly/android-ndk-r14-api-21-arm64-v8a-neon-clang-libcxx.cmake b/tools/polly/android-ndk-r14-api-21-arm64-v8a-neon-clang-libcxx.cmake new file mode 100644 index 0000000..141887b --- /dev/null +++ b/tools/polly/android-ndk-r14-api-21-arm64-v8a-neon-clang-libcxx.cmake @@ -0,0 +1,31 @@ +# Copyright (c) 2015-2017, Ruslan Baratov +# Copyright (c) 2015, David Hirvonen +# All rights reserved. + +if(DEFINED POLLY_ANDROID_NDK_R14_API_21_ARM64_V8A_NEON_CLANG_LIBCXX_CMAKE_) + return() +else() + set(POLLY_ANDROID_NDK_R14_API_21_ARM64_V8A_NEON_CLANG_LIBCXX_CMAKE_ 1) +endif() + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_clear_environment_variables.cmake") + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_init.cmake") + +set(ANDROID_NDK_VERSION "r14") +set(CMAKE_SYSTEM_VERSION "21") +set(CMAKE_ANDROID_ARCH_ABI "arm64-v8a") +set(CMAKE_ANDROID_NDK_TOOLCHAIN_VERSION "clang") +set(CMAKE_ANDROID_STL_TYPE "c++_static") # LLVM libc++ static + +polly_init( + "Android NDK ${ANDROID_NDK_VERSION} / \ +API ${CMAKE_SYSTEM_VERSION} / ${CMAKE_ANDROID_ARCH_ABI} / \ +Clang / c++11 support / libc++ static" + "Unix Makefiles" +) + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_common.cmake") + +include("${CMAKE_CURRENT_LIST_DIR}/flags/cxx11.cmake") # before toolchain! +include("${CMAKE_CURRENT_LIST_DIR}/os/android.cmake") diff --git a/tools/polly/android-ndk-r14-api-21-x86-64.cmake b/tools/polly/android-ndk-r14-api-21-x86-64.cmake new file mode 100644 index 0000000..1bfd4c8 --- /dev/null +++ b/tools/polly/android-ndk-r14-api-21-x86-64.cmake @@ -0,0 +1,30 @@ +# Copyright (c) 2016, Michele Caini +# Copyright (c) 2017, Ruslan Baratov +# All rights reserved. + +if(DEFINED POLLY_ANDROID_NDK_R14_API_21_X86_64_CMAKE_) + return() +else() + set(POLLY_ANDROID_NDK_R14_API_21_X86_64_CMAKE_ 1) +endif() + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_clear_environment_variables.cmake") + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_init.cmake") + +set(ANDROID_NDK_VERSION "r14") +set(CMAKE_SYSTEM_VERSION "21") +set(CMAKE_ANDROID_ARCH_ABI "x86_64") + +polly_init( + "Android NDK ${ANDROID_NDK_VERSION} / \ +API ${CMAKE_SYSTEM_VERSION} / ${CMAKE_ANDROID_ARCH_ABI} / \ +c++11 support" + "Unix Makefiles" +) + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_common.cmake") + +include("${CMAKE_CURRENT_LIST_DIR}/flags/cxx11.cmake") # before toolchain! + +include("${CMAKE_CURRENT_LIST_DIR}/os/android.cmake") diff --git a/tools/polly/android-ndk-r14b-api-21-armeabi-clang-libcxx.cmake b/tools/polly/android-ndk-r14b-api-21-armeabi-clang-libcxx.cmake new file mode 100644 index 0000000..1e1ba64 --- /dev/null +++ b/tools/polly/android-ndk-r14b-api-21-armeabi-clang-libcxx.cmake @@ -0,0 +1,29 @@ +if(DEFINED POLLY_ANDROID_NDK_R14B_API_21_ARMEABI_CLANG_LIBCXX_CMAKE_) + return() +else() + set(POLLY_ANDROID_NDK_R14B_API_21_ARMEABI_CLANG_LIBCXX_CMAKE_ 1) +endif() + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_clear_environment_variables.cmake") + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_init.cmake") + +set(ANDROID_NDK_VERSION "r14b") +set(CMAKE_SYSTEM_VERSION "21") +set(CMAKE_ANDROID_ARCH_ABI "armeabi") +set(CMAKE_ANDROID_ARM_MODE TRUE) # 32-bit ARM +set(CMAKE_ANDROID_NDK_TOOLCHAIN_VERSION "clang") +set(CMAKE_ANDROID_STL_TYPE "c++_static") # LLVM libc++ static + +polly_init( + "Android NDK ${ANDROID_NDK_VERSION} / \ +API ${CMAKE_SYSTEM_VERSION} / ${CMAKE_ANDROID_ARCH_ABI} / \ +32-bit ARM / Clang / c++11 support / libc++ static" + "Unix Makefiles" +) + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_common.cmake") + +include("${CMAKE_CURRENT_LIST_DIR}/flags/cxx11.cmake") # before toolchain! + +include("${CMAKE_CURRENT_LIST_DIR}/os/android.cmake") diff --git a/tools/polly/android-ndk-r14b-api-21-armeabi-v7a-neon-clang-libcxx.cmake b/tools/polly/android-ndk-r14b-api-21-armeabi-v7a-neon-clang-libcxx.cmake new file mode 100644 index 0000000..6ecb18a --- /dev/null +++ b/tools/polly/android-ndk-r14b-api-21-armeabi-v7a-neon-clang-libcxx.cmake @@ -0,0 +1,29 @@ +if(DEFINED POLLY_ANDROID_NDK_R14B_API_21_ARMEABI_V7A_NEON_CLANG_LIBCXX_CMAKE_) + return() +else() + set(POLLY_ANDROID_NDK_R14B_API_21_ARMEABI_V7A_NEON_CLANG_LIBCXX_CMAKE_ 1) +endif() + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_clear_environment_variables.cmake") + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_init.cmake") + +set(ANDROID_NDK_VERSION "r14b") +set(CMAKE_SYSTEM_VERSION "21") +set(CMAKE_ANDROID_ARCH_ABI "armeabi-v7a") +set(CMAKE_ANDROID_ARM_NEON TRUE) +set(CMAKE_ANDROID_ARM_MODE TRUE) # 32-bit ARM +set(CMAKE_ANDROID_NDK_TOOLCHAIN_VERSION "clang") +set(CMAKE_ANDROID_STL_TYPE "c++_static") # LLVM libc++ static + +polly_init( + "Android NDK ${ANDROID_NDK_VERSION} / \ +API ${CMAKE_SYSTEM_VERSION} / ${CMAKE_ANDROID_ARCH_ABI} / \ +Clang / c++11 support / libc++ static" + "Unix Makefiles" +) + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_common.cmake") + +include("${CMAKE_CURRENT_LIST_DIR}/flags/cxx11.cmake") # before toolchain! +include("${CMAKE_CURRENT_LIST_DIR}/os/android.cmake") diff --git a/tools/polly/android-ndk-r14b-api-21-mips-clang-libcxx.cmake b/tools/polly/android-ndk-r14b-api-21-mips-clang-libcxx.cmake new file mode 100644 index 0000000..dc7dac8 --- /dev/null +++ b/tools/polly/android-ndk-r14b-api-21-mips-clang-libcxx.cmake @@ -0,0 +1,28 @@ +if(DEFINED POLLY_ANDROID_NDK_R14B_API_21_MIPS_CLANG_LIBCXX_CMAKE_) + return() +else() + set(POLLY_ANDROID_NDK_R14B_API_21_MIPS_CLANG_LIBCXX_CMAKE_ 1) +endif() + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_clear_environment_variables.cmake") + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_init.cmake") + +set(ANDROID_NDK_VERSION "r14b") +set(CMAKE_SYSTEM_VERSION "21") +set(CMAKE_ANDROID_ARCH_ABI "mips") +set(CMAKE_ANDROID_NDK_TOOLCHAIN_VERSION "clang") +set(CMAKE_ANDROID_STL_TYPE "c++_static") # LLVM libc++ static + +polly_init( + "Android NDK ${ANDROID_NDK_VERSION} / \ +API ${CMAKE_SYSTEM_VERSION} / ${CMAKE_ANDROID_ARCH_ABI} / \ +Clang / c++11 support / libc++ static" + "Unix Makefiles" +) + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_common.cmake") + +include("${CMAKE_CURRENT_LIST_DIR}/flags/cxx11.cmake") # before toolchain! + +include("${CMAKE_CURRENT_LIST_DIR}/os/android.cmake") diff --git a/tools/polly/android-ndk-r14b-api-21-x86-clang-libcxx.cmake b/tools/polly/android-ndk-r14b-api-21-x86-clang-libcxx.cmake new file mode 100644 index 0000000..caf0c1f --- /dev/null +++ b/tools/polly/android-ndk-r14b-api-21-x86-clang-libcxx.cmake @@ -0,0 +1,28 @@ +if(DEFINED POLLY_ANDROID_NDK_R14B_API_21_X86_CLANG_LIBCXX_CMAKE_) + return() +else() + set(POLLY_ANDROID_NDK_R14B_API_21_X86_CLANG_LIBCXX_CMAKE_ 1) +endif() + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_clear_environment_variables.cmake") + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_init.cmake") + +set(ANDROID_NDK_VERSION "r14b") +set(CMAKE_SYSTEM_VERSION "21") +set(CMAKE_ANDROID_ARCH_ABI "x86") +set(CMAKE_ANDROID_NDK_TOOLCHAIN_VERSION "clang") +set(CMAKE_ANDROID_STL_TYPE "c++_static") # LLVM libc++ static + +polly_init( + "Android NDK ${ANDROID_NDK_VERSION} / \ +API ${CMAKE_SYSTEM_VERSION} / ${CMAKE_ANDROID_ARCH_ABI} / \ +Clang / c++11 support / libc++ static" + "Unix Makefiles" +) + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_common.cmake") + +include("${CMAKE_CURRENT_LIST_DIR}/flags/cxx11.cmake") # before toolchain! + +include("${CMAKE_CURRENT_LIST_DIR}/os/android.cmake") diff --git a/tools/polly/android-ndk-r15c-api-16-armeabi-clang-libcxx.cmake b/tools/polly/android-ndk-r15c-api-16-armeabi-clang-libcxx.cmake new file mode 100644 index 0000000..eeae2e0 --- /dev/null +++ b/tools/polly/android-ndk-r15c-api-16-armeabi-clang-libcxx.cmake @@ -0,0 +1,34 @@ +# Copyright (c) 2015-2017, Ruslan Baratov +# Copyright (c) 2015, David Hirvonen +# Copyright (c) 2015, Alexandre Pretyman +# All rights reserved. + +if(DEFINED POLLY_ANDROID_NDK_R15C_API_16_ARMEABI_CLANG_LIBCXX_CMAKE_) + return() +else() + set(POLLY_ANDROID_NDK_R15C_API_16_ARMEABI_CLANG_LIBCXX_CMAKE_ 1) +endif() + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_clear_environment_variables.cmake") + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_init.cmake") + +set(ANDROID_NDK_VERSION "r15c") +set(CMAKE_SYSTEM_VERSION "16") +set(CMAKE_ANDROID_ARCH_ABI "armeabi") +set(CMAKE_ANDROID_ARM_MODE TRUE) # 32-bit ARM +set(CMAKE_ANDROID_NDK_TOOLCHAIN_VERSION "clang") +set(CMAKE_ANDROID_STL_TYPE "c++_static") # LLVM libc++ static + +polly_init( + "Android NDK ${ANDROID_NDK_VERSION} / \ +API ${CMAKE_SYSTEM_VERSION} / ${CMAKE_ANDROID_ARCH_ABI} / \ +32-bit ARM / Clang / c++11 support / libc++ static" + "Unix Makefiles" +) + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_common.cmake") + +include("${CMAKE_CURRENT_LIST_DIR}/flags/cxx11.cmake") # before toolchain! + +include("${CMAKE_CURRENT_LIST_DIR}/os/android.cmake") diff --git a/tools/polly/android-ndk-r15c-api-16-armeabi-v7a-clang-libcxx.cmake b/tools/polly/android-ndk-r15c-api-16-armeabi-v7a-clang-libcxx.cmake new file mode 100644 index 0000000..4c13a73 --- /dev/null +++ b/tools/polly/android-ndk-r15c-api-16-armeabi-v7a-clang-libcxx.cmake @@ -0,0 +1,33 @@ +# Copyright (c) 2015-2017, Ruslan Baratov +# Copyright (c) 2015, David Hirvonen +# All rights reserved. + +if(DEFINED POLLY_ANDROID_NDK_R15C_API_16_ARMEABI_V7A_CLANG_LIBCXX_CMAKE_) + return() +else() + set(POLLY_ANDROID_NDK_R15C_API_16_ARMEABI_V7A_CLANG_LIBCXX_CMAKE_ 1) +endif() + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_clear_environment_variables.cmake") + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_init.cmake") + +set(ANDROID_NDK_VERSION "r15c") +set(CMAKE_SYSTEM_VERSION "16") +set(CMAKE_ANDROID_ARCH_ABI "armeabi-v7a") +set(CMAKE_ANDROID_ARM_NEON FALSE) +set(CMAKE_ANDROID_ARM_MODE TRUE) # 32-bit ARM +set(CMAKE_ANDROID_NDK_TOOLCHAIN_VERSION "clang") +set(CMAKE_ANDROID_STL_TYPE "c++_static") # LLVM libc++ static + +polly_init( + "Android NDK ${ANDROID_NDK_VERSION} / \ +API ${CMAKE_SYSTEM_VERSION} / ${CMAKE_ANDROID_ARCH_ABI} / \ +32-bit ARM / Clang / c++11 support / libc++ static" + "Unix Makefiles" +) + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_common.cmake") + +include("${CMAKE_CURRENT_LIST_DIR}/flags/cxx11.cmake") # before toolchain! +include("${CMAKE_CURRENT_LIST_DIR}/os/android.cmake") diff --git a/tools/polly/android-ndk-r15c-api-16-armeabi-v7a-neon-clang-libcxx.cmake b/tools/polly/android-ndk-r15c-api-16-armeabi-v7a-neon-clang-libcxx.cmake new file mode 100644 index 0000000..2635cbe --- /dev/null +++ b/tools/polly/android-ndk-r15c-api-16-armeabi-v7a-neon-clang-libcxx.cmake @@ -0,0 +1,33 @@ +# Copyright (c) 2015-2017, Ruslan Baratov +# Copyright (c) 2015, David Hirvonen +# All rights reserved. + +if(DEFINED POLLY_ANDROID_NDK_R15C_API_16_ARMEABI_V7A_NEON_CLANG_LIBCXX_CMAKE_) + return() +else() + set(POLLY_ANDROID_NDK_R15C_API_16_ARMEABI_V7A_NEON_CLANG_LIBCXX_CMAKE_ 1) +endif() + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_clear_environment_variables.cmake") + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_init.cmake") + +set(ANDROID_NDK_VERSION "r15c") +set(CMAKE_SYSTEM_VERSION "16") +set(CMAKE_ANDROID_ARCH_ABI "armeabi-v7a") +set(CMAKE_ANDROID_ARM_NEON TRUE) +set(CMAKE_ANDROID_ARM_MODE TRUE) # 32-bit ARM +set(CMAKE_ANDROID_NDK_TOOLCHAIN_VERSION "clang") +set(CMAKE_ANDROID_STL_TYPE "c++_static") # LLVM libc++ static + +polly_init( + "Android NDK ${ANDROID_NDK_VERSION} / \ +API ${CMAKE_SYSTEM_VERSION} / ${CMAKE_ANDROID_ARCH_ABI} / \ +Clang / c++11 support / libc++ static" + "Unix Makefiles" +) + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_common.cmake") + +include("${CMAKE_CURRENT_LIST_DIR}/flags/cxx11.cmake") # before toolchain! +include("${CMAKE_CURRENT_LIST_DIR}/os/android.cmake") diff --git a/tools/polly/android-ndk-r15c-api-16-mips-clang-libcxx.cmake b/tools/polly/android-ndk-r15c-api-16-mips-clang-libcxx.cmake new file mode 100644 index 0000000..0da67c7 --- /dev/null +++ b/tools/polly/android-ndk-r15c-api-16-mips-clang-libcxx.cmake @@ -0,0 +1,32 @@ +# Copyright (c) 2015, Ruslan Baratov +# Copyright (c) 2015, Michele Caini +# All rights reserved. + +if(DEFINED POLLY_ANDROID_NDK_R15C_API_16_MIPS_CLANG_LIBCXX_CMAKE_) + return() +else() + set(POLLY_ANDROID_NDK_R15C_API_16_MIPS_CLANG_LIBCXX_CMAKE_ 1) +endif() + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_clear_environment_variables.cmake") + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_init.cmake") + +set(ANDROID_NDK_VERSION "r15c") +set(CMAKE_SYSTEM_VERSION "16") +set(CMAKE_ANDROID_ARCH_ABI "mips") +set(CMAKE_ANDROID_NDK_TOOLCHAIN_VERSION "clang") +set(CMAKE_ANDROID_STL_TYPE "c++_static") # LLVM libc++ static + +polly_init( + "Android NDK ${ANDROID_NDK_VERSION} / \ +API ${CMAKE_SYSTEM_VERSION} / ${CMAKE_ANDROID_ARCH_ABI} / \ +Clang / c++11 support / libc++ static" + "Unix Makefiles" +) + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_common.cmake") + +include("${CMAKE_CURRENT_LIST_DIR}/flags/cxx11.cmake") # before toolchain! + +include("${CMAKE_CURRENT_LIST_DIR}/os/android.cmake") diff --git a/tools/polly/android-ndk-r15c-api-16-x86-clang-libcxx.cmake b/tools/polly/android-ndk-r15c-api-16-x86-clang-libcxx.cmake new file mode 100644 index 0000000..9a513a8 --- /dev/null +++ b/tools/polly/android-ndk-r15c-api-16-x86-clang-libcxx.cmake @@ -0,0 +1,31 @@ +# Copyright (c) 2015, Ruslan Baratov +# All rights reserved. + +if(DEFINED POLLY_ANDROID_NDK_R15C_API_16_X86_CLANG_LIBCXX_CMAKE_) + return() +else() + set(POLLY_ANDROID_NDK_R15C_API_16_X86_CLANG_LIBCXX_CMAKE_ 1) +endif() + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_clear_environment_variables.cmake") + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_init.cmake") + +set(ANDROID_NDK_VERSION "r15c") +set(CMAKE_SYSTEM_VERSION "16") +set(CMAKE_ANDROID_ARCH_ABI "x86") +set(CMAKE_ANDROID_NDK_TOOLCHAIN_VERSION "clang") +set(CMAKE_ANDROID_STL_TYPE "c++_static") # LLVM libc++ static + +polly_init( + "Android NDK ${ANDROID_NDK_VERSION} / \ +API ${CMAKE_SYSTEM_VERSION} / ${CMAKE_ANDROID_ARCH_ABI} / \ +Clang / c++11 support / libc++ static" + "Unix Makefiles" +) + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_common.cmake") + +include("${CMAKE_CURRENT_LIST_DIR}/flags/cxx11.cmake") # before toolchain! + +include("${CMAKE_CURRENT_LIST_DIR}/os/android.cmake") diff --git a/tools/polly/android-ndk-r15c-api-21-arm64-v8a-clang-libcxx.cmake b/tools/polly/android-ndk-r15c-api-21-arm64-v8a-clang-libcxx.cmake new file mode 100644 index 0000000..c52a3e7 --- /dev/null +++ b/tools/polly/android-ndk-r15c-api-21-arm64-v8a-clang-libcxx.cmake @@ -0,0 +1,32 @@ +# Copyright (c) 2015, Ruslan Baratov +# Copyright (c) 2017, Robert Nitsch +# All rights reserved. + +if(DEFINED POLLY_ANDROID_NDK_R15C_API_21_ARM64_V8A_CLANG_LIBCXX_CMAKE_) + return() +else() + set(POLLY_ANDROID_NDK_R15C_API_21_ARM64_V8A_CLANG_LIBCXX_CMAKE_ 1) +endif() + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_clear_environment_variables.cmake") + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_init.cmake") + +set(ANDROID_NDK_VERSION "r15c") +set(CMAKE_SYSTEM_VERSION "21") +set(CMAKE_ANDROID_ARCH_ABI "arm64-v8a") +set(CMAKE_ANDROID_NDK_TOOLCHAIN_VERSION "clang") +set(CMAKE_ANDROID_STL_TYPE "c++_static") # LLVM libc++ static + +polly_init( + "Android NDK ${ANDROID_NDK_VERSION} / \ +API ${CMAKE_SYSTEM_VERSION} / ${CMAKE_ANDROID_ARCH_ABI} / \ +Clang / c++11 support / libc++ static" + "Unix Makefiles" +) + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_common.cmake") + +include("${CMAKE_CURRENT_LIST_DIR}/flags/cxx11.cmake") # before toolchain! + +include("${CMAKE_CURRENT_LIST_DIR}/os/android.cmake") diff --git a/tools/polly/android-ndk-r15c-api-21-arm64-v8a-neon-clang-libcxx.cmake b/tools/polly/android-ndk-r15c-api-21-arm64-v8a-neon-clang-libcxx.cmake new file mode 100644 index 0000000..d954201 --- /dev/null +++ b/tools/polly/android-ndk-r15c-api-21-arm64-v8a-neon-clang-libcxx.cmake @@ -0,0 +1,32 @@ +# Copyright (c) 2015, Ruslan Baratov +# Copyright (c) 2017, Robert Nitsch +# All rights reserved. + +if(DEFINED POLLY_ANDROID_NDK_R15C_API_21_ARM64_V8A_NEON_CLANG_LIBCXX_CMAKE_) + return() +else() + set(POLLY_ANDROID_NDK_R15C_API_21_ARM64_V8A_NEON_CLANG_LIBCXX_CMAKE_ 1) +endif() + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_clear_environment_variables.cmake") + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_init.cmake") + +set(ANDROID_NDK_VERSION "r15c") +set(CMAKE_SYSTEM_VERSION "21") +set(CMAKE_ANDROID_ARCH_ABI "arm64-v8a") +set(CMAKE_ANDROID_NDK_TOOLCHAIN_VERSION "clang") +set(CMAKE_ANDROID_STL_TYPE "c++_static") # LLVM libc++ static + +polly_init( + "Android NDK ${ANDROID_NDK_VERSION} / \ +API ${CMAKE_SYSTEM_VERSION} / ${CMAKE_ANDROID_ARCH_ABI} / \ +Clang / c++11 support / libc++ static" + "Unix Makefiles" +) + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_common.cmake") + +include("${CMAKE_CURRENT_LIST_DIR}/flags/cxx11.cmake") # before toolchain! + +include("${CMAKE_CURRENT_LIST_DIR}/os/android.cmake") diff --git a/tools/polly/android-ndk-r15c-api-21-armeabi-clang-libcxx.cmake b/tools/polly/android-ndk-r15c-api-21-armeabi-clang-libcxx.cmake new file mode 100644 index 0000000..8c6aa16 --- /dev/null +++ b/tools/polly/android-ndk-r15c-api-21-armeabi-clang-libcxx.cmake @@ -0,0 +1,34 @@ +# Copyright (c) 2015-2017, Ruslan Baratov +# Copyright (c) 2015, David Hirvonen +# Copyright (c) 2015, Alexandre Pretyman +# All rights reserved. + +if(DEFINED POLLY_ANDROID_NDK_R15C_API_21_ARMEABI_CLANG_LIBCXX_CMAKE_) + return() +else() + set(POLLY_ANDROID_NDK_R15C_API_21_ARMEABI_CLANG_LIBCXX_CMAKE_ 1) +endif() + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_clear_environment_variables.cmake") + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_init.cmake") + +set(ANDROID_NDK_VERSION "r15c") +set(CMAKE_SYSTEM_VERSION "21") +set(CMAKE_ANDROID_ARCH_ABI "armeabi") +set(CMAKE_ANDROID_ARM_MODE TRUE) # 32-bit ARM +set(CMAKE_ANDROID_NDK_TOOLCHAIN_VERSION "clang") +set(CMAKE_ANDROID_STL_TYPE "c++_static") # LLVM libc++ static + +polly_init( + "Android NDK ${ANDROID_NDK_VERSION} / \ +API ${CMAKE_SYSTEM_VERSION} / ${CMAKE_ANDROID_ARCH_ABI} / \ +32-bit ARM / Clang / c++11 support / libc++ static" + "Unix Makefiles" +) + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_common.cmake") + +include("${CMAKE_CURRENT_LIST_DIR}/flags/cxx11.cmake") # before toolchain! + +include("${CMAKE_CURRENT_LIST_DIR}/os/android.cmake") diff --git a/tools/polly/android-ndk-r15c-api-21-armeabi-v7a-clang-libcxx.cmake b/tools/polly/android-ndk-r15c-api-21-armeabi-v7a-clang-libcxx.cmake new file mode 100644 index 0000000..c7e3021 --- /dev/null +++ b/tools/polly/android-ndk-r15c-api-21-armeabi-v7a-clang-libcxx.cmake @@ -0,0 +1,33 @@ +# Copyright (c) 2015-2018, Ruslan Baratov +# Copyright (c) 2015, David Hirvonen +# All rights reserved. + +if(DEFINED POLLY_ANDROID_NDK_R15C_API_21_ARMEABI_V7A_CLANG_LIBCXX_CMAKE_) + return() +else() + set(POLLY_ANDROID_NDK_R15C_API_21_ARMEABI_V7A_CLANG_LIBCXX_CMAKE_ 1) +endif() + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_clear_environment_variables.cmake") + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_init.cmake") + +set(ANDROID_NDK_VERSION "r15c") +set(CMAKE_SYSTEM_VERSION "21") +set(CMAKE_ANDROID_ARCH_ABI "armeabi-v7a") +set(CMAKE_ANDROID_ARM_NEON FALSE) +set(CMAKE_ANDROID_ARM_MODE TRUE) # 32-bit ARM +set(CMAKE_ANDROID_NDK_TOOLCHAIN_VERSION "clang") +set(CMAKE_ANDROID_STL_TYPE "c++_static") # LLVM libc++ static + +polly_init( + "Android NDK ${ANDROID_NDK_VERSION} / \ +API ${CMAKE_SYSTEM_VERSION} / ${CMAKE_ANDROID_ARCH_ABI} / \ +32-bit ARM / Clang / c++11 support / libc++ static" + "Unix Makefiles" +) + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_common.cmake") + +include("${CMAKE_CURRENT_LIST_DIR}/flags/cxx11.cmake") # before toolchain! +include("${CMAKE_CURRENT_LIST_DIR}/os/android.cmake") diff --git a/tools/polly/android-ndk-r15c-api-21-armeabi-v7a-neon-clang-libcxx.cmake b/tools/polly/android-ndk-r15c-api-21-armeabi-v7a-neon-clang-libcxx.cmake new file mode 100644 index 0000000..a99dcf9 --- /dev/null +++ b/tools/polly/android-ndk-r15c-api-21-armeabi-v7a-neon-clang-libcxx.cmake @@ -0,0 +1,33 @@ +# Copyright (c) 2015-2017, Ruslan Baratov +# Copyright (c) 2015, David Hirvonen +# All rights reserved. + +if(DEFINED POLLY_ANDROID_NDK_R15C_API_21_ARMEABI_V7A_NEON_CLANG_LIBCXX_CMAKE_) + return() +else() + set(POLLY_ANDROID_NDK_R15C_API_21_ARMEABI_V7A_NEON_CLANG_LIBCXX_CMAKE_ 1) +endif() + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_clear_environment_variables.cmake") + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_init.cmake") + +set(ANDROID_NDK_VERSION "r15c") +set(CMAKE_SYSTEM_VERSION "21") +set(CMAKE_ANDROID_ARCH_ABI "armeabi-v7a") +set(CMAKE_ANDROID_ARM_NEON TRUE) +set(CMAKE_ANDROID_ARM_MODE TRUE) # 32-bit ARM +set(CMAKE_ANDROID_NDK_TOOLCHAIN_VERSION "clang") +set(CMAKE_ANDROID_STL_TYPE "c++_static") # LLVM libc++ static + +polly_init( + "Android NDK ${ANDROID_NDK_VERSION} / \ +API ${CMAKE_SYSTEM_VERSION} / ${CMAKE_ANDROID_ARCH_ABI} / \ +Clang / c++11 support / libc++ static" + "Unix Makefiles" +) + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_common.cmake") + +include("${CMAKE_CURRENT_LIST_DIR}/flags/cxx11.cmake") # before toolchain! +include("${CMAKE_CURRENT_LIST_DIR}/os/android.cmake") diff --git a/tools/polly/android-ndk-r15c-api-21-mips-clang-libcxx.cmake b/tools/polly/android-ndk-r15c-api-21-mips-clang-libcxx.cmake new file mode 100644 index 0000000..51999b3 --- /dev/null +++ b/tools/polly/android-ndk-r15c-api-21-mips-clang-libcxx.cmake @@ -0,0 +1,32 @@ +# Copyright (c) 2015, Ruslan Baratov +# Copyright (c) 2015, Michele Caini +# All rights reserved. + +if(DEFINED POLLY_ANDROID_NDK_R15C_API_21_MIPS_CLANG_LIBCXX_CMAKE_) + return() +else() + set(POLLY_ANDROID_NDK_R15C_API_21_MIPS_CLANG_LIBCXX_CMAKE_ 1) +endif() + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_clear_environment_variables.cmake") + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_init.cmake") + +set(ANDROID_NDK_VERSION "r15c") +set(CMAKE_SYSTEM_VERSION "21") +set(CMAKE_ANDROID_ARCH_ABI "mips") +set(CMAKE_ANDROID_NDK_TOOLCHAIN_VERSION "clang") +set(CMAKE_ANDROID_STL_TYPE "c++_static") # LLVM libc++ static + +polly_init( + "Android NDK ${ANDROID_NDK_VERSION} / \ +API ${CMAKE_SYSTEM_VERSION} / ${CMAKE_ANDROID_ARCH_ABI} / \ +Clang / c++11 support / libc++ static" + "Unix Makefiles" +) + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_common.cmake") + +include("${CMAKE_CURRENT_LIST_DIR}/flags/cxx11.cmake") # before toolchain! + +include("${CMAKE_CURRENT_LIST_DIR}/os/android.cmake") diff --git a/tools/polly/android-ndk-r15c-api-21-x86-64-clang-libcxx.cmake b/tools/polly/android-ndk-r15c-api-21-x86-64-clang-libcxx.cmake new file mode 100644 index 0000000..02dd359 --- /dev/null +++ b/tools/polly/android-ndk-r15c-api-21-x86-64-clang-libcxx.cmake @@ -0,0 +1,31 @@ +# Copyright (c) 2015, Ruslan Baratov +# All rights reserved. + +if(DEFINED POLLY_ANDROID_NDK_R15C_API_21_X86_64_CLANG_LIBCXX_CMAKE_) + return() +else() + set(POLLY_ANDROID_NDK_R15C_API_21_X86_64_CLANG_LIBCXX_CMAKE_ 1) +endif() + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_clear_environment_variables.cmake") + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_init.cmake") + +set(ANDROID_NDK_VERSION "r15c") +set(CMAKE_SYSTEM_VERSION "21") +set(CMAKE_ANDROID_ARCH_ABI "x86_64") +set(CMAKE_ANDROID_NDK_TOOLCHAIN_VERSION "clang") +set(CMAKE_ANDROID_STL_TYPE "c++_static") # LLVM libc++ static + +polly_init( + "Android NDK ${ANDROID_NDK_VERSION} / \ +API ${CMAKE_SYSTEM_VERSION} / ${CMAKE_ANDROID_ARCH_ABI} / \ +Clang / c++11 support / libc++ static" + "Unix Makefiles" +) + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_common.cmake") + +include("${CMAKE_CURRENT_LIST_DIR}/flags/cxx11.cmake") # before toolchain! + +include("${CMAKE_CURRENT_LIST_DIR}/os/android.cmake") diff --git a/tools/polly/android-ndk-r15c-api-21-x86-clang-libcxx.cmake b/tools/polly/android-ndk-r15c-api-21-x86-clang-libcxx.cmake new file mode 100644 index 0000000..0ed76d9 --- /dev/null +++ b/tools/polly/android-ndk-r15c-api-21-x86-clang-libcxx.cmake @@ -0,0 +1,31 @@ +# Copyright (c) 2015, Ruslan Baratov +# All rights reserved. + +if(DEFINED POLLY_ANDROID_NDK_R15C_API_21_X86_CLANG_LIBCXX_CMAKE_) + return() +else() + set(POLLY_ANDROID_NDK_R15C_API_21_X86_CLANG_LIBCXX_CMAKE_ 1) +endif() + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_clear_environment_variables.cmake") + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_init.cmake") + +set(ANDROID_NDK_VERSION "r15c") +set(CMAKE_SYSTEM_VERSION "21") +set(CMAKE_ANDROID_ARCH_ABI "x86") +set(CMAKE_ANDROID_NDK_TOOLCHAIN_VERSION "clang") +set(CMAKE_ANDROID_STL_TYPE "c++_static") # LLVM libc++ static + +polly_init( + "Android NDK ${ANDROID_NDK_VERSION} / \ +API ${CMAKE_SYSTEM_VERSION} / ${CMAKE_ANDROID_ARCH_ABI} / \ +Clang / c++11 support / libc++ static" + "Unix Makefiles" +) + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_common.cmake") + +include("${CMAKE_CURRENT_LIST_DIR}/flags/cxx11.cmake") # before toolchain! + +include("${CMAKE_CURRENT_LIST_DIR}/os/android.cmake") diff --git a/tools/polly/android-ndk-r15c-api-24-armeabi-v7a-neon-clang-libcxx.cmake b/tools/polly/android-ndk-r15c-api-24-armeabi-v7a-neon-clang-libcxx.cmake new file mode 100644 index 0000000..0636f3a --- /dev/null +++ b/tools/polly/android-ndk-r15c-api-24-armeabi-v7a-neon-clang-libcxx.cmake @@ -0,0 +1,33 @@ +# Copyright (c) 2015-2018, Ruslan Baratov +# Copyright (c) 2015-2018, David Hirvonen +# All rights reserved. + +if(DEFINED POLLY_ANDROID_NDK_R15C_API_24_ARMEABI_V7A_NEON_CLANG_LIBCXX_CMAKE_) + return() +else() + set(POLLY_ANDROID_NDK_R15C_API_24_ARMEABI_V7A_NEON_CLANG_LIBCXX_CMAKE_ 1) +endif() + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_clear_environment_variables.cmake") + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_init.cmake") + +set(ANDROID_NDK_VERSION "r15c") +set(CMAKE_SYSTEM_VERSION "24") +set(CMAKE_ANDROID_ARCH_ABI "armeabi-v7a") +set(CMAKE_ANDROID_ARM_NEON TRUE) +set(CMAKE_ANDROID_ARM_MODE TRUE) # 32-bit ARM +set(CMAKE_ANDROID_NDK_TOOLCHAIN_VERSION "clang") +set(CMAKE_ANDROID_STL_TYPE "c++_static") # LLVM libc++ static + +polly_init( + "Android NDK ${ANDROID_NDK_VERSION} / \ +API ${CMAKE_SYSTEM_VERSION} / ${CMAKE_ANDROID_ARCH_ABI} / \ +Clang / c++11 support / libc++ static" + "Unix Makefiles" +) + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_common.cmake") + +include("${CMAKE_CURRENT_LIST_DIR}/flags/cxx11.cmake") # before toolchain! +include("${CMAKE_CURRENT_LIST_DIR}/os/android.cmake") diff --git a/tools/polly/android-ndk-r16b-api-16-armeabi-v7a-clang-libcxx14.cmake b/tools/polly/android-ndk-r16b-api-16-armeabi-v7a-clang-libcxx14.cmake new file mode 100644 index 0000000..574ced9 --- /dev/null +++ b/tools/polly/android-ndk-r16b-api-16-armeabi-v7a-clang-libcxx14.cmake @@ -0,0 +1,35 @@ +# Copyright (c) 2015-2018, Ruslan Baratov +# Copyright (c) 2017-2018, Robert Nitsch +# Copyright (c) 2018, David Hirvonen +# All rights reserved. + +if(DEFINED POLLY_ANDROID_NDK_R16B_API_16_ARMEABI_V7A_CLANG_LIBCXX14_CMAKE_) + return() +else() + set(POLLY_ANDROID_NDK_R16B_API_16_ARMEABI_V7A_CLANG_LIBCXX14_CMAKE_ 1) +endif() + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_clear_environment_variables.cmake") + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_init.cmake") + +set(ANDROID_NDK_VERSION "r16b") +set(CMAKE_SYSTEM_VERSION "16") +set(CMAKE_ANDROID_ARCH_ABI "armeabi-v7a") +set(CMAKE_ANDROID_ARM_NEON FALSE) +set(CMAKE_ANDROID_ARM_MODE TRUE) # 32-bit ARM +set(CMAKE_ANDROID_NDK_TOOLCHAIN_VERSION "clang") +set(CMAKE_ANDROID_STL_TYPE "c++_static") # LLVM libc++ static + +polly_init( + "Android NDK ${ANDROID_NDK_VERSION} / \ +API ${CMAKE_SYSTEM_VERSION} / ${CMAKE_ANDROID_ARCH_ABI} / \ +32-bit ARM / Clang / c++14 support / libc++ static" + "Unix Makefiles" +) + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_common.cmake") + +include("${CMAKE_CURRENT_LIST_DIR}/flags/cxx14.cmake") # before toolchain! + +include("${CMAKE_CURRENT_LIST_DIR}/os/android.cmake") diff --git a/tools/polly/android-ndk-r16b-api-16-armeabi-v7a-thumb-clang-libcxx14.cmake b/tools/polly/android-ndk-r16b-api-16-armeabi-v7a-thumb-clang-libcxx14.cmake new file mode 100644 index 0000000..575c6a0 --- /dev/null +++ b/tools/polly/android-ndk-r16b-api-16-armeabi-v7a-thumb-clang-libcxx14.cmake @@ -0,0 +1,35 @@ +# Copyright (c) 2015-2018, Ruslan Baratov +# Copyright (c) 2017-2018, Robert Nitsch +# Copyright (c) 2018, David Hirvonen +# All rights reserved. + +if(DEFINED POLLY_ANDROID_NDK_R16B_API_16_ARMEABI_V7A_THUMB_CLANG_LIBCXX14_CMAKE_) + return() +else() + set(POLLY_ANDROID_NDK_R16B_API_16_ARMEABI_V7A_THUMB_CLANG_LIBCXX14_CMAKE_ 1) +endif() + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_clear_environment_variables.cmake") + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_init.cmake") + +set(ANDROID_NDK_VERSION "r16b") +set(CMAKE_SYSTEM_VERSION "16") +set(CMAKE_ANDROID_ARCH_ABI "armeabi-v7a") +set(CMAKE_ANDROID_ARM_NEON FALSE) +set(CMAKE_ANDROID_ARM_MODE FALSE) # 16-bit Thumb +set(CMAKE_ANDROID_NDK_TOOLCHAIN_VERSION "clang") +set(CMAKE_ANDROID_STL_TYPE "c++_static") # LLVM libc++ static + +polly_init( + "Android NDK ${ANDROID_NDK_VERSION} / \ +API ${CMAKE_SYSTEM_VERSION} / ${CMAKE_ANDROID_ARCH_ABI} / \ +16-bit Thumb / Clang / c++14 support / libc++ static" + "Unix Makefiles" +) + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_common.cmake") + +include("${CMAKE_CURRENT_LIST_DIR}/flags/cxx14.cmake") # before toolchain! + +include("${CMAKE_CURRENT_LIST_DIR}/os/android.cmake") diff --git a/tools/polly/android-ndk-r16b-api-16-x86-clang-libcxx14.cmake b/tools/polly/android-ndk-r16b-api-16-x86-clang-libcxx14.cmake new file mode 100644 index 0000000..bd4e139 --- /dev/null +++ b/tools/polly/android-ndk-r16b-api-16-x86-clang-libcxx14.cmake @@ -0,0 +1,33 @@ +# Copyright (c) 2015-2018, Ruslan Baratov +# Copyright (c) 2017-2018, Robert Nitsch +# Copyright (c) 2018, David Hirvonen +# All rights reserved. + +if(DEFINED POLLY_ANDROID_NDK_R16B_API_16_X86_CLANG_LIBCXX14_CMAKE_) + return() +else() + set(POLLY_ANDROID_NDK_R16B_API_16_X86_CLANG_LIBCXX14_CMAKE_ 1) +endif() + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_clear_environment_variables.cmake") + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_init.cmake") + +set(ANDROID_NDK_VERSION "r16b") +set(CMAKE_SYSTEM_VERSION "16") +set(CMAKE_ANDROID_ARCH_ABI "x86") +set(CMAKE_ANDROID_NDK_TOOLCHAIN_VERSION "clang") +set(CMAKE_ANDROID_STL_TYPE "c++_static") # LLVM libc++ static + +polly_init( + "Android NDK ${ANDROID_NDK_VERSION} / \ +API ${CMAKE_SYSTEM_VERSION} / ${CMAKE_ANDROID_ARCH_ABI} / \ +Clang / c++14 support / libc++ static" + "Unix Makefiles" +) + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_common.cmake") + +include("${CMAKE_CURRENT_LIST_DIR}/flags/cxx14.cmake") # before toolchain! + +include("${CMAKE_CURRENT_LIST_DIR}/os/android.cmake") diff --git a/tools/polly/android-ndk-r16b-api-19-gcc-49-armeabi-v7a-neon-libcxx-hid-sections-lto.cmake b/tools/polly/android-ndk-r16b-api-19-gcc-49-armeabi-v7a-neon-libcxx-hid-sections-lto.cmake new file mode 100644 index 0000000..3b7f68f --- /dev/null +++ b/tools/polly/android-ndk-r16b-api-19-gcc-49-armeabi-v7a-neon-libcxx-hid-sections-lto.cmake @@ -0,0 +1,43 @@ +# Copyright (c) 2015-2018, Ruslan Baratov +# Copyright (c) 2015-2018, David Hirvonen +# Copyright (c) 2015-2018, Alexandre Pretyman +# All rights reserved. + +if(DEFINED POLLY_ANDROID_NDK_R16B_API_19_GCC49_ARMEABI_V7A_NEON_LIBCXX_HID_SECTIONS_LTO_CMAKE_) + return() +else() + set(POLLY_ANDROID_NDK_R16B_API_19_GCC49_ARMEABI_V7A_NEON_LIBCXX_HID_SECTIONS_LTO_CMAKE_ 1) +endif() + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_clear_environment_variables.cmake") + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_init.cmake") + +set(ANDROID_NDK_VERSION "r16b") +set(CMAKE_SYSTEM_VERSION "19") +set(CMAKE_ANDROID_ARCH_ABI "armeabi-v7a") +set(CMAKE_ANDROID_ARM_NEON TRUE) +set(CMAKE_ANDROID_ARM_MODE TRUE) # 32-bit ARM +set(CMAKE_ANDROID_NDK_TOOLCHAIN_VERSION "4.9") # .: GCC of specified version +set(CMAKE_ANDROID_STL_TYPE "c++_static") # LLVM libc++ static + +polly_init( + "Android NDK ${ANDROID_NDK_VERSION} / \ +API ${CMAKE_SYSTEM_VERSION} / ${CMAKE_ANDROID_ARCH_ABI} / \ +NEON / 32-bit ARM / c++11 support / hidden / function-sections / data-sections / LTO" + "Unix Makefiles" +) + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_common.cmake") + +include("${CMAKE_CURRENT_LIST_DIR}/flags/cxx11.cmake") # before toolchain! + +include("${CMAKE_CURRENT_LIST_DIR}/flags/function-sections.cmake") + +include("${CMAKE_CURRENT_LIST_DIR}/flags/data-sections.cmake") + +include("${CMAKE_CURRENT_LIST_DIR}/flags/hidden.cmake") + +include("${CMAKE_CURRENT_LIST_DIR}/os/android.cmake") + +include("${CMAKE_CURRENT_LIST_DIR}/flags/lto.cmake") # after 'os/android.cmake' diff --git a/tools/polly/android-ndk-r16b-api-21-arm64-v8a-neon-clang-libcxx.cmake b/tools/polly/android-ndk-r16b-api-21-arm64-v8a-neon-clang-libcxx.cmake new file mode 100644 index 0000000..db88a25 --- /dev/null +++ b/tools/polly/android-ndk-r16b-api-21-arm64-v8a-neon-clang-libcxx.cmake @@ -0,0 +1,32 @@ +# Copyright (c) 2015, Ruslan Baratov +# Copyright (c) 2017, Robert Nitsch +# All rights reserved. + +if(DEFINED POLLY_ANDROID_NDK_R16B_API_21_ARM64_V8A_NEON_CLANG_LIBCXX_CMAKE_) + return() +else() + set(POLLY_ANDROID_NDK_R16B_API_21_ARM64_V8A_NEON_CLANG_LIBCXX_CMAKE_ 1) +endif() + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_clear_environment_variables.cmake") + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_init.cmake") + +set(ANDROID_NDK_VERSION "r16b") +set(CMAKE_SYSTEM_VERSION "21") +set(CMAKE_ANDROID_ARCH_ABI "arm64-v8a") +set(CMAKE_ANDROID_NDK_TOOLCHAIN_VERSION "clang") +set(CMAKE_ANDROID_STL_TYPE "c++_static") # LLVM libc++ static + +polly_init( + "Android NDK ${ANDROID_NDK_VERSION} / \ +API ${CMAKE_SYSTEM_VERSION} / ${CMAKE_ANDROID_ARCH_ABI} / \ +Clang / c++11 support / libc++ static" + "Unix Makefiles" +) + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_common.cmake") + +include("${CMAKE_CURRENT_LIST_DIR}/flags/cxx11.cmake") # before toolchain! + +include("${CMAKE_CURRENT_LIST_DIR}/os/android.cmake") diff --git a/tools/polly/android-ndk-r16b-api-21-arm64-v8a-neon-clang-libcxx14.cmake b/tools/polly/android-ndk-r16b-api-21-arm64-v8a-neon-clang-libcxx14.cmake new file mode 100644 index 0000000..5520c7b --- /dev/null +++ b/tools/polly/android-ndk-r16b-api-21-arm64-v8a-neon-clang-libcxx14.cmake @@ -0,0 +1,32 @@ +# Copyright (c) 2015, Ruslan Baratov +# Copyright (c) 2017, Robert Nitsch +# All rights reserved. + +if(DEFINED POLLY_ANDROID_NDK_R16B_API_21_ARM64_V8A_NEON_CLANG_LIBCXX14_CMAKE_) + return() +else() + set(POLLY_ANDROID_NDK_R16B_API_21_ARM64_V8A_NEON_CLANG_LIBCXX14_CMAKE_ 1) +endif() + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_clear_environment_variables.cmake") + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_init.cmake") + +set(ANDROID_NDK_VERSION "r16b") +set(CMAKE_SYSTEM_VERSION "21") +set(CMAKE_ANDROID_ARCH_ABI "arm64-v8a") +set(CMAKE_ANDROID_NDK_TOOLCHAIN_VERSION "clang") +set(CMAKE_ANDROID_STL_TYPE "c++_static") # LLVM libc++ static + +polly_init( + "Android NDK ${ANDROID_NDK_VERSION} / \ +API ${CMAKE_SYSTEM_VERSION} / ${CMAKE_ANDROID_ARCH_ABI} / \ +Clang / c++14 support / libc++ static" + "Unix Makefiles" +) + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_common.cmake") + +include("${CMAKE_CURRENT_LIST_DIR}/flags/cxx14.cmake") # before toolchain! + +include("${CMAKE_CURRENT_LIST_DIR}/os/android.cmake") diff --git a/tools/polly/android-ndk-r16b-api-21-armeabi-clang-libcxx.cmake b/tools/polly/android-ndk-r16b-api-21-armeabi-clang-libcxx.cmake new file mode 100644 index 0000000..e31097f --- /dev/null +++ b/tools/polly/android-ndk-r16b-api-21-armeabi-clang-libcxx.cmake @@ -0,0 +1,34 @@ +# Copyright (c) 2015-2017, Ruslan Baratov +# Copyright (c) 2015, David Hirvonen +# Copyright (c) 2015, Alexandre Pretyman +# All rights reserved. + +if(DEFINED POLLY_ANDROID_NDK_R16B_API_21_ARMEABI_CLANG_LIBCXX_CMAKE_) + return() +else() + set(POLLY_ANDROID_NDK_R16B_API_21_ARMEABI_CLANG_LIBCXX_CMAKE_ 1) +endif() + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_clear_environment_variables.cmake") + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_init.cmake") + +set(ANDROID_NDK_VERSION "r16b") +set(CMAKE_SYSTEM_VERSION "21") +set(CMAKE_ANDROID_ARCH_ABI "armeabi") +set(CMAKE_ANDROID_ARM_MODE TRUE) # 32-bit ARM +set(CMAKE_ANDROID_NDK_TOOLCHAIN_VERSION "clang") +set(CMAKE_ANDROID_STL_TYPE "c++_static") # LLVM libc++ static + +polly_init( + "Android NDK ${ANDROID_NDK_VERSION} / \ +API ${CMAKE_SYSTEM_VERSION} / ${CMAKE_ANDROID_ARCH_ABI} / \ +32-bit ARM / Clang / c++11 support / libc++ static" + "Unix Makefiles" +) + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_common.cmake") + +include("${CMAKE_CURRENT_LIST_DIR}/flags/cxx11.cmake") # before toolchain! + +include("${CMAKE_CURRENT_LIST_DIR}/os/android.cmake") diff --git a/tools/polly/android-ndk-r16b-api-21-armeabi-clang-libcxx14.cmake b/tools/polly/android-ndk-r16b-api-21-armeabi-clang-libcxx14.cmake new file mode 100644 index 0000000..d580b4d --- /dev/null +++ b/tools/polly/android-ndk-r16b-api-21-armeabi-clang-libcxx14.cmake @@ -0,0 +1,34 @@ +# Copyright (c) 2015-2017, Ruslan Baratov +# Copyright (c) 2015, David Hirvonen +# Copyright (c) 2015, Alexandre Pretyman +# All rights reserved. + +if(DEFINED POLLY_ANDROID_NDK_R16B_API_21_ARMEABI_CLANG_LIBCXX14_CMAKE_) + return() +else() + set(POLLY_ANDROID_NDK_R16B_API_21_ARMEABI_CLANG_LIBCXX14_CMAKE_ 1) +endif() + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_clear_environment_variables.cmake") + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_init.cmake") + +set(ANDROID_NDK_VERSION "r16b") +set(CMAKE_SYSTEM_VERSION "21") +set(CMAKE_ANDROID_ARCH_ABI "armeabi") +set(CMAKE_ANDROID_ARM_MODE TRUE) # 32-bit ARM +set(CMAKE_ANDROID_NDK_TOOLCHAIN_VERSION "clang") +set(CMAKE_ANDROID_STL_TYPE "c++_static") # LLVM libc++ static + +polly_init( + "Android NDK ${ANDROID_NDK_VERSION} / \ +API ${CMAKE_SYSTEM_VERSION} / ${CMAKE_ANDROID_ARCH_ABI} / \ +32-bit ARM / Clang / c++14 support / libc++ static" + "Unix Makefiles" +) + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_common.cmake") + +include("${CMAKE_CURRENT_LIST_DIR}/flags/cxx14.cmake") # before toolchain! + +include("${CMAKE_CURRENT_LIST_DIR}/os/android.cmake") diff --git a/tools/polly/android-ndk-r16b-api-21-armeabi-v7a-clang-libcxx.cmake b/tools/polly/android-ndk-r16b-api-21-armeabi-v7a-clang-libcxx.cmake new file mode 100644 index 0000000..576799d --- /dev/null +++ b/tools/polly/android-ndk-r16b-api-21-armeabi-v7a-clang-libcxx.cmake @@ -0,0 +1,34 @@ +# Copyright (c) 2015-2017, Ruslan Baratov +# Copyright (c) 2015, David Hirvonen +# Copyright (c) 2017, Robert Nitsch +# All rights reserved. + +if(DEFINED POLLY_ANDROID_NDK_R16B_API_21_ARMEABI_V7A_CLANG_LIBCXX_CMAKE_) + return() +else() + set(POLLY_ANDROID_NDK_R16B_API_21_ARMEABI_V7A_CLANG_LIBCXX_CMAKE_ 1) +endif() + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_clear_environment_variables.cmake") + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_init.cmake") + +set(ANDROID_NDK_VERSION "r16b") +set(CMAKE_SYSTEM_VERSION "21") +set(CMAKE_ANDROID_ARCH_ABI "armeabi-v7a") +set(CMAKE_ANDROID_ARM_NEON FALSE) +set(CMAKE_ANDROID_ARM_MODE TRUE) # 32-bit ARM +set(CMAKE_ANDROID_NDK_TOOLCHAIN_VERSION "clang") +set(CMAKE_ANDROID_STL_TYPE "c++_static") # LLVM libc++ static + +polly_init( + "Android NDK ${ANDROID_NDK_VERSION} / \ +API ${CMAKE_SYSTEM_VERSION} / ${CMAKE_ANDROID_ARCH_ABI} / \ +32-bit ARM / Clang / c++11 support / libc++ static" + "Unix Makefiles" +) + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_common.cmake") + +include("${CMAKE_CURRENT_LIST_DIR}/flags/cxx11.cmake") # before toolchain! +include("${CMAKE_CURRENT_LIST_DIR}/os/android.cmake") diff --git a/tools/polly/android-ndk-r16b-api-21-armeabi-v7a-clang-libcxx14.cmake b/tools/polly/android-ndk-r16b-api-21-armeabi-v7a-clang-libcxx14.cmake new file mode 100644 index 0000000..ef5a084 --- /dev/null +++ b/tools/polly/android-ndk-r16b-api-21-armeabi-v7a-clang-libcxx14.cmake @@ -0,0 +1,34 @@ +# Copyright (c) 2015-2017, Ruslan Baratov +# Copyright (c) 2015, David Hirvonen +# Copyright (c) 2017, Robert Nitsch +# All rights reserved. + +if(DEFINED POLLY_ANDROID_NDK_R16B_API_21_ARMEABI_V7A_CLANG_LIBCXX14_CMAKE_) + return() +else() + set(POLLY_ANDROID_NDK_R16B_API_21_ARMEABI_V7A_CLANG_LIBCXX14_CMAKE_ 1) +endif() + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_clear_environment_variables.cmake") + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_init.cmake") + +set(ANDROID_NDK_VERSION "r16b") +set(CMAKE_SYSTEM_VERSION "21") +set(CMAKE_ANDROID_ARCH_ABI "armeabi-v7a") +set(CMAKE_ANDROID_ARM_NEON FALSE) +set(CMAKE_ANDROID_ARM_MODE TRUE) # 32-bit ARM +set(CMAKE_ANDROID_NDK_TOOLCHAIN_VERSION "clang") +set(CMAKE_ANDROID_STL_TYPE "c++_static") # LLVM libc++ static + +polly_init( + "Android NDK ${ANDROID_NDK_VERSION} / \ +API ${CMAKE_SYSTEM_VERSION} / ${CMAKE_ANDROID_ARCH_ABI} / \ +32-bit ARM / Clang / c++14 support / libc++ static" + "Unix Makefiles" +) + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_common.cmake") + +include("${CMAKE_CURRENT_LIST_DIR}/flags/cxx14.cmake") # before toolchain! +include("${CMAKE_CURRENT_LIST_DIR}/os/android.cmake") diff --git a/tools/polly/android-ndk-r16b-api-21-armeabi-v7a-neon-clang-libcxx.cmake b/tools/polly/android-ndk-r16b-api-21-armeabi-v7a-neon-clang-libcxx.cmake new file mode 100644 index 0000000..54cf885 --- /dev/null +++ b/tools/polly/android-ndk-r16b-api-21-armeabi-v7a-neon-clang-libcxx.cmake @@ -0,0 +1,34 @@ +# Copyright (c) 2015-2017, Ruslan Baratov +# Copyright (c) 2015, David Hirvonen +# Copyright (c) 2017, Robert Nitsch +# All rights reserved. + +if(DEFINED POLLY_ANDROID_NDK_R16B_API_21_ARMEABI_V7A_NEON_CLANG_LIBCXX_CMAKE_) + return() +else() + set(POLLY_ANDROID_NDK_R16B_API_21_ARMEABI_V7A_NEON_CLANG_LIBCXX_CMAKE_ 1) +endif() + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_clear_environment_variables.cmake") + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_init.cmake") + +set(ANDROID_NDK_VERSION "r16b") +set(CMAKE_SYSTEM_VERSION "21") +set(CMAKE_ANDROID_ARCH_ABI "armeabi-v7a") +set(CMAKE_ANDROID_ARM_NEON TRUE) +set(CMAKE_ANDROID_ARM_MODE TRUE) # 32-bit ARM +set(CMAKE_ANDROID_NDK_TOOLCHAIN_VERSION "clang") +set(CMAKE_ANDROID_STL_TYPE "c++_static") # LLVM libc++ static + +polly_init( + "Android NDK ${ANDROID_NDK_VERSION} / \ +API ${CMAKE_SYSTEM_VERSION} / ${CMAKE_ANDROID_ARCH_ABI} / \ +Clang / c++11 support / libc++ static" + "Unix Makefiles" +) + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_common.cmake") + +include("${CMAKE_CURRENT_LIST_DIR}/flags/cxx11.cmake") # before toolchain! +include("${CMAKE_CURRENT_LIST_DIR}/os/android.cmake") diff --git a/tools/polly/android-ndk-r16b-api-21-armeabi-v7a-neon-clang-libcxx14.cmake b/tools/polly/android-ndk-r16b-api-21-armeabi-v7a-neon-clang-libcxx14.cmake new file mode 100644 index 0000000..0797fcc --- /dev/null +++ b/tools/polly/android-ndk-r16b-api-21-armeabi-v7a-neon-clang-libcxx14.cmake @@ -0,0 +1,34 @@ +# Copyright (c) 2015-2017, Ruslan Baratov +# Copyright (c) 2015, David Hirvonen +# Copyright (c) 2017, Robert Nitsch +# All rights reserved. + +if(DEFINED POLLY_ANDROID_NDK_R16B_API_21_ARMEABI_V7A_NEON_CLANG_LIBCXX14_CMAKE_) + return() +else() + set(POLLY_ANDROID_NDK_R16B_API_21_ARMEABI_V7A_NEON_CLANG_LIBCXX14_CMAKE_ 1) +endif() + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_clear_environment_variables.cmake") + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_init.cmake") + +set(ANDROID_NDK_VERSION "r16b") +set(CMAKE_SYSTEM_VERSION "21") +set(CMAKE_ANDROID_ARCH_ABI "armeabi-v7a") +set(CMAKE_ANDROID_ARM_NEON TRUE) +set(CMAKE_ANDROID_ARM_MODE TRUE) # 32-bit ARM +set(CMAKE_ANDROID_NDK_TOOLCHAIN_VERSION "clang") +set(CMAKE_ANDROID_STL_TYPE "c++_static") # LLVM libc++ static + +polly_init( + "Android NDK ${ANDROID_NDK_VERSION} / \ +API ${CMAKE_SYSTEM_VERSION} / ${CMAKE_ANDROID_ARCH_ABI} / \ +NEON / 32-bit ARM / Clang / c++14 support / libc++ static" + "Unix Makefiles" +) + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_common.cmake") + +include("${CMAKE_CURRENT_LIST_DIR}/flags/cxx14.cmake") # before toolchain! +include("${CMAKE_CURRENT_LIST_DIR}/os/android.cmake") diff --git a/tools/polly/android-ndk-r16b-api-21-x86-64-clang-libcxx.cmake b/tools/polly/android-ndk-r16b-api-21-x86-64-clang-libcxx.cmake new file mode 100644 index 0000000..0ce8d0a --- /dev/null +++ b/tools/polly/android-ndk-r16b-api-21-x86-64-clang-libcxx.cmake @@ -0,0 +1,33 @@ +# Copyright (c) 2015, Ruslan Baratov +# Copyright (c) 2017, Robert Nitsch +# Copyright (c) 2018, Chanwoo Noh +# All rights reserved. + +if(DEFINED POLLY_ANDROID_NDK_R16B_API_21_X86_64_CLANG_LIBCXX_CMAKE_) + return() +else() + set(POLLY_ANDROID_NDK_R16B_API_21_X86_64_CLANG_LIBCXX_CMAKE_ 1) +endif() + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_clear_environment_variables.cmake") + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_init.cmake") + +set(ANDROID_NDK_VERSION "r16b") +set(CMAKE_SYSTEM_VERSION "21") +set(CMAKE_ANDROID_ARCH_ABI "x86_64") +set(CMAKE_ANDROID_NDK_TOOLCHAIN_VERSION "clang") +set(CMAKE_ANDROID_STL_TYPE "c++_static") # LLVM libc++ static + +polly_init( + "Android NDK ${ANDROID_NDK_VERSION} / \ +API ${CMAKE_SYSTEM_VERSION} / ${CMAKE_ANDROID_ARCH_ABI} / \ +Clang / c++11 support / libc++ static" + "Unix Makefiles" +) + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_common.cmake") + +include("${CMAKE_CURRENT_LIST_DIR}/flags/cxx11.cmake") # before toolchain! + +include("${CMAKE_CURRENT_LIST_DIR}/os/android.cmake") diff --git a/tools/polly/android-ndk-r16b-api-21-x86-clang-libcxx.cmake b/tools/polly/android-ndk-r16b-api-21-x86-clang-libcxx.cmake new file mode 100644 index 0000000..30ee4a3 --- /dev/null +++ b/tools/polly/android-ndk-r16b-api-21-x86-clang-libcxx.cmake @@ -0,0 +1,32 @@ +# Copyright (c) 2015, Ruslan Baratov +# Copyright (c) 2017, Robert Nitsch +# All rights reserved. + +if(DEFINED POLLY_ANDROID_NDK_R16B_API_21_X86_CLANG_LIBCXX_CMAKE_) + return() +else() + set(POLLY_ANDROID_NDK_R16B_API_21_X86_CLANG_LIBCXX_CMAKE_ 1) +endif() + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_clear_environment_variables.cmake") + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_init.cmake") + +set(ANDROID_NDK_VERSION "r16b") +set(CMAKE_SYSTEM_VERSION "21") +set(CMAKE_ANDROID_ARCH_ABI "x86") +set(CMAKE_ANDROID_NDK_TOOLCHAIN_VERSION "clang") +set(CMAKE_ANDROID_STL_TYPE "c++_static") # LLVM libc++ static + +polly_init( + "Android NDK ${ANDROID_NDK_VERSION} / \ +API ${CMAKE_SYSTEM_VERSION} / ${CMAKE_ANDROID_ARCH_ABI} / \ +Clang / c++11 support / libc++ static" + "Unix Makefiles" +) + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_common.cmake") + +include("${CMAKE_CURRENT_LIST_DIR}/flags/cxx11.cmake") # before toolchain! + +include("${CMAKE_CURRENT_LIST_DIR}/os/android.cmake") diff --git a/tools/polly/android-ndk-r16b-api-24-arm64-v8a-clang-libcxx14.cmake b/tools/polly/android-ndk-r16b-api-24-arm64-v8a-clang-libcxx14.cmake new file mode 100644 index 0000000..27d9d19 --- /dev/null +++ b/tools/polly/android-ndk-r16b-api-24-arm64-v8a-clang-libcxx14.cmake @@ -0,0 +1,33 @@ +# Copyright (c) 2015-2018, Ruslan Baratov +# Copyright (c) 2017-2018, Robert Nitsch +# Copyright (c) 2018, David Hirvonen +# All rights reserved. + +if(DEFINED POLLY_ANDROID_NDK_R16B_API_24_ARM64_V8A_CLANG_LIBCXX14_CMAKE_) + return() +else() + set(POLLY_ANDROID_NDK_R16B_API_24_ARM64_V8A_CLANG_LIBCXX14_CMAKE_ 1) +endif() + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_clear_environment_variables.cmake") + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_init.cmake") + +set(ANDROID_NDK_VERSION "r16b") +set(CMAKE_SYSTEM_VERSION "24") +set(CMAKE_ANDROID_ARCH_ABI "arm64-v8a") +set(CMAKE_ANDROID_NDK_TOOLCHAIN_VERSION "clang") +set(CMAKE_ANDROID_STL_TYPE "c++_static") # LLVM libc++ static + +polly_init( + "Android NDK ${ANDROID_NDK_VERSION} / \ +API ${CMAKE_SYSTEM_VERSION} / ${CMAKE_ANDROID_ARCH_ABI} / \ +Clang / c++14 support / libc++ static" + "Unix Makefiles" +) + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_common.cmake") + +include("${CMAKE_CURRENT_LIST_DIR}/flags/cxx14.cmake") # before toolchain! + +include("${CMAKE_CURRENT_LIST_DIR}/os/android.cmake") diff --git a/tools/polly/android-ndk-r16b-api-24-armeabi-v7a-neon-clang-libcxx.cmake b/tools/polly/android-ndk-r16b-api-24-armeabi-v7a-neon-clang-libcxx.cmake new file mode 100644 index 0000000..2aff1a2 --- /dev/null +++ b/tools/polly/android-ndk-r16b-api-24-armeabi-v7a-neon-clang-libcxx.cmake @@ -0,0 +1,34 @@ +# Copyright (c) 2015-2017, Ruslan Baratov +# Copyright (c) 2015, David Hirvonen +# Copyright (c) 2017, Robert Nitsch +# All rights reserved. + +if(DEFINED POLLY_ANDROID_NDK_R16B_API_24_ARMEABI_V7A_NEON_CLANG_LIBCXX_CMAKE_) + return() +else() + set(POLLY_ANDROID_NDK_R16B_API_24_ARMEABI_V7A_NEON_CLANG_LIBCXX_CMAKE_ 1) +endif() + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_clear_environment_variables.cmake") + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_init.cmake") + +set(ANDROID_NDK_VERSION "r16b") +set(CMAKE_SYSTEM_VERSION "24") +set(CMAKE_ANDROID_ARCH_ABI "armeabi-v7a") +set(CMAKE_ANDROID_ARM_NEON TRUE) +set(CMAKE_ANDROID_ARM_MODE TRUE) # 32-bit ARM +set(CMAKE_ANDROID_NDK_TOOLCHAIN_VERSION "clang") +set(CMAKE_ANDROID_STL_TYPE "c++_static") # LLVM libc++ static + +polly_init( + "Android NDK ${ANDROID_NDK_VERSION} / \ +API ${CMAKE_SYSTEM_VERSION} / ${CMAKE_ANDROID_ARCH_ABI} / \ +Clang / c++11 support / libc++ static" + "Unix Makefiles" +) + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_common.cmake") + +include("${CMAKE_CURRENT_LIST_DIR}/flags/cxx11.cmake") # before toolchain! +include("${CMAKE_CURRENT_LIST_DIR}/os/android.cmake") diff --git a/tools/polly/android-ndk-r16b-api-24-armeabi-v7a-neon-clang-libcxx14.cmake b/tools/polly/android-ndk-r16b-api-24-armeabi-v7a-neon-clang-libcxx14.cmake new file mode 100644 index 0000000..4bd4e20 --- /dev/null +++ b/tools/polly/android-ndk-r16b-api-24-armeabi-v7a-neon-clang-libcxx14.cmake @@ -0,0 +1,34 @@ +# Copyright (c) 2015-2018, Ruslan Baratov +# Copyright (c) 2015-2018, David Hirvonen +# Copyright (c) 2017-2018, Robert Nitsch +# All rights reserved. + +if(DEFINED POLLY_ANDROID_NDK_R16B_API_24_ARMEABI_V7A_NEON_CLANG_LIBCXX14_CMAKE_) + return() +else() + set(POLLY_ANDROID_NDK_R16B_API_24_ARMEABI_V7A_NEON_CLANG_LIBCXX14_CMAKE_ 1) +endif() + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_clear_environment_variables.cmake") + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_init.cmake") + +set(ANDROID_NDK_VERSION "r16b") +set(CMAKE_SYSTEM_VERSION "24") +set(CMAKE_ANDROID_ARCH_ABI "armeabi-v7a") +set(CMAKE_ANDROID_ARM_NEON TRUE) +set(CMAKE_ANDROID_ARM_MODE TRUE) # 32-bit ARM +set(CMAKE_ANDROID_NDK_TOOLCHAIN_VERSION "clang") +set(CMAKE_ANDROID_STL_TYPE "c++_static") # LLVM libc++ static + +polly_init( + "Android NDK ${ANDROID_NDK_VERSION} / \ +API ${CMAKE_SYSTEM_VERSION} / ${CMAKE_ANDROID_ARCH_ABI} / \ +Clang / c++14 support / libc++ static" + "Unix Makefiles" +) + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_common.cmake") + +include("${CMAKE_CURRENT_LIST_DIR}/flags/cxx14.cmake") # before toolchain! +include("${CMAKE_CURRENT_LIST_DIR}/os/android.cmake") diff --git a/tools/polly/android-ndk-r17-api-16-armeabi-v7a-clang-libcxx14.cmake b/tools/polly/android-ndk-r17-api-16-armeabi-v7a-clang-libcxx14.cmake new file mode 100644 index 0000000..9f9cf12 --- /dev/null +++ b/tools/polly/android-ndk-r17-api-16-armeabi-v7a-clang-libcxx14.cmake @@ -0,0 +1,35 @@ +# Copyright (c) 2015-2018, Ruslan Baratov +# Copyright (c) 2017-2018, Robert Nitsch +# Copyright (c) 2018, David Hirvonen +# All rights reserved. + +if(DEFINED POLLY_ANDROID_NDK_R17_API_16_ARMEABI_V7A_CLANG_LIBCXX14_CMAKE_) + return() +else() + set(POLLY_ANDROID_NDK_R17_API_16_ARMEABI_V7A_CLANG_LIBCXX14_CMAKE_ 1) +endif() + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_clear_environment_variables.cmake") + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_init.cmake") + +set(ANDROID_NDK_VERSION "r17") +set(CMAKE_SYSTEM_VERSION "16") +set(CMAKE_ANDROID_ARCH_ABI "armeabi-v7a") +set(CMAKE_ANDROID_ARM_NEON FALSE) +set(CMAKE_ANDROID_ARM_MODE TRUE) # 32-bit ARM +set(CMAKE_ANDROID_NDK_TOOLCHAIN_VERSION "clang") +set(CMAKE_ANDROID_STL_TYPE "c++_static") # LLVM libc++ static + +polly_init( + "Android NDK ${ANDROID_NDK_VERSION} / \ +API ${CMAKE_SYSTEM_VERSION} / ${CMAKE_ANDROID_ARCH_ABI} / \ +32-bit ARM / Clang / c++14 support / libc++ static" + "Unix Makefiles" +) + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_common.cmake") + +include("${CMAKE_CURRENT_LIST_DIR}/flags/cxx14.cmake") # before toolchain! + +include("${CMAKE_CURRENT_LIST_DIR}/os/android.cmake") diff --git a/tools/polly/android-ndk-r17-api-16-x86-clang-libcxx14.cmake b/tools/polly/android-ndk-r17-api-16-x86-clang-libcxx14.cmake new file mode 100644 index 0000000..35a3cd1 --- /dev/null +++ b/tools/polly/android-ndk-r17-api-16-x86-clang-libcxx14.cmake @@ -0,0 +1,33 @@ +# Copyright (c) 2015-2018, Ruslan Baratov +# Copyright (c) 2017-2018, Robert Nitsch +# Copyright (c) 2018, David Hirvonen +# All rights reserved. + +if(DEFINED POLLY_ANDROID_NDK_R17_API_16_X86_CLANG_LIBCXX14_CMAKE_) + return() +else() + set(POLLY_ANDROID_NDK_R17_API_16_X86_CLANG_LIBCXX14_CMAKE_ 1) +endif() + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_clear_environment_variables.cmake") + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_init.cmake") + +set(ANDROID_NDK_VERSION "r17") +set(CMAKE_SYSTEM_VERSION "16") +set(CMAKE_ANDROID_ARCH_ABI "x86") +set(CMAKE_ANDROID_NDK_TOOLCHAIN_VERSION "clang") +set(CMAKE_ANDROID_STL_TYPE "c++_static") # LLVM libc++ static + +polly_init( + "Android NDK ${ANDROID_NDK_VERSION} / \ +API ${CMAKE_SYSTEM_VERSION} / ${CMAKE_ANDROID_ARCH_ABI} / \ +Clang / c++14 support / libc++ static" + "Unix Makefiles" +) + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_common.cmake") + +include("${CMAKE_CURRENT_LIST_DIR}/flags/cxx14.cmake") # before toolchain! + +include("${CMAKE_CURRENT_LIST_DIR}/os/android.cmake") diff --git a/tools/polly/android-ndk-r17-api-19-armeabi-v7a-neon-clang-libcxx.cmake b/tools/polly/android-ndk-r17-api-19-armeabi-v7a-neon-clang-libcxx.cmake new file mode 100644 index 0000000..5251324 --- /dev/null +++ b/tools/polly/android-ndk-r17-api-19-armeabi-v7a-neon-clang-libcxx.cmake @@ -0,0 +1,33 @@ +# Copyright (c) 2015-2017, Ruslan Baratov +# Copyright (c) 2015, David Hirvonen +# All rights reserved. + +if(DEFINED POLLY_ANDROID_NDK_R17_API_19_ARMEABI_V7A_NEON_CLANG_LIBCXX_CMAKE_) + return() +else() + set(POLLY_ANDROID_NDK_R17_API_19_ARMEABI_V7A_NEON_CLANG_LIBCXX_CMAKE_ 1) +endif() + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_clear_environment_variables.cmake") + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_init.cmake") + +set(ANDROID_NDK_VERSION "r17") +set(CMAKE_SYSTEM_VERSION "19") +set(CMAKE_ANDROID_ARCH_ABI "armeabi-v7a") +set(CMAKE_ANDROID_ARM_NEON TRUE) +set(CMAKE_ANDROID_ARM_MODE TRUE) # 32-bit ARM +set(CMAKE_ANDROID_NDK_TOOLCHAIN_VERSION "clang") +set(CMAKE_ANDROID_STL_TYPE "c++_static") # LLVM libc++ static + +polly_init( + "Android NDK ${ANDROID_NDK_VERSION} / \ +API ${CMAKE_SYSTEM_VERSION} / ${CMAKE_ANDROID_ARCH_ABI} / \ +NEON / 32-bit ARM / Clang / c++11 support / libc++ static" + "Unix Makefiles" +) + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_common.cmake") + +include("${CMAKE_CURRENT_LIST_DIR}/flags/cxx11.cmake") # before toolchain! +include("${CMAKE_CURRENT_LIST_DIR}/os/android.cmake") diff --git a/tools/polly/android-ndk-r17-api-19-armeabi-v7a-neon-hid-sections.cmake b/tools/polly/android-ndk-r17-api-19-armeabi-v7a-neon-hid-sections.cmake new file mode 100644 index 0000000..1018772 --- /dev/null +++ b/tools/polly/android-ndk-r17-api-19-armeabi-v7a-neon-hid-sections.cmake @@ -0,0 +1,39 @@ +# Copyright (c) 2015, Ruslan Baratov +# Copyright (c) 2015, David Hirvonen +# Copyright (c) 2015, Alexandre Pretyman +# All rights reserved. + +if(DEFINED POLLY_ANDROID_NDK_R17_API_19_ARMEABI_V7A_NEON_HID_SECTIONS_CMAKE_) + return() +else() + set(POLLY_ANDROID_NDK_R17_API_19_ARMEABI_V7A_NEON_HID_SECTIONS_CMAKE_ 1) +endif() + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_clear_environment_variables.cmake") + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_init.cmake") + +set(ANDROID_NDK_VERSION "r17") +set(CMAKE_SYSTEM_VERSION "19") +set(CMAKE_ANDROID_ARCH_ABI "armeabi-v7a") +set(CMAKE_ANDROID_ARM_NEON TRUE) +set(CMAKE_ANDROID_ARM_MODE TRUE) # 32-bit ARM + +polly_init( + "Android NDK ${ANDROID_NDK_VERSION} / \ +API ${CMAKE_SYSTEM_VERSION} / ${CMAKE_ANDROID_ARCH_ABI} / \ +NEON / 32-bit ARM / c++11 support / hidden / function-sections / data-sections" + "Unix Makefiles" +) + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_common.cmake") + +include("${CMAKE_CURRENT_LIST_DIR}/flags/cxx11.cmake") # before toolchain! + +include("${CMAKE_CURRENT_LIST_DIR}/flags/function-sections.cmake") + +include("${CMAKE_CURRENT_LIST_DIR}/flags/data-sections.cmake") + +include("${CMAKE_CURRENT_LIST_DIR}/flags/hidden.cmake") + +include("${CMAKE_CURRENT_LIST_DIR}/os/android.cmake") diff --git a/tools/polly/android-ndk-r17-api-21-arm64-v8a-neon-clang-libcxx14.cmake b/tools/polly/android-ndk-r17-api-21-arm64-v8a-neon-clang-libcxx14.cmake new file mode 100644 index 0000000..fb5e90d --- /dev/null +++ b/tools/polly/android-ndk-r17-api-21-arm64-v8a-neon-clang-libcxx14.cmake @@ -0,0 +1,32 @@ +# Copyright (c) 2015, Ruslan Baratov +# Copyright (c) 2017, Robert Nitsch +# All rights reserved. + +if(DEFINED POLLY_ANDROID_NDK_R17_API_21_ARM64_V8A_NEON_CLANG_LIBCXX14_CMAKE_) + return() +else() + set(POLLY_ANDROID_NDK_R17_API_21_ARM64_V8A_NEON_CLANG_LIBCXX14_CMAKE_ 1) +endif() + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_clear_environment_variables.cmake") + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_init.cmake") + +set(ANDROID_NDK_VERSION "r17") +set(CMAKE_SYSTEM_VERSION "21") +set(CMAKE_ANDROID_ARCH_ABI "arm64-v8a") +set(CMAKE_ANDROID_NDK_TOOLCHAIN_VERSION "clang") +set(CMAKE_ANDROID_STL_TYPE "c++_static") # LLVM libc++ static + +polly_init( + "Android NDK ${ANDROID_NDK_VERSION} / \ +API ${CMAKE_SYSTEM_VERSION} / ${CMAKE_ANDROID_ARCH_ABI} / \ +Clang / c++14 support / libc++ static" + "Unix Makefiles" +) + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_common.cmake") + +include("${CMAKE_CURRENT_LIST_DIR}/flags/cxx14.cmake") # before toolchain! + +include("${CMAKE_CURRENT_LIST_DIR}/os/android.cmake") diff --git a/tools/polly/android-ndk-r17-api-21-x86-64-clang-libcxx14.cmake b/tools/polly/android-ndk-r17-api-21-x86-64-clang-libcxx14.cmake new file mode 100644 index 0000000..1590b3f --- /dev/null +++ b/tools/polly/android-ndk-r17-api-21-x86-64-clang-libcxx14.cmake @@ -0,0 +1,33 @@ +# Copyright (c) 2015, Ruslan Baratov +# Copyright (c) 2017, Robert Nitsch +# Copyright (c) 2018, Chanwoo Noh +# All rights reserved. + +if(DEFINED POLLY_ANDROID_NDK_R17_API_21_X86_64_CLANG_LIBCXX14_CMAKE_) + return() +else() + set(POLLY_ANDROID_NDK_R17_API_21_X86_64_CLANG_LIBCXX14_CMAKE_ 1) +endif() + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_clear_environment_variables.cmake") + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_init.cmake") + +set(ANDROID_NDK_VERSION "r17") +set(CMAKE_SYSTEM_VERSION "21") +set(CMAKE_ANDROID_ARCH_ABI "x86_64") +set(CMAKE_ANDROID_NDK_TOOLCHAIN_VERSION "clang") +set(CMAKE_ANDROID_STL_TYPE "c++_static") # LLVM libc++ static + +polly_init( + "Android NDK ${ANDROID_NDK_VERSION} / \ +API ${CMAKE_SYSTEM_VERSION} / ${CMAKE_ANDROID_ARCH_ABI} / \ +Clang / c++14 support / libc++ static" + "Unix Makefiles" +) + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_common.cmake") + +include("${CMAKE_CURRENT_LIST_DIR}/flags/cxx14.cmake") # before toolchain! + +include("${CMAKE_CURRENT_LIST_DIR}/os/android.cmake") diff --git a/tools/polly/android-ndk-r17-api-24-arm64-v8a-clang-libcxx14.cmake b/tools/polly/android-ndk-r17-api-24-arm64-v8a-clang-libcxx14.cmake new file mode 100644 index 0000000..bd55652 --- /dev/null +++ b/tools/polly/android-ndk-r17-api-24-arm64-v8a-clang-libcxx14.cmake @@ -0,0 +1,33 @@ +# Copyright (c) 2015-2018, Ruslan Baratov +# Copyright (c) 2017-2018, Robert Nitsch +# Copyright (c) 2018, David Hirvonen +# All rights reserved. + +if(DEFINED POLLY_ANDROID_NDK_R17_API_24_ARM64_V8A_CLANG_LIBCXX14_CMAKE_) + return() +else() + set(POLLY_ANDROID_NDK_R17_API_24_ARM64_V8A_CLANG_LIBCXX14_CMAKE_ 1) +endif() + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_clear_environment_variables.cmake") + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_init.cmake") + +set(ANDROID_NDK_VERSION "r17") +set(CMAKE_SYSTEM_VERSION "24") +set(CMAKE_ANDROID_ARCH_ABI "arm64-v8a") +set(CMAKE_ANDROID_NDK_TOOLCHAIN_VERSION "clang") +set(CMAKE_ANDROID_STL_TYPE "c++_static") # LLVM libc++ static + +polly_init( + "Android NDK ${ANDROID_NDK_VERSION} / \ +API ${CMAKE_SYSTEM_VERSION} / ${CMAKE_ANDROID_ARCH_ABI} / \ +Clang / c++14 support / libc++ static" + "Unix Makefiles" +) + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_common.cmake") + +include("${CMAKE_CURRENT_LIST_DIR}/flags/cxx14.cmake") # before toolchain! + +include("${CMAKE_CURRENT_LIST_DIR}/os/android.cmake") diff --git a/tools/polly/android-ndk-r18-api-24-arm64-v8a-clang-libcxx14.cmake b/tools/polly/android-ndk-r18-api-24-arm64-v8a-clang-libcxx14.cmake new file mode 100644 index 0000000..d4dcbbe --- /dev/null +++ b/tools/polly/android-ndk-r18-api-24-arm64-v8a-clang-libcxx14.cmake @@ -0,0 +1,33 @@ +# Copyright (c) 2015-2018, Ruslan Baratov +# Copyright (c) 2017-2018, Robert Nitsch +# Copyright (c) 2018, David Hirvonen +# All rights reserved. + +if(DEFINED POLLY_ANDROID_NDK_R18_API_24_ARM64_V8A_CLANG_LIBCXX14_CMAKE_) + return() +else() + set(POLLY_ANDROID_NDK_R18_API_24_ARM64_V8A_CLANG_LIBCXX14_CMAKE_ 1) +endif() + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_clear_environment_variables.cmake") + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_init.cmake") + +set(ANDROID_NDK_VERSION "r18") +set(CMAKE_SYSTEM_VERSION "24") +set(CMAKE_ANDROID_ARCH_ABI "arm64-v8a") +set(CMAKE_ANDROID_NDK_TOOLCHAIN_VERSION "clang") +set(CMAKE_ANDROID_STL_TYPE "c++_static") # LLVM libc++ static + +polly_init( + "Android NDK ${ANDROID_NDK_VERSION} / \ +API ${CMAKE_SYSTEM_VERSION} / ${CMAKE_ANDROID_ARCH_ABI} / \ +Clang / c++14 support / libc++ static" + "Unix Makefiles" +) + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_common.cmake") + +include("${CMAKE_CURRENT_LIST_DIR}/flags/cxx14.cmake") # before toolchain! + +include("${CMAKE_CURRENT_LIST_DIR}/os/android.cmake") diff --git a/tools/polly/android-ndk-r18b-api-16-armeabi-v7a-clang-libcxx.cmake b/tools/polly/android-ndk-r18b-api-16-armeabi-v7a-clang-libcxx.cmake new file mode 100644 index 0000000..c4155c9 --- /dev/null +++ b/tools/polly/android-ndk-r18b-api-16-armeabi-v7a-clang-libcxx.cmake @@ -0,0 +1,33 @@ +# Copyright (c) 2015-2018, Ruslan Baratov +# Copyright (c) 2015, David Hirvonen +# All rights reserved. + +if(DEFINED POLLY_ANDROID_NDK_R18B_API_16_ARMEABI_V7A_CLANG_LIBCXX_CMAKE_) + return() +else() + set(POLLY_ANDROID_NDK_R18B_API_16_ARMEABI_V7A_CLANG_LIBCXX_CMAKE_ 1) +endif() + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_clear_environment_variables.cmake") + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_init.cmake") + +set(ANDROID_NDK_VERSION "r18b") +set(CMAKE_SYSTEM_VERSION "16") +set(CMAKE_ANDROID_ARCH_ABI "armeabi-v7a") +set(CMAKE_ANDROID_ARM_NEON FALSE) +set(CMAKE_ANDROID_ARM_MODE TRUE) # 32-bit ARM +set(CMAKE_ANDROID_NDK_TOOLCHAIN_VERSION "clang") +set(CMAKE_ANDROID_STL_TYPE "c++_static") # LLVM libc++ static + +polly_init( + "Android NDK ${ANDROID_NDK_VERSION} / \ +API ${CMAKE_SYSTEM_VERSION} / ${CMAKE_ANDROID_ARCH_ABI} / \ +32-bit ARM / Clang / c++11 support / libc++ static" + "Unix Makefiles" +) + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_common.cmake") + +include("${CMAKE_CURRENT_LIST_DIR}/flags/cxx11.cmake") # before toolchain! +include("${CMAKE_CURRENT_LIST_DIR}/os/android.cmake") diff --git a/tools/polly/android-ndk-r18b-api-24-arm64-v8a-clang-libcxx11.cmake b/tools/polly/android-ndk-r18b-api-24-arm64-v8a-clang-libcxx11.cmake new file mode 100644 index 0000000..d2c5ae8 --- /dev/null +++ b/tools/polly/android-ndk-r18b-api-24-arm64-v8a-clang-libcxx11.cmake @@ -0,0 +1,33 @@ +# Copyright (c) 2015-2018, Ruslan Baratov +# Copyright (c) 2017-2018, Robert Nitsch +# Copyright (c) 2018, David Hirvonen +# All rights reserved. + +if(DEFINED POLLY_ANDROID_NDK_R18b_API_24_ARM64_V8A_CLANG_LIBCXX11_CMAKE_) + return() +else() + set(POLLY_ANDROID_NDK_R18b_API_24_ARM64_V8A_CLANG_LIBCXX11_CMAKE_ 1) +endif() + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_clear_environment_variables.cmake") + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_init.cmake") + +set(ANDROID_NDK_VERSION "r18b") +set(CMAKE_SYSTEM_VERSION "24") +set(CMAKE_ANDROID_ARCH_ABI "arm64-v8a") +set(CMAKE_ANDROID_NDK_TOOLCHAIN_VERSION "clang") +set(CMAKE_ANDROID_STL_TYPE "c++_static") # LLVM libc++ static + +polly_init( + "Android NDK ${ANDROID_NDK_VERSION} / \ +API ${CMAKE_SYSTEM_VERSION} / ${CMAKE_ANDROID_ARCH_ABI} / \ +Clang / c++11 support / libc++ static" + "Unix Makefiles" +) + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_common.cmake") + +include("${CMAKE_CURRENT_LIST_DIR}/flags/cxx11.cmake") # before toolchain! + +include("${CMAKE_CURRENT_LIST_DIR}/os/android.cmake") diff --git a/tools/polly/android-vc-ndk-r10e-api-19-arm-clang-3-6.cmake b/tools/polly/android-vc-ndk-r10e-api-19-arm-clang-3-6.cmake new file mode 100644 index 0000000..493daed --- /dev/null +++ b/tools/polly/android-vc-ndk-r10e-api-19-arm-clang-3-6.cmake @@ -0,0 +1,31 @@ +# Copyright (c) 2016, Ruslan Baratov +# All rights reserved. + +if(DEFINED POLLY_ANDROID_VC_NDK_R10E_API_19_ARM_CLANG_3_6_CMAKE_) + return() +else() + set(POLLY_ANDROID_VC_NDK_R10E_API_19_ARM_CLANG_3_6_CMAKE_ 1) +endif() + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_clear_environment_variables.cmake") + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_init.cmake") + +set(ANDROID_NDK_VERSION "r10e") # default +set(ANDROID_NATIVE_API_LEVEL "19") +set(ANDROID_ABI "armeabi") +set(CMAKE_VC_MDD_ANDROID_PLATFORM_TOOLSET "Clang_3_6") + +polly_init( + "Android NDK ${ANDROID_NDK_VERSION} / \ +API ${ANDROID_NATIVE_API_LEVEL} / ${ANDROID_ABI} / \ +${CMAKE_VC_MDD_ANDROID_PLATFORM_TOOLSET} / \ +c++11 support" + "Visual Studio 14 2015 ARM" +) + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_common.cmake") + +include("${CMAKE_CURRENT_LIST_DIR}/flags/cxx11.cmake") # before toolchain! + +include("${CMAKE_CURRENT_LIST_DIR}/os/vc-mdd-android.cmake") diff --git a/tools/polly/android-vc-ndk-r10e-api-19-arm-gcc-4-9.cmake b/tools/polly/android-vc-ndk-r10e-api-19-arm-gcc-4-9.cmake new file mode 100644 index 0000000..ca1a5ef --- /dev/null +++ b/tools/polly/android-vc-ndk-r10e-api-19-arm-gcc-4-9.cmake @@ -0,0 +1,31 @@ +# Copyright (c) 2016, Ruslan Baratov +# All rights reserved. + +if(DEFINED POLLY_ANDROID_VC_NDK_R10E_API_19_ARM_GCC_4_9_CMAKE_) + return() +else() + set(POLLY_ANDROID_VC_NDK_R10E_API_19_ARM_GCC_4_9_CMAKE_ 1) +endif() + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_clear_environment_variables.cmake") + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_init.cmake") + +set(ANDROID_NDK_VERSION "r10e") # default +set(ANDROID_NATIVE_API_LEVEL "19") +set(ANDROID_ABI "armeabi") +set(CMAKE_VC_MDD_ANDROID_PLATFORM_TOOLSET "Gcc_4_9") + +polly_init( + "Android NDK ${ANDROID_NDK_VERSION} / \ +API ${ANDROID_NATIVE_API_LEVEL} / ${ANDROID_ABI} / \ +${CMAKE_VC_MDD_ANDROID_PLATFORM_TOOLSET} / \ +c++11 support" + "Visual Studio 14 2015 ARM" +) + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_common.cmake") + +include("${CMAKE_CURRENT_LIST_DIR}/flags/cxx11.cmake") # before toolchain! + +include("${CMAKE_CURRENT_LIST_DIR}/os/vc-mdd-android.cmake") diff --git a/tools/polly/android-vc-ndk-r10e-api-19-x86-clang-3-6.cmake b/tools/polly/android-vc-ndk-r10e-api-19-x86-clang-3-6.cmake new file mode 100644 index 0000000..7a6a8b0 --- /dev/null +++ b/tools/polly/android-vc-ndk-r10e-api-19-x86-clang-3-6.cmake @@ -0,0 +1,31 @@ +# Copyright (c) 2016, Ruslan Baratov +# All rights reserved. + +if(DEFINED POLLY_ANDROID_VC_NDK_R10E_API_19_X86_CLANG_3_6_CMAKE_) + return() +else() + set(POLLY_ANDROID_VC_NDK_R10E_API_19_X86_CLANG_3_6_CMAKE_ 1) +endif() + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_clear_environment_variables.cmake") + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_init.cmake") + +set(ANDROID_NDK_VERSION "r10e") # default +set(ANDROID_NATIVE_API_LEVEL "19") +set(ANDROID_ABI "x86") +set(CMAKE_VC_MDD_ANDROID_PLATFORM_TOOLSET "Clang_3_6") + +polly_init( + "Android NDK ${ANDROID_NDK_VERSION} / \ +API ${ANDROID_NATIVE_API_LEVEL} / ${ANDROID_ABI} / \ +${CMAKE_VC_MDD_ANDROID_PLATFORM_TOOLSET} / \ +c++11 support" + "Visual Studio 14 2015" +) + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_common.cmake") + +include("${CMAKE_CURRENT_LIST_DIR}/flags/cxx11.cmake") # before toolchain! + +include("${CMAKE_CURRENT_LIST_DIR}/os/vc-mdd-android.cmake") diff --git a/tools/polly/android-vc-ndk-r10e-api-21-arm-clang-3-6.cmake b/tools/polly/android-vc-ndk-r10e-api-21-arm-clang-3-6.cmake new file mode 100644 index 0000000..52160be --- /dev/null +++ b/tools/polly/android-vc-ndk-r10e-api-21-arm-clang-3-6.cmake @@ -0,0 +1,31 @@ +# Copyright (c) 2016, Ruslan Baratov +# All rights reserved. + +if(DEFINED POLLY_ANDROID_VC_NDK_R10E_API_21_ARM_CLANG_3_6_CMAKE_) + return() +else() + set(POLLY_ANDROID_VC_NDK_R10E_API_21_ARM_CLANG_3_6_CMAKE_ 1) +endif() + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_clear_environment_variables.cmake") + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_init.cmake") + +set(ANDROID_NDK_VERSION "r10e") # default +set(ANDROID_NATIVE_API_LEVEL "21") +set(ANDROID_ABI "armeabi") +set(CMAKE_VC_MDD_ANDROID_PLATFORM_TOOLSET "Clang_3_6") + +polly_init( + "Android NDK ${ANDROID_NDK_VERSION} / \ +API ${ANDROID_NATIVE_API_LEVEL} / ${ANDROID_ABI} / \ +${CMAKE_VC_MDD_ANDROID_PLATFORM_TOOLSET} / \ +c++11 support" + "Visual Studio 14 2015 ARM" +) + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_common.cmake") + +include("${CMAKE_CURRENT_LIST_DIR}/flags/cxx11.cmake") # before toolchain! + +include("${CMAKE_CURRENT_LIST_DIR}/os/vc-mdd-android.cmake") diff --git a/tools/polly/appveyor.yml b/tools/polly/appveyor.yml new file mode 100644 index 0000000..3ee7c47 --- /dev/null +++ b/tools/polly/appveyor.yml @@ -0,0 +1,72 @@ +# Windows (https://github.com/travis-ci-tester/toolchain-table) + +environment: + matrix: + - APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2017 + TOOLCHAIN: "vs-15-2017-cxx17" + EXAMPLE: 01-executable + CONFIG: Release + + - TOOLCHAIN: "ninja-vs-12-2013-win64" + EXAMPLE: 01-executable + CONFIG: Release + + - TOOLCHAIN: "nmake-vs-12-2013-win64" + EXAMPLE: 01-executable + CONFIG: Release + + - TOOLCHAIN: "vs-12-2013" + EXAMPLE: 01-executable + CONFIG: Release + + - TOOLCHAIN: "vs-14-2015" + EXAMPLE: 01-executable + CONFIG: Release + + - TOOLCHAIN: "mingw-cxx17" + EXAMPLE: 01-executable + CONFIG: Release + + - TOOLCHAIN: "msys-cxx14" + EXAMPLE: 01-executable + CONFIG: Release + + - TOOLCHAIN: "vs-14-2015" + EXAMPLE: 02-library + CONFIG: Release + + - TOOLCHAIN: "vs-14-2015" + EXAMPLE: 03-shared-link + CONFIG: Release + +install: + # Python 3 + - cmd: set PATH=C:\Python34-x64;C:\Python34-x64\Scripts;%PATH% + + # Install Python package 'requests' + - cmd: pip install requests + + # Install dependencies (CMake, Ninja) + - cmd: set POLLY_SOURCE_DIR=%cd% + - cmd: python %POLLY_SOURCE_DIR%\bin\install-ci-dependencies.py + + # Tune locations + - cmd: set PATH=%cd%\_ci\cmake\bin;%PATH% + - cmd: set PATH=%cd%\_ci\ninja;%PATH% + + # Remove entry with sh.exe from PATH to fix error with MinGW toolchain + # (For MinGW make to work correctly sh.exe must NOT be in your path) + # * http://stackoverflow.com/a/3870338/2288008 + - cmd: set PATH=%PATH:C:\Program Files\Git\usr\bin;=% + + - cmd: set MINGW_PATH=C:\mingw-w64\x86_64-7.2.0-posix-seh-rt_v5-rev1\mingw64\bin + + # MSYS2 location + - cmd: set MSYS_PATH=C:\msys64\usr\bin + +build_script: + - cmd: python %POLLY_SOURCE_DIR%\bin\build.py --home examples/%EXAMPLE% --toolchain %TOOLCHAIN% --config %CONFIG% --verbose --clear --install --test + +branches: + except: + - /^pr\..*/ diff --git a/tools/polly/arm-openwrt-linux-muslgnueabi.cmake b/tools/polly/arm-openwrt-linux-muslgnueabi.cmake new file mode 100644 index 0000000..00afa8c --- /dev/null +++ b/tools/polly/arm-openwrt-linux-muslgnueabi.cmake @@ -0,0 +1,46 @@ +# Copyright (c) 2017, NeroBurner +# Copyright (c) 2017, Ruslan Baratov +# All rights reserved. + +if(DEFINED POLLY_ARM_OPENWRT_LINUX_MUSLGNUEABI_) + return() +else() + set(POLLY_ARM_OPENWRT_LINUX_MUSLGNUEABI_ 1) +endif() + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_init.cmake") + +polly_init( + "Linux / gcc / OpenWRT / MUSL / c++11 support / cortex-a9" + "Unix Makefiles" +) + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_common.cmake") + +string(COMPARE EQUAL "$ENV{ARM_OPENWRT_LINUX_MUSLGNUEABI_ROOT}" "" _is_empty) +if(_is_empty) + polly_fatal_error("Environment variable 'ARM_OPENWRT_LINUX_MUSLGNUEABI_ROOT' is not set") +endif() + +# set system name, this sets the variable CMAKE_CROSSCOMPILING +set(CMAKE_SYSTEM_NAME Linux) +set(CROSS_COMPILE_TOOLCHAIN_PREFIX "arm-openwrt-linux-muslgnueabi") + +set(_expected_dir "$ENV{ARM_OPENWRT_LINUX_MUSLGNUEABI_ROOT}/${CROSS_COMPILE_TOOLCHAIN_PREFIX}") +if(NOT IS_DIRECTORY "${_expected_dir}") + polly_fatal_error( + "Directory not found: ${_expected_dir}" + " (check ARM_OPENWRT_LINUX_MUSLGNUEABI_ROOT environment variable)" + ) +endif() + +set(CROSS_COMPILE_TOOLCHAIN_PATH "$ENV{ARM_OPENWRT_LINUX_MUSLGNUEABI_ROOT}/bin") +set(CROSS_COMPILE_SYSROOT "$ENV{ARM_OPENWRT_LINUX_MUSLGNUEABI_ROOT}/usr/include") # ??? + +include( + "${CMAKE_CURRENT_LIST_DIR}/compiler/gcc-cross-compile.cmake" +) +include("${CMAKE_CURRENT_LIST_DIR}/flags/cxx11.cmake") +include("${CMAKE_CURRENT_LIST_DIR}/flags/openwrt.cmake") + +set(OPENWRT 1 CACHE INTERNAL "") diff --git a/tools/polly/bin/build.py b/tools/polly/bin/build.py new file mode 100755 index 0000000..c9de5f6 --- /dev/null +++ b/tools/polly/bin/build.py @@ -0,0 +1,9 @@ +#!/usr/bin/env python3 + +# Copyright (c) 2014-2015, Ruslan Baratov +# All rights reserved. + +# Note: build.py has been renamed to polly.py. + +from os.path import abspath, dirname, join +exec(open(join(dirname(abspath(__file__)), 'polly.py'), 'r').read()) diff --git a/TODO.md b/tools/polly/bin/detail/__init__.py similarity index 100% rename from TODO.md rename to tools/polly/bin/detail/__init__.py diff --git a/tools/polly/bin/detail/call.py b/tools/polly/bin/detail/call.py new file mode 100644 index 0000000..618d0cf --- /dev/null +++ b/tools/polly/bin/detail/call.py @@ -0,0 +1,102 @@ +# Copyright (c) 2014-2015, Ruslan Baratov +# All rights reserved. + +# Adapted to python3 version of: http://stackoverflow.com/questions/4984428 + +import os +import platform +import subprocess +import sys +import threading +import time + +# Tests: +# +# Windows: +# * Control Panel -> Region -> Administrative -> Current languange for non-Unicode programs: "Russian (Russia)" +# * cd to directory with name like 'привет' and run 'polly.py --verbose' + +def tee(infile, discard, logging, console=None): + """Print `infile` to `files` in a separate thread.""" + def fanout(): + discard_counter = 0 + for line in iter(infile.readline, b''): + # use the same encoding as stdout/stderr + s = line.decode( + encoding=sys.stdout.encoding, + errors='replace' + ) + s = s.replace('\r', '') + s = s.replace('\t', ' ') + s = s.rstrip() # strip spaces and EOL + s += '\n' # append stripped EOL back + logging.write(s) + if console is None: + continue + if discard is None: + console.write(s) + console.flush() + continue + if discard_counter == 0: + console.write(s) + console.flush() + discard_counter += 1 + if discard_counter == discard: + discard_counter = 0 + infile.close() + t = threading.Thread(target=fanout) + t.daemon = True + t.start() + return t + +def teed_call(cmd_args, logging): + p = subprocess.Popen( + cmd_args, + stdout=subprocess.PIPE, + stderr=subprocess.PIPE, + env=os.environ, + bufsize=0 + ) + threads = [] + + if logging.verbosity != 'silent': + threads.append(tee(p.stdout, logging.discard, logging, sys.stdout)) + threads.append(tee(p.stderr, logging.discard, logging, sys.stderr)) + else: + threads.append(tee(p.stdout, logging.discard, logging)) + threads.append(tee(p.stderr, logging.discard, logging)) + + for t in threads: + t.join() # wait for IO completion + + return p.wait() + +def call(call_args, logging, cache_file='', ignore=False, sleep=0): + pretty = 'Execute command: [\n' + for i in call_args: + pretty += ' `{}`\n'.format(i) + pretty += ']\n' + print(pretty) + logging.write(pretty) + + # print one line version + oneline = '' + for i in call_args: + oneline += ' "{}"'.format(i) + oneline = "[{}]>{}\n".format(os.getcwd(), oneline) + if logging.verbosity != 'silent': + print(oneline) + logging.write(oneline) + + x = teed_call(call_args, logging) + if x == 0 or ignore: + time.sleep(sleep) + return + if os.path.exists(cache_file): + os.unlink(cache_file) + logging.log_file.close() + print('Command exit with status "{}": {}'.format(x, oneline)) + print('Log: {}'.format(logging.log_path)) + logging.print_last_lines() + print('*** FAILED ***') + sys.exit(1) diff --git a/tools/polly/bin/detail/cpack_generator.py b/tools/polly/bin/detail/cpack_generator.py new file mode 100644 index 0000000..d0cb479 --- /dev/null +++ b/tools/polly/bin/detail/cpack_generator.py @@ -0,0 +1,54 @@ +# Copyright (c) 2014, Ruslan Baratov +# All rights reserved. + +import os +import platform + +available_generators = [ + '7Z', + 'IFW', + 'NSIS', + 'NSIS64', + 'STGZ', + 'TBZ2', + 'TGZ', + 'TXZ', + 'TZ', + 'ZIP', +] + +if platform.system() == 'Darwin': + available_generators += [ + 'Bundle', + 'DragNDrop', + 'OSXX11', + 'PackageMaker', + ] + +if platform.system().startswith('CYGWIN'): + available_generators += [ + 'CygwinBinary', + 'CygwinSource', + 'DEB', + 'RPM', + ] + +if platform.system() == 'Linux': + available_generators += [ + 'DEB', + 'RPM', + ] + +if os.name == 'nt': + available_generators += [ + 'WIX' + ] + +def default(): + if os.name == 'nt': + return 'NSIS' + if platform.system() == 'Darwin': + return 'PackageMaker' + if platform.system() == 'Linux': + return 'DEB' + return 'TGZ' diff --git a/tools/polly/bin/detail/create_archive.py b/tools/polly/bin/detail/create_archive.py new file mode 100644 index 0000000..32833c3 --- /dev/null +++ b/tools/polly/bin/detail/create_archive.py @@ -0,0 +1,35 @@ +# Copyright (c) 2016, Ruslan Baratov +# All rights reserved. + +import tarfile +import platform +import os + +def run(install_dir, archives_dir, archive_name, toolchain_name, config): + if not os.path.exists(archives_dir): + os.mkdir(archives_dir) + + version_travis = os.getenv('TRAVIS_TAG') + version_appveyor_present = os.getenv('APPVEYOR_REPO_TAG') + version_appveyor = os.getenv('APPVEYOR_REPO_TAG_NAME') + + if version_travis: + version = '-' + version_travis + elif version_appveyor_present == 'true': + version = '-' + version_appveyor + else: + version = '' + + if config: + config = '-' + config + else: + config = '' + + archive_full_name = archive_name + version + '-' + platform.system() + '-' + toolchain_name + config + '.tar.gz' + archive_full_name = os.path.join(archives_dir, archive_full_name) + + tar = tarfile.open(archive_full_name, 'w:gz') + tar.add(install_dir, arcname='.') + tar.close() + + print('Archive created: {}'.format(archive_full_name)) diff --git a/tools/polly/bin/detail/create_framework.py b/tools/polly/bin/detail/create_framework.py new file mode 100644 index 0000000..cde9cac --- /dev/null +++ b/tools/polly/bin/detail/create_framework.py @@ -0,0 +1,148 @@ +# Copyright (c) 2015, Ruslan Baratov +# All rights reserved. + +import detail.call +import detail.rmtree + +import glob +import os +import re +import shutil +import sys + +def get_framework_name(lib_name): + if re.match(r'^lib.*\.a$', lib_name): + return re.sub(r'^lib(.*)\.a$', r'\1', lib_name) + if re.match(r'^lib.*\.dylib$', lib_name): + return re.sub(r'^lib(.*)\.dylib$', r'\1', lib_name) + sys.exit('Incorrect library name `{}`. Expected format lib*.a or lib*.dylib') + +def get_libname_soversion(libs): + name_len = min([len(x) for x in libs]) + for x in libs: + if (len(x) == name_len) and os.path.islink(x): + return x + sys.exit('Unexpected version/soversion format: {}'.format(libs)) + +def run(install_dir, framework_dir, ios, polly_root, device, logging, plist=None, identity=None, lib_regex='*'): + libs_path = os.path.join(install_dir, 'lib') + libs = glob.glob(os.path.join(libs_path, lib_regex)) + try: + libs.remove(os.path.join(libs_path, 'cmake')) + except ValueError: + pass + + if len(libs) == 0: + sys.exit('No libs found in directory: {}'.format(libs_path)) + + if len(libs) == 3: + # SOVERSION install: + # 1) lib.dylib (symlink) + # 2) lib.N.dylib (symlink) + # 3) lib.N.M.dylib (real file) + lib_name = os.path.basename(get_libname_soversion(libs)) + elif len(libs) == 1: + lib_name = os.path.basename(libs[0]) + else: + sys.exit( + 'Expected only one lib in directory: {}'.format(libs_path) + + '\nBut found: {}'.format(libs) + ) + + framework_name = get_framework_name(lib_name) + + framework_dir = os.path.join( + framework_dir, '{}.framework'.format(framework_name) + ) + detail.rmtree.rmtree(framework_dir) + + if ios: + lib_dir = os.path.join(framework_dir) + headers_dir = os.path.join(framework_dir, 'Headers') + else: + lib_dir = os.path.join(framework_dir, 'Versions', 'A') + headers_dir = os.path.join(framework_dir, 'Versions', 'A', 'Headers') + + os.makedirs(lib_dir) + os.makedirs(headers_dir) + + framework_lib = os.path.join(lib_dir, framework_name) + shutil.copy(libs[0], framework_lib) + if libs[0].endswith('.dylib'): + cmd = [ + 'install_name_tool', + '-id', + '@rpath/{}.framework/{}'.format(framework_name, framework_name), + framework_lib + ] + detail.call.call(cmd, logging) + + header_found = False + incl_dir = os.path.join(install_dir, 'include', framework_name) + for root, dirs, files in os.walk(incl_dir): + for d in dirs: + d_rel = os.path.relpath(os.path.join(root, d), incl_dir) + x = os.path.join(headers_dir, d_rel) + if not os.path.exists(x): + os.makedirs(x) + for f in files: + header_found = True + f_rel = os.path.relpath(os.path.join(root, f), incl_dir) + shutil.copy(os.path.join(root, f), os.path.join(headers_dir, f_rel)) + + if not header_found: + print('Warning: no headers found for framework (dir: {})'.format(incl_dir)) + + if not ios: + link = ['ln', '-sfh', 'A', os.path.join(framework_dir, 'Versions', 'Current')] + detail.call.call(link, logging) + + link = [ + 'ln', + '-sfh', + os.path.join('Versions', 'Current', framework_name), + os.path.join(framework_dir, framework_name) + ] + detail.call.call(link, logging) + + link = [ + 'ln', + '-sfh', + os.path.join('Versions', 'Current', 'Headers'), + os.path.join(framework_dir, 'Headers') + ] + detail.call.call(link, logging) + else: + framework_plist = os.path.join(framework_dir, 'Info.plist') + if plist is None: + shutil.copy( + os.path.join(polly_root, 'scripts', 'Info.plist'), + framework_plist); + else: + shutil.copy(plist, framework_plist); + + plist_text = open(framework_plist).read() + plist_text = re.sub(r'__MINIMUM_OS_VERSION__', ios, plist_text) + plist_text = re.sub(r'__BUNDLE_EXECUTABLE__', framework_name, plist_text) + open(framework_plist, 'w').write(plist_text) + if device: + detail.call.call( + ['lipo', '-remove', 'i386', '-output', framework_lib, framework_lib], + logging, + ignore=True + ) + detail.call.call( + ['lipo', '-remove', 'x86_64', '-output', framework_lib, framework_lib], + logging, + ignore=True + ) + + if identity is None: + identity = 'iPhone Developer'; + + sign_cmd = [ + 'codesign', '--force', '--sign', identity, framework_dir + ] + detail.call.call(sign_cmd, logging) + + print('Framework created: {}'.format(framework_dir)) diff --git a/tools/polly/bin/detail/generate_command.py b/tools/polly/bin/detail/generate_command.py new file mode 100644 index 0000000..db72960 --- /dev/null +++ b/tools/polly/bin/detail/generate_command.py @@ -0,0 +1,37 @@ +# Copyright (c) 2014-2015, Ruslan Baratov +# All rights reserved. + +import difflib +import os +import sys + +import detail.call + +def run(generate_command, build_dir, polly_temp_dir, reconfig, logging): + if not os.path.exists(polly_temp_dir): + os.makedirs(polly_temp_dir) + saved_arguments_path = os.path.join(polly_temp_dir, 'saved-arguments') + cache_file = os.path.join(build_dir, 'CMakeCache.txt') + + generate_command_oneline = ' '.join( + [ '"{}"'.format(x) for x in generate_command] + ) + + if reconfig or not os.path.exists(saved_arguments_path): + detail.call.call(generate_command, logging, cache_file=cache_file, sleep=1) + open(saved_arguments_path, 'w').write(generate_command_oneline) + return + + # No need to generate project, just check that arguments not changed + expected = open(saved_arguments_path, 'r').read() + if expected != generate_command_oneline: + sys.exit( + "\n== WARNING ==\n" + "\nLooks like cmake arguments changed." + " You have two options to fix it:\n" + " * Remove build directory completely" + " by adding '--clear' (works 100%)\n" + " * Run configure again by adding '--reconfig'" + " (you must understand how CMake cache variables works/updated)\n\n" + "{}".format("\n".join(difflib.ndiff([expected], [generate_command_oneline]))) + ) diff --git a/tools/polly/bin/detail/get_nmake_environment.py b/tools/polly/bin/detail/get_nmake_environment.py new file mode 100755 index 0000000..6a9ec86 --- /dev/null +++ b/tools/polly/bin/detail/get_nmake_environment.py @@ -0,0 +1,35 @@ +# Copyright (c) 2014, Ruslan Baratov +# All rights reserved. + +import detail.util +import os +import sys + +def get(arch, vs_version): + vs_path_env = 'VS{}0COMNTOOLS'.format(vs_version) + vs_path = os.getenv(vs_path_env) + if not vs_path: + sys.exit( + 'Environment variable {} is empty, ' + 'looks like Visual Studio {} is not installed'.format( + vs_path_env, vs_version + ) + ) + + if vs_version == '15': + vcvarsall_dir = os.path.join(vs_path, '..', '..', 'VC', 'Auxiliary', 'Build') + else: + vcvarsall_dir = os.path.join(vs_path, '..', '..', 'VC') + + if not os.path.isdir(vcvarsall_dir): + sys.exit( + 'Directory `{}` not exists ' + '({} environment variable)'.format(vcvarsall_dir, vs_path_env) + ) + vcvarsall_path = os.path.join(vcvarsall_dir, 'vcvarsall.bat') + if not os.path.isfile(vcvarsall_path): + sys.exit( + 'File vcvarsall.bat not found in directory ' + '`{}` ({} environment variable)'.format(vcvarsall_dir, vs_path_env) + ) + return detail.util.get_environment_from_batch_command([vcvarsall_path, arch]) diff --git a/tools/polly/bin/detail/ios_dev_root.py b/tools/polly/bin/detail/ios_dev_root.py new file mode 100644 index 0000000..f95addc --- /dev/null +++ b/tools/polly/bin/detail/ios_dev_root.py @@ -0,0 +1,10 @@ +# Copyright (c) 2014, Ruslan Baratov +# All rights reserved. + +import os +import re + +def get(ios_version): + dev_dir = re.sub(r'\.', '_', ios_version) + dev_dir = 'IOS_{}_DEVELOPER_DIR'.format(dev_dir) + return os.getenv(dev_dir) diff --git a/tools/polly/bin/detail/logging.py b/tools/polly/bin/detail/logging.py new file mode 100644 index 0000000..93830a3 --- /dev/null +++ b/tools/polly/bin/detail/logging.py @@ -0,0 +1,49 @@ +# Copyright (c) 2015-2017, Ruslan Baratov +# All rights reserved. + +import os +import sys + +class Logging: + def __init__(self, cdir, verbosity, discard, tail_N, polly_toolchain): + self.verbosity = verbosity + self.discard = discard + self.tail_N = tail_N + + # Add extra 'polly_toolchain' directory so we can run two builds on + # one directory with different toolchains in parallel + log_dir = os.path.join(cdir, '_logs', 'polly', polly_toolchain) + if not os.path.exists(log_dir): + os.makedirs(log_dir) + + self.log_path = os.path.join(log_dir, 'log.txt') + if os.path.exists(self.log_path): + for i in range(1000): + try_name = 'log-{}.txt'.format(i) + try_path = os.path.join(log_dir, try_name) + if not os.path.exists(try_path): + os.renames(self.log_path, try_path) + break + else: + sys.exit( + 'Please clean-up your logs in directory: {}'.format(log_dir) + ) + + # https://docs.python.org/3.2/library/functions.html#open + # 'b' - we will be writing byte objects to this file (see 'write' method) + self.log_file = open(self.log_path, 'wb') + + # receive string 's' in various encoding and convert it to UTF-8 + def write(self, s): + self.log_file.write(s.encode('utf-8')) + + def print_last_lines(self): + if self.tail_N is None: + return + lines = open(self.log_path, 'r').readlines() + tail = lines[-self.tail_N:] + print('Last {} lines\n'.format(self.tail_N)) + print('-' * 80) + for i in tail: + print(' {}'.format(i), end='') + print('-' * 80) diff --git a/tools/polly/bin/detail/open_project.py b/tools/polly/bin/detail/open_project.py new file mode 100644 index 0000000..d64d933 --- /dev/null +++ b/tools/polly/bin/detail/open_project.py @@ -0,0 +1,40 @@ +# Copyright (c) 2014, Ruslan Baratov +# All rights reserved. + +import os +import subprocess +import sys + +import detail.call + +def find_project(directory, extension): + for file in os.listdir(directory): + if file.endswith(extension): + project_path = os.path.join(directory, file) + print("Open project: {}".format(project_path)) + return project_path + sys.exit( + "Project with extension `{}` not found in `{}`".format( + extension, + directory + ) + ) + +def open(toolchain, build_dir, logging): + if toolchain.is_xcode: + args = ['open'] + dev_root = '' + if toolchain.ios_version: + dev_root = detail.ios_dev_root.get(toolchain.ios_version) + if not dev_root: + dev_root = subprocess.check_output( + ['xcode-select', '--print-path'], universal_newlines=True + ).split('\n')[0] + args.append('-a') + args.append(os.path.join(dev_root, '..', '..')) + args.append(find_project(build_dir, ".xcodeproj")) + detail.call.call(args, logging) + elif toolchain.is_msvc: + os.startfile(find_project(build_dir, ".sln")) + else: + print("Open skipped (not Xcode or Visual Studio)") diff --git a/tools/polly/bin/detail/osx_dev_root.py b/tools/polly/bin/detail/osx_dev_root.py new file mode 100644 index 0000000..b6cf75d --- /dev/null +++ b/tools/polly/bin/detail/osx_dev_root.py @@ -0,0 +1,10 @@ +# Copyright (c) 2015, Ruslan Baratov +# All rights reserved. + +import os +import re + +def get(osx_version): + dev_dir = re.sub(r'\.', '_', osx_version) + dev_dir = 'OSX_{}_DEVELOPER_DIR'.format(dev_dir) + return os.getenv(dev_dir) diff --git a/tools/polly/bin/detail/pack_command.py b/tools/polly/bin/detail/pack_command.py new file mode 100644 index 0000000..be79047 --- /dev/null +++ b/tools/polly/bin/detail/pack_command.py @@ -0,0 +1,25 @@ +# Copyright (c) 2014, Ruslan Baratov +# All rights reserved. + +import os +import subprocess + +import detail.call + +def run(config, logging, cpack_generator, cpack_bin, cmake_bin): + pack_command = [cpack_bin] + if os.name == 'nt': + # use full path to cpack since Chocolatey pack command has the same name + cmake_list = subprocess.check_output( + ['where', cmake_bin], universal_newlines=True + ) + cmake_path = cmake_list.split('\n')[0] + cpack_path = os.path.join(os.path.dirname(cmake_path), cpack_bin) + pack_command = [cpack_path] + if config: + pack_command.append('-C') + pack_command.append(config) + pack_command.append('--verbose') + if cpack_generator: + pack_command.append('-G{}'.format(cpack_generator)) + detail.call.call(pack_command, logging) diff --git a/tools/polly/bin/detail/rmtree.py b/tools/polly/bin/detail/rmtree.py new file mode 100644 index 0000000..580e652 --- /dev/null +++ b/tools/polly/bin/detail/rmtree.py @@ -0,0 +1,23 @@ +# Copyright (c) 2015, Ruslan Baratov +# All rights reserved. + +# Call native tools to remove directory recursively. Use this command instead +# of shutils.rmtree because of different glitches like impossibility to remove +# directory with files with long path on Windows. + +import os +import subprocess +import sys + +def rmtree(dir_path): + if not os.path.exists(dir_path): + return + print("Remove directory: {}".format(dir_path)) + if os.name == 'nt': + subprocess.check_call(['cmd', '/c', 'rmdir', dir_path, '/S', '/Q']) + else: + subprocess.check_call(['rm', '-rf', dir_path]) + + # sanity check + if os.path.exists(dir_path): + sys.exit("Directory removing failed ({})".format(dir_path)) diff --git a/tools/polly/bin/detail/target.py b/tools/polly/bin/detail/target.py new file mode 100644 index 0000000..a9f21c7 --- /dev/null +++ b/tools/polly/bin/detail/target.py @@ -0,0 +1,30 @@ +# Copyright (c) 2015, Ruslan Baratov +# All rights reserved. + +import sys + +class Target: + def __init__(self): + self.name = '' + + def add(self, condition, name): + if not condition: + return + if not name: + sys.exit('No name for target') + if not self.name: + self.name = name + return + if self.name == name: + return + sys.exit( + "Can't add target `{}` since another target defined: `{}`".format( + name, self.name + ) + ) + + def args(self): + if self.name: + return ['--target', self.name] + else: + return [] diff --git a/tools/polly/bin/detail/test_command.py b/tools/polly/bin/detail/test_command.py new file mode 100644 index 0000000..c431cba --- /dev/null +++ b/tools/polly/bin/detail/test_command.py @@ -0,0 +1,20 @@ +# Copyright (c) 2014, Ruslan Baratov +# All rights reserved. + +import detail.call + +def run(build_dir, config, logging, test_xml, verbose, timeout, ctest_bin): + test_command = [ctest_bin] + if test_xml: + test_command.append('-T') + test_command.append(test_xml) + if config: + test_command.append('-C') + test_command.append(config) + if verbose: + test_command.append('-VV') + if timeout: + test_command.append('--timeout') + test_command.append(str(timeout)) + print('Run tests') + detail.call.call(test_command, logging) diff --git a/tools/polly/bin/detail/timer.py b/tools/polly/bin/detail/timer.py new file mode 100644 index 0000000..27e1b07 --- /dev/null +++ b/tools/polly/bin/detail/timer.py @@ -0,0 +1,61 @@ +# Copyright (c) 2015, Ruslan Baratov +# All rights reserved. + +import datetime +import sys +import time + +perf_counter_available = (sys.version_info.minor >= 3) + +class Job: + def __init__(self, job_name): + if perf_counter_available: + self.start = time.perf_counter() + else: + self.start = 0 + self.job_name = job_name + self.stopped = False + + def stop(self): + if self.stopped: + sys.exit('Already stopped') + self.stopped = True + if perf_counter_available: + self.total = time.perf_counter() - self.start + else: + self.total = 0 + + def result(self): + if not self.stopped: + sys.exit("Stop the job before result") + print( + '{}: {}s'.format(self.job_name, datetime.timedelta(seconds=self.total)) + ) + +class Timer: + def __init__(self): + self.jobs = [] + self.total = Job('Total') + + def start(self, job_name): + if job_name == 'Total': + sys.exit('Name reserved') + for i in self.jobs: + if i.job_name == job_name: + sys.exit('Job already exists: {}'.format(job_name)) + self.jobs.append(Job(job_name)) + + def stop(self): + if len(self.jobs) == 0: + sys.exit("No jobs to stop") + self.jobs[-1].stop() + + def result(self): + if not perf_counter_available: + print('timer.perf_counter is not available (update to python 3.3+)') + return + for i in self.jobs: + i.result() + print('-') + self.total.stop() + self.total.result() diff --git a/tools/polly/bin/detail/toolchain_name.py b/tools/polly/bin/detail/toolchain_name.py new file mode 100644 index 0000000..07b0bac --- /dev/null +++ b/tools/polly/bin/detail/toolchain_name.py @@ -0,0 +1,8 @@ +# Copyright (c) 2014, Ruslan Baratov +# All rights reserved. + +def get(args_toolchain): + if args_toolchain: + return args_toolchain + else: + return 'default' diff --git a/tools/polly/bin/detail/toolchain_table.py b/tools/polly/bin/detail/toolchain_table.py new file mode 100644 index 0000000..ef187f1 --- /dev/null +++ b/tools/polly/bin/detail/toolchain_table.py @@ -0,0 +1,705 @@ +# Copyright (c) 2014, Ruslan Baratov & Luca Martini +# Copyright (c) 2014, Michele Caini +# Copyright (c) 2017, Robert Nitsch +# Copyright (c) 2018, David Hirvonen +# Copyright (c) 2018, Richard Hodges +# All rights reserved. + +import os +import platform + +class Toolchain: + def __init__( + self, + name, + generator, + toolset='', + arch='', + vs_version='', + ios_version='', + osx_version='', + xp=False, + nocodesign=False, + ): + self.name = name + self.generator = generator + self.toolset = toolset + self.arch = arch + self.vs_version = vs_version + self.ios_version = ios_version + self.osx_version = osx_version + self.is_nmake = (self.generator == 'NMake Makefiles') + self.is_msvc = self.generator.startswith('Visual Studio') + self.is_make = self.generator.endswith('Makefiles') + self.is_ninja = (self.generator == 'Ninja') + self.xp = xp + self.is_xcode = (self.generator == 'Xcode') + self.multiconfig = (self.is_xcode or self.is_msvc) + self.nocodesign = nocodesign + self.verify() + + def verify(self): + if self.arch: + assert(self.is_nmake or self.is_msvc or self.is_ninja) + assert(self.arch == 'amd64' or self.arch == 'x86') + + if self.is_nmake or self.is_msvc: + assert(self.vs_version) + + if self.ios_version or self.osx_version: + assert(self.generator == 'Xcode') + + if self.xp: + assert(self.vs_version) + +toolchain_table = [ + Toolchain('default', ''), + Toolchain('cxx11', ''), + Toolchain('cxx17', ''), + Toolchain('android-ndk-r10e-api-8-armeabi-v7a', 'Unix Makefiles'), + Toolchain('android-ndk-r10e-api-16-armeabi-v7a-neon', 'Unix Makefiles'), + Toolchain('android-ndk-r10e-api-16-armeabi-v7a-neon-clang-35', 'Unix Makefiles'), + Toolchain('android-ndk-r10e-api-16-armeabi-v7a-neon-clang-35-hid', 'Unix Makefiles'), + Toolchain('android-ndk-r10e-api-16-armeabi-v7a-neon-clang-35-hid-sections', 'Unix Makefiles'), + Toolchain('android-ndk-r10e-api-16-x86', 'Unix Makefiles'), + Toolchain('android-ndk-r10e-api-16-x86-hid', 'Unix Makefiles'), + Toolchain('android-ndk-r10e-api-16-x86-hid-sections', 'Unix Makefiles'), + Toolchain('android-ndk-r10e-api-19-armeabi-v7a-neon', 'Unix Makefiles'), + Toolchain('android-ndk-r10e-api-19-armeabi-v7a-neon-c11', 'Unix Makefiles'), + Toolchain('android-ndk-r10e-api-19-armeabi-v7a-neon-hid-sections', 'Unix Makefiles'), + Toolchain('android-ndk-r10e-api-19-armeabi-v7a-neon-hid-sections-lto', 'Unix Makefiles'), + Toolchain('android-ndk-r10e-api-19-armeabi-v7a-neon-clang-libcxx', 'Unix Makefiles'), + Toolchain('android-ndk-r10e-api-21-armeabi-v7a', 'Unix Makefiles'), + Toolchain('android-ndk-r10e-api-21-armeabi-v7a-neon', 'Unix Makefiles'), + Toolchain('android-ndk-r10e-api-21-armeabi-v7a-neon-hid-sections', 'Unix Makefiles'), + Toolchain('android-ndk-r10e-api-21-armeabi-v7a-neon-clang-35', 'Unix Makefiles'), + Toolchain('android-ndk-r10e-api-21-armeabi-v7a-neon-clang-libcxx', 'Unix Makefiles'), + Toolchain('android-ndk-r10e-api-21-armeabi-clang-libcxx', 'Unix Makefiles'), + Toolchain('android-ndk-r10e-api-21-armeabi', 'Unix Makefiles'), + Toolchain('android-ndk-r10e-api-21-arm64-v8a', 'Unix Makefiles'), + Toolchain('android-ndk-r10e-api-21-arm64-v8a-gcc-49', 'Unix Makefiles'), + Toolchain('android-ndk-r10e-api-21-arm64-v8a-gcc-49-hid', 'Unix Makefiles'), + Toolchain('android-ndk-r10e-api-21-arm64-v8a-gcc-49-hid-sections', 'Unix Makefiles'), + Toolchain('android-ndk-r10e-api-21-arm64-v8a-clang-35', 'Unix Makefiles'), + Toolchain('android-ndk-r10e-api-21-x86', 'Unix Makefiles'), + Toolchain('android-ndk-r10e-api-21-x86-clang-libcxx', 'Unix Makefiles'), + Toolchain('android-ndk-r10e-api-21-x86-64', 'Unix Makefiles'), + Toolchain('android-ndk-r10e-api-21-x86-64-hid', 'Unix Makefiles'), + Toolchain('android-ndk-r10e-api-21-x86-64-hid-sections', 'Unix Makefiles'), + Toolchain('android-ndk-r10e-api-21-mips', 'Unix Makefiles'), + Toolchain('android-ndk-r10e-api-21-mips64', 'Unix Makefiles'), + Toolchain('android-ndk-r10e-api-21-mips-clang-libcxx', 'Unix Makefiles'), + Toolchain('android-ndk-r11c-api-8-armeabi-v7a', 'Unix Makefiles'), + Toolchain('android-ndk-r11c-api-16-armeabi', 'Unix Makefiles'), + Toolchain('android-ndk-r11c-api-16-armeabi-cxx14', 'Unix Makefiles'), + Toolchain('android-ndk-r11c-api-16-armeabi-v7a', 'Unix Makefiles'), + Toolchain('android-ndk-r11c-api-16-armeabi-v7a-cxx14', 'Unix Makefiles'), + Toolchain('android-ndk-r11c-api-16-armeabi-v7a-neon', 'Unix Makefiles'), + Toolchain('android-ndk-r11c-api-16-armeabi-v7a-neon-cxx14', 'Unix Makefiles'), + Toolchain('android-ndk-r11c-api-16-armeabi-v7a-neon-clang-35', 'Unix Makefiles'), + Toolchain('android-ndk-r11c-api-16-armeabi-v7a-neon-clang-35-hid', 'Unix Makefiles'), + Toolchain('android-ndk-r11c-api-16-x86', 'Unix Makefiles'), + Toolchain('android-ndk-r11c-api-16-x86-hid', 'Unix Makefiles'), + Toolchain('android-ndk-r11c-api-19-armeabi-v7a-neon', 'Unix Makefiles'), + Toolchain('android-ndk-r11c-api-21-armeabi-v7a', 'Unix Makefiles'), + Toolchain('android-ndk-r11c-api-21-armeabi-v7a-neon', 'Unix Makefiles'), + Toolchain('android-ndk-r11c-api-21-armeabi-v7a-neon-clang-35', 'Unix Makefiles'), + Toolchain('android-ndk-r11c-api-21-armeabi', 'Unix Makefiles'), + Toolchain('android-ndk-r11c-api-21-arm64-v8a', 'Unix Makefiles'), + Toolchain('android-ndk-r11c-api-21-arm64-v8a-gcc-49', 'Unix Makefiles'), + Toolchain('android-ndk-r11c-api-21-arm64-v8a-gcc-49-hid', 'Unix Makefiles'), + Toolchain('android-ndk-r11c-api-21-arm64-v8a-clang-35', 'Unix Makefiles'), + Toolchain('android-ndk-r11c-api-21-x86', 'Unix Makefiles'), + Toolchain('android-ndk-r11c-api-21-x86-64', 'Unix Makefiles'), + Toolchain('android-ndk-r11c-api-21-x86-64-hid', 'Unix Makefiles'), + Toolchain('android-ndk-r11c-api-21-mips', 'Unix Makefiles'), + Toolchain('android-ndk-r11c-api-21-mips64', 'Unix Makefiles'), + Toolchain('android-ndk-r12b-api-19-armeabi-v7a-neon', 'Unix Makefiles'), + Toolchain('android-ndk-r13b-api-19-armeabi-v7a-neon', 'Unix Makefiles'), + Toolchain('android-ndk-r14-api-16-armeabi-v7a-neon-clang-hid-sections-lto', 'Unix Makefiles'), + Toolchain('android-ndk-r14-api-19-armeabi-v7a-neon-c11', 'Unix Makefiles'), + Toolchain('android-ndk-r14-api-19-armeabi-v7a-neon-clang', 'Unix Makefiles'), + Toolchain('android-ndk-r14-api-19-armeabi-v7a-neon-clang-libcxx', 'Unix Makefiles'), + Toolchain('android-ndk-r14-api-21-arm64-v8a-neon-clang-libcxx', 'Unix Makefiles'), + Toolchain('android-ndk-r14-api-19-armeabi-v7a-neon-hid-sections-lto', 'Unix Makefiles'), + Toolchain('android-ndk-r14-api-21-arm64-v8a-clang-hid-sections-lto', 'Unix Makefiles'), + Toolchain('android-ndk-r14-api-21-x86-64', 'Unix Makefiles'), + Toolchain('android-ndk-r14b-api-21-armeabi-clang-libcxx', 'Unix Makefiles'), + Toolchain('android-ndk-r14b-api-21-armeabi-v7a-neon-clang-libcxx', 'Unix Makefiles'), + Toolchain('android-ndk-r14b-api-21-mips-clang-libcxx', 'Unix Makefiles'), + Toolchain('android-ndk-r14b-api-21-x86-clang-libcxx', 'Unix Makefiles'), + Toolchain('android-ndk-r15c-api-16-armeabi-v7a-neon-clang-libcxx', 'Unix Makefiles'), + Toolchain('android-ndk-r15c-api-16-armeabi-v7a-clang-libcxx', 'Unix Makefiles'), + Toolchain('android-ndk-r15c-api-16-armeabi-clang-libcxx', 'Unix Makefiles'), + Toolchain('android-ndk-r15c-api-16-mips-clang-libcxx', 'Unix Makefiles'), + Toolchain('android-ndk-r15c-api-16-x86-clang-libcxx', 'Unix Makefiles'), + Toolchain('android-ndk-r15c-api-21-arm64-v8a-neon-clang-libcxx', 'Unix Makefiles'), + Toolchain('android-ndk-r15c-api-21-arm64-v8a-clang-libcxx', 'Unix Makefiles'), + Toolchain('android-ndk-r15c-api-21-armeabi-v7a-clang-libcxx', 'Unix Makefiles'), + Toolchain('android-ndk-r15c-api-21-armeabi-v7a-neon-clang-libcxx', 'Unix Makefiles'), + Toolchain('android-ndk-r15c-api-21-armeabi-clang-libcxx', 'Unix Makefiles'), + Toolchain('android-ndk-r15c-api-21-mips-clang-libcxx', 'Unix Makefiles'), + Toolchain('android-ndk-r15c-api-21-x86-clang-libcxx', 'Unix Makefiles'), + Toolchain('android-ndk-r15c-api-21-x86-64-clang-libcxx', 'Unix Makefiles'), + Toolchain('android-ndk-r15c-api-24-armeabi-v7a-neon-clang-libcxx', 'Unix Makefiles'), + Toolchain('android-ndk-r16b-api-16-armeabi-v7a-clang-libcxx14', 'Unix Makefiles'), + Toolchain('android-ndk-r16b-api-16-armeabi-v7a-thumb-clang-libcxx14', 'Unix Makefiles'), + Toolchain('android-ndk-r16b-api-16-x86-clang-libcxx14', 'Unix Makefiles'), + Toolchain('android-ndk-r16b-api-19-gcc-49-armeabi-v7a-neon-libcxx-hid-sections-lto', 'Unix Makefiles'), + Toolchain('android-ndk-r16b-api-21-armeabi-clang-libcxx', 'Unix Makefiles'), + Toolchain('android-ndk-r16b-api-21-armeabi-clang-libcxx14', 'Unix Makefiles'), + Toolchain('android-ndk-r16b-api-21-armeabi-v7a-clang-libcxx', 'Unix Makefiles'), + Toolchain('android-ndk-r16b-api-21-armeabi-v7a-clang-libcxx14', 'Unix Makefiles'), + Toolchain('android-ndk-r16b-api-21-arm64-v8a-neon-clang-libcxx', 'Unix Makefiles'), + Toolchain('android-ndk-r16b-api-21-arm64-v8a-neon-clang-libcxx14', 'Unix Makefiles'), + Toolchain('android-ndk-r16b-api-21-armeabi-v7a-neon-clang-libcxx', 'Unix Makefiles'), + Toolchain('android-ndk-r16b-api-21-armeabi-v7a-neon-clang-libcxx14', 'Unix Makefiles'), + Toolchain('android-ndk-r16b-api-21-x86-clang-libcxx', 'Unix Makefiles'), + Toolchain('android-ndk-r16b-api-21-x86-64-clang-libcxx', 'Unix Makefiles'), + Toolchain('android-ndk-r16b-api-24-arm64-v8a-clang-libcxx14', 'Unix Makefiles'), + Toolchain('android-ndk-r16b-api-24-armeabi-v7a-neon-clang-libcxx', 'Unix Makefiles'), + Toolchain('android-ndk-r16b-api-24-armeabi-v7a-neon-clang-libcxx14', 'Unix Makefiles'), + Toolchain('android-ndk-r17-api-24-arm64-v8a-clang-libcxx14', 'Unix Makefiles'), + Toolchain('android-ndk-r17-api-21-arm64-v8a-neon-clang-libcxx14', 'Unix Makefiles'), + Toolchain('android-ndk-r17-api-16-armeabi-v7a-clang-libcxx14', 'Unix Makefiles'), + Toolchain('android-ndk-r17-api-16-x86-clang-libcxx14', 'Unix Makefiles'), + Toolchain('android-ndk-r17-api-21-x86-64-clang-libcxx14', 'Unix Makefiles'), + Toolchain('android-ndk-r17-api-19-armeabi-v7a-neon-hid-sections', 'Unix Makefiles'), + Toolchain('android-ndk-r17-api-19-armeabi-v7a-neon-clang-libcxx', 'Unix Makefiles'), + Toolchain('android-ndk-r18-api-24-arm64-v8a-clang-libcxx14', 'Unix Makefiles'), + Toolchain('android-ndk-r18b-api-24-arm64-v8a-clang-libcxx11', 'Unix Makefiles'), + Toolchain('android-ndk-r18b-api-16-armeabi-v7a-clang-libcxx', 'Unix Makefiles'), + Toolchain('emscripten-cxx11', 'Unix Makefiles'), + Toolchain('emscripten-cxx14', 'Unix Makefiles'), + Toolchain('emscripten-cxx17', 'Unix Makefiles'), + Toolchain('raspberrypi1-cxx11-pic', 'Unix Makefiles'), + Toolchain('raspberrypi1-cxx11-pic-static-std', 'Unix Makefiles'), + Toolchain('raspberrypi2-cxx11', 'Unix Makefiles'), + Toolchain('raspberrypi2-cxx11-pic', 'Unix Makefiles'), + Toolchain('raspberrypi3-gcc-pic-hid-sections', 'Unix Makefiles'), + Toolchain('raspberrypi3-cxx11', 'Unix Makefiles') +] + +if os.name == 'nt': + toolchain_table += [ + Toolchain('mingw', 'MinGW Makefiles'), + Toolchain('mingw-c11', 'MinGW Makefiles'), + Toolchain('mingw-cxx14', 'MinGW Makefiles'), + Toolchain('mingw-cxx17', 'MinGW Makefiles'), + Toolchain('msys', 'MSYS Makefiles'), + Toolchain('msys-cxx14', 'MSYS Makefiles'), + Toolchain('msys-cxx17', 'MSYS Makefiles'), + Toolchain( + 'nmake-vs-12-2013', + 'NMake Makefiles', + arch='x86', + vs_version='12' + ), + Toolchain( + 'nmake-vs-12-2013-win64', + 'NMake Makefiles', + arch='amd64', + vs_version='12' + ), + Toolchain( + 'nmake-vs-15-2017-win64', + 'NMake Makefiles', + arch='amd64', + vs_version='15' + ), + Toolchain( + 'nmake-vs-15-2017-win64-cxx17', + 'NMake Makefiles', + arch='amd64', + vs_version='15' + ), + Toolchain( + 'ninja-vs-12-2013-win64', + 'Ninja', + arch='amd64', + vs_version='12' + ), + Toolchain( + 'ninja-vs-14-2015-win64', + 'Ninja', + arch='amd64', + vs_version='14' + ), + Toolchain( + 'ninja-vs-15-2017-win64', + 'Ninja', + arch='amd64', + vs_version='15' + ), + Toolchain( + 'ninja-vs-15-2017-win64-cxx17', + 'Ninja', + arch='amd64', + vs_version='15' + ), + Toolchain( + 'vs-12-2013', 'Visual Studio 12 2013', arch='x86', vs_version='12' + ), + Toolchain( + 'vs-12-2013-mt', 'Visual Studio 12 2013', arch='x86', vs_version='12' + ), + Toolchain( + 'vs-10-2010', 'Visual Studio 10 2010', arch='x86', vs_version='10' + ), + Toolchain( + 'vs-11-2012', 'Visual Studio 11 2012', arch='x86', vs_version='11' + ), + Toolchain( + 'vs-14-2015', 'Visual Studio 14 2015', arch='x86', vs_version='14' + ), + Toolchain( + 'vs-15-2017', 'Visual Studio 15 2017', arch='x86', vs_version='15' + ), + Toolchain( + 'vs-15-2017-cxx17', 'Visual Studio 15 2017', arch='x86', vs_version='15' + ), + Toolchain( + 'vs-14-2015-sdk-8-1', 'Visual Studio 14 2015', arch='x86', vs_version='14' + ), + Toolchain( + 'vs-9-2008', 'Visual Studio 9 2008', arch='x86', vs_version='9' + ), + Toolchain( + 'vs-8-2005', 'Visual Studio 8 2005', arch='x86', vs_version='8' + ), + Toolchain( + 'vs-12-2013-xp', + 'Visual Studio 12 2013', + arch='x86', + vs_version='12', + xp=True + ), + Toolchain( + 'vs-11-2012-win64', + 'Visual Studio 11 2012 Win64', + arch='amd64', + vs_version='11' + ), + Toolchain( + 'vs-12-2013-win64', + 'Visual Studio 12 2013 Win64', + arch='amd64', + vs_version='12' + ), + Toolchain( + 'vs-14-2015-win64', + 'Visual Studio 14 2015 Win64', + arch='amd64', + vs_version='14' + ), + Toolchain( + 'vs-14-2015-win64-sdk-8-1', + 'Visual Studio 14 2015 Win64', + arch='amd64', + vs_version='14' + ), + Toolchain( + 'vs-11-2012-arm', + 'Visual Studio 11 2012 ARM', + vs_version='11' + ), + Toolchain( + 'vs-12-2013-arm', + 'Visual Studio 12 2013 ARM', + vs_version='12' + ), + Toolchain( + 'vs-14-2015-arm', + 'Visual Studio 14 2015 ARM', + vs_version='14' + ), + Toolchain( + 'vs-15-2017-win64', + 'Visual Studio 15 2017 Win64', + arch='amd64', + vs_version='15' + ), + Toolchain( + 'vs-15-2017-win64-cxx14', + 'Visual Studio 15 2017 Win64', + arch='amd64', + vs_version='15' + ), + Toolchain( + 'vs-15-2017-win64-cxx17', + 'Visual Studio 15 2017 Win64', + arch='amd64', + vs_version='15' + ), + Toolchain( + 'vs-15-2017-win64-llvm', + 'Visual Studio 15 2017 Win64', + toolset='llvm', + arch='amd64', + vs_version='15' + ), + Toolchain( + 'vs-15-2017-win64-llvm-vs2014', + 'Visual Studio 15 2017 Win64', + toolset='LLVM-vs2014', + arch='amd64', + vs_version='15' + ), + Toolchain( + 'vs-15-2017-win64-store-10-zw', + 'Visual Studio 15 2017 Win64', + arch='amd64', + vs_version='15' + ), + Toolchain( + 'vs-15-2017-store-10-zw', + 'Visual Studio 15 2017', + arch='x86', + vs_version='15' + ), + Toolchain( + 'vs-15-2017-win64-store-10-cxx17', + 'Visual Studio 15 2017 Win64', + arch='amd64', + vs_version='15' + ), + Toolchain( + 'vs-15-2017-win64-z7', + 'Visual Studio 15 2017 Win64', + arch='amd64', + vs_version='15' + ), + Toolchain( + 'android-vc-ndk-r10e-api-19-arm-clang-3-6', + 'Visual Studio 14 2015 ARM', + arch='', + vs_version='14' + ), + Toolchain( + 'android-vc-ndk-r10e-api-21-arm-clang-3-6', + 'Visual Studio 14 2015 ARM', + arch='', + vs_version='14' + ), + Toolchain( + 'android-vc-ndk-r10e-api-19-x86-clang-3-6', + 'Visual Studio 14 2015', + arch='', + vs_version='14' + ), + Toolchain( + 'android-vc-ndk-r10e-api-19-arm-gcc-4-9', + 'Visual Studio 14 2015 ARM', + arch='', + vs_version='14' + ), + ] + +if platform.system().startswith('CYGWIN'): + toolchain_table += [ + Toolchain('cygwin', 'Unix Makefiles'), + ] + +if platform.system() == 'Linux': + toolchain_table += [ + Toolchain('sanitize-leak', 'Unix Makefiles'), + Toolchain('sanitize-leak-cxx17', 'Unix Makefiles'), + Toolchain('sanitize-leak-cxx17-pic', 'Unix Makefiles'), + Toolchain('sanitize-memory', 'Unix Makefiles'), + Toolchain('linux-mingw-w32', 'Unix Makefiles'), + Toolchain('linux-mingw-w64', 'Unix Makefiles'), + Toolchain('linux-mingw-w64-cxx98', 'Unix Makefiles'), + Toolchain('linux-mingw-w64-gnuxx11', 'Unix Makefiles'), + Toolchain('linux-gcc-armhf', 'Unix Makefiles'), + Toolchain('linux-gcc-armhf-neon', 'Unix Makefiles'), + Toolchain('linux-gcc-armhf-neon-vfpv4', 'Unix Makefiles'), + Toolchain('linux-gcc-jetson-tk1', 'Unix Makefiles'), + ] + +if platform.system() == 'Darwin': + toolchain_table += [ + Toolchain('ios', 'Xcode'), + Toolchain('ios-12-0-dep-11-0-arm64', 'Xcode', ios_version='12.0'), + Toolchain('ios-12-1-dep-11-0-arm64', 'Xcode', ios_version='12.1'), + Toolchain('ios-12-1-dep-9-3-arm64', 'Xcode', ios_version='12.1'), + Toolchain('ios-11-4-dep-9-3-arm64', 'Xcode', ios_version='11.4'), + Toolchain('ios-11-4-dep-9-3-armv7', 'Xcode', ios_version='11.4'), + Toolchain('ios-11-4-dep-9-3-arm64-armv7', 'Xcode', ios_version='11.4'), + Toolchain('ios-11-4-dep-9-3', 'Xcode', ios_version='11.4'), + Toolchain('ios-11-4-dep-9-4-arm64', 'Xcode', ios_version='11.4'), + Toolchain('ios-11-4-dep-9-3-arm64-hid-sections-lto-cxx11', 'Xcode', ios_version='11.4'), + Toolchain('ios-11-4-dep-8-0-arm64-armv7-hid-sections-lto-cxx11', 'Xcode', ios_version='11.4'), + Toolchain('ios-11-4-dep-8-0-arm64-hid-sections-lto-cxx11', 'Xcode', ios_version='11.4'), + Toolchain('ios-11-3-dep-9-0-arm64', 'Xcode', ios_version='11.3'), + Toolchain('ios-11-4-dep-9-0-device-bitcode-cxx11', 'Xcode', ios_version='11.4'), + Toolchain('ios-12-0-dep-9-0-device-bitcode-cxx11', 'Xcode', ios_version='12.0'), + Toolchain('ios-11-4-dep-9-0-device-bitcode-nocxx', 'Xcode', ios_version='11.4'), + Toolchain('ios-11-3-dep-9-0-device-bitcode', 'Xcode', ios_version='11.3'), + Toolchain('ios-11-3-dep-9-0-device-bitcode-nocxx', 'Xcode', ios_version='11.3'), + Toolchain('ios-11-3-dep-9-0-device-bitcode-cxx11', 'Xcode', ios_version='11.3'), + Toolchain('ios-11-3-dep-9-0-device-bitcode-cxx17', 'Xcode', ios_version='11.3'), + Toolchain('ios-11-2-dep-9-0-device-bitcode-cxx11', 'Xcode', ios_version='11.2'), + Toolchain('ios-11-2-dep-9-0-device-bitcode-nocxx', 'Xcode', ios_version='11.2'), + Toolchain('ios-11-2-dep-9-3-arm64-armv7', 'Xcode', ios_version='11.2'), + Toolchain('ios-11-3-dep-9-3-arm64-armv7', 'Xcode', ios_version='11.3'), + Toolchain('ios-11-1-dep-9-0-bitcode-cxx11', 'Xcode', ios_version='11.1'), + Toolchain('ios-11-1-dep-9-0-device-bitcode-cxx11', 'Xcode', ios_version='11.1'), + Toolchain('ios-11-0-dep-9-0-bitcode-cxx11', 'Xcode', ios_version='11.0'), + Toolchain('ios-11-0-dep-9-0-device-bitcode-cxx11', 'Xcode', ios_version='11.0'), + Toolchain('ios-11-0', 'Xcode', ios_version='11.0'), + Toolchain('ios-10-3', 'Xcode', ios_version='10.3'), + Toolchain('ios-10-3-dep-8-0-bitcode', 'Xcode', ios_version='10.3'), + Toolchain('ios-10-3-dep-9-0-bitcode', 'Xcode', ios_version='10.3'), + Toolchain('ios-10-3-dep-9-3-i386-armv7', 'Xcode', ios_version='10.3'), + Toolchain('ios-10-3-dep-9-3-x86-64-arm64', 'Xcode', ios_version='10.3'), + Toolchain('ios-10-3-lto', 'Xcode', ios_version='10.3'), + Toolchain('ios-10-3-armv7', 'Xcode', ios_version='10.3'), + Toolchain('ios-10-3-arm64', 'Xcode', ios_version='10.3'), + Toolchain('ios-10-2', 'Xcode', ios_version='10.2'), + Toolchain('ios-10-2-dep-9-3-armv7', 'Xcode', ios_version='10.2'), + Toolchain('ios-10-2-dep-9-3-arm64', 'Xcode', ios_version='10.2'), + Toolchain('ios-10-1', 'Xcode', ios_version='10.1'), + Toolchain('ios-10-1-arm64', 'Xcode', ios_version='10.1'), + Toolchain('ios-10-1-arm64-dep-8-0-hid-sections', 'Xcode', ios_version='10.1'), + Toolchain('ios-10-1-armv7', 'Xcode', ios_version='10.1'), + Toolchain('ios-10-1-dep-8-0-hid-sections', 'Xcode', ios_version='10.1'), + Toolchain('ios-10-1-dep-8-0-libcxx-hid-sections', 'Xcode', ios_version='10.1'), + Toolchain('ios-10-1-dep-8-0-libcxx-hid-sections-lto', 'Xcode', ios_version='10.1'), + Toolchain('ios-10-1-wo-armv7s', 'Xcode', ios_version='10.1'), + Toolchain('ios-10-0', 'Xcode', ios_version='10.0'), + Toolchain('ios-10-0-arm64', 'Xcode', ios_version='10.0'), + Toolchain('ios-10-0-arm64-dep-8-0-hid-sections', 'Xcode', ios_version='10.0'), + Toolchain('ios-10-0-armv7', 'Xcode', ios_version='10.0'), + Toolchain('ios-10-0-dep-8-0-hid-sections', 'Xcode', ios_version='10.0'), + Toolchain('ios-10-0-wo-armv7s', 'Xcode', ios_version='10.0'), + Toolchain('ios-9-3', 'Xcode', ios_version='9.3'), + Toolchain('ios-9-3-arm64', 'Xcode', ios_version='9.3'), + Toolchain('ios-9-3-armv7', 'Xcode', ios_version='9.3'), + Toolchain('ios-9-3-wo-armv7s', 'Xcode', ios_version='9.3'), + Toolchain('ios-9-2', 'Xcode', ios_version='9.2'), + Toolchain('ios-9-2-arm64', 'Xcode', ios_version='9.2'), + Toolchain('ios-9-2-armv7', 'Xcode', ios_version='9.2'), + Toolchain('ios-9-2-hid', 'Xcode', ios_version='9.2'), + Toolchain('ios-9-2-hid-sections', 'Xcode', ios_version='9.2'), + Toolchain('ios-9-1-armv7', 'Xcode', ios_version='9.1'), + Toolchain('ios-9-1-arm64', 'Xcode', ios_version='9.1'), + Toolchain('ios-9-1-dep-7-0-armv7', 'Xcode', ios_version='9.1'), + Toolchain('ios-9-1-hid', 'Xcode', ios_version='9.1'), + Toolchain('ios-9-1-dep-8-0-hid', 'Xcode', ios_version='9.1'), + Toolchain('ios-9-1', 'Xcode', ios_version='9.1'), + Toolchain('ios-9-0', 'Xcode', ios_version='9.0'), + Toolchain('ios-9-0-armv7', 'Xcode', ios_version='9.0'), + Toolchain('ios-9-0-i386-armv7', 'Xcode', ios_version='9.0'), + Toolchain('ios-9-0-wo-armv7s', 'Xcode', ios_version='9.0'), + Toolchain('ios-9-0-dep-7-0-armv7', 'Xcode', ios_version='9.0'), + Toolchain('ios-8-4', 'Xcode', ios_version='8.4'), + Toolchain('ios-8-4-arm64', 'Xcode', ios_version='8.4'), + Toolchain('ios-8-4-armv7', 'Xcode', ios_version='8.4'), + Toolchain('ios-8-4-armv7s', 'Xcode', ios_version='8.4'), + Toolchain('ios-8-4-hid', 'Xcode', ios_version='8.4'), + Toolchain('ios-8-2', 'Xcode', ios_version='8.2'), + Toolchain('ios-8-2-i386-arm64', 'Xcode', ios_version='8.2'), + Toolchain('ios-8-2-arm64', 'Xcode', ios_version='8.2'), + Toolchain('ios-8-2-arm64-hid', 'Xcode', ios_version='8.2'), + Toolchain('ios-8-2-cxx98', 'Xcode', ios_version='8.2'), + Toolchain('ios-8-1', 'Xcode', ios_version='8.1'), + Toolchain('ios-8-0', 'Xcode', ios_version='8.0'), + Toolchain('ios-7-1', 'Xcode', ios_version='7.1'), + Toolchain('ios-7-0', 'Xcode', ios_version='7.0'), + Toolchain('ios-dep-8-0-arm64-armv7-hid-sections-lto-cxx11', 'Xcode'), + Toolchain('ios-nocodesign', 'Xcode', nocodesign=True), + Toolchain('ios-nocodesign-arm64', 'Xcode', ios_version='8.1', nocodesign=True), + Toolchain('ios-nocodesign-armv7', 'Xcode', ios_version='8.1', nocodesign=True), + Toolchain('ios-nocodesign-hid-sections', 'Xcode', ios_version='8.1', nocodesign=True), + Toolchain('ios-nocodesign-wo-armv7s', 'Xcode', ios_version='8.1', nocodesign=True), + Toolchain('ios-nocodesign-8-4', 'Xcode', ios_version='8.4', nocodesign=True), + Toolchain('ios-nocodesign-8-1', 'Xcode', ios_version='8.1', nocodesign=True), + Toolchain('ios-nocodesign-9-1', 'Xcode', ios_version='9.1', nocodesign=True), + Toolchain('ios-nocodesign-9-1-arm64', 'Xcode', ios_version='9.1', nocodesign=True), + Toolchain('ios-nocodesign-9-1-armv7', 'Xcode', ios_version='9.1', nocodesign=True), + Toolchain('ios-nocodesign-9-2', 'Xcode', ios_version='9.2', nocodesign=True), + Toolchain('ios-nocodesign-9-2-arm64', 'Xcode', ios_version='9.2', nocodesign=True), + Toolchain('ios-nocodesign-9-2-armv7', 'Xcode', ios_version='9.2', nocodesign=True), + Toolchain('ios-nocodesign-9-3', 'Xcode', ios_version='9.3', nocodesign=True), + Toolchain('ios-nocodesign-9-3-device', 'Xcode', ios_version='9.3', nocodesign=True), + Toolchain('ios-nocodesign-9-3-device-hid-sections', 'Xcode', ios_version='9.3', nocodesign=True), + Toolchain('ios-nocodesign-9-3-arm64', 'Xcode', ios_version='9.3', nocodesign=True), + Toolchain('ios-nocodesign-9-3-armv7', 'Xcode', ios_version='9.3', nocodesign=True), + Toolchain('ios-nocodesign-9-3-wo-armv7s', 'Xcode', ios_version='9.3', nocodesign=True), + Toolchain('ios-nocodesign-10-0', 'Xcode', ios_version='10.0', nocodesign=True), + Toolchain('ios-nocodesign-10-0-arm64', 'Xcode', ios_version='10.0', nocodesign=True), + Toolchain('ios-nocodesign-10-0-armv7', 'Xcode', ios_version='10.0', nocodesign=True), + Toolchain('ios-nocodesign-10-0-wo-armv7s', 'Xcode', ios_version='10.0', nocodesign=True), + Toolchain('ios-nocodesign-10-1', 'Xcode', ios_version='10.1', nocodesign=True), + Toolchain('ios-nocodesign-10-1-arm64', 'Xcode', ios_version='10.1', nocodesign=True), + Toolchain('ios-nocodesign-10-1-armv7', 'Xcode', ios_version='10.1', nocodesign=True), + Toolchain('ios-nocodesign-10-1-wo-armv7s', 'Xcode', ios_version='10.1', nocodesign=True), + Toolchain('ios-nocodesign-10-1-arm64-dep-9-0-device-libcxx-hid-sections-lto', 'Xcode', ios_version='10.1', nocodesign=True), + Toolchain('ios-nocodesign-10-1-arm64-dep-9-0-device-libcxx-hid-sections', 'Xcode', ios_version='10.1', nocodesign=True), + Toolchain('ios-nocodesign-10-1-dep-8-0-libcxx-hid-sections-lto', 'Xcode', ios_version='10.1', nocodesign=True), + Toolchain('ios-nocodesign-10-1-dep-8-0-device-libcxx-hid-sections-lto', 'Xcode', ios_version='10.1', nocodesign=True), + Toolchain('ios-nocodesign-10-1-dep-9-0-device-libcxx-hid-sections-lto', 'Xcode', ios_version='10.1', nocodesign=True), + Toolchain('ios-nocodesign-10-2', 'Xcode', ios_version='10.2', nocodesign=True), + Toolchain('ios-nocodesign-10-3', 'Xcode', ios_version='10.3', nocodesign=True), + Toolchain('ios-nocodesign-10-3-cxx14', 'Xcode', ios_version='10.3', nocodesign=True), + Toolchain('ios-nocodesign-10-3-arm64-dep-9-0-device-libcxx-hid-sections', 'Xcode', ios_version='10.3', nocodesign=True), + Toolchain('ios-nocodesign-10-3-dep-9-0-bitcode', 'Xcode', ios_version='10.3', nocodesign=True), + Toolchain('ios-nocodesign-10-3-wo-armv7s', 'Xcode', ios_version='10.3', nocodesign=True), + Toolchain('ios-nocodesign-10-3-arm64', 'Xcode', ios_version='10.3', nocodesign=True), + Toolchain('ios-nocodesign-10-3-armv7', 'Xcode', ios_version='10.3', nocodesign=True), + Toolchain('ios-nocodesign-11-0', 'Xcode', ios_version='11.0', nocodesign=True), + Toolchain('ios-nocodesign-11-0-dep-9-0-bitcode-cxx11', 'Xcode', ios_version='11.0', nocodesign=True), + Toolchain('ios-nocodesign-11-0-arm64-dep-9-0-device-libcxx-hid-sections', 'Xcode', ios_version='11.0', nocodesign=True), + Toolchain('ios-nocodesign-11-1', 'Xcode', ios_version='11.1', nocodesign=True), + Toolchain('ios-nocodesign-11-1-dep-9-0-wo-armv7s-bitcode-cxx11', 'Xcode', ios_version='11.1', nocodesign=True), + Toolchain('ios-nocodesign-11-1-dep-9-0-bitcode-cxx11', 'Xcode', ios_version='11.1', nocodesign=True), + Toolchain('ios-nocodesign-11-2-dep-8-0-wo-armv7s-bitcode-cxx11', 'Xcode', ios_version='11.2', nocodesign=True), + Toolchain('ios-nocodesign-11-2-dep-9-0-bitcode-cxx11', 'Xcode', ios_version='11.2', nocodesign=True), + Toolchain('ios-nocodesign-11-2-dep-9-3', 'Xcode', ios_version='11.2', nocodesign=True), + Toolchain('ios-nocodesign-11-2-dep-9-3-armv7', 'Xcode', ios_version='11.2', nocodesign=True), + Toolchain('ios-nocodesign-11-2-dep-9-3-arm64', 'Xcode', ios_version='11.2', nocodesign=True), + Toolchain('ios-nocodesign-11-2-dep-9-3-arm64-armv7', 'Xcode', ios_version='11.2', nocodesign=True), + Toolchain('ios-nocodesign-11-2-dep-9-3-i386-armv7', 'Xcode', ios_version='11.2', nocodesign=True), + Toolchain('ios-nocodesign-11-2', 'Xcode', ios_version='11.2', nocodesign=True), + Toolchain('ios-nocodesign-11-3-dep-9-3', 'Xcode', ios_version='11.3', nocodesign=True), + Toolchain('ios-nocodesign-11-3-dep-9-3-armv7', 'Xcode', ios_version='11.3', nocodesign=True), + Toolchain('ios-nocodesign-11-3-dep-9-3-arm64', 'Xcode', ios_version='11.3', nocodesign=True), + Toolchain('ios-nocodesign-11-3-dep-9-0-bitcode-cxx11', 'Xcode', ios_version='11.3', nocodesign=True), + Toolchain('ios-nocodesign-11-4-dep-9-0-bitcode-cxx11', 'Xcode', ios_version='11.4', nocodesign=True), + Toolchain('ios-nocodesign-12-0-dep-9-0-bitcode-cxx11', 'Xcode', ios_version='12.0', nocodesign=True), + Toolchain('ios-nocodesign-11-4-dep-9-3', 'Xcode', ios_version='11.4', nocodesign=True), + Toolchain('ios-nocodesign-11-4-dep-9-3-arm64', 'Xcode', ios_version='11.4', nocodesign=True), + Toolchain('ios-nocodesign-11-4-dep-9-3-armv7', 'Xcode', ios_version='11.4', nocodesign=True), + Toolchain('ios-nocodesign-12-1-dep-9-3-armv7', 'Xcode', ios_version='12.1', nocodesign=True), + Toolchain('ios-nocodesign-dep-9-0-cxx14', 'Xcode', nocodesign=True), + Toolchain('xcode', 'Xcode'), + Toolchain('xcode-cxx98', 'Xcode'), + Toolchain('xcode-nocxx', 'Xcode'), + Toolchain('xcode-gcc', 'Xcode'), + Toolchain('xcode-hid-sections', 'Xcode'), + Toolchain('xcode-sections', 'Xcode'), + Toolchain('osx-10-7', 'Xcode', osx_version='10.7'), + Toolchain('osx-10-8', 'Xcode', osx_version='10.8'), + Toolchain('osx-10-9', 'Xcode', osx_version='10.9'), + Toolchain('osx-10-10', 'Xcode', osx_version='10.10'), + Toolchain('osx-10-11', 'Xcode', osx_version='10.11'), + Toolchain('osx-10-11-hid-sections', 'Xcode', osx_version='10.11'), + Toolchain('osx-10-11-hid-sections-lto', 'Xcode', osx_version='10.11'), + Toolchain('osx-10-11-lto', 'Xcode', osx_version='10.11'), + Toolchain('osx-10-12', 'Xcode', osx_version='10.12'), + Toolchain('osx-10-12-hid-sections', 'Xcode', osx_version='10.12'), + Toolchain('osx-10-12-lto', 'Xcode', osx_version='10.12'), + Toolchain('osx-10-12-cxx98', 'Xcode', osx_version='10.12'), + Toolchain('osx-10-12-cxx14', 'Xcode', osx_version='10.12'), + Toolchain('osx-10-12-cxx17', 'Xcode', osx_version='10.12'), + Toolchain('osx-10-10-dep-10-7', 'Xcode', osx_version='10.10'), + Toolchain('osx-10-12-dep-10-10', 'Xcode', osx_version='10.12'), + Toolchain('osx-10-12-dep-10-10-lto', 'Xcode', osx_version='10.12'), + Toolchain('osx-10-10-dep-10-9-make', 'Unix Makefiles'), + Toolchain('osx-10-11-make', 'Unix Makefiles'), + Toolchain('osx-10-12-make', 'Unix Makefiles'), + Toolchain('osx-10-12-ninja', 'Ninja'), + Toolchain('osx-10-11-sanitize-address', 'Xcode', osx_version='10.11'), + Toolchain('osx-10-12-sanitize-address', 'Xcode', osx_version='10.12'), + Toolchain('osx-10-12-sanitize-address-hid-sections', 'Xcode', osx_version='10.12'), + Toolchain('osx-10-13', 'Xcode', osx_version='10.13'), + Toolchain('osx-10-13-dep-10-10', 'Xcode', osx_version='10.13'), + Toolchain('osx-10-13-dep-10-10-cxx14', 'Xcode', osx_version='10.13'), + Toolchain('osx-10-13-dep-10-10-cxx17', 'Xcode', osx_version='10.13'), + Toolchain('osx-10-13-make-cxx14', 'Unix Makefiles'), + Toolchain('osx-10-13-cxx14', 'Xcode', osx_version='10.13'), + Toolchain('osx-10-13-cxx17', 'Xcode', osx_version='10.13'), + Toolchain('osx-10-13-i386-cxx14', 'Xcode', osx_version='10.13'), + Toolchain('osx-10-14', 'Xcode', osx_version='10.14'), + Toolchain('osx-10-14-dep-10-10', 'Xcode', osx_version='10.14'), + Toolchain('osx-10-14-dep-10-10-cxx14', 'Xcode', osx_version='10.14'), + Toolchain('osx-10-14-dep-10-10-cxx17', 'Xcode', osx_version='10.14'), + Toolchain('osx-10-14-cxx14', 'Xcode', osx_version='10.14'), + Toolchain('osx-10-14-cxx17', 'Xcode', osx_version='10.14'), + Toolchain('linux-gcc-x64', 'Unix Makefiles'), + ] + +if os.name == 'posix': + toolchain_table += [ + Toolchain('analyze', 'Unix Makefiles'), + Toolchain('analyze-cxx17', 'Unix Makefiles'), + Toolchain('clang-5', 'Unix Makefiles'), + Toolchain('clang-5-cxx14', 'Unix Makefiles'), + Toolchain('clang-5-cxx17', 'Unix Makefiles'), + Toolchain('clang-cxx17', 'Unix Makefiles'), + Toolchain('clang-cxx14', 'Unix Makefiles'), + Toolchain('clang-cxx14-pic', 'Unix Makefiles'), + Toolchain('clang-libcxx', 'Unix Makefiles'), + Toolchain('clang-libcxx-fpic', 'Unix Makefiles'), + Toolchain('clang-libcxx14', 'Unix Makefiles'), + Toolchain('clang-libcxx14-fpic', 'Unix Makefiles'), + Toolchain('clang-libcxx17', 'Unix Makefiles'), + Toolchain('clang-libcxx17-fpic', 'Unix Makefiles'), + Toolchain('clang-lto', 'Unix Makefiles'), + Toolchain('clang-libstdcxx', 'Unix Makefiles'), + Toolchain('clang-omp', 'Unix Makefiles'), + Toolchain('clang-fpic', 'Unix Makefiles'), + Toolchain('clang-fpic-hid-sections', 'Unix Makefiles'), + Toolchain('clang-fpic-static-std', 'Unix Makefiles'), + Toolchain('clang-tidy', 'Unix Makefiles'), + Toolchain('clang-tidy-libcxx', 'Unix Makefiles'), + Toolchain('gcc', 'Unix Makefiles'), + Toolchain('gcc-ninja', 'Ninja'), + Toolchain('gcc-static', 'Unix Makefiles'), + Toolchain('gcc-static-std', 'Unix Makefiles'), + Toolchain('gcc-musl', 'Unix Makefiles'), + Toolchain('gcc-32bit', 'Unix Makefiles'), + Toolchain('gcc-32bit-pic', 'Unix Makefiles'), + Toolchain('gcc-hid', 'Unix Makefiles'), + Toolchain('gcc-hid-fpic', 'Unix Makefiles'), + Toolchain('gcc-gold', 'Unix Makefiles'), + Toolchain('gcc-pic', 'Unix Makefiles'), + Toolchain('gcc-c11', 'Unix Makefiles'), + Toolchain('gcc-cxx14-c11', 'Unix Makefiles'), + Toolchain('gcc-cxx17-c11', 'Unix Makefiles'), + Toolchain('gcc-4-8', 'Unix Makefiles'), + Toolchain('gcc-4-8-c11', 'Unix Makefiles'), + Toolchain('gcc-4-8-pic', 'Unix Makefiles'), + Toolchain('gcc-4-8-pic-hid-sections', 'Unix Makefiles'), + Toolchain('gcc-pic-hid-sections', 'Unix Makefiles'), + Toolchain('gcc-pic-hid-sections-lto', 'Unix Makefiles'), + Toolchain('gcc-5-pic-hid-sections-lto', 'Unix Makefiles'), + Toolchain('gcc-5-pic-hid-sections', 'Unix Makefiles'), + Toolchain('gcc-5', 'Unix Makefiles'), + Toolchain('gcc-5-cxx14-c11', 'Unix Makefiles'), + Toolchain('gcc-6-32bit-cxx14', 'Unix Makefiles'), + Toolchain('gcc-7', 'Unix Makefiles'), + Toolchain('gcc-7-cxx14', 'Unix Makefiles'), + Toolchain('gcc-7-cxx14-pic', 'Unix Makefiles'), + Toolchain('gcc-7-cxx17', 'Unix Makefiles'), + Toolchain('gcc-7-cxx17-gnu', 'Unix Makefiles'), + Toolchain('gcc-7-cxx17-pic', 'Unix Makefiles'), + Toolchain('gcc-7-pic-hid-sections-lto', 'Unix Makefiles'), + Toolchain('gcc-8-cxx14', 'Unix Makefiles'), + Toolchain('gcc-8-cxx14-fpic', 'Unix Makefiles'), + Toolchain('gcc-8-cxx17', 'Unix Makefiles'), + Toolchain('gcc-8-cxx17-fpic', 'Unix Makefiles'), + Toolchain('gcc-cxx98', 'Unix Makefiles'), + Toolchain('gcc-lto', 'Unix Makefiles'), + Toolchain('libcxx', 'Unix Makefiles'), + Toolchain('libcxx14', 'Unix Makefiles'), + Toolchain('libcxx-no-sdk', 'Unix Makefiles'), + Toolchain('libcxx-hid', 'Unix Makefiles'), + Toolchain('libcxx-hid-fpic', 'Unix Makefiles'), + Toolchain('libcxx-fpic-hid-sections', 'Unix Makefiles'), + Toolchain('libcxx-hid-sections', 'Unix Makefiles'), + Toolchain('sanitize-address', 'Unix Makefiles'), + Toolchain('sanitize-address-cxx17', 'Unix Makefiles'), + Toolchain('sanitize-address-cxx17-pic', 'Unix Makefiles'), + Toolchain('sanitize-thread', 'Unix Makefiles'), + Toolchain('sanitize-thread-cxx17', 'Unix Makefiles'), + Toolchain('sanitize-thread-cxx17-pic', 'Unix Makefiles'), + Toolchain('arm-openwrt-linux-muslgnueabi', 'Unix Makefiles'), + Toolchain('openbsd-egcc-cxx11-static-std', 'Unix Makefiles'), + ] + +def get_by_name(name): + for x in toolchain_table: + if name == x.name: + return x + sys.exit('Internal error: toolchain not found in toolchain table') diff --git a/tools/polly/bin/detail/util.py b/tools/polly/bin/detail/util.py new file mode 100755 index 0000000..4b48a10 --- /dev/null +++ b/tools/polly/bin/detail/util.py @@ -0,0 +1,40 @@ +import sys +import subprocess + +def get_environment_from_batch_command(env_cmd, initial=None): + """ + Take a command (either a single command or list of arguments) + and return the environment created after running that command. + Note that if the command must be a batch file or .cmd file, or the + changes to the environment will not be captured. + + If initial is supplied, it is used as the initial environment passed + to the child process. + """ + if not isinstance(env_cmd, (list, tuple)): + env_cmd = [env_cmd] + # construct the command that will alter the environment + env_cmd = subprocess.list2cmdline(env_cmd) + # create a tag so we can tell in the output when the proc is done + tag = 'Done running command' + # construct a cmd.exe command to do accomplish this + cmd = 'cmd.exe /s /c "{env_cmd} && echo "{tag}" && set"'.format(**vars()) + # launch the process + output = subprocess.check_output(cmd, universal_newlines=True) + list_of_output = output.split('\n') + result = dict() + is_environment = False + for i in list_of_output: + if not is_environment: + if i == '"{}" '.format(tag): + is_environment = True + continue + if not i: + continue + eq_index = i.find('=') + if eq_index == -1: + sys.exit('Expected `=`') + var_name = i[0:eq_index] + var_value = i[eq_index + 1:] + result[var_name] = var_value + return result diff --git a/tools/polly/bin/detail/verify_mingw_path.py b/tools/polly/bin/detail/verify_mingw_path.py new file mode 100644 index 0000000..c7589df --- /dev/null +++ b/tools/polly/bin/detail/verify_mingw_path.py @@ -0,0 +1,21 @@ +# Copyright (c) 2014, Ruslan Baratov +# All rights reserved. + +import os +import sys + +def verify(mingw_path): + if not mingw_path: + sys.exit( + "Please set environment variable MINGW_PATH " + "to directory with mingw32-make.exe" + ) + if not os.path.isdir(mingw_path): + sys.exit("MINGW_PATH({}) is not a directory".format(mingw_path)) + + mingw_make = os.path.join(mingw_path, 'mingw32-make.exe') + if not os.path.isfile(mingw_make): + sys.exit( + "File mingw32-make.exe not found in " + "directory `{}` (MINGW_PATH environment variable)".format(mingw_path) + ) diff --git a/tools/polly/bin/detail/verify_msys_path.py b/tools/polly/bin/detail/verify_msys_path.py new file mode 100644 index 0000000..6e95629 --- /dev/null +++ b/tools/polly/bin/detail/verify_msys_path.py @@ -0,0 +1,28 @@ +# Copyright (c) 2014, Ruslan Baratov +# All rights reserved. + +import os +import sys + +def verify(msys_path): + if not msys_path: + sys.exit( + "Please set environment variable MSYS_PATH " + "to directory with make.exe" + ) + make_found = False + for path in msys_path.split(';'): + if not os.path.isdir(path): + sys.exit( + "One of the MSYS_PATH components is not a directory: {} ". + format(path) + ) + msys_make = os.path.join(path, 'make.exe') + if os.path.isfile(msys_make): + make_found = True + + if not make_found: + sys.exit( + "File make.exe not found in " + "directories `{}` (MSYS_PATH environment variable)".format(msys_path) + ) diff --git a/tools/polly/bin/detail/win32.py b/tools/polly/bin/detail/win32.py new file mode 100755 index 0000000..c1d3677 --- /dev/null +++ b/tools/polly/bin/detail/win32.py @@ -0,0 +1,20 @@ +import ctypes +from ctypes import wintypes + +_GetShortPathNameW = ctypes.windll.kernel32.GetShortPathNameW +_GetShortPathNameW.argtypes = [wintypes.LPCWSTR, wintypes.LPWSTR, wintypes.DWORD] +_GetShortPathNameW.restype = wintypes.DWORD + +def get_short_path_name(long_name): + """ + Gets the short path name of a given long path. + http://stackoverflow.com/a/23598461/200291 + """ + output_buf_size = 0 + while True: + output_buf = ctypes.create_unicode_buffer(output_buf_size) + needed = _GetShortPathNameW(long_name, output_buf, output_buf_size) + if output_buf_size >= needed: + return output_buf.value + else: + output_buf_size = needed diff --git a/tools/polly/bin/install-ci-dependencies.py b/tools/polly/bin/install-ci-dependencies.py new file mode 100755 index 0000000..0ff6064 --- /dev/null +++ b/tools/polly/bin/install-ci-dependencies.py @@ -0,0 +1,279 @@ +#!/usr/bin/env python3 + +# Copyright (c) 2016, Ruslan Baratov +# All rights reserved. + +import argparse +import hashlib +import os +import platform +import requests +import shutil +import stat +import subprocess +import sys +import tarfile +import tempfile +import time +import zipfile + +print( + 'Python version: {}.{}'.format( + sys.version_info.major, sys.version_info.minor + ) +) + +parser = argparse.ArgumentParser( + description='Install dependencies for CI testing' +) + +parser.add_argument( + '--prune-archives', + action='store_true', + help="Remove downloaded archives after unpack finished" +) + +args = parser.parse_args() + +class FileToDownload: + def __init__(self, url, sha1, local_path, unpack_dir): + self.url = url + self.sha1 = sha1 + self.local_path = local_path + self.unpack_dir = unpack_dir + + self.download() + self.unpack() + + def download(self): + ok = self.hash_match() + if ok: + print('File already downloaded: {}'.format(self.local_path)) + else: + self.real_file_download() + assert(self.hash_match() == True) + + def hash_match(self): + if not os.path.exists(self.local_path): + print('File not exists: {}'.format(self.local_path)) + return False + sha1_of_file = hashlib.sha1(open(self.local_path, 'rb').read()).hexdigest() + ok = (sha1_of_file == self.sha1) + if ok: + return True + else: + print('SHA1 mismatch for file {}:'.format(self.local_path)) + print(' {} (real)'.format(sha1_of_file)) + print(' {} (expected)'.format(self.sha1)) + return False + + def real_file_download(self): + max_retry = 3 + for i in range(max_retry): + try: + self.real_file_download_once() + print('Done') + return + except Exception as exc: + print('Exception catched ({}), retry... ({} of {})'.format(exc, i+1, max_retry)) + time.sleep(60) + sys.exit('Download failed') + + # http://stackoverflow.com/a/16696317/2288008 + def real_file_download_once(self): + print('Downloading:\n {}\n -> {}'.format(self.url, self.local_path)) + r = requests.get(self.url, stream=True) + if not r.ok: + raise Exception('Downloading failed: {}'.format(self.url)) + with open(self.local_path, 'wb') as f: + for chunk in r.iter_content(chunk_size=16*1024): + if chunk: + f.write(chunk) + + def unpack(self): + print('Unpacking {}'.format(self.local_path)) + last_cwd = os.getcwd() + os.chdir(self.unpack_dir) + if self.url.endswith('.tar.gz'): + tar_archive = tarfile.open(self.local_path) + tar_archive.extractall(path=self.unpack_dir) + tar_archive.close() + elif self.url.endswith('.zip'): + # Can't use ZipFile module because permissions will be lost, see bug: + # * https://bugs.python.org/issue15795 + w = tempfile.NamedTemporaryFile() + subprocess.check_call(['unzip', self.local_path], stdout=w, stderr=w, bufsize=0) + elif self.url.endswith('.bin'): + os.chmod(self.local_path, os.stat(self.local_path).st_mode | stat.S_IEXEC) + devnull = open(os.devnull, 'w') # subprocess.DEVNULL is not available for Python 3.2 + subprocess.check_call(self.local_path, stdout=devnull) + else: + sys.exit('Unknown archive format') + os.chdir(last_cwd) + if args.prune_archives: + print('Removing {}'.format(self.local_path)) + os.remove(self.local_path) + +### Parse toolchain name + +toolchain = os.getenv('TOOLCHAIN') +if toolchain is None: + toolchain = '' + print('** WARNING ** Environment variable TOOLCHAIN is empty') + +def get_android_full_version_url(): + if toolchain.startswith('android-ndk-r10e-'): + if platform.system() == 'Darwin': + return 'http://dl.google.com/android/ndk/android-ndk-r10e-darwin-x86_64.bin', 'b57c2b9213251180dcab794352bfc9a241bf2557', + if platform.system() == 'Linux': + return 'http://dl.google.com/android/ndk/android-ndk-r10e-linux-x86_64.bin', 'c685e5f106f8daa9b5449d0a4f21ee8c0afcb2f6', + + if toolchain.startswith('android-ndk-r11c-'): + if platform.system() == 'Darwin': + return 'http://dl.google.com/android/repository/android-ndk-r11c-darwin-x86_64.zip', '4ce8e7ed8dfe08c5fe58aedf7f46be2a97564696', + if platform.system() == 'Linux': + return 'http://dl.google.com/android/repository/android-ndk-r11c-linux-x86_64.zip', 'de5ce9bddeee16fb6af2b9117e9566352aa7e279', + + if toolchain.startswith('android-ndk-r15c-'): + if platform.system() == 'Darwin': + return 'https://dl.google.com/android/repository/android-ndk-r15c-darwin-x86_64.zip', 'ea4b5d76475db84745aa8828000d009625fc1f98', + if platform.system() == 'Linux': + return 'https://dl.google.com/android/repository/android-ndk-r15c-linux-x86_64.zip', '0bf02d4e8b85fd770fd7b9b2cdec57f9441f27a2', + + if toolchain.startswith('android-ndk-r16b-'): + if platform.system() == 'Darwin': + return 'https://dl.google.com/android/repository/android-ndk-r16b-darwin-x86_64.zip', 'e51e615449b98c716cf912057e2682e75d55e2de', + if platform.system() == 'Linux': + return 'https://dl.google.com/android/repository/android-ndk-r16b-linux-x86_64.zip', '42aa43aae89a50d1c66c3f9fdecd676936da6128', + + if toolchain.startswith('android-ndk-r17-'): + if platform.system() == 'Darwin': + return 'https://dl.google.com/android/repository/android-ndk-r17-darwin-x86_64.zip', '08015290bf88ba8fb348d7f5380929c2106524b3', + if platform.system() == 'Linux': + return 'https://dl.google.com/android/repository/android-ndk-r17-linux-x86_64.zip', '1d886a64483adf3f3a3e3aaf7ac5084184006ac7', + + sys.exit('Android supported only for Linux and OSX') + +def get_android_url(): + if not os.getenv('TRAVIS'): + return get_android_full_version_url() + if toolchain == 'android-ndk-r10e-api-19-armeabi-v7a-neon': + if platform.system() == 'Linux': + return 'https://github.com/hunter-packages/android-ndk/releases/download/v1.0.0/android-ndk-r10e-arm-linux-androideabi-4.9-gnu-libstdc.-4.9-armeabi-v7a-android-19-arch-arm-Linux.tar.gz', '847177799b0fe4f7480f910bbf1815c3e3fed0da' + if platform.system() == 'Darwin': + return 'https://github.com/hunter-packages/android-ndk/releases/download/v1.0.0/android-ndk-r10e-arm-linux-androideabi-4.9-gnu-libstdc.-4.9-armeabi-v7a-android-19-arch-arm-Darwin.tar.gz', 'e568e9a8f562e7d1bc06f93e6f7cc7f44df3ded2' + if toolchain == 'android-ndk-r11c-api-19-armeabi-v7a-neon': + if platform.system() == 'Linux': + return 'https://github.com/hunter-packages/android-ndk/releases/download/v1.0.1/android-ndk-r11c-arm-linux-androideabi-4.9-gnu-libstdc.-4.9-armeabi-v7a-android-19-arch-arm-Linux.tar.gz', '2e0da01961e0031bfd7d8db6ce4a15372bd8c3e8' + if platform.system() == 'Darwin': + return 'https://github.com/hunter-packages/android-ndk/releases/download/v1.0.1/android-ndk-r11c-arm-linux-androideabi-4.9-gnu-libstdc.-4.9-armeabi-v7a-android-19-arch-arm-Darwin.tar.gz', '664b3c8104142de2af16f887c19d1b2e618725cb' + if toolchain == 'android-ndk-r15c-api-21-armeabi-v7a-neon-clang-libcxx': + if platform.system() == 'Linux': + return 'https://github.com/hunter-packages/android-ndk/releases/download/v1.0.1/android-ndk-r15c-arm-linux-androideabi-4.9-llvm-libc.-android-21-arch-arm-Linux.tar.gz', '952403abedc3960b6d6eee35aeed940d935baaea' + if platform.system() == 'Darwin': + return 'https://github.com/hunter-packages/android-ndk/releases/download/v1.0.1/android-ndk-r15c-arm-linux-androideabi-4.9-llvm-libc.-android-21-arch-arm-Darwin.tar.gz', '978ef8b724dc3691a128d8f48a8440172478d82b' + if toolchain == 'android-ndk-r16b-api-24-armeabi-v7a-neon-clang-libcxx': + if platform.system() == 'Linux': + return 'https://github.com/hunter-packages/android-ndk/releases/download/v1.0.1/android-ndk-r16b-arm-linux-androideabi-4.9-llvm-libc.-android-24-arch-arm-Linux.tar.gz', 'b9ee32e31376fd5fe090172169f14faf50af6b68' + + if toolchain == 'android-ndk-r16b-api-24-arm64-v8a-clang-libcxx14': + if platform.system() == 'Linux': + return 'https://github.com/hunter-packages/android-ndk/releases/download/v1.0.1/android-ndk-r16b-aarch64-linux-android-4.9-llvm-libc.-android-24-arch-arm64-Linux.tar.gz', 'b897dcb942df95ffb5903e181d5a2e27706c41f3' + + if toolchain == 'android-ndk-r17-api-24-arm64-v8a-clang-libcxx14': + if platform.system() == 'Linux': + return 'https://github.com/hunter-packages/android-ndk/releases/download/v1.0.2/android-ndk-r17-aarch64-linux-android-4.9-llvm-libc.-android-24-arch-arm64-Linux.tar.gz', 'ebc3a849efcd056d8e8362b9cc2e46b5efd78df6' + + return get_android_full_version_url() + +def get_cmake_url(): + if platform.system() == 'Darwin': + return ( + 'https://github.com/ruslo/CMake/releases/download/v3.13.2/cmake-3.13.2-Darwin-x86_64.tar.gz', + 'c05a2cd2977916e41989808c5061f7b00ac17b7b' + ) + elif platform.system() == 'Linux': + return ( + 'https://github.com/ruslo/CMake/releases/download/v3.13.2/cmake-3.13.2-Linux-x86_64.tar.gz', + 'd5c0aeebc8e313f3e61ec9198059e66f8cd4c3c6' + ) + elif platform.system() == 'Windows': + return ( + 'https://github.com/ruslo/CMake/releases/download/v3.13.2/cmake-3.13.2-win64-x64.zip', + 'f02a6b816d0deb7f8c29dc22c86a233fc418eb8f' + ) + else: + sys.exit('Unknown system: {}'.format(platform.system())) + +is_android = toolchain.startswith('android-') +is_ninja = toolchain.startswith('ninja-') + +### Prepare directories + +ci_dir = os.path.join(os.getcwd(), '_ci') + +if not os.path.exists(ci_dir): + os.mkdir(ci_dir) + +cmake_url, cmake_sha1 = get_cmake_url() +cmake_archive_local = cmake_url.split('/')[-1] +cmake_archive_local = os.path.join(ci_dir, cmake_archive_local) + +ninja_archive_local = os.path.join(ci_dir, 'ninja.zip') + +if is_android: + url, sha1 = get_android_url() + android_archive_local = url.split('/')[-1] +else: + android_archive_local = 'android.bin' +android_archive_local = os.path.join(ci_dir, android_archive_local) + +expected_files = [ + cmake_archive_local, android_archive_local, ninja_archive_local +] + +for i in os.listdir(ci_dir): + dir_item = os.path.join(ci_dir, i) + expected = (dir_item in expected_files) + if os.path.isdir(dir_item): + print('Removing directory: {}'.format(dir_item)) + shutil.rmtree(dir_item) + elif not expected: + print('Removing file: {}'.format(dir_item)) + os.remove(dir_item) + +cmake_dir = os.path.join(ci_dir, 'cmake') +ninja_dir = os.path.join(ci_dir, 'ninja') + +### Downloading files + +# https://cmake.org/download/ + +FileToDownload(cmake_url, cmake_sha1, cmake_archive_local, ci_dir) + +if is_android: + url, sha1 = get_android_url() + FileToDownload(url, sha1, android_archive_local, ci_dir) + +if is_ninja: + ninja = FileToDownload( + 'https://github.com/ninja-build/ninja/releases/download/v1.8.2/ninja-win.zip', + '637cc6e144f5cc7c6388a30f3c32ad81b2e0442e', + ninja_archive_local, + ci_dir + ) + +### Unify directories + +for i in os.listdir(ci_dir): + src = os.path.join(ci_dir, i) + if i.startswith('cmake') and os.path.isdir(src): + macosx_contents = os.path.join(src, 'CMake.app', 'Contents') + if os.path.isdir(macosx_contents): + os.rename(macosx_contents, cmake_dir) + else: + os.rename(src, cmake_dir) + + if i == 'ninja.exe': + os.mkdir(ninja_dir) + os.rename(src, os.path.join(ninja_dir, i)) diff --git a/tools/polly/bin/polly b/tools/polly/bin/polly new file mode 100755 index 0000000..575f8f9 --- /dev/null +++ b/tools/polly/bin/polly @@ -0,0 +1,7 @@ +#!/usr/bin/env python3 + +from os.path import realpath, dirname, join +from sys import argv + +polly_py = join(dirname(realpath(argv[0])), 'polly.py') +exec(open(polly_py, 'r').read()) diff --git a/tools/polly/bin/polly.bat b/tools/polly/bin/polly.bat new file mode 100644 index 0000000..89e266f --- /dev/null +++ b/tools/polly/bin/polly.bat @@ -0,0 +1 @@ +python %~dp0\\polly.py %* diff --git a/tools/polly/bin/polly.py b/tools/polly/bin/polly.py new file mode 100755 index 0000000..9d817f4 --- /dev/null +++ b/tools/polly/bin/polly.py @@ -0,0 +1,547 @@ +#!/usr/bin/env python3 + +# Copyright (c) 2014-2015, Ruslan Baratov +# All rights reserved. + +import argparse +import os +import platform +import shutil +import sys + +import detail.call +import detail.cpack_generator +import detail.create_archive +import detail.create_framework +import detail.generate_command +import detail.get_nmake_environment +import detail.ios_dev_root +import detail.logging +import detail.open_project +import detail.osx_dev_root +import detail.pack_command +import detail.rmtree +import detail.target +import detail.test_command +import detail.timer +import detail.toolchain_name +import detail.toolchain_table +import detail.verify_mingw_path +import detail.verify_msys_path + +toolchain_table = detail.toolchain_table.toolchain_table + +assert(sys.version_info.major == 3) +assert(sys.version_info.minor >= 2) # Current cygwin version is 3.2.3 + +print( + 'Python version: {}.{}'.format( + sys.version_info.major, sys.version_info.minor + ) +) + +description=""" +Script for building. Available toolchains:\n +""" + +for x in toolchain_table: + description += ' ' + x.name + '\n' + +parser = argparse.ArgumentParser( + formatter_class=argparse.RawDescriptionHelpFormatter, + description=description +) + +parser.add_argument( + '--toolchain', + choices=[x.name for x in toolchain_table], + help="CMake generator/toolchain", +) + +parser.add_argument( + '--config', + help="CMake build type (Release, Debug, ...)", +) + +parser.add_argument( + '--keep-going', + action='store_true', + help="Continue as much as possible after an error. see make -k" +) + +parser.add_argument( + '--config-all', + help="CMake build type for project and hunter packages: --config --fwd HUNTER_CONFIGURATION_TYPES=", +) + +parser.add_argument( + '--home', + help="Project home directory (directory with CMakeLists.txt)" +) + +parser.add_argument( + '--output', + help="Project build directory (i.e., cmake -B)" +) + +parser.add_argument( + '--cache', + help="CMake -C = Pre-load a script to populate the cache." +) + +parser.add_argument('--test', action='store_true', help="Run ctest after build") +parser.add_argument('--test-xml', help="Save ctest output to xml") + +parser.add_argument( + '--pack', + choices=detail.cpack_generator.available_generators, + nargs='?', + const=detail.cpack_generator.default(), + help="Run cpack after build" +) +parser.add_argument( + '--archive', + help="Create an archive of locally installed files" +) +parser.add_argument( + '--nobuild', action='store_true', help="Do not build (only generate)" +) +parser.add_argument( + '--open', action='store_true', help="Open generated project (for IDE)" +) + +verbosity_group=parser.add_mutually_exclusive_group() +verbosity_group.add_argument( + '--verbosity-level', dest='verbosity', help="Verbosity level", + choices=['silent', 'normal', 'full'], default='normal' +) +verbosity_group.add_argument('--verbose', action='store_true', help="Full verbose output") + +parser.add_argument( + '--install', action='store_true', help="Run install (local directory)" +) +parser.add_argument( + '--ios-multiarch', + action='store_true', + help="Build multi-architecture binary (effectively add CMAKE_XCODE_ATTRIBUTE_ONLY_ACTIVE_ARCH=NO)" +) +parser.add_argument( + '--ios-combined', + action='store_true', + help="Combine iOS simulator and device libraries on install (effectively add CMAKE_IOS_INSTALL_COMBINED=YES)" +) +parser.add_argument( + '--framework', action='store_true', help="Create framework" +) +parser.add_argument( + '--framework-device', + action='store_true', + help="Create framework for device (exclude simulator architectures)" +) +parser.add_argument( + '--framework-lib', + default='*', + help="Regular expression for the source library used for --framework" +) +parser.add_argument( + '--strip', action='store_true', help="Run strip/install cmake targets" +) +parser.add_argument( + '--identity', + help="Specify code signing identity for --framework" +) +parser.add_argument( + '--plist', + help="User specified Info.plist file for --framework" +) +parser.add_argument( + '--clear', + action='store_true', + help="Remove build and install dirs before build" +) +parser.add_argument( + '--reconfig', + action='store_true', + help="Run configure even if CMakeCache.txt exists. Used to add new args." +) +parser.add_argument( + '--fwd', + nargs='*', + help="Arguments to cmake without '-D', like:\nBOOST_ROOT=/some/path" +) +parser.add_argument( + '--iossim', + action='store_true', + help="Build for ios i386 simulator" +) + +parser.add_argument( + '--jobs', + type=int, + help="Number of concurrent build operations" +) + +parser.add_argument( + '--target', + help="Target to build for the 'cmake --build' command" +) + +def PositiveInt(string): + value = int(string) + if value > 0: + return value + m = 'Should be greater that zero: {}'.format(string) + raise argparse.ArgumentTypeError(m) + +parser.add_argument( + '--discard', + type=PositiveInt, + help='Option to reduce output. Discard every N lines of execution messages' + ' (note that full log is still available in log.txt)' +) + +parser.add_argument( + '--tail', + type=PositiveInt, + help='Print last N lines if build failed' +) + +parser.add_argument( + '--timeout', + type=PositiveInt, + help='Timeout for CTest' +) + +parser.add_argument( + '--cmake', + help="CMake binary (cmake or cmake3)" +) + +parser.add_argument( + '--cpack', + help="CPack binary (cpack or cpack3)" +) + +parser.add_argument( + '--ctest', + help="CTest binary (ctest or ctest3)" +) + +args = parser.parse_args() + +polly_toolchain = detail.toolchain_name.get(args.toolchain) +toolchain_entry = detail.toolchain_table.get_by_name(polly_toolchain) +cpack_generator = args.pack + +polly_root = os.path.join(os.path.dirname(os.path.realpath(__file__)), '..') +polly_root = os.path.realpath(polly_root) + +if args.config and args.config_all: + sys.exit('Must specify --config or --config-all but not both') + +if args.config_all: + args.config = args.config_all + +"""Build directory tag""" +if args.config and not toolchain_entry.multiconfig: + build_tag = "{}-{}".format(polly_toolchain, args.config) +else: + build_tag = polly_toolchain + +"""Tune environment""" +if toolchain_entry.name.startswith('mingw'): + mingw_path = os.getenv("MINGW_PATH") + detail.verify_mingw_path.verify(mingw_path) + os.environ['PATH'] = "{};{}".format(mingw_path, os.getenv('PATH')) + +if toolchain_entry.name.startswith('msys'): + msys_path = os.getenv("MSYS_PATH") + detail.verify_msys_path.verify(msys_path) + os.environ['PATH'] = "{};{}".format(msys_path, os.getenv('PATH')) + +vs_ninja = toolchain_entry.is_ninja and toolchain_entry.vs_version +if toolchain_entry.is_nmake or vs_ninja: + os.environ = detail.get_nmake_environment.get( + toolchain_entry.arch, toolchain_entry.vs_version + ) + +if toolchain_entry.ios_version: + ios_dev_root = detail.ios_dev_root.get(toolchain_entry.ios_version) + if ios_dev_root: + print("Set environment DEVELOPER_DIR to {}".format(ios_dev_root)) + os.environ['DEVELOPER_DIR'] = ios_dev_root + +if toolchain_entry.nocodesign: + xcconfig = os.path.join(polly_root, 'scripts', 'NoCodeSign.xcconfig') + print("Set environment XCODE_XCCONFIG_FILE to {}".format(xcconfig)) + os.environ['XCODE_XCCONFIG_FILE'] = xcconfig + +if toolchain_entry.osx_version: + osx_dev_root = detail.osx_dev_root.get(toolchain_entry.osx_version) + if osx_dev_root: + print("Set environment DEVELOPER_DIR to {}".format(osx_dev_root)) + os.environ['DEVELOPER_DIR'] = osx_dev_root + +toolchain_path = os.path.join(polly_root, "{}.cmake".format(polly_toolchain)) +if not os.path.exists(toolchain_path): + sys.exit("Toolchain file not found: {}".format(toolchain_path)) +toolchain_option = "-DCMAKE_TOOLCHAIN_FILE={}".format(toolchain_path) + +if args.output: + if not os.path.isdir(args.output): + sys.exit("Specified build directory does not exist: {}".format(args.output)) + if not os.access(args.output, os.W_OK): + sys.exit("Specified build directory is not writeable: {}".format(args.output)) + cdir = args.output +else: + cdir = os.getcwd() + +build_dir = os.path.join(cdir, '_builds', build_tag) +print("Build dir: {}".format(build_dir)) +build_dir_option = "-B{}".format(build_dir) + +install_dir = os.path.join(cdir, '_install', polly_toolchain) +local_install = args.install or args.strip or args.framework or args.framework_device or args.archive + +if args.install and args.strip: + sys.exit('Both --install and --strip specified') + +if args.strip: + install_target_name = 'install/strip' +elif local_install: + install_target_name = 'install' +else: + install_target_name = '' # not used + +target = detail.target.Target() + +target.add(condition=local_install, name=install_target_name) +target.add(condition=args.target, name=args.target) + +# After 'target.add' +if args.strip and not toolchain_entry.is_make: + sys.exit('CMake install/strip targets are only supported for the Unix Makefile generator') + +if local_install: + install_dir_option = "-DCMAKE_INSTALL_PREFIX={}".format(install_dir) + +if (args.framework or args.framework_device) and platform.system() != 'Darwin': + sys.exit('Framework creation only for Mac OS X') +framework_dir = os.path.join(cdir, '_framework', polly_toolchain) +archives_dir = os.path.join(cdir, '_archives') + +if args.clear: + detail.rmtree.rmtree(build_dir) + detail.rmtree.rmtree(install_dir) + detail.rmtree.rmtree(framework_dir) + +# --verbose flag triggers full verbosity level +if args.verbose: + args.verbosity='full' + +polly_temp_dir = os.path.join(build_dir, '_3rdParty', 'polly') +if not os.path.exists(polly_temp_dir): + os.makedirs(polly_temp_dir) +logging = detail.logging.Logging( + cdir, args.verbosity, args.discard, args.tail, polly_toolchain +) + +if args.cmake: + cmake_bin = args.cmake +else: + cmake_bin = 'cmake' + +if os.path.isabs(cmake_bin): + if not os.path.exists(cmake_bin): + sys.exit("CMake binary not found: {}".format(cmake_bin)) +else: + if os.name == 'nt': + # Windows + detail.call.call(['where', cmake_bin], logging) + else: + detail.call.call(['which', cmake_bin], logging) +detail.call.call([cmake_bin, '--version'], logging) + +home = '.' +if args.home: + home = args.home + +generate_command = [ + cmake_bin, + '-H{}'.format(home), + build_dir_option +] + +if args.cache: + if not os.path.isfile(args.cache): + sys.exit("Specified cache file does not exist: {}".format(args.cache)) + if not os.access(args.cache, os.R_OK): + sys.exit("Specified cache file is not readable: {}".format(args.cache)) + generate_command.append("-C{}".format(args.cache)) + +if (args.config and not toolchain_entry.multiconfig) or args.config_all: + generate_command.append("-DCMAKE_BUILD_TYPE={}".format(args.config)) + +if toolchain_entry.generator: + generate_command.append('-G{}'.format(toolchain_entry.generator)) + +if toolchain_entry.toolset: + generate_command.append('-T{}'.format(toolchain_entry.toolset)) + +if toolchain_entry.xp: + toolset = 'v{}0_xp'.format(toolchain_entry.vs_version) + generate_command.append('-T{}'.format(toolset)) + +if toolchain_option: + generate_command.append(toolchain_option) + +if args.verbosity == 'full': + generate_command.append('-DCMAKE_VERBOSE_MAKEFILE=ON') + generate_command.append('-DPOLLY_STATUS_DEBUG=ON') + generate_command.append('-DHUNTER_STATUS_DEBUG=ON') + +if args.ios_multiarch: + generate_command.append('-DCMAKE_XCODE_ATTRIBUTE_ONLY_ACTIVE_ARCH=NO') + +if args.ios_combined: + generate_command.append('-DCMAKE_IOS_INSTALL_COMBINED=YES') + +if local_install: + generate_command.append(install_dir_option) + +if cpack_generator: + generate_command.append('-DCPACK_GENERATOR={}'.format(cpack_generator)) + +if args.fwd != None: + for x in args.fwd: + generate_command.append("-D{}".format(x)) + +if args.config_all: + generate_command.append("-DHUNTER_CONFIGURATION_TYPES={}".format(args.config_all)) + +timer = detail.timer.Timer() + +timer.start('Generate') +detail.generate_command.run( + generate_command, build_dir, polly_temp_dir, args.reconfig, logging +) +timer.stop() + +build_command = [ + cmake_bin, + '--build', + build_dir +] + +if args.config: + build_command.append('--config') + build_command.append(args.config) + +build_command += target.args() + +# NOTE: This must be the last `build_command` modification! +build_command.append('--') + +if args.iossim: + build_command.append('-arch') + build_command.append('i386') + build_command.append('-sdk') + build_command.append('iphonesimulator') + +if args.jobs: + if toolchain_entry.is_xcode: + build_command.append('-jobs') + build_command.append('{}'.format(args.jobs)) + elif toolchain_entry.is_make and not toolchain_entry.is_nmake: + build_command.append('-j') + build_command.append('{}'.format(args.jobs)) + elif toolchain_entry.is_msvc and (int(toolchain_entry.vs_version) >= 12): + build_command.append('/maxcpucount:{}'.format(args.jobs)) + +if args.keep_going: + if toolchain_entry.is_make: + build_command.append('-k') ## keep going + +if not args.nobuild: + timer.start('Build') + + if toolchain_entry.is_xcode: + # Workaround for https://gitlab.kitware.com/cmake/cmake/issues/17851 + zero_check_command = [ + cmake_bin, + '--build', + build_dir, + '--target', + 'ZERO_CHECK' + ] + detail.call.call(zero_check_command, logging, sleep=1) + + detail.call.call(build_command, logging, sleep=1) + timer.stop() + + if args.archive: + timer.start('Archive creation') + detail.create_archive.run( + install_dir, + archives_dir, + args.archive, + toolchain_entry.name, + args.config + ) + timer.stop() + + if args.framework or args.framework_device: + timer.start('Framework creation') + detail.create_framework.run( + install_dir, + framework_dir, + toolchain_entry.ios_version, + polly_root, + args.framework_device, + logging, + args.plist, + args.identity, + args.framework_lib + ) + timer.stop() + +if not args.nobuild: + os.chdir(build_dir) + if args.test or args.test_xml: + timer.start('Test') + + if args.ctest: + ctest_bin = args.ctest + else: + ctest_bin = 'ctest' + + if os.path.isabs(ctest_bin): + if not os.path.exists(ctest_bin): + sys.exit("Ctest binary not found: {}".format(ctest_bin)) + + detail.test_command.run(build_dir, args.config, logging, args.test_xml, args.verbosity == 'full', args.timeout, ctest_bin) + timer.stop() + if args.pack: + timer.start('Pack') + + if args.cpack: + cpack_bin = args.cpack + else: + cpack_bin = 'cpack' + + if os.path.isabs(cpack_bin): + if not os.path.exists(cpack_bin): + sys.exit("CPack binary not found: {}".format(cpack_bin)) + + detail.pack_command.run(args.config, logging, cpack_generator, cpack_bin, cmake_bin) + timer.stop() + +if args.open: + detail.open_project.open(toolchain_entry, build_dir, logging) + +print('-') +print('Log saved: {}'.format(logging.log_path)) +print('-') +timer.result() +print('-') +print('SUCCESS') diff --git a/tools/polly/clang-5-cxx14.cmake b/tools/polly/clang-5-cxx14.cmake new file mode 100644 index 0000000..6a7a598 --- /dev/null +++ b/tools/polly/clang-5-cxx14.cmake @@ -0,0 +1,21 @@ +# Copyright (c) 2016-2017, Ruslan Baratov +# Copyright (c) 2017, David Hirvonen +# All rights reserved. + +if(DEFINED POLLY_CLANG_5_CXX14_CMAKE_) + return() +else() + set(POLLY_CLANG_5_CXX14_CMAKE_ 1) +endif() + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_init.cmake") + +polly_init( + "clang 5 / c++14 support" + "Unix Makefiles" +) + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_common.cmake") + +include("${CMAKE_CURRENT_LIST_DIR}/compiler/clang-5.cmake") +include("${CMAKE_CURRENT_LIST_DIR}/flags/cxx14.cmake") diff --git a/tools/polly/clang-5-cxx17.cmake b/tools/polly/clang-5-cxx17.cmake new file mode 100644 index 0000000..c979522 --- /dev/null +++ b/tools/polly/clang-5-cxx17.cmake @@ -0,0 +1,21 @@ +# Copyright (c) 2016-2017, Ruslan Baratov +# Copyright (c) 2017, David Hirvonen +# All rights reserved. + +if(DEFINED POLLY_CLANG_5_CXX17_CMAKE_) + return() +else() + set(POLLY_CLANG_5_CXX17_CMAKE_ 1) +endif() + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_init.cmake") + +polly_init( + "clang 5 / c++17 support" + "Unix Makefiles" +) + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_common.cmake") + +include("${CMAKE_CURRENT_LIST_DIR}/compiler/clang-5.cmake") +include("${CMAKE_CURRENT_LIST_DIR}/flags/cxx17.cmake") diff --git a/tools/polly/clang-5.cmake b/tools/polly/clang-5.cmake new file mode 100644 index 0000000..1d4db43 --- /dev/null +++ b/tools/polly/clang-5.cmake @@ -0,0 +1,21 @@ +# Copyright (c) 2016-2017, Ruslan Baratov +# Copyright (c) 2017, David Hirvonen +# All rights reserved. + +if(DEFINED POLLY_CLANG_5_CMAKE_) + return() +else() + set(POLLY_CLANG_5_CMAKE_ 1) +endif() + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_init.cmake") + +polly_init( + "clang 5 / c++11 support" + "Unix Makefiles" +) + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_common.cmake") + +include("${CMAKE_CURRENT_LIST_DIR}/compiler/clang-5.cmake") +include("${CMAKE_CURRENT_LIST_DIR}/flags/cxx11.cmake") diff --git a/tools/polly/clang-cxx14-pic.cmake b/tools/polly/clang-cxx14-pic.cmake new file mode 100644 index 0000000..ab3bfa9 --- /dev/null +++ b/tools/polly/clang-cxx14-pic.cmake @@ -0,0 +1,22 @@ +# Copyright (c) 2016-2018, Ruslan Baratov +# Copyright (c) 2017, David Hirvonen +# All rights reserved. + +if(DEFINED POLLY_CLANG_CXX14_PIC_CMAKE_) + return() +else() + set(POLLY_CLANG_CXX14_PIC_CMAKE_ 1) +endif() + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_init.cmake") + +polly_init( + "clang / c++14 support / PIC" + "Unix Makefiles" +) + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_common.cmake") + +include("${CMAKE_CURRENT_LIST_DIR}/compiler/clang.cmake") +include("${CMAKE_CURRENT_LIST_DIR}/flags/cxx14.cmake") +include("${CMAKE_CURRENT_LIST_DIR}/flags/fpic.cmake") diff --git a/tools/polly/clang-cxx14.cmake b/tools/polly/clang-cxx14.cmake new file mode 100644 index 0000000..b8e7716 --- /dev/null +++ b/tools/polly/clang-cxx14.cmake @@ -0,0 +1,21 @@ +# Copyright (c) 2016-2018, Ruslan Baratov +# Copyright (c) 2017, David Hirvonen +# All rights reserved. + +if(DEFINED POLLY_CLANG_CXX14_CMAKE_) + return() +else() + set(POLLY_CLANG_CXX14_CMAKE_ 1) +endif() + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_init.cmake") + +polly_init( + "clang / c++14 support" + "Unix Makefiles" +) + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_common.cmake") + +include("${CMAKE_CURRENT_LIST_DIR}/compiler/clang.cmake") +include("${CMAKE_CURRENT_LIST_DIR}/flags/cxx14.cmake") diff --git a/tools/polly/clang-cxx17.cmake b/tools/polly/clang-cxx17.cmake new file mode 100644 index 0000000..6edb96f --- /dev/null +++ b/tools/polly/clang-cxx17.cmake @@ -0,0 +1,21 @@ +# Copyright (c) 2016-2018, Ruslan Baratov +# Copyright (c) 2017, David Hirvonen +# All rights reserved. + +if(DEFINED POLLY_CLANG_CXX17_CMAKE_) + return() +else() + set(POLLY_CLANG_CXX17_CMAKE_ 1) +endif() + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_init.cmake") + +polly_init( + "clang / c++17 support" + "Unix Makefiles" +) + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_common.cmake") + +include("${CMAKE_CURRENT_LIST_DIR}/compiler/clang.cmake") +include("${CMAKE_CURRENT_LIST_DIR}/flags/cxx17.cmake") diff --git a/tools/polly/clang-fpic-hid-sections.cmake b/tools/polly/clang-fpic-hid-sections.cmake new file mode 100644 index 0000000..1059de9 --- /dev/null +++ b/tools/polly/clang-fpic-hid-sections.cmake @@ -0,0 +1,26 @@ +# Copyright (c) 2013, Ruslan Baratov +# Copyright (c) 2016, David Hirvonen +# All rights reserved. + +if(DEFINED POLLY_CLANG_FPIC_HID_SECTIONS_) + return() +else() + set(POLLY_CLANG_FPIC_HID_SECTIONS_ 1) +endif() + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_init.cmake") + +polly_init( + "clang / PIC / \ +c++11 support / hidden / data-sections / function-sections" + "Unix Makefiles" +) + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_common.cmake") + +include("${CMAKE_CURRENT_LIST_DIR}/compiler/clang.cmake") +include("${CMAKE_CURRENT_LIST_DIR}/flags/cxx11.cmake") +include("${CMAKE_CURRENT_LIST_DIR}/flags/function-sections.cmake") +include("${CMAKE_CURRENT_LIST_DIR}/flags/data-sections.cmake") +include("${CMAKE_CURRENT_LIST_DIR}/flags/hidden.cmake") +include("${CMAKE_CURRENT_LIST_DIR}/flags/fpic.cmake") diff --git a/tools/polly/clang-fpic-static-std.cmake b/tools/polly/clang-fpic-static-std.cmake new file mode 100644 index 0000000..d695f2a --- /dev/null +++ b/tools/polly/clang-fpic-static-std.cmake @@ -0,0 +1,25 @@ +# Copyright (c) 2013, Ruslan Baratov +# All rights reserved. + +if(DEFINED POLLY_CLANG_LIBSTDCXX_CMAKE) + return() +else() + set(POLLY_CLANG_LIBSTDCXX_CMAKE 1) +endif() + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_init.cmake") + +polly_init( + "clang / GNU Standard C++ Library (libstdc++) / c++11 support" + "Unix Makefiles" +) + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_common.cmake") + +include("${CMAKE_CURRENT_LIST_DIR}/compiler/clang.cmake") +include("${CMAKE_CURRENT_LIST_DIR}/library/std/libstdcxx.cmake") +include("${CMAKE_CURRENT_LIST_DIR}/flags/cxx11.cmake") +include("${CMAKE_CURRENT_LIST_DIR}/flags/fpic.cmake") +include("${CMAKE_CURRENT_LIST_DIR}/flags/static-std.cmake") + +include("${CMAKE_CURRENT_LIST_DIR}/os/osx.cmake") diff --git a/tools/polly/clang-fpic.cmake b/tools/polly/clang-fpic.cmake new file mode 100644 index 0000000..9a33c20 --- /dev/null +++ b/tools/polly/clang-fpic.cmake @@ -0,0 +1,24 @@ +# Copyright (c) 2013, Ruslan Baratov +# All rights reserved. + +if(DEFINED POLLY_CLANG_LIBSTDCXX_FPIC_CMAKE) + return() +else() + set(POLLY_CLANG_LIBSTDCXX_FPIC_CMAKE 1) +endif() + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_init.cmake") + +polly_init( + "clang / GNU Standard C++ Library (libstdc++) / c++11 support / Position-Independent Code" + "Unix Makefiles" +) + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_common.cmake") + +include("${CMAKE_CURRENT_LIST_DIR}/compiler/clang.cmake") +include("${CMAKE_CURRENT_LIST_DIR}/library/std/libstdcxx.cmake") +include("${CMAKE_CURRENT_LIST_DIR}/flags/cxx11.cmake") +include("${CMAKE_CURRENT_LIST_DIR}/flags/fpic.cmake") + +include("${CMAKE_CURRENT_LIST_DIR}/os/osx.cmake") diff --git a/tools/polly/clang-libcxx-fpic.cmake b/tools/polly/clang-libcxx-fpic.cmake new file mode 100644 index 0000000..c7b2264 --- /dev/null +++ b/tools/polly/clang-libcxx-fpic.cmake @@ -0,0 +1,24 @@ +# Copyright (c) 2013, Ruslan Baratov +# All rights reserved. + +if(DEFINED POLLY_CLANG_LIBCXX_FPIC_CMAKE) + return() +else() + set(POLLY_CLANG_LIBCXX_FPIC_CMAKE 1) +endif() + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_init.cmake") + +polly_init( + "clang / LLVM Standard C++ Library (libc++) / c++11 support / Position-Independent Code" + "Unix Makefiles" +) + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_common.cmake") + +include("${CMAKE_CURRENT_LIST_DIR}/compiler/clang.cmake") +include("${CMAKE_CURRENT_LIST_DIR}/library/std/libcxx.cmake") +include("${CMAKE_CURRENT_LIST_DIR}/flags/cxx11.cmake") +include("${CMAKE_CURRENT_LIST_DIR}/flags/fpic.cmake") + +include("${CMAKE_CURRENT_LIST_DIR}/os/osx.cmake") diff --git a/tools/polly/clang-libcxx.cmake b/tools/polly/clang-libcxx.cmake new file mode 100644 index 0000000..29b05ed --- /dev/null +++ b/tools/polly/clang-libcxx.cmake @@ -0,0 +1,23 @@ +# Copyright (c) 2013, Ruslan Baratov +# All rights reserved. + +if(DEFINED POLLY_CLANG_LIBCXX_CMAKE) + return() +else() + set(POLLY_CLANG_LIBCXX_CMAKE 1) +endif() + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_init.cmake") + +polly_init( + "clang / LLVM Standard C++ Library (libc++) / c++11 support" + "Unix Makefiles" +) + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_common.cmake") + +include("${CMAKE_CURRENT_LIST_DIR}/compiler/clang.cmake") +include("${CMAKE_CURRENT_LIST_DIR}/library/std/libcxx.cmake") +include("${CMAKE_CURRENT_LIST_DIR}/flags/cxx11.cmake") + +include("${CMAKE_CURRENT_LIST_DIR}/os/osx.cmake") diff --git a/tools/polly/clang-libcxx14-fpic.cmake b/tools/polly/clang-libcxx14-fpic.cmake new file mode 100644 index 0000000..8733d3e --- /dev/null +++ b/tools/polly/clang-libcxx14-fpic.cmake @@ -0,0 +1,24 @@ +# Copyright (c) 2013, Ruslan Baratov +# All rights reserved. + +if(DEFINED POLLY_CLANG_LIBCXX14_FPIC_CMAKE) + return() +else() + set(POLLY_CLANG_LIBCXX14_FPIC_CMAKE 1) +endif() + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_init.cmake") + +polly_init( + "clang / LLVM Standard C++ Library (libc++) / c++14 support / Position-Independent Code" + "Unix Makefiles" +) + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_common.cmake") + +include("${CMAKE_CURRENT_LIST_DIR}/compiler/clang.cmake") +include("${CMAKE_CURRENT_LIST_DIR}/library/std/libcxx.cmake") +include("${CMAKE_CURRENT_LIST_DIR}/flags/cxx14.cmake") +include("${CMAKE_CURRENT_LIST_DIR}/flags/fpic.cmake") + +include("${CMAKE_CURRENT_LIST_DIR}/os/osx.cmake") diff --git a/tools/polly/clang-libcxx14.cmake b/tools/polly/clang-libcxx14.cmake new file mode 100644 index 0000000..37fd84e --- /dev/null +++ b/tools/polly/clang-libcxx14.cmake @@ -0,0 +1,23 @@ +# Copyright (c) 2013, Ruslan Baratov +# All rights reserved. + +if(DEFINED POLLY_CLANG_LIBCXX14_CMAKE) + return() +else() + set(POLLY_CLANG_LIBCXX14_CMAKE 1) +endif() + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_init.cmake") + +polly_init( + "clang / LLVM Standard C++ Library (libc++) / c++14 support" + "Unix Makefiles" +) + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_common.cmake") + +include("${CMAKE_CURRENT_LIST_DIR}/compiler/clang.cmake") +include("${CMAKE_CURRENT_LIST_DIR}/library/std/libcxx.cmake") +include("${CMAKE_CURRENT_LIST_DIR}/flags/cxx14.cmake") + +include("${CMAKE_CURRENT_LIST_DIR}/os/osx.cmake") diff --git a/tools/polly/clang-libcxx17-fpic.cmake b/tools/polly/clang-libcxx17-fpic.cmake new file mode 100644 index 0000000..917c221 --- /dev/null +++ b/tools/polly/clang-libcxx17-fpic.cmake @@ -0,0 +1,24 @@ +# Copyright (c) 2013, Ruslan Baratov +# All rights reserved. + +if(DEFINED POLLY_CLANG_LIBCXX17_FPIC_CMAKE) + return() +else() + set(POLLY_CLANG_LIBCXX17_FPIC_CMAKE 1) +endif() + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_init.cmake") + +polly_init( + "clang / LLVM Standard C++ Library (libc++) / c++17 support / Position-Independent Code" + "Unix Makefiles" +) + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_common.cmake") + +include("${CMAKE_CURRENT_LIST_DIR}/compiler/clang.cmake") +include("${CMAKE_CURRENT_LIST_DIR}/library/std/libcxx.cmake") +include("${CMAKE_CURRENT_LIST_DIR}/flags/cxx17.cmake") +include("${CMAKE_CURRENT_LIST_DIR}/flags/fpic.cmake") + +include("${CMAKE_CURRENT_LIST_DIR}/os/osx.cmake") diff --git a/tools/polly/clang-libcxx17.cmake b/tools/polly/clang-libcxx17.cmake new file mode 100644 index 0000000..cbd5825 --- /dev/null +++ b/tools/polly/clang-libcxx17.cmake @@ -0,0 +1,23 @@ +# Copyright (c) 2013, Ruslan Baratov +# All rights reserved. + +if(DEFINED POLLY_CLANG_LIBCXX17_CMAKE) + return() +else() + set(POLLY_CLANG_LIBCXX17_CMAKE 1) +endif() + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_init.cmake") + +polly_init( + "clang / LLVM Standard C++ Library (libc++) / c++17 support" + "Unix Makefiles" +) + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_common.cmake") + +include("${CMAKE_CURRENT_LIST_DIR}/compiler/clang.cmake") +include("${CMAKE_CURRENT_LIST_DIR}/library/std/libcxx.cmake") +include("${CMAKE_CURRENT_LIST_DIR}/flags/cxx17.cmake") + +include("${CMAKE_CURRENT_LIST_DIR}/os/osx.cmake") diff --git a/tools/polly/clang-libstdcxx.cmake b/tools/polly/clang-libstdcxx.cmake new file mode 100644 index 0000000..5a96a7d --- /dev/null +++ b/tools/polly/clang-libstdcxx.cmake @@ -0,0 +1,23 @@ +# Copyright (c) 2013, Ruslan Baratov +# All rights reserved. + +if(DEFINED POLLY_CLANG_LIBSTDCXX_CMAKE) + return() +else() + set(POLLY_CLANG_LIBSTDCXX_CMAKE 1) +endif() + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_init.cmake") + +polly_init( + "clang / GNU Standard C++ Library (libstdc++) / c++11 support" + "Unix Makefiles" +) + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_common.cmake") + +include("${CMAKE_CURRENT_LIST_DIR}/compiler/clang.cmake") +include("${CMAKE_CURRENT_LIST_DIR}/library/std/libstdcxx.cmake") +include("${CMAKE_CURRENT_LIST_DIR}/flags/cxx11.cmake") + +include("${CMAKE_CURRENT_LIST_DIR}/os/osx.cmake") diff --git a/tools/polly/clang-lto.cmake b/tools/polly/clang-lto.cmake new file mode 100644 index 0000000..1b9c19f --- /dev/null +++ b/tools/polly/clang-lto.cmake @@ -0,0 +1,22 @@ +# Copyright (c) 2014, Ruslan Baratov +# All rights reserved. + +if(DEFINED POLLY_CLANG_LTO_CMAKE_) + return() +else() + set(POLLY_CLANG_LTO_CMAKE_ 1) +endif() + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_init.cmake") + +polly_init( + "clang / LLVM Standard C++ Library (libc++) / c++11 support / LTO" + "Unix Makefiles" +) + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_common.cmake") + +include("${CMAKE_CURRENT_LIST_DIR}/compiler/clang.cmake") +include("${CMAKE_CURRENT_LIST_DIR}/library/std/libcxx.cmake") +include("${CMAKE_CURRENT_LIST_DIR}/flags/cxx11.cmake") +include("${CMAKE_CURRENT_LIST_DIR}/flags/lto.cmake") diff --git a/tools/polly/clang-omp.cmake b/tools/polly/clang-omp.cmake new file mode 100644 index 0000000..67850df --- /dev/null +++ b/tools/polly/clang-omp.cmake @@ -0,0 +1,23 @@ +# Copyright (c) 2013-2017, Ruslan Baratov +# All rights reserved. + +if(DEFINED POLLY_CLANG_OMP_CMAKE_) + return() +else() + set(POLLY_CLANG_OMP_CMAKE_ 1) +endif() + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_init.cmake") + +polly_init( + "clang / LLVM Standard C++ Library (libc++) / OpenMP / c++11 support" + "Unix Makefiles" +) + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_common.cmake") + +include("${CMAKE_CURRENT_LIST_DIR}/compiler/clang-omp.cmake") +include("${CMAKE_CURRENT_LIST_DIR}/library/std/libcxx.cmake") +include("${CMAKE_CURRENT_LIST_DIR}/flags/cxx11.cmake") + +include("${CMAKE_CURRENT_LIST_DIR}/os/osx.cmake") diff --git a/tools/polly/clang-tidy-libcxx.cmake b/tools/polly/clang-tidy-libcxx.cmake new file mode 100644 index 0000000..05d0aea --- /dev/null +++ b/tools/polly/clang-tidy-libcxx.cmake @@ -0,0 +1,22 @@ +# Copyright (c) 2018, Ruslan Baratov +# All rights reserved. + +if(DEFINED POLLY_CLANG_TIDY_LIBCXX_CMAKE_) + return() +else() + set(POLLY_CLANG_TIDY_LIBCXX_CMAKE_ 1) +endif() + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_init.cmake") + +polly_init( + "Clang tidy / LLVM Standard C++ Library (libc++) / c++11 support" + "Unix Makefiles" +) + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_common.cmake") + +include("${CMAKE_CURRENT_LIST_DIR}/compiler/clang.cmake") +include("${CMAKE_CURRENT_LIST_DIR}/library/std/libcxx.cmake") +include("${CMAKE_CURRENT_LIST_DIR}/flags/cxx11.cmake") +include("${CMAKE_CURRENT_LIST_DIR}/flags/clang-tidy.cmake") diff --git a/tools/polly/clang-tidy.cmake b/tools/polly/clang-tidy.cmake new file mode 100644 index 0000000..53c20a0 --- /dev/null +++ b/tools/polly/clang-tidy.cmake @@ -0,0 +1,21 @@ +# Copyright (c) 2018, Ruslan Baratov +# All rights reserved. + +if(DEFINED POLLY_CLANG_TIDY_CMAKE_) + return() +else() + set(POLLY_CLANG_TIDY_CMAKE_ 1) +endif() + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_init.cmake") + +polly_init( + "Clang tidy / c++11 support" + "Unix Makefiles" +) + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_common.cmake") + +include("${CMAKE_CURRENT_LIST_DIR}/compiler/clang.cmake") +include("${CMAKE_CURRENT_LIST_DIR}/flags/cxx11.cmake") +include("${CMAKE_CURRENT_LIST_DIR}/flags/clang-tidy.cmake") diff --git a/tools/polly/compiler/cl.cmake b/tools/polly/compiler/cl.cmake new file mode 100644 index 0000000..c98d888 --- /dev/null +++ b/tools/polly/compiler/cl.cmake @@ -0,0 +1,37 @@ +# Copyright (c) 2016, Ruslan Baratov +# All rights reserved. + +if(DEFINED POLLY_COMPILER_CL_CMAKE_) + return() +else() + set(POLLY_COMPILER_CL_CMAKE_ 1) +endif() + +find_program(CMAKE_C_COMPILER cl) +find_program(CMAKE_CXX_COMPILER cl) + +if(NOT CMAKE_C_COMPILER) + polly_fatal_error("cl not found") +endif() + +if(NOT CMAKE_CXX_COMPILER) + polly_fatal_error("cl not found") +endif() + +set( + CMAKE_C_COMPILER + "${CMAKE_C_COMPILER}" + CACHE + STRING + "C compiler" + FORCE +) + +set( + CMAKE_CXX_COMPILER + "${CMAKE_CXX_COMPILER}" + CACHE + STRING + "C++ compiler" + FORCE +) diff --git a/tools/polly/compiler/clang-5.cmake b/tools/polly/compiler/clang-5.cmake new file mode 100644 index 0000000..025ee4f --- /dev/null +++ b/tools/polly/compiler/clang-5.cmake @@ -0,0 +1,47 @@ +# Copyright (c) 2013-2017, Ruslan Baratov +# Copyright (c) 2017, David Hirvonen +# All rights reserved. + +if(DEFINED POLLY_COMPILER_CLANG_5_CMAKE) + return() +else() + set(POLLY_COMPILER_CLANG_5_CMAKE 1) +endif() + +include(polly_fatal_error) + +if(XCODE_VERSION) + set(_err "This toolchain is not available for Xcode") + set(_err "${_err} because Xcode ignores CMAKE_C(XX)_COMPILER variable.") + set(_err "${_err} Use xcode.cmake toolchain instead.") + polly_fatal_error(${_err}) +endif() + +find_program(CMAKE_C_COMPILER clang-5.0) +find_program(CMAKE_CXX_COMPILER clang++-5.0) + +if(NOT CMAKE_C_COMPILER) + polly_fatal_error("clang not found") +endif() + +if(NOT CMAKE_CXX_COMPILER) + polly_fatal_error("clang++ not found") +endif() + +set( + CMAKE_C_COMPILER + "${CMAKE_C_COMPILER}" + CACHE + STRING + "C compiler" + FORCE +) + +set( + CMAKE_CXX_COMPILER + "${CMAKE_CXX_COMPILER}" + CACHE + STRING + "C++ compiler" + FORCE +) diff --git a/tools/polly/compiler/clang-omp.cmake b/tools/polly/compiler/clang-omp.cmake new file mode 100644 index 0000000..9b0b2b6 --- /dev/null +++ b/tools/polly/compiler/clang-omp.cmake @@ -0,0 +1,58 @@ +# Copyright (c) 2013-2017, Ruslan Baratov +# All rights reserved. + +if(DEFINED POLLY_COMPILER_CLANG_OMP_CMAKE) + return() +else() + set(POLLY_COMPILER_CLANG_OMP_CMAKE 1) +endif() + +include(polly_add_cache_flag) +include(polly_fatal_error) + +if(XCODE_VERSION) + set(_err "This toolchain is not available for Xcode") + set(_err "${_err} because Xcode ignores CMAKE_C(XX)_COMPILER variable.") + set(_err "${_err} Use xcode.cmake toolchain instead.") + polly_fatal_error(${_err}) +endif() + +string(COMPARE EQUAL "$ENV{CLANG_OMP_ROOT}" "" _is_empty) +if(_is_empty) + polly_fatal_error("Environment variable CLANG_OMP_ROOT is not set") +endif() + +if(NOT EXISTS "$ENV{CLANG_OMP_ROOT}/bin") + polly_fatal_error("Directory '$ENV{CLANG_OMP_ROOT}/bin' not exists (please check CLANG_OMP_ROOT)") +endif() + +unset(CMAKE_C_COMPILER CACHE) +unset(CMAKE_CXX_COMPILER CACHE) + +find_program( + CMAKE_C_COMPILER + clang + PATHS "$ENV{CLANG_OMP_ROOT}/bin" + NO_DEFAULT_PATH +) + +find_program( + CMAKE_CXX_COMPILER + clang++ + PATHS "$ENV{CLANG_OMP_ROOT}/bin" + NO_DEFAULT_PATH +) + +if(NOT CMAKE_C_COMPILER) + polly_fatal_error("clang not found (verify CLANG_OMP_ROOT)") +endif() + +if(NOT CMAKE_CXX_COMPILER) + polly_fatal_error("clang++ not found (verify CLANG_OMP_ROOT)") +endif() + +polly_add_cache_flag(CMAKE_CXX_FLAGS "-fopenmp") +polly_add_cache_flag(CMAKE_C_FLAGS "-fopenmp") + +polly_add_cache_flag(CMAKE_EXE_LINKER_FLAGS "-L$ENV{CLANG_OMP_ROOT}/lib") +polly_add_cache_flag(CMAKE_SHARED_LINKER_FLAGS "-L$ENV{CLANG_OMP_ROOT}/lib") diff --git a/tools/polly/compiler/clang.cmake b/tools/polly/compiler/clang.cmake new file mode 100644 index 0000000..b74c64f --- /dev/null +++ b/tools/polly/compiler/clang.cmake @@ -0,0 +1,46 @@ +# Copyright (c) 2013, Ruslan Baratov +# All rights reserved. + +if(DEFINED POLLY_COMPILER_CLANG_CMAKE) + return() +else() + set(POLLY_COMPILER_CLANG_CMAKE 1) +endif() + +include(polly_fatal_error) + +if(XCODE_VERSION) + set(_err "This toolchain is not available for Xcode") + set(_err "${_err} because Xcode ignores CMAKE_C(XX)_COMPILER variable.") + set(_err "${_err} Use xcode.cmake toolchain instead.") + polly_fatal_error(${_err}) +endif() + +find_program(CMAKE_C_COMPILER clang) +find_program(CMAKE_CXX_COMPILER clang++) + +if(NOT CMAKE_C_COMPILER) + polly_fatal_error("clang not found") +endif() + +if(NOT CMAKE_CXX_COMPILER) + polly_fatal_error("clang++ not found") +endif() + +set( + CMAKE_C_COMPILER + "${CMAKE_C_COMPILER}" + CACHE + STRING + "C compiler" + FORCE +) + +set( + CMAKE_CXX_COMPILER + "${CMAKE_CXX_COMPILER}" + CACHE + STRING + "C++ compiler" + FORCE +) diff --git a/tools/polly/compiler/egcc.cmake b/tools/polly/compiler/egcc.cmake new file mode 100644 index 0000000..a170764 --- /dev/null +++ b/tools/polly/compiler/egcc.cmake @@ -0,0 +1,47 @@ +# Copyright (c) 2013, Ruslan Baratov +# All rights reserved. + +if(DEFINED POLLY_COMPILER_EGCC_CMAKE) + return() +else() + set(POLLY_COMPILER_EGCC_CMAKE 1) +endif() + +include(polly_fatal_error) + +if(XCODE_VERSION) + set(_err "This toolchain is not available for Xcode") + set(_err "${_err} because Xcode ignores CMAKE_C(XX)_COMPILER variable.") + set(_err "${_err} Use xcode.cmake toolchain instead.") + polly_fatal_error(${_err}) +endif() + +find_program(CMAKE_C_COMPILER egcc) +find_program(CMAKE_CXX_COMPILER eg++) +find_program(CMAKE_CPP_COMPILER egcpp) + +if(NOT CMAKE_C_COMPILER) + polly_fatal_error("egcc not found") +endif() + +if(NOT CMAKE_CXX_COMPILER) + polly_fatal_error("eg++ not found") +endif() + +set( + CMAKE_C_COMPILER + "${CMAKE_C_COMPILER}" + CACHE + STRING + "C compiler" + FORCE +) + +set( + CMAKE_CXX_COMPILER + "${CMAKE_CXX_COMPILER}" + CACHE + STRING + "C++ compiler" + FORCE +) diff --git a/tools/polly/compiler/emscripten.cmake b/tools/polly/compiler/emscripten.cmake new file mode 100644 index 0000000..696b1b4 --- /dev/null +++ b/tools/polly/compiler/emscripten.cmake @@ -0,0 +1,21 @@ +# Copyright (c) 2016, Alexandre Pretyman +# All rights reserved. + +if(DEFINED POLLY_COMPILER_EMSCRIPTEN_CMAKE) + return() +else() + set(POLLY_COMPILER_EMSCRIPTEN_CMAKE 1) +endif() + +include(polly_fatal_error) + +string(COMPARE EQUAL "$ENV{EMSCRIPTEN}" "" _is_empty) +if(_is_empty) + polly_fatal_error( + "EMSCRIPTEN environment variable not set. Emscripten environment variables are in emsdk_env.sh" + ) +endif() + +include("$ENV{EMSCRIPTEN}/cmake/Modules/Platform/Emscripten.cmake") +list(APPEND CMAKE_FIND_ROOT_PATH "${CMAKE_CURRENT_LIST_DIR}/emscripten") + diff --git a/tools/polly/compiler/emscripten/glew/glewConfig.cmake b/tools/polly/compiler/emscripten/glew/glewConfig.cmake new file mode 100644 index 0000000..62f3ba3 --- /dev/null +++ b/tools/polly/compiler/emscripten/glew/glewConfig.cmake @@ -0,0 +1,11 @@ +# Copyright (c) 2016, Alexandre Pretyman, Ruslan Baratov +# Emscripten CMake target to emulate native glew::glew target +if(NOT TARGET glew::glew) + add_library(glew::glew INTERFACE IMPORTED) + set_target_properties( + glew::glew + PROPERTIES + INTERFACE_COMPILE_DEFINITIONS "GLEWMX" + INTERFACE_LINK_LIBRARIES "-s LEGACY_GL_EMULATION=1" + ) +endif() diff --git a/tools/polly/compiler/emscripten/glfw3/glfw3Config.cmake b/tools/polly/compiler/emscripten/glfw3/glfw3Config.cmake new file mode 100644 index 0000000..8fe516a --- /dev/null +++ b/tools/polly/compiler/emscripten/glfw3/glfw3Config.cmake @@ -0,0 +1,10 @@ +# Copyright (c) 2016, Alexandre Pretyman +# Emscripten CMake target to emulate native glfw target +if(NOT TARGET glfw) + add_library(glfw INTERFACE IMPORTED) + set_target_properties( + glfw + PROPERTIES + INTERFACE_LINK_LIBRARIES "-s LEGACY_GL_EMULATION=1;-s USE_GLFW=3" + ) +endif() diff --git a/tools/polly/compiler/gcc-5.cmake b/tools/polly/compiler/gcc-5.cmake new file mode 100644 index 0000000..c13cb43 --- /dev/null +++ b/tools/polly/compiler/gcc-5.cmake @@ -0,0 +1,37 @@ +# Copyright (c) 2013-2017, Ruslan Baratov +# All rights reserved. + +if(DEFINED POLLY_COMPILER_GCC_5_CMAKE_) + return() +else() + set(POLLY_COMPILER_GCC_5_CMAKE_ 1) +endif() + +find_program(CMAKE_C_COMPILER gcc-5) +find_program(CMAKE_CXX_COMPILER g++-5) + +if(NOT CMAKE_C_COMPILER) + polly_fatal_error("gcc not found") +endif() + +if(NOT CMAKE_CXX_COMPILER) + polly_fatal_error("g++ not found") +endif() + +set( + CMAKE_C_COMPILER + "${CMAKE_C_COMPILER}" + CACHE + STRING + "C compiler" + FORCE +) + +set( + CMAKE_CXX_COMPILER + "${CMAKE_CXX_COMPILER}" + CACHE + STRING + "C++ compiler" + FORCE +) diff --git a/tools/polly/compiler/gcc-6.cmake b/tools/polly/compiler/gcc-6.cmake new file mode 100644 index 0000000..1894051 --- /dev/null +++ b/tools/polly/compiler/gcc-6.cmake @@ -0,0 +1,37 @@ +# Copyright (c) 2013-2017, Ruslan Baratov +# All rights reserved. + +if(DEFINED POLLY_COMPILER_GCC_7_CMAKE_) + return() +else() + set(POLLY_COMPILER_GCC_7_CMAKE_ 1) +endif() + +find_program(CMAKE_C_COMPILER gcc-6) +find_program(CMAKE_CXX_COMPILER g++-6) + +if(NOT CMAKE_C_COMPILER) + polly_fatal_error("gcc not found") +endif() + +if(NOT CMAKE_CXX_COMPILER) + polly_fatal_error("g++ not found") +endif() + +set( + CMAKE_C_COMPILER + "${CMAKE_C_COMPILER}" + CACHE + STRING + "C compiler" + FORCE +) + +set( + CMAKE_CXX_COMPILER + "${CMAKE_CXX_COMPILER}" + CACHE + STRING + "C++ compiler" + FORCE +) diff --git a/tools/polly/compiler/gcc-7.cmake b/tools/polly/compiler/gcc-7.cmake new file mode 100644 index 0000000..28927bd --- /dev/null +++ b/tools/polly/compiler/gcc-7.cmake @@ -0,0 +1,38 @@ +# Copyright (c) 2013-2017, Ruslan Baratov +# Copyright (c) 2017, David Hirvonen +# All rights reserved. + +if(DEFINED POLLY_COMPILER_GCC_7_CMAKE_) + return() +else() + set(POLLY_COMPILER_GCC_7_CMAKE_ 1) +endif() + +find_program(CMAKE_C_COMPILER gcc-7) +find_program(CMAKE_CXX_COMPILER g++-7) + +if(NOT CMAKE_C_COMPILER) + polly_fatal_error("gcc not found") +endif() + +if(NOT CMAKE_CXX_COMPILER) + polly_fatal_error("g++ not found") +endif() + +set( + CMAKE_C_COMPILER + "${CMAKE_C_COMPILER}" + CACHE + STRING + "C compiler" + FORCE +) + +set( + CMAKE_CXX_COMPILER + "${CMAKE_CXX_COMPILER}" + CACHE + STRING + "C++ compiler" + FORCE +) diff --git a/tools/polly/compiler/gcc-8.cmake b/tools/polly/compiler/gcc-8.cmake new file mode 100644 index 0000000..1093aa4 --- /dev/null +++ b/tools/polly/compiler/gcc-8.cmake @@ -0,0 +1,38 @@ +# Copyright (c) 2013-2017, Ruslan Baratov +# Copyright (c) 2017, David Hirvonen +# All rights reserved. + +if(DEFINED POLLY_COMPILER_GCC_8_CMAKE_) + return() +else() + set(POLLY_COMPILER_GCC_8_CMAKE_ 1) +endif() + +find_program(CMAKE_C_COMPILER gcc-8) +find_program(CMAKE_CXX_COMPILER g++-8) + +if(NOT CMAKE_C_COMPILER) + polly_fatal_error("gcc not found") +endif() + +if(NOT CMAKE_CXX_COMPILER) + polly_fatal_error("g++ not found") +endif() + +set( + CMAKE_C_COMPILER + "${CMAKE_C_COMPILER}" + CACHE + STRING + "C compiler" + FORCE +) + +set( + CMAKE_CXX_COMPILER + "${CMAKE_CXX_COMPILER}" + CACHE + STRING + "C++ compiler" + FORCE +) diff --git a/tools/polly/compiler/gcc-cross-compile-raspberry-pi.cmake b/tools/polly/compiler/gcc-cross-compile-raspberry-pi.cmake new file mode 100644 index 0000000..086b396 --- /dev/null +++ b/tools/polly/compiler/gcc-cross-compile-raspberry-pi.cmake @@ -0,0 +1,103 @@ +# Copyright (c) 2017, Alexandre Pretyman +# All rights reserved. + +if(DEFINED POLLY_COMPILER_GCC_CROSS_COMPILE_RASPBERRY_PI_CMAKE) + return() +else() + set(POLLY_COMPILER_GCC_CROSS_COMPILE_RASPBERRY_PI_CMAKE 1) +endif() + +include(polly_fatal_error) +include(polly_status_print) + +# Detect Raspberry Pi host +set(_proc_cpuinfo "/proc/cpuinfo") +if(EXISTS "${_proc_cpuinfo}") + # https://en.wikipedia.org/wiki/Raspberry_Pi#Specifications + file( + STRINGS + "${_proc_cpuinfo}" + _proc_cpuinfo_strings + REGEX + "^Hardware[\t ]*:[\t ]*BCM283(5|6|7)$" + ) + string(COMPARE EQUAL "${_proc_cpuinfo_strings}" "" _is_empty) + if(NOT _is_empty) + polly_status_print("Raspberry Pi host") + set(_usr_bin_cpp "/usr/bin/cpp") + if(EXISTS "${_usr_bin_cpp}") + # Needed for 'url_sha1_autotools' Hunter build scheme + set(CMAKE_C_PREPROCESSOR "${_usr_bin_cpp}" CACHE PATH "Preprocessor") + endif() + return() # We are not cross-compiling, exit now. + endif() +endif() + +set(_rpi_error_msg) #if empty, then no errors! +string(COMPARE EQUAL + "$ENV{RASPBERRYPI_CROSS_COMPILE_TOOLCHAIN_PATH}" + "" + _is_empty +) +if(_is_empty) + set(_rpi_error_msg + "${_rpi_error_msg}\nRASPBERRYPI_CROSS_COMPILE_TOOLCHAIN_PATH environment variable not set. Set it to the absolute path of the \"bin\" directory for the toolchain" + ) +endif() + +string(COMPARE EQUAL + "$ENV{RASPBERRYPI_CROSS_COMPILE_TOOLCHAIN_PREFIX}" + "" + _is_empty +) +if(_is_empty) + set(_rpi_error_msg + "${_rpi_error_msg}\nRASPBERRYPI_CROSS_COMPILE_TOOLCHAIN_PREFIX environment variable not set. Set it to the triplet of the toolchain (ex: arm-linux-gnueabihf)" + ) +endif() + +string(COMPARE EQUAL + "$ENV{RASPBERRYPI_CROSS_COMPILE_SYSROOT}" + "" + _is_empty +) +if(_is_empty) + set(_rpi_error_msg + "${_rpi_error_msg}\nRASPBERRYPI_CROSS_COMPILE_SYSROOT environment variable not set. Set it to the sysroot to be used" + ) +endif() + +string(COMPARE NOTEQUAL + "${_rpi_error_msg}" + "" + _has_errors +) +if(_has_errors) + polly_fatal_error( + "RaspberyPi Toolchain configuration failed:" + ${_rpi_error_msg} + ) +endif() + +# We shouldn't try to hardcore the path, since the cross compiler for the Mac +# needs to be in a "case-sensitive" file system +set(CROSS_COMPILE_TOOLCHAIN_PATH + "$ENV{RASPBERRYPI_CROSS_COMPILE_TOOLCHAIN_PATH}" + CACHE PATH "RaspberryPi Toolchain Path" +) + +# The prefix is what is known as the cross compiler triplet or quadruplet. +# ex: arm-unknown-linux-gnueabihf (note: no dash at the end) +set(CROSS_COMPILE_TOOLCHAIN_PREFIX + "$ENV{RASPBERRYPI_CROSS_COMPILE_TOOLCHAIN_PREFIX}" + CACHE STRING "RaspberryPi Toolchain Prefix" +) + +# The sysroot for the cross compile +set(CROSS_COMPILE_SYSROOT + "$ENV{RASPBERRYPI_CROSS_COMPILE_SYSROOT}" + CACHE PATH "RaspberryPi sysroot" +) + +include("${CMAKE_CURRENT_LIST_DIR}/gcc-cross-compile.cmake") + diff --git a/tools/polly/compiler/gcc-cross-compile-simple-layout.cmake b/tools/polly/compiler/gcc-cross-compile-simple-layout.cmake new file mode 100644 index 0000000..da60062 --- /dev/null +++ b/tools/polly/compiler/gcc-cross-compile-simple-layout.cmake @@ -0,0 +1,31 @@ +# Copyright (c) 2015 Ruslan Baratov +# All rights reserved. + +if(DEFINED POLLY_COMPILER_GCC_CROSS_COMPILE_SIMPLE_LAYOUT_) + return() +else() + set(POLLY_COMPILER_GCC_CROSS_COMPILE_SIMPLE_LAYOUT_ TRUE) +endif() + +string(COMPARE EQUAL "${CROSS_COMPILE_TOOLCHAIN_PREFIX}" "" _is_empty) +if(_is_empty) + polly_fatal_error("CROSS_COMPILE_TOOLCHAIN_PREFIX not set.") +endif() + +set(_gcc_name "${CROSS_COMPILE_TOOLCHAIN_PREFIX}-gcc") +find_program(_gcc_location "${_gcc_name}") +if(NOT _gcc_location) + polly_fatal_error( + "GCC not found: ${_gcc_name} (update PATH environment variable)" + ) +endif() + +get_filename_component( + CROSS_COMPILE_TOOLCHAIN_PATH "${_gcc_location}" DIRECTORY +) +get_filename_component( + CROSS_COMPILE_SYSROOT "${CROSS_COMPILE_TOOLCHAIN_PATH}/.." ABSOLUTE +) + +set(POLLY_SKIP_SYSROOT YES) +include("${CMAKE_CURRENT_LIST_DIR}/gcc-cross-compile.cmake") diff --git a/tools/polly/compiler/gcc-cross-compile.cmake b/tools/polly/compiler/gcc-cross-compile.cmake new file mode 100644 index 0000000..76fb1d0 --- /dev/null +++ b/tools/polly/compiler/gcc-cross-compile.cmake @@ -0,0 +1,87 @@ +# Copyright (c) 2015 Alexandre Pretyman +# All rights reserved. +# +# ------------------------------------------------------------------------------ +# GCC Based Cross Compiler CMake toolchain file +# +# Variables: +# CROSS_COMPILE_TOOLCHAIN_PATH=/path/to/toolchain/bin +# CROSS_COMPILE_TOOLCHAIN_PREFIX=arm-unknown-linux-gnueabihf +# CROSS_COMPILE_SYSROOT=/path/to/sysroot +# ------------------------------------------------------------------------------ + +if(DEFINED POLLY_COMPILER_GCC_CROSS_COMPILE) + return() +else() + set(POLLY_COMPILER_GCC_CROSS_COMPILE TRUE) +endif() + +include(polly_add_cache_flag) + +if( CMAKE_TOOLCHAIN_FILE ) + # touch toolchain variable to suppress "unused variable" warning +endif() + +string(COMPARE EQUAL + "${CROSS_COMPILE_TOOLCHAIN_PATH}" + "" + _is_empty +) +if(_is_empty) + polly_fatal_error("CROSS_COMPILE_TOOLCHAIN_PATH not set.") +endif() + +string(COMPARE EQUAL + "${CROSS_COMPILE_TOOLCHAIN_PREFIX}" + "" + _is_empty +) +if(_is_empty) + polly_fatal_error("CROSS_COMPILE_TOOLCHAIN_PREFIX not set.") +endif() + +string(COMPARE EQUAL + "${CROSS_COMPILE_SYSROOT}" + "" + _is_empty +) +if(_is_empty) + polly_fatal_error("CROSS_COMPILE_SYSROOT not set.") +endif() + +if(POLLY_SKIP_SYSROOT) + # Do not modify CMAKE_{C,CXX}_FLAGS + # Workaround for x86_64-pc-linux-gcc error: + # "this linker was not configured to use sysroots" +else() + set(SYSROOT_COMPILE_FLAG "--sysroot=${CROSS_COMPILE_SYSROOT}") + polly_add_cache_flag( + CMAKE_C_FLAGS + "${SYSROOT_COMPILE_FLAG}" + ) + polly_add_cache_flag( + CMAKE_CXX_FLAGS + "${SYSROOT_COMPILE_FLAG}" + ) +endif() + +# The (...)_PREFIX variable name refers to the Cross Compiler Triplet +set(TOOLCHAIN_PATH_AND_PREFIX ${CROSS_COMPILE_TOOLCHAIN_PATH}/${CROSS_COMPILE_TOOLCHAIN_PREFIX}) +set(CMAKE_C_COMPILER "${TOOLCHAIN_PATH_AND_PREFIX}-gcc" CACHE PATH "C compiler" ) +set(CMAKE_CXX_COMPILER "${TOOLCHAIN_PATH_AND_PREFIX}-g++" CACHE PATH "C++ compiler" ) +set(CMAKE_ASM_COMPILER "${TOOLCHAIN_PATH_AND_PREFIX}-as" CACHE PATH "Assembler" ) +set(CMAKE_C_PREPROCESSOR "${TOOLCHAIN_PATH_AND_PREFIX}-cpp" CACHE PATH "Preprocessor" ) +set(CMAKE_STRIP "${TOOLCHAIN_PATH_AND_PREFIX}-strip" CACHE PATH "strip" ) +if( EXISTS "${TOOLCHAIN_PATH_AND_PREFIX}-gcc-ar" ) + # Prefer gcc-ar over binutils ar: https://gcc.gnu.org/wiki/LinkTimeOptimizationFAQ + set(CMAKE_AR "${TOOLCHAIN_PATH_AND_PREFIX}-gcc-ar" CACHE PATH "Archiver" ) +else() + set(CMAKE_AR "${TOOLCHAIN_PATH_AND_PREFIX}-ar" CACHE PATH "Archiver" ) +endif() +set(CMAKE_LINKER "${TOOLCHAIN_PATH_AND_PREFIX}-ld" CACHE PATH "Linker" ) +set(CMAKE_NM "${TOOLCHAIN_PATH_AND_PREFIX}-nm" CACHE PATH "nm" ) +set(CMAKE_OBJCOPY "${TOOLCHAIN_PATH_AND_PREFIX}-objcopy" CACHE PATH "objcopy" ) +set(CMAKE_OBJDUMP "${TOOLCHAIN_PATH_AND_PREFIX}-objdump" CACHE PATH "objdump" ) +set(CMAKE_RANLIB "${TOOLCHAIN_PATH_AND_PREFIX}-ranlib" CACHE PATH "ranlib" ) +set(CMAKE_RC_COMPILER "${TOOLCHAIN_PATH_AND_PREFIX}-windres" CACHE PATH "WindowsRC" ) +set(CMAKE_Fortran_COMPILER "${TOOLCHAIN_PATH_AND_PREFIX}-gfortran" CACHE PATH "gfortran" ) diff --git a/tools/polly/compiler/gcc.cmake b/tools/polly/compiler/gcc.cmake new file mode 100644 index 0000000..3c3d68a --- /dev/null +++ b/tools/polly/compiler/gcc.cmake @@ -0,0 +1,37 @@ +# Copyright (c) 2013, Ruslan Baratov +# All rights reserved. + +if(DEFINED POLLY_COMPILER_GCC_CMAKE) + return() +else() + set(POLLY_COMPILER_GCC_CMAKE 1) +endif() + +find_program(CMAKE_C_COMPILER gcc) +find_program(CMAKE_CXX_COMPILER g++) + +if(NOT CMAKE_C_COMPILER) + polly_fatal_error("gcc not found") +endif() + +if(NOT CMAKE_CXX_COMPILER) + polly_fatal_error("g++ not found") +endif() + +set( + CMAKE_C_COMPILER + "${CMAKE_C_COMPILER}" + CACHE + STRING + "C compiler" + FORCE +) + +set( + CMAKE_CXX_COMPILER + "${CMAKE_CXX_COMPILER}" + CACHE + STRING + "C++ compiler" + FORCE +) diff --git a/tools/polly/compiler/gcc48.cmake b/tools/polly/compiler/gcc48.cmake new file mode 100644 index 0000000..6b8cc75 --- /dev/null +++ b/tools/polly/compiler/gcc48.cmake @@ -0,0 +1,11 @@ +# Copyright (c) 2013, Ruslan Baratov +# All rights reserved. + +if(DEFINED POLLY_COMPILER_GCC48_CMAKE) + return() +else() + set(POLLY_COMPILER_GCC48_CMAKE 1) +endif() + +set(CMAKE_C_COMPILER gcc-4.8 CACHE STRING "C compiler" FORCE) +set(CMAKE_CXX_COMPILER g++-4.8 CACHE STRING "C++ compiler" FORCE) diff --git a/tools/polly/compiler/xcode.cmake b/tools/polly/compiler/xcode.cmake new file mode 100644 index 0000000..c8cbbe1 --- /dev/null +++ b/tools/polly/compiler/xcode.cmake @@ -0,0 +1,33 @@ +# Copyright (c) 2015, Ruslan Baratov +# All rights reserved. + +if(DEFINED POLLY_COMPILER_XCODE_CMAKE_) + return() +else() + set(POLLY_COMPILER_XCODE_CMAKE_ 1) +endif() + +include(polly_fatal_error) + +string(COMPARE EQUAL "${POLLY_XCODE_COMPILER}" "" _is_empty) +if(_is_empty) + polly_fatal_error("Please set POLLY_XCODE_COMPILER") +endif() + +set(_cmd xcrun --find "${POLLY_XCODE_COMPILER}") + +execute_process( + COMMAND + ${_cmd} + OUTPUT_VARIABLE _compiler_path + RESULT_VARIABLE _result + OUTPUT_STRIP_TRAILING_WHITESPACE +) + +if(NOT _result EQUAL 0) + polly_fatal_error("Command failed: ${_cmd}") +endif() + +set(CMAKE_XCODE_ATTRIBUTE_CC "${_compiler_path}") + +polly_status_debug("Compiler: ${_compiler_path}") diff --git a/tools/polly/custom-libcxx.cmake b/tools/polly/custom-libcxx.cmake new file mode 100644 index 0000000..5930427 --- /dev/null +++ b/tools/polly/custom-libcxx.cmake @@ -0,0 +1,34 @@ +# Copyright (c) 2013, Ruslan Baratov +# All rights reserved. + +if(DEFINED POLLY_CUSTOM_LIBCXX_CMAKE) + return() +else() + set(POLLY_CUSTOM_LIBCXX_CMAKE 1) +endif() + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_init.cmake") + +polly_init( + "clang / Custom LLVM Standard C++ Library (libc++) / c++11 support" + "Unix Makefiles" +) + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_common.cmake") + +include("${CMAKE_CURRENT_LIST_DIR}/compiler/clang.cmake") +include("${CMAKE_CURRENT_LIST_DIR}/library/std/libcxx.cmake") +include("${CMAKE_CURRENT_LIST_DIR}/library/std/nolibs.cmake") +include("${CMAKE_CURRENT_LIST_DIR}/flags/cxx11.cmake") + +# '-lSystem' needed to fix broken compiler report +set( + CMAKE_EXE_LINKER_FLAGS + "${CMAKE_EXE_LINKER_FLAGS} -lSystem" + CACHE + STRING + "C++ linker flags" + FORCE +) + +set(CUSTOM_LIBCXX_LIBRARY_LOCATION TRUE) diff --git a/tools/polly/cxx11.cmake b/tools/polly/cxx11.cmake new file mode 100644 index 0000000..30d3039 --- /dev/null +++ b/tools/polly/cxx11.cmake @@ -0,0 +1,16 @@ +# Copyright (c) 2013-2017, Ruslan Baratov +# All rights reserved. + +if(DEFINED POLLY_CXX11_CMAKE_) + return() +else() + set(POLLY_CXX11_CMAKE_ 1) +endif() + +# Don't use polly_init (no generator expected) +set(POLLY_TOOLCHAIN_NAME "C++11 support") +set(POLLY_TOOLCHAIN_TAG "cxx11") + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_common.cmake") + +set(CMAKE_CXX_STANDARD 11) diff --git a/tools/polly/cxx17.cmake b/tools/polly/cxx17.cmake new file mode 100644 index 0000000..fe488c6 --- /dev/null +++ b/tools/polly/cxx17.cmake @@ -0,0 +1,18 @@ +# Copyright (c) 2013-2017, Ruslan Baratov +# Copyright (c) 2018, Richard Hodges + +# All rights reserved. + +if(DEFINED POLLY_CXX17_CMAKE_) + return() +else() + set(POLLY_CXX17_CMAKE_ 1) +endif() + +# Don't use polly_init (no generator expected) +set(POLLY_TOOLCHAIN_NAME "C++17 support") +set(POLLY_TOOLCHAIN_TAG "cxx17") + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_common.cmake") + +set(CMAKE_CXX_STANDARD 17) diff --git a/tools/polly/cygwin.cmake b/tools/polly/cygwin.cmake new file mode 100644 index 0000000..08e6682 --- /dev/null +++ b/tools/polly/cygwin.cmake @@ -0,0 +1,22 @@ +# Copyright (c) 2014, Ruslan Baratov +# All rights reserved. + +if(DEFINED POLLY_CYGWIN_CMAKE_) + return() +else() + set(POLLY_CYGWIN_CMAKE_ 1) +endif() + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_init.cmake") + +polly_init( + "cygwin / gcc / c++11 support" + "Unix Makefiles" +) + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_common.cmake") + +include("${CMAKE_CURRENT_LIST_DIR}/compiler/gcc.cmake") +include("${CMAKE_CURRENT_LIST_DIR}/flags/cxx11.cmake") + +include("${CMAKE_CURRENT_LIST_DIR}/os/cygwin.cmake") diff --git a/tools/polly/default.cmake b/tools/polly/default.cmake new file mode 100644 index 0000000..e4658a9 --- /dev/null +++ b/tools/polly/default.cmake @@ -0,0 +1,14 @@ +# Copyright (c) 2013, Ruslan Baratov +# All rights reserved. + +if(DEFINED POLLY_DEFAULT_CMAKE) + return() +else() + set(POLLY_DEFAULT_CMAKE 1) +endif() + +# Don't use polly_init (no generator expected) +set(POLLY_TOOLCHAIN_NAME "Default") +set(POLLY_TOOLCHAIN_TAG "default") + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_common.cmake") diff --git a/tools/polly/docs/Makefile b/tools/polly/docs/Makefile new file mode 100644 index 0000000..531f052 --- /dev/null +++ b/tools/polly/docs/Makefile @@ -0,0 +1,216 @@ +# Makefile for Sphinx documentation +# + +# You can set these variables from the command line. +SPHINXOPTS = +SPHINXBUILD = sphinx-build +PAPER = +BUILDDIR = _build + +# User-friendly check for sphinx-build +ifeq ($(shell which $(SPHINXBUILD) >/dev/null 2>&1; echo $$?), 1) +$(error The '$(SPHINXBUILD)' command was not found. Make sure you have Sphinx installed, then set the SPHINXBUILD environment variable to point to the full path of the '$(SPHINXBUILD)' executable. Alternatively you can add the directory with the executable to your PATH. If you don't have Sphinx installed, grab it from http://sphinx-doc.org/) +endif + +# Internal variables. +PAPEROPT_a4 = -D latex_paper_size=a4 +PAPEROPT_letter = -D latex_paper_size=letter +ALLSPHINXOPTS = -d $(BUILDDIR)/doctrees $(PAPEROPT_$(PAPER)) $(SPHINXOPTS) . +# the i18n builder cannot share the environment and doctrees with the others +I18NSPHINXOPTS = $(PAPEROPT_$(PAPER)) $(SPHINXOPTS) . + +.PHONY: help +help: + @echo "Please use \`make ' where is one of" + @echo " html to make standalone HTML files" + @echo " dirhtml to make HTML files named index.html in directories" + @echo " singlehtml to make a single large HTML file" + @echo " pickle to make pickle files" + @echo " json to make JSON files" + @echo " htmlhelp to make HTML files and a HTML help project" + @echo " qthelp to make HTML files and a qthelp project" + @echo " applehelp to make an Apple Help Book" + @echo " devhelp to make HTML files and a Devhelp project" + @echo " epub to make an epub" + @echo " latex to make LaTeX files, you can set PAPER=a4 or PAPER=letter" + @echo " latexpdf to make LaTeX files and run them through pdflatex" + @echo " latexpdfja to make LaTeX files and run them through platex/dvipdfmx" + @echo " text to make text files" + @echo " man to make manual pages" + @echo " texinfo to make Texinfo files" + @echo " info to make Texinfo files and run them through makeinfo" + @echo " gettext to make PO message catalogs" + @echo " changes to make an overview of all changed/added/deprecated items" + @echo " xml to make Docutils-native XML files" + @echo " pseudoxml to make pseudoxml-XML files for display purposes" + @echo " linkcheck to check all external links for integrity" + @echo " doctest to run all doctests embedded in the documentation (if enabled)" + @echo " coverage to run coverage check of the documentation (if enabled)" + +.PHONY: clean +clean: + rm -rf $(BUILDDIR)/* + +.PHONY: html +html: + $(SPHINXBUILD) -b html $(ALLSPHINXOPTS) $(BUILDDIR)/html + @echo + @echo "Build finished. The HTML pages are in $(BUILDDIR)/html." + +.PHONY: dirhtml +dirhtml: + $(SPHINXBUILD) -b dirhtml $(ALLSPHINXOPTS) $(BUILDDIR)/dirhtml + @echo + @echo "Build finished. The HTML pages are in $(BUILDDIR)/dirhtml." + +.PHONY: singlehtml +singlehtml: + $(SPHINXBUILD) -b singlehtml $(ALLSPHINXOPTS) $(BUILDDIR)/singlehtml + @echo + @echo "Build finished. The HTML page is in $(BUILDDIR)/singlehtml." + +.PHONY: pickle +pickle: + $(SPHINXBUILD) -b pickle $(ALLSPHINXOPTS) $(BUILDDIR)/pickle + @echo + @echo "Build finished; now you can process the pickle files." + +.PHONY: json +json: + $(SPHINXBUILD) -b json $(ALLSPHINXOPTS) $(BUILDDIR)/json + @echo + @echo "Build finished; now you can process the JSON files." + +.PHONY: htmlhelp +htmlhelp: + $(SPHINXBUILD) -b htmlhelp $(ALLSPHINXOPTS) $(BUILDDIR)/htmlhelp + @echo + @echo "Build finished; now you can run HTML Help Workshop with the" \ + ".hhp project file in $(BUILDDIR)/htmlhelp." + +.PHONY: qthelp +qthelp: + $(SPHINXBUILD) -b qthelp $(ALLSPHINXOPTS) $(BUILDDIR)/qthelp + @echo + @echo "Build finished; now you can run "qcollectiongenerator" with the" \ + ".qhcp project file in $(BUILDDIR)/qthelp, like this:" + @echo "# qcollectiongenerator $(BUILDDIR)/qthelp/Polly.qhcp" + @echo "To view the help file:" + @echo "# assistant -collectionFile $(BUILDDIR)/qthelp/Polly.qhc" + +.PHONY: applehelp +applehelp: + $(SPHINXBUILD) -b applehelp $(ALLSPHINXOPTS) $(BUILDDIR)/applehelp + @echo + @echo "Build finished. The help book is in $(BUILDDIR)/applehelp." + @echo "N.B. You won't be able to view it unless you put it in" \ + "~/Library/Documentation/Help or install it in your application" \ + "bundle." + +.PHONY: devhelp +devhelp: + $(SPHINXBUILD) -b devhelp $(ALLSPHINXOPTS) $(BUILDDIR)/devhelp + @echo + @echo "Build finished." + @echo "To view the help file:" + @echo "# mkdir -p $$HOME/.local/share/devhelp/Polly" + @echo "# ln -s $(BUILDDIR)/devhelp $$HOME/.local/share/devhelp/Polly" + @echo "# devhelp" + +.PHONY: epub +epub: + $(SPHINXBUILD) -b epub $(ALLSPHINXOPTS) $(BUILDDIR)/epub + @echo + @echo "Build finished. The epub file is in $(BUILDDIR)/epub." + +.PHONY: latex +latex: + $(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) $(BUILDDIR)/latex + @echo + @echo "Build finished; the LaTeX files are in $(BUILDDIR)/latex." + @echo "Run \`make' in that directory to run these through (pdf)latex" \ + "(use \`make latexpdf' here to do that automatically)." + +.PHONY: latexpdf +latexpdf: + $(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) $(BUILDDIR)/latex + @echo "Running LaTeX files through pdflatex..." + $(MAKE) -C $(BUILDDIR)/latex all-pdf + @echo "pdflatex finished; the PDF files are in $(BUILDDIR)/latex." + +.PHONY: latexpdfja +latexpdfja: + $(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) $(BUILDDIR)/latex + @echo "Running LaTeX files through platex and dvipdfmx..." + $(MAKE) -C $(BUILDDIR)/latex all-pdf-ja + @echo "pdflatex finished; the PDF files are in $(BUILDDIR)/latex." + +.PHONY: text +text: + $(SPHINXBUILD) -b text $(ALLSPHINXOPTS) $(BUILDDIR)/text + @echo + @echo "Build finished. The text files are in $(BUILDDIR)/text." + +.PHONY: man +man: + $(SPHINXBUILD) -b man $(ALLSPHINXOPTS) $(BUILDDIR)/man + @echo + @echo "Build finished. The manual pages are in $(BUILDDIR)/man." + +.PHONY: texinfo +texinfo: + $(SPHINXBUILD) -b texinfo $(ALLSPHINXOPTS) $(BUILDDIR)/texinfo + @echo + @echo "Build finished. The Texinfo files are in $(BUILDDIR)/texinfo." + @echo "Run \`make' in that directory to run these through makeinfo" \ + "(use \`make info' here to do that automatically)." + +.PHONY: info +info: + $(SPHINXBUILD) -b texinfo $(ALLSPHINXOPTS) $(BUILDDIR)/texinfo + @echo "Running Texinfo files through makeinfo..." + make -C $(BUILDDIR)/texinfo info + @echo "makeinfo finished; the Info files are in $(BUILDDIR)/texinfo." + +.PHONY: gettext +gettext: + $(SPHINXBUILD) -b gettext $(I18NSPHINXOPTS) $(BUILDDIR)/locale + @echo + @echo "Build finished. The message catalogs are in $(BUILDDIR)/locale." + +.PHONY: changes +changes: + $(SPHINXBUILD) -b changes $(ALLSPHINXOPTS) $(BUILDDIR)/changes + @echo + @echo "The overview file is in $(BUILDDIR)/changes." + +.PHONY: linkcheck +linkcheck: + $(SPHINXBUILD) -b linkcheck $(ALLSPHINXOPTS) $(BUILDDIR)/linkcheck + @echo + @echo "Link check complete; look for any errors in the above output " \ + "or in $(BUILDDIR)/linkcheck/output.txt." + +.PHONY: doctest +doctest: + $(SPHINXBUILD) -b doctest $(ALLSPHINXOPTS) $(BUILDDIR)/doctest + @echo "Testing of doctests in the sources finished, look at the " \ + "results in $(BUILDDIR)/doctest/output.txt." + +.PHONY: coverage +coverage: + $(SPHINXBUILD) -b coverage $(ALLSPHINXOPTS) $(BUILDDIR)/coverage + @echo "Testing of coverage in the sources finished, look at the " \ + "results in $(BUILDDIR)/coverage/python.txt." + +.PHONY: xml +xml: + $(SPHINXBUILD) -b xml $(ALLSPHINXOPTS) $(BUILDDIR)/xml + @echo + @echo "Build finished. The XML files are in $(BUILDDIR)/xml." + +.PHONY: pseudoxml +pseudoxml: + $(SPHINXBUILD) -b pseudoxml $(ALLSPHINXOPTS) $(BUILDDIR)/pseudoxml + @echo + @echo "Build finished. The pseudo-XML files are in $(BUILDDIR)/pseudoxml." diff --git a/tools/polly/docs/conf.py b/tools/polly/docs/conf.py new file mode 100644 index 0000000..a81b421 --- /dev/null +++ b/tools/polly/docs/conf.py @@ -0,0 +1,317 @@ +#!/usr/bin/env python3 +# -*- coding: utf-8 -*- +# +# Polly documentation build configuration file, created by +# sphinx-quickstart on Mon Jul 25 21:47:33 2016. +# +# This file is execfile()d with the current directory set to its +# containing dir. +# +# Note that not all possible configuration values are present in this +# autogenerated file. +# +# All configuration values have a default; values that are commented out +# serve to show the default. + +import sys +import os + +# If extensions (or modules to document with autodoc) are in another directory, +# add these directories to sys.path here. If the directory is relative to the +# documentation root, use os.path.abspath to make it absolute, like shown here. +#sys.path.insert(0, os.path.abspath('.')) + +# -- General configuration ------------------------------------------------ + +# If your documentation needs a minimal Sphinx version, state it here. +#needs_sphinx = '1.0' + +# on_rtd is whether we are on readthedocs.org, this line of code grabbed from docs.readthedocs.org +on_rtd = os.environ.get('READTHEDOCS', None) == 'True' + +# Add any Sphinx extension module names here, as strings. They can be +# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom +# ones. +extensions = [] + +if not on_rtd: + extensions.append('sphinxcontrib.spelling') + spelling_show_suggestions = True + spelling_word_list_filename = 'spelling.txt' + +# Add any paths that contain templates here, relative to this directory. +templates_path = ['_templates'] + +# The suffix(es) of source filenames. +# You can specify multiple suffix as a list of string: +# source_suffix = ['.rst', '.md'] +source_suffix = '.rst' + +# The encoding of source files. +#source_encoding = 'utf-8-sig' + +# The master toctree document. +master_doc = 'index' + +# General information about the project. +project = 'Polly' +copyright = '2013-2016, Ruslan Baratov' +author = 'Ruslan Baratov' + +# The version info for the project you're documenting, acts as replacement for +# |version| and |release|, also used in various other places throughout the +# built documents. +# +# The short X.Y version. +version = '0.10' +# The full version, including alpha/beta/rc tags. +release = '0.10' + +# The language for content autogenerated by Sphinx. Refer to documentation +# for a list of supported languages. +# +# This is also used if you do content translation via gettext catalogs. +# Usually you set "language" from the command line for these cases. +language = None + +# There are two options for replacing |today|: either, you set today to some +# non-false value, then it is used: +#today = '' +# Else, today_fmt is used as the format for a strftime call. +#today_fmt = '%B %d, %Y' + +# List of patterns, relative to source directory, that match files and +# directories to ignore when looking for source files. +exclude_patterns = ['_build', '_venv', 'rtfd-css', 'examples/docs.rst'] + +# The reST default role (used for this markup: `text`) to use for all +# documents. +#default_role = None + +# If true, '()' will be appended to :func: etc. cross-reference text. +#add_function_parentheses = True + +# If true, the current module name will be prepended to all description +# unit titles (such as .. function::). +#add_module_names = True + +# If true, sectionauthor and moduleauthor directives will be shown in the +# output. They are ignored by default. +#show_authors = False + +# The name of the Pygments (syntax highlighting) style to use. +pygments_style = 'sphinx' + +# A list of ignored prefixes for module index sorting. +#modindex_common_prefix = [] + +# If true, keep warnings as "system message" paragraphs in the built documents. +#keep_warnings = False + +# If true, `todo` and `todoList` produce output, else they produce nothing. +todo_include_todos = False + + +# -- Options for HTML output ---------------------------------------------- + +# The theme to use for HTML and HTML Help pages. See the documentation for +# a list of builtin themes. +html_theme = 'default' + +# Theme options are theme-specific and customize the look and feel of a theme +# further. For a list of options available for each theme, see the +# documentation. +#html_theme_options = {} + +# From: +# * https://github.com/snide/sphinx_rtd_theme#using-this-theme-locally-then-building-on-read-the-docs + +if not on_rtd: # only import and set the theme if we're building docs locally + import sphinx_rtd_theme + html_theme = 'sphinx_rtd_theme' + html_theme_path = [sphinx_rtd_theme.get_html_theme_path()] + +# Suppress warnings: http://stackoverflow.com/a/28778969/2288008 +if not on_rtd: + import sphinx.environment + from docutils.utils import get_source_line + + def _warn_node(self, msg, node, **kwargs): + if not msg.startswith('nonlocal image URI found:'): + self._warnfunc(msg, '%s:%s' % get_source_line(node), **kwargs) + + sphinx.environment.BuildEnvironment.warn_node = _warn_node + +# Add any paths that contain custom themes here, relative to this directory. +#html_theme_path = [] + +# The name for this set of Sphinx documents. If None, it defaults to +# " v documentation". +#html_title = None + +# A shorter title for the navigation bar. Default is the same as html_title. +#html_short_title = None + +# The name of an image file (relative to this directory) to place at the top +# of the sidebar. +#html_logo = None + +# The name of an image file (relative to this directory) to use as a favicon of +# the docs. This file should be a Windows icon file (.ico) being 16x16 or 32x32 +# pixels large. +#html_favicon = None + +# Add any paths that contain custom static files (such as style sheets) here, +# relative to this directory. They are copied after the builtin static files, +# so a file named "default.css" will overwrite the builtin "default.css". +html_static_path = ['_static', 'rtfd-css/docs/rtfd-css'] + +# Add custom .css files +# https://github.com/snide/sphinx_rtd_theme/issues/117#issuecomment-41571653 +def setup(app): + app.add_stylesheet("custom.css") + app.add_stylesheet("rtfd-css.css") + +# Add any extra paths that contain custom files (such as robots.txt or +# .htaccess) here, relative to this directory. These files are copied +# directly to the root of the documentation. +#html_extra_path = [] + +# If not '', a 'Last updated on:' timestamp is inserted at every page bottom, +# using the given strftime format. +#html_last_updated_fmt = '%b %d, %Y' + +# If true, SmartyPants will be used to convert quotes and dashes to +# typographically correct entities. +#html_use_smartypants = True + +# Custom sidebar templates, maps document names to template names. +#html_sidebars = {} + +# Additional templates that should be rendered to pages, maps page names to +# template names. +#html_additional_pages = {} + +# If false, no module index is generated. +#html_domain_indices = True + +# If false, no index is generated. +#html_use_index = True + +# If true, the index is split into individual pages for each letter. +#html_split_index = False + +# If true, links to the reST sources are added to the pages. +#html_show_sourcelink = True + +# If true, "Created using Sphinx" is shown in the HTML footer. Default is True. +#html_show_sphinx = True + +# If true, "(C) Copyright ..." is shown in the HTML footer. Default is True. +#html_show_copyright = True + +# If true, an OpenSearch description file will be output, and all pages will +# contain a tag referring to it. The value of this option must be the +# base URL from which the finished HTML is served. +#html_use_opensearch = '' + +# This is the file name suffix for HTML files (e.g. ".xhtml"). +#html_file_suffix = None + +# Language to be used for generating the HTML full-text search index. +# Sphinx supports the following languages: +# 'da', 'de', 'en', 'es', 'fi', 'fr', 'h', 'it', 'ja' +# 'nl', 'no', 'pt', 'ro', 'r', 'sv', 'tr' +#html_search_language = 'en' + +# A dictionary with options for the search language support, empty by default. +# Now only 'ja' uses this config value +#html_search_options = {'type': 'default'} + +# The name of a javascript file (relative to the configuration directory) that +# implements a search results scorer. If empty, the default will be used. +#html_search_scorer = 'scorer.js' + +# Output file base name for HTML help builder. +htmlhelp_basename = 'Pollydoc' + +# -- Options for LaTeX output --------------------------------------------- + +latex_elements = { +# The paper size ('letterpaper' or 'a4paper'). +#'papersize': 'letterpaper', + +# The font size ('10pt', '11pt' or '12pt'). +#'pointsize': '10pt', + +# Additional stuff for the LaTeX preamble. +#'preamble': '', + +# Latex figure (float) alignment +#'figure_align': 'htbp', +} + +# Grouping the document tree into LaTeX files. List of tuples +# (source start file, target name, title, +# author, documentclass [howto, manual, or own class]). +latex_documents = [ + (master_doc, 'Polly.tex', 'Polly Documentation', + 'Ruslan Baratov', 'manual'), +] + +# The name of an image file (relative to this directory) to place at the top of +# the title page. +#latex_logo = None + +# For "manual" documents, if this is true, then toplevel headings are parts, +# not chapters. +#latex_use_parts = False + +# If true, show page references after internal links. +#latex_show_pagerefs = False + +# If true, show URL addresses after external links. +#latex_show_urls = False + +# Documents to append as an appendix to all manuals. +#latex_appendices = [] + +# If false, no module index is generated. +#latex_domain_indices = True + + +# -- Options for manual page output --------------------------------------- + +# One entry per manual page. List of tuples +# (source start file, name, description, authors, manual section). +man_pages = [ + (master_doc, 'polly', 'Polly Documentation', + [author], 1) +] + +# If true, show URL addresses after external links. +#man_show_urls = False + + +# -- Options for Texinfo output ------------------------------------------- + +# Grouping the document tree into Texinfo files. List of tuples +# (source start file, target name, title, author, +# dir menu entry, description, category) +texinfo_documents = [ + (master_doc, 'Polly', 'Polly Documentation', + author, 'Polly', 'One line description of project.', + 'Miscellaneous'), +] + +# Documents to append as an appendix to all manuals. +#texinfo_appendices = [] + +# If false, no module index is generated. +#texinfo_domain_indices = True + +# How to display URL addresses: 'footnote', 'no', or 'inline'. +#texinfo_show_urls = 'footnote' + +# If true, do not generate a @detailmenu in the "Top" node's menu. +#texinfo_no_detailmenu = False diff --git a/tools/polly/docs/index.rst b/tools/polly/docs/index.rst new file mode 100644 index 0000000..93910a8 --- /dev/null +++ b/tools/polly/docs/index.rst @@ -0,0 +1,17 @@ +.. Copyright (c) 2016, Ruslan Baratov +.. All rights reserved. + +Polly: Collection of CMake toolchains +===================================== + +.. warning:: + + Documentation is in process of migrating from + `GitHub wiki `_. + Some information may be missing: blank pages, broken links, etc. + Will be fixed soon... + +.. toctree:: + :maxdepth: 1 + + /toolchains diff --git a/tools/polly/docs/jenkins.sh b/tools/polly/docs/jenkins.sh new file mode 100755 index 0000000..a9a273b --- /dev/null +++ b/tools/polly/docs/jenkins.sh @@ -0,0 +1,34 @@ +#!/bin/bash -e + +function wrong_dir() { + echo "Please run script from 'docs' directory" + exit 1 +} + +[ -f "`pwd`/jenkins.sh" ] || wrong_dir + +venv_dir="`pwd`/_venv" +src="${venv_dir}/bin/activate" + +if [ ! -f "${src}" ]; +then + virtualenv "${venv_dir}" +fi + +source "${src}" + +which python +python --version + +which pip +pip --version + +pip install -U pip +pip install -r requirements.txt + +rm -rf _build _static _spelling + +mkdir _static + +sphinx-build -v -W . _build +sphinx-build -b spelling . _spelling diff --git a/tools/polly/docs/make.sh b/tools/polly/docs/make.sh new file mode 100755 index 0000000..01f12d8 --- /dev/null +++ b/tools/polly/docs/make.sh @@ -0,0 +1,12 @@ +#!/bin/bash -e + +set -x + +mkdir -p _static + +sphinx-build -v . _build + +set +x + +echo "Done:" +echo "`pwd`/_build/index.html" diff --git a/tools/polly/docs/requirements.txt b/tools/polly/docs/requirements.txt new file mode 100644 index 0000000..beca227 --- /dev/null +++ b/tools/polly/docs/requirements.txt @@ -0,0 +1,3 @@ +Sphinx==1.4.5 +sphinx-rtd-theme==0.1.9 +sphinxcontrib-spelling==2.2.0 diff --git a/tools/polly/docs/screens/ios-team-id.png b/tools/polly/docs/screens/ios-team-id.png new file mode 100644 index 0000000..c25b52d Binary files /dev/null and b/tools/polly/docs/screens/ios-team-id.png differ diff --git a/tools/polly/docs/spelling.txt b/tools/polly/docs/spelling.txt new file mode 100644 index 0000000..091063d --- /dev/null +++ b/tools/polly/docs/spelling.txt @@ -0,0 +1,54 @@ +AppVeyor +CGold +CMake +CPack +CTest +Config +Cygwin +Dereferenced +Dereferencing +Executables +GCC +GTest +IDE +IDEs +Listfile +Makefile +Makefiles +NMake +OSX +Screenshot +Stackoverflow +Subdirectories +Subdirectory +Toolchain +Uncheck +Uninstall +Unrelocatable +Wikipedia +Workflow +Xcode +autotools +bijective +boolean +breakpoint +checkbox +configs +dereferenced +dereferencing +executables +globbing +hacky +hunterization +iOS +listfile +listfiles +multi +namespace +showstopper +subproject +toolchain +toolchains +wiki +workarounded +workflow diff --git a/tools/polly/docs/toolchains.rst b/tools/polly/docs/toolchains.rst new file mode 100644 index 0000000..7b9e858 --- /dev/null +++ b/tools/polly/docs/toolchains.rst @@ -0,0 +1,15 @@ +.. Copyright (c) 2016, Ruslan Baratov +.. All rights reserved. + +Toolchains +========== + +.. toctree:: + :maxdepth: 1 + + /toolchains/android + /toolchains/ios + /toolchains/gcc-musl + /toolchains/clang-omp + /toolchains/linux-mingw-w64 + /toolchains/raspberry-pi diff --git a/tools/polly/docs/toolchains/android.rst b/tools/polly/docs/toolchains/android.rst new file mode 100644 index 0000000..ab20a26 --- /dev/null +++ b/tools/polly/docs/toolchains/android.rst @@ -0,0 +1,57 @@ +.. Copyright (c) 2016, Ruslan Baratov +.. All rights reserved. + +.. spelling:: + + vc + ndk + api + +Android +------- + +.. seealso:: + + * `Android history by API level `__ + * `Android ABI management `__ + +android-ndk-X-api-Y-* +===================== + +Android toolchain. + +* Name: ``Android NDK X / API Y / ... / c++11 support`` +* Add ``CMAKE_CXX_FLAGS``: ``-std=c++11`` + +.. note:: + + * Minimum version of CMake is 3.7.1 + * `v0.10.2 `__ + is the latest release which do support version of CMake less than 3.7.1 + (based on `taka-no-me`_ toolchain) + +.. toctree:: + :maxdepth: 1 + + /toolchains/android/old + +.. _taka-no-me: https://github.com/taka-no-me/android-cmake + +android-vc-ndk-X-api-Y-* +======================== + +Android toolchains for Visual Studio 14 2015 IDE. + +.. admonition:: CGold + + * You have to install `additional tools`_ before using this toolchain + +.. _additional tools: http://cgold.readthedocs.io/en/latest/platforms/android/windows.html + +* Name: ``Android NDK X / API Y / ... / c++11 support`` +* Add ``CMAKE_CXX_FLAGS``: ``-std=c++11`` + +.. toctree:: + :maxdepth: 1 + + /toolchains/android/developer-notes diff --git a/tools/polly/docs/toolchains/android/developer-notes.rst b/tools/polly/docs/toolchains/android/developer-notes.rst new file mode 100644 index 0000000..8269b01 --- /dev/null +++ b/tools/polly/docs/toolchains/android/developer-notes.rst @@ -0,0 +1,48 @@ +.. Copyright (c) 2016, Ruslan Baratov +.. All rights reserved. + +.. spelling:: + + thru + +Developer notes +=============== + +Visual Studio controlling variables: + +* `CMAKE_VC_MDD_ANDROID_API_LEVEL `__ +* `CMAKE_VC_MDD_ANDROID_PLATFORM_TOOLSET `__ +* `CMAKE_VC_MDD_ANDROID_USE_OF_STL `__ + +Provide Information: + +* `VC_MDD `__ +* `VC_MDD_ANDROID `__ +* `VC_MDD_ANDROID_VERSION `__ + +Mapping: + ++---------------------------------------+--------------------------------------------+ +| `Polly`_ | `VCMDDAndroid`_ | ++=======================================+============================================+ +| ANDROID_NDK_VERSION | Always set to ``r10e`` [1]_. | +| | Used to verify ANDROID_NDK [2]_ | ++---------------------------------------+--------------------------------------------+ +| ANDROID_NATIVE_API_LEVEL | Used to set CMAKE_VC_MDD_ANDROID_API_LEVEL | ++---------------------------------------+--------------------------------------------+ +| ANDROID_ABI | Used to set ANDROID_ARCH_NAME [3]_ | ++---------------------------------------+--------------------------------------------+ +| CMAKE_VC_MDD_ANDROID_PLATFORM_TOOLSET | Used as is | ++---------------------------------------+--------------------------------------------+ + +.. note:: + + * CMAKE_VC_MDD_ANDROID_USE_OF_STL set by default to ``gnustl_static`` + +.. _Polly: https://github.com/ruslo/polly +.. _VCMDDAndroid: https://github.com/Microsoft/CMake/tree/feature/VCMDDAndroid + +.. [1] From `comments `__: + "This is not exposed thru CMake". +.. [2] NDK dir taken from [HKEY_CURRENT_USER\\SOFTWARE\\Microsoft\\VisualStudio\\14.0_Config\\Setup\\vs\\SecondaryInstall\\AndroidNDK64\\NDK_HOME] +.. [3] ANDROID_ARCH_NAME used to set ANDROID_TOOLCHAIN_NAME and ANDROID_TOOLCHAIN_MACHINE_NAME diff --git a/tools/polly/docs/toolchains/android/old.rst b/tools/polly/docs/toolchains/android/old.rst new file mode 100644 index 0000000..5396faa --- /dev/null +++ b/tools/polly/docs/toolchains/android/old.rst @@ -0,0 +1,59 @@ +.. Copyright (c) 2016, Ruslan Baratov +.. All rights reserved. + +.. spelling:: + + taka + +Migration to CMake 3.7.1+ +------------------------- + +Here is the table for migrating from toolchain based on `taka-no-me`_ project to +CMake 3.7.1+: + ++---------------------------------+-------------------------------------------+ +| taka-no-me | CMake 3.7.1+ | ++=================================+===========================================+ +| ANDROID_NATIVE_API_LEVEL | `CMAKE_SYSTEM_VERSION`_ | ++---------------------------------+-------------------------------------------+ +| ANDROID_NDK | `CMAKE_ANDROID_NDK`_ | ++---------------------------------+-------------------------------------------+ +| ANDROID_STL | `CMAKE_ANDROID_STL_TYPE`_ | ++---------------------------------+-------------------------------------------+ +| ANDROID_NDK_ABI_NAME | `CMAKE_ANDROID_ARCH_ABI`_ | ++---------------------------------+-------------------------------------------+ +| ANDROID_ARCH_NAME | `CMAKE_ANDROID_ARCH`_ | ++---------------------------------+-------------------------------------------+ +| ANDROID_ABI | `CMAKE_ANDROID_ARCH_ABI`_ [1]_ | ++---------------------------------+-------------------------------------------+ +| ANDROID_TOOLCHAIN_MACHINE_NAME | `CMAKE__ANDROID_TOOLCHAIN_MACHINE`_ | ++---------------------------------+-------------------------------------------+ +| ANDROID_COMPILER_VERSION | `CMAKE_ANDROID_NDK_TOOLCHAIN_VERSION`_ | ++---------------------------------+-------------------------------------------+ +| ANDROID_NDK_HOST_SYSTEM_NAME | `CMAKE_ANDROID_NDK_TOOLCHAIN_HOST_TAG`_ | ++---------------------------------+-------------------------------------------+ + +.. _taka-no-me: https://github.com/taka-no-me/android-cmake +.. _CMAKE_SYSTEM_VERSION: https://cmake.org/cmake/help/latest/variable/CMAKE_SYSTEM_VERSION.html +.. _CMAKE_ANDROID_NDK: https://cmake.org/cmake/help/latest/variable/CMAKE_ANDROID_NDK.html +.. _CMAKE_ANDROID_ARCH_ABI: https://cmake.org/cmake/help/latest/variable/CMAKE_ANDROID_ARCH_ABI.html +.. _CMAKE_ANDROID_ARCH: https://cmake.org/cmake/help/latest/variable/CMAKE_ANDROID_ARCH.html +.. _CMAKE_ANDROID_STL_TYPE: https://cmake.org/cmake/help/latest/variable/CMAKE_ANDROID_STL_TYPE.html +.. _CMAKE_CXX_ANDROID_TOOLCHAIN_MACHINE: https://cmake.org/cmake/help/latest/variable/CMAKE_LANG_ANDROID_TOOLCHAIN_MACHINE.html +.. _CMAKE_ANDROID_NDK_TOOLCHAIN_VERSION: https://cmake.org/cmake/help/latest/variable/CMAKE_ANDROID_NDK_TOOLCHAIN_VERSION.html + + +.. [1] Additionally `CMAKE_ANDROID_ARM_MODE`_ and `CMAKE_ANDROID_ARM_NEON`_ + should be used for obtaining more accurate information about ABI + +.. note:: + + ``ANDROID_TOOLCHAIN_NAME`` has no analogy in CMake 3.7+. + Closest is `CMAKE_CXX_ANDROID_TOOLCHAIN_MACHINE`_ with `CMAKE_ANDROID_NDK_TOOLCHAIN_VERSION`_. + +.. _CMAKE_ANDROID_ARM_MODE: https://cmake.org/cmake/help/latest/variable/CMAKE_ANDROID_ARM_MODE.html +.. _CMAKE_ANDROID_ARM_NEON: https://cmake.org/cmake/help/latest/variable/CMAKE_ANDROID_ARM_NEON.html + +.. _CMAKE__ANDROID_TOOLCHAIN_MACHINE: https://cmake.org/cmake/help/latest/variable/CMAKE_LANG_ANDROID_TOOLCHAIN_MACHINE.html +.. _CMAKE_ANDROID_NDK_TOOLCHAIN_VERSION: https://cmake.org/cmake/help/latest/variable/CMAKE_ANDROID_NDK_TOOLCHAIN_VERSION.html +.. _CMAKE_ANDROID_NDK_TOOLCHAIN_HOST_TAG: https://cmake.org/cmake/help/latest/variable/CMAKE_ANDROID_NDK_TOOLCHAIN_HOST_TAG.html diff --git a/tools/polly/docs/toolchains/clang-omp.rst b/tools/polly/docs/toolchains/clang-omp.rst new file mode 100644 index 0000000..965e764 --- /dev/null +++ b/tools/polly/docs/toolchains/clang-omp.rst @@ -0,0 +1,32 @@ +.. Copyright (c) 2017, Ruslan Baratov +.. All rights reserved. + +.. spelling:: + + omp + +clang-omp +--------- + +Download Clang from (tested with Clang 4.0): + +* http://releases.llvm.org/ + +Save directory with Clang in environment variable ``CLANG_OMP_ROOT``. +Verify path: + +.. code-block:: none + + > ls ${CLANG_OMP_ROOT}/bin/clang++ + /.../clang-4.0.0/bin/clang++ + +Runtime +======= + +To run executable you should provide a path to shared OpenMP library. + +Modify ``DYLD_LIBRARY_PATH`` on OSX: + +.. code-block:: none + + > export DYLD_LIBRARY_PATH=${CLANG_OMP_ROOT}/lib:${DYLD_LIBRARY_PATH} diff --git a/tools/polly/docs/toolchains/gcc-musl.rst b/tools/polly/docs/toolchains/gcc-musl.rst new file mode 100644 index 0000000..abed692 --- /dev/null +++ b/tools/polly/docs/toolchains/gcc-musl.rst @@ -0,0 +1,60 @@ +.. Copyright (c) 2017, Ruslan Baratov +.. All rights reserved. + +.. spelling:: + + gcc + musl + libc + +gcc-musl +======== + +GCC toolchain with `musl libc `__ instead of +GNU libc. + +You have to build/install GCC and save path to compiler in ``GCC_MUSL_ROOT`` +environment variable. Instructions for Ubuntu are below. + +Install GCC dependencies: + +.. code-block:: none + + > sudo apt-get -y install libgmp-dev libmpfr-dev libmpc-dev + +Download building scripts: + +.. code-block:: none + + > git clone https://github.com/sabotage-linux/musl-cross + > cd musl-cross + [musl-cross]> + +Set installation path by updating ``CC_BASE_PREFIX`` variable: + +.. code-block:: none + + [musl-cross]> vim config.sh + +Run build/install: + +.. code-block:: none + + [musl-cross]> ./build.sh + +Save path to ``GCC_MUSL_ROOT`` variable +(you may want to save it in ``.bashrc``): + +.. code-block:: none + + > export GCC_MUSL_ROOT=/.../x86_64-linux-musl/bin + +Verify path: + +.. code-block:: none + + > "$GCC_MUSL_ROOT/x86_64-linux-musl-gcc" --version + x86_64-linux-musl-gcc (GCC) 5.3.0 + Copyright (C) 2015 Free Software Foundation, Inc. + This is free software; see the source for copying conditions. There is NO + warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. diff --git a/tools/polly/docs/toolchains/ios.rst b/tools/polly/docs/toolchains/ios.rst new file mode 100644 index 0000000..9c5cf2c --- /dev/null +++ b/tools/polly/docs/toolchains/ios.rst @@ -0,0 +1,155 @@ +.. Copyright (c) 2016-2017, Ruslan Baratov +.. All rights reserved. + +iOS +--- + +.. spelling:: + + ios + multiarch + nocodesign + +ios-X-Y-* +========= + +.. toctree:: + :hidden: + + ios/bundle-id + +.. warning:: + + Please check before you start: + + * Xcode version >= 5.0 + * CMake version >= 3.5 + * Since ``iOS 10.0`` you have to define ``POLLY_IOS_DEVELOPMENT_TEAM`` + variable. See + :doc:`POLLY_IOS_DEVELOPMENT_TEAM ` + for details + * Check :doc:`code signing works ` + +* Name: ``iOS X.Y Universal (iphoneos + iphonesimulator) / c++11 support`` +* Add ``CMAKE_CXX_FLAGS``: ``-std=c++11`` +* Defaults to fix `try_compile `__ command: + + * Set ``MACOSX_BUNDLE_GUI_IDENTIFIER`` to ``com.example`` + * Set ``CMAKE_MACOSX_BUNDLE`` to ``YES`` + * Set ``CMAKE_XCODE_ATTRIBUTE_CODE_SIGN_IDENTITY`` to ``iPhone Developer`` + +* Set ``CMAKE_OSX_SYSROOT`` to ``iphoneos`` +* Set ``IPHONEOS_ARCHS`` to ``armv7;armv7s;arm64`` +* Set ``IPHONESIMULATOR_ARCHS`` to ``i386;x86_64`` +* Set ``XCODE_DEVELOPER_ROOT`` to ``xcode-select -print-path`` (e.g. ``/Applications/Xcode.app/Contents/Developer/``) +* Set ``IPHONESIMULATOR_ROOT``/``IPHONEOS_ROOT`` (e.g. + ``/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer``) +* Set ``IPHONESIMULATOR_SDK_ROOT``/``IPHONEOS_SDK_ROOT`` using ``IPHONE*_ROOT`` and ``IOS_SDK_VERSION`` + (e.g. ``/.../Xcode.app/.../iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator6.1.sdk/``) + +.. note:: + + * ``build.py --ios-multiarch`` will **build** multi-architecture binary + (apply ``CMAKE_XCODE_ATTRIBUTE_ONLY_ACTIVE_ARCH=NO``). + I.e. ``armv7 armv7s arm64`` instead of ``armv7`` only + * ``build.py --ios-combined`` will **install** combined simulator + device + binary (apply ``CMAKE_IOS_INSTALL_COMBINED=YES``). I.e. ``armv7 i386`` instead of ``armv7`` + * ``build.py --ios-multiarch --ios-combined`` will build multiarch binary and + combine device/simulator binaries, i.e. final binary will be + ``i386 armv7 armv7s x86_64 arm64`` + +.. note:: + + * `Keychain unlock note `__ + +.. note:: + + * ``build.py`` script can detect environment variables + ``IOS_X_Y_DEVELOPER_DIR`` to set ``DEVELOPER_DIR`` to appropriate value, + e.g. switching between `7.0` and `7.1`: + + .. code-block:: bash + + export IOS_7_1_DEVELOPER_DIR=/Applications/xcode/5.1.1/Xcode.app/Contents/Developer + export IOS_7_0_DEVELOPER_DIR=/Applications/xcode/5.0.2/Xcode.app/Contents/Developer + +Xcode SDK installed by default: + ++-------+------+-------+-----+ +| Xcode | OS X | OS X | iOS | ++-------+------+-------+-----+ +| 4.6.3 | 10.7 | 10.8 | 6.1 | ++-------+------+-------+-----+ +| 5.0.2 | 10.8 | 10.9 | 7.0 | ++-------+------+-------+-----+ +| 5.1.1 | 10.8 | 10.9 | 7.1 | ++-------+------+-------+-----+ +| 6.0.1 | 10.9 | | 8.0 | ++-------+------+-------+-----+ +| 6.1.1 | 10.9 | 10.10 | 8.1 | ++-------+------+-------+-----+ +| 6.2 | 10.9 | 10.10 | 8.2 | ++-------+------+-------+-----+ +| 6.4 | 10.9 | 10.10 | 8.4 | ++-------+------+-------+-----+ +| 7.0 | 10.11| | 9.0 | ++-------+------+-------+-----+ +| 7.1 | 10.11| | 9.1 | ++-------+------+-------+-----+ +| 7.2 | 10.11| | 9.2 | ++-------+------+-------+-----+ +| 7.2.1 | 10.11| | 9.2 | ++-------+------+-------+-----+ +| 7.3 | 10.11| | 9.3 | ++-------+------+-------+-----+ +| 8.0 | 10.12| |10.0 | ++-------+------+-------+-----+ +| 8.1 | 10.12| |10.1 | ++-------+------+-------+-----+ +| 8.2 | 10.12| |10.2 | ++-------+------+-------+-----+ +| 8.3.1 | 10.12| |10.3 | ++-------+------+-------+-----+ +| 9.0 | 10.13| |11.0 | ++-------+------+-------+-----+ +| 9.1 | 10.13| |11.1 | ++-------+------+-------+-----+ +| 9.2 | 10.13| |11.2 | ++-------+------+-------+-----+ +| 9.3 | 10.13| |11.3 | ++-------+------+-------+-----+ +| 9.4 | 10.13| |11.4 | ++-------+------+-------+-----+ +| 10.0 | 10.14| |12.0 | ++-------+------+-------+-----+ +| 10.1 | 10.14| |12.1 | ++-------+------+-------+-----+ + +ios-X-Y-- +======================= + +* Name: ``iOS X.Y Universal (iphoneos + iphonesimulator) / / / c++11 support`` +* Same as ``ios-*``, but limited to ```` and ```` architectures +* Example: ``ios-9-0-i386-armv7`` + +ios-nocodesign-X-Y +================== + +* Name: ``iOS X.Y Universal (iphoneos + iphonesimulator) / No code sign / c++11 support`` +* Same as ``ios-*``, but without ``CMAKE_XCODE_ATTRIBUTE_CODE_SIGN_IDENTITY`` +* Very helpful in server testing (no need to install developer certificate) + +.. warning:: + + * If you're not using ``polly.py`` script you have to define + ``XCODE_XCCONFIG_FILE`` environment variable with path + to ``$POLLY_ROOT/scripts/NoCodeSign.xcconfig`` file (do not forget ``export``!) + +Errors +====== + +.. toctree:: + :maxdepth: 1 + :glob: + + /toolchains/ios/errors/* diff --git a/tools/polly/docs/toolchains/ios/bundle-id.rst b/tools/polly/docs/toolchains/ios/bundle-id.rst new file mode 100644 index 0000000..0019780 --- /dev/null +++ b/tools/polly/docs/toolchains/ios/bundle-id.rst @@ -0,0 +1,60 @@ +.. Copyright (c) 2017, Ruslan Baratov +.. All rights reserved. + +Bundle ID +--------- + +By default Polly will try to use ``com.example`` bundle ID in iOS projects. +Please follow this steps before you start working with iOS toolchains: + +* Create **native** simple Xcode project without using CMake: start Xcode + and click :menuselection:`File --> New --> Project...`: + + .. image:: screens/01_new_project.png + :align: center + +* Choose some template (e.g. ``Single View App``) and click ``Next``: + + .. image:: screens/02_single_view_app.png + :align: center + +* Fill "Product Name" with any name and set "Organization Identifier" + to ``com.example``, click ``Next``: + + .. image:: screens/03_project_options.png + :align: center + +* Verify that "Automatically manage signing" is checked. + **Set "Bundle Identifier" to "com.example" (!)**: + + .. image:: screens/04_bundle_identifier.png + :align: center + +* If you see this error + + .. code-block:: none + + The app ID "com.example" cannot be registered to your development team. + Change your bundle identifier to a unique string to try again. + + .. image:: screens/bad_bundle_id.png + :align: center + + it means you can't use ``com.example`` as default bundle ID and have + to find and save another one. Try ``com.example.polly`` or any other random + string. Then **save this string** to + :doc:`POLLY_IOS_BUNDLE_IDENTIFIER ` + environment variable so Polly can use it. + +* Run example on real device. By this you will verify that build and signing + is working correctly: + + .. image:: screens/05_run_app.png + :align: center + +.. note:: + + Related issues: + + * https://github.com/ruslo/polly/issues/102 + * https://github.com/ruslo/polly/issues/170 diff --git a/tools/polly/docs/toolchains/ios/errors/polly_ios_bundle_identifier.rst b/tools/polly/docs/toolchains/ios/errors/polly_ios_bundle_identifier.rst new file mode 100644 index 0000000..b52a9aa --- /dev/null +++ b/tools/polly/docs/toolchains/ios/errors/polly_ios_bundle_identifier.rst @@ -0,0 +1,24 @@ +.. Copyright (c) 2016, Ruslan Baratov +.. All rights reserved. + +POLLY_IOS_BUNDLE_IDENTIFIER +=========================== +When using an Apple Enterprise developer account, the ``CMAKE_TRY_COMPILE`` step +can fail with this message + +.. code-block:: none + + No profiles for 'com.example' were found: Xcode couldn't find a + provisioning profile matching 'com.example'. + + +You can bypass this problem by creating a project with a unique bundle +identifier, i.e. ``com..example`` and setting the environment +variable ``POLLY_IOS_BUNDLE_IDENTIFIER``. If the environment variable exists, +Polly will set the corresponding CMake variable ``MACOSX_BUNDLE_GUI_IDENTIFIER`` +, otherwise it is set to ``com.example``. + +.. code-block:: none + + > grep POLLY_IOS_BUNDLE_IDENTIFIER ~/.bashrc + export POLLY_IOS_BUNDLE_IDENTIFIER="com..example" diff --git a/tools/polly/docs/toolchains/ios/errors/polly_ios_development_team.rst b/tools/polly/docs/toolchains/ios/errors/polly_ios_development_team.rst new file mode 100644 index 0000000..dbfae36 --- /dev/null +++ b/tools/polly/docs/toolchains/ios/errors/polly_ios_development_team.rst @@ -0,0 +1,29 @@ +.. Copyright (c) 2016, Ruslan Baratov +.. All rights reserved. + +POLLY_IOS_DEVELOPMENT_TEAM +========================== + +Since ``iOS 10.0`` users have to +`set Team ID explicitly `__ +in CMake code. Polly will set corresponding global Xcode attribute +``CMAKE_XCODE_ATTRIBUTE_DEVELOPMENT_TEAM`` automatically using value of +environment variable ``POLLY_IOS_DEVELOPMENT_TEAM``. + +You can find your Team ID by visiting this page: + +* https://developer.apple.com/account/#/membership + +.. image:: /screens/ios-team-id.png + :align: center + +Example: + +.. code-block:: none + + > grep POLLY_IOS_DEVELOPMENT_TEAM ~/.bashrc + export POLLY_IOS_DEVELOPMENT_TEAM="KDKA6UJ6WT" + +.. admonition:: Stackoverflow + + * `How can I find my Apple Developer Team ID? `__ diff --git a/tools/polly/docs/toolchains/ios/errors/signing-request-development-team.rst b/tools/polly/docs/toolchains/ios/errors/signing-request-development-team.rst new file mode 100644 index 0000000..66b60e0 --- /dev/null +++ b/tools/polly/docs/toolchains/ios/errors/signing-request-development-team.rst @@ -0,0 +1,21 @@ +.. Copyright (c) 2017, Ruslan Baratov +.. All rights reserved. + +.. spelling:: + + xxx + +Signing for "xxx" requires a development team +--------------------------------------------- + +If configure step fails with the error similar to: + +.. code-block:: none + + Signing for "xxxxxx" requires a development team. Select a development + team in the project editor. + +First check that variable +:doc:`POLLY_IOS_DEVELOPMENT_TEAM ` +is set. Second verify that ``com.example`` can be used as a +:doc:`bundle ID `. diff --git a/tools/polly/docs/toolchains/ios/screens/01_new_project.png b/tools/polly/docs/toolchains/ios/screens/01_new_project.png new file mode 100644 index 0000000..0a4dc06 Binary files /dev/null and b/tools/polly/docs/toolchains/ios/screens/01_new_project.png differ diff --git a/tools/polly/docs/toolchains/ios/screens/02_single_view_app.png b/tools/polly/docs/toolchains/ios/screens/02_single_view_app.png new file mode 100644 index 0000000..b889d43 Binary files /dev/null and b/tools/polly/docs/toolchains/ios/screens/02_single_view_app.png differ diff --git a/tools/polly/docs/toolchains/ios/screens/03_project_options.png b/tools/polly/docs/toolchains/ios/screens/03_project_options.png new file mode 100644 index 0000000..05c2f14 Binary files /dev/null and b/tools/polly/docs/toolchains/ios/screens/03_project_options.png differ diff --git a/tools/polly/docs/toolchains/ios/screens/04_bundle_identifier.png b/tools/polly/docs/toolchains/ios/screens/04_bundle_identifier.png new file mode 100644 index 0000000..bd9e1b3 Binary files /dev/null and b/tools/polly/docs/toolchains/ios/screens/04_bundle_identifier.png differ diff --git a/tools/polly/docs/toolchains/ios/screens/05_run_app.png b/tools/polly/docs/toolchains/ios/screens/05_run_app.png new file mode 100644 index 0000000..14c9c7a Binary files /dev/null and b/tools/polly/docs/toolchains/ios/screens/05_run_app.png differ diff --git a/tools/polly/docs/toolchains/ios/screens/bad_bundle_id.png b/tools/polly/docs/toolchains/ios/screens/bad_bundle_id.png new file mode 100644 index 0000000..79aa091 Binary files /dev/null and b/tools/polly/docs/toolchains/ios/screens/bad_bundle_id.png differ diff --git a/tools/polly/docs/toolchains/linux-mingw-w64.rst b/tools/polly/docs/toolchains/linux-mingw-w64.rst new file mode 100644 index 0000000..a252221 --- /dev/null +++ b/tools/polly/docs/toolchains/linux-mingw-w64.rst @@ -0,0 +1,27 @@ +.. Copyright (c) 2017, NeroBurner +.. All rights reserved. + +.. spelling:: + + mingw + +mingw-w64 +========= + +mingw-w64 http://mingw-w64.org/ cross compiling toolchain to compile for Windows on Linux host. + +Install mingw-w64 cross compiler: + +.. code-block:: none + + > sudo apt-get -y install mingw-w64 + +Test if the compiler is installed correctly + +.. code-block:: none + + > x86_64-w64-mingw32-gcc --version + x86_64-w64-mingw32-gcc (GCC) 5.3.1 20160211 + Copyright (C) 2015 Free Software Foundation, Inc. + This is free software; see the source for copying conditions. There is NO + warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. diff --git a/tools/polly/docs/toolchains/raspberry-pi.rst b/tools/polly/docs/toolchains/raspberry-pi.rst new file mode 100644 index 0000000..3ecbfd5 --- /dev/null +++ b/tools/polly/docs/toolchains/raspberry-pi.rst @@ -0,0 +1,111 @@ +.. Copyright (c) 2017, Ruslan Baratov +.. All rights reserved. + +.. spelling:: + + Raspbian + +Raspberry Pi +------------ + +.. seealso:: + + * `Official `__ + * `Hardware Guide `__ + * `Formatting SDCard `__ + * `Download Software `__ + * `What password to use to log in after the first boot? `__ + +Raspbian (native) +================= + +Instructions for `Raspbian `__: + +.. code-block:: none + :emphasize-lines: 3 + + > lsb_release -a + No LSB modules are available. + Distributor ID: Raspbian + Description: Raspbian GNU/Linux 8.0 (jessie) + Release: 8.0 + Codename: jessie + + +.. code-block:: none + + > sudo apt-get install python3 + > sudo apt-get install g++ + > sudo apt-get install cmake + +Use ``raspberrypi*-cxx11`` toolchain, e.g. ``raspberrypi3-cxx11``: + +.. code-block:: none + :emphasize-lines: 3 + + > polly.py --toolchain raspberrypi3-cxx11 --verbose --config Release + ... + -- [polly] Raspberry Pi host + ... + +Cross-compiling +=============== + +Ubuntu +~~~~~~ + +.. seealso:: + + * `Kernel building `__ + +Download tools: + +.. code-block:: none + + > git clone https://github.com/raspberrypi/tools raspberrypi-tools + +Save paths in environment variables: + +.. code-block:: none + + > export RASPBERRYPI_CROSS_COMPILE_TOOLCHAIN_PATH=/.../raspberrypi-tools/arm-bcm2708/gcc-linaro-arm-linux-gnueabihf-raspbian-x64/bin + > export RASPBERRYPI_CROSS_COMPILE_TOOLCHAIN_PREFIX=arm-linux-gnueabihf + > export RASPBERRYPI_CROSS_COMPILE_SYSROOT=/.../raspberrypi-tools/arm-bcm2708/gcc-linaro-arm-linux-gnueabihf-raspbian-x64/arm-linux-gnueabihf/libc + + +GCC 4.9 configuration: + +.. code-block:: none + + > export RASPBERRYPI_CROSS_COMPILE_TOOLCHAIN_PATH=/.../raspberrypi-tools/arm-bcm2708/arm-rpi-4.9.3-linux-gnueabihf/bin/ + > export RASPBERRYPI_CROSS_COMPILE_TOOLCHAIN_PREFIX=arm-linux-gnueabihf + > export RASPBERRYPI_CROSS_COMPILE_SYSROOT=/.../raspberrypi-tools/arm-bcm2708/arm-rpi-4.9.3-linux-gnueabihf/arm-linux-gnueabihf/sysroot + +Use ``raspberrypi*-cxx11`` toolchain, e.g. ``raspberrypi3-cxx11``: + +.. code-block:: none + + > polly.py --toolchain raspberrypi3-cxx11 --verbose --config Release + +OSX +~~~ + +Download tools: + +.. code-block:: none + + > git clone https://github.com/pretyman/raspberrypi2-mac-crosscompiler raspberrypi-tools + +Save paths in environment variables: + +.. code-block:: none + + > export RASPBERRYPI_CROSS_COMPILE_TOOLCHAIN_PATH=/.../raspberrypi-tools/x-tools/arm-unknown-linux-gnueabihf/bin/ + > export RASPBERRYPI_CROSS_COMPILE_TOOLCHAIN_PREFIX=arm-unknown-linux-gnueabihf + > export RASPBERRYPI_CROSS_COMPILE_SYSROOT=/.../raspberrypi-tools/x-tools/arm-unknown-linux-gnueabihf/arm-unknown-linux-gnueabihf/sysroot + +Use ``raspberrypi*-cxx11`` toolchain, e.g. ``raspberrypi3-cxx11``: + +.. code-block:: none + + > polly.py --toolchain raspberrypi3-cxx11 --verbose --config Release diff --git a/tools/polly/emscripten-cxx11.cmake b/tools/polly/emscripten-cxx11.cmake new file mode 100644 index 0000000..728d540 --- /dev/null +++ b/tools/polly/emscripten-cxx11.cmake @@ -0,0 +1,21 @@ +# Copyright (c) 2016, Alexandre Pretyman +# All rights reserved. + +if(DEFINED POLLY_EMSCRIPTEN_CXX11_CMAKE) + return() +else() + set(POLLY_EMSCRIPTEN_CXX11_CMAKE 1) +endif() + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_init.cmake") + +polly_init( + "Emscripten Cross Compile / C++11" + "Unix Makefiles" +) + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_common.cmake") +include(polly_clear_environment_variables) +include("${CMAKE_CURRENT_LIST_DIR}/flags/cxx11.cmake") +include("${CMAKE_CURRENT_LIST_DIR}/compiler/emscripten.cmake") + diff --git a/tools/polly/emscripten-cxx14.cmake b/tools/polly/emscripten-cxx14.cmake new file mode 100644 index 0000000..b9822ee --- /dev/null +++ b/tools/polly/emscripten-cxx14.cmake @@ -0,0 +1,21 @@ +# Copyright (c) 2016, Alexandre Pretyman +# All rights reserved. + +if(DEFINED POLLY_EMSCRIPTEN_CXX14_CMAKE) + return() +else() + set(POLLY_EMSCRIPTEN_CXX14_CMAKE 1) +endif() + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_init.cmake") + +polly_init( + "Emscripten Cross Compile / C++14" + "Unix Makefiles" +) + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_common.cmake") +include(polly_clear_environment_variables) +include("${CMAKE_CURRENT_LIST_DIR}/flags/cxx14.cmake") +include("${CMAKE_CURRENT_LIST_DIR}/compiler/emscripten.cmake") + diff --git a/tools/polly/emscripten-cxx17.cmake b/tools/polly/emscripten-cxx17.cmake new file mode 100644 index 0000000..d317dbe --- /dev/null +++ b/tools/polly/emscripten-cxx17.cmake @@ -0,0 +1,21 @@ +# Copyright (c) 2016, Alexandre Pretyman +# All rights reserved. + +if(DEFINED POLLY_EMSCRIPTEN_CXX17_CMAKE) + return() +else() + set(POLLY_EMSCRIPTEN_CXX17_CMAKE 1) +endif() + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_init.cmake") + +polly_init( + "Emscripten Cross Compile / C++17" + "Unix Makefiles" +) + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_common.cmake") +include(polly_clear_environment_variables) +include("${CMAKE_CURRENT_LIST_DIR}/flags/cxx17.cmake") +include("${CMAKE_CURRENT_LIST_DIR}/compiler/emscripten.cmake") + diff --git a/tools/polly/examples/01-executable/CMakeLists.txt b/tools/polly/examples/01-executable/CMakeLists.txt new file mode 100644 index 0000000..77b6307 --- /dev/null +++ b/tools/polly/examples/01-executable/CMakeLists.txt @@ -0,0 +1,18 @@ +# Copyright (c) 2013-2016, Ruslan Baratov +# All rights reserved. + +cmake_minimum_required(VERSION 2.8.8) +project(01-executable) + +add_executable(simple "./main.cpp") + +install(TARGETS simple DESTINATION bin) + +enable_testing() +if(IOS) + add_test(NAME SimpleTest COMMAND "${CMAKE_COMMAND}" -E echo "Skip iOS test") +elseif(ANDROID) + add_test(NAME SimpleTest COMMAND "${CMAKE_COMMAND}" -E echo "Skip Android test") +else() + add_test(NAME SimpleTest COMMAND simple) +endif() diff --git a/tools/polly/examples/01-executable/main.cpp b/tools/polly/examples/01-executable/main.cpp new file mode 100644 index 0000000..4a1c395 --- /dev/null +++ b/tools/polly/examples/01-executable/main.cpp @@ -0,0 +1,47 @@ +#include // EXIT_SUCCESS +#include // std::cout + +#if __cplusplus >= 201703L +# include +#elif __cplusplus >= 201402L +# include +# include + +auto f() // this function returns multiple values +{ + int x = 5; + // not "return {x,7};" because the corresponding + // tuple constructor is explicit (LWG 2051) + return std::make_tuple(x, 7); +} + +#endif + +int main() { + std::cout << "Hello!" << std::endl; + +#if __cplusplus >= 201703L + // C++ 17 + auto x1 = { 1, 2 }; + std::cout << "C++17: "; + for ( auto a : x1 ) { std::cout << a << " "; } + std::cout << std::endl; +#elif __cplusplus >= 201402L + // heterogeneous tuple construction + int n = 1; + auto t = std::make_tuple(10, "Test", 3.14, std::ref(n), n); + n = 7; + std::cout << "C++14: The value of t is " << "(" + << std::get<0>(t) << ", " << std::get<1>(t) << ", " + << std::get<2>(t) << ", " << std::get<3>(t) << ", " + << std::get<4>(t) << ")\n"; + + // function returning multiple values + int a, b; + std::tie(a, b) = f(); + std::cout << "C++14: " << a << " " << b << "\n"; +#endif + return EXIT_SUCCESS; +} + + diff --git a/tools/polly/examples/02-library/CMakeLists.txt b/tools/polly/examples/02-library/CMakeLists.txt new file mode 100644 index 0000000..7b4a485 --- /dev/null +++ b/tools/polly/examples/02-library/CMakeLists.txt @@ -0,0 +1,20 @@ +# Copyright (c) 2013-2016, Ruslan Baratov +# All rights reserved. + +cmake_minimum_required(VERSION 2.8.8) +project(02-library) + +add_library(foo "./foo.cpp") +install(TARGETS foo DESTINATION lib) + +add_executable(simple "./main.cpp") +target_link_libraries(simple foo) + +enable_testing() +if(IOS) + add_test(NAME SimpleTest COMMAND "${CMAKE_COMMAND}" -E echo "Skip iOS test") +elseif(ANDROID) + add_test(NAME SimpleTest COMMAND "${CMAKE_COMMAND}" -E echo "Skip Android test") +else() + add_test(NAME SimpleTest COMMAND simple) +endif() diff --git a/tools/polly/examples/02-library/foo.cpp b/tools/polly/examples/02-library/foo.cpp new file mode 100644 index 0000000..70d65c6 --- /dev/null +++ b/tools/polly/examples/02-library/foo.cpp @@ -0,0 +1,6 @@ +#include // std::cout + +int foo() { + std::cout << "Hello from foo" << std::endl; + return 42; +} diff --git a/tools/polly/examples/02-library/main.cpp b/tools/polly/examples/02-library/main.cpp new file mode 100755 index 0000000..63290cb --- /dev/null +++ b/tools/polly/examples/02-library/main.cpp @@ -0,0 +1,8 @@ +#include + +int foo(); + +int main() { + std::cout << "Foo say:" << std::endl; + foo(); +} diff --git a/tools/polly/examples/03-shared-link/CMakeLists.txt b/tools/polly/examples/03-shared-link/CMakeLists.txt new file mode 100644 index 0000000..c8f99d0 --- /dev/null +++ b/tools/polly/examples/03-shared-link/CMakeLists.txt @@ -0,0 +1,31 @@ +# Copyright (c) 2013-2016, Ruslan Baratov +# All rights reserved. + +cmake_minimum_required(VERSION 2.8.8) +project(03-shared-link) + +include(GenerateExportHeader) + +add_library(foo SHARED foo.cpp) +add_library(boo SHARED boo.cpp) + +generate_export_header(foo) +generate_export_header(boo) + +include_directories("${CMAKE_CURRENT_BINARY_DIR}") + +target_link_libraries(boo foo) + +install(TARGETS boo DESTINATION lib) + +add_executable(simple "./main.cpp") +target_link_libraries(simple boo) + +enable_testing() +if(IOS) + add_test(NAME SimpleTest COMMAND "${CMAKE_COMMAND}" -E echo "Skip iOS test") +elseif(ANDROID) + add_test(NAME SimpleTest COMMAND "${CMAKE_COMMAND}" -E echo "Skip Android test") +else() + add_test(NAME SimpleTest COMMAND simple) +endif() diff --git a/tools/polly/examples/03-shared-link/boo.cpp b/tools/polly/examples/03-shared-link/boo.cpp new file mode 100644 index 0000000..5926621 --- /dev/null +++ b/tools/polly/examples/03-shared-link/boo.cpp @@ -0,0 +1,10 @@ +#include + +#include "boo_export.h" + +int foo(); + +BOO_EXPORT int boo() { + std::cout << "boo: " << foo() << std::endl; + return 42; +} diff --git a/tools/polly/examples/03-shared-link/foo.cpp b/tools/polly/examples/03-shared-link/foo.cpp new file mode 100644 index 0000000..77b8538 --- /dev/null +++ b/tools/polly/examples/03-shared-link/foo.cpp @@ -0,0 +1,8 @@ +#include + +#include "foo_export.h" + +FOO_EXPORT int foo() { + std::cout << "foo" << std::endl; + return 0x42; +} diff --git a/tools/polly/examples/03-shared-link/main.cpp b/tools/polly/examples/03-shared-link/main.cpp new file mode 100755 index 0000000..7463ce6 --- /dev/null +++ b/tools/polly/examples/03-shared-link/main.cpp @@ -0,0 +1,8 @@ +#include + +int boo(); + +int main() { + std::cout << "Boo say:" << std::endl; + boo(); +} diff --git a/tools/polly/find/FindLibcxx.cmake b/tools/polly/find/FindLibcxx.cmake new file mode 100644 index 0000000..7313fcc --- /dev/null +++ b/tools/polly/find/FindLibcxx.cmake @@ -0,0 +1,101 @@ +# Copyright (c) 2013, Ruslan Baratov +# All rights reserved. + +if(NOT Libcxx_FIND_QUIETLY) + # TODO ??? +endif() + +if(NOT Libcxx_FIND_REQUIRED) + # TODO ??? +endif() + +if(NOT LIBCXX_ROOT) + set(LIBCXX_ROOT $ENV{LIBCXX_ROOT}) +endif() + +include(polly_fatal_error) +include(polly_status_print) + +if(NOT LIBCXX_ROOT) + polly_fatal_error( + "LIBCXX_ROOT not found. Please set cmake or environment variable" + ) +endif() + +if(Libcxx_FOUND) + return() +endif() + +polly_status_print("Libcxx root: ${LIBCXX_ROOT}") + +set( + Libcxx_INCLUDE_DIRS + "${LIBCXX_ROOT}/include/c++/v1" +) + +set(_find_libcxx_save_find_suffixes ${CMAKE_FIND_LIBRARY_SUFFIXES}) +if(Libcxx_USE_STATIC_LIBS) + polly_status_print("Libcxx static libraries: ON") + set(CMAKE_FIND_LIBRARY_SUFFIXES ${CMAKE_STATIC_LIBRARY_SUFFIX}) +else() + polly_status_print("Libcxx static libraries: OFF") + set(CMAKE_FIND_LIBRARY_SUFFIXES ${CMAKE_SHARED_LIBRARY_SUFFIX}) +endif() + +set(_find_libcxx_install_path "${LIBCXX_ROOT}/lib") + +if(CMAKE_DEBUG_POSTFIX) + set(_find_libcxx_debug_name c++${CMAKE_DEBUG_POSTFIX}) +else() + polly_status_print("CMAKE_DEBUG_POSTFIX is empty, no Debug library variant") + set(_find_libcxx_debug_name c++) +endif() + +find_library( + Libcxx_LIBRARY_DEBUG + ${_find_libcxx_debug_name} + PATH + "${_find_libcxx_install_path}" + NO_DEFAULT_PATH +) + +if(NOT Libcxx_LIBRARY_DEBUG) + polly_fatal_error( + "Libcxx library(debug): ${_find_libcxx_debug_name}, " + "not found in: ${_find_libcxx_install_path}" + ) +endif() + +find_library( + Libcxx_LIBRARY_RELEASE + c++ + PATH + "${_find_libcxx_install_path}" + NO_DEFAULT_PATH +) + +if(NOT Libcxx_LIBRARY_RELEASE) + polly_fatal_error( + "Libcxx library(release) not found in: ${_find_libcxx_install_path}" + ) +endif() + +set( + Libcxx_LIBRARY + debug + "${Libcxx_LIBRARY_DEBUG}" + optimized + "${Libcxx_LIBRARY_RELEASE}" +) + +# revert cmake suffixes +set(CMAKE_FIND_LIBRARY_SUFFIXES ${_find_libcxx_save_find_suffixes}) + +find_library(LibcxxAbi_LIBRARY c++abi) +if(NOT LibcxxAbi_LIBRARY) + polly_fatal_error("libc++abi not found") +endif() + +set(Libcxx_LIBRARIES ${Libcxx_LIBRARY} ${LibcxxAbi_LIBRARY}) + +set(Libcxx_FOUND TRUE) diff --git a/tools/polly/flags/32bit.cmake b/tools/polly/flags/32bit.cmake new file mode 100644 index 0000000..f7143ff --- /dev/null +++ b/tools/polly/flags/32bit.cmake @@ -0,0 +1,13 @@ +# Copyright (c) 2017, Ruslan Baratov +# All rights reserved. + +if(DEFINED POLLY_FLAGS_32BIT_CMAKE) + return() +else() + set(POLLY_FLAGS_32BIT_CMAKE 1) +endif() + +include(polly_add_cache_flag) + +polly_add_cache_flag(CMAKE_CXX_FLAGS "-m32") +polly_add_cache_flag(CMAKE_C_FLAGS "-m32") diff --git a/tools/polly/flags/bitcode.cmake b/tools/polly/flags/bitcode.cmake new file mode 100644 index 0000000..cd49e73 --- /dev/null +++ b/tools/polly/flags/bitcode.cmake @@ -0,0 +1,22 @@ +# Copyright (c) 2014-2017, Ruslan Baratov +# All rights reserved. + +if(DEFINED POLLY_FLAGS_BITCODE_) + return() +else() + set(POLLY_FLAGS_BITCODE_ 1) +endif() + +set(CMAKE_XCODE_ATTRIBUTE_ENABLE_BITCODE YES) + +# It is not enough to set ENABLE_BITCODE to get binaries built with real bitcode information inside +# We should set BITCODE_GENERATION_MODE to "bitcode" for release builds and to "marker" for debug builds +# Only release builds usually need real bitcode for submission to Apple AppStore, so we'll save time on build +# +# https://medium.com/@heitorburger/static-libraries-frameworks-and-bitcode-6d8f784478a9 + +set(CMAKE_XCODE_ATTRIBUTE_BITCODE_GENERATION_MODE[variant=Debug] "marker") +set(CMAKE_XCODE_ATTRIBUTE_BITCODE_GENERATION_MODE "bitcode") + +list(APPEND HUNTER_TOOLCHAIN_UNDETECTABLE_ID "bitcode.3") + diff --git a/tools/polly/flags/c11.cmake b/tools/polly/flags/c11.cmake new file mode 100644 index 0000000..85eadcc --- /dev/null +++ b/tools/polly/flags/c11.cmake @@ -0,0 +1,18 @@ +# Copyright (c) 2017, Ruslan Baratov +# All rights reserved. + +if(DEFINED POLLY_FLAGS_C11_CMAKE_) + return() +else() + set(POLLY_FLAGS_C11_CMAKE_ 1) +endif() + +include(polly_add_cache_flag) + +# Do not add this flag to 'flags/cxx11': +# * FAIL: OpenSSL + gcc-4-8-c11 +# * FAIL: lzma + gcc-4-8 +polly_add_cache_flag(CMAKE_C_FLAGS_INIT "-std=c11") + +# Hunter doesn't run toolchain-id calculation for C compiler +list(APPEND HUNTER_TOOLCHAIN_UNDETECTABLE_ID "c11") diff --git a/tools/polly/flags/clang-tidy.cmake b/tools/polly/flags/clang-tidy.cmake new file mode 100644 index 0000000..49b6864 --- /dev/null +++ b/tools/polly/flags/clang-tidy.cmake @@ -0,0 +1,12 @@ +# Copyright (c) 2018, Ruslan Baratov +# All rights reserved. + +if(DEFINED POLLY_FLAGS_CLANG_TIDY_CMAKE_) + return() +else() + set(POLLY_FLAGS_CLANG_TIDY_CMAKE_ 1) +endif() + +set(CMAKE_CXX_CLANG_TIDY clang-tidy) +set(CMAKE_C_CLANG_TIDY clang-tidy) +list(APPEND HUNTER_TOOLCHAIN_UNDETECTABLE_ID "clang-tidy") diff --git a/tools/polly/flags/cxx11.cmake b/tools/polly/flags/cxx11.cmake new file mode 100644 index 0000000..84a02af --- /dev/null +++ b/tools/polly/flags/cxx11.cmake @@ -0,0 +1,26 @@ +# Copyright (c) 2013, Ruslan Baratov +# All rights reserved. + +if(DEFINED POLLY_FLAGS_CXX11_CMAKE) + return() +else() + set(POLLY_FLAGS_CXX11_CMAKE 1) +endif() + +include(polly_add_cache_flag) + +string(COMPARE EQUAL "${ANDROID_NDK_VERSION}" "" _not_android) + +# TODO: test other platfroms, CMAKE_CXX_FLAGS_INIT should work for all +if(_not_android) + polly_add_cache_flag(CMAKE_CXX_FLAGS "-std=c++11") +else() + polly_add_cache_flag(CMAKE_CXX_FLAGS_INIT "-std=c++11") +endif() + +# Set CMAKE_CXX_STANDARD to cache to override project local value if present. +# FORCE added in case CMAKE_CXX_STANDARD already set in cache +# (e.g. set before 'project' by user). +set(CMAKE_CXX_STANDARD 11 CACHE STRING "C++ Standard (toolchain)" FORCE) +set(CMAKE_CXX_STANDARD_REQUIRED YES CACHE BOOL "C++ Standard required" FORCE) +set(CMAKE_CXX_EXTENSIONS NO CACHE BOOL "C++ Standard extensions" FORCE) diff --git a/tools/polly/flags/cxx14.cmake b/tools/polly/flags/cxx14.cmake new file mode 100644 index 0000000..1750df5 --- /dev/null +++ b/tools/polly/flags/cxx14.cmake @@ -0,0 +1,26 @@ +# Copyright (c) 2013, Ruslan Baratov +# All rights reserved. + +if(DEFINED POLLY_FLAGS_CXX14_CMAKE) + return() +else() + set(POLLY_FLAGS_CXX14_CMAKE 1) +endif() + +include(polly_add_cache_flag) + +string(COMPARE EQUAL "${ANDROID_NDK_VERSION}" "" _not_android) + +# TODO: test other platfroms, CMAKE_CXX_FLAGS_INIT should work for all +if(_not_android) + polly_add_cache_flag(CMAKE_CXX_FLAGS "-std=c++14") +else() + polly_add_cache_flag(CMAKE_CXX_FLAGS_INIT "-std=c++14") +endif() + +# Set CMAKE_CXX_STANDARD to cache to override project local value if present. +# FORCE added in case CMAKE_CXX_STANDARD already set in cache +# (e.g. set before 'project' by user). +set(CMAKE_CXX_STANDARD 14 CACHE STRING "C++ Standard (toolchain)" FORCE) +set(CMAKE_CXX_STANDARD_REQUIRED YES CACHE BOOL "C++ Standard required" FORCE) +set(CMAKE_CXX_EXTENSIONS NO CACHE BOOL "C++ Standard extensions" FORCE) diff --git a/tools/polly/flags/cxx17-gnu.cmake b/tools/polly/flags/cxx17-gnu.cmake new file mode 100644 index 0000000..15d84ed --- /dev/null +++ b/tools/polly/flags/cxx17-gnu.cmake @@ -0,0 +1,29 @@ +# Copyright (c) 2013, 2018, Ruslan Baratov +# All rights reserved. + +if(DEFINED POLLY_FLAGS_CXX17_GNU_CMAKE_) + return() +else() + set(POLLY_FLAGS_CXX17_GNU_CMAKE_ 1) +endif() + +include(polly_add_cache_flag) +include(polly_fatal_error) + +string(COMPARE EQUAL "${ANDROID_NDK_VERSION}" "" _not_android) + +# TODO: test other platfroms, CMAKE_CXX_FLAGS_INIT should work for all +if(HUNTER_CMAKE_GENERATOR MATCHES "^Visual Studio.*$") + polly_fatal_error("Use flags/vs-cxx17.cmake instead") +elseif(_not_android) + polly_add_cache_flag(CMAKE_CXX_FLAGS "-std=gnu++17") +else() + polly_add_cache_flag(CMAKE_CXX_FLAGS_INIT "-std=gnu++17") +endif() + +# Set CMAKE_CXX_STANDARD to cache to override project local value if present. +# FORCE added in case CMAKE_CXX_STANDARD already set in cache +# (e.g. set before 'project' by user). +set(CMAKE_CXX_STANDARD 17 CACHE STRING "C++ Standard (toolchain)" FORCE) +set(CMAKE_CXX_STANDARD_REQUIRED YES CACHE BOOL "C++ Standard required" FORCE) +set(CMAKE_CXX_EXTENSIONS ON CACHE BOOL "C++ Standard extensions" FORCE) # GNU diff --git a/tools/polly/flags/cxx17.cmake b/tools/polly/flags/cxx17.cmake new file mode 100644 index 0000000..cb98b8f --- /dev/null +++ b/tools/polly/flags/cxx17.cmake @@ -0,0 +1,29 @@ +# Copyright (c) 2013, Ruslan Baratov +# All rights reserved. + +if(DEFINED POLLY_FLAGS_CXX17_CMAKE) + return() +else() + set(POLLY_FLAGS_CXX17_CMAKE 1) +endif() + +include(polly_add_cache_flag) +include(polly_fatal_error) + +string(COMPARE EQUAL "${ANDROID_NDK_VERSION}" "" _not_android) + +# TODO: test other platfroms, CMAKE_CXX_FLAGS_INIT should work for all +if(HUNTER_CMAKE_GENERATOR MATCHES "^Visual Studio.*$") + polly_fatal_error("Use flags/vs-cxx17.cmake instead") +elseif(_not_android) + polly_add_cache_flag(CMAKE_CXX_FLAGS "-std=c++17") +else() + polly_add_cache_flag(CMAKE_CXX_FLAGS_INIT "-std=c++17") +endif() + +# Set CMAKE_CXX_STANDARD to cache to override project local value if present. +# FORCE added in case CMAKE_CXX_STANDARD already set in cache +# (e.g. set before 'project' by user). +set(CMAKE_CXX_STANDARD 17 CACHE STRING "C++ Standard (toolchain)" FORCE) +set(CMAKE_CXX_STANDARD_REQUIRED YES CACHE BOOL "C++ Standard required" FORCE) +set(CMAKE_CXX_EXTENSIONS NO CACHE BOOL "C++ Standard extensions" FORCE) diff --git a/tools/polly/flags/cxx98.cmake b/tools/polly/flags/cxx98.cmake new file mode 100644 index 0000000..e28dbd6 --- /dev/null +++ b/tools/polly/flags/cxx98.cmake @@ -0,0 +1,19 @@ +# Copyright (c) 2015, Ruslan Baratov +# All rights reserved. + +if(DEFINED POLLY_FLAGS_CXX98_CMAKE_) + return() +else() + set(POLLY_FLAGS_CXX98_CMAKE_ 1) +endif() + +include(polly_add_cache_flag) + +polly_add_cache_flag(CMAKE_CXX_FLAGS "-std=c++98") + +# Set CMAKE_CXX_STANDARD to cache to override project local value if present. +# FORCE added in case CMAKE_CXX_STANDARD already set in cache +# (e.g. set before 'project' by user). +set(CMAKE_CXX_STANDARD 98 CACHE STRING "C++ Standard (toolchain)" FORCE) +set(CMAKE_CXX_STANDARD_REQUIRED YES CACHE BOOL "C++ Standard required" FORCE) +set(CMAKE_CXX_EXTENSIONS NO CACHE BOOL "C++ Standard extensions" FORCE) diff --git a/tools/polly/flags/data-sections.cmake b/tools/polly/flags/data-sections.cmake new file mode 100644 index 0000000..b3174da --- /dev/null +++ b/tools/polly/flags/data-sections.cmake @@ -0,0 +1,26 @@ +# Copyright (c) 2013-2016, Ruslan Baratov +# Copyright (c) 2016, David Hirvonen +# All rights reserved. + +if(DEFINED POLLY_FLAGS_DATA_SECTIONS_CMAKE) + return() +else() + set(POLLY_FLAGS_DATA_SECTIONS_CMAKE 1) +endif() + +include(polly_add_cache_flag) + +string(COMPARE EQUAL "${ANDROID_NDK_VERSION}" "" _not_android) + +# TODO: test other platfroms, CMAKE_CXX_FLAGS_INIT should work for all +if(_not_android) + polly_add_cache_flag(CMAKE_CXX_FLAGS "-fdata-sections") + polly_add_cache_flag(CMAKE_C_FLAGS "-fdata-sections") +else() + polly_add_cache_flag(CMAKE_CXX_FLAGS_INIT "-fdata-sections") + polly_add_cache_flag(CMAKE_C_FLAGS_INIT "-fdata-sections") +endif() + +# There is no macro to detect this flags on toolchain calculation so we must +# mark this toolchain explicitly. +list(APPEND HUNTER_TOOLCHAIN_UNDETECTABLE_ID "data-sections") diff --git a/tools/polly/flags/fpic.cmake b/tools/polly/flags/fpic.cmake new file mode 100644 index 0000000..ee7108d --- /dev/null +++ b/tools/polly/flags/fpic.cmake @@ -0,0 +1,32 @@ +# Copyright (c) 2015, Ruslan Baratov, David Hirvonen +# All rights reserved. + +if(DEFINED POLLY_FLAGS_FPIC_CMAKE_) + return() +else() + set(POLLY_FLAGS_FPIC_CMAKE_ 1) +endif() + +include(polly_add_cache_flag) + +string(COMPARE EQUAL "${ANDROID_NDK_VERSION}" "" _not_android) + +# TODO: test other platfroms, CMAKE_CXX_FLAGS_INIT should work for all +if(_not_android) + polly_add_cache_flag(CMAKE_CXX_FLAGS "-fPIC") + polly_add_cache_flag(CMAKE_C_FLAGS "-fPIC") + polly_add_cache_flag(CMAKE_Fortran_FLAGS "-fPIC") +else() + polly_add_cache_flag(CMAKE_CXX_FLAGS_INIT "-fPIC") + polly_add_cache_flag(CMAKE_C_FLAGS_INIT "-fPIC") + polly_add_cache_flag(CMAKE_Fortran_FLAGS_INIT "-fPIC") +endif() + +set( + CMAKE_POSITION_INDEPENDENT_CODE + TRUE + CACHE + BOOL + "Position independent code" + FORCE +) diff --git a/tools/polly/flags/function-sections.cmake b/tools/polly/flags/function-sections.cmake new file mode 100644 index 0000000..029f4c2 --- /dev/null +++ b/tools/polly/flags/function-sections.cmake @@ -0,0 +1,26 @@ +# Copyright (c) 2013-2016, Ruslan Baratov +# Copyright (c) 2016, David Hirvonen +# All rights reserved. + +if(DEFINED POLLY_FLAGS_FUNCTION_SECTIONS_CMAKE) + return() +else() + set(POLLY_FLAGS_FUNCTION_SECTIONS_CMAKE 1) +endif() + +include(polly_add_cache_flag) + +string(COMPARE EQUAL "${ANDROID_NDK_VERSION}" "" _not_android) + +# TODO: test other platfroms, CMAKE_CXX_FLAGS_INIT should work for all +if(_not_android) + polly_add_cache_flag(CMAKE_CXX_FLAGS "-ffunction-sections") + polly_add_cache_flag(CMAKE_C_FLAGS "-ffunction-sections") +else() + polly_add_cache_flag(CMAKE_CXX_FLAGS_INIT "-ffunction-sections") + polly_add_cache_flag(CMAKE_C_FLAGS_INIT "-ffunction-sections") +endif() + +# There is no macro to detect this flags on toolchain calculation so we must +# mark this toolchain explicitly. +list(APPEND HUNTER_TOOLCHAIN_UNDETECTABLE_ID "function-sections") diff --git a/tools/polly/flags/gnuxx11.cmake b/tools/polly/flags/gnuxx11.cmake new file mode 100644 index 0000000..1844e59 --- /dev/null +++ b/tools/polly/flags/gnuxx11.cmake @@ -0,0 +1,18 @@ +# Copyright (c) 2018, NeroBurner +# All rights reserved. + +if(DEFINED POLLY_FLAGS_GNUXX11_CMAKE) + return() +else() + set(POLLY_FLAGS_GNUXX11_CMAKE 1) +endif() + +include(polly_add_cache_flag) + +polly_add_cache_flag(CMAKE_CXX_FLAGS "-std=gnu++11") + +# Set CMAKE_CXX_STANDARD to cache to override project local value if present. +# FORCE added in case CMAKE_CXX_STANDARD already set in cache +# (e.g. set before 'project' by user). +set(CMAKE_CXX_STANDARD 11 CACHE STRING "C++ Standard (toolchain)" FORCE) +set(CMAKE_CXX_STANDARD_REQUIRED YES CACHE BOOL "C++ Standard required" FORCE) diff --git a/tools/polly/flags/gold.cmake b/tools/polly/flags/gold.cmake new file mode 100644 index 0000000..2e58f26 --- /dev/null +++ b/tools/polly/flags/gold.cmake @@ -0,0 +1,13 @@ +# Copyright (c) 2015, Ruslan Baratov +# All rights reserved. + +if(DEFINED POLLY_FLAGS_GOLD_CMAKE_) + return() +else() + set(POLLY_FLAGS_GOLD_CMAKE_ 1) +endif() + +include(polly_add_cache_flag) + +polly_add_cache_flag(CMAKE_CXX_FLAGS "-fuse-ld=gold") +polly_add_cache_flag(CMAKE_C_FLAGS "-fuse-ld=gold") diff --git a/tools/polly/flags/hardfloat.cmake b/tools/polly/flags/hardfloat.cmake new file mode 100644 index 0000000..ab67666 --- /dev/null +++ b/tools/polly/flags/hardfloat.cmake @@ -0,0 +1,13 @@ +# Copyright (c) 2017, NeroBurner +# All rights reserved. + +if(DEFINED POLLY_FLAGS_HARDFLOAT_CMAKE_) + return() +else() + set(POLLY_FLAGS_HARDFLOAT_CMAKE_ 1) +endif() + +include(polly_add_cache_flag) + +polly_add_cache_flag(CMAKE_CXX_FLAGS "-mfloat-abi=hard") +polly_add_cache_flag(CMAKE_C_FLAGS "-mfloat-abi=hard") diff --git a/tools/polly/flags/hidden.cmake b/tools/polly/flags/hidden.cmake new file mode 100644 index 0000000..c1f6f25 --- /dev/null +++ b/tools/polly/flags/hidden.cmake @@ -0,0 +1,27 @@ +# Copyright (c) 2015, Ruslan Baratov +# All rights reserved. + +if(DEFINED POLLY_FLAGS_HIDDEN_CMAKE_) + return() +else() + set(POLLY_FLAGS_HIDDEN_CMAKE_ 1) +endif() + +include(polly_add_cache_flag) + +string(COMPARE EQUAL "${ANDROID_NDK_VERSION}" "" _not_android) + +# TODO: test other platfroms, CMAKE_CXX_FLAGS_INIT should work for all +if(_not_android) + polly_add_cache_flag(CMAKE_CXX_FLAGS "-fvisibility=hidden") + polly_add_cache_flag(CMAKE_CXX_FLAGS "-fvisibility-inlines-hidden") # only C++ + polly_add_cache_flag(CMAKE_C_FLAGS "-fvisibility=hidden") +else() + polly_add_cache_flag(CMAKE_CXX_FLAGS_INIT "-fvisibility=hidden") + polly_add_cache_flag(CMAKE_CXX_FLAGS_INIT "-fvisibility-inlines-hidden") # only C++ + polly_add_cache_flag(CMAKE_C_FLAGS_INIT "-fvisibility=hidden") +endif() + +# There is no macro to detect this flags on toolchain calculation so we must +# mark this toolchain explicitly. +list(APPEND HUNTER_TOOLCHAIN_UNDETECTABLE_ID "hidden") diff --git a/tools/polly/flags/ios_nocodesign.cmake b/tools/polly/flags/ios_nocodesign.cmake new file mode 100644 index 0000000..d65e65f --- /dev/null +++ b/tools/polly/flags/ios_nocodesign.cmake @@ -0,0 +1,52 @@ +# Copyright (c) 2014-2017, Ruslan Baratov +# All rights reserved. + +if(DEFINED POLLY_FLAGS_IOS_NOCODESIGN_CMAKE_) + return() +else() + set(POLLY_FLAGS_IOS_NOCODESIGN_CMAKE_ 1) +endif() + +# Verify XCODE_XCCONFIG_FILE +set( + _polly_xcode_xcconfig_file_path + "${CMAKE_CURRENT_LIST_DIR}/../scripts/NoCodeSign.xcconfig" +) + +get_filename_component( + _polly_xcode_xcconfig_file_path + "${_polly_xcode_xcconfig_file_path}" + ABSOLUTE +) + +get_filename_component( + _polly_xcode_xcconfig_file_path_env + "$ENV{XCODE_XCCONFIG_FILE}" + ABSOLUTE +) + +if(NOT EXISTS "${_polly_xcode_xcconfig_file_path_env}") + polly_fatal_error( + "Path specified by XCODE_XCCONFIG_FILE environment variable not found" + "($ENV{XCODE_XCCONFIG_FILE})" + "Use this command to set: " + " export XCODE_XCCONFIG_FILE=${_polly_xcode_xcconfig_file_path}" + ) +else() + string( + COMPARE + NOTEQUAL + "${_polly_xcode_xcconfig_file_path_env}" + "${_polly_xcode_xcconfig_file_path}" + _polly_wrong_xcconfig_path + ) + if(_polly_wrong_xcconfig_path) + message( + WARNING + "Unexpected XCODE_XCCONFIG_FILE value: " + " ${_polly_xcode_xcconfig_file_path_env}" + "expected: " + " ${_polly_xcode_xcconfig_file_path}" + ) + endif() +endif() diff --git a/tools/polly/flags/lto.cmake b/tools/polly/flags/lto.cmake new file mode 100644 index 0000000..7d83008 --- /dev/null +++ b/tools/polly/flags/lto.cmake @@ -0,0 +1,17 @@ +# Copyright (c) 2014-2017, Ruslan Baratov +# All rights reserved. + +if(DEFINED POLLY_FLAGS_LTO_CMAKE_) + return() +else() + set(POLLY_FLAGS_LTO_CMAKE_ 1) +endif() + +include(polly_fatal_error) + +if(NOT POLICY CMP0069) + polly_fatal_error("Bad CMake version") +endif() + +set(CMAKE_INTERPROCEDURAL_OPTIMIZATION YES) +list(APPEND HUNTER_TOOLCHAIN_UNDETECTABLE_ID "lto.v2") diff --git a/tools/polly/flags/mtune_cortex-a15.cmake b/tools/polly/flags/mtune_cortex-a15.cmake new file mode 100644 index 0000000..1eb6998 --- /dev/null +++ b/tools/polly/flags/mtune_cortex-a15.cmake @@ -0,0 +1,16 @@ +# Copyright (c) 2017, NeroBurner +# All rights reserved. + +if(DEFINED POLLY_FLAGS_MTUNE_CORTEX-A15_CMAKE_) + return() +else() + set(POLLY_FLAGS_MTUNE_CORTEX-A15_CMAKE_ 1) +endif() + +include(polly_add_cache_flag) + +# generate code that works best on the specified hardware +list(APPEND HUNTER_TOOLCHAIN_UNDETECTABLE_ID "cortex-a15") +polly_add_cache_flag(CMAKE_CXX_FLAGS "-mtune=cortex-a15") +polly_add_cache_flag(CMAKE_C_FLAGS "-mtune=cortex-a15") + diff --git a/tools/polly/flags/neon-vfpv4.cmake b/tools/polly/flags/neon-vfpv4.cmake new file mode 100644 index 0000000..20fcb0d --- /dev/null +++ b/tools/polly/flags/neon-vfpv4.cmake @@ -0,0 +1,13 @@ +# Copyright (c) 2017, NeroBurner +# All rights reserved. + +if(DEFINED POLLY_FLAGS_NEON_VFPV4_CMAKE_) + return() +else() + set(POLLY_FLAGS_NEON_VFPV4_CMAKE_ 1) +endif() + +include(polly_add_cache_flag) + +polly_add_cache_flag(CMAKE_CXX_FLAGS "-mfpu=neon-vfpv4") +polly_add_cache_flag(CMAKE_C_FLAGS "-mfpu=neon-vfpv4") diff --git a/tools/polly/flags/neon.cmake b/tools/polly/flags/neon.cmake new file mode 100644 index 0000000..b44f5c9 --- /dev/null +++ b/tools/polly/flags/neon.cmake @@ -0,0 +1,13 @@ +# Copyright (c) 2017, NeroBurner +# All rights reserved. + +if(DEFINED POLLY_FLAGS_NEON_CMAKE_) + return() +else() + set(POLLY_FLAGS_NEON_CMAKE_ 1) +endif() + +include(polly_add_cache_flag) + +polly_add_cache_flag(CMAKE_CXX_FLAGS "-mfpu=neon") +polly_add_cache_flag(CMAKE_C_FLAGS "-mfpu=neon") diff --git a/tools/polly/flags/openwrt.cmake b/tools/polly/flags/openwrt.cmake new file mode 100644 index 0000000..b56f2d7 --- /dev/null +++ b/tools/polly/flags/openwrt.cmake @@ -0,0 +1,29 @@ +# Copyright (c) 2017, NeroBurner +# Copyright (c) 2017, Ruslan Baratov +# All rights reserved. + +if(DEFINED POLLY_FLAGS_OPENWRT_CMAKE_) + return() +else() + set(POLLY_FLAGS_OPENWRT_CMAKE_ 1) +endif() + +include(polly_add_cache_flag) + +set( + _openwrt_flags + -pipe + -march=armv7-a + -mcpu=cortex-a9 + -mtune=cortex-a9 + -msoft-float + -mfloat-abi=soft + -fno-caller-saves + -fno-plt + "-DNEED_PRINTF=1" # http://www.dd-wrt.com/phpBB2/viewtopic.php?p=552124 +) + +foreach(_openwrt_flag ${_openwrt_flags}) + polly_add_cache_flag(CMAKE_C_FLAGS "${_openwrt_flag}") + polly_add_cache_flag(CMAKE_CXX_FLAGS "${_openwrt_flag}") +endforeach() diff --git a/tools/polly/flags/sanitize_address.cmake b/tools/polly/flags/sanitize_address.cmake new file mode 100644 index 0000000..f61a314 --- /dev/null +++ b/tools/polly/flags/sanitize_address.cmake @@ -0,0 +1,81 @@ +# Copyright (c) 2014, Ruslan Baratov +# All rights reserved. + +if(DEFINED POLLY_FLAGS_SANITIZE_ADDRESS_CMAKE_) + return() +else() + set(POLLY_FLAGS_SANITIZE_ADDRESS_CMAKE_ 1) +endif() + +include(polly_add_cache_flag) +include(polly_fatal_error) + +polly_add_cache_flag(CMAKE_CXX_FLAGS "-fsanitize=address") +polly_add_cache_flag(CMAKE_CXX_FLAGS "-g") + +set( + CMAKE_CXX_FLAGS_RELEASE + "-O1 -DNDEBUG" + CACHE + STRING + "C++ compiler flags" + FORCE +) + +polly_add_cache_flag(CMAKE_C_FLAGS "-fsanitize=address") +polly_add_cache_flag(CMAKE_C_FLAGS "-g") + +set( + CMAKE_C_FLAGS_RELEASE + "-O1 -DNDEBUG" + CACHE + STRING + "C compiler flags" + FORCE +) + +if(XCODE) + polly_add_cache_flag(CMAKE_C_FLAGS "-D_LIBCPP_HAS_NO_ASAN") + polly_add_cache_flag(CMAKE_CXX_FLAGS "-D_LIBCPP_HAS_NO_ASAN") + + string(COMPARE EQUAL "${CMAKE_XCODE_ATTRIBUTE_CC}" "" _is_empty) + if(_is_empty) + polly_fatal_error("CMAKE_XCODE_ATTRIBUTE_CC is empty") + endif() + + get_filename_component(_xcode_root "${CMAKE_XCODE_ATTRIBUTE_CC}" DIRECTORY) + + set(_xcode_asan_lib_name "libclang_rt.asan_osx_dynamic") + set( + _xcode_asan_pattern + "${_xcode_root}/../lib/clang/*/lib/darwin/${_xcode_asan_lib_name}.dylib" + ) + + file(GLOB _xcode_asan_lib "${_xcode_asan_pattern}") + list(LENGTH _xcode_asan_lib _xcode_asan_lib_length) + if(_xcode_asan_lib_length EQUAL 1) + get_filename_component(_xcode_asan_lib "${_xcode_asan_lib}" ABSOLUTE) + get_filename_component(_xcode_asan_lib_dir "${_xcode_asan_lib}" DIRECTORY) + polly_status_debug("Using ASAN library:\n") + polly_status_debug(" * ${_xcode_asan_lib}") + elseif(_xcode_asan_lib_length EQUAL 0) + polly_fatal_error("File not found by pattern: ${_xcode_asan_pattern}") + else() + polly_fatal_error("Unexpected: '${_xcode_asan_lib}'") + endif() + + polly_add_cache_flag(CMAKE_EXE_LINKER_FLAGS "${_xcode_asan_lib}") + polly_add_cache_flag(CMAKE_SHARED_LINKER_FLAGS "${_xcode_asan_lib}") + + if(CMAKE_VERSION VERSION_LESS 3.8.0) + polly_fatal_error("At least CMake 3.8.0 required (BUILD_RPATH feature)") + endif() + + set(CMAKE_BUILD_RPATH "${_xcode_asan_lib_dir}") + + # Hunter copying rules { + set_property(GLOBAL APPEND PROPERTY HUNTER_COPY_FILES "${_xcode_asan_lib}") + # Do not use SOURCE property because it's visible only for current directory + set_property(GLOBAL PROPERTY "HUNTER_DST_RELATIVE_DIR_${_xcode_asan_lib}" "lib") + # } +endif() diff --git a/tools/polly/flags/sanitize_leak.cmake b/tools/polly/flags/sanitize_leak.cmake new file mode 100644 index 0000000..1c7c045 --- /dev/null +++ b/tools/polly/flags/sanitize_leak.cmake @@ -0,0 +1,18 @@ +# Copyright (c) 2014, Ruslan Baratov +# All rights reserved. + +if(DEFINED POLLY_FLAGS_SANITIZE_LEAK_CMAKE_) + return() +else() + set(POLLY_FLAGS_SANITIZE_LEAK_CMAKE_ 1) +endif() + +include(polly_add_cache_flag) + +polly_add_cache_flag(CMAKE_CXX_FLAGS "-fsanitize=leak") +polly_add_cache_flag(CMAKE_CXX_FLAGS "-g") + +polly_add_cache_flag(CMAKE_C_FLAGS "-fsanitize=leak") +polly_add_cache_flag(CMAKE_C_FLAGS "-g") + +list(APPEND HUNTER_TOOLCHAIN_UNDETECTABLE_ID "sanitize-leak") diff --git a/tools/polly/flags/sanitize_memory.cmake b/tools/polly/flags/sanitize_memory.cmake new file mode 100644 index 0000000..a53295e --- /dev/null +++ b/tools/polly/flags/sanitize_memory.cmake @@ -0,0 +1,18 @@ +# Copyright (c) 2014, Ruslan Baratov +# All rights reserved. + +if(DEFINED POLLY_FLAGS_SANITIZE_MEMORY_CMAKE_) + return() +else() + set(POLLY_FLAGS_SANITIZE_MEMORY_CMAKE_ 1) +endif() + +include(polly_add_cache_flag) + +polly_add_cache_flag(CMAKE_CXX_FLAGS "-fsanitize=memory") +polly_add_cache_flag(CMAKE_CXX_FLAGS "-fsanitize-memory-track-origins") +polly_add_cache_flag(CMAKE_CXX_FLAGS "-g") + +polly_add_cache_flag(CMAKE_C_FLAGS "-fsanitize=memory") +polly_add_cache_flag(CMAKE_C_FLAGS "-fsanitize-memory-track-origins") +polly_add_cache_flag(CMAKE_C_FLAGS "-g") diff --git a/tools/polly/flags/sanitize_thread.cmake b/tools/polly/flags/sanitize_thread.cmake new file mode 100644 index 0000000..4b9690a --- /dev/null +++ b/tools/polly/flags/sanitize_thread.cmake @@ -0,0 +1,25 @@ +# Copyright (c) 2014-2017, Ruslan Baratov +# All rights reserved. + +if(DEFINED POLLY_FLAGS_SANITIZE_THREAD_CMAKE_) + return() +else() + set(POLLY_FLAGS_SANITIZE_THREAD_CMAKE_ 1) +endif() + +include(polly_add_cache_flag) + +polly_add_cache_flag(CMAKE_CXX_FLAGS "-fsanitize=thread") +polly_add_cache_flag(CMAKE_CXX_FLAGS "-g") + +polly_add_cache_flag(CMAKE_C_FLAGS "-fsanitize=thread") +polly_add_cache_flag(CMAKE_C_FLAGS "-g") + +# NOTE: +# +# PIE flags removed because it's not a requirement anymore: +# * https://github.com/google/sanitizers/issues/503#issuecomment-137946595 +# +# With PIE flags sanitizer doesn't work on Ubuntu 14.04/16.04 +# producing runtime error "ThreadSanitizer: unexpected memory mapping": +# * https://github.com/google/sanitizers/issues/503 diff --git a/tools/polly/flags/static-std.cmake b/tools/polly/flags/static-std.cmake new file mode 100644 index 0000000..c9f7b35 --- /dev/null +++ b/tools/polly/flags/static-std.cmake @@ -0,0 +1,19 @@ +# Copyright (c) 2015-2017, Ruslan Baratov +# All rights reserved. + +if(DEFINED POLLY_FLAGS_STATIC_STD_CMAKE_) + return() +else() + set(POLLY_FLAGS_STATIC_STD_CMAKE_ 1) +endif() + +include(polly_add_cache_flag) + +polly_add_cache_flag(CMAKE_CXX_FLAGS "-static-libgcc") +polly_add_cache_flag(CMAKE_CXX_FLAGS "-static-libstdc++") + +polly_add_cache_flag(CMAKE_C_FLAGS "-static-libgcc") + +# There is no macro to detect this flags on toolchain calculation so we must +# mark this toolchain explicitly. +list(APPEND HUNTER_TOOLCHAIN_UNDETECTABLE_ID "static-std-v2") diff --git a/tools/polly/flags/static.cmake b/tools/polly/flags/static.cmake new file mode 100644 index 0000000..05ae8e8 --- /dev/null +++ b/tools/polly/flags/static.cmake @@ -0,0 +1,17 @@ +# Copyright (c) 2015, Ruslan Baratov +# All rights reserved. + +if(DEFINED POLLY_FLAGS_STATIC_CMAKE_) + return() +else() + set(POLLY_FLAGS_STATIC_CMAKE_ 1) +endif() + +include(polly_add_cache_flag) + +polly_add_cache_flag(CMAKE_CXX_FLAGS "-static") +polly_add_cache_flag(CMAKE_C_FLAGS "-static") + +# There is no macro to detect this flags on toolchain calculation so we must +# mark this toolchain explicitly. +list(APPEND HUNTER_TOOLCHAIN_UNDETECTABLE_ID "static") diff --git a/tools/polly/flags/vs-cxx14.cmake b/tools/polly/flags/vs-cxx14.cmake new file mode 100644 index 0000000..4429668 --- /dev/null +++ b/tools/polly/flags/vs-cxx14.cmake @@ -0,0 +1,19 @@ +# Copyright (c) 2013, 2018 Ruslan Baratov +# All rights reserved. + +if(DEFINED POLLY_FLAGS_VS_CXX14_CMAKE_) + return() +else() + set(POLLY_FLAGS_VS_CXX14_CMAKE_ 1) +endif() + +include(polly_add_cache_flag) + +polly_add_cache_flag(CMAKE_CXX_FLAGS_INIT "/std:c++14") + +# Set CMAKE_CXX_STANDARD to cache to override project local value if present. +# FORCE added in case CMAKE_CXX_STANDARD already set in cache +# (e.g. set before 'project' by user). +set(CMAKE_CXX_STANDARD 14 CACHE STRING "C++ Standard (toolchain)" FORCE) +set(CMAKE_CXX_STANDARD_REQUIRED YES CACHE BOOL "C++ Standard required" FORCE) +set(CMAKE_CXX_EXTENSIONS NO CACHE BOOL "C++ Standard extensions" FORCE) diff --git a/tools/polly/flags/vs-cxx17.cmake b/tools/polly/flags/vs-cxx17.cmake new file mode 100644 index 0000000..56b5612 --- /dev/null +++ b/tools/polly/flags/vs-cxx17.cmake @@ -0,0 +1,19 @@ +# Copyright (c) 2013, 2018 Ruslan Baratov +# All rights reserved. + +if(DEFINED POLLY_FLAGS_VS_CXX17_CMAKE_) + return() +else() + set(POLLY_FLAGS_VS_CXX17_CMAKE_ 1) +endif() + +include(polly_add_cache_flag) + +polly_add_cache_flag(CMAKE_CXX_FLAGS_INIT "/std:c++17") + +# Set CMAKE_CXX_STANDARD to cache to override project local value if present. +# FORCE added in case CMAKE_CXX_STANDARD already set in cache +# (e.g. set before 'project' by user). +set(CMAKE_CXX_STANDARD 17 CACHE STRING "C++ Standard (toolchain)" FORCE) +set(CMAKE_CXX_STANDARD_REQUIRED YES CACHE BOOL "C++ Standard required" FORCE) +set(CMAKE_CXX_EXTENSIONS NO CACHE BOOL "C++ Standard extensions" FORCE) diff --git a/tools/polly/flags/vs-mt.cmake b/tools/polly/flags/vs-mt.cmake new file mode 100644 index 0000000..657f251 --- /dev/null +++ b/tools/polly/flags/vs-mt.cmake @@ -0,0 +1,15 @@ +# Copyright (c) 2016, Ruslan Baratov +# All rights reserved. + +if(DEFINED POLLY_FLAGS_VS_MT_CMAKE_) + return() +else() + set(POLLY_FLAGS_VS_MT_CMAKE_ 1) +endif() + +foreach(_lang C CXX) + set(CMAKE_${_lang}_FLAGS_DEBUG "/D_DEBUG /MTd /Zi /Ob0 /Od /RTC1" CACHE STRING "" FORCE) + set(CMAKE_${_lang}_FLAGS_MINSIZEREL "/MT /O1 /Ob1 /DNDEBUG" CACHE STRING "" FORCE) + set(CMAKE_${_lang}_FLAGS_RELEASE "/MT /O2 /Ob2 /DNDEBUG" CACHE STRING "" FORCE) + set(CMAKE_${_lang}_FLAGS_RELWITHDEBINFO "/MT /Zi /O2 /Ob1 /DNDEBUG" CACHE STRING "" FORCE) +endforeach() diff --git a/tools/polly/flags/vs-z7.cmake b/tools/polly/flags/vs-z7.cmake new file mode 100644 index 0000000..ce8aedf --- /dev/null +++ b/tools/polly/flags/vs-z7.cmake @@ -0,0 +1,17 @@ +# Copyright (c) 2018, Ruslan Baratov +# All rights reserved. + +if(DEFINED POLLY_FLAGS_VS_Z7_CMAKE_) + return() +else() + set(POLLY_FLAGS_VS_Z7_CMAKE_ 1) +endif() + +foreach(_lang C CXX) + set(CMAKE_${_lang}_FLAGS_DEBUG "/D_DEBUG /MDd /Z7 /Ob0 /Od /RTC1" CACHE STRING "" FORCE) + set(CMAKE_${_lang}_FLAGS_MINSIZEREL "/MD /O1 /Ob1 /DNDEBUG" CACHE STRING "" FORCE) + set(CMAKE_${_lang}_FLAGS_RELEASE "/MD /O2 /Ob2 /DNDEBUG" CACHE STRING "" FORCE) + set(CMAKE_${_lang}_FLAGS_RELWITHDEBINFO "/MD /Z7 /O2 /Ob1 /DNDEBUG" CACHE STRING "" FORCE) +endforeach() + +list(APPEND HUNTER_TOOLCHAIN_UNDETECTABLE_ID "/Z7") diff --git a/tools/polly/flags/vs-zw.cmake b/tools/polly/flags/vs-zw.cmake new file mode 100644 index 0000000..7fec8d2 --- /dev/null +++ b/tools/polly/flags/vs-zw.cmake @@ -0,0 +1,14 @@ +# Copyright (c) 2013, 2018 Ruslan Baratov +# All rights reserved. + +if(DEFINED POLLY_FLAGS_VS_ZW_CMAKE_) + return() +else() + set(POLLY_FLAGS_VS_ZW_CMAKE_ 1) +endif() + +include(polly_add_cache_flag) + +# https://msdn.microsoft.com/en-us/library/hh561383.aspx +polly_add_cache_flag(CMAKE_CXX_FLAGS_INIT "/ZW") +polly_add_cache_flag(CMAKE_C_FLAGS_INIT "/ZW") diff --git a/tools/polly/gcc-32bit-pic.cmake b/tools/polly/gcc-32bit-pic.cmake new file mode 100644 index 0000000..7779d43 --- /dev/null +++ b/tools/polly/gcc-32bit-pic.cmake @@ -0,0 +1,24 @@ +# Copyright (c) 2013-2017, Ruslan Baratov +# All rights reserved. + +if(DEFINED POLLY_GCC_32BIT_PIC_CMAKE_) + return() +else() + set(POLLY_GCC_32BIT_PIC_CMAKE_ 1) +endif() + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_init.cmake") + +polly_init( + "gcc / PIC / c++11 support / 32 bit" + "Unix Makefiles" +) + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_common.cmake") + +include("${CMAKE_CURRENT_LIST_DIR}/compiler/gcc.cmake") +include("${CMAKE_CURRENT_LIST_DIR}/flags/cxx11.cmake") +include("${CMAKE_CURRENT_LIST_DIR}/flags/fpic.cmake") +include("${CMAKE_CURRENT_LIST_DIR}/flags/32bit.cmake") + +include("${CMAKE_CURRENT_LIST_DIR}/os/osx.cmake") diff --git a/tools/polly/gcc-32bit.cmake b/tools/polly/gcc-32bit.cmake new file mode 100644 index 0000000..9bd0dfb --- /dev/null +++ b/tools/polly/gcc-32bit.cmake @@ -0,0 +1,23 @@ +# Copyright (c) 2013-2017, Ruslan Baratov +# All rights reserved. + +if(DEFINED POLLY_GCC_32BIT_CMAKE) + return() +else() + set(POLLY_GCC_32BIT_CMAKE 1) +endif() + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_init.cmake") + +polly_init( + "gcc / c++11 support / 32 bit" + "Unix Makefiles" +) + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_common.cmake") + +include("${CMAKE_CURRENT_LIST_DIR}/compiler/gcc.cmake") +include("${CMAKE_CURRENT_LIST_DIR}/flags/cxx11.cmake") +include("${CMAKE_CURRENT_LIST_DIR}/flags/32bit.cmake") + +include("${CMAKE_CURRENT_LIST_DIR}/os/osx.cmake") diff --git a/tools/polly/gcc-4-8-c11.cmake b/tools/polly/gcc-4-8-c11.cmake new file mode 100644 index 0000000..2786b72 --- /dev/null +++ b/tools/polly/gcc-4-8-c11.cmake @@ -0,0 +1,21 @@ +# Copyright (c) 2017, Ruslan Baratov +# All rights reserved. + +if(DEFINED POLLY_GCC48_C11_CMAKE_) + return() +else() + set(POLLY_GCC48_C11_CMAKE_ 1) +endif() + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_init.cmake") + +polly_init( + "gcc 4.8 / c++11 support / C11" + "Unix Makefiles" +) + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_common.cmake") + +include("${CMAKE_CURRENT_LIST_DIR}/compiler/gcc48.cmake") +include("${CMAKE_CURRENT_LIST_DIR}/flags/cxx11.cmake") +include("${CMAKE_CURRENT_LIST_DIR}/flags/c11.cmake") diff --git a/tools/polly/gcc-4-8-pic-hid-sections.cmake b/tools/polly/gcc-4-8-pic-hid-sections.cmake new file mode 100644 index 0000000..0808636 --- /dev/null +++ b/tools/polly/gcc-4-8-pic-hid-sections.cmake @@ -0,0 +1,24 @@ +# Copyright (c) 2016, Ruslan Baratov +# All rights reserved. + +if(DEFINED POLLY_GCC48_PIC_HID_SECTIONS_CMAKE_) + return() +else() + set(POLLY_GCC48_PIC_HID_SECTIONS_CMAKE_ 1) +endif() + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_init.cmake") + +polly_init( + "gcc 4.8 / PIC / c++11 support / hidden / function-sections / data-sections" + "Unix Makefiles" +) + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_common.cmake") + +include("${CMAKE_CURRENT_LIST_DIR}/compiler/gcc48.cmake") +include("${CMAKE_CURRENT_LIST_DIR}/flags/cxx11.cmake") +include("${CMAKE_CURRENT_LIST_DIR}/flags/fpic.cmake") +include("${CMAKE_CURRENT_LIST_DIR}/flags/function-sections.cmake") +include("${CMAKE_CURRENT_LIST_DIR}/flags/data-sections.cmake") +include("${CMAKE_CURRENT_LIST_DIR}/flags/hidden.cmake") diff --git a/tools/polly/gcc-4-8-pic.cmake b/tools/polly/gcc-4-8-pic.cmake new file mode 100644 index 0000000..db0ebbf --- /dev/null +++ b/tools/polly/gcc-4-8-pic.cmake @@ -0,0 +1,21 @@ +# Copyright (c) 2016, Ruslan Baratov +# All rights reserved. + +if(DEFINED POLLY_GCC48_PIC_CMAKE_) + return() +else() + set(POLLY_GCC48_PIC_CMAKE_ 1) +endif() + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_init.cmake") + +polly_init( + "gcc 4.8 / PIC / c++11 support" + "Unix Makefiles" +) + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_common.cmake") + +include("${CMAKE_CURRENT_LIST_DIR}/compiler/gcc48.cmake") +include("${CMAKE_CURRENT_LIST_DIR}/flags/cxx11.cmake") +include("${CMAKE_CURRENT_LIST_DIR}/flags/fpic.cmake") diff --git a/tools/polly/gcc-4-8.cmake b/tools/polly/gcc-4-8.cmake new file mode 100644 index 0000000..7488fa9 --- /dev/null +++ b/tools/polly/gcc-4-8.cmake @@ -0,0 +1,20 @@ +# Copyright (c) 2013, Ruslan Baratov +# All rights reserved. + +if(DEFINED POLLY_GCC48_CMAKE) + return() +else() + set(POLLY_GCC48_CMAKE 1) +endif() + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_init.cmake") + +polly_init( + "gcc 4.8 / c++11 support" + "Unix Makefiles" +) + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_common.cmake") + +include("${CMAKE_CURRENT_LIST_DIR}/compiler/gcc48.cmake") +include("${CMAKE_CURRENT_LIST_DIR}/flags/cxx11.cmake") diff --git a/tools/polly/gcc-5-cxx14-c11.cmake b/tools/polly/gcc-5-cxx14-c11.cmake new file mode 100644 index 0000000..d0e533e --- /dev/null +++ b/tools/polly/gcc-5-cxx14-c11.cmake @@ -0,0 +1,24 @@ +# Copyright (c) 2013-2017, Ruslan Baratov +# All rights reserved. + +if(DEFINED POLLY_GCC_5_CXX14_C11_CMAKE_) + return() +else() + set(POLLY_GCC_5_CXX14_C11_CMAKE_ 1) +endif() + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_init.cmake") + +polly_init( + "gcc 5 / c++14 support / C11" + "Unix Makefiles" +) + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_common.cmake") + +include("${CMAKE_CURRENT_LIST_DIR}/compiler/gcc-5.cmake") +include("${CMAKE_CURRENT_LIST_DIR}/flags/cxx14.cmake") +include("${CMAKE_CURRENT_LIST_DIR}/flags/c11.cmake") + +include("${CMAKE_CURRENT_LIST_DIR}/os/osx.cmake") + diff --git a/tools/polly/gcc-5-pic-hid-sections-lto.cmake b/tools/polly/gcc-5-pic-hid-sections-lto.cmake new file mode 100644 index 0000000..ce177f0 --- /dev/null +++ b/tools/polly/gcc-5-pic-hid-sections-lto.cmake @@ -0,0 +1,25 @@ +# Copyright (c) 2016-2017, Ruslan Baratov +# All rights reserved. + +if(DEFINED POLLY_GCC_5_PIC_HID_SECTIONS_LTO_CMAKE_) + return() +else() + set(POLLY_GCC_5_PIC_HID_SECTIONS_LTO_CMAKE_ 1) +endif() + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_init.cmake") + +polly_init( + "gcc 5 / PIC / c++11 support / hidden / function-sections / data-sections / LTO" + "Unix Makefiles" +) + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_common.cmake") + +include("${CMAKE_CURRENT_LIST_DIR}/compiler/gcc-5.cmake") +include("${CMAKE_CURRENT_LIST_DIR}/flags/cxx11.cmake") +include("${CMAKE_CURRENT_LIST_DIR}/flags/fpic.cmake") +include("${CMAKE_CURRENT_LIST_DIR}/flags/function-sections.cmake") +include("${CMAKE_CURRENT_LIST_DIR}/flags/data-sections.cmake") +include("${CMAKE_CURRENT_LIST_DIR}/flags/hidden.cmake") +include("${CMAKE_CURRENT_LIST_DIR}/flags/lto.cmake") diff --git a/tools/polly/gcc-5-pic-hid-sections.cmake b/tools/polly/gcc-5-pic-hid-sections.cmake new file mode 100644 index 0000000..8a9a22a --- /dev/null +++ b/tools/polly/gcc-5-pic-hid-sections.cmake @@ -0,0 +1,25 @@ +# Copyright (c) 2016-2018, Ruslan Baratov +# Copyright (c) 2018, David Hirvonen +# All rights reserved. + +if(DEFINED POLLY_GCC_5_PIC_HID_SECTIONS_CMAKE_) + return() +else() + set(POLLY_GCC_5_PIC_HID_SECTIONS_CMAKE_ 1) +endif() + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_init.cmake") + +polly_init( + "gcc 5 / PIC / c++11 support / hidden / function-sections / data-sections" + "Unix Makefiles" +) + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_common.cmake") + +include("${CMAKE_CURRENT_LIST_DIR}/compiler/gcc-5.cmake") +include("${CMAKE_CURRENT_LIST_DIR}/flags/cxx11.cmake") +include("${CMAKE_CURRENT_LIST_DIR}/flags/fpic.cmake") +include("${CMAKE_CURRENT_LIST_DIR}/flags/function-sections.cmake") +include("${CMAKE_CURRENT_LIST_DIR}/flags/data-sections.cmake") +include("${CMAKE_CURRENT_LIST_DIR}/flags/hidden.cmake") diff --git a/tools/polly/gcc-5.cmake b/tools/polly/gcc-5.cmake new file mode 100644 index 0000000..a8743e6 --- /dev/null +++ b/tools/polly/gcc-5.cmake @@ -0,0 +1,20 @@ +# Copyright (c) 2016-2017, Ruslan Baratov +# All rights reserved. + +if(DEFINED POLLY_GCC_5_CMAKE_) + return() +else() + set(POLLY_GCC_5_CMAKE_ 1) +endif() + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_init.cmake") + +polly_init( + "gcc 5 / c++11 support" + "Unix Makefiles" +) + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_common.cmake") + +include("${CMAKE_CURRENT_LIST_DIR}/compiler/gcc-5.cmake") +include("${CMAKE_CURRENT_LIST_DIR}/flags/cxx11.cmake") diff --git a/tools/polly/gcc-6-32bit-cxx14.cmake b/tools/polly/gcc-6-32bit-cxx14.cmake new file mode 100644 index 0000000..3a7df7f --- /dev/null +++ b/tools/polly/gcc-6-32bit-cxx14.cmake @@ -0,0 +1,21 @@ +# Copyright (c) 2013-2017, Ruslan Baratov +# All rights reserved. + +if(DEFINED POLLY_GCC_32BIT_CMAKE) + return() +else() + set(POLLY_GCC_32BIT_CMAKE 1) +endif() + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_init.cmake") + +polly_init( + "gcc 6 / c++14 support / 32 bit" + "Unix Makefiles" +) + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_common.cmake") + +include("${CMAKE_CURRENT_LIST_DIR}/compiler/gcc-6.cmake") +include("${CMAKE_CURRENT_LIST_DIR}/flags/cxx14.cmake") +include("${CMAKE_CURRENT_LIST_DIR}/flags/32bit.cmake") diff --git a/tools/polly/gcc-7-cxx14-pic.cmake b/tools/polly/gcc-7-cxx14-pic.cmake new file mode 100644 index 0000000..47de556 --- /dev/null +++ b/tools/polly/gcc-7-cxx14-pic.cmake @@ -0,0 +1,22 @@ +# Copyright (c) 2016-2017, Ruslan Baratov +# Copyright (c) 2017, David Hirvonen +# All rights reserved. + +if(DEFINED POLLY_GCC_7_CXX14_PIC_CMAKE_) + return() +else() + set(POLLY_GCC_7_CXX14_PIC_CMAKE_ 1) +endif() + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_init.cmake") + +polly_init( + "gcc 7 / c++14 support / PIC" + "Unix Makefiles" +) + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_common.cmake") + +include("${CMAKE_CURRENT_LIST_DIR}/compiler/gcc-7.cmake") +include("${CMAKE_CURRENT_LIST_DIR}/flags/cxx14.cmake") +include("${CMAKE_CURRENT_LIST_DIR}/flags/fpic.cmake") diff --git a/tools/polly/gcc-7-cxx14.cmake b/tools/polly/gcc-7-cxx14.cmake new file mode 100644 index 0000000..ade241a --- /dev/null +++ b/tools/polly/gcc-7-cxx14.cmake @@ -0,0 +1,21 @@ +# Copyright (c) 2016-2017, Ruslan Baratov +# Copyright (c) 2017, David Hirvonen +# All rights reserved. + +if(DEFINED POLLY_GCC_7_CXX14_CMAKE_) + return() +else() + set(POLLY_GCC_7_CXX14_CMAKE_ 1) +endif() + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_init.cmake") + +polly_init( + "gcc 7 / c++14 support" + "Unix Makefiles" +) + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_common.cmake") + +include("${CMAKE_CURRENT_LIST_DIR}/compiler/gcc-7.cmake") +include("${CMAKE_CURRENT_LIST_DIR}/flags/cxx14.cmake") diff --git a/tools/polly/gcc-7-cxx17-gnu.cmake b/tools/polly/gcc-7-cxx17-gnu.cmake new file mode 100644 index 0000000..71f0876 --- /dev/null +++ b/tools/polly/gcc-7-cxx17-gnu.cmake @@ -0,0 +1,21 @@ +# Copyright (c) 2016-2018, Ruslan Baratov +# Copyright (c) 2017, David Hirvonen +# All rights reserved. + +if(DEFINED POLLY_GCC_7_CXX17_GNU_CMAKE_) + return() +else() + set(POLLY_GCC_7_CXX17_GNU_CMAKE_ 1) +endif() + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_init.cmake") + +polly_init( + "gcc 7 / c++17 support / GNU" + "Unix Makefiles" +) + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_common.cmake") + +include("${CMAKE_CURRENT_LIST_DIR}/compiler/gcc-7.cmake") +include("${CMAKE_CURRENT_LIST_DIR}/flags/cxx17-gnu.cmake") diff --git a/tools/polly/gcc-7-cxx17-pic.cmake b/tools/polly/gcc-7-cxx17-pic.cmake new file mode 100644 index 0000000..029edca --- /dev/null +++ b/tools/polly/gcc-7-cxx17-pic.cmake @@ -0,0 +1,22 @@ +# Copyright (c) 2016-2017, Ruslan Baratov +# Copyright (c) 2017, David Hirvonen +# All rights reserved. + +if(DEFINED POLLY_GCC_7_CXX17_PIC_CMAKE_) + return() +else() + set(POLLY_GCC_7_CXX17_PIC_CMAKE_ 1) +endif() + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_init.cmake") + +polly_init( + "gcc 7 / c++17 support / PIC" + "Unix Makefiles" +) + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_common.cmake") + +include("${CMAKE_CURRENT_LIST_DIR}/compiler/gcc-7.cmake") +include("${CMAKE_CURRENT_LIST_DIR}/flags/cxx17.cmake") +include("${CMAKE_CURRENT_LIST_DIR}/flags/fpic.cmake") diff --git a/tools/polly/gcc-7-cxx17.cmake b/tools/polly/gcc-7-cxx17.cmake new file mode 100644 index 0000000..57a01c0 --- /dev/null +++ b/tools/polly/gcc-7-cxx17.cmake @@ -0,0 +1,21 @@ +# Copyright (c) 2016-2017, Ruslan Baratov +# Copyright (c) 2017, David Hirvonen +# All rights reserved. + +if(DEFINED POLLY_GCC_7_CXX17_CMAKE_) + return() +else() + set(POLLY_GCC_7_CXX17_CMAKE_ 1) +endif() + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_init.cmake") + +polly_init( + "gcc 7 / c++17 support" + "Unix Makefiles" +) + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_common.cmake") + +include("${CMAKE_CURRENT_LIST_DIR}/compiler/gcc-7.cmake") +include("${CMAKE_CURRENT_LIST_DIR}/flags/cxx17.cmake") diff --git a/tools/polly/gcc-7-pic-hid-sections-lto.cmake b/tools/polly/gcc-7-pic-hid-sections-lto.cmake new file mode 100644 index 0000000..c0482d1 --- /dev/null +++ b/tools/polly/gcc-7-pic-hid-sections-lto.cmake @@ -0,0 +1,25 @@ +# Copyright (c) 2016-2017, Ruslan Baratov +# All rights reserved. + +if(DEFINED POLLY_GCC_7_PIC_HID_SECTIONS_LTO_CMAKE_) + return() +else() + set(POLLY_GCC_7_PIC_HID_SECTIONS_LTO_CMAKE_ 1) +endif() + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_init.cmake") + +polly_init( + "gcc 7 / PIC / c++11 support / hidden / function-sections / data-sections / LTO" + "Unix Makefiles" +) + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_common.cmake") + +include("${CMAKE_CURRENT_LIST_DIR}/compiler/gcc-7.cmake") +include("${CMAKE_CURRENT_LIST_DIR}/flags/cxx11.cmake") +include("${CMAKE_CURRENT_LIST_DIR}/flags/fpic.cmake") +include("${CMAKE_CURRENT_LIST_DIR}/flags/function-sections.cmake") +include("${CMAKE_CURRENT_LIST_DIR}/flags/data-sections.cmake") +include("${CMAKE_CURRENT_LIST_DIR}/flags/hidden.cmake") +include("${CMAKE_CURRENT_LIST_DIR}/flags/lto.cmake") diff --git a/tools/polly/gcc-7.cmake b/tools/polly/gcc-7.cmake new file mode 100644 index 0000000..cf7d650 --- /dev/null +++ b/tools/polly/gcc-7.cmake @@ -0,0 +1,21 @@ +# Copyright (c) 2016-2017, Ruslan Baratov +# Copyright (c) 2017, David Hirvonen +# All rights reserved. + +if(DEFINED POLLY_GCC_7_CMAKE_) + return() +else() + set(POLLY_GCC_7_CMAKE_ 1) +endif() + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_init.cmake") + +polly_init( + "gcc 7 / c++11 support" + "Unix Makefiles" +) + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_common.cmake") + +include("${CMAKE_CURRENT_LIST_DIR}/compiler/gcc-7.cmake") +include("${CMAKE_CURRENT_LIST_DIR}/flags/cxx11.cmake") diff --git a/tools/polly/gcc-8-cxx14-fpic.cmake b/tools/polly/gcc-8-cxx14-fpic.cmake new file mode 100644 index 0000000..19363c8 --- /dev/null +++ b/tools/polly/gcc-8-cxx14-fpic.cmake @@ -0,0 +1,21 @@ +# Copyright (c) 2013, Ruslan Baratov +# All rights reserved. + +if(DEFINED POLLY_GCC_8_CXX14_FPIC_CMAKE) + return() +else() + set(POLLY_GCC_8_CXX14_FPIC_CMAKE 1) +endif() + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_init.cmake") + +polly_init( + "gcc 8 / c++14 support / Position-Independent Code" + "Unix Makefiles" +) + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_common.cmake") + +include("${CMAKE_CURRENT_LIST_DIR}/compiler/gcc-8.cmake") +include("${CMAKE_CURRENT_LIST_DIR}/flags/cxx14.cmake") +include("${CMAKE_CURRENT_LIST_DIR}/flags/fpic.cmake") diff --git a/tools/polly/gcc-8-cxx14.cmake b/tools/polly/gcc-8-cxx14.cmake new file mode 100644 index 0000000..beb5c44 --- /dev/null +++ b/tools/polly/gcc-8-cxx14.cmake @@ -0,0 +1,20 @@ +# Copyright (c) 2013, Ruslan Baratov +# All rights reserved. + +if(DEFINED POLLY_GCC_8_CXX14_CMAKE) + return() +else() + set(POLLY_GCC_8_CXX14_CMAKE 1) +endif() + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_init.cmake") + +polly_init( + "gcc 8 / c++14 support" + "Unix Makefiles" +) + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_common.cmake") + +include("${CMAKE_CURRENT_LIST_DIR}/compiler/gcc-8.cmake") +include("${CMAKE_CURRENT_LIST_DIR}/flags/cxx14.cmake") diff --git a/tools/polly/gcc-8-cxx17-fpic.cmake b/tools/polly/gcc-8-cxx17-fpic.cmake new file mode 100644 index 0000000..019047f --- /dev/null +++ b/tools/polly/gcc-8-cxx17-fpic.cmake @@ -0,0 +1,21 @@ +# Copyright (c) 2013, Ruslan Baratov +# All rights reserved. + +if(DEFINED POLLY_GCC_8_CXX17_FPIC_CMAKE) + return() +else() + set(POLLY_GCC_8_CXX17_FPIC_CMAKE 1) +endif() + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_init.cmake") + +polly_init( + "gcc 8 / c++17 support / Position-Independent Code" + "Unix Makefiles" +) + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_common.cmake") + +include("${CMAKE_CURRENT_LIST_DIR}/compiler/gcc-8.cmake") +include("${CMAKE_CURRENT_LIST_DIR}/flags/cxx17.cmake") +include("${CMAKE_CURRENT_LIST_DIR}/flags/fpic.cmake") diff --git a/tools/polly/gcc-8-cxx17.cmake b/tools/polly/gcc-8-cxx17.cmake new file mode 100644 index 0000000..47432f6 --- /dev/null +++ b/tools/polly/gcc-8-cxx17.cmake @@ -0,0 +1,20 @@ +# Copyright (c) 2013, Ruslan Baratov +# All rights reserved. + +if(DEFINED POLLY_GCC_8_CXX17_CMAKE) + return() +else() + set(POLLY_GCC_8_CXX17_CMAKE 1) +endif() + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_init.cmake") + +polly_init( + "gcc 8 / c++17 support" + "Unix Makefiles" +) + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_common.cmake") + +include("${CMAKE_CURRENT_LIST_DIR}/compiler/gcc-8.cmake") +include("${CMAKE_CURRENT_LIST_DIR}/flags/cxx17.cmake") diff --git a/tools/polly/gcc-c11.cmake b/tools/polly/gcc-c11.cmake new file mode 100644 index 0000000..d302add --- /dev/null +++ b/tools/polly/gcc-c11.cmake @@ -0,0 +1,23 @@ +# Copyright (c) 2013-2017, Ruslan Baratov +# All rights reserved. + +if(DEFINED POLLY_GCC_C11_CMAKE_) + return() +else() + set(POLLY_GCC_C11_CMAKE_ 1) +endif() + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_init.cmake") + +polly_init( + "gcc / c++11 support / C11" + "Unix Makefiles" +) + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_common.cmake") + +include("${CMAKE_CURRENT_LIST_DIR}/compiler/gcc.cmake") +include("${CMAKE_CURRENT_LIST_DIR}/flags/cxx11.cmake") +include("${CMAKE_CURRENT_LIST_DIR}/flags/c11.cmake") + +include("${CMAKE_CURRENT_LIST_DIR}/os/osx.cmake") diff --git a/tools/polly/gcc-cxx14-c11.cmake b/tools/polly/gcc-cxx14-c11.cmake new file mode 100644 index 0000000..69f71fd --- /dev/null +++ b/tools/polly/gcc-cxx14-c11.cmake @@ -0,0 +1,24 @@ +# Copyright (c) 2013-2017, Ruslan Baratov +# All rights reserved. + +if(DEFINED POLLY_GCC_CXX14_C11_CMAKE_) + return() +else() + set(POLLY_GCC_CXX14_C11_CMAKE_ 1) +endif() + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_init.cmake") + +polly_init( + "gcc / c++14 support / C11" + "Unix Makefiles" +) + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_common.cmake") + +include("${CMAKE_CURRENT_LIST_DIR}/compiler/gcc.cmake") +include("${CMAKE_CURRENT_LIST_DIR}/flags/cxx14.cmake") +include("${CMAKE_CURRENT_LIST_DIR}/flags/c11.cmake") + +include("${CMAKE_CURRENT_LIST_DIR}/os/osx.cmake") + diff --git a/tools/polly/gcc-cxx17-c11.cmake b/tools/polly/gcc-cxx17-c11.cmake new file mode 100644 index 0000000..c41e392 --- /dev/null +++ b/tools/polly/gcc-cxx17-c11.cmake @@ -0,0 +1,24 @@ +# Copyright (c) 2013-2017, Ruslan Baratov +# All rights reserved. + +if(DEFINED POLLY_GCC_CXX17_C11_CMAKE_) + return() +else() + set(POLLY_GCC_CXX14_C17_CMAKE_ 1) +endif() + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_init.cmake") + +polly_init( + "gcc / c++17 support / C11" + "Unix Makefiles" +) + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_common.cmake") + +include("${CMAKE_CURRENT_LIST_DIR}/compiler/gcc.cmake") +include("${CMAKE_CURRENT_LIST_DIR}/flags/cxx17.cmake") +include("${CMAKE_CURRENT_LIST_DIR}/flags/c11.cmake") + +include("${CMAKE_CURRENT_LIST_DIR}/os/osx.cmake") + diff --git a/tools/polly/gcc-cxx98.cmake b/tools/polly/gcc-cxx98.cmake new file mode 100644 index 0000000..0e65edf --- /dev/null +++ b/tools/polly/gcc-cxx98.cmake @@ -0,0 +1,20 @@ +# Copyright (c) 2015, Ruslan Baratov +# All rights reserved. + +if(DEFINED POLLY_GCC_CXX98_CMAKE) + return() +else() + set(POLLY_GCC_CXX98_CMAKE 1) +endif() + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_init.cmake") + +polly_init( + "gcc" + "Unix Makefiles" +) + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_common.cmake") + +include("${CMAKE_CURRENT_LIST_DIR}/compiler/gcc.cmake") +include("${CMAKE_CURRENT_LIST_DIR}/flags/cxx98.cmake") diff --git a/tools/polly/gcc-gold.cmake b/tools/polly/gcc-gold.cmake new file mode 100644 index 0000000..87c3815 --- /dev/null +++ b/tools/polly/gcc-gold.cmake @@ -0,0 +1,21 @@ +# Copyright (c) 2015, Ruslan Baratov +# All rights reserved. + +if(DEFINED POLLY_GCC_GOLD_CMAKE_) + return() +else() + set(POLLY_GCC_GOLD_CMAKE_ 1) +endif() + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_init.cmake") + +polly_init( + "gcc / c++11 support / gold" + "Unix Makefiles" +) + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_common.cmake") + +include("${CMAKE_CURRENT_LIST_DIR}/compiler/gcc.cmake") +include("${CMAKE_CURRENT_LIST_DIR}/flags/cxx11.cmake") +include("${CMAKE_CURRENT_LIST_DIR}/flags/gold.cmake") diff --git a/tools/polly/gcc-hid-fpic.cmake b/tools/polly/gcc-hid-fpic.cmake new file mode 100644 index 0000000..837dd51 --- /dev/null +++ b/tools/polly/gcc-hid-fpic.cmake @@ -0,0 +1,24 @@ +# Copyright (c) 2015, Ruslan Baratov +# Copyright (c) 2016, David Hirvonen +# All rights reserved. + +if(DEFINED POLLY_GCC_HID_FPIC_CMAKE_) + return() +else() + set(POLLY_GCC_HID_FPIC_CMAKE_ 1) +endif() + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_init.cmake") + +polly_init( + "gcc / c++11 support / hidden / FPIC" + "Unix Makefiles" + ) + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_common.cmake") + +include("${CMAKE_CURRENT_LIST_DIR}/compiler/gcc.cmake") +include("${CMAKE_CURRENT_LIST_DIR}/flags/cxx11.cmake") +include("${CMAKE_CURRENT_LIST_DIR}/flags/hidden.cmake") +include("${CMAKE_CURRENT_LIST_DIR}/flags/fpic.cmake") + diff --git a/tools/polly/gcc-hid.cmake b/tools/polly/gcc-hid.cmake new file mode 100644 index 0000000..e477ba9 --- /dev/null +++ b/tools/polly/gcc-hid.cmake @@ -0,0 +1,21 @@ +# Copyright (c) 2015, Ruslan Baratov +# All rights reserved. + +if(DEFINED POLLY_GCC_HID_CMAKE_) + return() +else() + set(POLLY_GCC_HID_CMAKE_ 1) +endif() + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_init.cmake") + +polly_init( + "gcc / c++11 support / hidden" + "Unix Makefiles" +) + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_common.cmake") + +include("${CMAKE_CURRENT_LIST_DIR}/compiler/gcc.cmake") +include("${CMAKE_CURRENT_LIST_DIR}/flags/cxx11.cmake") +include("${CMAKE_CURRENT_LIST_DIR}/flags/hidden.cmake") diff --git a/tools/polly/gcc-lto.cmake b/tools/polly/gcc-lto.cmake new file mode 100644 index 0000000..42d9e49 --- /dev/null +++ b/tools/polly/gcc-lto.cmake @@ -0,0 +1,23 @@ +# Copyright (c) 2013-2017, Ruslan Baratov +# All rights reserved. + +if(DEFINED POLLY_GCC_LTO_CMAKE_) + return() +else() + set(POLLY_GCC_LTO_CMAKE_ 1) +endif() + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_init.cmake") + +polly_init( + "gcc / c++11 support / LTO" + "Unix Makefiles" +) + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_common.cmake") + +include("${CMAKE_CURRENT_LIST_DIR}/compiler/gcc.cmake") +include("${CMAKE_CURRENT_LIST_DIR}/flags/cxx11.cmake") +include("${CMAKE_CURRENT_LIST_DIR}/flags/lto.cmake") + +include("${CMAKE_CURRENT_LIST_DIR}/os/osx.cmake") diff --git a/tools/polly/gcc-musl.cmake b/tools/polly/gcc-musl.cmake new file mode 100644 index 0000000..2c13989 --- /dev/null +++ b/tools/polly/gcc-musl.cmake @@ -0,0 +1,33 @@ +# Copyright (c) 2013-2017, Ruslan Baratov +# All rights reserved. + +if(DEFINED POLLY_GCC_MUSL_CMAKE_) + return() +else() + set(POLLY_GCC_MUSL_CMAKE_ 1) +endif() + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_init.cmake") + +polly_init( + "gcc / c++11 support / musl / static" + "Unix Makefiles" +) + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_common.cmake") + +set(CROSS_COMPILE_TOOLCHAIN_PATH "$ENV{GCC_MUSL_ROOT}") +string(COMPARE EQUAL "${CROSS_COMPILE_TOOLCHAIN_PATH}" "" _is_empty) +if(_is_empty) + polly_fatal_error("Environment variable GCC_MUSL_ROOT is not set") +endif() + +set(CROSS_COMPILE_TOOLCHAIN_PREFIX "x86_64-linux-musl") + +set(POLLY_SKIP_SYSROOT TRUE) +set(CROSS_COMPILE_SYSROOT "dummy/path") + +include("${CMAKE_CURRENT_LIST_DIR}/compiler/gcc-cross-compile.cmake") + +include("${CMAKE_CURRENT_LIST_DIR}/flags/cxx11.cmake") +include("${CMAKE_CURRENT_LIST_DIR}/flags/static.cmake") diff --git a/tools/polly/gcc-ninja.cmake b/tools/polly/gcc-ninja.cmake new file mode 100644 index 0000000..bc4daa0 --- /dev/null +++ b/tools/polly/gcc-ninja.cmake @@ -0,0 +1,22 @@ +# Copyright (c) 2013, 2018, Ruslan Baratov +# All rights reserved. + +if(DEFINED POLLY_GCC_NINJA_CMAKE_) + return() +else() + set(POLLY_GCC_NINJA_CMAKE_ 1) +endif() + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_init.cmake") + +polly_init( + "gcc / c++11 support" + "Ninja" +) + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_common.cmake") + +include("${CMAKE_CURRENT_LIST_DIR}/compiler/gcc.cmake") +include("${CMAKE_CURRENT_LIST_DIR}/flags/cxx11.cmake") + +include("${CMAKE_CURRENT_LIST_DIR}/os/osx.cmake") diff --git a/tools/polly/gcc-pic-hid-sections-lto.cmake b/tools/polly/gcc-pic-hid-sections-lto.cmake new file mode 100644 index 0000000..5f1658f --- /dev/null +++ b/tools/polly/gcc-pic-hid-sections-lto.cmake @@ -0,0 +1,25 @@ +# Copyright (c) 2016-2017, Ruslan Baratov +# All rights reserved. + +if(DEFINED POLLY_GCC_PIC_HID_SECTIONS_LTO_CMAKE_) + return() +else() + set(POLLY_GCC_PIC_HID_SECTIONS_LTO_CMAKE_ 1) +endif() + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_init.cmake") + +polly_init( + "gcc / PIC / c++11 support / hidden / function-sections / data-sections / LTO" + "Unix Makefiles" +) + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_common.cmake") + +include("${CMAKE_CURRENT_LIST_DIR}/compiler/gcc.cmake") +include("${CMAKE_CURRENT_LIST_DIR}/flags/cxx11.cmake") +include("${CMAKE_CURRENT_LIST_DIR}/flags/fpic.cmake") +include("${CMAKE_CURRENT_LIST_DIR}/flags/function-sections.cmake") +include("${CMAKE_CURRENT_LIST_DIR}/flags/data-sections.cmake") +include("${CMAKE_CURRENT_LIST_DIR}/flags/hidden.cmake") +include("${CMAKE_CURRENT_LIST_DIR}/flags/lto.cmake") diff --git a/tools/polly/gcc-pic-hid-sections.cmake b/tools/polly/gcc-pic-hid-sections.cmake new file mode 100644 index 0000000..c3754c4 --- /dev/null +++ b/tools/polly/gcc-pic-hid-sections.cmake @@ -0,0 +1,24 @@ +# Copyright (c) 2016-2017, Ruslan Baratov +# All rights reserved. + +if(DEFINED POLLY_GCC_PIC_HID_SECTIONS_CMAKE_) + return() +else() + set(POLLY_GCC_PIC_HID_SECTIONS_CMAKE_ 1) +endif() + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_init.cmake") + +polly_init( + "gcc / PIC / c++11 support / hidden / function-sections / data-sections" + "Unix Makefiles" +) + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_common.cmake") + +include("${CMAKE_CURRENT_LIST_DIR}/compiler/gcc.cmake") +include("${CMAKE_CURRENT_LIST_DIR}/flags/cxx11.cmake") +include("${CMAKE_CURRENT_LIST_DIR}/flags/fpic.cmake") +include("${CMAKE_CURRENT_LIST_DIR}/flags/function-sections.cmake") +include("${CMAKE_CURRENT_LIST_DIR}/flags/data-sections.cmake") +include("${CMAKE_CURRENT_LIST_DIR}/flags/hidden.cmake") diff --git a/tools/polly/gcc-pic.cmake b/tools/polly/gcc-pic.cmake new file mode 100644 index 0000000..e2b27d0 --- /dev/null +++ b/tools/polly/gcc-pic.cmake @@ -0,0 +1,21 @@ +# Copyright (c) 2015, Ruslan Baratov +# All rights reserved. + +if(DEFINED POLLY_GCC_PIC_CMAKE_) + return() +else() + set(POLLY_GCC_PIC_CMAKE_ 1) +endif() + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_init.cmake") + +polly_init( + "gcc / PIC / c++11 support" + "Unix Makefiles" +) + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_common.cmake") + +include("${CMAKE_CURRENT_LIST_DIR}/compiler/gcc.cmake") +include("${CMAKE_CURRENT_LIST_DIR}/flags/cxx11.cmake") +include("${CMAKE_CURRENT_LIST_DIR}/flags/fpic.cmake") diff --git a/tools/polly/gcc-static-std.cmake b/tools/polly/gcc-static-std.cmake new file mode 100644 index 0000000..52e0903 --- /dev/null +++ b/tools/polly/gcc-static-std.cmake @@ -0,0 +1,23 @@ +# Copyright (c) 2013-2017, Ruslan Baratov +# All rights reserved. + +if(DEFINED POLLY_GCC_STATIC_STD_CMAKE_) + return() +else() + set(POLLY_GCC_STATIC_STD_CMAKE_ 1) +endif() + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_init.cmake") + +polly_init( + "gcc / c++11 support / static (libgcc, libstdc++)" + "Unix Makefiles" +) + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_common.cmake") + +include("${CMAKE_CURRENT_LIST_DIR}/compiler/gcc.cmake") +include("${CMAKE_CURRENT_LIST_DIR}/flags/cxx11.cmake") +include("${CMAKE_CURRENT_LIST_DIR}/flags/static-std.cmake") + +include("${CMAKE_CURRENT_LIST_DIR}/os/osx.cmake") diff --git a/tools/polly/gcc-static.cmake b/tools/polly/gcc-static.cmake new file mode 100644 index 0000000..69a90c0 --- /dev/null +++ b/tools/polly/gcc-static.cmake @@ -0,0 +1,23 @@ +# Copyright (c) 2013-2017, Ruslan Baratov +# All rights reserved. + +if(DEFINED POLLY_GCC_STATIC_CMAKE_) + return() +else() + set(POLLY_GCC_STATIC_CMAKE_ 1) +endif() + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_init.cmake") + +polly_init( + "gcc / c++11 support / static" + "Unix Makefiles" +) + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_common.cmake") + +include("${CMAKE_CURRENT_LIST_DIR}/compiler/gcc.cmake") +include("${CMAKE_CURRENT_LIST_DIR}/flags/cxx11.cmake") +include("${CMAKE_CURRENT_LIST_DIR}/flags/static.cmake") + +include("${CMAKE_CURRENT_LIST_DIR}/os/osx.cmake") diff --git a/tools/polly/gcc.cmake b/tools/polly/gcc.cmake new file mode 100644 index 0000000..98229a7 --- /dev/null +++ b/tools/polly/gcc.cmake @@ -0,0 +1,22 @@ +# Copyright (c) 2013, Ruslan Baratov +# All rights reserved. + +if(DEFINED POLLY_GCC_CMAKE) + return() +else() + set(POLLY_GCC_CMAKE 1) +endif() + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_init.cmake") + +polly_init( + "gcc / c++11 support" + "Unix Makefiles" +) + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_common.cmake") + +include("${CMAKE_CURRENT_LIST_DIR}/compiler/gcc.cmake") +include("${CMAKE_CURRENT_LIST_DIR}/flags/cxx11.cmake") + +include("${CMAKE_CURRENT_LIST_DIR}/os/osx.cmake") diff --git a/tools/polly/ios-10-0-arm64-dep-8-0-hid-sections.cmake b/tools/polly/ios-10-0-arm64-dep-8-0-hid-sections.cmake new file mode 100644 index 0000000..cc9fa8f --- /dev/null +++ b/tools/polly/ios-10-0-arm64-dep-8-0-hid-sections.cmake @@ -0,0 +1,45 @@ +# Copyright (c) 2015, Tomas Zemaitis +# Copyright (c) 2016, David Hirvonen +# All rights reserved. + +if(DEFINED POLLY_IOS_10_0_ARM64_DEP_8_0_HID_SECTIONS_CMAKE_) + return() +else() + set(POLLY_IOS_10_0_ARM64_DEP_8_0_HID_SECTIONS_CMAKE_ 1) +endif() + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_clear_environment_variables.cmake") + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_init.cmake") + +set(IOS_SDK_VERSION 10.0) +set(IOS_DEPLOYMENT_SDK_VERSION 8.0) +set(POLLY_XCODE_COMPILER "clang") + +polly_init( + "iOS ${IOS_SDK_VERSION} Universal (iphoneos + iphonesimulator) / \ +Deployment ${IOS_DEPLOYMENT_SDK_VERSION} / \ +${POLLY_XCODE_COMPILER} / \ +c++11 support / hidden / data-sections / function-sections" + "Xcode" +) + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_common.cmake") + +include(polly_fatal_error) + +# Fix try_compile +include(polly_ios_bundle_identifier) +set(CMAKE_MACOSX_BUNDLE YES) +set(CMAKE_XCODE_ATTRIBUTE_CODE_SIGN_IDENTITY "iPhone Developer") + +set(IPHONEOS_ARCHS arm64) +set(IPHONESIMULATOR_ARCHS "") + +include("${CMAKE_CURRENT_LIST_DIR}/compiler/xcode.cmake") +include("${CMAKE_CURRENT_LIST_DIR}/os/iphone.cmake") +include("${CMAKE_CURRENT_LIST_DIR}/flags/cxx11.cmake") +include("${CMAKE_CURRENT_LIST_DIR}/flags/hidden.cmake") +include("${CMAKE_CURRENT_LIST_DIR}/flags/function-sections.cmake") +include("${CMAKE_CURRENT_LIST_DIR}/flags/data-sections.cmake") +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_ios_development_team.cmake") diff --git a/tools/polly/ios-10-0-arm64.cmake b/tools/polly/ios-10-0-arm64.cmake new file mode 100644 index 0000000..1e12dd9 --- /dev/null +++ b/tools/polly/ios-10-0-arm64.cmake @@ -0,0 +1,40 @@ +# Copyright (c) 2015, Ruslan Baratov +# All rights reserved. + +if(DEFINED POLLY_IOS_10_0_ARM64_CMAKE_) + return() +else() + set(POLLY_IOS_10_0_ARM64_CMAKE_ 1) +endif() + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_clear_environment_variables.cmake") + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_init.cmake") + +set(IOS_SDK_VERSION 10.0) +set(POLLY_XCODE_COMPILER "clang") +polly_init( + "iOS ${IOS_SDK_VERSION} / \ +${POLLY_XCODE_COMPILER} / \ +arm64 / \ +c++11 support" + "Xcode" +) + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_common.cmake") + +include(polly_fatal_error) + +# Fix try_compile +include(polly_ios_bundle_identifier) +set(CMAKE_MACOSX_BUNDLE YES) +set(CMAKE_XCODE_ATTRIBUTE_CODE_SIGN_IDENTITY "iPhone Developer") + +set(IPHONEOS_ARCHS arm64) +set(IPHONESIMULATOR_ARCHS "") + +include("${CMAKE_CURRENT_LIST_DIR}/compiler/xcode.cmake") +include("${CMAKE_CURRENT_LIST_DIR}/os/iphone.cmake") +include("${CMAKE_CURRENT_LIST_DIR}/flags/cxx11.cmake") + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_ios_development_team.cmake") diff --git a/tools/polly/ios-10-0-armv7.cmake b/tools/polly/ios-10-0-armv7.cmake new file mode 100644 index 0000000..eccf9af --- /dev/null +++ b/tools/polly/ios-10-0-armv7.cmake @@ -0,0 +1,40 @@ +# Copyright (c) 2015, Ruslan Baratov +# All rights reserved. + +if(DEFINED POLLY_IOS_10_0_ARMV7_CMAKE_) + return() +else() + set(POLLY_IOS_10_0_ARMV7_CMAKE_ 1) +endif() + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_clear_environment_variables.cmake") + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_init.cmake") + +set(IOS_SDK_VERSION 10.0) +set(POLLY_XCODE_COMPILER "clang") +polly_init( + "iOS ${IOS_SDK_VERSION} / \ +${POLLY_XCODE_COMPILER} / \ +armv7 / \ +c++11 support" + "Xcode" +) + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_common.cmake") + +include(polly_fatal_error) + +# Fix try_compile +include(polly_ios_bundle_identifier) +set(CMAKE_MACOSX_BUNDLE YES) +set(CMAKE_XCODE_ATTRIBUTE_CODE_SIGN_IDENTITY "iPhone Developer") + +set(IPHONEOS_ARCHS armv7) +set(IPHONESIMULATOR_ARCHS "") + +include("${CMAKE_CURRENT_LIST_DIR}/compiler/xcode.cmake") +include("${CMAKE_CURRENT_LIST_DIR}/os/iphone.cmake") +include("${CMAKE_CURRENT_LIST_DIR}/flags/cxx11.cmake") + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_ios_development_team.cmake") diff --git a/tools/polly/ios-10-0-dep-8-0-hid-sections.cmake b/tools/polly/ios-10-0-dep-8-0-hid-sections.cmake new file mode 100644 index 0000000..f6cb2d4 --- /dev/null +++ b/tools/polly/ios-10-0-dep-8-0-hid-sections.cmake @@ -0,0 +1,45 @@ +# Copyright (c) 2015, Tomas Zemaitis +# Copyright (c) 2016, David Hirvonen +# All rights reserved. + +if(DEFINED POLLY_IOS_10_0_DEP_8_0_HID_SECTIONS_CMAKE_) + return() +else() + set(POLLY_IOS_10_0_DEP_8_0_HID_SECTIONS_CMAKE_ 1) +endif() + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_clear_environment_variables.cmake") + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_init.cmake") + +set(IOS_SDK_VERSION 10.0) +set(IOS_DEPLOYMENT_SDK_VERSION 8.0) +set(POLLY_XCODE_COMPILER "clang") + +polly_init( + "iOS ${IOS_SDK_VERSION} Universal (iphoneos + iphonesimulator) / \ +Deployment ${IOS_DEPLOYMENT_SDK_VERSION} / \ +${POLLY_XCODE_COMPILER} / \ +c++11 support / hidden / data-sections / function-sections" + "Xcode" +) + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_common.cmake") + +include(polly_fatal_error) + +# Fix try_compile +include(polly_ios_bundle_identifier) +set(CMAKE_MACOSX_BUNDLE YES) +set(CMAKE_XCODE_ATTRIBUTE_CODE_SIGN_IDENTITY "iPhone Developer") + +set(IPHONEOS_ARCHS armv7;armv7s;arm64) +set(IPHONESIMULATOR_ARCHS i386;x86_64) + +include("${CMAKE_CURRENT_LIST_DIR}/compiler/xcode.cmake") +include("${CMAKE_CURRENT_LIST_DIR}/os/iphone.cmake") +include("${CMAKE_CURRENT_LIST_DIR}/flags/cxx11.cmake") +include("${CMAKE_CURRENT_LIST_DIR}/flags/hidden.cmake") +include("${CMAKE_CURRENT_LIST_DIR}/flags/function-sections.cmake") +include("${CMAKE_CURRENT_LIST_DIR}/flags/data-sections.cmake") +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_ios_development_team.cmake") diff --git a/tools/polly/ios-10-0-wo-armv7s.cmake b/tools/polly/ios-10-0-wo-armv7s.cmake new file mode 100644 index 0000000..ad1ece8 --- /dev/null +++ b/tools/polly/ios-10-0-wo-armv7s.cmake @@ -0,0 +1,40 @@ +# Copyright (c) 2015-2016, Ruslan Baratov +# All rights reserved. + +if(DEFINED POLLY_IOS_10_0_WO_ARMV7S_CMAKE_) + return() +else() + set(POLLY_IOS_10_0_WO_ARMV7S_CMAKE_ 1) +endif() + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_clear_environment_variables.cmake") + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_init.cmake") + +set(IOS_SDK_VERSION 10.0) +set(POLLY_XCODE_COMPILER "clang") +polly_init( + "iOS ${IOS_SDK_VERSION} Universal (iphoneos + iphonesimulator) / \ +${POLLY_XCODE_COMPILER} / \ +armv7 arm64 / i386 x86_64 / \ +c++11 support" + "Xcode" +) + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_common.cmake") + +include(polly_fatal_error) + +# Fix try_compile +include(polly_ios_bundle_identifier) +set(CMAKE_MACOSX_BUNDLE YES) +set(CMAKE_XCODE_ATTRIBUTE_CODE_SIGN_IDENTITY "iPhone Developer") + +set(IPHONEOS_ARCHS armv7;arm64) +set(IPHONESIMULATOR_ARCHS i386;x86_64) + +include("${CMAKE_CURRENT_LIST_DIR}/compiler/xcode.cmake") +include("${CMAKE_CURRENT_LIST_DIR}/os/iphone.cmake") +include("${CMAKE_CURRENT_LIST_DIR}/flags/cxx11.cmake") + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_ios_development_team.cmake") diff --git a/tools/polly/ios-10-0.cmake b/tools/polly/ios-10-0.cmake new file mode 100644 index 0000000..2ced3a4 --- /dev/null +++ b/tools/polly/ios-10-0.cmake @@ -0,0 +1,39 @@ +# Copyright (c) 2015, Tomas Zemaitis +# All rights reserved. + +if(DEFINED POLLY_IOS_10_0_CMAKE_) + return() +else() + set(POLLY_IOS_10_0_CMAKE_ 1) +endif() + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_clear_environment_variables.cmake") + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_init.cmake") + +set(IOS_SDK_VERSION 10.0) +set(POLLY_XCODE_COMPILER "clang") +polly_init( + "iOS ${IOS_SDK_VERSION} Universal (iphoneos + iphonesimulator) / \ +${POLLY_XCODE_COMPILER} / \ +c++11 support" + "Xcode" +) + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_common.cmake") + +include(polly_fatal_error) + +# Fix try_compile +include(polly_ios_bundle_identifier) +set(CMAKE_MACOSX_BUNDLE YES) +set(CMAKE_XCODE_ATTRIBUTE_CODE_SIGN_IDENTITY "iPhone Developer") + +set(IPHONEOS_ARCHS armv7;armv7s;arm64) +set(IPHONESIMULATOR_ARCHS i386;x86_64) + +include("${CMAKE_CURRENT_LIST_DIR}/compiler/xcode.cmake") +include("${CMAKE_CURRENT_LIST_DIR}/os/iphone.cmake") +include("${CMAKE_CURRENT_LIST_DIR}/flags/cxx11.cmake") + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_ios_development_team.cmake") diff --git a/tools/polly/ios-10-1-arm64-dep-8-0-hid-sections.cmake b/tools/polly/ios-10-1-arm64-dep-8-0-hid-sections.cmake new file mode 100644 index 0000000..7d7c4c8 --- /dev/null +++ b/tools/polly/ios-10-1-arm64-dep-8-0-hid-sections.cmake @@ -0,0 +1,45 @@ +# Copyright (c) 2015, Tomas Zemaitis +# Copyright (c) 2016, David Hirvonen +# All rights reserved. + +if(DEFINED POLLY_IOS_10_1_ARM64_DEP_8_0_HID_SECTIONS_CMAKE_) + return() +else() + set(POLLY_IOS_10_1_ARM64_DEP_8_0_HID_SECTIONS_CMAKE_ 1) +endif() + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_clear_environment_variables.cmake") + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_init.cmake") + +set(IOS_SDK_VERSION 10.1) +set(IOS_DEPLOYMENT_SDK_VERSION 8.0) +set(POLLY_XCODE_COMPILER "clang") + +polly_init( + "iOS ${IOS_SDK_VERSION} Universal (iphoneos + iphonesimulator) / \ +Deployment ${IOS_DEPLOYMENT_SDK_VERSION} / \ +${POLLY_XCODE_COMPILER} / \ +c++11 support / hidden / data-sections / function-sections" + "Xcode" +) + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_common.cmake") + +include(polly_fatal_error) + +# Fix try_compile +include(polly_ios_bundle_identifier) +set(CMAKE_MACOSX_BUNDLE YES) +set(CMAKE_XCODE_ATTRIBUTE_CODE_SIGN_IDENTITY "iPhone Developer") + +set(IPHONEOS_ARCHS arm64) +set(IPHONESIMULATOR_ARCHS "") + +include("${CMAKE_CURRENT_LIST_DIR}/compiler/xcode.cmake") +include("${CMAKE_CURRENT_LIST_DIR}/os/iphone.cmake") +include("${CMAKE_CURRENT_LIST_DIR}/flags/cxx11.cmake") +include("${CMAKE_CURRENT_LIST_DIR}/flags/hidden.cmake") +include("${CMAKE_CURRENT_LIST_DIR}/flags/function-sections.cmake") +include("${CMAKE_CURRENT_LIST_DIR}/flags/data-sections.cmake") +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_ios_development_team.cmake") diff --git a/tools/polly/ios-10-1-arm64.cmake b/tools/polly/ios-10-1-arm64.cmake new file mode 100644 index 0000000..3707fb7 --- /dev/null +++ b/tools/polly/ios-10-1-arm64.cmake @@ -0,0 +1,40 @@ +# Copyright (c) 2015, Ruslan Baratov +# All rights reserved. + +if(DEFINED POLLY_IOS_10_1_ARM64_CMAKE_) + return() +else() + set(POLLY_IOS_10_1_ARM64_CMAKE_ 1) +endif() + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_clear_environment_variables.cmake") + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_init.cmake") + +set(IOS_SDK_VERSION 10.1) +set(POLLY_XCODE_COMPILER "clang") +polly_init( + "iOS ${IOS_SDK_VERSION} / \ +${POLLY_XCODE_COMPILER} / \ +arm64 / \ +c++11 support" + "Xcode" +) + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_common.cmake") + +include(polly_fatal_error) + +# Fix try_compile +include(polly_ios_bundle_identifier) +set(CMAKE_MACOSX_BUNDLE YES) +set(CMAKE_XCODE_ATTRIBUTE_CODE_SIGN_IDENTITY "iPhone Developer") + +set(IPHONEOS_ARCHS arm64) +set(IPHONESIMULATOR_ARCHS "") + +include("${CMAKE_CURRENT_LIST_DIR}/compiler/xcode.cmake") +include("${CMAKE_CURRENT_LIST_DIR}/os/iphone.cmake") +include("${CMAKE_CURRENT_LIST_DIR}/flags/cxx11.cmake") + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_ios_development_team.cmake") diff --git a/tools/polly/ios-10-1-armv7.cmake b/tools/polly/ios-10-1-armv7.cmake new file mode 100644 index 0000000..9bbab5c --- /dev/null +++ b/tools/polly/ios-10-1-armv7.cmake @@ -0,0 +1,40 @@ +# Copyright (c) 2015, Ruslan Baratov +# All rights reserved. + +if(DEFINED POLLY_IOS_10_1_ARMV7_CMAKE_) + return() +else() + set(POLLY_IOS_10_1_ARMV7_CMAKE_ 1) +endif() + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_clear_environment_variables.cmake") + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_init.cmake") + +set(IOS_SDK_VERSION 10.1) +set(POLLY_XCODE_COMPILER "clang") +polly_init( + "iOS ${IOS_SDK_VERSION} / \ +${POLLY_XCODE_COMPILER} / \ +armv7 / \ +c++11 support" + "Xcode" +) + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_common.cmake") + +include(polly_fatal_error) + +# Fix try_compile +include(polly_ios_bundle_identifier) +set(CMAKE_MACOSX_BUNDLE YES) +set(CMAKE_XCODE_ATTRIBUTE_CODE_SIGN_IDENTITY "iPhone Developer") + +set(IPHONEOS_ARCHS armv7) +set(IPHONESIMULATOR_ARCHS "") + +include("${CMAKE_CURRENT_LIST_DIR}/compiler/xcode.cmake") +include("${CMAKE_CURRENT_LIST_DIR}/os/iphone.cmake") +include("${CMAKE_CURRENT_LIST_DIR}/flags/cxx11.cmake") + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_ios_development_team.cmake") diff --git a/tools/polly/ios-10-1-dep-8-0-hid-sections.cmake b/tools/polly/ios-10-1-dep-8-0-hid-sections.cmake new file mode 100644 index 0000000..9fc9878 --- /dev/null +++ b/tools/polly/ios-10-1-dep-8-0-hid-sections.cmake @@ -0,0 +1,45 @@ +# Copyright (c) 2015, Tomas Zemaitis +# Copyright (c) 2016, David Hirvonen +# All rights reserved. + +if(DEFINED POLLY_IOS_10_1_DEP_8_0_HID_SECTIONS_CMAKE_) + return() +else() + set(POLLY_IOS_10_1_DEP_8_0_HID_SECTIONS_CMAKE_ 1) +endif() + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_clear_environment_variables.cmake") + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_init.cmake") + +set(IOS_SDK_VERSION 10.1) +set(IOS_DEPLOYMENT_SDK_VERSION 8.0) +set(POLLY_XCODE_COMPILER "clang") + +polly_init( + "iOS ${IOS_SDK_VERSION} Universal (iphoneos + iphonesimulator) / \ +Deployment ${IOS_DEPLOYMENT_SDK_VERSION} / \ +${POLLY_XCODE_COMPILER} / \ +c++11 support / hidden / data-sections / function-sections" + "Xcode" +) + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_common.cmake") + +include(polly_fatal_error) + +# Fix try_compile +include(polly_ios_bundle_identifier) +set(CMAKE_MACOSX_BUNDLE YES) +set(CMAKE_XCODE_ATTRIBUTE_CODE_SIGN_IDENTITY "iPhone Developer") + +set(IPHONEOS_ARCHS armv7;armv7s;arm64) +set(IPHONESIMULATOR_ARCHS i386;x86_64) + +include("${CMAKE_CURRENT_LIST_DIR}/compiler/xcode.cmake") +include("${CMAKE_CURRENT_LIST_DIR}/os/iphone.cmake") +include("${CMAKE_CURRENT_LIST_DIR}/flags/cxx11.cmake") +include("${CMAKE_CURRENT_LIST_DIR}/flags/hidden.cmake") +include("${CMAKE_CURRENT_LIST_DIR}/flags/function-sections.cmake") +include("${CMAKE_CURRENT_LIST_DIR}/flags/data-sections.cmake") +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_ios_development_team.cmake") diff --git a/tools/polly/ios-10-1-dep-8-0-libcxx-hid-sections-lto.cmake b/tools/polly/ios-10-1-dep-8-0-libcxx-hid-sections-lto.cmake new file mode 100644 index 0000000..8e70626 --- /dev/null +++ b/tools/polly/ios-10-1-dep-8-0-libcxx-hid-sections-lto.cmake @@ -0,0 +1,47 @@ +# Copyright (c) 2015, Tomas Zemaitis +# Copyright (c) 2016, David Hirvonen +# All rights reserved. + +if(DEFINED POLLY_IOS_10_1_DEP_8_0_LIBCXX_HID_SECTIONS_LTO_CMAKE_) + return() +else() + set(POLLY_IOS_10_1_DEP_8_0_LIBCXX_HID_SECTIONS_LTO_CMAKE_ 1) +endif() + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_clear_environment_variables.cmake") + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_init.cmake") + +set(IOS_SDK_VERSION 10.1) +set(IOS_DEPLOYMENT_SDK_VERSION 8.0) +set(POLLY_XCODE_COMPILER "clang") + +polly_init( + "iOS ${IOS_SDK_VERSION} Universal (iphoneos + iphonesimulator) / \ +Deployment ${IOS_DEPLOYMENT_SDK_VERSION} / \ +${POLLY_XCODE_COMPILER} / \ +c++11 support / hidden / data-sections / function-sections / LTO" + "Xcode" +) + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_common.cmake") + +include(polly_fatal_error) + +# Fix try_compile +include(polly_ios_bundle_identifier) +set(CMAKE_MACOSX_BUNDLE YES) +set(CMAKE_XCODE_ATTRIBUTE_CODE_SIGN_IDENTITY "iPhone Developer") + +set(IPHONEOS_ARCHS armv7;armv7s;arm64) +set(IPHONESIMULATOR_ARCHS i386;x86_64) + +include("${CMAKE_CURRENT_LIST_DIR}/compiler/xcode.cmake") +include("${CMAKE_CURRENT_LIST_DIR}/os/iphone.cmake") +include("${CMAKE_CURRENT_LIST_DIR}/library/std/libcxx.cmake") +include("${CMAKE_CURRENT_LIST_DIR}/flags/cxx11.cmake") +include("${CMAKE_CURRENT_LIST_DIR}/flags/hidden.cmake") +include("${CMAKE_CURRENT_LIST_DIR}/flags/function-sections.cmake") +include("${CMAKE_CURRENT_LIST_DIR}/flags/data-sections.cmake") +include("${CMAKE_CURRENT_LIST_DIR}/flags/lto.cmake") +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_ios_development_team.cmake") diff --git a/tools/polly/ios-10-1-dep-8-0-libcxx-hid-sections.cmake b/tools/polly/ios-10-1-dep-8-0-libcxx-hid-sections.cmake new file mode 100644 index 0000000..f06e3d4 --- /dev/null +++ b/tools/polly/ios-10-1-dep-8-0-libcxx-hid-sections.cmake @@ -0,0 +1,46 @@ +# Copyright (c) 2015, Tomas Zemaitis +# Copyright (c) 2016, David Hirvonen +# All rights reserved. + +if(DEFINED POLLY_IOS_10_1_DEP_8_0_LIBCXX_HID_SECTIONS_CMAKE_) + return() +else() + set(POLLY_IOS_10_1_DEP_8_0_HID_LIBCXX_SECTIONS_CMAKE_ 1) +endif() + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_clear_environment_variables.cmake") + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_init.cmake") + +set(IOS_SDK_VERSION 10.1) +set(IOS_DEPLOYMENT_SDK_VERSION 8.0) +set(POLLY_XCODE_COMPILER "clang") + +polly_init( + "iOS ${IOS_SDK_VERSION} Universal (iphoneos + iphonesimulator) / \ +Deployment ${IOS_DEPLOYMENT_SDK_VERSION} / \ +${POLLY_XCODE_COMPILER} / \ +c++11 support / hidden / data-sections / function-sections" + "Xcode" +) + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_common.cmake") + +include(polly_fatal_error) + +# Fix try_compile +include(polly_ios_bundle_identifier) +set(CMAKE_MACOSX_BUNDLE YES) +set(CMAKE_XCODE_ATTRIBUTE_CODE_SIGN_IDENTITY "iPhone Developer") + +set(IPHONEOS_ARCHS armv7;armv7s;arm64) +set(IPHONESIMULATOR_ARCHS i386;x86_64) + +include("${CMAKE_CURRENT_LIST_DIR}/compiler/xcode.cmake") +include("${CMAKE_CURRENT_LIST_DIR}/os/iphone.cmake") +include("${CMAKE_CURRENT_LIST_DIR}/library/std/libcxx.cmake") +include("${CMAKE_CURRENT_LIST_DIR}/flags/cxx11.cmake") +include("${CMAKE_CURRENT_LIST_DIR}/flags/hidden.cmake") +include("${CMAKE_CURRENT_LIST_DIR}/flags/function-sections.cmake") +include("${CMAKE_CURRENT_LIST_DIR}/flags/data-sections.cmake") +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_ios_development_team.cmake") diff --git a/tools/polly/ios-10-1-wo-armv7s.cmake b/tools/polly/ios-10-1-wo-armv7s.cmake new file mode 100644 index 0000000..4ffee38 --- /dev/null +++ b/tools/polly/ios-10-1-wo-armv7s.cmake @@ -0,0 +1,40 @@ +# Copyright (c) 2015-2016, Ruslan Baratov +# All rights reserved. + +if(DEFINED POLLY_IOS_10_1_WO_ARMV7S_CMAKE_) + return() +else() + set(POLLY_IOS_10_1_WO_ARMV7S_CMAKE_ 1) +endif() + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_clear_environment_variables.cmake") + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_init.cmake") + +set(IOS_SDK_VERSION 10.1) +set(POLLY_XCODE_COMPILER "clang") +polly_init( + "iOS ${IOS_SDK_VERSION} Universal (iphoneos + iphonesimulator) / \ +${POLLY_XCODE_COMPILER} / \ +armv7 arm64 / i386 x86_64 / \ +c++11 support" + "Xcode" +) + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_common.cmake") + +include(polly_fatal_error) + +# Fix try_compile +include(polly_ios_bundle_identifier) +set(CMAKE_MACOSX_BUNDLE YES) +set(CMAKE_XCODE_ATTRIBUTE_CODE_SIGN_IDENTITY "iPhone Developer") + +set(IPHONEOS_ARCHS armv7;arm64) +set(IPHONESIMULATOR_ARCHS i386;x86_64) + +include("${CMAKE_CURRENT_LIST_DIR}/compiler/xcode.cmake") +include("${CMAKE_CURRENT_LIST_DIR}/os/iphone.cmake") +include("${CMAKE_CURRENT_LIST_DIR}/flags/cxx11.cmake") + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_ios_development_team.cmake") diff --git a/tools/polly/ios-10-1.cmake b/tools/polly/ios-10-1.cmake new file mode 100644 index 0000000..614fa6a --- /dev/null +++ b/tools/polly/ios-10-1.cmake @@ -0,0 +1,39 @@ +# Copyright (c) 2015, Tomas Zemaitis +# All rights reserved. + +if(DEFINED POLLY_IOS_10_1_CMAKE_) + return() +else() + set(POLLY_IOS_10_1_CMAKE_ 1) +endif() + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_clear_environment_variables.cmake") + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_init.cmake") + +set(IOS_SDK_VERSION 10.1) +set(POLLY_XCODE_COMPILER "clang") +polly_init( + "iOS ${IOS_SDK_VERSION} Universal (iphoneos + iphonesimulator) / \ +${POLLY_XCODE_COMPILER} / \ +c++11 support" + "Xcode" +) + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_common.cmake") + +include(polly_fatal_error) + +# Fix try_compile +include(polly_ios_bundle_identifier) +set(CMAKE_MACOSX_BUNDLE YES) +set(CMAKE_XCODE_ATTRIBUTE_CODE_SIGN_IDENTITY "iPhone Developer") + +set(IPHONEOS_ARCHS armv7;armv7s;arm64) +set(IPHONESIMULATOR_ARCHS i386;x86_64) + +include("${CMAKE_CURRENT_LIST_DIR}/compiler/xcode.cmake") +include("${CMAKE_CURRENT_LIST_DIR}/os/iphone.cmake") +include("${CMAKE_CURRENT_LIST_DIR}/flags/cxx11.cmake") + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_ios_development_team.cmake") diff --git a/tools/polly/ios-10-2-dep-9-3-arm64.cmake b/tools/polly/ios-10-2-dep-9-3-arm64.cmake new file mode 100644 index 0000000..f478003 --- /dev/null +++ b/tools/polly/ios-10-2-dep-9-3-arm64.cmake @@ -0,0 +1,42 @@ +# Copyright (c) 2015-2017, Ruslan Baratov +# All rights reserved. + +if(DEFINED POLLY_IOS_10_2_DEP_9_3_ARM64_CMAKE_) + return() +else() + set(POLLY_IOS_10_2_DEP_9_3_ARM64_CMAKE_ 1) +endif() + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_clear_environment_variables.cmake") + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_init.cmake") + +set(IOS_SDK_VERSION 10.2) +set(IOS_DEPLOYMENT_SDK_VERSION 9.3) + +set(POLLY_XCODE_COMPILER "clang") +polly_init( + "iOS ${IOS_SDK_VERSION} / Deployment ${IOS_DEPLOYMENT_SDK_VERSION} / \ +${POLLY_XCODE_COMPILER} / \ +arm64 / \ +c++11 support" + "Xcode" +) + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_common.cmake") + +include(polly_fatal_error) + +# Fix try_compile +include(polly_ios_bundle_identifier) +set(CMAKE_MACOSX_BUNDLE YES) +set(CMAKE_XCODE_ATTRIBUTE_CODE_SIGN_IDENTITY "iPhone Developer") + +set(IPHONEOS_ARCHS arm64) +set(IPHONESIMULATOR_ARCHS "") + +include("${CMAKE_CURRENT_LIST_DIR}/compiler/xcode.cmake") +include("${CMAKE_CURRENT_LIST_DIR}/os/iphone.cmake") +include("${CMAKE_CURRENT_LIST_DIR}/flags/cxx11.cmake") + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_ios_development_team.cmake") diff --git a/tools/polly/ios-10-2-dep-9-3-armv7.cmake b/tools/polly/ios-10-2-dep-9-3-armv7.cmake new file mode 100644 index 0000000..dc4e47f --- /dev/null +++ b/tools/polly/ios-10-2-dep-9-3-armv7.cmake @@ -0,0 +1,42 @@ +# Copyright (c) 2015-2017, Ruslan Baratov +# All rights reserved. + +if(DEFINED POLLY_IOS_10_2_DEP_9_3_ARMV7_CMAKE_) + return() +else() + set(POLLY_IOS_10_2_DEP_9_3_ARMV7_CMAKE_ 1) +endif() + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_clear_environment_variables.cmake") + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_init.cmake") + +set(IOS_SDK_VERSION 10.2) +set(IOS_DEPLOYMENT_SDK_VERSION 9.3) + +set(POLLY_XCODE_COMPILER "clang") +polly_init( + "iOS ${IOS_SDK_VERSION} / Deployment ${IOS_DEPLOYMENT_SDK_VERSION} / \ +${POLLY_XCODE_COMPILER} / \ +armv7 / \ +c++11 support" + "Xcode" +) + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_common.cmake") + +include(polly_fatal_error) + +# Fix try_compile +include(polly_ios_bundle_identifier) +set(CMAKE_MACOSX_BUNDLE YES) +set(CMAKE_XCODE_ATTRIBUTE_CODE_SIGN_IDENTITY "iPhone Developer") + +set(IPHONEOS_ARCHS armv7) +set(IPHONESIMULATOR_ARCHS "") + +include("${CMAKE_CURRENT_LIST_DIR}/compiler/xcode.cmake") +include("${CMAKE_CURRENT_LIST_DIR}/os/iphone.cmake") +include("${CMAKE_CURRENT_LIST_DIR}/flags/cxx11.cmake") + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_ios_development_team.cmake") diff --git a/tools/polly/ios-10-2.cmake b/tools/polly/ios-10-2.cmake new file mode 100644 index 0000000..f6a6a91 --- /dev/null +++ b/tools/polly/ios-10-2.cmake @@ -0,0 +1,39 @@ +# Copyright (c) 2016, Ruslan Baratov +# All rights reserved. + +if(DEFINED POLLY_IOS_10_2_CMAKE_) + return() +else() + set(POLLY_IOS_10_2_CMAKE_ 1) +endif() + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_clear_environment_variables.cmake") + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_init.cmake") + +set(IOS_SDK_VERSION 10.2) +set(POLLY_XCODE_COMPILER "clang") +polly_init( + "iOS ${IOS_SDK_VERSION} Universal (iphoneos + iphonesimulator) / \ +${POLLY_XCODE_COMPILER} / \ +c++11 support" + "Xcode" +) + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_common.cmake") + +include(polly_fatal_error) + +# Fix try_compile +include(polly_ios_bundle_identifier) +set(CMAKE_MACOSX_BUNDLE YES) +set(CMAKE_XCODE_ATTRIBUTE_CODE_SIGN_IDENTITY "iPhone Developer") + +set(IPHONEOS_ARCHS armv7;armv7s;arm64) +set(IPHONESIMULATOR_ARCHS i386;x86_64) + +include("${CMAKE_CURRENT_LIST_DIR}/compiler/xcode.cmake") +include("${CMAKE_CURRENT_LIST_DIR}/os/iphone.cmake") +include("${CMAKE_CURRENT_LIST_DIR}/flags/cxx11.cmake") + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_ios_development_team.cmake") diff --git a/tools/polly/ios-10-3-arm64.cmake b/tools/polly/ios-10-3-arm64.cmake new file mode 100644 index 0000000..89b254f --- /dev/null +++ b/tools/polly/ios-10-3-arm64.cmake @@ -0,0 +1,41 @@ +# Copyright (c) 2015-2017, Ruslan Baratov +# All rights reserved. + +if(DEFINED POLLY_IOS_10_3_ARM64_CMAKE_) + return() +else() + set(POLLY_IOS_10_3_ARM64_CMAKE_ 1) +endif() + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_clear_environment_variables.cmake") + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_init.cmake") + +set(IOS_SDK_VERSION 10.3) +set(POLLY_XCODE_COMPILER "clang") +polly_init( + "iOS ${IOS_SDK_VERSION} / \ +${POLLY_XCODE_COMPILER} / \ +arm64 / \ +c++11 support" + "Xcode" +) + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_common.cmake") + +include(polly_fatal_error) + +# Fix try_compile +include(polly_ios_bundle_identifier) + +set(CMAKE_MACOSX_BUNDLE YES) +set(CMAKE_XCODE_ATTRIBUTE_CODE_SIGN_IDENTITY "iPhone Developer") + +set(IPHONEOS_ARCHS arm64) +set(IPHONESIMULATOR_ARCHS "") + +include("${CMAKE_CURRENT_LIST_DIR}/compiler/xcode.cmake") +include("${CMAKE_CURRENT_LIST_DIR}/os/iphone.cmake") +include("${CMAKE_CURRENT_LIST_DIR}/flags/cxx11.cmake") + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_ios_development_team.cmake") diff --git a/tools/polly/ios-10-3-armv7.cmake b/tools/polly/ios-10-3-armv7.cmake new file mode 100644 index 0000000..41f0abf --- /dev/null +++ b/tools/polly/ios-10-3-armv7.cmake @@ -0,0 +1,41 @@ +# Copyright (c) 2015-2017, Ruslan Baratov +# All rights reserved. + +if(DEFINED POLLY_IOS_10_3_ARMV7_CMAKE_) + return() +else() + set(POLLY_IOS_10_3_ARMV7_CMAKE_ 1) +endif() + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_clear_environment_variables.cmake") + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_init.cmake") + +set(IOS_SDK_VERSION 10.3) +set(POLLY_XCODE_COMPILER "clang") +polly_init( + "iOS ${IOS_SDK_VERSION} / \ +${POLLY_XCODE_COMPILER} / \ +armv7 / \ +c++11 support" + "Xcode" +) + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_common.cmake") + +include(polly_fatal_error) + +# Fix try_compile +include(polly_ios_bundle_identifier) + +set(CMAKE_MACOSX_BUNDLE YES) +set(CMAKE_XCODE_ATTRIBUTE_CODE_SIGN_IDENTITY "iPhone Developer") + +set(IPHONEOS_ARCHS armv7) +set(IPHONESIMULATOR_ARCHS "") + +include("${CMAKE_CURRENT_LIST_DIR}/compiler/xcode.cmake") +include("${CMAKE_CURRENT_LIST_DIR}/os/iphone.cmake") +include("${CMAKE_CURRENT_LIST_DIR}/flags/cxx11.cmake") + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_ios_development_team.cmake") diff --git a/tools/polly/ios-10-3-dep-8-0-bitcode.cmake b/tools/polly/ios-10-3-dep-8-0-bitcode.cmake new file mode 100644 index 0000000..5a14d97 --- /dev/null +++ b/tools/polly/ios-10-3-dep-8-0-bitcode.cmake @@ -0,0 +1,44 @@ +# Copyright (c) 2017, Ruslan Baratov +# All rights reserved. + +if(DEFINED POLLY_IOS_10_3_DEP_8_0_BITCODE_CMAKE_) + return() +else() + set(POLLY_IOS_10_3_DEP_8_0_BITCODE_CMAKE_ 1) +endif() + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_clear_environment_variables.cmake") + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_init.cmake") + +set(IOS_SDK_VERSION 10.3) +set(IOS_DEPLOYMENT_SDK_VERSION 8.0) + +set(POLLY_XCODE_COMPILER "clang") +polly_init( + "iOS ${IOS_SDK_VERSION} / Deployment ${IOS_DEPLOYMENT_SDK_VERSION} / Universal (iphoneos + iphonesimulator) / \ +${POLLY_XCODE_COMPILER} / \ +bitcode / \ +c++11 support" + "Xcode" +) + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_common.cmake") + +include(polly_fatal_error) + +# Fix try_compile +include(polly_ios_bundle_identifier) + +set(CMAKE_MACOSX_BUNDLE YES) +set(CMAKE_XCODE_ATTRIBUTE_CODE_SIGN_IDENTITY "iPhone Developer") + +set(IPHONEOS_ARCHS armv7;armv7s;arm64) +set(IPHONESIMULATOR_ARCHS i386;x86_64) + +include("${CMAKE_CURRENT_LIST_DIR}/compiler/xcode.cmake") +include("${CMAKE_CURRENT_LIST_DIR}/os/iphone.cmake") +include("${CMAKE_CURRENT_LIST_DIR}/flags/cxx11.cmake") +include("${CMAKE_CURRENT_LIST_DIR}/flags/bitcode.cmake") # after os/iphone.cmake + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_ios_development_team.cmake") diff --git a/tools/polly/ios-10-3-dep-9-0-bitcode.cmake b/tools/polly/ios-10-3-dep-9-0-bitcode.cmake new file mode 100644 index 0000000..a77f4ed --- /dev/null +++ b/tools/polly/ios-10-3-dep-9-0-bitcode.cmake @@ -0,0 +1,44 @@ +# Copyright (c) 2017, Ruslan Baratov +# All rights reserved. + +if(DEFINED POLLY_IOS_10_3_DEP_9_0_BITCODE_CMAKE_) + return() +else() + set(POLLY_IOS_10_3_DEP_9_0_BITCODE_CMAKE_ 1) +endif() + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_clear_environment_variables.cmake") + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_init.cmake") + +set(IOS_SDK_VERSION 10.3) +set(IOS_DEPLOYMENT_SDK_VERSION 9.0) + +set(POLLY_XCODE_COMPILER "clang") +polly_init( + "iOS ${IOS_SDK_VERSION} / Deployment ${IOS_DEPLOYMENT_SDK_VERSION} / Universal (iphoneos + iphonesimulator) / \ +${POLLY_XCODE_COMPILER} / \ +bitcode / \ +c++11 support" + "Xcode" +) + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_common.cmake") + +include(polly_fatal_error) + +# Fix try_compile +include(polly_ios_bundle_identifier) + +set(CMAKE_MACOSX_BUNDLE YES) +set(CMAKE_XCODE_ATTRIBUTE_CODE_SIGN_IDENTITY "iPhone Developer") + +set(IPHONEOS_ARCHS armv7;armv7s;arm64) +set(IPHONESIMULATOR_ARCHS i386;x86_64) + +include("${CMAKE_CURRENT_LIST_DIR}/compiler/xcode.cmake") +include("${CMAKE_CURRENT_LIST_DIR}/os/iphone.cmake") +include("${CMAKE_CURRENT_LIST_DIR}/flags/cxx11.cmake") +include("${CMAKE_CURRENT_LIST_DIR}/flags/bitcode.cmake") # after os/iphone.cmake + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_ios_development_team.cmake") diff --git a/tools/polly/ios-10-3-dep-9-3-i386-armv7.cmake b/tools/polly/ios-10-3-dep-9-3-i386-armv7.cmake new file mode 100644 index 0000000..b909790 --- /dev/null +++ b/tools/polly/ios-10-3-dep-9-3-i386-armv7.cmake @@ -0,0 +1,43 @@ +# Copyright (c) 2015-2017, Ruslan Baratov +# All rights reserved. + +if(DEFINED POLLY_IOS_10_3_DEP_9_3_I386_ARMV7_CMAKE_) + return() +else() + set(POLLY_IOS_10_3_DEP_9_3_I386_ARMV7_CMAKE_ 1) +endif() + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_clear_environment_variables.cmake") + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_init.cmake") + +set(IOS_SDK_VERSION 10.3) +set(IOS_DEPLOYMENT_SDK_VERSION 9.3) + +set(POLLY_XCODE_COMPILER "clang") +polly_init( + "iOS ${IOS_SDK_VERSION} / Deployment ${IOS_DEPLOYMENT_SDK_VERSION} / \ +${POLLY_XCODE_COMPILER} / \ +i386 / armv7 / \ +c++11 support" + "Xcode" +) + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_common.cmake") + +include(polly_fatal_error) + +# Fix try_compile +include(polly_ios_bundle_identifier) + +set(CMAKE_MACOSX_BUNDLE YES) +set(CMAKE_XCODE_ATTRIBUTE_CODE_SIGN_IDENTITY "iPhone Developer") + +set(IPHONEOS_ARCHS armv7) +set(IPHONESIMULATOR_ARCHS i386) + +include("${CMAKE_CURRENT_LIST_DIR}/compiler/xcode.cmake") +include("${CMAKE_CURRENT_LIST_DIR}/os/iphone.cmake") +include("${CMAKE_CURRENT_LIST_DIR}/flags/cxx11.cmake") + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_ios_development_team.cmake") diff --git a/tools/polly/ios-10-3-dep-9-3-x86-64-arm64.cmake b/tools/polly/ios-10-3-dep-9-3-x86-64-arm64.cmake new file mode 100644 index 0000000..0dbd8ac --- /dev/null +++ b/tools/polly/ios-10-3-dep-9-3-x86-64-arm64.cmake @@ -0,0 +1,43 @@ +# Copyright (c) 2015-2017, Ruslan Baratov +# All rights reserved. + +if(DEFINED POLLY_IOS_10_3_DEP_9_3_X86_64_ARM64_CMAKE_) + return() +else() + set(POLLY_IOS_10_3_DEP_9_3_X86_64_ARM64_CMAKE_ 1) +endif() + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_clear_environment_variables.cmake") + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_init.cmake") + +set(IOS_SDK_VERSION 10.3) +set(IOS_DEPLOYMENT_SDK_VERSION 9.3) + +set(POLLY_XCODE_COMPILER "clang") +polly_init( + "iOS ${IOS_SDK_VERSION} / Deployment ${IOS_DEPLOYMENT_SDK_VERSION} / \ +${POLLY_XCODE_COMPILER} / \ +x86_64 / arm64 / \ +c++11 support" + "Xcode" +) + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_common.cmake") + +include(polly_fatal_error) + +# Fix try_compile +include(polly_ios_bundle_identifier) + +set(CMAKE_MACOSX_BUNDLE YES) +set(CMAKE_XCODE_ATTRIBUTE_CODE_SIGN_IDENTITY "iPhone Developer") + +set(IPHONEOS_ARCHS arm64) +set(IPHONESIMULATOR_ARCHS x86_64) + +include("${CMAKE_CURRENT_LIST_DIR}/compiler/xcode.cmake") +include("${CMAKE_CURRENT_LIST_DIR}/os/iphone.cmake") +include("${CMAKE_CURRENT_LIST_DIR}/flags/cxx11.cmake") + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_ios_development_team.cmake") diff --git a/tools/polly/ios-10-3-lto.cmake b/tools/polly/ios-10-3-lto.cmake new file mode 100644 index 0000000..48a9b86 --- /dev/null +++ b/tools/polly/ios-10-3-lto.cmake @@ -0,0 +1,41 @@ +# Copyright (c) 2016-2017, Ruslan Baratov +# All rights reserved. + +if(DEFINED POLLY_IOS_10_3_LTO_CMAKE_) + return() +else() + set(POLLY_IOS_10_3_LTO_CMAKE_ 1) +endif() + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_clear_environment_variables.cmake") + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_init.cmake") + +set(IOS_SDK_VERSION 10.3) +set(POLLY_XCODE_COMPILER "clang") +polly_init( + "iOS ${IOS_SDK_VERSION} Universal (iphoneos + iphonesimulator) / \ +${POLLY_XCODE_COMPILER} / \ +c++11 support / LTO" + "Xcode" +) + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_common.cmake") + +include(polly_fatal_error) + +# Fix try_compile +include(polly_ios_bundle_identifier) + +set(CMAKE_MACOSX_BUNDLE YES) +set(CMAKE_XCODE_ATTRIBUTE_CODE_SIGN_IDENTITY "iPhone Developer") + +set(IPHONEOS_ARCHS armv7;armv7s;arm64) +set(IPHONESIMULATOR_ARCHS i386;x86_64) + +include("${CMAKE_CURRENT_LIST_DIR}/compiler/xcode.cmake") +include("${CMAKE_CURRENT_LIST_DIR}/os/iphone.cmake") +include("${CMAKE_CURRENT_LIST_DIR}/flags/cxx11.cmake") +include("${CMAKE_CURRENT_LIST_DIR}/flags/lto.cmake") + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_ios_development_team.cmake") diff --git a/tools/polly/ios-10-3.cmake b/tools/polly/ios-10-3.cmake new file mode 100644 index 0000000..3f91de5 --- /dev/null +++ b/tools/polly/ios-10-3.cmake @@ -0,0 +1,40 @@ +# Copyright (c) 2016, Ruslan Baratov +# All rights reserved. + +if(DEFINED POLLY_IOS_10_3_CMAKE_) + return() +else() + set(POLLY_IOS_10_3_CMAKE_ 1) +endif() + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_clear_environment_variables.cmake") + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_init.cmake") + +set(IOS_SDK_VERSION 10.3) +set(POLLY_XCODE_COMPILER "clang") +polly_init( + "iOS ${IOS_SDK_VERSION} Universal (iphoneos + iphonesimulator) / \ +${POLLY_XCODE_COMPILER} / \ +c++11 support" + "Xcode" +) + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_common.cmake") + +include(polly_fatal_error) + +# Fix try_compile +include(polly_ios_bundle_identifier) + +set(CMAKE_MACOSX_BUNDLE YES) +set(CMAKE_XCODE_ATTRIBUTE_CODE_SIGN_IDENTITY "iPhone Developer") + +set(IPHONEOS_ARCHS armv7;armv7s;arm64) +set(IPHONESIMULATOR_ARCHS i386;x86_64) + +include("${CMAKE_CURRENT_LIST_DIR}/compiler/xcode.cmake") +include("${CMAKE_CURRENT_LIST_DIR}/os/iphone.cmake") +include("${CMAKE_CURRENT_LIST_DIR}/flags/cxx11.cmake") + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_ios_development_team.cmake") diff --git a/tools/polly/ios-11-0-dep-9-0-bitcode-cxx11.cmake b/tools/polly/ios-11-0-dep-9-0-bitcode-cxx11.cmake new file mode 100644 index 0000000..4e6b3b6 --- /dev/null +++ b/tools/polly/ios-11-0-dep-9-0-bitcode-cxx11.cmake @@ -0,0 +1,44 @@ +# Copyright (c) 2017, Ruslan Baratov +# All rights reserved. + +if(DEFINED POLLY_IOS_11_0_DEP_9_0_BITCODE_CMAKE_) + return() +else() + set(POLLY_IOS_11_0_DEP_9_0_BITCODE_CMAKE_ 1) +endif() + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_clear_environment_variables.cmake") + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_init.cmake") + +set(IOS_SDK_VERSION 11.0) +set(IOS_DEPLOYMENT_SDK_VERSION 9.0) + +set(POLLY_XCODE_COMPILER "clang") +polly_init( + "iOS ${IOS_SDK_VERSION} / Deployment ${IOS_DEPLOYMENT_SDK_VERSION} / Universal (iphoneos + iphonesimulator) / \ +${POLLY_XCODE_COMPILER} / \ +bitcode / \ +c++11 support" + "Xcode" +) + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_common.cmake") + +include(polly_fatal_error) + +# Fix try_compile +include(polly_ios_bundle_identifier) + +set(CMAKE_MACOSX_BUNDLE YES) +set(CMAKE_XCODE_ATTRIBUTE_CODE_SIGN_IDENTITY "iPhone Developer") + +set(IPHONEOS_ARCHS armv7;armv7s;arm64) +set(IPHONESIMULATOR_ARCHS i386;x86_64) + +include("${CMAKE_CURRENT_LIST_DIR}/compiler/xcode.cmake") +include("${CMAKE_CURRENT_LIST_DIR}/os/iphone.cmake") +include("${CMAKE_CURRENT_LIST_DIR}/flags/cxx11.cmake") +include("${CMAKE_CURRENT_LIST_DIR}/flags/bitcode.cmake") # after os/iphone.cmake + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_ios_development_team.cmake") diff --git a/tools/polly/ios-11-0-dep-9-0-device-bitcode-cxx11.cmake b/tools/polly/ios-11-0-dep-9-0-device-bitcode-cxx11.cmake new file mode 100644 index 0000000..0dea6a2 --- /dev/null +++ b/tools/polly/ios-11-0-dep-9-0-device-bitcode-cxx11.cmake @@ -0,0 +1,44 @@ +# Copyright (c) 2017, Ruslan Baratov +# All rights reserved. + +if(DEFINED POLLY_IOS_11_0_DEP_9_0_DEVICE_BITCODE_CMAKE_) + return() +else() + set(POLLY_IOS_11_0_DEP_9_0_DEVICE_BITCODE_CMAKE_ 1) +endif() + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_clear_environment_variables.cmake") + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_init.cmake") + +set(IOS_SDK_VERSION 11.0) +set(IOS_DEPLOYMENT_SDK_VERSION 9.0) + +set(POLLY_XCODE_COMPILER "clang") +polly_init( + "iOS ${IOS_SDK_VERSION} / Deployment ${IOS_DEPLOYMENT_SDK_VERSION} / Universal (arm64 armv7s armv7) / \ +${POLLY_XCODE_COMPILER} / \ +bitcode / \ +c++11 support" + "Xcode" +) + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_common.cmake") + +include(polly_fatal_error) + +# Fix try_compile +include(polly_ios_bundle_identifier) + +set(CMAKE_MACOSX_BUNDLE YES) +set(CMAKE_XCODE_ATTRIBUTE_CODE_SIGN_IDENTITY "iPhone Developer") + +set(IPHONEOS_ARCHS armv7;armv7s;arm64) +set(IPHONESIMULATOR_ARCHS "") + +include("${CMAKE_CURRENT_LIST_DIR}/compiler/xcode.cmake") +include("${CMAKE_CURRENT_LIST_DIR}/os/iphone.cmake") +include("${CMAKE_CURRENT_LIST_DIR}/flags/cxx11.cmake") +include("${CMAKE_CURRENT_LIST_DIR}/flags/bitcode.cmake") # after os/iphone.cmake + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_ios_development_team.cmake") diff --git a/tools/polly/ios-11-0.cmake b/tools/polly/ios-11-0.cmake new file mode 100644 index 0000000..383c571 --- /dev/null +++ b/tools/polly/ios-11-0.cmake @@ -0,0 +1,40 @@ +# Copyright (c) 2016, Ruslan Baratov +# All rights reserved. + +if(DEFINED POLLY_IOS_11_0_CMAKE_) + return() +else() + set(POLLY_IOS_11_0_CMAKE_ 1) +endif() + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_clear_environment_variables.cmake") + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_init.cmake") + +set(IOS_SDK_VERSION 11.0) +set(POLLY_XCODE_COMPILER "clang") +polly_init( + "iOS ${IOS_SDK_VERSION} Universal (iphoneos + iphonesimulator) / \ +${POLLY_XCODE_COMPILER} / \ +c++14 support" + "Xcode" +) + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_common.cmake") + +include(polly_fatal_error) + +# Fix try_compile +include(polly_ios_bundle_identifier) + +set(CMAKE_MACOSX_BUNDLE YES) +set(CMAKE_XCODE_ATTRIBUTE_CODE_SIGN_IDENTITY "iPhone Developer") + +set(IPHONEOS_ARCHS arm64) +set(IPHONESIMULATOR_ARCHS x86_64) + +include("${CMAKE_CURRENT_LIST_DIR}/compiler/xcode.cmake") +include("${CMAKE_CURRENT_LIST_DIR}/os/iphone.cmake") +include("${CMAKE_CURRENT_LIST_DIR}/flags/cxx14.cmake") + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_ios_development_team.cmake") diff --git a/tools/polly/ios-11-1-dep-9-0-bitcode-cxx11.cmake b/tools/polly/ios-11-1-dep-9-0-bitcode-cxx11.cmake new file mode 100644 index 0000000..d34019e --- /dev/null +++ b/tools/polly/ios-11-1-dep-9-0-bitcode-cxx11.cmake @@ -0,0 +1,44 @@ +# Copyright (c) 2017, Ruslan Baratov +# All rights reserved. + +if(DEFINED POLLY_IOS_11_1_DEP_9_0_BITCODE_CMAKE_) + return() +else() + set(POLLY_IOS_11_1_DEP_9_0_BITCODE_CMAKE_ 1) +endif() + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_clear_environment_variables.cmake") + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_init.cmake") + +set(IOS_SDK_VERSION 11.1) +set(IOS_DEPLOYMENT_SDK_VERSION 9.0) + +set(POLLY_XCODE_COMPILER "clang") +polly_init( + "iOS ${IOS_SDK_VERSION} / Deployment ${IOS_DEPLOYMENT_SDK_VERSION} / Universal (iphoneos + iphonesimulator) / \ +${POLLY_XCODE_COMPILER} / \ +bitcode / \ +c++11 support" + "Xcode" +) + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_common.cmake") + +include(polly_fatal_error) + +# Fix try_compile +include(polly_ios_bundle_identifier) + +set(CMAKE_MACOSX_BUNDLE YES) +set(CMAKE_XCODE_ATTRIBUTE_CODE_SIGN_IDENTITY "iPhone Developer") + +set(IPHONEOS_ARCHS armv7;armv7s;arm64) +set(IPHONESIMULATOR_ARCHS i386;x86_64) + +include("${CMAKE_CURRENT_LIST_DIR}/compiler/xcode.cmake") +include("${CMAKE_CURRENT_LIST_DIR}/os/iphone.cmake") +include("${CMAKE_CURRENT_LIST_DIR}/flags/cxx11.cmake") +include("${CMAKE_CURRENT_LIST_DIR}/flags/bitcode.cmake") # after os/iphone.cmake + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_ios_development_team.cmake") diff --git a/tools/polly/ios-11-1-dep-9-0-device-bitcode-cxx11.cmake b/tools/polly/ios-11-1-dep-9-0-device-bitcode-cxx11.cmake new file mode 100644 index 0000000..1315f8f --- /dev/null +++ b/tools/polly/ios-11-1-dep-9-0-device-bitcode-cxx11.cmake @@ -0,0 +1,44 @@ +# Copyright (c) 2017, Ruslan Baratov +# All rights reserved. + +if(DEFINED POLLY_IOS_11_1_DEP_9_0_DEVICE_BITCODE_CMAKE_) + return() +else() + set(POLLY_IOS_11_1_DEP_9_0_DEVICE_BITCODE_CMAKE_ 1) +endif() + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_clear_environment_variables.cmake") + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_init.cmake") + +set(IOS_SDK_VERSION 11.1) +set(IOS_DEPLOYMENT_SDK_VERSION 9.0) + +set(POLLY_XCODE_COMPILER "clang") +polly_init( + "iOS ${IOS_SDK_VERSION} / Deployment ${IOS_DEPLOYMENT_SDK_VERSION} / Universal (arm64 armv7s armv7) / \ +${POLLY_XCODE_COMPILER} / \ +bitcode / \ +c++11 support" + "Xcode" +) + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_common.cmake") + +include(polly_fatal_error) + +# Fix try_compile +include(polly_ios_bundle_identifier) + +set(CMAKE_MACOSX_BUNDLE YES) +set(CMAKE_XCODE_ATTRIBUTE_CODE_SIGN_IDENTITY "iPhone Developer") + +set(IPHONEOS_ARCHS armv7;armv7s;arm64) +set(IPHONESIMULATOR_ARCHS "") + +include("${CMAKE_CURRENT_LIST_DIR}/compiler/xcode.cmake") +include("${CMAKE_CURRENT_LIST_DIR}/os/iphone.cmake") +include("${CMAKE_CURRENT_LIST_DIR}/flags/cxx11.cmake") +include("${CMAKE_CURRENT_LIST_DIR}/flags/bitcode.cmake") # after os/iphone.cmake + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_ios_development_team.cmake") diff --git a/tools/polly/ios-11-2-dep-9-0-device-bitcode-cxx11.cmake b/tools/polly/ios-11-2-dep-9-0-device-bitcode-cxx11.cmake new file mode 100644 index 0000000..12d8a6d --- /dev/null +++ b/tools/polly/ios-11-2-dep-9-0-device-bitcode-cxx11.cmake @@ -0,0 +1,44 @@ +# Copyright (c) 2017, Ruslan Baratov +# All rights reserved. + +if(DEFINED POLLY_IOS_11_2_DEP_9_0_DEVICE_BITCODE_CMAKE_) + return() +else() + set(POLLY_IOS_11_2_DEP_9_0_DEVICE_BITCODE_CMAKE_ 1) +endif() + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_clear_environment_variables.cmake") + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_init.cmake") + +set(IOS_SDK_VERSION 11.2) +set(IOS_DEPLOYMENT_SDK_VERSION 9.0) + +set(POLLY_XCODE_COMPILER "clang") +polly_init( + "iOS ${IOS_SDK_VERSION} / Deployment ${IOS_DEPLOYMENT_SDK_VERSION} / Universal (arm64 armv7s armv7) / \ +${POLLY_XCODE_COMPILER} / \ +bitcode / \ +c++11 support" + "Xcode" +) + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_common.cmake") + +include(polly_fatal_error) + +# Fix try_compile +include(polly_ios_bundle_identifier) + +set(CMAKE_MACOSX_BUNDLE YES) +set(CMAKE_XCODE_ATTRIBUTE_CODE_SIGN_IDENTITY "iPhone Developer") + +set(IPHONEOS_ARCHS armv7;armv7s;arm64) +set(IPHONESIMULATOR_ARCHS "") + +include("${CMAKE_CURRENT_LIST_DIR}/compiler/xcode.cmake") +include("${CMAKE_CURRENT_LIST_DIR}/os/iphone.cmake") +include("${CMAKE_CURRENT_LIST_DIR}/flags/cxx11.cmake") +include("${CMAKE_CURRENT_LIST_DIR}/flags/bitcode.cmake") # after os/iphone.cmake + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_ios_development_team.cmake") diff --git a/tools/polly/ios-11-2-dep-9-0-device-bitcode-nocxx.cmake b/tools/polly/ios-11-2-dep-9-0-device-bitcode-nocxx.cmake new file mode 100644 index 0000000..d1aa5a7 --- /dev/null +++ b/tools/polly/ios-11-2-dep-9-0-device-bitcode-nocxx.cmake @@ -0,0 +1,43 @@ +# Copyright (c) 2017, Ruslan Baratov +# All rights reserved. + +if(DEFINED POLLY_IOS_11_2_DEP_9_0_DEVICE_BITCODE_NOCXX_CMAKE_) + return() +else() + set(POLLY_IOS_11_2_DEP_9_0_DEVICE_BITCODE_NOCXX_CMAKE_ 1) +endif() + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_clear_environment_variables.cmake") + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_init.cmake") + +set(IOS_SDK_VERSION 11.2) +set(IOS_DEPLOYMENT_SDK_VERSION 9.0) + +set(POLLY_XCODE_COMPILER "clang") +polly_init( + "iOS ${IOS_SDK_VERSION} / Deployment ${IOS_DEPLOYMENT_SDK_VERSION} / Universal (arm64 armv7s armv7) / \ +${POLLY_XCODE_COMPILER} / \ +bitcode / \ +any c++ support" + "Xcode" +) + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_common.cmake") + +include(polly_fatal_error) + +# Fix try_compile +include(polly_ios_bundle_identifier) + +set(CMAKE_MACOSX_BUNDLE YES) +set(CMAKE_XCODE_ATTRIBUTE_CODE_SIGN_IDENTITY "iPhone Developer") + +set(IPHONEOS_ARCHS armv7;armv7s;arm64) +set(IPHONESIMULATOR_ARCHS "") + +include("${CMAKE_CURRENT_LIST_DIR}/compiler/xcode.cmake") +include("${CMAKE_CURRENT_LIST_DIR}/os/iphone.cmake") +include("${CMAKE_CURRENT_LIST_DIR}/flags/bitcode.cmake") # after os/iphone.cmake + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_ios_development_team.cmake") diff --git a/tools/polly/ios-11-2-dep-9-3-arm64-armv7.cmake b/tools/polly/ios-11-2-dep-9-3-arm64-armv7.cmake new file mode 100644 index 0000000..b4a0697 --- /dev/null +++ b/tools/polly/ios-11-2-dep-9-3-arm64-armv7.cmake @@ -0,0 +1,42 @@ +# Copyright (c) 2017-2018, Ruslan Baratov +# All rights reserved. + +if(DEFINED POLLY_IOS_11_2_DEP_9_3_ARM64_ARMV7_CMAKE_) + return() +else() + set(POLLY_IOS_11_2_DEP_9_3_ARM64_ARMV7_CMAKE_ 1) +endif() + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_clear_environment_variables.cmake") + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_init.cmake") + +set(IOS_SDK_VERSION 11.2) +set(IOS_DEPLOYMENT_SDK_VERSION 9.3) + +set(POLLY_XCODE_COMPILER "clang") +polly_init( + "iOS ${IOS_SDK_VERSION} / Deployment ${IOS_DEPLOYMENT_SDK_VERSION} / Universal (arm64 armv7) / \ +${POLLY_XCODE_COMPILER} / \ +c++14 support" + "Xcode" +) + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_common.cmake") + +include(polly_fatal_error) + +# Fix try_compile +include(polly_ios_bundle_identifier) + +set(CMAKE_MACOSX_BUNDLE YES) +set(CMAKE_XCODE_ATTRIBUTE_CODE_SIGN_IDENTITY "iPhone Developer") + +set(IPHONEOS_ARCHS armv7;arm64) +set(IPHONESIMULATOR_ARCHS "") + +include("${CMAKE_CURRENT_LIST_DIR}/compiler/xcode.cmake") +include("${CMAKE_CURRENT_LIST_DIR}/os/iphone.cmake") +include("${CMAKE_CURRENT_LIST_DIR}/flags/cxx14.cmake") + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_ios_development_team.cmake") diff --git a/tools/polly/ios-11-3-dep-9-0-arm64.cmake b/tools/polly/ios-11-3-dep-9-0-arm64.cmake new file mode 100644 index 0000000..93e3198 --- /dev/null +++ b/tools/polly/ios-11-3-dep-9-0-arm64.cmake @@ -0,0 +1,43 @@ +# Copyright (c) 2017-2018, Ruslan Baratov +# Copyright (c) 2018, David Hirvonen +# All rights reserved. + +if(DEFINED POLLY_IOS_11_3_DEP_9_0_ARM64_CMAKE_) + return() +else() + set(POLLY_IOS_11_3_DEP_9_0_ARM64_CMAKE_ 1) +endif() + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_clear_environment_variables.cmake") + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_init.cmake") + +set(IOS_SDK_VERSION 11.3) +set(IOS_DEPLOYMENT_SDK_VERSION 9.0) + +set(POLLY_XCODE_COMPILER "clang") +polly_init( + "iOS ${IOS_SDK_VERSION} / Deployment ${IOS_DEPLOYMENT_SDK_VERSION} / Universal (arm64) / \ +${POLLY_XCODE_COMPILER} / \ +c++14 support" + "Xcode" +) + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_common.cmake") + +include(polly_fatal_error) + +# Fix try_compile +include(polly_ios_bundle_identifier) + +set(CMAKE_MACOSX_BUNDLE YES) +set(CMAKE_XCODE_ATTRIBUTE_CODE_SIGN_IDENTITY "iPhone Developer") + +set(IPHONEOS_ARCHS arm64) +set(IPHONESIMULATOR_ARCHS "") + +include("${CMAKE_CURRENT_LIST_DIR}/compiler/xcode.cmake") +include("${CMAKE_CURRENT_LIST_DIR}/os/iphone.cmake") +include("${CMAKE_CURRENT_LIST_DIR}/flags/cxx14.cmake") + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_ios_development_team.cmake") diff --git a/tools/polly/ios-11-3-dep-9-0-device-bitcode-cxx11.cmake b/tools/polly/ios-11-3-dep-9-0-device-bitcode-cxx11.cmake new file mode 100644 index 0000000..5dba22b --- /dev/null +++ b/tools/polly/ios-11-3-dep-9-0-device-bitcode-cxx11.cmake @@ -0,0 +1,44 @@ +# Copyright (c) 2017, Ruslan Baratov +# All rights reserved. + +if(DEFINED POLLY_IOS_11_3_DEP_9_0_DEVICE_BITCODE_CMAKE_) + return() +else() + set(POLLY_IOS_11_3_DEP_9_0_DEVICE_BITCODE_CMAKE_ 1) +endif() + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_clear_environment_variables.cmake") + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_init.cmake") + +set(IOS_SDK_VERSION 11.3) +set(IOS_DEPLOYMENT_SDK_VERSION 9.0) + +set(POLLY_XCODE_COMPILER "clang") +polly_init( + "iOS ${IOS_SDK_VERSION} / Deployment ${IOS_DEPLOYMENT_SDK_VERSION} / Universal (arm64 armv7s armv7) / \ +${POLLY_XCODE_COMPILER} / \ +bitcode / \ +c++11 support" + "Xcode" +) + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_common.cmake") + +include(polly_fatal_error) + +# Fix try_compile +include(polly_ios_bundle_identifier) + +set(CMAKE_MACOSX_BUNDLE YES) +set(CMAKE_XCODE_ATTRIBUTE_CODE_SIGN_IDENTITY "iPhone Developer") + +set(IPHONEOS_ARCHS armv7;armv7s;arm64) +set(IPHONESIMULATOR_ARCHS "") + +include("${CMAKE_CURRENT_LIST_DIR}/compiler/xcode.cmake") +include("${CMAKE_CURRENT_LIST_DIR}/os/iphone.cmake") +include("${CMAKE_CURRENT_LIST_DIR}/flags/cxx11.cmake") +include("${CMAKE_CURRENT_LIST_DIR}/flags/bitcode.cmake") # after os/iphone.cmake + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_ios_development_team.cmake") diff --git a/tools/polly/ios-11-3-dep-9-0-device-bitcode-cxx17.cmake b/tools/polly/ios-11-3-dep-9-0-device-bitcode-cxx17.cmake new file mode 100644 index 0000000..391126f --- /dev/null +++ b/tools/polly/ios-11-3-dep-9-0-device-bitcode-cxx17.cmake @@ -0,0 +1,44 @@ +# Copyright (c) 2017, Ruslan Baratov +# All rights reserved. + +if(DEFINED POLLY_IOS_11_3_DEP_9_0_DEVICE_BITCODE_CXX17_CMAKE_) + return() +else() + set(POLLY_IOS_11_3_DEP_9_0_DEVICE_BITCODE_CXX17_CMAKE_ 1) +endif() + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_clear_environment_variables.cmake") + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_init.cmake") + +set(IOS_SDK_VERSION 11.3) +set(IOS_DEPLOYMENT_SDK_VERSION 9.0) + +set(POLLY_XCODE_COMPILER "clang") +polly_init( + "iOS ${IOS_SDK_VERSION} / Deployment ${IOS_DEPLOYMENT_SDK_VERSION} / Universal (arm64 armv7s armv7) / \ +${POLLY_XCODE_COMPILER} / \ +bitcode / \ +c++17 support" + "Xcode" +) + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_common.cmake") + +include(polly_fatal_error) + +# Fix try_compile +include(polly_ios_bundle_identifier) + +set(CMAKE_MACOSX_BUNDLE YES) +set(CMAKE_XCODE_ATTRIBUTE_CODE_SIGN_IDENTITY "iPhone Developer") + +set(IPHONEOS_ARCHS armv7;armv7s;arm64) +set(IPHONESIMULATOR_ARCHS "") + +include("${CMAKE_CURRENT_LIST_DIR}/compiler/xcode.cmake") +include("${CMAKE_CURRENT_LIST_DIR}/os/iphone.cmake") +include("${CMAKE_CURRENT_LIST_DIR}/flags/cxx17.cmake") +include("${CMAKE_CURRENT_LIST_DIR}/flags/bitcode.cmake") # after os/iphone.cmake + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_ios_development_team.cmake") diff --git a/tools/polly/ios-11-3-dep-9-0-device-bitcode-nocxx.cmake b/tools/polly/ios-11-3-dep-9-0-device-bitcode-nocxx.cmake new file mode 100644 index 0000000..4730e53 --- /dev/null +++ b/tools/polly/ios-11-3-dep-9-0-device-bitcode-nocxx.cmake @@ -0,0 +1,43 @@ +# Copyright (c) 2017, Ruslan Baratov +# All rights reserved. + +if(DEFINED POLLY_IOS_11_3_DEP_9_0_DEVICE_BITCODE_NOCXX_CMAKE_) + return() +else() + set(POLLY_IOS_11_3_DEP_9_0_DEVICE_BITCODE_NOCXX_CMAKE_ 1) +endif() + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_clear_environment_variables.cmake") + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_init.cmake") + +set(IOS_SDK_VERSION 11.3) +set(IOS_DEPLOYMENT_SDK_VERSION 9.0) + +set(POLLY_XCODE_COMPILER "clang") +polly_init( + "iOS ${IOS_SDK_VERSION} / Deployment ${IOS_DEPLOYMENT_SDK_VERSION} / Universal (arm64 armv7s armv7) / \ +${POLLY_XCODE_COMPILER} / \ +bitcode / \ +any c++ support" + "Xcode" +) + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_common.cmake") + +include(polly_fatal_error) + +# Fix try_compile +include(polly_ios_bundle_identifier) + +set(CMAKE_MACOSX_BUNDLE YES) +set(CMAKE_XCODE_ATTRIBUTE_CODE_SIGN_IDENTITY "iPhone Developer") + +set(IPHONEOS_ARCHS armv7;armv7s;arm64) +set(IPHONESIMULATOR_ARCHS "") + +include("${CMAKE_CURRENT_LIST_DIR}/compiler/xcode.cmake") +include("${CMAKE_CURRENT_LIST_DIR}/os/iphone.cmake") +include("${CMAKE_CURRENT_LIST_DIR}/flags/bitcode.cmake") # after os/iphone.cmake + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_ios_development_team.cmake") diff --git a/tools/polly/ios-11-3-dep-9-0-device-bitcode.cmake b/tools/polly/ios-11-3-dep-9-0-device-bitcode.cmake new file mode 100644 index 0000000..e3f3b59 --- /dev/null +++ b/tools/polly/ios-11-3-dep-9-0-device-bitcode.cmake @@ -0,0 +1,44 @@ +# Copyright (c) 2017, Ruslan Baratov +# All rights reserved. + +if(DEFINED POLLY_IOS_11_3_DEP_9_0_DEVICE_BITCODE_CMAKE_) + return() +else() + set(POLLY_IOS_11_3_DEP_9_0_DEVICE_BITCODE_CMAKE_ 1) +endif() + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_clear_environment_variables.cmake") + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_init.cmake") + +set(IOS_SDK_VERSION 11.3) +set(IOS_DEPLOYMENT_SDK_VERSION 9.0) + +set(POLLY_XCODE_COMPILER "clang") +polly_init( + "iOS ${IOS_SDK_VERSION} / Deployment ${IOS_DEPLOYMENT_SDK_VERSION} / Universal (arm64 armv7s armv7) / \ +${POLLY_XCODE_COMPILER} / \ +bitcode / \ +c++14 support" + "Xcode" +) + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_common.cmake") + +include(polly_fatal_error) + +# Fix try_compile +include(polly_ios_bundle_identifier) + +set(CMAKE_MACOSX_BUNDLE YES) +set(CMAKE_XCODE_ATTRIBUTE_CODE_SIGN_IDENTITY "iPhone Developer") + +set(IPHONEOS_ARCHS armv7;armv7s;arm64) +set(IPHONESIMULATOR_ARCHS "") + +include("${CMAKE_CURRENT_LIST_DIR}/compiler/xcode.cmake") +include("${CMAKE_CURRENT_LIST_DIR}/os/iphone.cmake") +include("${CMAKE_CURRENT_LIST_DIR}/flags/cxx14.cmake") +include("${CMAKE_CURRENT_LIST_DIR}/flags/bitcode.cmake") # after os/iphone.cmake + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_ios_development_team.cmake") diff --git a/tools/polly/ios-11-3-dep-9-3-arm64-armv7.cmake b/tools/polly/ios-11-3-dep-9-3-arm64-armv7.cmake new file mode 100644 index 0000000..28b9418 --- /dev/null +++ b/tools/polly/ios-11-3-dep-9-3-arm64-armv7.cmake @@ -0,0 +1,42 @@ +# Copyright (c) 2017-2018, Ruslan Baratov +# All rights reserved. + +if(DEFINED POLLY_IOS_11_3_DEP_9_3_ARM64_ARMV7_CMAKE_) + return() +else() + set(POLLY_IOS_11_3_DEP_9_3_ARM64_ARMV7_CMAKE_ 1) +endif() + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_clear_environment_variables.cmake") + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_init.cmake") + +set(IOS_SDK_VERSION 11.3) +set(IOS_DEPLOYMENT_SDK_VERSION 9.3) + +set(POLLY_XCODE_COMPILER "clang") +polly_init( + "iOS ${IOS_SDK_VERSION} / Deployment ${IOS_DEPLOYMENT_SDK_VERSION} / Universal (arm64 armv7) / \ +${POLLY_XCODE_COMPILER} / \ +c++14 support" + "Xcode" +) + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_common.cmake") + +include(polly_fatal_error) + +# Fix try_compile +include(polly_ios_bundle_identifier) + +set(CMAKE_MACOSX_BUNDLE YES) +set(CMAKE_XCODE_ATTRIBUTE_CODE_SIGN_IDENTITY "iPhone Developer") + +set(IPHONEOS_ARCHS armv7;arm64) +set(IPHONESIMULATOR_ARCHS "") + +include("${CMAKE_CURRENT_LIST_DIR}/compiler/xcode.cmake") +include("${CMAKE_CURRENT_LIST_DIR}/os/iphone.cmake") +include("${CMAKE_CURRENT_LIST_DIR}/flags/cxx14.cmake") + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_ios_development_team.cmake") diff --git a/tools/polly/ios-11-4-dep-8-0-arm64-armv7-hid-sections-lto-cxx11.cmake b/tools/polly/ios-11-4-dep-8-0-arm64-armv7-hid-sections-lto-cxx11.cmake new file mode 100644 index 0000000..af0a7bc --- /dev/null +++ b/tools/polly/ios-11-4-dep-8-0-arm64-armv7-hid-sections-lto-cxx11.cmake @@ -0,0 +1,45 @@ +# Copyright (c) 2017-2018, Ruslan Baratov +# All rights reserved. + +if(DEFINED POLLY_IOS_11_4_DEP_8_0_ARM64_ARMV7_HID_SECTIONS_LTO_CXX11_CMAKE_) + return() +else() + set(POLLY_IOS_11_4_DEP_8_0_ARM64_ARMV7_HID_SECTIONS_LTO_CXX11_CMAKE_ 1) +endif() + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_clear_environment_variables.cmake") + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_init.cmake") + +set(IOS_SDK_VERSION 11.4) +set(IOS_DEPLOYMENT_SDK_VERSION 8.0) + +set(POLLY_XCODE_COMPILER "clang") +polly_init( + "iOS ${IOS_SDK_VERSION} / Deployment ${IOS_DEPLOYMENT_SDK_VERSION} / Universal (arm64 armv7) / \ +${POLLY_XCODE_COMPILER} / \ +c++11 support / hidden / data-sections / function-sections / LTO" + "Xcode" +) + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_common.cmake") + +include(polly_fatal_error) + +# Fix try_compile +include(polly_ios_bundle_identifier) + +set(CMAKE_MACOSX_BUNDLE YES) +set(CMAKE_XCODE_ATTRIBUTE_CODE_SIGN_IDENTITY "iPhone Developer") + +set(IPHONEOS_ARCHS arm64;armv7) +set(IPHONESIMULATOR_ARCHS "") + +include("${CMAKE_CURRENT_LIST_DIR}/compiler/xcode.cmake") +include("${CMAKE_CURRENT_LIST_DIR}/os/iphone.cmake") +include("${CMAKE_CURRENT_LIST_DIR}/flags/cxx11.cmake") +include("${CMAKE_CURRENT_LIST_DIR}/flags/hidden.cmake") +include("${CMAKE_CURRENT_LIST_DIR}/flags/function-sections.cmake") +include("${CMAKE_CURRENT_LIST_DIR}/flags/data-sections.cmake") +include("${CMAKE_CURRENT_LIST_DIR}/flags/lto.cmake") +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_ios_development_team.cmake") diff --git a/tools/polly/ios-11-4-dep-8-0-arm64-hid-sections-lto-cxx11.cmake b/tools/polly/ios-11-4-dep-8-0-arm64-hid-sections-lto-cxx11.cmake new file mode 100644 index 0000000..cee8479 --- /dev/null +++ b/tools/polly/ios-11-4-dep-8-0-arm64-hid-sections-lto-cxx11.cmake @@ -0,0 +1,45 @@ +# Copyright (c) 2017-2018, Ruslan Baratov +# All rights reserved. + +if(DEFINED POLLY_IOS_11_4_DEP_8_0_ARM64_HID_SECTIONS_LTO_CXX11_CMAKE_) + return() +else() + set(POLLY_IOS_11_4_DEP_8_0_ARM64_HID_SECTIONS_LTO_CXX11_CMAKE_ 1) +endif() + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_clear_environment_variables.cmake") + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_init.cmake") + +set(IOS_SDK_VERSION 11.4) +set(IOS_DEPLOYMENT_SDK_VERSION 8.0) + +set(POLLY_XCODE_COMPILER "clang") +polly_init( + "iOS ${IOS_SDK_VERSION} / Deployment ${IOS_DEPLOYMENT_SDK_VERSION} / arm64 / \ +${POLLY_XCODE_COMPILER} / \ +c++11 support / hidden / data-sections / function-sections / LTO" + "Xcode" +) + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_common.cmake") + +include(polly_fatal_error) + +# Fix try_compile +include(polly_ios_bundle_identifier) + +set(CMAKE_MACOSX_BUNDLE YES) +set(CMAKE_XCODE_ATTRIBUTE_CODE_SIGN_IDENTITY "iPhone Developer") + +set(IPHONEOS_ARCHS arm64) +set(IPHONESIMULATOR_ARCHS "") + +include("${CMAKE_CURRENT_LIST_DIR}/compiler/xcode.cmake") +include("${CMAKE_CURRENT_LIST_DIR}/os/iphone.cmake") +include("${CMAKE_CURRENT_LIST_DIR}/flags/cxx11.cmake") +include("${CMAKE_CURRENT_LIST_DIR}/flags/hidden.cmake") +include("${CMAKE_CURRENT_LIST_DIR}/flags/function-sections.cmake") +include("${CMAKE_CURRENT_LIST_DIR}/flags/data-sections.cmake") +include("${CMAKE_CURRENT_LIST_DIR}/flags/lto.cmake") +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_ios_development_team.cmake") diff --git a/tools/polly/ios-11-4-dep-9-0-device-bitcode-cxx11.cmake b/tools/polly/ios-11-4-dep-9-0-device-bitcode-cxx11.cmake new file mode 100644 index 0000000..5aa8902 --- /dev/null +++ b/tools/polly/ios-11-4-dep-9-0-device-bitcode-cxx11.cmake @@ -0,0 +1,44 @@ +# Copyright (c) 2017, Ruslan Baratov +# All rights reserved. + +if(DEFINED POLLY_IOS_11_4_DEP_9_0_DEVICE_BITCODE_CMAKE_) + return() +else() + set(POLLY_IOS_11_4_DEP_9_0_DEVICE_BITCODE_CMAKE_ 1) +endif() + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_clear_environment_variables.cmake") + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_init.cmake") + +set(IOS_SDK_VERSION 11.4) +set(IOS_DEPLOYMENT_SDK_VERSION 9.0) + +set(POLLY_XCODE_COMPILER "clang") +polly_init( + "iOS ${IOS_SDK_VERSION} / Deployment ${IOS_DEPLOYMENT_SDK_VERSION} / Universal (arm64 armv7s armv7) / \ +${POLLY_XCODE_COMPILER} / \ +bitcode / \ +c++11 support" + "Xcode" +) + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_common.cmake") + +include(polly_fatal_error) + +# Fix try_compile +include(polly_ios_bundle_identifier) + +set(CMAKE_MACOSX_BUNDLE YES) +set(CMAKE_XCODE_ATTRIBUTE_CODE_SIGN_IDENTITY "iPhone Developer") + +set(IPHONEOS_ARCHS armv7;armv7s;arm64) +set(IPHONESIMULATOR_ARCHS "") + +include("${CMAKE_CURRENT_LIST_DIR}/compiler/xcode.cmake") +include("${CMAKE_CURRENT_LIST_DIR}/os/iphone.cmake") +include("${CMAKE_CURRENT_LIST_DIR}/flags/cxx11.cmake") +include("${CMAKE_CURRENT_LIST_DIR}/flags/bitcode.cmake") # after os/iphone.cmake + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_ios_development_team.cmake") diff --git a/tools/polly/ios-11-4-dep-9-0-device-bitcode-nocxx.cmake b/tools/polly/ios-11-4-dep-9-0-device-bitcode-nocxx.cmake new file mode 100644 index 0000000..8d57c84 --- /dev/null +++ b/tools/polly/ios-11-4-dep-9-0-device-bitcode-nocxx.cmake @@ -0,0 +1,43 @@ +# Copyright (c) 2017, Ruslan Baratov +# All rights reserved. + +if(DEFINED POLLY_IOS_11_4_DEP_9_0_DEVICE_BITCODE_NOCXX_CMAKE_) + return() +else() + set(POLLY_IOS_11_4_DEP_9_0_DEVICE_BITCODE_NOCXX_CMAKE_ 1) +endif() + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_clear_environment_variables.cmake") + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_init.cmake") + +set(IOS_SDK_VERSION 11.4) +set(IOS_DEPLOYMENT_SDK_VERSION 9.0) + +set(POLLY_XCODE_COMPILER "clang") +polly_init( + "iOS ${IOS_SDK_VERSION} / Deployment ${IOS_DEPLOYMENT_SDK_VERSION} / Universal (arm64 armv7s armv7) / \ +${POLLY_XCODE_COMPILER} / \ +bitcode / \ +any c++ support" + "Xcode" +) + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_common.cmake") + +include(polly_fatal_error) + +# Fix try_compile +include(polly_ios_bundle_identifier) + +set(CMAKE_MACOSX_BUNDLE YES) +set(CMAKE_XCODE_ATTRIBUTE_CODE_SIGN_IDENTITY "iPhone Developer") + +set(IPHONEOS_ARCHS armv7;armv7s;arm64) +set(IPHONESIMULATOR_ARCHS "") + +include("${CMAKE_CURRENT_LIST_DIR}/compiler/xcode.cmake") +include("${CMAKE_CURRENT_LIST_DIR}/os/iphone.cmake") +include("${CMAKE_CURRENT_LIST_DIR}/flags/bitcode.cmake") # after os/iphone.cmake + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_ios_development_team.cmake") diff --git a/tools/polly/ios-11-4-dep-9-3-arm64-armv7.cmake b/tools/polly/ios-11-4-dep-9-3-arm64-armv7.cmake new file mode 100644 index 0000000..74e7377 --- /dev/null +++ b/tools/polly/ios-11-4-dep-9-3-arm64-armv7.cmake @@ -0,0 +1,42 @@ +# Copyright (c) 2017-2018, Ruslan Baratov +# All rights reserved. + +if(DEFINED POLLY_IOS_11_4_DEP_9_3_ARM64_ARMV7_CMAKE_) + return() +else() + set(POLLY_IOS_11_4_DEP_9_3_ARM64_ARMV7_CMAKE_ 1) +endif() + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_clear_environment_variables.cmake") + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_init.cmake") + +set(IOS_SDK_VERSION 11.4) +set(IOS_DEPLOYMENT_SDK_VERSION 9.3) + +set(POLLY_XCODE_COMPILER "clang") +polly_init( + "iOS ${IOS_SDK_VERSION} / Deployment ${IOS_DEPLOYMENT_SDK_VERSION} / Universal (arm64 armv7) / \ +${POLLY_XCODE_COMPILER} / \ +c++14 support" + "Xcode" +) + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_common.cmake") + +include(polly_fatal_error) + +# Fix try_compile +include(polly_ios_bundle_identifier) + +set(CMAKE_MACOSX_BUNDLE YES) +set(CMAKE_XCODE_ATTRIBUTE_CODE_SIGN_IDENTITY "iPhone Developer") + +set(IPHONEOS_ARCHS armv7;arm64) +set(IPHONESIMULATOR_ARCHS "") + +include("${CMAKE_CURRENT_LIST_DIR}/compiler/xcode.cmake") +include("${CMAKE_CURRENT_LIST_DIR}/os/iphone.cmake") +include("${CMAKE_CURRENT_LIST_DIR}/flags/cxx14.cmake") + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_ios_development_team.cmake") diff --git a/tools/polly/ios-11-4-dep-9-3-arm64-hid-sections-lto-cxx11.cmake b/tools/polly/ios-11-4-dep-9-3-arm64-hid-sections-lto-cxx11.cmake new file mode 100644 index 0000000..933e01b --- /dev/null +++ b/tools/polly/ios-11-4-dep-9-3-arm64-hid-sections-lto-cxx11.cmake @@ -0,0 +1,45 @@ +# Copyright (c) 2017-2018, Ruslan Baratov +# All rights reserved. + +if(DEFINED POLLY_IOS_11_4_DEP_9_3_ARM64_HID_SECTIONS_LTO_CXX11_CMAKE_) + return() +else() + set(POLLY_IOS_11_4_DEP_9_3_ARM64_HID_SECTIONS_LTO_CXX11_CMAKE_ 1) +endif() + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_clear_environment_variables.cmake") + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_init.cmake") + +set(IOS_SDK_VERSION 11.4) +set(IOS_DEPLOYMENT_SDK_VERSION 9.3) + +set(POLLY_XCODE_COMPILER "clang") +polly_init( + "iOS ${IOS_SDK_VERSION} / Deployment ${IOS_DEPLOYMENT_SDK_VERSION} / arm64 / \ +${POLLY_XCODE_COMPILER} / \ +c++11 support / hidden / data-sections / function-sections / LTO" + "Xcode" +) + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_common.cmake") + +include(polly_fatal_error) + +# Fix try_compile +include(polly_ios_bundle_identifier) + +set(CMAKE_MACOSX_BUNDLE YES) +set(CMAKE_XCODE_ATTRIBUTE_CODE_SIGN_IDENTITY "iPhone Developer") + +set(IPHONEOS_ARCHS arm64) +set(IPHONESIMULATOR_ARCHS "") + +include("${CMAKE_CURRENT_LIST_DIR}/compiler/xcode.cmake") +include("${CMAKE_CURRENT_LIST_DIR}/os/iphone.cmake") +include("${CMAKE_CURRENT_LIST_DIR}/flags/cxx11.cmake") +include("${CMAKE_CURRENT_LIST_DIR}/flags/hidden.cmake") +include("${CMAKE_CURRENT_LIST_DIR}/flags/function-sections.cmake") +include("${CMAKE_CURRENT_LIST_DIR}/flags/data-sections.cmake") +include("${CMAKE_CURRENT_LIST_DIR}/flags/lto.cmake") +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_ios_development_team.cmake") diff --git a/tools/polly/ios-11-4-dep-9-3-arm64.cmake b/tools/polly/ios-11-4-dep-9-3-arm64.cmake new file mode 100644 index 0000000..c5c0256 --- /dev/null +++ b/tools/polly/ios-11-4-dep-9-3-arm64.cmake @@ -0,0 +1,42 @@ +# Copyright (c) 2017-2018, Ruslan Baratov +# All rights reserved. + +if(DEFINED POLLY_IOS_11_4_DEP_9_3_ARM64_CMAKE_) + return() +else() + set(POLLY_IOS_11_4_DEP_9_3_ARM64_CMAKE_ 1) +endif() + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_clear_environment_variables.cmake") + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_init.cmake") + +set(IOS_SDK_VERSION 11.4) +set(IOS_DEPLOYMENT_SDK_VERSION 9.3) + +set(POLLY_XCODE_COMPILER "clang") +polly_init( + "iOS ${IOS_SDK_VERSION} / Deployment ${IOS_DEPLOYMENT_SDK_VERSION} / arm64 / \ +${POLLY_XCODE_COMPILER} / \ +c++14 support" + "Xcode" +) + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_common.cmake") + +include(polly_fatal_error) + +# Fix try_compile +include(polly_ios_bundle_identifier) + +set(CMAKE_MACOSX_BUNDLE YES) +set(CMAKE_XCODE_ATTRIBUTE_CODE_SIGN_IDENTITY "iPhone Developer") + +set(IPHONEOS_ARCHS arm64) +set(IPHONESIMULATOR_ARCHS "") + +include("${CMAKE_CURRENT_LIST_DIR}/compiler/xcode.cmake") +include("${CMAKE_CURRENT_LIST_DIR}/os/iphone.cmake") +include("${CMAKE_CURRENT_LIST_DIR}/flags/cxx14.cmake") + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_ios_development_team.cmake") diff --git a/tools/polly/ios-11-4-dep-9-3-armv7.cmake b/tools/polly/ios-11-4-dep-9-3-armv7.cmake new file mode 100644 index 0000000..d3296f3 --- /dev/null +++ b/tools/polly/ios-11-4-dep-9-3-armv7.cmake @@ -0,0 +1,42 @@ +# Copyright (c) 2017-2018, Ruslan Baratov +# All rights reserved. + +if(DEFINED POLLY_IOS_11_4_DEP_9_3_ARMV7_CMAKE_) + return() +else() + set(POLLY_IOS_11_4_DEP_9_3_ARMV7_CMAKE_ 1) +endif() + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_clear_environment_variables.cmake") + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_init.cmake") + +set(IOS_SDK_VERSION 11.4) +set(IOS_DEPLOYMENT_SDK_VERSION 9.3) + +set(POLLY_XCODE_COMPILER "clang") +polly_init( + "iOS ${IOS_SDK_VERSION} / Deployment ${IOS_DEPLOYMENT_SDK_VERSION} / armv7 / \ +${POLLY_XCODE_COMPILER} / \ +c++14 support" + "Xcode" +) + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_common.cmake") + +include(polly_fatal_error) + +# Fix try_compile +include(polly_ios_bundle_identifier) + +set(CMAKE_MACOSX_BUNDLE YES) +set(CMAKE_XCODE_ATTRIBUTE_CODE_SIGN_IDENTITY "iPhone Developer") + +set(IPHONEOS_ARCHS armv7) +set(IPHONESIMULATOR_ARCHS "") + +include("${CMAKE_CURRENT_LIST_DIR}/compiler/xcode.cmake") +include("${CMAKE_CURRENT_LIST_DIR}/os/iphone.cmake") +include("${CMAKE_CURRENT_LIST_DIR}/flags/cxx14.cmake") + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_ios_development_team.cmake") diff --git a/tools/polly/ios-11-4-dep-9-3.cmake b/tools/polly/ios-11-4-dep-9-3.cmake new file mode 100644 index 0000000..acc75bd --- /dev/null +++ b/tools/polly/ios-11-4-dep-9-3.cmake @@ -0,0 +1,42 @@ +# Copyright (c) 2017-2018, Ruslan Baratov +# All rights reserved. + +if(DEFINED POLLY_IOS_11_4_DEP_9_3_CMAKE_) + return() +else() + set(POLLY_IOS_11_4_DEP_9_3_CMAKE_ 1) +endif() + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_clear_environment_variables.cmake") + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_init.cmake") + +set(IOS_SDK_VERSION 11.4) +set(IOS_DEPLOYMENT_SDK_VERSION 9.3) + +set(POLLY_XCODE_COMPILER "clang") +polly_init( + "iOS ${IOS_SDK_VERSION} / Deployment ${IOS_DEPLOYMENT_SDK_VERSION} / Universal (iphoneos + iphonesimulator) / \ +${POLLY_XCODE_COMPILER} / \ +c++14 support" + "Xcode" +) + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_common.cmake") + +include(polly_fatal_error) + +# Fix try_compile +include(polly_ios_bundle_identifier) + +set(CMAKE_MACOSX_BUNDLE YES) +set(CMAKE_XCODE_ATTRIBUTE_CODE_SIGN_IDENTITY "iPhone Developer") + +set(IPHONEOS_ARCHS armv7;armv7s;arm64) +set(IPHONESIMULATOR_ARCHS i386;x86_64) + +include("${CMAKE_CURRENT_LIST_DIR}/compiler/xcode.cmake") +include("${CMAKE_CURRENT_LIST_DIR}/os/iphone.cmake") +include("${CMAKE_CURRENT_LIST_DIR}/flags/cxx14.cmake") + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_ios_development_team.cmake") diff --git a/tools/polly/ios-11-4-dep-9-4-arm64.cmake b/tools/polly/ios-11-4-dep-9-4-arm64.cmake new file mode 100644 index 0000000..8c6d60b --- /dev/null +++ b/tools/polly/ios-11-4-dep-9-4-arm64.cmake @@ -0,0 +1,42 @@ +# Copyright (c) 2017-2018, Ruslan Baratov +# All rights reserved. + +if(DEFINED POLLY_IOS_11_4_DEP_9_4_ARM64_CMAKE_) + return() +else() + set(POLLY_IOS_11_4_DEP_9_4_ARM64_CMAKE_ 1) +endif() + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_clear_environment_variables.cmake") + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_init.cmake") + +set(IOS_SDK_VERSION 11.4) +set(IOS_DEPLOYMENT_SDK_VERSION 9.4) + +set(POLLY_XCODE_COMPILER "clang") +polly_init( + "iOS ${IOS_SDK_VERSION} / Deployment ${IOS_DEPLOYMENT_SDK_VERSION} / Universal (arm64) / \ +${POLLY_XCODE_COMPILER} / \ +c++14 support" + "Xcode" +) + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_common.cmake") + +include(polly_fatal_error) + +# Fix try_compile +include(polly_ios_bundle_identifier) + +set(CMAKE_MACOSX_BUNDLE YES) +set(CMAKE_XCODE_ATTRIBUTE_CODE_SIGN_IDENTITY "iPhone Developer") + +set(IPHONEOS_ARCHS arm64) +set(IPHONESIMULATOR_ARCHS "") + +include("${CMAKE_CURRENT_LIST_DIR}/compiler/xcode.cmake") +include("${CMAKE_CURRENT_LIST_DIR}/os/iphone.cmake") +include("${CMAKE_CURRENT_LIST_DIR}/flags/cxx14.cmake") + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_ios_development_team.cmake") diff --git a/tools/polly/ios-12-0-dep-11-0-arm64.cmake b/tools/polly/ios-12-0-dep-11-0-arm64.cmake new file mode 100644 index 0000000..909ca99 --- /dev/null +++ b/tools/polly/ios-12-0-dep-11-0-arm64.cmake @@ -0,0 +1,42 @@ +# Copyright (c) 2017-2018, Ruslan Baratov +# All rights reserved. + +if(DEFINED POLLY_IOS_12_0_DEP_11_0_ARM64_CMAKE_) + return() +else() + set(POLLY_IOS_12_0_DEP_11_0_ARM64_CMAKE_ 1) +endif() + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_clear_environment_variables.cmake") + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_init.cmake") + +set(IOS_SDK_VERSION 12.0) +set(IOS_DEPLOYMENT_SDK_VERSION 11.0) + +set(POLLY_XCODE_COMPILER "clang") +polly_init( + "iOS ${IOS_SDK_VERSION} / Deployment ${IOS_DEPLOYMENT_SDK_VERSION} / Universal (arm64) / \ +${POLLY_XCODE_COMPILER} / \ +c++14 support" + "Xcode" +) + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_common.cmake") + +include(polly_fatal_error) + +# Fix try_compile +include(polly_ios_bundle_identifier) + +set(CMAKE_MACOSX_BUNDLE YES) +set(CMAKE_XCODE_ATTRIBUTE_CODE_SIGN_IDENTITY "iPhone Developer") + +set(IPHONEOS_ARCHS arm64) +set(IPHONESIMULATOR_ARCHS "") + +include("${CMAKE_CURRENT_LIST_DIR}/compiler/xcode.cmake") +include("${CMAKE_CURRENT_LIST_DIR}/os/iphone.cmake") +include("${CMAKE_CURRENT_LIST_DIR}/flags/cxx14.cmake") + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_ios_development_team.cmake") diff --git a/tools/polly/ios-12-0-dep-9-0-device-bitcode-cxx11.cmake b/tools/polly/ios-12-0-dep-9-0-device-bitcode-cxx11.cmake new file mode 100644 index 0000000..7614bcb --- /dev/null +++ b/tools/polly/ios-12-0-dep-9-0-device-bitcode-cxx11.cmake @@ -0,0 +1,44 @@ +# Copyright (c) 2017, Ruslan Baratov +# All rights reserved. + +if(DEFINED POLLY_IOS_12_0_DEP_9_0_DEVICE_BITCODE_CMAKE_) + return() +else() + set(POLLY_IOS_12_0_DEP_9_0_DEVICE_BITCODE_CMAKE_ 1) +endif() + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_clear_environment_variables.cmake") + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_init.cmake") + +set(IOS_SDK_VERSION 12.0) +set(IOS_DEPLOYMENT_SDK_VERSION 9.0) + +set(POLLY_XCODE_COMPILER "clang") +polly_init( + "iOS ${IOS_SDK_VERSION} / Deployment ${IOS_DEPLOYMENT_SDK_VERSION} / Universal (arm64 armv7s armv7) / \ +${POLLY_XCODE_COMPILER} / \ +bitcode / \ +c++11 support" + "Xcode" +) + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_common.cmake") + +include(polly_fatal_error) + +# Fix try_compile +include(polly_ios_bundle_identifier) + +set(CMAKE_MACOSX_BUNDLE YES) +set(CMAKE_XCODE_ATTRIBUTE_CODE_SIGN_IDENTITY "iPhone Developer") + +set(IPHONEOS_ARCHS armv7;armv7s;arm64) +set(IPHONESIMULATOR_ARCHS "") + +include("${CMAKE_CURRENT_LIST_DIR}/compiler/xcode.cmake") +include("${CMAKE_CURRENT_LIST_DIR}/os/iphone.cmake") +include("${CMAKE_CURRENT_LIST_DIR}/flags/cxx11.cmake") +include("${CMAKE_CURRENT_LIST_DIR}/flags/bitcode.cmake") # after os/iphone.cmake + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_ios_development_team.cmake") diff --git a/tools/polly/ios-12-1-dep-11-0-arm64.cmake b/tools/polly/ios-12-1-dep-11-0-arm64.cmake new file mode 100644 index 0000000..914e394 --- /dev/null +++ b/tools/polly/ios-12-1-dep-11-0-arm64.cmake @@ -0,0 +1,42 @@ +# Copyright (c) 2017-2018, Ruslan Baratov +# All rights reserved. + +if(DEFINED POLLY_IOS_12_1_DEP_11_0_ARM64_CMAKE_) + return() +else() + set(POLLY_IOS_12_1_DEP_11_0_ARM64_CMAKE_ 1) +endif() + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_clear_environment_variables.cmake") + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_init.cmake") + +set(IOS_SDK_VERSION 12.1) +set(IOS_DEPLOYMENT_SDK_VERSION 11.0) + +set(POLLY_XCODE_COMPILER "clang") +polly_init( + "iOS ${IOS_SDK_VERSION} / Deployment ${IOS_DEPLOYMENT_SDK_VERSION} / Universal (arm64) / \ +${POLLY_XCODE_COMPILER} / \ +c++14 support" + "Xcode" +) + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_common.cmake") + +include(polly_fatal_error) + +# Fix try_compile +include(polly_ios_bundle_identifier) + +set(CMAKE_MACOSX_BUNDLE YES) +set(CMAKE_XCODE_ATTRIBUTE_CODE_SIGN_IDENTITY "iPhone Developer") + +set(IPHONEOS_ARCHS arm64) +set(IPHONESIMULATOR_ARCHS "") + +include("${CMAKE_CURRENT_LIST_DIR}/compiler/xcode.cmake") +include("${CMAKE_CURRENT_LIST_DIR}/os/iphone.cmake") +include("${CMAKE_CURRENT_LIST_DIR}/flags/cxx14.cmake") + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_ios_development_team.cmake") diff --git a/tools/polly/ios-12-1-dep-9-3-arm64.cmake b/tools/polly/ios-12-1-dep-9-3-arm64.cmake new file mode 100644 index 0000000..e3e664f --- /dev/null +++ b/tools/polly/ios-12-1-dep-9-3-arm64.cmake @@ -0,0 +1,42 @@ +# Copyright (c) 2017-2018, Ruslan Baratov +# All rights reserved. + +if(DEFINED POLLY_IOS_12_1_DEP_9_3_ARM64_CMAKE_) + return() +else() + set(POLLY_IOS_12_1_DEP_9_3_ARM64_CMAKE_ 1) +endif() + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_clear_environment_variables.cmake") + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_init.cmake") + +set(IOS_SDK_VERSION 12.1) +set(IOS_DEPLOYMENT_SDK_VERSION 9.3) + +set(POLLY_XCODE_COMPILER "clang") +polly_init( + "iOS ${IOS_SDK_VERSION} / Deployment ${IOS_DEPLOYMENT_SDK_VERSION} / arm64 / \ +${POLLY_XCODE_COMPILER} / \ +c++14 support" + "Xcode" +) + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_common.cmake") + +include(polly_fatal_error) + +# Fix try_compile +include(polly_ios_bundle_identifier) + +set(CMAKE_MACOSX_BUNDLE YES) +set(CMAKE_XCODE_ATTRIBUTE_CODE_SIGN_IDENTITY "iPhone Developer") + +set(IPHONEOS_ARCHS arm64) +set(IPHONESIMULATOR_ARCHS "") + +include("${CMAKE_CURRENT_LIST_DIR}/compiler/xcode.cmake") +include("${CMAKE_CURRENT_LIST_DIR}/os/iphone.cmake") +include("${CMAKE_CURRENT_LIST_DIR}/flags/cxx14.cmake") + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_ios_development_team.cmake") diff --git a/tools/polly/ios-7-0.cmake b/tools/polly/ios-7-0.cmake new file mode 100644 index 0000000..4769961 --- /dev/null +++ b/tools/polly/ios-7-0.cmake @@ -0,0 +1,37 @@ +# Copyright (c) 2014, Ruslan Baratov +# All rights reserved. + +if(DEFINED POLLY_IOS_7_0_CMAKE_) + return() +else() + set(POLLY_IOS_7_0_CMAKE_ 1) +endif() + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_clear_environment_variables.cmake") + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_init.cmake") + +set(IOS_SDK_VERSION 7.0) +set(POLLY_XCODE_COMPILER "clang") +polly_init( + "iOS ${IOS_SDK_VERSION} Universal (iphoneos + iphonesimulator) / \ +${POLLY_XCODE_COMPILER} / \ +c++11 support" + "Xcode" +) + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_common.cmake") + +include(polly_fatal_error) + +# Fix try_compile +include(polly_ios_bundle_identifier) +set(CMAKE_MACOSX_BUNDLE YES) +set(CMAKE_XCODE_ATTRIBUTE_CODE_SIGN_IDENTITY "iPhone Developer") + +set(IPHONEOS_ARCHS armv7;armv7s;arm64) +set(IPHONESIMULATOR_ARCHS i386;x86_64) + +include("${CMAKE_CURRENT_LIST_DIR}/compiler/xcode.cmake") +include("${CMAKE_CURRENT_LIST_DIR}/os/iphone.cmake") +include("${CMAKE_CURRENT_LIST_DIR}/flags/cxx11.cmake") diff --git a/tools/polly/ios-7-1.cmake b/tools/polly/ios-7-1.cmake new file mode 100644 index 0000000..1c7e70f --- /dev/null +++ b/tools/polly/ios-7-1.cmake @@ -0,0 +1,37 @@ +# Copyright (c) 2014, Ruslan Baratov +# All rights reserved. + +if(DEFINED POLLY_IOS_7_1_CMAKE_) + return() +else() + set(POLLY_IOS_7_1_CMAKE_ 1) +endif() + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_clear_environment_variables.cmake") + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_init.cmake") + +set(IOS_SDK_VERSION 7.1) +set(POLLY_XCODE_COMPILER "clang") +polly_init( + "iOS ${IOS_SDK_VERSION} Universal (iphoneos + iphonesimulator) / \ +${POLLY_XCODE_COMPILER} / \ +c++11 support" + "Xcode" +) + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_common.cmake") + +include(polly_fatal_error) + +# Fix try_compile +include(polly_ios_bundle_identifier) +set(CMAKE_MACOSX_BUNDLE YES) +set(CMAKE_XCODE_ATTRIBUTE_CODE_SIGN_IDENTITY "iPhone Developer") + +set(IPHONEOS_ARCHS armv7;armv7s;arm64) +set(IPHONESIMULATOR_ARCHS i386;x86_64) + +include("${CMAKE_CURRENT_LIST_DIR}/compiler/xcode.cmake") +include("${CMAKE_CURRENT_LIST_DIR}/os/iphone.cmake") +include("${CMAKE_CURRENT_LIST_DIR}/flags/cxx11.cmake") diff --git a/tools/polly/ios-8-0.cmake b/tools/polly/ios-8-0.cmake new file mode 100644 index 0000000..809c390 --- /dev/null +++ b/tools/polly/ios-8-0.cmake @@ -0,0 +1,37 @@ +# Copyright (c) 2014, Ruslan Baratov +# All rights reserved. + +if(DEFINED POLLY_IOS_8_0_CMAKE_) + return() +else() + set(POLLY_IOS_8_0_CMAKE_ 1) +endif() + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_clear_environment_variables.cmake") + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_init.cmake") + +set(IOS_SDK_VERSION 8.0) +set(POLLY_XCODE_COMPILER "clang") +polly_init( + "iOS ${IOS_SDK_VERSION} Universal (iphoneos + iphonesimulator) / \ +${POLLY_XCODE_COMPILER} / \ +c++11 support" + "Xcode" +) + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_common.cmake") + +include(polly_fatal_error) + +# Fix try_compile +include(polly_ios_bundle_identifier) +set(CMAKE_MACOSX_BUNDLE YES) +set(CMAKE_XCODE_ATTRIBUTE_CODE_SIGN_IDENTITY "iPhone Developer") + +set(IPHONEOS_ARCHS armv7;armv7s;arm64) +set(IPHONESIMULATOR_ARCHS i386;x86_64) + +include("${CMAKE_CURRENT_LIST_DIR}/compiler/xcode.cmake") +include("${CMAKE_CURRENT_LIST_DIR}/os/iphone.cmake") +include("${CMAKE_CURRENT_LIST_DIR}/flags/cxx11.cmake") diff --git a/tools/polly/ios-8-1.cmake b/tools/polly/ios-8-1.cmake new file mode 100644 index 0000000..0bc7f67 --- /dev/null +++ b/tools/polly/ios-8-1.cmake @@ -0,0 +1,37 @@ +# Copyright (c) 2014, Ruslan Baratov +# All rights reserved. + +if(DEFINED POLLY_IOS_8_1_CMAKE_) + return() +else() + set(POLLY_IOS_8_1_CMAKE_ 1) +endif() + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_clear_environment_variables.cmake") + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_init.cmake") + +set(IOS_SDK_VERSION 8.1) +set(POLLY_XCODE_COMPILER "clang") +polly_init( + "iOS ${IOS_SDK_VERSION} Universal (iphoneos + iphonesimulator) / \ +${POLLY_XCODE_COMPILER} / \ +c++11 support" + "Xcode" +) + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_common.cmake") + +include(polly_fatal_error) + +# Fix try_compile +include(polly_ios_bundle_identifier) +set(CMAKE_MACOSX_BUNDLE YES) +set(CMAKE_XCODE_ATTRIBUTE_CODE_SIGN_IDENTITY "iPhone Developer") + +set(IPHONEOS_ARCHS armv7;armv7s;arm64) +set(IPHONESIMULATOR_ARCHS i386;x86_64) + +include("${CMAKE_CURRENT_LIST_DIR}/compiler/xcode.cmake") +include("${CMAKE_CURRENT_LIST_DIR}/os/iphone.cmake") +include("${CMAKE_CURRENT_LIST_DIR}/flags/cxx11.cmake") diff --git a/tools/polly/ios-8-2-arm64-hid.cmake b/tools/polly/ios-8-2-arm64-hid.cmake new file mode 100644 index 0000000..e19f943 --- /dev/null +++ b/tools/polly/ios-8-2-arm64-hid.cmake @@ -0,0 +1,39 @@ +# Copyright (c) 2015, Ruslan Baratov +# All rights reserved. + +if(DEFINED POLLY_IOS_8_2_ARM64_HID_) + return() +else() + set(POLLY_IOS_8_2_ARM64_HID_ 1) +endif() + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_clear_environment_variables.cmake") + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_init.cmake") + +set(IOS_SDK_VERSION 8.2) +set(POLLY_XCODE_COMPILER "clang") +polly_init( + "iOS ${IOS_SDK_VERSION} / \ +${POLLY_XCODE_COMPILER} / \ +arm64 / hidden visibility / \ +c++11 support" + "Xcode" +) + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_common.cmake") + +include(polly_fatal_error) + +# Fix try_compile +include(polly_ios_bundle_identifier) +set(CMAKE_MACOSX_BUNDLE YES) +set(CMAKE_XCODE_ATTRIBUTE_CODE_SIGN_IDENTITY "iPhone Developer") + +set(IPHONEOS_ARCHS arm64) +set(IPHONESIMULATOR_ARCHS "") + +include("${CMAKE_CURRENT_LIST_DIR}/compiler/xcode.cmake") +include("${CMAKE_CURRENT_LIST_DIR}/os/iphone.cmake") +include("${CMAKE_CURRENT_LIST_DIR}/flags/cxx11.cmake") +include("${CMAKE_CURRENT_LIST_DIR}/flags/hidden.cmake") diff --git a/tools/polly/ios-8-2-arm64.cmake b/tools/polly/ios-8-2-arm64.cmake new file mode 100644 index 0000000..ddd5d39 --- /dev/null +++ b/tools/polly/ios-8-2-arm64.cmake @@ -0,0 +1,38 @@ +# Copyright (c) 2015, Ruslan Baratov +# All rights reserved. + +if(DEFINED POLLY_IOS_8_2_ARM64_) + return() +else() + set(POLLY_IOS_8_2_ARM64_ 1) +endif() + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_clear_environment_variables.cmake") + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_init.cmake") + +set(IOS_SDK_VERSION 8.2) +set(POLLY_XCODE_COMPILER "clang") +polly_init( + "iOS ${IOS_SDK_VERSION} / \ +${POLLY_XCODE_COMPILER} / \ +arm64 / \ +c++11 support" + "Xcode" +) + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_common.cmake") + +include(polly_fatal_error) + +# Fix try_compile +include(polly_ios_bundle_identifier) +set(CMAKE_MACOSX_BUNDLE YES) +set(CMAKE_XCODE_ATTRIBUTE_CODE_SIGN_IDENTITY "iPhone Developer") + +set(IPHONEOS_ARCHS arm64) +set(IPHONESIMULATOR_ARCHS "") + +include("${CMAKE_CURRENT_LIST_DIR}/compiler/xcode.cmake") +include("${CMAKE_CURRENT_LIST_DIR}/os/iphone.cmake") +include("${CMAKE_CURRENT_LIST_DIR}/flags/cxx11.cmake") diff --git a/tools/polly/ios-8-2-cxx98.cmake b/tools/polly/ios-8-2-cxx98.cmake new file mode 100644 index 0000000..daaf6ff --- /dev/null +++ b/tools/polly/ios-8-2-cxx98.cmake @@ -0,0 +1,37 @@ +# Copyright (c) 2015, Ruslan Baratov +# All rights reserved. + +if(DEFINED POLLY_IOS_8_2_CMAKE_) + return() +else() + set(POLLY_IOS_8_2_CMAKE_ 1) +endif() + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_clear_environment_variables.cmake") + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_init.cmake") + +set(IOS_SDK_VERSION 8.2) +set(POLLY_XCODE_COMPILER "clang") +polly_init( + "iOS ${IOS_SDK_VERSION} Universal (iphoneos + iphonesimulator) / \ +${POLLY_XCODE_COMPILER} / \ +c++98" + "Xcode" +) + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_common.cmake") + +include(polly_fatal_error) + +# Fix try_compile +include(polly_ios_bundle_identifier) +set(CMAKE_MACOSX_BUNDLE YES) +set(CMAKE_XCODE_ATTRIBUTE_CODE_SIGN_IDENTITY "iPhone Developer") + +set(IPHONEOS_ARCHS armv7;armv7s;arm64) +set(IPHONESIMULATOR_ARCHS i386;x86_64) + +include("${CMAKE_CURRENT_LIST_DIR}/compiler/xcode.cmake") +include("${CMAKE_CURRENT_LIST_DIR}/os/iphone.cmake") +include("${CMAKE_CURRENT_LIST_DIR}/flags/cxx98.cmake") diff --git a/tools/polly/ios-8-2-i386-arm64.cmake b/tools/polly/ios-8-2-i386-arm64.cmake new file mode 100644 index 0000000..5a1e527 --- /dev/null +++ b/tools/polly/ios-8-2-i386-arm64.cmake @@ -0,0 +1,38 @@ +# Copyright (c) 2013-2015, Ruslan Baratov +# All rights reserved. + +if(DEFINED POLLY_IOS_8_2_I386_ARM64_CMAKE_) + return() +else() + set(POLLY_IOS_8_2_I386_ARM64_CMAKE_ 1) +endif() + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_clear_environment_variables.cmake") + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_init.cmake") + +set(IOS_SDK_VERSION 8.2) +set(POLLY_XCODE_COMPILER "clang") +polly_init( + "iOS ${IOS_SDK_VERSION} Universal (iphoneos + iphonesimulator) / \ +${POLLY_XCODE_COMPILER} / \ +i386 / arm64 / \ +c++11 support" + "Xcode" +) + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_common.cmake") + +include(polly_fatal_error) + +# Fix try_compile +include(polly_ios_bundle_identifier) +set(CMAKE_MACOSX_BUNDLE YES) +set(CMAKE_XCODE_ATTRIBUTE_CODE_SIGN_IDENTITY "iPhone Developer") + +set(IPHONEOS_ARCHS arm64) +set(IPHONESIMULATOR_ARCHS i386) + +include("${CMAKE_CURRENT_LIST_DIR}/compiler/xcode.cmake") +include("${CMAKE_CURRENT_LIST_DIR}/os/iphone.cmake") +include("${CMAKE_CURRENT_LIST_DIR}/flags/cxx11.cmake") diff --git a/tools/polly/ios-8-2.cmake b/tools/polly/ios-8-2.cmake new file mode 100644 index 0000000..97372ab --- /dev/null +++ b/tools/polly/ios-8-2.cmake @@ -0,0 +1,37 @@ +# Copyright (c) 2015, Ruslan Baratov +# All rights reserved. + +if(DEFINED POLLY_IOS_8_2_CMAKE_) + return() +else() + set(POLLY_IOS_8_2_CMAKE_ 1) +endif() + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_clear_environment_variables.cmake") + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_init.cmake") + +set(IOS_SDK_VERSION 8.2) +set(POLLY_XCODE_COMPILER "clang") +polly_init( + "iOS ${IOS_SDK_VERSION} Universal (iphoneos + iphonesimulator) / \ +${POLLY_XCODE_COMPILER} / \ +c++11 support" + "Xcode" +) + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_common.cmake") + +include(polly_fatal_error) + +# Fix try_compile +include(polly_ios_bundle_identifier) +set(CMAKE_MACOSX_BUNDLE YES) +set(CMAKE_XCODE_ATTRIBUTE_CODE_SIGN_IDENTITY "iPhone Developer") + +set(IPHONEOS_ARCHS armv7;armv7s;arm64) +set(IPHONESIMULATOR_ARCHS i386;x86_64) + +include("${CMAKE_CURRENT_LIST_DIR}/compiler/xcode.cmake") +include("${CMAKE_CURRENT_LIST_DIR}/os/iphone.cmake") +include("${CMAKE_CURRENT_LIST_DIR}/flags/cxx11.cmake") diff --git a/tools/polly/ios-8-4-arm64.cmake b/tools/polly/ios-8-4-arm64.cmake new file mode 100644 index 0000000..8103907 --- /dev/null +++ b/tools/polly/ios-8-4-arm64.cmake @@ -0,0 +1,38 @@ +# Copyright (c) 2015, Ruslan Baratov +# All rights reserved. + +if(DEFINED POLLY_IOS_8_4_ARM64_) + return() +else() + set(POLLY_IOS_8_4_ARM64_ 1) +endif() + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_clear_environment_variables.cmake") + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_init.cmake") + +set(IOS_SDK_VERSION 8.4) +set(POLLY_XCODE_COMPILER "clang") +polly_init( + "iOS ${IOS_SDK_VERSION} / \ +${POLLY_XCODE_COMPILER} / \ +arm64 / \ +c++11 support" + "Xcode" +) + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_common.cmake") + +include(polly_fatal_error) + +# Fix try_compile +include(polly_ios_bundle_identifier) +set(CMAKE_MACOSX_BUNDLE YES) +set(CMAKE_XCODE_ATTRIBUTE_CODE_SIGN_IDENTITY "iPhone Developer") + +set(IPHONEOS_ARCHS arm64) +set(IPHONESIMULATOR_ARCHS "") + +include("${CMAKE_CURRENT_LIST_DIR}/compiler/xcode.cmake") +include("${CMAKE_CURRENT_LIST_DIR}/os/iphone.cmake") +include("${CMAKE_CURRENT_LIST_DIR}/flags/cxx11.cmake") diff --git a/tools/polly/ios-8-4-armv7.cmake b/tools/polly/ios-8-4-armv7.cmake new file mode 100644 index 0000000..06cfd8f --- /dev/null +++ b/tools/polly/ios-8-4-armv7.cmake @@ -0,0 +1,38 @@ +# Copyright (c) 2015, Ruslan Baratov +# All rights reserved. + +if(DEFINED POLLY_IOS_8_4_ARMV7_) + return() +else() + set(POLLY_IOS_8_4_ARMV7_ 1) +endif() + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_clear_environment_variables.cmake") + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_init.cmake") + +set(IOS_SDK_VERSION 8.4) +set(POLLY_XCODE_COMPILER "clang") +polly_init( + "iOS ${IOS_SDK_VERSION} / \ +${POLLY_XCODE_COMPILER} / \ +armv7 / \ +c++11 support" + "Xcode" +) + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_common.cmake") + +include(polly_fatal_error) + +# Fix try_compile +include(polly_ios_bundle_identifier) +set(CMAKE_MACOSX_BUNDLE YES) +set(CMAKE_XCODE_ATTRIBUTE_CODE_SIGN_IDENTITY "iPhone Developer") + +set(IPHONEOS_ARCHS armv7) +set(IPHONESIMULATOR_ARCHS "") + +include("${CMAKE_CURRENT_LIST_DIR}/compiler/xcode.cmake") +include("${CMAKE_CURRENT_LIST_DIR}/os/iphone.cmake") +include("${CMAKE_CURRENT_LIST_DIR}/flags/cxx11.cmake") diff --git a/tools/polly/ios-8-4-armv7s.cmake b/tools/polly/ios-8-4-armv7s.cmake new file mode 100644 index 0000000..670cb19 --- /dev/null +++ b/tools/polly/ios-8-4-armv7s.cmake @@ -0,0 +1,38 @@ +# Copyright (c) 2015, Ruslan Baratov +# All rights reserved. + +if(DEFINED POLLY_IOS_8_4_ARMV7S_) + return() +else() + set(POLLY_IOS_8_4_ARMV7S_ 1) +endif() + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_clear_environment_variables.cmake") + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_init.cmake") + +set(IOS_SDK_VERSION 8.4) +set(POLLY_XCODE_COMPILER "clang") +polly_init( + "iOS ${IOS_SDK_VERSION} / \ +${POLLY_XCODE_COMPILER} / \ +armv7s / \ +c++11 support" + "Xcode" +) + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_common.cmake") + +include(polly_fatal_error) + +# Fix try_compile +include(polly_ios_bundle_identifier) +set(CMAKE_MACOSX_BUNDLE YES) +set(CMAKE_XCODE_ATTRIBUTE_CODE_SIGN_IDENTITY "iPhone Developer") + +set(IPHONEOS_ARCHS armv7s) +set(IPHONESIMULATOR_ARCHS "") + +include("${CMAKE_CURRENT_LIST_DIR}/compiler/xcode.cmake") +include("${CMAKE_CURRENT_LIST_DIR}/os/iphone.cmake") +include("${CMAKE_CURRENT_LIST_DIR}/flags/cxx11.cmake") diff --git a/tools/polly/ios-8-4-hid.cmake b/tools/polly/ios-8-4-hid.cmake new file mode 100644 index 0000000..d89e053 --- /dev/null +++ b/tools/polly/ios-8-4-hid.cmake @@ -0,0 +1,40 @@ +# Copyright (c) 2015, Ruslan Baratov +# Copyright (c) 2015, David Hirvonen +# All rights reserved. + +if(DEFINED POLLY_IOS_8_4_HID_) + return() +else() + set(POLLY_IOS_8_4_HID_ 1) +endif() + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_clear_environment_variables.cmake") + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_init.cmake") + +set(IOS_SDK_VERSION 8.4) +set(POLLY_XCODE_COMPILER "clang") +polly_init( + "iOS ${IOS_SDK_VERSION} Universal (iphoneos + iphonesimulator) / \ +${POLLY_XCODE_COMPILER} / \ +hidden visibility / \ +c++11 support" + "Xcode" +) + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_common.cmake") + +include(polly_fatal_error) + +# Fix try_compile +include(polly_ios_bundle_identifier) +set(CMAKE_MACOSX_BUNDLE YES) +set(CMAKE_XCODE_ATTRIBUTE_CODE_SIGN_IDENTITY "iPhone Developer") + +set(IPHONEOS_ARCHS armv7;armv7s;arm64) +set(IPHONESIMULATOR_ARCHS i386;x86_64) + +include("${CMAKE_CURRENT_LIST_DIR}/compiler/xcode.cmake") +include("${CMAKE_CURRENT_LIST_DIR}/os/iphone.cmake") +include("${CMAKE_CURRENT_LIST_DIR}/flags/cxx11.cmake") +include("${CMAKE_CURRENT_LIST_DIR}/flags/hidden.cmake") diff --git a/tools/polly/ios-8-4.cmake b/tools/polly/ios-8-4.cmake new file mode 100644 index 0000000..a4349c7 --- /dev/null +++ b/tools/polly/ios-8-4.cmake @@ -0,0 +1,37 @@ +# Copyright (c) 2015, Ruslan Baratov +# All rights reserved. + +if(DEFINED POLLY_IOS_8_4_CMAKE_) + return() +else() + set(POLLY_IOS_8_4_CMAKE_ 1) +endif() + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_clear_environment_variables.cmake") + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_init.cmake") + +set(IOS_SDK_VERSION 8.4) +set(POLLY_XCODE_COMPILER "clang") +polly_init( + "iOS ${IOS_SDK_VERSION} Universal (iphoneos + iphonesimulator) / \ +${POLLY_XCODE_COMPILER} / \ +c++11 support" + "Xcode" +) + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_common.cmake") + +include(polly_fatal_error) + +# Fix try_compile +include(polly_ios_bundle_identifier) +set(CMAKE_MACOSX_BUNDLE YES) +set(CMAKE_XCODE_ATTRIBUTE_CODE_SIGN_IDENTITY "iPhone Developer") + +set(IPHONEOS_ARCHS armv7;armv7s;arm64) +set(IPHONESIMULATOR_ARCHS i386;x86_64) + +include("${CMAKE_CURRENT_LIST_DIR}/compiler/xcode.cmake") +include("${CMAKE_CURRENT_LIST_DIR}/os/iphone.cmake") +include("${CMAKE_CURRENT_LIST_DIR}/flags/cxx11.cmake") diff --git a/tools/polly/ios-9-0-armv7.cmake b/tools/polly/ios-9-0-armv7.cmake new file mode 100644 index 0000000..aadb5b6 --- /dev/null +++ b/tools/polly/ios-9-0-armv7.cmake @@ -0,0 +1,38 @@ +# Copyright (c) 2015, Ruslan Baratov +# All rights reserved. + +if(DEFINED POLLY_IOS_9_0_ARMV7_CMAKE_) + return() +else() + set(POLLY_IOS_9_0_ARMV7_CMAKE_ 1) +endif() + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_clear_environment_variables.cmake") + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_init.cmake") + +set(IOS_SDK_VERSION 9.0) +set(POLLY_XCODE_COMPILER "clang") +polly_init( + "iOS ${IOS_SDK_VERSION} / \ +${POLLY_XCODE_COMPILER} / \ +armv7 / \ +c++11 support" + "Xcode" +) + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_common.cmake") + +include(polly_fatal_error) + +# Fix try_compile +include(polly_ios_bundle_identifier) +set(CMAKE_MACOSX_BUNDLE YES) +set(CMAKE_XCODE_ATTRIBUTE_CODE_SIGN_IDENTITY "iPhone Developer") + +set(IPHONEOS_ARCHS armv7) +set(IPHONESIMULATOR_ARCHS "") + +include("${CMAKE_CURRENT_LIST_DIR}/compiler/xcode.cmake") +include("${CMAKE_CURRENT_LIST_DIR}/os/iphone.cmake") +include("${CMAKE_CURRENT_LIST_DIR}/flags/cxx11.cmake") diff --git a/tools/polly/ios-9-0-dep-7-0-armv7.cmake b/tools/polly/ios-9-0-dep-7-0-armv7.cmake new file mode 100644 index 0000000..989c270 --- /dev/null +++ b/tools/polly/ios-9-0-dep-7-0-armv7.cmake @@ -0,0 +1,40 @@ +# Copyright (c) 2015, Ruslan Baratov +# All rights reserved. + +if(DEFINED POLLY_IOS_9_0_DEP_7_0_ARMV7_CMAKE_) + return() +else() + set(POLLY_IOS_9_0_DEP_7_0_ARMV7_CMAKE_ 1) +endif() + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_clear_environment_variables.cmake") + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_init.cmake") + +set(IOS_SDK_VERSION 9.0) +set(IOS_DEPLOYMENT_SDK_VERSION 7.0) + +set(POLLY_XCODE_COMPILER "clang") +polly_init( + "iOS ${IOS_SDK_VERSION} / Deployment ${IOS_DEPLOYMENT_SDK_VERSION} / \ +${POLLY_XCODE_COMPILER} / \ +armv7 / \ +c++11 support" + "Xcode" +) + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_common.cmake") + +include(polly_fatal_error) + +# Fix try_compile +include(polly_ios_bundle_identifier) +set(CMAKE_MACOSX_BUNDLE YES) +set(CMAKE_XCODE_ATTRIBUTE_CODE_SIGN_IDENTITY "iPhone Developer") + +set(IPHONEOS_ARCHS armv7) +set(IPHONESIMULATOR_ARCHS "") + +include("${CMAKE_CURRENT_LIST_DIR}/compiler/xcode.cmake") +include("${CMAKE_CURRENT_LIST_DIR}/os/iphone.cmake") +include("${CMAKE_CURRENT_LIST_DIR}/flags/cxx11.cmake") diff --git a/tools/polly/ios-9-0-i386-armv7.cmake b/tools/polly/ios-9-0-i386-armv7.cmake new file mode 100644 index 0000000..2bcbd30 --- /dev/null +++ b/tools/polly/ios-9-0-i386-armv7.cmake @@ -0,0 +1,38 @@ +# Copyright (c) 2015, Ruslan Baratov +# All rights reserved. + +if(DEFINED POLLY_IOS_9_0_CMAKE_) + return() +else() + set(POLLY_IOS_9_0_CMAKE_ 1) +endif() + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_clear_environment_variables.cmake") + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_init.cmake") + +set(IOS_SDK_VERSION 9.0) +set(POLLY_XCODE_COMPILER "clang") +polly_init( + "iOS ${IOS_SDK_VERSION} Universal (iphoneos + iphonesimulator) / \ +${POLLY_XCODE_COMPILER} / \ +i386 / armv7 / \ +c++11 support" + "Xcode" +) + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_common.cmake") + +include(polly_fatal_error) + +# Fix try_compile +include(polly_ios_bundle_identifier) +set(CMAKE_MACOSX_BUNDLE YES) +set(CMAKE_XCODE_ATTRIBUTE_CODE_SIGN_IDENTITY "iPhone Developer") + +set(IPHONEOS_ARCHS armv7) +set(IPHONESIMULATOR_ARCHS i386) + +include("${CMAKE_CURRENT_LIST_DIR}/compiler/xcode.cmake") +include("${CMAKE_CURRENT_LIST_DIR}/os/iphone.cmake") +include("${CMAKE_CURRENT_LIST_DIR}/flags/cxx11.cmake") diff --git a/tools/polly/ios-9-0-wo-armv7s.cmake b/tools/polly/ios-9-0-wo-armv7s.cmake new file mode 100644 index 0000000..07fd05d --- /dev/null +++ b/tools/polly/ios-9-0-wo-armv7s.cmake @@ -0,0 +1,38 @@ +# Copyright (c) 2015, Ruslan Baratov +# All rights reserved. + +if(DEFINED POLLY_IOS_9_0_WO_ARMV7S_CMAKE_) + return() +else() + set(POLLY_IOS_9_0_WO_ARMV7S_CMAKE_ 1) +endif() + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_clear_environment_variables.cmake") + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_init.cmake") + +set(IOS_SDK_VERSION 9.0) +set(POLLY_XCODE_COMPILER "clang") +polly_init( + "iOS ${IOS_SDK_VERSION} Universal (iphoneos + iphonesimulator) / \ +${POLLY_XCODE_COMPILER} / \ +armv7 arm64 / i386 x86_64 / \ +c++11 support" + "Xcode" +) + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_common.cmake") + +include(polly_fatal_error) + +# Fix try_compile +include(polly_ios_bundle_identifier) +set(CMAKE_MACOSX_BUNDLE YES) +set(CMAKE_XCODE_ATTRIBUTE_CODE_SIGN_IDENTITY "iPhone Developer") + +set(IPHONEOS_ARCHS armv7;arm64) +set(IPHONESIMULATOR_ARCHS i386;x86_64) + +include("${CMAKE_CURRENT_LIST_DIR}/compiler/xcode.cmake") +include("${CMAKE_CURRENT_LIST_DIR}/os/iphone.cmake") +include("${CMAKE_CURRENT_LIST_DIR}/flags/cxx11.cmake") diff --git a/tools/polly/ios-9-0.cmake b/tools/polly/ios-9-0.cmake new file mode 100644 index 0000000..b6d3edf --- /dev/null +++ b/tools/polly/ios-9-0.cmake @@ -0,0 +1,37 @@ +# Copyright (c) 2015, Ruslan Baratov +# All rights reserved. + +if(DEFINED POLLY_IOS_9_0_CMAKE_) + return() +else() + set(POLLY_IOS_9_0_CMAKE_ 1) +endif() + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_clear_environment_variables.cmake") + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_init.cmake") + +set(IOS_SDK_VERSION 9.0) +set(POLLY_XCODE_COMPILER "clang") +polly_init( + "iOS ${IOS_SDK_VERSION} Universal (iphoneos + iphonesimulator) / \ +${POLLY_XCODE_COMPILER} / \ +c++11 support" + "Xcode" +) + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_common.cmake") + +include(polly_fatal_error) + +# Fix try_compile +include(polly_ios_bundle_identifier) +set(CMAKE_MACOSX_BUNDLE YES) +set(CMAKE_XCODE_ATTRIBUTE_CODE_SIGN_IDENTITY "iPhone Developer") + +set(IPHONEOS_ARCHS armv7;armv7s;arm64) +set(IPHONESIMULATOR_ARCHS i386;x86_64) + +include("${CMAKE_CURRENT_LIST_DIR}/compiler/xcode.cmake") +include("${CMAKE_CURRENT_LIST_DIR}/os/iphone.cmake") +include("${CMAKE_CURRENT_LIST_DIR}/flags/cxx11.cmake") diff --git a/tools/polly/ios-9-1-arm64.cmake b/tools/polly/ios-9-1-arm64.cmake new file mode 100644 index 0000000..a105db4 --- /dev/null +++ b/tools/polly/ios-9-1-arm64.cmake @@ -0,0 +1,38 @@ +# Copyright (c) 2015, Ruslan Baratov +# All rights reserved. + +if(DEFINED POLLY_IOS_9_1_ARM64_CMAKE_) + return() +else() + set(POLLY_IOS_9_1_ARM64_CMAKE_ 1) +endif() + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_clear_environment_variables.cmake") + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_init.cmake") + +set(IOS_SDK_VERSION 9.1) +set(POLLY_XCODE_COMPILER "clang") +polly_init( + "iOS ${IOS_SDK_VERSION} / \ +${POLLY_XCODE_COMPILER} / \ +arm64 / \ +c++11 support" + "Xcode" +) + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_common.cmake") + +include(polly_fatal_error) + +# Fix try_compile +include(polly_ios_bundle_identifier) +set(CMAKE_MACOSX_BUNDLE YES) +set(CMAKE_XCODE_ATTRIBUTE_CODE_SIGN_IDENTITY "iPhone Developer") + +set(IPHONEOS_ARCHS arm64) +set(IPHONESIMULATOR_ARCHS "") + +include("${CMAKE_CURRENT_LIST_DIR}/compiler/xcode.cmake") +include("${CMAKE_CURRENT_LIST_DIR}/os/iphone.cmake") +include("${CMAKE_CURRENT_LIST_DIR}/flags/cxx11.cmake") diff --git a/tools/polly/ios-9-1-armv7.cmake b/tools/polly/ios-9-1-armv7.cmake new file mode 100644 index 0000000..9e88ac8 --- /dev/null +++ b/tools/polly/ios-9-1-armv7.cmake @@ -0,0 +1,38 @@ +# Copyright (c) 2015, Ruslan Baratov +# All rights reserved. + +if(DEFINED POLLY_IOS_9_1_ARMV7_CMAKE_) + return() +else() + set(POLLY_IOS_9_1_ARMV7_CMAKE_ 1) +endif() + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_clear_environment_variables.cmake") + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_init.cmake") + +set(IOS_SDK_VERSION 9.1) +set(POLLY_XCODE_COMPILER "clang") +polly_init( + "iOS ${IOS_SDK_VERSION} / \ +${POLLY_XCODE_COMPILER} / \ +armv7 / \ +c++11 support" + "Xcode" +) + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_common.cmake") + +include(polly_fatal_error) + +# Fix try_compile +include(polly_ios_bundle_identifier) +set(CMAKE_MACOSX_BUNDLE YES) +set(CMAKE_XCODE_ATTRIBUTE_CODE_SIGN_IDENTITY "iPhone Developer") + +set(IPHONEOS_ARCHS armv7) +set(IPHONESIMULATOR_ARCHS "") + +include("${CMAKE_CURRENT_LIST_DIR}/compiler/xcode.cmake") +include("${CMAKE_CURRENT_LIST_DIR}/os/iphone.cmake") +include("${CMAKE_CURRENT_LIST_DIR}/flags/cxx11.cmake") diff --git a/tools/polly/ios-9-1-dep-7-0-armv7.cmake b/tools/polly/ios-9-1-dep-7-0-armv7.cmake new file mode 100644 index 0000000..c5dd458 --- /dev/null +++ b/tools/polly/ios-9-1-dep-7-0-armv7.cmake @@ -0,0 +1,40 @@ +# Copyright (c) 2015, Ruslan Baratov +# All rights reserved. + +if(DEFINED POLLY_IOS_9_1_DEP_7_0_ARMV7_CMAKE_) + return() +else() + set(POLLY_IOS_9_1_DEP_7_0_ARMV7_CMAKE_ 1) +endif() + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_clear_environment_variables.cmake") + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_init.cmake") + +set(IOS_SDK_VERSION 9.1) +set(IOS_DEPLOYMENT_SDK_VERSION 7.0) + +set(POLLY_XCODE_COMPILER "clang") +polly_init( + "iOS ${IOS_SDK_VERSION} / Deployment ${IOS_DEPLOYMENT_SDK_VERSION} / \ +${POLLY_XCODE_COMPILER} / \ +armv7 / \ +c++11 support" + "Xcode" +) + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_common.cmake") + +include(polly_fatal_error) + +# Fix try_compile +include(polly_ios_bundle_identifier) +set(CMAKE_MACOSX_BUNDLE YES) +set(CMAKE_XCODE_ATTRIBUTE_CODE_SIGN_IDENTITY "iPhone Developer") + +set(IPHONEOS_ARCHS armv7) +set(IPHONESIMULATOR_ARCHS "") + +include("${CMAKE_CURRENT_LIST_DIR}/compiler/xcode.cmake") +include("${CMAKE_CURRENT_LIST_DIR}/os/iphone.cmake") +include("${CMAKE_CURRENT_LIST_DIR}/flags/cxx11.cmake") diff --git a/tools/polly/ios-9-1-dep-8-0-hid.cmake b/tools/polly/ios-9-1-dep-8-0-hid.cmake new file mode 100644 index 0000000..5627efc --- /dev/null +++ b/tools/polly/ios-9-1-dep-8-0-hid.cmake @@ -0,0 +1,42 @@ +# Copyright (c) 2015, Ruslan Baratov +# Copyright (c) 2015, David Hirvonen +# All rights reserved. + +if(DEFINED POLLY_IOS_9_1_DEP_8_0_HID_) + return() +else() + set(POLLY_IOS_9_1_DEP_8_0_HID_ 1) +endif() + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_clear_environment_variables.cmake") + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_init.cmake") + +set(IOS_SDK_VERSION 9.1) +set(IOS_DEPLOYMENT_SDK_VERSION 8.0) +set(POLLY_XCODE_COMPILER "clang") + +polly_init( + "iOS ${IOS_SDK_VERSION} Universal (iphoneos + iphonesimulator) / \ +Deployment ${IOS_DEPLOYMENT_SDK_VERSION} / \ +${POLLY_XCODE_COMPILER} / \ +c++11 support" + "Xcode" +) + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_common.cmake") + +include(polly_fatal_error) + +# Fix try_compile +include(polly_ios_bundle_identifier) +set(CMAKE_MACOSX_BUNDLE YES) +set(CMAKE_XCODE_ATTRIBUTE_CODE_SIGN_IDENTITY "iPhone Developer") + +set(IPHONEOS_ARCHS armv7;armv7s;arm64) +set(IPHONESIMULATOR_ARCHS i386;x86_64) + +include("${CMAKE_CURRENT_LIST_DIR}/compiler/xcode.cmake") +include("${CMAKE_CURRENT_LIST_DIR}/os/iphone.cmake") +include("${CMAKE_CURRENT_LIST_DIR}/flags/cxx11.cmake") +include("${CMAKE_CURRENT_LIST_DIR}/flags/hidden.cmake") diff --git a/tools/polly/ios-9-1-hid.cmake b/tools/polly/ios-9-1-hid.cmake new file mode 100644 index 0000000..b6307e9 --- /dev/null +++ b/tools/polly/ios-9-1-hid.cmake @@ -0,0 +1,40 @@ +# Copyright (c) 2015, Ruslan Baratov +# Copyright (c) 2015, David Hirvonen +# All rights reserved. + +if(DEFINED POLLY_IOS_9_1_HID_) + return() +else() + set(POLLY_IOS_9_1_HID_ 1) +endif() + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_clear_environment_variables.cmake") + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_init.cmake") + +set(IOS_SDK_VERSION 9.1) +set(POLLY_XCODE_COMPILER "clang") +polly_init( + "iOS ${IOS_SDK_VERSION} Universal (iphoneos + iphonesimulator) / \ +${POLLY_XCODE_COMPILER} / \ +hidden visibility / \ +c++11 support" + "Xcode" +) + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_common.cmake") + +include(polly_fatal_error) + +# Fix try_compile +include(polly_ios_bundle_identifier) +set(CMAKE_MACOSX_BUNDLE YES) +set(CMAKE_XCODE_ATTRIBUTE_CODE_SIGN_IDENTITY "iPhone Developer") + +set(IPHONEOS_ARCHS armv7;armv7s;arm64) +set(IPHONESIMULATOR_ARCHS i386;x86_64) + +include("${CMAKE_CURRENT_LIST_DIR}/compiler/xcode.cmake") +include("${CMAKE_CURRENT_LIST_DIR}/os/iphone.cmake") +include("${CMAKE_CURRENT_LIST_DIR}/flags/cxx11.cmake") +include("${CMAKE_CURRENT_LIST_DIR}/flags/hidden.cmake") diff --git a/tools/polly/ios-9-1.cmake b/tools/polly/ios-9-1.cmake new file mode 100644 index 0000000..34bb556 --- /dev/null +++ b/tools/polly/ios-9-1.cmake @@ -0,0 +1,37 @@ +# Copyright (c) 2015, Tomas Zemaitis +# All rights reserved. + +if(DEFINED POLLY_IOS_9_1_CMAKE_) + return() +else() + set(POLLY_IOS_9_1_CMAKE_ 1) +endif() + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_clear_environment_variables.cmake") + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_init.cmake") + +set(IOS_SDK_VERSION 9.1) +set(POLLY_XCODE_COMPILER "clang") +polly_init( + "iOS ${IOS_SDK_VERSION} Universal (iphoneos + iphonesimulator) / \ +${POLLY_XCODE_COMPILER} / \ +c++11 support" + "Xcode" +) + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_common.cmake") + +include(polly_fatal_error) + +# Fix try_compile +include(polly_ios_bundle_identifier) +set(CMAKE_MACOSX_BUNDLE YES) +set(CMAKE_XCODE_ATTRIBUTE_CODE_SIGN_IDENTITY "iPhone Developer") + +set(IPHONEOS_ARCHS armv7;armv7s;arm64) +set(IPHONESIMULATOR_ARCHS i386;x86_64) + +include("${CMAKE_CURRENT_LIST_DIR}/compiler/xcode.cmake") +include("${CMAKE_CURRENT_LIST_DIR}/os/iphone.cmake") +include("${CMAKE_CURRENT_LIST_DIR}/flags/cxx11.cmake") diff --git a/tools/polly/ios-9-2-arm64.cmake b/tools/polly/ios-9-2-arm64.cmake new file mode 100644 index 0000000..f87685b --- /dev/null +++ b/tools/polly/ios-9-2-arm64.cmake @@ -0,0 +1,38 @@ +# Copyright (c) 2015, Ruslan Baratov +# All rights reserved. + +if(DEFINED POLLY_IOS_9_2_ARM64_CMAKE_) + return() +else() + set(POLLY_IOS_9_2_ARM64_CMAKE_ 1) +endif() + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_clear_environment_variables.cmake") + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_init.cmake") + +set(IOS_SDK_VERSION 9.2) +set(POLLY_XCODE_COMPILER "clang") +polly_init( + "iOS ${IOS_SDK_VERSION} / \ +${POLLY_XCODE_COMPILER} / \ +arm64 / \ +c++11 support" + "Xcode" +) + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_common.cmake") + +include(polly_fatal_error) + +# Fix try_compile +include(polly_ios_bundle_identifier) +set(CMAKE_MACOSX_BUNDLE YES) +set(CMAKE_XCODE_ATTRIBUTE_CODE_SIGN_IDENTITY "iPhone Developer") + +set(IPHONEOS_ARCHS arm64) +set(IPHONESIMULATOR_ARCHS "") + +include("${CMAKE_CURRENT_LIST_DIR}/compiler/xcode.cmake") +include("${CMAKE_CURRENT_LIST_DIR}/os/iphone.cmake") +include("${CMAKE_CURRENT_LIST_DIR}/flags/cxx11.cmake") diff --git a/tools/polly/ios-9-2-armv7.cmake b/tools/polly/ios-9-2-armv7.cmake new file mode 100644 index 0000000..adbbeff --- /dev/null +++ b/tools/polly/ios-9-2-armv7.cmake @@ -0,0 +1,38 @@ +# Copyright (c) 2015, Ruslan Baratov +# All rights reserved. + +if(DEFINED POLLY_IOS_9_2_ARMV7_CMAKE_) + return() +else() + set(POLLY_IOS_9_2_ARMV7_CMAKE_ 1) +endif() + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_clear_environment_variables.cmake") + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_init.cmake") + +set(IOS_SDK_VERSION 9.2) +set(POLLY_XCODE_COMPILER "clang") +polly_init( + "iOS ${IOS_SDK_VERSION} / \ +${POLLY_XCODE_COMPILER} / \ +armv7 / \ +c++11 support" + "Xcode" +) + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_common.cmake") + +include(polly_fatal_error) + +# Fix try_compile +include(polly_ios_bundle_identifier) +set(CMAKE_MACOSX_BUNDLE YES) +set(CMAKE_XCODE_ATTRIBUTE_CODE_SIGN_IDENTITY "iPhone Developer") + +set(IPHONEOS_ARCHS armv7) +set(IPHONESIMULATOR_ARCHS "") + +include("${CMAKE_CURRENT_LIST_DIR}/compiler/xcode.cmake") +include("${CMAKE_CURRENT_LIST_DIR}/os/iphone.cmake") +include("${CMAKE_CURRENT_LIST_DIR}/flags/cxx11.cmake") diff --git a/tools/polly/ios-9-2-hid-sections.cmake b/tools/polly/ios-9-2-hid-sections.cmake new file mode 100644 index 0000000..d80948a --- /dev/null +++ b/tools/polly/ios-9-2-hid-sections.cmake @@ -0,0 +1,42 @@ +# Copyright (c) 2015-2016, Ruslan Baratov +# Copyright (c) 2015-2016, David Hirvonen +# All rights reserved. + +if(DEFINED POLLY_IOS_9_2_HID_SECTIONS_) + return() +else() + set(POLLY_IOS_9_2_HID_SECTIONS_ 1) +endif() + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_clear_environment_variables.cmake") + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_init.cmake") + +set(IOS_SDK_VERSION 9.2) +set(POLLY_XCODE_COMPILER "clang") +polly_init( + "iOS ${IOS_SDK_VERSION} Universal (iphoneos + iphonesimulator) / \ +${POLLY_XCODE_COMPILER} / \ +hidden visibility / function-sections / data-sections \ +c++11 support" + "Xcode" +) + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_common.cmake") + +include(polly_fatal_error) + +# Fix try_compile +include(polly_ios_bundle_identifier) +set(CMAKE_MACOSX_BUNDLE YES) +set(CMAKE_XCODE_ATTRIBUTE_CODE_SIGN_IDENTITY "iPhone Developer") + +set(IPHONEOS_ARCHS armv7;armv7s;arm64) +set(IPHONESIMULATOR_ARCHS i386;x86_64) + +include("${CMAKE_CURRENT_LIST_DIR}/compiler/xcode.cmake") +include("${CMAKE_CURRENT_LIST_DIR}/os/iphone.cmake") +include("${CMAKE_CURRENT_LIST_DIR}/flags/cxx11.cmake") +include("${CMAKE_CURRENT_LIST_DIR}/flags/hidden.cmake") +include("${CMAKE_CURRENT_LIST_DIR}/flags/function-sections.cmake") +include("${CMAKE_CURRENT_LIST_DIR}/flags/data-sections.cmake") diff --git a/tools/polly/ios-9-2-hid.cmake b/tools/polly/ios-9-2-hid.cmake new file mode 100644 index 0000000..19f8519 --- /dev/null +++ b/tools/polly/ios-9-2-hid.cmake @@ -0,0 +1,40 @@ +# Copyright (c) 2015, Ruslan Baratov +# Copyright (c) 2015, David Hirvonen +# All rights reserved. + +if(DEFINED POLLY_IOS_9_2_HID_) + return() +else() + set(POLLY_IOS_9_2_HID_ 1) +endif() + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_clear_environment_variables.cmake") + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_init.cmake") + +set(IOS_SDK_VERSION 9.2) +set(POLLY_XCODE_COMPILER "clang") +polly_init( + "iOS ${IOS_SDK_VERSION} Universal (iphoneos + iphonesimulator) / \ +${POLLY_XCODE_COMPILER} / \ +hidden visibility / \ +c++11 support" + "Xcode" +) + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_common.cmake") + +include(polly_fatal_error) + +# Fix try_compile +include(polly_ios_bundle_identifier) +set(CMAKE_MACOSX_BUNDLE YES) +set(CMAKE_XCODE_ATTRIBUTE_CODE_SIGN_IDENTITY "iPhone Developer") + +set(IPHONEOS_ARCHS armv7;armv7s;arm64) +set(IPHONESIMULATOR_ARCHS i386;x86_64) + +include("${CMAKE_CURRENT_LIST_DIR}/compiler/xcode.cmake") +include("${CMAKE_CURRENT_LIST_DIR}/os/iphone.cmake") +include("${CMAKE_CURRENT_LIST_DIR}/flags/cxx11.cmake") +include("${CMAKE_CURRENT_LIST_DIR}/flags/hidden.cmake") diff --git a/tools/polly/ios-9-2.cmake b/tools/polly/ios-9-2.cmake new file mode 100644 index 0000000..2df1d75 --- /dev/null +++ b/tools/polly/ios-9-2.cmake @@ -0,0 +1,37 @@ +# Copyright (c) 2015, Tomas Zemaitis +# All rights reserved. + +if(DEFINED POLLY_IOS_9_2_CMAKE_) + return() +else() + set(POLLY_IOS_9_2_CMAKE_ 1) +endif() + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_clear_environment_variables.cmake") + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_init.cmake") + +set(IOS_SDK_VERSION 9.2) +set(POLLY_XCODE_COMPILER "clang") +polly_init( + "iOS ${IOS_SDK_VERSION} Universal (iphoneos + iphonesimulator) / \ +${POLLY_XCODE_COMPILER} / \ +c++11 support" + "Xcode" +) + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_common.cmake") + +include(polly_fatal_error) + +# Fix try_compile +include(polly_ios_bundle_identifier) +set(CMAKE_MACOSX_BUNDLE YES) +set(CMAKE_XCODE_ATTRIBUTE_CODE_SIGN_IDENTITY "iPhone Developer") + +set(IPHONEOS_ARCHS armv7;armv7s;arm64) +set(IPHONESIMULATOR_ARCHS i386;x86_64) + +include("${CMAKE_CURRENT_LIST_DIR}/compiler/xcode.cmake") +include("${CMAKE_CURRENT_LIST_DIR}/os/iphone.cmake") +include("${CMAKE_CURRENT_LIST_DIR}/flags/cxx11.cmake") diff --git a/tools/polly/ios-9-3-arm64.cmake b/tools/polly/ios-9-3-arm64.cmake new file mode 100644 index 0000000..e5ca002 --- /dev/null +++ b/tools/polly/ios-9-3-arm64.cmake @@ -0,0 +1,38 @@ +# Copyright (c) 2015, Ruslan Baratov +# All rights reserved. + +if(DEFINED POLLY_IOS_9_3_ARM64_CMAKE_) + return() +else() + set(POLLY_IOS_9_3_ARM64_CMAKE_ 1) +endif() + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_clear_environment_variables.cmake") + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_init.cmake") + +set(IOS_SDK_VERSION 9.3) +set(POLLY_XCODE_COMPILER "clang") +polly_init( + "iOS ${IOS_SDK_VERSION} / \ +${POLLY_XCODE_COMPILER} / \ +arm64 / \ +c++11 support" + "Xcode" +) + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_common.cmake") + +include(polly_fatal_error) + +# Fix try_compile +include(polly_ios_bundle_identifier) +set(CMAKE_MACOSX_BUNDLE YES) +set(CMAKE_XCODE_ATTRIBUTE_CODE_SIGN_IDENTITY "iPhone Developer") + +set(IPHONEOS_ARCHS arm64) +set(IPHONESIMULATOR_ARCHS "") + +include("${CMAKE_CURRENT_LIST_DIR}/compiler/xcode.cmake") +include("${CMAKE_CURRENT_LIST_DIR}/os/iphone.cmake") +include("${CMAKE_CURRENT_LIST_DIR}/flags/cxx11.cmake") diff --git a/tools/polly/ios-9-3-armv7.cmake b/tools/polly/ios-9-3-armv7.cmake new file mode 100644 index 0000000..0e1d110 --- /dev/null +++ b/tools/polly/ios-9-3-armv7.cmake @@ -0,0 +1,38 @@ +# Copyright (c) 2015, Ruslan Baratov +# All rights reserved. + +if(DEFINED POLLY_IOS_9_3_ARMV7_CMAKE_) + return() +else() + set(POLLY_IOS_9_3_ARMV7_CMAKE_ 1) +endif() + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_clear_environment_variables.cmake") + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_init.cmake") + +set(IOS_SDK_VERSION 9.3) +set(POLLY_XCODE_COMPILER "clang") +polly_init( + "iOS ${IOS_SDK_VERSION} / \ +${POLLY_XCODE_COMPILER} / \ +armv7 / \ +c++11 support" + "Xcode" +) + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_common.cmake") + +include(polly_fatal_error) + +# Fix try_compile +include(polly_ios_bundle_identifier) +set(CMAKE_MACOSX_BUNDLE YES) +set(CMAKE_XCODE_ATTRIBUTE_CODE_SIGN_IDENTITY "iPhone Developer") + +set(IPHONEOS_ARCHS armv7) +set(IPHONESIMULATOR_ARCHS "") + +include("${CMAKE_CURRENT_LIST_DIR}/compiler/xcode.cmake") +include("${CMAKE_CURRENT_LIST_DIR}/os/iphone.cmake") +include("${CMAKE_CURRENT_LIST_DIR}/flags/cxx11.cmake") diff --git a/tools/polly/ios-9-3-wo-armv7s.cmake b/tools/polly/ios-9-3-wo-armv7s.cmake new file mode 100644 index 0000000..3e02209 --- /dev/null +++ b/tools/polly/ios-9-3-wo-armv7s.cmake @@ -0,0 +1,38 @@ +# Copyright (c) 2015-2016, Ruslan Baratov +# All rights reserved. + +if(DEFINED POLLY_IOS_9_3_WO_ARMV7S_CMAKE_) + return() +else() + set(POLLY_IOS_9_3_WO_ARMV7S_CMAKE_ 1) +endif() + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_clear_environment_variables.cmake") + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_init.cmake") + +set(IOS_SDK_VERSION 9.3) +set(POLLY_XCODE_COMPILER "clang") +polly_init( + "iOS ${IOS_SDK_VERSION} Universal (iphoneos + iphonesimulator) / \ +${POLLY_XCODE_COMPILER} / \ +armv7 arm64 / i386 x86_64 / \ +c++11 support" + "Xcode" +) + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_common.cmake") + +include(polly_fatal_error) + +# Fix try_compile +include(polly_ios_bundle_identifier) +set(CMAKE_MACOSX_BUNDLE YES) +set(CMAKE_XCODE_ATTRIBUTE_CODE_SIGN_IDENTITY "iPhone Developer") + +set(IPHONEOS_ARCHS armv7;arm64) +set(IPHONESIMULATOR_ARCHS i386;x86_64) + +include("${CMAKE_CURRENT_LIST_DIR}/compiler/xcode.cmake") +include("${CMAKE_CURRENT_LIST_DIR}/os/iphone.cmake") +include("${CMAKE_CURRENT_LIST_DIR}/flags/cxx11.cmake") diff --git a/tools/polly/ios-9-3.cmake b/tools/polly/ios-9-3.cmake new file mode 100644 index 0000000..a48362d --- /dev/null +++ b/tools/polly/ios-9-3.cmake @@ -0,0 +1,37 @@ +# Copyright (c) 2015, Tomas Zemaitis +# All rights reserved. + +if(DEFINED POLLY_IOS_9_3_CMAKE_) + return() +else() + set(POLLY_IOS_9_3_CMAKE_ 1) +endif() + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_clear_environment_variables.cmake") + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_init.cmake") + +set(IOS_SDK_VERSION 9.3) +set(POLLY_XCODE_COMPILER "clang") +polly_init( + "iOS ${IOS_SDK_VERSION} Universal (iphoneos + iphonesimulator) / \ +${POLLY_XCODE_COMPILER} / \ +c++11 support" + "Xcode" +) + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_common.cmake") + +include(polly_fatal_error) + +# Fix try_compile +include(polly_ios_bundle_identifier) +set(CMAKE_MACOSX_BUNDLE YES) +set(CMAKE_XCODE_ATTRIBUTE_CODE_SIGN_IDENTITY "iPhone Developer") + +set(IPHONEOS_ARCHS armv7;armv7s;arm64) +set(IPHONESIMULATOR_ARCHS i386;x86_64) + +include("${CMAKE_CURRENT_LIST_DIR}/compiler/xcode.cmake") +include("${CMAKE_CURRENT_LIST_DIR}/os/iphone.cmake") +include("${CMAKE_CURRENT_LIST_DIR}/flags/cxx11.cmake") diff --git a/tools/polly/ios-dep-8-0-arm64-armv7-hid-sections-lto-cxx11.cmake b/tools/polly/ios-dep-8-0-arm64-armv7-hid-sections-lto-cxx11.cmake new file mode 100644 index 0000000..fed0b3f --- /dev/null +++ b/tools/polly/ios-dep-8-0-arm64-armv7-hid-sections-lto-cxx11.cmake @@ -0,0 +1,45 @@ +# Copyright (c) 2017-2018, Ruslan Baratov +# All rights reserved. + +if(DEFINED POLLY_IOS_DEP_8_0_ARM64_ARMV7_HID_SECTIONS_LTO_CXX11_CMAKE_) + return() +else() + set(POLLY_IOS_DEP_8_0_ARM64_ARMV7_HID_SECTIONS_LTO_CXX11_CMAKE_ 1) +endif() + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_module_path.cmake") +include(polly_clear_environment_variables) +include(polly_init) +include("${CMAKE_CURRENT_LIST_DIR}/os/iphone-default-sdk.cmake") # -> IOS_SDK_VERSION + +set(IOS_DEPLOYMENT_SDK_VERSION 8.0) +set(POLLY_XCODE_COMPILER "clang") +polly_init( + "iOS ${IOS_SDK_VERSION} / Deployment ${IOS_DEPLOYMENT_SDK_VERSION} / Universal (arm64 armv7) / \ +${POLLY_XCODE_COMPILER} / \ +c++11 support / hidden / data-sections / function-sections / LTO" + "Xcode" +) + +include(polly_common) +include(polly_fatal_error) + +# Fix try_compile +include(polly_ios_bundle_identifier) + +set(CMAKE_MACOSX_BUNDLE YES) +set(CMAKE_XCODE_ATTRIBUTE_CODE_SIGN_IDENTITY "iPhone Developer") + +set(IPHONEOS_ARCHS arm64;armv7) +set(IPHONESIMULATOR_ARCHS "") + +include("${CMAKE_CURRENT_LIST_DIR}/compiler/xcode.cmake") +include("${CMAKE_CURRENT_LIST_DIR}/os/iphone.cmake") +include("${CMAKE_CURRENT_LIST_DIR}/flags/cxx11.cmake") +include("${CMAKE_CURRENT_LIST_DIR}/flags/hidden.cmake") +include("${CMAKE_CURRENT_LIST_DIR}/flags/function-sections.cmake") +include("${CMAKE_CURRENT_LIST_DIR}/flags/data-sections.cmake") +include("${CMAKE_CURRENT_LIST_DIR}/flags/lto.cmake") +if(NOT IOS_SDK_VERSION VERSION_LESS 10.0) + include(polly_ios_development_team) +endif() diff --git a/tools/polly/ios-nocodesign-10-0-arm64.cmake b/tools/polly/ios-nocodesign-10-0-arm64.cmake new file mode 100644 index 0000000..bdfa7a9 --- /dev/null +++ b/tools/polly/ios-nocodesign-10-0-arm64.cmake @@ -0,0 +1,67 @@ +# Copyright (c) 2014-2016, Ruslan Baratov +# All rights reserved. + +if(DEFINED POLLY_IOS_NOCODESIGN_10_0_ARM64_CMAKE_) + return() +else() + set(POLLY_IOS_NOCODESIGN_10_0_ARM64_CMAKE_ 1) +endif() + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_clear_environment_variables.cmake") + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_init.cmake") + +set(IOS_SDK_VERSION 10.0) +set(POLLY_XCODE_COMPILER "clang") +polly_init( + "iOS ${IOS_SDK_VERSION} / arm64 / \ +${POLLY_XCODE_COMPILER} / \ +No code sign / \ +c++11 support" + "Xcode" +) + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_common.cmake") + +include(polly_fatal_error) + +# Fix try_compile +include(polly_ios_bundle_identifier) +set(CMAKE_MACOSX_BUNDLE YES) + +# Verify XCODE_XCCONFIG_FILE +set( + _polly_xcode_xcconfig_file_path + "${CMAKE_CURRENT_LIST_DIR}/scripts/NoCodeSign.xcconfig" +) +if(NOT EXISTS "$ENV{XCODE_XCCONFIG_FILE}") + polly_fatal_error( + "Path specified by XCODE_XCCONFIG_FILE environment variable not found" + "($ENV{XCODE_XCCONFIG_FILE})" + "Use this command to set: " + " export XCODE_XCCONFIG_FILE=${_polly_xcode_xcconfig_file_path}" + ) +else() + string( + COMPARE + NOTEQUAL + "$ENV{XCODE_XCCONFIG_FILE}" + "${_polly_xcode_xcconfig_file_path}" + _polly_wrong_xcconfig_path + ) + if(_polly_wrong_xcconfig_path) + polly_fatal_error( + "Unexpected XCODE_XCCONFIG_FILE value: " + " $ENV{XCODE_XCCONFIG_FILE}" + "expected: " + " ${_polly_xcode_xcconfig_file_path}" + ) + endif() +endif() + +set(IPHONEOS_ARCHS arm64) +set(IPHONESIMULATOR_ARCHS "") + +include("${CMAKE_CURRENT_LIST_DIR}/compiler/xcode.cmake") +include("${CMAKE_CURRENT_LIST_DIR}/os/iphone.cmake") +include("${CMAKE_CURRENT_LIST_DIR}/flags/cxx11.cmake") diff --git a/tools/polly/ios-nocodesign-10-0-armv7.cmake b/tools/polly/ios-nocodesign-10-0-armv7.cmake new file mode 100644 index 0000000..cc59c2d --- /dev/null +++ b/tools/polly/ios-nocodesign-10-0-armv7.cmake @@ -0,0 +1,67 @@ +# Copyright (c) 2014-2016, Ruslan Baratov +# All rights reserved. + +if(DEFINED POLLY_IOS_NOCODESIGN_10_0_ARMV7_CMAKE_) + return() +else() + set(POLLY_IOS_NOCODESIGN_10_0_ARMV7_CMAKE_ 1) +endif() + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_clear_environment_variables.cmake") + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_init.cmake") + +set(IOS_SDK_VERSION 10.0) +set(POLLY_XCODE_COMPILER "clang") +polly_init( + "iOS ${IOS_SDK_VERSION} / armv7 / \ +${POLLY_XCODE_COMPILER} / \ +No code sign / \ +c++11 support" + "Xcode" +) + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_common.cmake") + +include(polly_fatal_error) + +# Fix try_compile +include(polly_ios_bundle_identifier) +set(CMAKE_MACOSX_BUNDLE YES) + +# Verify XCODE_XCCONFIG_FILE +set( + _polly_xcode_xcconfig_file_path + "${CMAKE_CURRENT_LIST_DIR}/scripts/NoCodeSign.xcconfig" +) +if(NOT EXISTS "$ENV{XCODE_XCCONFIG_FILE}") + polly_fatal_error( + "Path specified by XCODE_XCCONFIG_FILE environment variable not found" + "($ENV{XCODE_XCCONFIG_FILE})" + "Use this command to set: " + " export XCODE_XCCONFIG_FILE=${_polly_xcode_xcconfig_file_path}" + ) +else() + string( + COMPARE + NOTEQUAL + "$ENV{XCODE_XCCONFIG_FILE}" + "${_polly_xcode_xcconfig_file_path}" + _polly_wrong_xcconfig_path + ) + if(_polly_wrong_xcconfig_path) + polly_fatal_error( + "Unexpected XCODE_XCCONFIG_FILE value: " + " $ENV{XCODE_XCCONFIG_FILE}" + "expected: " + " ${_polly_xcode_xcconfig_file_path}" + ) + endif() +endif() + +set(IPHONEOS_ARCHS armv7) +set(IPHONESIMULATOR_ARCHS "") + +include("${CMAKE_CURRENT_LIST_DIR}/compiler/xcode.cmake") +include("${CMAKE_CURRENT_LIST_DIR}/os/iphone.cmake") +include("${CMAKE_CURRENT_LIST_DIR}/flags/cxx11.cmake") diff --git a/tools/polly/ios-nocodesign-10-0-wo-armv7s.cmake b/tools/polly/ios-nocodesign-10-0-wo-armv7s.cmake new file mode 100644 index 0000000..b3b341d --- /dev/null +++ b/tools/polly/ios-nocodesign-10-0-wo-armv7s.cmake @@ -0,0 +1,67 @@ +# Copyright (c) 2014-2016, Ruslan Baratov +# All rights reserved. + +if(DEFINED POLLY_IOS_NOCODESIGN_10_0_WO_ARMV7S_CMAKE_) + return() +else() + set(POLLY_IOS_NOCODESIGN_10_0_WO_ARMV7S_CMAKE_ 1) +endif() + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_clear_environment_variables.cmake") + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_init.cmake") + +set(IOS_SDK_VERSION 10.0) +set(POLLY_XCODE_COMPILER "clang") +polly_init( + "iOS ${IOS_SDK_VERSION} Universal (iphoneos + iphonesimulator) / No armv7s / \ +${POLLY_XCODE_COMPILER} / \ +No code sign / \ +c++11 support" + "Xcode" +) + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_common.cmake") + +include(polly_fatal_error) + +# Fix try_compile +include(polly_ios_bundle_identifier) +set(CMAKE_MACOSX_BUNDLE YES) + +# Verify XCODE_XCCONFIG_FILE +set( + _polly_xcode_xcconfig_file_path + "${CMAKE_CURRENT_LIST_DIR}/scripts/NoCodeSign.xcconfig" +) +if(NOT EXISTS "$ENV{XCODE_XCCONFIG_FILE}") + polly_fatal_error( + "Path specified by XCODE_XCCONFIG_FILE environment variable not found" + "($ENV{XCODE_XCCONFIG_FILE})" + "Use this command to set: " + " export XCODE_XCCONFIG_FILE=${_polly_xcode_xcconfig_file_path}" + ) +else() + string( + COMPARE + NOTEQUAL + "$ENV{XCODE_XCCONFIG_FILE}" + "${_polly_xcode_xcconfig_file_path}" + _polly_wrong_xcconfig_path + ) + if(_polly_wrong_xcconfig_path) + polly_fatal_error( + "Unexpected XCODE_XCCONFIG_FILE value: " + " $ENV{XCODE_XCCONFIG_FILE}" + "expected: " + " ${_polly_xcode_xcconfig_file_path}" + ) + endif() +endif() + +set(IPHONEOS_ARCHS armv7;arm64) +set(IPHONESIMULATOR_ARCHS i386;x86_64) + +include("${CMAKE_CURRENT_LIST_DIR}/compiler/xcode.cmake") +include("${CMAKE_CURRENT_LIST_DIR}/os/iphone.cmake") +include("${CMAKE_CURRENT_LIST_DIR}/flags/cxx11.cmake") diff --git a/tools/polly/ios-nocodesign-10-0.cmake b/tools/polly/ios-nocodesign-10-0.cmake new file mode 100644 index 0000000..771c008 --- /dev/null +++ b/tools/polly/ios-nocodesign-10-0.cmake @@ -0,0 +1,67 @@ +# Copyright (c) 2014-2016, Ruslan Baratov +# All rights reserved. + +if(DEFINED POLLY_IOS_NOCODESIGN_10_0_CMAKE_) + return() +else() + set(POLLY_IOS_NOCODESIGN_10_0_CMAKE_ 1) +endif() + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_clear_environment_variables.cmake") + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_init.cmake") + +set(IOS_SDK_VERSION 10.0) +set(POLLY_XCODE_COMPILER "clang") +polly_init( + "iOS ${IOS_SDK_VERSION} Universal (iphoneos + iphonesimulator) / \ +${POLLY_XCODE_COMPILER} / \ +No code sign / \ +c++11 support" + "Xcode" +) + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_common.cmake") + +include(polly_fatal_error) + +# Fix try_compile +include(polly_ios_bundle_identifier) +set(CMAKE_MACOSX_BUNDLE YES) + +# Verify XCODE_XCCONFIG_FILE +set( + _polly_xcode_xcconfig_file_path + "${CMAKE_CURRENT_LIST_DIR}/scripts/NoCodeSign.xcconfig" +) +if(NOT EXISTS "$ENV{XCODE_XCCONFIG_FILE}") + polly_fatal_error( + "Path specified by XCODE_XCCONFIG_FILE environment variable not found" + "($ENV{XCODE_XCCONFIG_FILE})" + "Use this command to set: " + " export XCODE_XCCONFIG_FILE=${_polly_xcode_xcconfig_file_path}" + ) +else() + string( + COMPARE + NOTEQUAL + "$ENV{XCODE_XCCONFIG_FILE}" + "${_polly_xcode_xcconfig_file_path}" + _polly_wrong_xcconfig_path + ) + if(_polly_wrong_xcconfig_path) + polly_fatal_error( + "Unexpected XCODE_XCCONFIG_FILE value: " + " $ENV{XCODE_XCCONFIG_FILE}" + "expected: " + " ${_polly_xcode_xcconfig_file_path}" + ) + endif() +endif() + +set(IPHONEOS_ARCHS armv7;armv7s;arm64) +set(IPHONESIMULATOR_ARCHS i386;x86_64) + +include("${CMAKE_CURRENT_LIST_DIR}/compiler/xcode.cmake") +include("${CMAKE_CURRENT_LIST_DIR}/os/iphone.cmake") +include("${CMAKE_CURRENT_LIST_DIR}/flags/cxx11.cmake") diff --git a/tools/polly/ios-nocodesign-10-1-arm64-dep-9-0-device-libcxx-hid-sections-lto.cmake b/tools/polly/ios-nocodesign-10-1-arm64-dep-9-0-device-libcxx-hid-sections-lto.cmake new file mode 100644 index 0000000..2c506cb --- /dev/null +++ b/tools/polly/ios-nocodesign-10-1-arm64-dep-9-0-device-libcxx-hid-sections-lto.cmake @@ -0,0 +1,76 @@ +# Copyright (c) 2015, Tomas Zemaitis +# Copyright (c) 2016, David Hirvonen +# All rights reserved. + +if(DEFINED POLLY_IOS_NOCODESIGN_10_1_ARM64_DEP_9_0_DEVICE_LIBCXX_HID_SECTIONS_LTO_CMAKE_) + return() +else() + set(POLLY_IOS_NOCODESIGN_10_1_ARM64_DEP_9_0_DEVICE_LIBCXX_HID_SECTIONS_LTO_CMAKE_ 1) +endif() + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_clear_environment_variables.cmake") + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_init.cmake") + +set(IOS_SDK_VERSION 10.1) +set(IOS_DEPLOYMENT_SDK_VERSION 9.0) +set(POLLY_XCODE_COMPILER "clang") + +polly_init( + "iOS ${IOS_SDK_VERSION} / Universal (arm64) / \ +Deployment ${IOS_DEPLOYMENT_SDK_VERSION} / \ +${POLLY_XCODE_COMPILER} / \ +No code sign / \ +c++11 support / hidden / data-sections / function-sections / LTO" + "Xcode" +) + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_common.cmake") + +include(polly_fatal_error) + +# Fix try_compile +include(polly_ios_bundle_identifier) +set(CMAKE_MACOSX_BUNDLE YES) + +# Verify XCODE_XCCONFIG_FILE +set( + _polly_xcode_xcconfig_file_path + "${CMAKE_CURRENT_LIST_DIR}/scripts/NoCodeSign.xcconfig" +) +if(NOT EXISTS "$ENV{XCODE_XCCONFIG_FILE}") + polly_fatal_error( + "Path specified by XCODE_XCCONFIG_FILE environment variable not found" + "($ENV{XCODE_XCCONFIG_FILE})" + "Use this command to set: " + " export XCODE_XCCONFIG_FILE=${_polly_xcode_xcconfig_file_path}" + ) +else() + string( + COMPARE + NOTEQUAL + "$ENV{XCODE_XCCONFIG_FILE}" + "${_polly_xcode_xcconfig_file_path}" + _polly_wrong_xcconfig_path + ) + if(_polly_wrong_xcconfig_path) + polly_fatal_error( + "Unexpected XCODE_XCCONFIG_FILE value: " + " $ENV{XCODE_XCCONFIG_FILE}" + "expected: " + " ${_polly_xcode_xcconfig_file_path}" + ) + endif() +endif() + +set(IPHONEOS_ARCHS arm64) +set(IPHONESIMULATOR_ARCHS "") + +include("${CMAKE_CURRENT_LIST_DIR}/compiler/xcode.cmake") +include("${CMAKE_CURRENT_LIST_DIR}/os/iphone.cmake") +include("${CMAKE_CURRENT_LIST_DIR}/library/std/libcxx.cmake") +include("${CMAKE_CURRENT_LIST_DIR}/flags/cxx11.cmake") +include("${CMAKE_CURRENT_LIST_DIR}/flags/hidden.cmake") +include("${CMAKE_CURRENT_LIST_DIR}/flags/function-sections.cmake") +include("${CMAKE_CURRENT_LIST_DIR}/flags/data-sections.cmake") +include("${CMAKE_CURRENT_LIST_DIR}/flags/lto.cmake") diff --git a/tools/polly/ios-nocodesign-10-1-arm64-dep-9-0-device-libcxx-hid-sections.cmake b/tools/polly/ios-nocodesign-10-1-arm64-dep-9-0-device-libcxx-hid-sections.cmake new file mode 100644 index 0000000..88ed844 --- /dev/null +++ b/tools/polly/ios-nocodesign-10-1-arm64-dep-9-0-device-libcxx-hid-sections.cmake @@ -0,0 +1,75 @@ +# Copyright (c) 2015, Tomas Zemaitis +# Copyright (c) 2016, David Hirvonen +# All rights reserved. + +if(DEFINED POLLY_IOS_NOCODESIGN_10_1_ARM64_DEP_9_0_DEVICE_LIBCXX_HID_SECTIONS_CMAKE_) + return() +else() + set(POLLY_IOS_NOCODESIGN_10_1_ARM64_DEP_9_0_DEVICE_LIBCXX_HID_SECTIONS_CMAKE_ 1) +endif() + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_clear_environment_variables.cmake") + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_init.cmake") + +set(IOS_SDK_VERSION 10.1) +set(IOS_DEPLOYMENT_SDK_VERSION 9.0) +set(POLLY_XCODE_COMPILER "clang") + +polly_init( + "iOS ${IOS_SDK_VERSION} / Universal (arm64) / \ +Deployment ${IOS_DEPLOYMENT_SDK_VERSION} / \ +${POLLY_XCODE_COMPILER} / \ +No code sign / \ +c++11 support / hidden / data-sections / function-sections" + "Xcode" +) + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_common.cmake") + +include(polly_fatal_error) + +# Fix try_compile +include(polly_ios_bundle_identifier) +set(CMAKE_MACOSX_BUNDLE YES) + +# Verify XCODE_XCCONFIG_FILE +set( + _polly_xcode_xcconfig_file_path + "${CMAKE_CURRENT_LIST_DIR}/scripts/NoCodeSign.xcconfig" +) +if(NOT EXISTS "$ENV{XCODE_XCCONFIG_FILE}") + polly_fatal_error( + "Path specified by XCODE_XCCONFIG_FILE environment variable not found" + "($ENV{XCODE_XCCONFIG_FILE})" + "Use this command to set: " + " export XCODE_XCCONFIG_FILE=${_polly_xcode_xcconfig_file_path}" + ) +else() + string( + COMPARE + NOTEQUAL + "$ENV{XCODE_XCCONFIG_FILE}" + "${_polly_xcode_xcconfig_file_path}" + _polly_wrong_xcconfig_path + ) + if(_polly_wrong_xcconfig_path) + polly_fatal_error( + "Unexpected XCODE_XCCONFIG_FILE value: " + " $ENV{XCODE_XCCONFIG_FILE}" + "expected: " + " ${_polly_xcode_xcconfig_file_path}" + ) + endif() +endif() + +set(IPHONEOS_ARCHS arm64) +set(IPHONESIMULATOR_ARCHS "") + +include("${CMAKE_CURRENT_LIST_DIR}/compiler/xcode.cmake") +include("${CMAKE_CURRENT_LIST_DIR}/os/iphone.cmake") +include("${CMAKE_CURRENT_LIST_DIR}/library/std/libcxx.cmake") +include("${CMAKE_CURRENT_LIST_DIR}/flags/cxx11.cmake") +include("${CMAKE_CURRENT_LIST_DIR}/flags/hidden.cmake") +include("${CMAKE_CURRENT_LIST_DIR}/flags/function-sections.cmake") +include("${CMAKE_CURRENT_LIST_DIR}/flags/data-sections.cmake") diff --git a/tools/polly/ios-nocodesign-10-1-arm64.cmake b/tools/polly/ios-nocodesign-10-1-arm64.cmake new file mode 100644 index 0000000..e554596 --- /dev/null +++ b/tools/polly/ios-nocodesign-10-1-arm64.cmake @@ -0,0 +1,67 @@ +# Copyright (c) 2014-2016, Ruslan Baratov +# All rights reserved. + +if(DEFINED POLLY_IOS_NOCODESIGN_10_1_ARM64_CMAKE_) + return() +else() + set(POLLY_IOS_NOCODESIGN_10_1_ARM64_CMAKE_ 1) +endif() + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_clear_environment_variables.cmake") + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_init.cmake") + +set(IOS_SDK_VERSION 10.1) +set(POLLY_XCODE_COMPILER "clang") +polly_init( + "iOS ${IOS_SDK_VERSION} / arm64 / \ +${POLLY_XCODE_COMPILER} / \ +No code sign / \ +c++11 support" + "Xcode" +) + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_common.cmake") + +include(polly_fatal_error) + +# Fix try_compile +include(polly_ios_bundle_identifier) +set(CMAKE_MACOSX_BUNDLE YES) + +# Verify XCODE_XCCONFIG_FILE +set( + _polly_xcode_xcconfig_file_path + "${CMAKE_CURRENT_LIST_DIR}/scripts/NoCodeSign.xcconfig" +) +if(NOT EXISTS "$ENV{XCODE_XCCONFIG_FILE}") + polly_fatal_error( + "Path specified by XCODE_XCCONFIG_FILE environment variable not found" + "($ENV{XCODE_XCCONFIG_FILE})" + "Use this command to set: " + " export XCODE_XCCONFIG_FILE=${_polly_xcode_xcconfig_file_path}" + ) +else() + string( + COMPARE + NOTEQUAL + "$ENV{XCODE_XCCONFIG_FILE}" + "${_polly_xcode_xcconfig_file_path}" + _polly_wrong_xcconfig_path + ) + if(_polly_wrong_xcconfig_path) + polly_fatal_error( + "Unexpected XCODE_XCCONFIG_FILE value: " + " $ENV{XCODE_XCCONFIG_FILE}" + "expected: " + " ${_polly_xcode_xcconfig_file_path}" + ) + endif() +endif() + +set(IPHONEOS_ARCHS arm64) +set(IPHONESIMULATOR_ARCHS "") + +include("${CMAKE_CURRENT_LIST_DIR}/compiler/xcode.cmake") +include("${CMAKE_CURRENT_LIST_DIR}/os/iphone.cmake") +include("${CMAKE_CURRENT_LIST_DIR}/flags/cxx11.cmake") diff --git a/tools/polly/ios-nocodesign-10-1-armv7.cmake b/tools/polly/ios-nocodesign-10-1-armv7.cmake new file mode 100644 index 0000000..f41fadf --- /dev/null +++ b/tools/polly/ios-nocodesign-10-1-armv7.cmake @@ -0,0 +1,67 @@ +# Copyright (c) 2014-2016, Ruslan Baratov +# All rights reserved. + +if(DEFINED POLLY_IOS_NOCODESIGN_10_1_ARMV7_CMAKE_) + return() +else() + set(POLLY_IOS_NOCODESIGN_10_1_ARMV7_CMAKE_ 1) +endif() + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_clear_environment_variables.cmake") + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_init.cmake") + +set(IOS_SDK_VERSION 10.1) +set(POLLY_XCODE_COMPILER "clang") +polly_init( + "iOS ${IOS_SDK_VERSION} / armv7 / \ +${POLLY_XCODE_COMPILER} / \ +No code sign / \ +c++11 support" + "Xcode" +) + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_common.cmake") + +include(polly_fatal_error) + +# Fix try_compile +include(polly_ios_bundle_identifier) +set(CMAKE_MACOSX_BUNDLE YES) + +# Verify XCODE_XCCONFIG_FILE +set( + _polly_xcode_xcconfig_file_path + "${CMAKE_CURRENT_LIST_DIR}/scripts/NoCodeSign.xcconfig" +) +if(NOT EXISTS "$ENV{XCODE_XCCONFIG_FILE}") + polly_fatal_error( + "Path specified by XCODE_XCCONFIG_FILE environment variable not found" + "($ENV{XCODE_XCCONFIG_FILE})" + "Use this command to set: " + " export XCODE_XCCONFIG_FILE=${_polly_xcode_xcconfig_file_path}" + ) +else() + string( + COMPARE + NOTEQUAL + "$ENV{XCODE_XCCONFIG_FILE}" + "${_polly_xcode_xcconfig_file_path}" + _polly_wrong_xcconfig_path + ) + if(_polly_wrong_xcconfig_path) + polly_fatal_error( + "Unexpected XCODE_XCCONFIG_FILE value: " + " $ENV{XCODE_XCCONFIG_FILE}" + "expected: " + " ${_polly_xcode_xcconfig_file_path}" + ) + endif() +endif() + +set(IPHONEOS_ARCHS armv7) +set(IPHONESIMULATOR_ARCHS "") + +include("${CMAKE_CURRENT_LIST_DIR}/compiler/xcode.cmake") +include("${CMAKE_CURRENT_LIST_DIR}/os/iphone.cmake") +include("${CMAKE_CURRENT_LIST_DIR}/flags/cxx11.cmake") diff --git a/tools/polly/ios-nocodesign-10-1-dep-8-0-device-libcxx-hid-sections-lto.cmake b/tools/polly/ios-nocodesign-10-1-dep-8-0-device-libcxx-hid-sections-lto.cmake new file mode 100644 index 0000000..d980aa0 --- /dev/null +++ b/tools/polly/ios-nocodesign-10-1-dep-8-0-device-libcxx-hid-sections-lto.cmake @@ -0,0 +1,76 @@ +# Copyright (c) 2015, Tomas Zemaitis +# Copyright (c) 2016, David Hirvonen +# All rights reserved. + +if(DEFINED POLLY_IOS_NOCODESIGN_10_1_DEP_8_0_DEVICE_LIBCXX_HID_SECTIONS_LTO_CMAKE_) + return() +else() + set(POLLY_IOS_NOCODESIGN_10_1_DEP_8_0_DEVICE_LIBCXX_HID_SECTIONS_LTO_CMAKE_ 1) +endif() + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_clear_environment_variables.cmake") + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_init.cmake") + +set(IOS_SDK_VERSION 10.1) +set(IOS_DEPLOYMENT_SDK_VERSION 8.0) +set(POLLY_XCODE_COMPILER "clang") + +polly_init( + "iOS ${IOS_SDK_VERSION} / Universal (arm64 armv7s armv7) / \ +Deployment ${IOS_DEPLOYMENT_SDK_VERSION} / \ +${POLLY_XCODE_COMPILER} / \ +No code sign / \ +c++11 support / hidden / data-sections / function-sections / LTO" + "Xcode" +) + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_common.cmake") + +include(polly_fatal_error) + +# Fix try_compile +include(polly_ios_bundle_identifier) +set(CMAKE_MACOSX_BUNDLE YES) + +# Verify XCODE_XCCONFIG_FILE +set( + _polly_xcode_xcconfig_file_path + "${CMAKE_CURRENT_LIST_DIR}/scripts/NoCodeSign.xcconfig" +) +if(NOT EXISTS "$ENV{XCODE_XCCONFIG_FILE}") + polly_fatal_error( + "Path specified by XCODE_XCCONFIG_FILE environment variable not found" + "($ENV{XCODE_XCCONFIG_FILE})" + "Use this command to set: " + " export XCODE_XCCONFIG_FILE=${_polly_xcode_xcconfig_file_path}" + ) +else() + string( + COMPARE + NOTEQUAL + "$ENV{XCODE_XCCONFIG_FILE}" + "${_polly_xcode_xcconfig_file_path}" + _polly_wrong_xcconfig_path + ) + if(_polly_wrong_xcconfig_path) + polly_fatal_error( + "Unexpected XCODE_XCCONFIG_FILE value: " + " $ENV{XCODE_XCCONFIG_FILE}" + "expected: " + " ${_polly_xcode_xcconfig_file_path}" + ) + endif() +endif() + +set(IPHONEOS_ARCHS armv7;armv7s;arm64) +set(IPHONESIMULATOR_ARCHS "") + +include("${CMAKE_CURRENT_LIST_DIR}/compiler/xcode.cmake") +include("${CMAKE_CURRENT_LIST_DIR}/os/iphone.cmake") +include("${CMAKE_CURRENT_LIST_DIR}/library/std/libcxx.cmake") +include("${CMAKE_CURRENT_LIST_DIR}/flags/cxx11.cmake") +include("${CMAKE_CURRENT_LIST_DIR}/flags/hidden.cmake") +include("${CMAKE_CURRENT_LIST_DIR}/flags/function-sections.cmake") +include("${CMAKE_CURRENT_LIST_DIR}/flags/data-sections.cmake") +include("${CMAKE_CURRENT_LIST_DIR}/flags/lto.cmake") diff --git a/tools/polly/ios-nocodesign-10-1-dep-8-0-libcxx-hid-sections-lto.cmake b/tools/polly/ios-nocodesign-10-1-dep-8-0-libcxx-hid-sections-lto.cmake new file mode 100644 index 0000000..00dc00a --- /dev/null +++ b/tools/polly/ios-nocodesign-10-1-dep-8-0-libcxx-hid-sections-lto.cmake @@ -0,0 +1,76 @@ +# Copyright (c) 2015, Tomas Zemaitis +# Copyright (c) 2016, David Hirvonen +# All rights reserved. + +if(DEFINED POLLY_IOS_NOCODESIGN_10_1_DEP_8_0_LIBCXX_HID_SECTIONS_LTO_CMAKE_) + return() +else() + set(POLLY_IOS_NOCODESIGN_10_1_DEP_8_0_LIBCXX_HID_SECTIONS_LTO_CMAKE_ 1) +endif() + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_clear_environment_variables.cmake") + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_init.cmake") + +set(IOS_SDK_VERSION 10.1) +set(IOS_DEPLOYMENT_SDK_VERSION 8.0) +set(POLLY_XCODE_COMPILER "clang") + +polly_init( + "iOS ${IOS_SDK_VERSION} Universal (iphoneos + iphonesimulator) / \ +Deployment ${IOS_DEPLOYMENT_SDK_VERSION} / \ +${POLLY_XCODE_COMPILER} / \ +No code sign / \ +c++11 support / hidden / data-sections / function-sections / LTO" + "Xcode" +) + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_common.cmake") + +include(polly_fatal_error) + +# Fix try_compile +include(polly_ios_bundle_identifier) +set(CMAKE_MACOSX_BUNDLE YES) + +# Verify XCODE_XCCONFIG_FILE +set( + _polly_xcode_xcconfig_file_path + "${CMAKE_CURRENT_LIST_DIR}/scripts/NoCodeSign.xcconfig" +) +if(NOT EXISTS "$ENV{XCODE_XCCONFIG_FILE}") + polly_fatal_error( + "Path specified by XCODE_XCCONFIG_FILE environment variable not found" + "($ENV{XCODE_XCCONFIG_FILE})" + "Use this command to set: " + " export XCODE_XCCONFIG_FILE=${_polly_xcode_xcconfig_file_path}" + ) +else() + string( + COMPARE + NOTEQUAL + "$ENV{XCODE_XCCONFIG_FILE}" + "${_polly_xcode_xcconfig_file_path}" + _polly_wrong_xcconfig_path + ) + if(_polly_wrong_xcconfig_path) + polly_fatal_error( + "Unexpected XCODE_XCCONFIG_FILE value: " + " $ENV{XCODE_XCCONFIG_FILE}" + "expected: " + " ${_polly_xcode_xcconfig_file_path}" + ) + endif() +endif() + +set(IPHONEOS_ARCHS armv7;armv7s;arm64) +set(IPHONESIMULATOR_ARCHS i386;x86_64) + +include("${CMAKE_CURRENT_LIST_DIR}/compiler/xcode.cmake") +include("${CMAKE_CURRENT_LIST_DIR}/os/iphone.cmake") +include("${CMAKE_CURRENT_LIST_DIR}/library/std/libcxx.cmake") +include("${CMAKE_CURRENT_LIST_DIR}/flags/cxx11.cmake") +include("${CMAKE_CURRENT_LIST_DIR}/flags/hidden.cmake") +include("${CMAKE_CURRENT_LIST_DIR}/flags/function-sections.cmake") +include("${CMAKE_CURRENT_LIST_DIR}/flags/data-sections.cmake") +include("${CMAKE_CURRENT_LIST_DIR}/flags/lto.cmake") diff --git a/tools/polly/ios-nocodesign-10-1-dep-9-0-device-libcxx-hid-sections-lto.cmake b/tools/polly/ios-nocodesign-10-1-dep-9-0-device-libcxx-hid-sections-lto.cmake new file mode 100644 index 0000000..ac1e6a7 --- /dev/null +++ b/tools/polly/ios-nocodesign-10-1-dep-9-0-device-libcxx-hid-sections-lto.cmake @@ -0,0 +1,76 @@ +# Copyright (c) 2015, Tomas Zemaitis +# Copyright (c) 2016, David Hirvonen +# All rights reserved. + +if(DEFINED POLLY_IOS_NOCODESIGN_10_1_DEP_9_0_DEVICE_LIBCXX_HID_SECTIONS_LTO_CMAKE_) + return() +else() + set(POLLY_IOS_NOCODESIGN_10_1_DEP_9_0_DEVICE_LIBCXX_HID_SECTIONS_LTO_CMAKE_ 1) +endif() + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_clear_environment_variables.cmake") + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_init.cmake") + +set(IOS_SDK_VERSION 10.1) +set(IOS_DEPLOYMENT_SDK_VERSION 9.0) +set(POLLY_XCODE_COMPILER "clang") + +polly_init( + "iOS ${IOS_SDK_VERSION} / Universal (arm64 armv7s armv7) / \ +Deployment ${IOS_DEPLOYMENT_SDK_VERSION} / \ +${POLLY_XCODE_COMPILER} / \ +No code sign / \ +c++11 support / hidden / data-sections / function-sections / LTO" + "Xcode" +) + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_common.cmake") + +include(polly_fatal_error) + +# Fix try_compile +include(polly_ios_bundle_identifier) +set(CMAKE_MACOSX_BUNDLE YES) + +# Verify XCODE_XCCONFIG_FILE +set( + _polly_xcode_xcconfig_file_path + "${CMAKE_CURRENT_LIST_DIR}/scripts/NoCodeSign.xcconfig" +) +if(NOT EXISTS "$ENV{XCODE_XCCONFIG_FILE}") + polly_fatal_error( + "Path specified by XCODE_XCCONFIG_FILE environment variable not found" + "($ENV{XCODE_XCCONFIG_FILE})" + "Use this command to set: " + " export XCODE_XCCONFIG_FILE=${_polly_xcode_xcconfig_file_path}" + ) +else() + string( + COMPARE + NOTEQUAL + "$ENV{XCODE_XCCONFIG_FILE}" + "${_polly_xcode_xcconfig_file_path}" + _polly_wrong_xcconfig_path + ) + if(_polly_wrong_xcconfig_path) + polly_fatal_error( + "Unexpected XCODE_XCCONFIG_FILE value: " + " $ENV{XCODE_XCCONFIG_FILE}" + "expected: " + " ${_polly_xcode_xcconfig_file_path}" + ) + endif() +endif() + +set(IPHONEOS_ARCHS armv7;armv7s;arm64) +set(IPHONESIMULATOR_ARCHS "") + +include("${CMAKE_CURRENT_LIST_DIR}/compiler/xcode.cmake") +include("${CMAKE_CURRENT_LIST_DIR}/os/iphone.cmake") +include("${CMAKE_CURRENT_LIST_DIR}/library/std/libcxx.cmake") +include("${CMAKE_CURRENT_LIST_DIR}/flags/cxx11.cmake") +include("${CMAKE_CURRENT_LIST_DIR}/flags/hidden.cmake") +include("${CMAKE_CURRENT_LIST_DIR}/flags/function-sections.cmake") +include("${CMAKE_CURRENT_LIST_DIR}/flags/data-sections.cmake") +include("${CMAKE_CURRENT_LIST_DIR}/flags/lto.cmake") diff --git a/tools/polly/ios-nocodesign-10-1-wo-armv7s.cmake b/tools/polly/ios-nocodesign-10-1-wo-armv7s.cmake new file mode 100644 index 0000000..59df2bc --- /dev/null +++ b/tools/polly/ios-nocodesign-10-1-wo-armv7s.cmake @@ -0,0 +1,67 @@ +# Copyright (c) 2014-2016, Ruslan Baratov +# All rights reserved. + +if(DEFINED POLLY_IOS_NOCODESIGN_10_1_WO_ARMV7S_CMAKE_) + return() +else() + set(POLLY_IOS_NOCODESIGN_10_1_WO_ARMV7S_CMAKE_ 1) +endif() + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_clear_environment_variables.cmake") + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_init.cmake") + +set(IOS_SDK_VERSION 10.1) +set(POLLY_XCODE_COMPILER "clang") +polly_init( + "iOS ${IOS_SDK_VERSION} Universal (iphoneos + iphonesimulator) / No armv7s / \ +${POLLY_XCODE_COMPILER} / \ +No code sign / \ +c++11 support" + "Xcode" +) + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_common.cmake") + +include(polly_fatal_error) + +# Fix try_compile +include(polly_ios_bundle_identifier) +set(CMAKE_MACOSX_BUNDLE YES) + +# Verify XCODE_XCCONFIG_FILE +set( + _polly_xcode_xcconfig_file_path + "${CMAKE_CURRENT_LIST_DIR}/scripts/NoCodeSign.xcconfig" +) +if(NOT EXISTS "$ENV{XCODE_XCCONFIG_FILE}") + polly_fatal_error( + "Path specified by XCODE_XCCONFIG_FILE environment variable not found" + "($ENV{XCODE_XCCONFIG_FILE})" + "Use this command to set: " + " export XCODE_XCCONFIG_FILE=${_polly_xcode_xcconfig_file_path}" + ) +else() + string( + COMPARE + NOTEQUAL + "$ENV{XCODE_XCCONFIG_FILE}" + "${_polly_xcode_xcconfig_file_path}" + _polly_wrong_xcconfig_path + ) + if(_polly_wrong_xcconfig_path) + polly_fatal_error( + "Unexpected XCODE_XCCONFIG_FILE value: " + " $ENV{XCODE_XCCONFIG_FILE}" + "expected: " + " ${_polly_xcode_xcconfig_file_path}" + ) + endif() +endif() + +set(IPHONEOS_ARCHS armv7;arm64) +set(IPHONESIMULATOR_ARCHS i386;x86_64) + +include("${CMAKE_CURRENT_LIST_DIR}/compiler/xcode.cmake") +include("${CMAKE_CURRENT_LIST_DIR}/os/iphone.cmake") +include("${CMAKE_CURRENT_LIST_DIR}/flags/cxx11.cmake") diff --git a/tools/polly/ios-nocodesign-10-1.cmake b/tools/polly/ios-nocodesign-10-1.cmake new file mode 100644 index 0000000..8cb178c --- /dev/null +++ b/tools/polly/ios-nocodesign-10-1.cmake @@ -0,0 +1,67 @@ +# Copyright (c) 2014-2016, Ruslan Baratov +# All rights reserved. + +if(DEFINED POLLY_IOS_NOCODESIGN_10_1_CMAKE_) + return() +else() + set(POLLY_IOS_NOCODESIGN_10_1_CMAKE_ 1) +endif() + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_clear_environment_variables.cmake") + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_init.cmake") + +set(IOS_SDK_VERSION 10.1) +set(POLLY_XCODE_COMPILER "clang") +polly_init( + "iOS ${IOS_SDK_VERSION} Universal (iphoneos + iphonesimulator) / \ +${POLLY_XCODE_COMPILER} / \ +No code sign / \ +c++11 support" + "Xcode" +) + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_common.cmake") + +include(polly_fatal_error) + +# Fix try_compile +include(polly_ios_bundle_identifier) +set(CMAKE_MACOSX_BUNDLE YES) + +# Verify XCODE_XCCONFIG_FILE +set( + _polly_xcode_xcconfig_file_path + "${CMAKE_CURRENT_LIST_DIR}/scripts/NoCodeSign.xcconfig" +) +if(NOT EXISTS "$ENV{XCODE_XCCONFIG_FILE}") + polly_fatal_error( + "Path specified by XCODE_XCCONFIG_FILE environment variable not found" + "($ENV{XCODE_XCCONFIG_FILE})" + "Use this command to set: " + " export XCODE_XCCONFIG_FILE=${_polly_xcode_xcconfig_file_path}" + ) +else() + string( + COMPARE + NOTEQUAL + "$ENV{XCODE_XCCONFIG_FILE}" + "${_polly_xcode_xcconfig_file_path}" + _polly_wrong_xcconfig_path + ) + if(_polly_wrong_xcconfig_path) + polly_fatal_error( + "Unexpected XCODE_XCCONFIG_FILE value: " + " $ENV{XCODE_XCCONFIG_FILE}" + "expected: " + " ${_polly_xcode_xcconfig_file_path}" + ) + endif() +endif() + +set(IPHONEOS_ARCHS armv7;armv7s;arm64) +set(IPHONESIMULATOR_ARCHS i386;x86_64) + +include("${CMAKE_CURRENT_LIST_DIR}/compiler/xcode.cmake") +include("${CMAKE_CURRENT_LIST_DIR}/os/iphone.cmake") +include("${CMAKE_CURRENT_LIST_DIR}/flags/cxx11.cmake") diff --git a/tools/polly/ios-nocodesign-10-2.cmake b/tools/polly/ios-nocodesign-10-2.cmake new file mode 100644 index 0000000..87c5f95 --- /dev/null +++ b/tools/polly/ios-nocodesign-10-2.cmake @@ -0,0 +1,67 @@ +# Copyright (c) 2014-2016, Ruslan Baratov +# All rights reserved. + +if(DEFINED POLLY_IOS_NOCODESIGN_10_2_CMAKE_) + return() +else() + set(POLLY_IOS_NOCODESIGN_10_2_CMAKE_ 1) +endif() + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_clear_environment_variables.cmake") + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_init.cmake") + +set(IOS_SDK_VERSION 10.2) +set(POLLY_XCODE_COMPILER "clang") +polly_init( + "iOS ${IOS_SDK_VERSION} Universal (iphoneos + iphonesimulator) / \ +${POLLY_XCODE_COMPILER} / \ +No code sign / \ +c++11 support" + "Xcode" +) + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_common.cmake") + +include(polly_fatal_error) + +# Fix try_compile +include(polly_ios_bundle_identifier) +set(CMAKE_MACOSX_BUNDLE YES) + +# Verify XCODE_XCCONFIG_FILE +set( + _polly_xcode_xcconfig_file_path + "${CMAKE_CURRENT_LIST_DIR}/scripts/NoCodeSign.xcconfig" +) +if(NOT EXISTS "$ENV{XCODE_XCCONFIG_FILE}") + polly_fatal_error( + "Path specified by XCODE_XCCONFIG_FILE environment variable not found" + "($ENV{XCODE_XCCONFIG_FILE})" + "Use this command to set: " + " export XCODE_XCCONFIG_FILE=${_polly_xcode_xcconfig_file_path}" + ) +else() + string( + COMPARE + NOTEQUAL + "$ENV{XCODE_XCCONFIG_FILE}" + "${_polly_xcode_xcconfig_file_path}" + _polly_wrong_xcconfig_path + ) + if(_polly_wrong_xcconfig_path) + polly_fatal_error( + "Unexpected XCODE_XCCONFIG_FILE value: " + " $ENV{XCODE_XCCONFIG_FILE}" + "expected: " + " ${_polly_xcode_xcconfig_file_path}" + ) + endif() +endif() + +set(IPHONEOS_ARCHS armv7;armv7s;arm64) +set(IPHONESIMULATOR_ARCHS i386;x86_64) + +include("${CMAKE_CURRENT_LIST_DIR}/compiler/xcode.cmake") +include("${CMAKE_CURRENT_LIST_DIR}/os/iphone.cmake") +include("${CMAKE_CURRENT_LIST_DIR}/flags/cxx11.cmake") diff --git a/tools/polly/ios-nocodesign-10-3-arm64-dep-9-0-device-libcxx-hid-sections.cmake b/tools/polly/ios-nocodesign-10-3-arm64-dep-9-0-device-libcxx-hid-sections.cmake new file mode 100644 index 0000000..7d22cea --- /dev/null +++ b/tools/polly/ios-nocodesign-10-3-arm64-dep-9-0-device-libcxx-hid-sections.cmake @@ -0,0 +1,75 @@ +# Copyright (c) 2015-2017, Tomas Zemaitis +# Copyright (c) 2016-2017, David Hirvonen +# All rights reserved. + +if(DEFINED POLLY_IOS_NOCODESIGN_10_3_ARM64_DEP_9_0_DEVICE_LIBCXX_HID_SECTIONS_CMAKE_) + return() +else() + set(POLLY_IOS_NOCODESIGN_10_3_ARM64_DEP_9_0_DEVICE_LIBCXX_HID_SECTIONS_CMAKE_ 1) +endif() + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_clear_environment_variables.cmake") + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_init.cmake") + +set(IOS_SDK_VERSION 10.3) +set(IOS_DEPLOYMENT_SDK_VERSION 9.0) +set(POLLY_XCODE_COMPILER "clang") + +polly_init( + "iOS ${IOS_SDK_VERSION} / Universal (arm64) / \ +Deployment ${IOS_DEPLOYMENT_SDK_VERSION} / \ +${POLLY_XCODE_COMPILER} / \ +No code sign / \ +c++11 support / hidden / data-sections / function-sections" + "Xcode" +) + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_common.cmake") + +include(polly_fatal_error) + +# Fix try_compile +include(polly_ios_bundle_identifier) +set(CMAKE_MACOSX_BUNDLE YES) + +# Verify XCODE_XCCONFIG_FILE +set( + _polly_xcode_xcconfig_file_path + "${CMAKE_CURRENT_LIST_DIR}/scripts/NoCodeSign.xcconfig" +) +if(NOT EXISTS "$ENV{XCODE_XCCONFIG_FILE}") + polly_fatal_error( + "Path specified by XCODE_XCCONFIG_FILE environment variable not found" + "($ENV{XCODE_XCCONFIG_FILE})" + "Use this command to set: " + " export XCODE_XCCONFIG_FILE=${_polly_xcode_xcconfig_file_path}" + ) +else() + string( + COMPARE + NOTEQUAL + "$ENV{XCODE_XCCONFIG_FILE}" + "${_polly_xcode_xcconfig_file_path}" + _polly_wrong_xcconfig_path + ) + if(_polly_wrong_xcconfig_path) + polly_fatal_error( + "Unexpected XCODE_XCCONFIG_FILE value: " + " $ENV{XCODE_XCCONFIG_FILE}" + "expected: " + " ${_polly_xcode_xcconfig_file_path}" + ) + endif() +endif() + +set(IPHONEOS_ARCHS arm64) +set(IPHONESIMULATOR_ARCHS "") + +include("${CMAKE_CURRENT_LIST_DIR}/compiler/xcode.cmake") +include("${CMAKE_CURRENT_LIST_DIR}/os/iphone.cmake") +include("${CMAKE_CURRENT_LIST_DIR}/library/std/libcxx.cmake") +include("${CMAKE_CURRENT_LIST_DIR}/flags/cxx11.cmake") +include("${CMAKE_CURRENT_LIST_DIR}/flags/hidden.cmake") +include("${CMAKE_CURRENT_LIST_DIR}/flags/function-sections.cmake") +include("${CMAKE_CURRENT_LIST_DIR}/flags/data-sections.cmake") diff --git a/tools/polly/ios-nocodesign-10-3-arm64.cmake b/tools/polly/ios-nocodesign-10-3-arm64.cmake new file mode 100644 index 0000000..a5a517a --- /dev/null +++ b/tools/polly/ios-nocodesign-10-3-arm64.cmake @@ -0,0 +1,67 @@ +# Copyright (c) 2014-2018, Ruslan Baratov +# All rights reserved. + +if(DEFINED POLLY_IOS_NOCODESIGN_10_3_ARM64_CMAKE_) + return() +else() + set(POLLY_IOS_NOCODESIGN_10_3_ARM64_CMAKE_ 1) +endif() + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_clear_environment_variables.cmake") + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_init.cmake") + +set(IOS_SDK_VERSION 10.3) +set(POLLY_XCODE_COMPILER "clang") +polly_init( + "iOS ${IOS_SDK_VERSION} / arm64 / \ +${POLLY_XCODE_COMPILER} / \ +No code sign / \ +c++11 support" + "Xcode" +) + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_common.cmake") + +include(polly_fatal_error) + +# Fix try_compile +include(polly_ios_bundle_identifier) +set(CMAKE_MACOSX_BUNDLE YES) + +# Verify XCODE_XCCONFIG_FILE +set( + _polly_xcode_xcconfig_file_path + "${CMAKE_CURRENT_LIST_DIR}/scripts/NoCodeSign.xcconfig" +) +if(NOT EXISTS "$ENV{XCODE_XCCONFIG_FILE}") + polly_fatal_error( + "Path specified by XCODE_XCCONFIG_FILE environment variable not found" + "($ENV{XCODE_XCCONFIG_FILE})" + "Use this command to set: " + " export XCODE_XCCONFIG_FILE=${_polly_xcode_xcconfig_file_path}" + ) +else() + string( + COMPARE + NOTEQUAL + "$ENV{XCODE_XCCONFIG_FILE}" + "${_polly_xcode_xcconfig_file_path}" + _polly_wrong_xcconfig_path + ) + if(_polly_wrong_xcconfig_path) + polly_fatal_error( + "Unexpected XCODE_XCCONFIG_FILE value: " + " $ENV{XCODE_XCCONFIG_FILE}" + "expected: " + " ${_polly_xcode_xcconfig_file_path}" + ) + endif() +endif() + +set(IPHONEOS_ARCHS arm64) +set(IPHONESIMULATOR_ARCHS "") + +include("${CMAKE_CURRENT_LIST_DIR}/compiler/xcode.cmake") +include("${CMAKE_CURRENT_LIST_DIR}/os/iphone.cmake") +include("${CMAKE_CURRENT_LIST_DIR}/flags/cxx11.cmake") diff --git a/tools/polly/ios-nocodesign-10-3-armv7.cmake b/tools/polly/ios-nocodesign-10-3-armv7.cmake new file mode 100644 index 0000000..ac3a02b --- /dev/null +++ b/tools/polly/ios-nocodesign-10-3-armv7.cmake @@ -0,0 +1,67 @@ +# Copyright (c) 2014-2018, Ruslan Baratov +# All rights reserved. + +if(DEFINED POLLY_IOS_NOCODESIGN_10_3_ARMV7_CMAKE_) + return() +else() + set(POLLY_IOS_NOCODESIGN_10_3_ARMV7_CMAKE_ 1) +endif() + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_clear_environment_variables.cmake") + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_init.cmake") + +set(IOS_SDK_VERSION 10.3) +set(POLLY_XCODE_COMPILER "clang") +polly_init( + "iOS ${IOS_SDK_VERSION} / armv7 / \ +${POLLY_XCODE_COMPILER} / \ +No code sign / \ +c++11 support" + "Xcode" +) + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_common.cmake") + +include(polly_fatal_error) + +# Fix try_compile +include(polly_ios_bundle_identifier) +set(CMAKE_MACOSX_BUNDLE YES) + +# Verify XCODE_XCCONFIG_FILE +set( + _polly_xcode_xcconfig_file_path + "${CMAKE_CURRENT_LIST_DIR}/scripts/NoCodeSign.xcconfig" +) +if(NOT EXISTS "$ENV{XCODE_XCCONFIG_FILE}") + polly_fatal_error( + "Path specified by XCODE_XCCONFIG_FILE environment variable not found" + "($ENV{XCODE_XCCONFIG_FILE})" + "Use this command to set: " + " export XCODE_XCCONFIG_FILE=${_polly_xcode_xcconfig_file_path}" + ) +else() + string( + COMPARE + NOTEQUAL + "$ENV{XCODE_XCCONFIG_FILE}" + "${_polly_xcode_xcconfig_file_path}" + _polly_wrong_xcconfig_path + ) + if(_polly_wrong_xcconfig_path) + polly_fatal_error( + "Unexpected XCODE_XCCONFIG_FILE value: " + " $ENV{XCODE_XCCONFIG_FILE}" + "expected: " + " ${_polly_xcode_xcconfig_file_path}" + ) + endif() +endif() + +set(IPHONEOS_ARCHS armv7) +set(IPHONESIMULATOR_ARCHS "") + +include("${CMAKE_CURRENT_LIST_DIR}/compiler/xcode.cmake") +include("${CMAKE_CURRENT_LIST_DIR}/os/iphone.cmake") +include("${CMAKE_CURRENT_LIST_DIR}/flags/cxx11.cmake") diff --git a/tools/polly/ios-nocodesign-10-3-cxx14.cmake b/tools/polly/ios-nocodesign-10-3-cxx14.cmake new file mode 100644 index 0000000..45beab8 --- /dev/null +++ b/tools/polly/ios-nocodesign-10-3-cxx14.cmake @@ -0,0 +1,67 @@ +# Copyright (c) 2014-2016, Ruslan Baratov +# All rights reserved. + +if(DEFINED POLLY_IOS_NOCODESIGN_10_3_CXX14_CMAKE_) + return() +else() + set(POLLY_IOS_NOCODESIGN_10_3_CXX14_CMAKE_ 1) +endif() + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_clear_environment_variables.cmake") + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_init.cmake") + +set(IOS_SDK_VERSION 10.3) +set(POLLY_XCODE_COMPILER "clang") +polly_init( + "iOS ${IOS_SDK_VERSION} Universal (iphoneos + iphonesimulator) / \ +${POLLY_XCODE_COMPILER} / \ +No code sign / \ +c++14 support" + "Xcode" +) + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_common.cmake") + +include(polly_fatal_error) + +# Fix try_compile +include(polly_ios_bundle_identifier) +set(CMAKE_MACOSX_BUNDLE YES) + +# Verify XCODE_XCCONFIG_FILE +set( + _polly_xcode_xcconfig_file_path + "${CMAKE_CURRENT_LIST_DIR}/scripts/NoCodeSign.xcconfig" +) +if(NOT EXISTS "$ENV{XCODE_XCCONFIG_FILE}") + polly_fatal_error( + "Path specified by XCODE_XCCONFIG_FILE environment variable not found" + "($ENV{XCODE_XCCONFIG_FILE})" + "Use this command to set: " + " export XCODE_XCCONFIG_FILE=${_polly_xcode_xcconfig_file_path}" + ) +else() + string( + COMPARE + NOTEQUAL + "$ENV{XCODE_XCCONFIG_FILE}" + "${_polly_xcode_xcconfig_file_path}" + _polly_wrong_xcconfig_path + ) + if(_polly_wrong_xcconfig_path) + polly_fatal_error( + "Unexpected XCODE_XCCONFIG_FILE value: " + " $ENV{XCODE_XCCONFIG_FILE}" + "expected: " + " ${_polly_xcode_xcconfig_file_path}" + ) + endif() +endif() + +set(IPHONEOS_ARCHS armv7;armv7s;arm64) +set(IPHONESIMULATOR_ARCHS i386;x86_64) + +include("${CMAKE_CURRENT_LIST_DIR}/compiler/xcode.cmake") +include("${CMAKE_CURRENT_LIST_DIR}/os/iphone.cmake") +include("${CMAKE_CURRENT_LIST_DIR}/flags/cxx14.cmake") diff --git a/tools/polly/ios-nocodesign-10-3-dep-9-0-bitcode.cmake b/tools/polly/ios-nocodesign-10-3-dep-9-0-bitcode.cmake new file mode 100644 index 0000000..9577f17 --- /dev/null +++ b/tools/polly/ios-nocodesign-10-3-dep-9-0-bitcode.cmake @@ -0,0 +1,44 @@ +# Copyright (c) 2014-2017, Ruslan Baratov +# All rights reserved. + +if(DEFINED POLLY_IOS_NOCODESIGN_10_3_DEP_9_0_BITCODE_CMAKE_) + return() +else() + set(POLLY_IOS_NOCODESIGN_10_3_DEP_9_0_BITCODE_CMAKE_ 1) +endif() + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_clear_environment_variables.cmake") + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_init.cmake") + +set(IOS_SDK_VERSION 10.3) +set(IOS_DEPLOYMENT_SDK_VERSION 9.0) + +set(POLLY_XCODE_COMPILER "clang") +polly_init( + "iOS ${IOS_SDK_VERSION} / Deployment ${IOS_DEPLOYMENT_SDK_VERSION} / Universal (iphoneos + iphonesimulator) / \ +${POLLY_XCODE_COMPILER} / \ +No code sign / \ +bitcode / \ +c++11 support" + "Xcode" +) + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_common.cmake") + +include(polly_fatal_error) + +# Fix try_compile +include(polly_ios_bundle_identifier) + +set(CMAKE_MACOSX_BUNDLE YES) + +include("${CMAKE_CURRENT_LIST_DIR}/flags/ios_nocodesign.cmake") + +set(IPHONEOS_ARCHS armv7;armv7s;arm64) +set(IPHONESIMULATOR_ARCHS i386;x86_64) + +include("${CMAKE_CURRENT_LIST_DIR}/compiler/xcode.cmake") +include("${CMAKE_CURRENT_LIST_DIR}/os/iphone.cmake") +include("${CMAKE_CURRENT_LIST_DIR}/flags/cxx11.cmake") +include("${CMAKE_CURRENT_LIST_DIR}/flags/bitcode.cmake") # after os/iphone.cmake diff --git a/tools/polly/ios-nocodesign-10-3-wo-armv7s.cmake b/tools/polly/ios-nocodesign-10-3-wo-armv7s.cmake new file mode 100644 index 0000000..82b6700 --- /dev/null +++ b/tools/polly/ios-nocodesign-10-3-wo-armv7s.cmake @@ -0,0 +1,67 @@ +# Copyright (c) 2014-2016, Ruslan Baratov +# All rights reserved. + +if(DEFINED POLLY_IOS_NOCODESIGN_10_3_WO_ARMV7S_CMAKE_) + return() +else() + set(POLLY_IOS_NOCODESIGN_10_3_WO_ARMV7S_CMAKE_ 1) +endif() + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_clear_environment_variables.cmake") + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_init.cmake") + +set(IOS_SDK_VERSION 10.3) +set(POLLY_XCODE_COMPILER "clang") +polly_init( + "iOS ${IOS_SDK_VERSION} Universal (iphoneos + iphonesimulator) / No armv7s / \ +${POLLY_XCODE_COMPILER} / \ +No code sign / \ +c++11 support" + "Xcode" +) + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_common.cmake") + +include(polly_fatal_error) + +# Fix try_compile +include(polly_ios_bundle_identifier) +set(CMAKE_MACOSX_BUNDLE YES) + +# Verify XCODE_XCCONFIG_FILE +set( + _polly_xcode_xcconfig_file_path + "${CMAKE_CURRENT_LIST_DIR}/scripts/NoCodeSign.xcconfig" +) +if(NOT EXISTS "$ENV{XCODE_XCCONFIG_FILE}") + polly_fatal_error( + "Path specified by XCODE_XCCONFIG_FILE environment variable not found" + "($ENV{XCODE_XCCONFIG_FILE})" + "Use this command to set: " + " export XCODE_XCCONFIG_FILE=${_polly_xcode_xcconfig_file_path}" + ) +else() + string( + COMPARE + NOTEQUAL + "$ENV{XCODE_XCCONFIG_FILE}" + "${_polly_xcode_xcconfig_file_path}" + _polly_wrong_xcconfig_path + ) + if(_polly_wrong_xcconfig_path) + polly_fatal_error( + "Unexpected XCODE_XCCONFIG_FILE value: " + " $ENV{XCODE_XCCONFIG_FILE}" + "expected: " + " ${_polly_xcode_xcconfig_file_path}" + ) + endif() +endif() + +set(IPHONEOS_ARCHS armv7;arm64) +set(IPHONESIMULATOR_ARCHS i386;x86_64) + +include("${CMAKE_CURRENT_LIST_DIR}/compiler/xcode.cmake") +include("${CMAKE_CURRENT_LIST_DIR}/os/iphone.cmake") +include("${CMAKE_CURRENT_LIST_DIR}/flags/cxx11.cmake") diff --git a/tools/polly/ios-nocodesign-10-3.cmake b/tools/polly/ios-nocodesign-10-3.cmake new file mode 100644 index 0000000..4053b61 --- /dev/null +++ b/tools/polly/ios-nocodesign-10-3.cmake @@ -0,0 +1,67 @@ +# Copyright (c) 2014-2016, Ruslan Baratov +# All rights reserved. + +if(DEFINED POLLY_IOS_NOCODESIGN_10_3_CMAKE_) + return() +else() + set(POLLY_IOS_NOCODESIGN_10_3_CMAKE_ 1) +endif() + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_clear_environment_variables.cmake") + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_init.cmake") + +set(IOS_SDK_VERSION 10.3) +set(POLLY_XCODE_COMPILER "clang") +polly_init( + "iOS ${IOS_SDK_VERSION} Universal (iphoneos + iphonesimulator) / \ +${POLLY_XCODE_COMPILER} / \ +No code sign / \ +c++11 support" + "Xcode" +) + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_common.cmake") + +include(polly_fatal_error) + +# Fix try_compile +include(polly_ios_bundle_identifier) +set(CMAKE_MACOSX_BUNDLE YES) + +# Verify XCODE_XCCONFIG_FILE +set( + _polly_xcode_xcconfig_file_path + "${CMAKE_CURRENT_LIST_DIR}/scripts/NoCodeSign.xcconfig" +) +if(NOT EXISTS "$ENV{XCODE_XCCONFIG_FILE}") + polly_fatal_error( + "Path specified by XCODE_XCCONFIG_FILE environment variable not found" + "($ENV{XCODE_XCCONFIG_FILE})" + "Use this command to set: " + " export XCODE_XCCONFIG_FILE=${_polly_xcode_xcconfig_file_path}" + ) +else() + string( + COMPARE + NOTEQUAL + "$ENV{XCODE_XCCONFIG_FILE}" + "${_polly_xcode_xcconfig_file_path}" + _polly_wrong_xcconfig_path + ) + if(_polly_wrong_xcconfig_path) + polly_fatal_error( + "Unexpected XCODE_XCCONFIG_FILE value: " + " $ENV{XCODE_XCCONFIG_FILE}" + "expected: " + " ${_polly_xcode_xcconfig_file_path}" + ) + endif() +endif() + +set(IPHONEOS_ARCHS armv7;armv7s;arm64) +set(IPHONESIMULATOR_ARCHS i386;x86_64) + +include("${CMAKE_CURRENT_LIST_DIR}/compiler/xcode.cmake") +include("${CMAKE_CURRENT_LIST_DIR}/os/iphone.cmake") +include("${CMAKE_CURRENT_LIST_DIR}/flags/cxx11.cmake") diff --git a/tools/polly/ios-nocodesign-11-0-arm64-dep-9-0-device-libcxx-hid-sections.cmake b/tools/polly/ios-nocodesign-11-0-arm64-dep-9-0-device-libcxx-hid-sections.cmake new file mode 100644 index 0000000..fa20756 --- /dev/null +++ b/tools/polly/ios-nocodesign-11-0-arm64-dep-9-0-device-libcxx-hid-sections.cmake @@ -0,0 +1,75 @@ +# Copyright (c) 2015, Tomas Zemaitis +# Copyright (c) 2016, David Hirvonen +# All rights reserved. + +if(DEFINED POLLY_IOS_NOCODESIGN_11_0_ARM64_DEP_9_0_DEVICE_LIBCXX_HID_SECTIONS_CMAKE_) + return() +else() + set(POLLY_IOS_NOCODESIGN_11_0_ARM64_DEP_9_0_DEVICE_LIBCXX_HID_SECTIONS_CMAKE_ 1) +endif() + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_clear_environment_variables.cmake") + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_init.cmake") + +set(IOS_SDK_VERSION 11.0) +set(IOS_DEPLOYMENT_SDK_VERSION 9.0) +set(POLLY_XCODE_COMPILER "clang") + +polly_init( + "iOS ${IOS_SDK_VERSION} / Universal (arm64) / \ +Deployment ${IOS_DEPLOYMENT_SDK_VERSION} / \ +${POLLY_XCODE_COMPILER} / \ +No code sign / \ +c++14 support / hidden / data-sections / function-sections" + "Xcode" +) + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_common.cmake") + +include(polly_fatal_error) + +# Fix try_compile +include(polly_ios_bundle_identifier) +set(CMAKE_MACOSX_BUNDLE YES) + +# Verify XCODE_XCCONFIG_FILE +set( + _polly_xcode_xcconfig_file_path + "${CMAKE_CURRENT_LIST_DIR}/scripts/NoCodeSign.xcconfig" +) +if(NOT EXISTS "$ENV{XCODE_XCCONFIG_FILE}") + polly_fatal_error( + "Path specified by XCODE_XCCONFIG_FILE environment variable not found" + "($ENV{XCODE_XCCONFIG_FILE})" + "Use this command to set: " + " export XCODE_XCCONFIG_FILE=${_polly_xcode_xcconfig_file_path}" + ) +else() + string( + COMPARE + NOTEQUAL + "$ENV{XCODE_XCCONFIG_FILE}" + "${_polly_xcode_xcconfig_file_path}" + _polly_wrong_xcconfig_path + ) + if(_polly_wrong_xcconfig_path) + polly_fatal_error( + "Unexpected XCODE_XCCONFIG_FILE value: " + " $ENV{XCODE_XCCONFIG_FILE}" + "expected: " + " ${_polly_xcode_xcconfig_file_path}" + ) + endif() +endif() + +set(IPHONEOS_ARCHS arm64) +set(IPHONESIMULATOR_ARCHS "") + +include("${CMAKE_CURRENT_LIST_DIR}/compiler/xcode.cmake") +include("${CMAKE_CURRENT_LIST_DIR}/os/iphone.cmake") +include("${CMAKE_CURRENT_LIST_DIR}/library/std/libcxx.cmake") +include("${CMAKE_CURRENT_LIST_DIR}/flags/cxx14.cmake") +include("${CMAKE_CURRENT_LIST_DIR}/flags/hidden.cmake") +include("${CMAKE_CURRENT_LIST_DIR}/flags/function-sections.cmake") +include("${CMAKE_CURRENT_LIST_DIR}/flags/data-sections.cmake") diff --git a/tools/polly/ios-nocodesign-11-0-dep-9-0-bitcode-cxx11.cmake b/tools/polly/ios-nocodesign-11-0-dep-9-0-bitcode-cxx11.cmake new file mode 100644 index 0000000..4fa17bc --- /dev/null +++ b/tools/polly/ios-nocodesign-11-0-dep-9-0-bitcode-cxx11.cmake @@ -0,0 +1,44 @@ +# Copyright (c) 2017, Ruslan Baratov +# All rights reserved. + +if(DEFINED POLLY_IOS_NOCODESIGN_11_0_DEP_9_0_BITCODE_CMAKE_) + return() +else() + set(POLLY_IOS_NOCODESIGN_11_0_DEP_9_0_BITCODE_CMAKE_ 1) +endif() + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_clear_environment_variables.cmake") + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_init.cmake") + +set(IOS_SDK_VERSION 11.0) +set(IOS_DEPLOYMENT_SDK_VERSION 9.0) + +set(POLLY_XCODE_COMPILER "clang") +polly_init( + "iOS ${IOS_SDK_VERSION} / Deployment ${IOS_DEPLOYMENT_SDK_VERSION} / Universal (iphoneos + iphonesimulator) / \ +${POLLY_XCODE_COMPILER} / \ +No code sign / \ +bitcode / \ +c++11 support" + "Xcode" +) + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_common.cmake") + +include(polly_fatal_error) + +# Fix try_compile +include(polly_ios_bundle_identifier) + +set(CMAKE_MACOSX_BUNDLE YES) + +include("${CMAKE_CURRENT_LIST_DIR}/flags/ios_nocodesign.cmake") + +set(IPHONEOS_ARCHS armv7;armv7s;arm64) +set(IPHONESIMULATOR_ARCHS i386;x86_64) + +include("${CMAKE_CURRENT_LIST_DIR}/compiler/xcode.cmake") +include("${CMAKE_CURRENT_LIST_DIR}/os/iphone.cmake") +include("${CMAKE_CURRENT_LIST_DIR}/flags/cxx11.cmake") +include("${CMAKE_CURRENT_LIST_DIR}/flags/bitcode.cmake") # after os/iphone.cmake diff --git a/tools/polly/ios-nocodesign-11-0.cmake b/tools/polly/ios-nocodesign-11-0.cmake new file mode 100644 index 0000000..c4fe917 --- /dev/null +++ b/tools/polly/ios-nocodesign-11-0.cmake @@ -0,0 +1,67 @@ +# Copyright (c) 2014-2016, Ruslan Baratov +# All rights reserved. + +if(DEFINED POLLY_IOS_NOCODESIGN_11_0_CMAKE_) + return() +else() + set(POLLY_IOS_NOCODESIGN_11_0_CMAKE_ 1) +endif() + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_clear_environment_variables.cmake") + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_init.cmake") + +set(IOS_SDK_VERSION 11.0) +set(POLLY_XCODE_COMPILER "clang") +polly_init( + "iOS ${IOS_SDK_VERSION} Universal (iphoneos + iphonesimulator) / \ +${POLLY_XCODE_COMPILER} / \ +No code sign / \ +c++14 support" + "Xcode" +) + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_common.cmake") + +include(polly_fatal_error) + +# Fix try_compile +include(polly_ios_bundle_identifier) +set(CMAKE_MACOSX_BUNDLE YES) + +# Verify XCODE_XCCONFIG_FILE +set( + _polly_xcode_xcconfig_file_path + "${CMAKE_CURRENT_LIST_DIR}/scripts/NoCodeSign.xcconfig" +) +if(NOT EXISTS "$ENV{XCODE_XCCONFIG_FILE}") + polly_fatal_error( + "Path specified by XCODE_XCCONFIG_FILE environment variable not found" + "($ENV{XCODE_XCCONFIG_FILE})" + "Use this command to set: " + " export XCODE_XCCONFIG_FILE=${_polly_xcode_xcconfig_file_path}" + ) +else() + string( + COMPARE + NOTEQUAL + "$ENV{XCODE_XCCONFIG_FILE}" + "${_polly_xcode_xcconfig_file_path}" + _polly_wrong_xcconfig_path + ) + if(_polly_wrong_xcconfig_path) + polly_fatal_error( + "Unexpected XCODE_XCCONFIG_FILE value: " + " $ENV{XCODE_XCCONFIG_FILE}" + "expected: " + " ${_polly_xcode_xcconfig_file_path}" + ) + endif() +endif() + +set(IPHONEOS_ARCHS arm64) +set(IPHONESIMULATOR_ARCHS x86_64) + +include("${CMAKE_CURRENT_LIST_DIR}/compiler/xcode.cmake") +include("${CMAKE_CURRENT_LIST_DIR}/os/iphone.cmake") +include("${CMAKE_CURRENT_LIST_DIR}/flags/cxx14.cmake") diff --git a/tools/polly/ios-nocodesign-11-1-dep-9-0-bitcode-cxx11.cmake b/tools/polly/ios-nocodesign-11-1-dep-9-0-bitcode-cxx11.cmake new file mode 100644 index 0000000..1928638 --- /dev/null +++ b/tools/polly/ios-nocodesign-11-1-dep-9-0-bitcode-cxx11.cmake @@ -0,0 +1,44 @@ +# Copyright (c) 2017, Ruslan Baratov +# All rights reserved. + +if(DEFINED POLLY_IOS_NOCODESIGN_11_1_DEP_9_0_BITCODE_CMAKE_) + return() +else() + set(POLLY_IOS_NOCODESIGN_11_1_DEP_9_0_BITCODE_CMAKE_ 1) +endif() + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_clear_environment_variables.cmake") + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_init.cmake") + +set(IOS_SDK_VERSION 11.1) +set(IOS_DEPLOYMENT_SDK_VERSION 9.0) + +set(POLLY_XCODE_COMPILER "clang") +polly_init( + "iOS ${IOS_SDK_VERSION} / Deployment ${IOS_DEPLOYMENT_SDK_VERSION} / Universal (iphoneos + iphonesimulator) / \ +${POLLY_XCODE_COMPILER} / \ +No code sign / \ +bitcode / \ +c++11 support" + "Xcode" +) + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_common.cmake") + +include(polly_fatal_error) + +# Fix try_compile +include(polly_ios_bundle_identifier) + +set(CMAKE_MACOSX_BUNDLE YES) + +include("${CMAKE_CURRENT_LIST_DIR}/flags/ios_nocodesign.cmake") + +set(IPHONEOS_ARCHS armv7;armv7s;arm64) +set(IPHONESIMULATOR_ARCHS i386;x86_64) + +include("${CMAKE_CURRENT_LIST_DIR}/compiler/xcode.cmake") +include("${CMAKE_CURRENT_LIST_DIR}/os/iphone.cmake") +include("${CMAKE_CURRENT_LIST_DIR}/flags/cxx11.cmake") +include("${CMAKE_CURRENT_LIST_DIR}/flags/bitcode.cmake") # after os/iphone.cmake diff --git a/tools/polly/ios-nocodesign-11-1-dep-9-0-wo-armv7s-bitcode-cxx11.cmake b/tools/polly/ios-nocodesign-11-1-dep-9-0-wo-armv7s-bitcode-cxx11.cmake new file mode 100644 index 0000000..4410dae --- /dev/null +++ b/tools/polly/ios-nocodesign-11-1-dep-9-0-wo-armv7s-bitcode-cxx11.cmake @@ -0,0 +1,45 @@ +# Copyright (c) 2017, Ruslan Baratov +# All rights reserved. + +if(DEFINED POLLY_IOS_NOCODESIGN_11_1_DEP_9_0_WO_ARMV7S_BITCODE_CXX11_CMAKE_) + return() +else() + set(POLLY_IOS_NOCODESIGN_11_1_DEP_9_0_WO_ARMV7S_BITCODE_CXX11_CMAKE_ 1) +endif() + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_clear_environment_variables.cmake") + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_init.cmake") + +set(IOS_SDK_VERSION 11.1) +set(IOS_DEPLOYMENT_SDK_VERSION 9.0) + +set(POLLY_XCODE_COMPILER "clang") +polly_init( + "iOS ${IOS_SDK_VERSION} / Deployment ${IOS_DEPLOYMENT_SDK_VERSION} / Universal (iphoneos + iphonesimulator) / \ +armv7 arm64 / i386 x86_64 / \ +${POLLY_XCODE_COMPILER} / \ +No code sign / \ +bitcode / \ +c++11 support" + "Xcode" +) + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_common.cmake") + +include(polly_fatal_error) + +# Fix try_compile +include(polly_ios_bundle_identifier) + +set(CMAKE_MACOSX_BUNDLE YES) + +include("${CMAKE_CURRENT_LIST_DIR}/flags/ios_nocodesign.cmake") + +set(IPHONEOS_ARCHS armv7;arm64) +set(IPHONESIMULATOR_ARCHS i386;x86_64) + +include("${CMAKE_CURRENT_LIST_DIR}/compiler/xcode.cmake") +include("${CMAKE_CURRENT_LIST_DIR}/os/iphone.cmake") +include("${CMAKE_CURRENT_LIST_DIR}/flags/cxx11.cmake") +include("${CMAKE_CURRENT_LIST_DIR}/flags/bitcode.cmake") # after os/iphone.cmake diff --git a/tools/polly/ios-nocodesign-11-1.cmake b/tools/polly/ios-nocodesign-11-1.cmake new file mode 100644 index 0000000..cda6519 --- /dev/null +++ b/tools/polly/ios-nocodesign-11-1.cmake @@ -0,0 +1,67 @@ +# Copyright (c) 2014-2016, Ruslan Baratov +# All rights reserved. + +if(DEFINED POLLY_IOS_NOCODESIGN_11_1_CMAKE_) + return() +else() + set(POLLY_IOS_NOCODESIGN_11_1_CMAKE_ 1) +endif() + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_clear_environment_variables.cmake") + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_init.cmake") + +set(IOS_SDK_VERSION 11.1) +set(POLLY_XCODE_COMPILER "clang") +polly_init( + "iOS ${IOS_SDK_VERSION} Universal (iphoneos + iphonesimulator) / \ +${POLLY_XCODE_COMPILER} / \ +No code sign / \ +c++14 support" + "Xcode" +) + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_common.cmake") + +include(polly_fatal_error) + +# Fix try_compile +include(polly_ios_bundle_identifier) +set(CMAKE_MACOSX_BUNDLE YES) + +# Verify XCODE_XCCONFIG_FILE +set( + _polly_xcode_xcconfig_file_path + "${CMAKE_CURRENT_LIST_DIR}/scripts/NoCodeSign.xcconfig" +) +if(NOT EXISTS "$ENV{XCODE_XCCONFIG_FILE}") + polly_fatal_error( + "Path specified by XCODE_XCCONFIG_FILE environment variable not found" + "($ENV{XCODE_XCCONFIG_FILE})" + "Use this command to set: " + " export XCODE_XCCONFIG_FILE=${_polly_xcode_xcconfig_file_path}" + ) +else() + string( + COMPARE + NOTEQUAL + "$ENV{XCODE_XCCONFIG_FILE}" + "${_polly_xcode_xcconfig_file_path}" + _polly_wrong_xcconfig_path + ) + if(_polly_wrong_xcconfig_path) + polly_fatal_error( + "Unexpected XCODE_XCCONFIG_FILE value: " + " $ENV{XCODE_XCCONFIG_FILE}" + "expected: " + " ${_polly_xcode_xcconfig_file_path}" + ) + endif() +endif() + +set(IPHONEOS_ARCHS arm64) +set(IPHONESIMULATOR_ARCHS x86_64) + +include("${CMAKE_CURRENT_LIST_DIR}/compiler/xcode.cmake") +include("${CMAKE_CURRENT_LIST_DIR}/os/iphone.cmake") +include("${CMAKE_CURRENT_LIST_DIR}/flags/cxx14.cmake") diff --git a/tools/polly/ios-nocodesign-11-2-dep-8-0-wo-armv7s-bitcode-cxx11.cmake b/tools/polly/ios-nocodesign-11-2-dep-8-0-wo-armv7s-bitcode-cxx11.cmake new file mode 100644 index 0000000..e80248d --- /dev/null +++ b/tools/polly/ios-nocodesign-11-2-dep-8-0-wo-armv7s-bitcode-cxx11.cmake @@ -0,0 +1,45 @@ +# Copyright (c) 2017, Ruslan Baratov +# All rights reserved. + +if(DEFINED POLLY_IOS_NOCODESIGN_11_2_DEP_8_0_WO_ARMV7S_BITCODE_CXX11_CMAKE_) + return() +else() + set(POLLY_IOS_NOCODESIGN_11_2_DEP_8_0_WO_ARMV7S_BITCODE_CXX11_CMAKE_ 1) +endif() + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_clear_environment_variables.cmake") + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_init.cmake") + +set(IOS_SDK_VERSION 11.2) +set(IOS_DEPLOYMENT_SDK_VERSION 8.0) + +set(POLLY_XCODE_COMPILER "clang") +polly_init( + "iOS ${IOS_SDK_VERSION} / Deployment ${IOS_DEPLOYMENT_SDK_VERSION} / Universal (iphoneos + iphonesimulator) / \ +armv7 arm64 / i386 x86_64 / \ +${POLLY_XCODE_COMPILER} / \ +No code sign / \ +bitcode / \ +c++11 support" + "Xcode" +) + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_common.cmake") + +include(polly_fatal_error) + +# Fix try_compile +include(polly_ios_bundle_identifier) + +set(CMAKE_MACOSX_BUNDLE YES) + +include("${CMAKE_CURRENT_LIST_DIR}/flags/ios_nocodesign.cmake") + +set(IPHONEOS_ARCHS armv7;arm64) +set(IPHONESIMULATOR_ARCHS i386;x86_64) + +include("${CMAKE_CURRENT_LIST_DIR}/compiler/xcode.cmake") +include("${CMAKE_CURRENT_LIST_DIR}/os/iphone.cmake") +include("${CMAKE_CURRENT_LIST_DIR}/flags/cxx11.cmake") +include("${CMAKE_CURRENT_LIST_DIR}/flags/bitcode.cmake") # after os/iphone.cmake diff --git a/tools/polly/ios-nocodesign-11-2-dep-9-0-bitcode-cxx11.cmake b/tools/polly/ios-nocodesign-11-2-dep-9-0-bitcode-cxx11.cmake new file mode 100644 index 0000000..67d6571 --- /dev/null +++ b/tools/polly/ios-nocodesign-11-2-dep-9-0-bitcode-cxx11.cmake @@ -0,0 +1,44 @@ +# Copyright (c) 2017, Ruslan Baratov +# All rights reserved. + +if(DEFINED POLLY_IOS_NOCODESIGN_11_2_DEP_9_0_BITCODE_CMAKE_) + return() +else() + set(POLLY_IOS_NOCODESIGN_11_2_DEP_9_0_BITCODE_CMAKE_ 1) +endif() + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_clear_environment_variables.cmake") + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_init.cmake") + +set(IOS_SDK_VERSION 11.2) +set(IOS_DEPLOYMENT_SDK_VERSION 9.0) + +set(POLLY_XCODE_COMPILER "clang") +polly_init( + "iOS ${IOS_SDK_VERSION} / Deployment ${IOS_DEPLOYMENT_SDK_VERSION} / Universal (iphoneos + iphonesimulator) / \ +${POLLY_XCODE_COMPILER} / \ +No code sign / \ +bitcode / \ +c++11 support" + "Xcode" +) + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_common.cmake") + +include(polly_fatal_error) + +# Fix try_compile +include(polly_ios_bundle_identifier) + +set(CMAKE_MACOSX_BUNDLE YES) + +include("${CMAKE_CURRENT_LIST_DIR}/flags/ios_nocodesign.cmake") + +set(IPHONEOS_ARCHS armv7;armv7s;arm64) +set(IPHONESIMULATOR_ARCHS i386;x86_64) + +include("${CMAKE_CURRENT_LIST_DIR}/compiler/xcode.cmake") +include("${CMAKE_CURRENT_LIST_DIR}/os/iphone.cmake") +include("${CMAKE_CURRENT_LIST_DIR}/flags/cxx11.cmake") +include("${CMAKE_CURRENT_LIST_DIR}/flags/bitcode.cmake") # after os/iphone.cmake diff --git a/tools/polly/ios-nocodesign-11-2-dep-9-3-arm64-armv7.cmake b/tools/polly/ios-nocodesign-11-2-dep-9-3-arm64-armv7.cmake new file mode 100644 index 0000000..366157d --- /dev/null +++ b/tools/polly/ios-nocodesign-11-2-dep-9-3-arm64-armv7.cmake @@ -0,0 +1,42 @@ +# Copyright (c) 2017-2018, Ruslan Baratov +# All rights reserved. + +if(DEFINED POLLY_IOS_NOCODESIGN_11_2_DEP_9_3_ARM64_ARMV7_CMAKE_) + return() +else() + set(POLLY_IOS_NOCODESIGN_11_2_DEP_9_3_ARM64_ARMV7_CMAKE_ 1) +endif() + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_clear_environment_variables.cmake") + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_init.cmake") + +set(IOS_SDK_VERSION 11.2) +set(IOS_DEPLOYMENT_SDK_VERSION 9.3) + +set(POLLY_XCODE_COMPILER "clang") +polly_init( + "iOS ${IOS_SDK_VERSION} / Deployment ${IOS_DEPLOYMENT_SDK_VERSION} / Universal (arm64 armv7) / \ +${POLLY_XCODE_COMPILER} / \ +No code sign / \ +c++14 support" + "Xcode" +) + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_common.cmake") + +include(polly_fatal_error) + +# Fix try_compile +include(polly_ios_bundle_identifier) + +set(CMAKE_MACOSX_BUNDLE YES) + +include("${CMAKE_CURRENT_LIST_DIR}/flags/ios_nocodesign.cmake") + +set(IPHONEOS_ARCHS armv7;arm64) +set(IPHONESIMULATOR_ARCHS "") + +include("${CMAKE_CURRENT_LIST_DIR}/compiler/xcode.cmake") +include("${CMAKE_CURRENT_LIST_DIR}/os/iphone.cmake") +include("${CMAKE_CURRENT_LIST_DIR}/flags/cxx14.cmake") diff --git a/tools/polly/ios-nocodesign-11-2-dep-9-3-arm64.cmake b/tools/polly/ios-nocodesign-11-2-dep-9-3-arm64.cmake new file mode 100644 index 0000000..5aaf553 --- /dev/null +++ b/tools/polly/ios-nocodesign-11-2-dep-9-3-arm64.cmake @@ -0,0 +1,42 @@ +# Copyright (c) 2017-2018, Ruslan Baratov +# All rights reserved. + +if(DEFINED POLLY_IOS_NOCODESIGN_11_2_DEP_9_3_ARM64_CMAKE_) + return() +else() + set(POLLY_IOS_NOCODESIGN_11_2_DEP_9_3_ARM64_CMAKE_ 1) +endif() + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_clear_environment_variables.cmake") + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_init.cmake") + +set(IOS_SDK_VERSION 11.2) +set(IOS_DEPLOYMENT_SDK_VERSION 9.3) + +set(POLLY_XCODE_COMPILER "clang") +polly_init( + "iOS ${IOS_SDK_VERSION} / Deployment ${IOS_DEPLOYMENT_SDK_VERSION} / arm64 / \ +${POLLY_XCODE_COMPILER} / \ +No code sign / \ +c++14 support" + "Xcode" +) + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_common.cmake") + +include(polly_fatal_error) + +# Fix try_compile +include(polly_ios_bundle_identifier) + +set(CMAKE_MACOSX_BUNDLE YES) + +include("${CMAKE_CURRENT_LIST_DIR}/flags/ios_nocodesign.cmake") + +set(IPHONEOS_ARCHS arm64) +set(IPHONESIMULATOR_ARCHS "") + +include("${CMAKE_CURRENT_LIST_DIR}/compiler/xcode.cmake") +include("${CMAKE_CURRENT_LIST_DIR}/os/iphone.cmake") +include("${CMAKE_CURRENT_LIST_DIR}/flags/cxx14.cmake") diff --git a/tools/polly/ios-nocodesign-11-2-dep-9-3-armv7.cmake b/tools/polly/ios-nocodesign-11-2-dep-9-3-armv7.cmake new file mode 100644 index 0000000..8eb0ad2 --- /dev/null +++ b/tools/polly/ios-nocodesign-11-2-dep-9-3-armv7.cmake @@ -0,0 +1,42 @@ +# Copyright (c) 2017-2018, Ruslan Baratov +# All rights reserved. + +if(DEFINED POLLY_IOS_NOCODESIGN_11_2_DEP_9_3_ARMV7_CMAKE_) + return() +else() + set(POLLY_IOS_NOCODESIGN_11_2_DEP_9_3_ARMV7_CMAKE_ 1) +endif() + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_clear_environment_variables.cmake") + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_init.cmake") + +set(IOS_SDK_VERSION 11.2) +set(IOS_DEPLOYMENT_SDK_VERSION 9.3) + +set(POLLY_XCODE_COMPILER "clang") +polly_init( + "iOS ${IOS_SDK_VERSION} / Deployment ${IOS_DEPLOYMENT_SDK_VERSION} / armv7 / \ +${POLLY_XCODE_COMPILER} / \ +No code sign / \ +c++14 support" + "Xcode" +) + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_common.cmake") + +include(polly_fatal_error) + +# Fix try_compile +include(polly_ios_bundle_identifier) + +set(CMAKE_MACOSX_BUNDLE YES) + +include("${CMAKE_CURRENT_LIST_DIR}/flags/ios_nocodesign.cmake") + +set(IPHONEOS_ARCHS armv7) +set(IPHONESIMULATOR_ARCHS "") + +include("${CMAKE_CURRENT_LIST_DIR}/compiler/xcode.cmake") +include("${CMAKE_CURRENT_LIST_DIR}/os/iphone.cmake") +include("${CMAKE_CURRENT_LIST_DIR}/flags/cxx14.cmake") diff --git a/tools/polly/ios-nocodesign-11-2-dep-9-3-i386-armv7.cmake b/tools/polly/ios-nocodesign-11-2-dep-9-3-i386-armv7.cmake new file mode 100644 index 0000000..4339879 --- /dev/null +++ b/tools/polly/ios-nocodesign-11-2-dep-9-3-i386-armv7.cmake @@ -0,0 +1,43 @@ +# Copyright (c) 2017-2018, Ruslan Baratov +# All rights reserved. + +if(DEFINED POLLY_IOS_NOCODESIGN_11_2_DEP_9_3_I386_ARMV7_CMAKE_) + return() +else() + set(POLLY_IOS_NOCODESIGN_11_2_DEP_9_3_I386_ARMV7_CMAKE_ 1) +endif() + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_clear_environment_variables.cmake") + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_init.cmake") + +set(IOS_SDK_VERSION 11.2) +set(IOS_DEPLOYMENT_SDK_VERSION 9.3) + +set(POLLY_XCODE_COMPILER "clang") +polly_init( + "iOS ${IOS_SDK_VERSION} / Deployment ${IOS_DEPLOYMENT_SDK_VERSION} / \ +${POLLY_XCODE_COMPILER} / \ +i386 / armv7 / \ +No code sign / \ +c++14 support" + "Xcode" +) + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_common.cmake") + +include(polly_fatal_error) + +# Fix try_compile +include(polly_ios_bundle_identifier) + +set(CMAKE_MACOSX_BUNDLE YES) + +include("${CMAKE_CURRENT_LIST_DIR}/flags/ios_nocodesign.cmake") + +set(IPHONEOS_ARCHS armv7) +set(IPHONESIMULATOR_ARCHS i386) + +include("${CMAKE_CURRENT_LIST_DIR}/compiler/xcode.cmake") +include("${CMAKE_CURRENT_LIST_DIR}/os/iphone.cmake") +include("${CMAKE_CURRENT_LIST_DIR}/flags/cxx14.cmake") diff --git a/tools/polly/ios-nocodesign-11-2-dep-9-3.cmake b/tools/polly/ios-nocodesign-11-2-dep-9-3.cmake new file mode 100644 index 0000000..ab41103 --- /dev/null +++ b/tools/polly/ios-nocodesign-11-2-dep-9-3.cmake @@ -0,0 +1,42 @@ +# Copyright (c) 2017-2018, Ruslan Baratov +# All rights reserved. + +if(DEFINED POLLY_IOS_NOCODESIGN_11_2_DEP_9_3_CMAKE_) + return() +else() + set(POLLY_IOS_NOCODESIGN_11_2_DEP_9_3_CMAKE_ 1) +endif() + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_clear_environment_variables.cmake") + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_init.cmake") + +set(IOS_SDK_VERSION 11.2) +set(IOS_DEPLOYMENT_SDK_VERSION 9.3) + +set(POLLY_XCODE_COMPILER "clang") +polly_init( + "iOS ${IOS_SDK_VERSION} / Deployment ${IOS_DEPLOYMENT_SDK_VERSION} / Universal (iphoneos + iphonesimulator) / \ +${POLLY_XCODE_COMPILER} / \ +No code sign / \ +c++14 support" + "Xcode" +) + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_common.cmake") + +include(polly_fatal_error) + +# Fix try_compile +include(polly_ios_bundle_identifier) + +set(CMAKE_MACOSX_BUNDLE YES) + +include("${CMAKE_CURRENT_LIST_DIR}/flags/ios_nocodesign.cmake") + +set(IPHONEOS_ARCHS armv7;armv7s;arm64) +set(IPHONESIMULATOR_ARCHS i386;x86_64) + +include("${CMAKE_CURRENT_LIST_DIR}/compiler/xcode.cmake") +include("${CMAKE_CURRENT_LIST_DIR}/os/iphone.cmake") +include("${CMAKE_CURRENT_LIST_DIR}/flags/cxx14.cmake") diff --git a/tools/polly/ios-nocodesign-11-2.cmake b/tools/polly/ios-nocodesign-11-2.cmake new file mode 100644 index 0000000..efef5c3 --- /dev/null +++ b/tools/polly/ios-nocodesign-11-2.cmake @@ -0,0 +1,67 @@ +# Copyright (c) 2014-2016, Ruslan Baratov +# All rights reserved. + +if(DEFINED POLLY_IOS_NOCODESIGN_11_2_CMAKE_) + return() +else() + set(POLLY_IOS_NOCODESIGN_11_2_CMAKE_ 1) +endif() + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_clear_environment_variables.cmake") + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_init.cmake") + +set(IOS_SDK_VERSION 11.2) +set(POLLY_XCODE_COMPILER "clang") +polly_init( + "iOS ${IOS_SDK_VERSION} Universal (iphoneos + iphonesimulator) / \ +${POLLY_XCODE_COMPILER} / \ +No code sign / \ +c++14 support" + "Xcode" +) + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_common.cmake") + +include(polly_fatal_error) + +# Fix try_compile +include(polly_ios_bundle_identifier) +set(CMAKE_MACOSX_BUNDLE YES) + +# Verify XCODE_XCCONFIG_FILE +set( + _polly_xcode_xcconfig_file_path + "${CMAKE_CURRENT_LIST_DIR}/scripts/NoCodeSign.xcconfig" +) +if(NOT EXISTS "$ENV{XCODE_XCCONFIG_FILE}") + polly_fatal_error( + "Path specified by XCODE_XCCONFIG_FILE environment variable not found" + "($ENV{XCODE_XCCONFIG_FILE})" + "Use this command to set: " + " export XCODE_XCCONFIG_FILE=${_polly_xcode_xcconfig_file_path}" + ) +else() + string( + COMPARE + NOTEQUAL + "$ENV{XCODE_XCCONFIG_FILE}" + "${_polly_xcode_xcconfig_file_path}" + _polly_wrong_xcconfig_path + ) + if(_polly_wrong_xcconfig_path) + polly_fatal_error( + "Unexpected XCODE_XCCONFIG_FILE value: " + " $ENV{XCODE_XCCONFIG_FILE}" + "expected: " + " ${_polly_xcode_xcconfig_file_path}" + ) + endif() +endif() + +set(IPHONEOS_ARCHS arm64) +set(IPHONESIMULATOR_ARCHS x86_64) + +include("${CMAKE_CURRENT_LIST_DIR}/compiler/xcode.cmake") +include("${CMAKE_CURRENT_LIST_DIR}/os/iphone.cmake") +include("${CMAKE_CURRENT_LIST_DIR}/flags/cxx14.cmake") diff --git a/tools/polly/ios-nocodesign-11-3-dep-9-0-bitcode-cxx11.cmake b/tools/polly/ios-nocodesign-11-3-dep-9-0-bitcode-cxx11.cmake new file mode 100644 index 0000000..38a3f2e --- /dev/null +++ b/tools/polly/ios-nocodesign-11-3-dep-9-0-bitcode-cxx11.cmake @@ -0,0 +1,44 @@ +# Copyright (c) 2017, Ruslan Baratov +# All rights reserved. + +if(DEFINED POLLY_IOS_NOCODESIGN_11_3_DEP_9_0_BITCODE_CMAKE_) + return() +else() + set(POLLY_IOS_NOCODESIGN_11_3_DEP_9_0_BITCODE_CMAKE_ 1) +endif() + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_clear_environment_variables.cmake") + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_init.cmake") + +set(IOS_SDK_VERSION 11.3) +set(IOS_DEPLOYMENT_SDK_VERSION 9.0) + +set(POLLY_XCODE_COMPILER "clang") +polly_init( + "iOS ${IOS_SDK_VERSION} / Deployment ${IOS_DEPLOYMENT_SDK_VERSION} / Universal (iphoneos + iphonesimulator) / \ +${POLLY_XCODE_COMPILER} / \ +No code sign / \ +bitcode / \ +c++11 support" + "Xcode" +) + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_common.cmake") + +include(polly_fatal_error) + +# Fix try_compile +include(polly_ios_bundle_identifier) + +set(CMAKE_MACOSX_BUNDLE YES) + +include("${CMAKE_CURRENT_LIST_DIR}/flags/ios_nocodesign.cmake") + +set(IPHONEOS_ARCHS armv7;armv7s;arm64) +set(IPHONESIMULATOR_ARCHS i386;x86_64) + +include("${CMAKE_CURRENT_LIST_DIR}/compiler/xcode.cmake") +include("${CMAKE_CURRENT_LIST_DIR}/os/iphone.cmake") +include("${CMAKE_CURRENT_LIST_DIR}/flags/cxx11.cmake") +include("${CMAKE_CURRENT_LIST_DIR}/flags/bitcode.cmake") # after os/iphone.cmake diff --git a/tools/polly/ios-nocodesign-11-3-dep-9-3-arm64.cmake b/tools/polly/ios-nocodesign-11-3-dep-9-3-arm64.cmake new file mode 100644 index 0000000..4e535f9 --- /dev/null +++ b/tools/polly/ios-nocodesign-11-3-dep-9-3-arm64.cmake @@ -0,0 +1,42 @@ +# Copyright (c) 2017-2018, Ruslan Baratov +# All rights reserved. + +if(DEFINED POLLY_IOS_NOCODESIGN_11_3_DEP_9_3_ARM64_CMAKE_) + return() +else() + set(POLLY_IOS_NOCODESIGN_11_3_DEP_9_3_ARM64_CMAKE_ 1) +endif() + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_clear_environment_variables.cmake") + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_init.cmake") + +set(IOS_SDK_VERSION 11.3) +set(IOS_DEPLOYMENT_SDK_VERSION 9.3) + +set(POLLY_XCODE_COMPILER "clang") +polly_init( + "iOS ${IOS_SDK_VERSION} / Deployment ${IOS_DEPLOYMENT_SDK_VERSION} / arm64 / \ +${POLLY_XCODE_COMPILER} / \ +No code sign / \ +c++14 support" + "Xcode" +) + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_common.cmake") + +include(polly_fatal_error) + +# Fix try_compile +include(polly_ios_bundle_identifier) + +set(CMAKE_MACOSX_BUNDLE YES) + +include("${CMAKE_CURRENT_LIST_DIR}/flags/ios_nocodesign.cmake") + +set(IPHONEOS_ARCHS arm64) +set(IPHONESIMULATOR_ARCHS "") + +include("${CMAKE_CURRENT_LIST_DIR}/compiler/xcode.cmake") +include("${CMAKE_CURRENT_LIST_DIR}/os/iphone.cmake") +include("${CMAKE_CURRENT_LIST_DIR}/flags/cxx14.cmake") diff --git a/tools/polly/ios-nocodesign-11-3-dep-9-3-armv7.cmake b/tools/polly/ios-nocodesign-11-3-dep-9-3-armv7.cmake new file mode 100644 index 0000000..2232022 --- /dev/null +++ b/tools/polly/ios-nocodesign-11-3-dep-9-3-armv7.cmake @@ -0,0 +1,42 @@ +# Copyright (c) 2017-2018, Ruslan Baratov +# All rights reserved. + +if(DEFINED POLLY_IOS_NOCODESIGN_11_3_DEP_9_3_ARMV7_CMAKE_) + return() +else() + set(POLLY_IOS_NOCODESIGN_11_3_DEP_9_3_ARMV7_CMAKE_ 1) +endif() + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_clear_environment_variables.cmake") + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_init.cmake") + +set(IOS_SDK_VERSION 11.3) +set(IOS_DEPLOYMENT_SDK_VERSION 9.3) + +set(POLLY_XCODE_COMPILER "clang") +polly_init( + "iOS ${IOS_SDK_VERSION} / Deployment ${IOS_DEPLOYMENT_SDK_VERSION} / armv7 / \ +${POLLY_XCODE_COMPILER} / \ +No code sign / \ +c++14 support" + "Xcode" +) + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_common.cmake") + +include(polly_fatal_error) + +# Fix try_compile +include(polly_ios_bundle_identifier) + +set(CMAKE_MACOSX_BUNDLE YES) + +include("${CMAKE_CURRENT_LIST_DIR}/flags/ios_nocodesign.cmake") + +set(IPHONEOS_ARCHS armv7) +set(IPHONESIMULATOR_ARCHS "") + +include("${CMAKE_CURRENT_LIST_DIR}/compiler/xcode.cmake") +include("${CMAKE_CURRENT_LIST_DIR}/os/iphone.cmake") +include("${CMAKE_CURRENT_LIST_DIR}/flags/cxx14.cmake") diff --git a/tools/polly/ios-nocodesign-11-3-dep-9-3.cmake b/tools/polly/ios-nocodesign-11-3-dep-9-3.cmake new file mode 100644 index 0000000..a483068 --- /dev/null +++ b/tools/polly/ios-nocodesign-11-3-dep-9-3.cmake @@ -0,0 +1,42 @@ +# Copyright (c) 2017-2018, Ruslan Baratov +# All rights reserved. + +if(DEFINED POLLY_IOS_NOCODESIGN_11_3_DEP_9_3_CMAKE_) + return() +else() + set(POLLY_IOS_NOCODESIGN_11_3_DEP_9_3_CMAKE_ 1) +endif() + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_clear_environment_variables.cmake") + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_init.cmake") + +set(IOS_SDK_VERSION 11.3) +set(IOS_DEPLOYMENT_SDK_VERSION 9.3) + +set(POLLY_XCODE_COMPILER "clang") +polly_init( + "iOS ${IOS_SDK_VERSION} / Deployment ${IOS_DEPLOYMENT_SDK_VERSION} / Universal (iphoneos + iphonesimulator) / \ +${POLLY_XCODE_COMPILER} / \ +No code sign / \ +c++14 support" + "Xcode" +) + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_common.cmake") + +include(polly_fatal_error) + +# Fix try_compile +include(polly_ios_bundle_identifier) + +set(CMAKE_MACOSX_BUNDLE YES) + +include("${CMAKE_CURRENT_LIST_DIR}/flags/ios_nocodesign.cmake") + +set(IPHONEOS_ARCHS armv7;armv7s;arm64) +set(IPHONESIMULATOR_ARCHS i386;x86_64) + +include("${CMAKE_CURRENT_LIST_DIR}/compiler/xcode.cmake") +include("${CMAKE_CURRENT_LIST_DIR}/os/iphone.cmake") +include("${CMAKE_CURRENT_LIST_DIR}/flags/cxx14.cmake") diff --git a/tools/polly/ios-nocodesign-11-4-dep-9-0-bitcode-cxx11.cmake b/tools/polly/ios-nocodesign-11-4-dep-9-0-bitcode-cxx11.cmake new file mode 100644 index 0000000..86f2da0 --- /dev/null +++ b/tools/polly/ios-nocodesign-11-4-dep-9-0-bitcode-cxx11.cmake @@ -0,0 +1,44 @@ +# Copyright (c) 2017, Ruslan Baratov +# All rights reserved. + +if(DEFINED POLLY_IOS_NOCODESIGN_11_4_DEP_9_0_BITCODE_CMAKE_) + return() +else() + set(POLLY_IOS_NOCODESIGN_11_4_DEP_9_0_BITCODE_CMAKE_ 1) +endif() + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_clear_environment_variables.cmake") + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_init.cmake") + +set(IOS_SDK_VERSION 11.4) +set(IOS_DEPLOYMENT_SDK_VERSION 9.0) + +set(POLLY_XCODE_COMPILER "clang") +polly_init( + "iOS ${IOS_SDK_VERSION} / Deployment ${IOS_DEPLOYMENT_SDK_VERSION} / Universal (iphoneos + iphonesimulator) / \ +${POLLY_XCODE_COMPILER} / \ +No code sign / \ +bitcode / \ +c++11 support" + "Xcode" +) + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_common.cmake") + +include(polly_fatal_error) + +# Fix try_compile +include(polly_ios_bundle_identifier) + +set(CMAKE_MACOSX_BUNDLE YES) + +include("${CMAKE_CURRENT_LIST_DIR}/flags/ios_nocodesign.cmake") + +set(IPHONEOS_ARCHS armv7;armv7s;arm64) +set(IPHONESIMULATOR_ARCHS i386;x86_64) + +include("${CMAKE_CURRENT_LIST_DIR}/compiler/xcode.cmake") +include("${CMAKE_CURRENT_LIST_DIR}/os/iphone.cmake") +include("${CMAKE_CURRENT_LIST_DIR}/flags/cxx11.cmake") +include("${CMAKE_CURRENT_LIST_DIR}/flags/bitcode.cmake") # after os/iphone.cmake diff --git a/tools/polly/ios-nocodesign-11-4-dep-9-3-arm64.cmake b/tools/polly/ios-nocodesign-11-4-dep-9-3-arm64.cmake new file mode 100644 index 0000000..5f9ec7b --- /dev/null +++ b/tools/polly/ios-nocodesign-11-4-dep-9-3-arm64.cmake @@ -0,0 +1,42 @@ +# Copyright (c) 2017-2018, Ruslan Baratov +# All rights reserved. + +if(DEFINED POLLY_IOS_NOCODESIGN_11_4_DEP_9_3_ARM64_CMAKE_) + return() +else() + set(POLLY_IOS_NOCODESIGN_11_4_DEP_9_3_ARM64_CMAKE_ 1) +endif() + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_clear_environment_variables.cmake") + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_init.cmake") + +set(IOS_SDK_VERSION 11.4) +set(IOS_DEPLOYMENT_SDK_VERSION 9.3) + +set(POLLY_XCODE_COMPILER "clang") +polly_init( + "iOS ${IOS_SDK_VERSION} / Deployment ${IOS_DEPLOYMENT_SDK_VERSION} / arm64 / \ +${POLLY_XCODE_COMPILER} / \ +No code sign / \ +c++14 support" + "Xcode" +) + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_common.cmake") + +include(polly_fatal_error) + +# Fix try_compile +include(polly_ios_bundle_identifier) + +set(CMAKE_MACOSX_BUNDLE YES) + +include("${CMAKE_CURRENT_LIST_DIR}/flags/ios_nocodesign.cmake") + +set(IPHONEOS_ARCHS arm64) +set(IPHONESIMULATOR_ARCHS "") + +include("${CMAKE_CURRENT_LIST_DIR}/compiler/xcode.cmake") +include("${CMAKE_CURRENT_LIST_DIR}/os/iphone.cmake") +include("${CMAKE_CURRENT_LIST_DIR}/flags/cxx14.cmake") diff --git a/tools/polly/ios-nocodesign-11-4-dep-9-3-armv7.cmake b/tools/polly/ios-nocodesign-11-4-dep-9-3-armv7.cmake new file mode 100644 index 0000000..1c37696 --- /dev/null +++ b/tools/polly/ios-nocodesign-11-4-dep-9-3-armv7.cmake @@ -0,0 +1,42 @@ +# Copyright (c) 2017-2018, Ruslan Baratov +# All rights reserved. + +if(DEFINED POLLY_IOS_NOCODESIGN_11_4_DEP_9_3_ARMV7_CMAKE_) + return() +else() + set(POLLY_IOS_NOCODESIGN_11_4_DEP_9_3_ARMV7_CMAKE_ 1) +endif() + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_clear_environment_variables.cmake") + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_init.cmake") + +set(IOS_SDK_VERSION 11.4) +set(IOS_DEPLOYMENT_SDK_VERSION 9.3) + +set(POLLY_XCODE_COMPILER "clang") +polly_init( + "iOS ${IOS_SDK_VERSION} / Deployment ${IOS_DEPLOYMENT_SDK_VERSION} / armv7 / \ +${POLLY_XCODE_COMPILER} / \ +No code sign / \ +c++14 support" + "Xcode" +) + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_common.cmake") + +include(polly_fatal_error) + +# Fix try_compile +include(polly_ios_bundle_identifier) + +set(CMAKE_MACOSX_BUNDLE YES) + +include("${CMAKE_CURRENT_LIST_DIR}/flags/ios_nocodesign.cmake") + +set(IPHONEOS_ARCHS armv7) +set(IPHONESIMULATOR_ARCHS "") + +include("${CMAKE_CURRENT_LIST_DIR}/compiler/xcode.cmake") +include("${CMAKE_CURRENT_LIST_DIR}/os/iphone.cmake") +include("${CMAKE_CURRENT_LIST_DIR}/flags/cxx14.cmake") diff --git a/tools/polly/ios-nocodesign-11-4-dep-9-3.cmake b/tools/polly/ios-nocodesign-11-4-dep-9-3.cmake new file mode 100644 index 0000000..cb81e20 --- /dev/null +++ b/tools/polly/ios-nocodesign-11-4-dep-9-3.cmake @@ -0,0 +1,42 @@ +# Copyright (c) 2017-2018, Ruslan Baratov +# All rights reserved. + +if(DEFINED POLLY_IOS_NOCODESIGN_11_4_DEP_9_3_CMAKE_) + return() +else() + set(POLLY_IOS_NOCODESIGN_11_4_DEP_9_3_CMAKE_ 1) +endif() + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_clear_environment_variables.cmake") + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_init.cmake") + +set(IOS_SDK_VERSION 11.4) +set(IOS_DEPLOYMENT_SDK_VERSION 9.3) + +set(POLLY_XCODE_COMPILER "clang") +polly_init( + "iOS ${IOS_SDK_VERSION} / Deployment ${IOS_DEPLOYMENT_SDK_VERSION} / Universal (iphoneos + iphonesimulator) / \ +${POLLY_XCODE_COMPILER} / \ +No code sign / \ +c++14 support" + "Xcode" +) + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_common.cmake") + +include(polly_fatal_error) + +# Fix try_compile +include(polly_ios_bundle_identifier) + +set(CMAKE_MACOSX_BUNDLE YES) + +include("${CMAKE_CURRENT_LIST_DIR}/flags/ios_nocodesign.cmake") + +set(IPHONEOS_ARCHS armv7;armv7s;arm64) +set(IPHONESIMULATOR_ARCHS i386;x86_64) + +include("${CMAKE_CURRENT_LIST_DIR}/compiler/xcode.cmake") +include("${CMAKE_CURRENT_LIST_DIR}/os/iphone.cmake") +include("${CMAKE_CURRENT_LIST_DIR}/flags/cxx14.cmake") diff --git a/tools/polly/ios-nocodesign-12-0-dep-9-0-bitcode-cxx11.cmake b/tools/polly/ios-nocodesign-12-0-dep-9-0-bitcode-cxx11.cmake new file mode 100644 index 0000000..93d6585 --- /dev/null +++ b/tools/polly/ios-nocodesign-12-0-dep-9-0-bitcode-cxx11.cmake @@ -0,0 +1,44 @@ +# Copyright (c) 2017, Ruslan Baratov +# All rights reserved. + +if(DEFINED POLLY_IOS_NOCODESIGN_12_0_DEP_9_0_BITCODE_CMAKE_) + return() +else() + set(POLLY_IOS_NOCODESIGN_12_0_DEP_9_0_BITCODE_CMAKE_ 1) +endif() + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_clear_environment_variables.cmake") + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_init.cmake") + +set(IOS_SDK_VERSION 12.0) +set(IOS_DEPLOYMENT_SDK_VERSION 9.0) + +set(POLLY_XCODE_COMPILER "clang") +polly_init( + "iOS ${IOS_SDK_VERSION} / Deployment ${IOS_DEPLOYMENT_SDK_VERSION} / Universal (iphoneos + iphonesimulator) / \ +${POLLY_XCODE_COMPILER} / \ +No code sign / \ +bitcode / \ +c++11 support" + "Xcode" +) + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_common.cmake") + +include(polly_fatal_error) + +# Fix try_compile +include(polly_ios_bundle_identifier) + +set(CMAKE_MACOSX_BUNDLE YES) + +include("${CMAKE_CURRENT_LIST_DIR}/flags/ios_nocodesign.cmake") + +set(IPHONEOS_ARCHS armv7;armv7s;arm64) +set(IPHONESIMULATOR_ARCHS i386;x86_64) + +include("${CMAKE_CURRENT_LIST_DIR}/compiler/xcode.cmake") +include("${CMAKE_CURRENT_LIST_DIR}/os/iphone.cmake") +include("${CMAKE_CURRENT_LIST_DIR}/flags/cxx11.cmake") +include("${CMAKE_CURRENT_LIST_DIR}/flags/bitcode.cmake") # after os/iphone.cmake diff --git a/tools/polly/ios-nocodesign-12-1-dep-9-3-armv7.cmake b/tools/polly/ios-nocodesign-12-1-dep-9-3-armv7.cmake new file mode 100644 index 0000000..153852f --- /dev/null +++ b/tools/polly/ios-nocodesign-12-1-dep-9-3-armv7.cmake @@ -0,0 +1,42 @@ +# Copyright (c) 2017-2018, Ruslan Baratov +# All rights reserved. + +if(DEFINED POLLY_IOS_NOCODESIGN_12_1_DEP_9_3_ARMV7_CMAKE_) + return() +else() + set(POLLY_IOS_NOCODESIGN_12_1_DEP_9_3_ARMV7_CMAKE_ 1) +endif() + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_clear_environment_variables.cmake") + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_init.cmake") + +set(IOS_SDK_VERSION 12.1) +set(IOS_DEPLOYMENT_SDK_VERSION 9.3) + +set(POLLY_XCODE_COMPILER "clang") +polly_init( + "iOS ${IOS_SDK_VERSION} / Deployment ${IOS_DEPLOYMENT_SDK_VERSION} / armv7 / \ +${POLLY_XCODE_COMPILER} / \ +No code sign / \ +c++14 support" + "Xcode" +) + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_common.cmake") + +include(polly_fatal_error) + +# Fix try_compile +include(polly_ios_bundle_identifier) + +set(CMAKE_MACOSX_BUNDLE YES) + +include("${CMAKE_CURRENT_LIST_DIR}/flags/ios_nocodesign.cmake") + +set(IPHONEOS_ARCHS armv7) +set(IPHONESIMULATOR_ARCHS "") + +include("${CMAKE_CURRENT_LIST_DIR}/compiler/xcode.cmake") +include("${CMAKE_CURRENT_LIST_DIR}/os/iphone.cmake") +include("${CMAKE_CURRENT_LIST_DIR}/flags/cxx14.cmake") diff --git a/tools/polly/ios-nocodesign-8-1.cmake b/tools/polly/ios-nocodesign-8-1.cmake new file mode 100644 index 0000000..6cfce5c --- /dev/null +++ b/tools/polly/ios-nocodesign-8-1.cmake @@ -0,0 +1,67 @@ +# Copyright (c) 2014, Ruslan Baratov +# All rights reserved. + +if(DEFINED POLLY_IOS_NOCODESIGN_8_1_CMAKE_) + return() +else() + set(POLLY_IOS_NOCODESIGN_8_1_CMAKE_ 1) +endif() + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_clear_environment_variables.cmake") + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_init.cmake") + +set(IOS_SDK_VERSION 8.1) +set(POLLY_XCODE_COMPILER "clang") +polly_init( + "iOS ${IOS_SDK_VERSION} Universal (iphoneos + iphonesimulator) / \ +${POLLY_XCODE_COMPILER} / \ +No code sign / \ +c++11 support" + "Xcode" +) + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_common.cmake") + +include(polly_fatal_error) + +# Fix try_compile +include(polly_ios_bundle_identifier) +set(CMAKE_MACOSX_BUNDLE YES) + +# Verify XCODE_XCCONFIG_FILE +set( + _polly_xcode_xcconfig_file_path + "${CMAKE_CURRENT_LIST_DIR}/scripts/NoCodeSign.xcconfig" +) +if(NOT EXISTS "$ENV{XCODE_XCCONFIG_FILE}") + polly_fatal_error( + "Path specified by XCODE_XCCONFIG_FILE environment variable not found" + "($ENV{XCODE_XCCONFIG_FILE})" + "Use this command to set: " + " export XCODE_XCCONFIG_FILE=${_polly_xcode_xcconfig_file_path}" + ) +else() + string( + COMPARE + NOTEQUAL + "$ENV{XCODE_XCCONFIG_FILE}" + "${_polly_xcode_xcconfig_file_path}" + _polly_wrong_xcconfig_path + ) + if(_polly_wrong_xcconfig_path) + polly_fatal_error( + "Unexpected XCODE_XCCONFIG_FILE value: " + " $ENV{XCODE_XCCONFIG_FILE}" + "expected: " + " ${_polly_xcode_xcconfig_file_path}" + ) + endif() +endif() + +set(IPHONEOS_ARCHS armv7;armv7s;arm64) +set(IPHONESIMULATOR_ARCHS i386;x86_64) + +include("${CMAKE_CURRENT_LIST_DIR}/compiler/xcode.cmake") +include("${CMAKE_CURRENT_LIST_DIR}/os/iphone.cmake") +include("${CMAKE_CURRENT_LIST_DIR}/flags/cxx11.cmake") diff --git a/tools/polly/ios-nocodesign-8-4.cmake b/tools/polly/ios-nocodesign-8-4.cmake new file mode 100644 index 0000000..9b87e07 --- /dev/null +++ b/tools/polly/ios-nocodesign-8-4.cmake @@ -0,0 +1,67 @@ +# Copyright (c) 2014-2016, Ruslan Baratov +# All rights reserved. + +if(DEFINED POLLY_IOS_NOCODESIGN_8_4_CMAKE_) + return() +else() + set(POLLY_IOS_NOCODESIGN_8_4_CMAKE_ 1) +endif() + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_clear_environment_variables.cmake") + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_init.cmake") + +set(IOS_SDK_VERSION 8.4) +set(POLLY_XCODE_COMPILER "clang") +polly_init( + "iOS ${IOS_SDK_VERSION} Universal (iphoneos + iphonesimulator) / \ +${POLLY_XCODE_COMPILER} / \ +No code sign / \ +c++11 support" + "Xcode" +) + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_common.cmake") + +include(polly_fatal_error) + +# Fix try_compile +include(polly_ios_bundle_identifier) +set(CMAKE_MACOSX_BUNDLE YES) + +# Verify XCODE_XCCONFIG_FILE +set( + _polly_xcode_xcconfig_file_path + "${CMAKE_CURRENT_LIST_DIR}/scripts/NoCodeSign.xcconfig" +) +if(NOT EXISTS "$ENV{XCODE_XCCONFIG_FILE}") + polly_fatal_error( + "Path specified by XCODE_XCCONFIG_FILE environment variable not found" + "($ENV{XCODE_XCCONFIG_FILE})" + "Use this command to set: " + " export XCODE_XCCONFIG_FILE=${_polly_xcode_xcconfig_file_path}" + ) +else() + string( + COMPARE + NOTEQUAL + "$ENV{XCODE_XCCONFIG_FILE}" + "${_polly_xcode_xcconfig_file_path}" + _polly_wrong_xcconfig_path + ) + if(_polly_wrong_xcconfig_path) + polly_fatal_error( + "Unexpected XCODE_XCCONFIG_FILE value: " + " $ENV{XCODE_XCCONFIG_FILE}" + "expected: " + " ${_polly_xcode_xcconfig_file_path}" + ) + endif() +endif() + +set(IPHONEOS_ARCHS armv7;armv7s;arm64) +set(IPHONESIMULATOR_ARCHS i386;x86_64) + +include("${CMAKE_CURRENT_LIST_DIR}/compiler/xcode.cmake") +include("${CMAKE_CURRENT_LIST_DIR}/os/iphone.cmake") +include("${CMAKE_CURRENT_LIST_DIR}/flags/cxx11.cmake") diff --git a/tools/polly/ios-nocodesign-9-1-arm64.cmake b/tools/polly/ios-nocodesign-9-1-arm64.cmake new file mode 100644 index 0000000..aa6a75e --- /dev/null +++ b/tools/polly/ios-nocodesign-9-1-arm64.cmake @@ -0,0 +1,67 @@ +# Copyright (c) 2015, Ruslan Baratov & Luca Martini +# All rights reserved. + +if(DEFINED POLLY_IOS_NOCODESIGN_9_1_ARM64_CMAKE) + return() +else() + set(POLLY_IOS_NOCODESIGN_9_1_ARM64_CMAKE 1) +endif() + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_clear_environment_variables.cmake") + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_init.cmake") + +set(IOS_SDK_VERSION 9.1) +set(POLLY_XCODE_COMPILER "clang") +polly_init( + "iOS ${IOS_SDK_VERSION} arm64 (iphoneos + iphonesimulator) / \ +${POLLY_XCODE_COMPILER} / \ +No code sign / \ +c++11 support" + "Xcode" +) + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_common.cmake") + +include(polly_fatal_error) + +# Fix try_compile +include(polly_ios_bundle_identifier) +set(CMAKE_MACOSX_BUNDLE YES) + +# Verify XCODE_XCCONFIG_FILE +set( + _polly_xcode_xcconfig_file_path + "${CMAKE_CURRENT_LIST_DIR}/scripts/NoCodeSign.xcconfig" +) +if(NOT EXISTS "$ENV{XCODE_XCCONFIG_FILE}") + polly_fatal_error( + "Path specified by XCODE_XCCONFIG_FILE environment variable not found" + "($ENV{XCODE_XCCONFIG_FILE})" + "Use this command to set: " + " export XCODE_XCCONFIG_FILE=${_polly_xcode_xcconfig_file_path}" + ) +else() + string( + COMPARE + NOTEQUAL + "$ENV{XCODE_XCCONFIG_FILE}" + "${_polly_xcode_xcconfig_file_path}" + _polly_wrong_xcconfig_path + ) + if(_polly_wrong_xcconfig_path) + polly_fatal_error( + "Unexpected XCODE_XCCONFIG_FILE value: " + " $ENV{XCODE_XCCONFIG_FILE}" + "expected: " + " ${_polly_xcode_xcconfig_file_path}" + ) + endif() +endif() + +set(IPHONEOS_ARCHS arm64) +set(IPHONESIMULATOR_ARCHS "") + +include("${CMAKE_CURRENT_LIST_DIR}/compiler/xcode.cmake") +include("${CMAKE_CURRENT_LIST_DIR}/os/iphone.cmake") +include("${CMAKE_CURRENT_LIST_DIR}/flags/cxx11.cmake") diff --git a/tools/polly/ios-nocodesign-9-1-armv7.cmake b/tools/polly/ios-nocodesign-9-1-armv7.cmake new file mode 100644 index 0000000..44eeba1 --- /dev/null +++ b/tools/polly/ios-nocodesign-9-1-armv7.cmake @@ -0,0 +1,67 @@ +# Copyright (c) 2015, Ruslan Baratov & Luca Martini +# All rights reserved. + +if(DEFINED POLLY_IOS_NOCODESIGN_9_1_ARMV7_CMAKE) + return() +else() + set(POLLY_IOS_NOCODESIGN_9_1_ARMV7_CMAKE 1) +endif() + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_clear_environment_variables.cmake") + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_init.cmake") + +set(IOS_SDK_VERSION 9.1) +set(POLLY_XCODE_COMPILER "clang") +polly_init( + "iOS ${IOS_SDK_VERSION} armv7 (iphoneos + iphonesimulator) / \ +${POLLY_XCODE_COMPILER} / \ +No code sign / \ +c++11 support" + "Xcode" +) + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_common.cmake") + +include(polly_fatal_error) + +# Fix try_compile +include(polly_ios_bundle_identifier) +set(CMAKE_MACOSX_BUNDLE YES) + +# Verify XCODE_XCCONFIG_FILE +set( + _polly_xcode_xcconfig_file_path + "${CMAKE_CURRENT_LIST_DIR}/scripts/NoCodeSign.xcconfig" +) +if(NOT EXISTS "$ENV{XCODE_XCCONFIG_FILE}") + polly_fatal_error( + "Path specified by XCODE_XCCONFIG_FILE environment variable not found" + "($ENV{XCODE_XCCONFIG_FILE})" + "Use this command to set: " + " export XCODE_XCCONFIG_FILE=${_polly_xcode_xcconfig_file_path}" + ) +else() + string( + COMPARE + NOTEQUAL + "$ENV{XCODE_XCCONFIG_FILE}" + "${_polly_xcode_xcconfig_file_path}" + _polly_wrong_xcconfig_path + ) + if(_polly_wrong_xcconfig_path) + polly_fatal_error( + "Unexpected XCODE_XCCONFIG_FILE value: " + " $ENV{XCODE_XCCONFIG_FILE}" + "expected: " + " ${_polly_xcode_xcconfig_file_path}" + ) + endif() +endif() + +set(IPHONEOS_ARCHS armv7) +set(IPHONESIMULATOR_ARCHS "") + +include("${CMAKE_CURRENT_LIST_DIR}/compiler/xcode.cmake") +include("${CMAKE_CURRENT_LIST_DIR}/os/iphone.cmake") +include("${CMAKE_CURRENT_LIST_DIR}/flags/cxx11.cmake") diff --git a/tools/polly/ios-nocodesign-9-1.cmake b/tools/polly/ios-nocodesign-9-1.cmake new file mode 100644 index 0000000..3f2fc8b --- /dev/null +++ b/tools/polly/ios-nocodesign-9-1.cmake @@ -0,0 +1,67 @@ +# Copyright (c) 2014, Ruslan Baratov & Luca Martini +# All rights reserved. + +if(DEFINED POLLY_IOS_NOCODESIGN_9_1_CMAKE) + return() +else() + set(POLLY_IOS_NOCODESIGN_9_1_CMAKE 1) +endif() + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_clear_environment_variables.cmake") + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_init.cmake") + +set(IOS_SDK_VERSION 9.1) +set(POLLY_XCODE_COMPILER "clang") +polly_init( + "iOS ${IOS_SDK_VERSION} Universal (iphoneos + iphonesimulator) / \ +${POLLY_XCODE_COMPILER} / \ +No code sign / \ +c++11 support" + "Xcode" +) + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_common.cmake") + +include(polly_fatal_error) + +# Fix try_compile +include(polly_ios_bundle_identifier) +set(CMAKE_MACOSX_BUNDLE YES) + +# Verify XCODE_XCCONFIG_FILE +set( + _polly_xcode_xcconfig_file_path + "${CMAKE_CURRENT_LIST_DIR}/scripts/NoCodeSign.xcconfig" +) +if(NOT EXISTS "$ENV{XCODE_XCCONFIG_FILE}") + polly_fatal_error( + "Path specified by XCODE_XCCONFIG_FILE environment variable not found" + "($ENV{XCODE_XCCONFIG_FILE})" + "Use this command to set: " + " export XCODE_XCCONFIG_FILE=${_polly_xcode_xcconfig_file_path}" + ) +else() + string( + COMPARE + NOTEQUAL + "$ENV{XCODE_XCCONFIG_FILE}" + "${_polly_xcode_xcconfig_file_path}" + _polly_wrong_xcconfig_path + ) + if(_polly_wrong_xcconfig_path) + polly_fatal_error( + "Unexpected XCODE_XCCONFIG_FILE value: " + " $ENV{XCODE_XCCONFIG_FILE}" + "expected: " + " ${_polly_xcode_xcconfig_file_path}" + ) + endif() +endif() + +set(IPHONEOS_ARCHS armv7;armv7s;arm64) +set(IPHONESIMULATOR_ARCHS i386;x86_64) + +include("${CMAKE_CURRENT_LIST_DIR}/compiler/xcode.cmake") +include("${CMAKE_CURRENT_LIST_DIR}/os/iphone.cmake") +include("${CMAKE_CURRENT_LIST_DIR}/flags/cxx11.cmake") diff --git a/tools/polly/ios-nocodesign-9-2-arm64.cmake b/tools/polly/ios-nocodesign-9-2-arm64.cmake new file mode 100644 index 0000000..74fe6b0 --- /dev/null +++ b/tools/polly/ios-nocodesign-9-2-arm64.cmake @@ -0,0 +1,67 @@ +# Copyright (c) 2015, Ruslan Baratov & Michele Caini +# All rights reserved. + +if(DEFINED POLLY_IOS_NOCODESIGN_9_2_ARM64_CMAKE) + return() +else() + set(POLLY_IOS_NOCODESIGN_9_2_ARM64_CMAKE 1) +endif() + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_clear_environment_variables.cmake") + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_init.cmake") + +set(IOS_SDK_VERSION 9.2) +set(POLLY_XCODE_COMPILER "clang") +polly_init( + "iOS ${IOS_SDK_VERSION} arm64 (iphoneos + iphonesimulator) / \ +${POLLY_XCODE_COMPILER} / \ +No code sign / \ +c++11 support" + "Xcode" +) + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_common.cmake") + +include(polly_fatal_error) + +# Fix try_compile +include(polly_ios_bundle_identifier) +set(CMAKE_MACOSX_BUNDLE YES) + +# Verify XCODE_XCCONFIG_FILE +set( + _polly_xcode_xcconfig_file_path + "${CMAKE_CURRENT_LIST_DIR}/scripts/NoCodeSign.xcconfig" +) +if(NOT EXISTS "$ENV{XCODE_XCCONFIG_FILE}") + polly_fatal_error( + "Path specified by XCODE_XCCONFIG_FILE environment variable not found" + "($ENV{XCODE_XCCONFIG_FILE})" + "Use this command to set: " + " export XCODE_XCCONFIG_FILE=${_polly_xcode_xcconfig_file_path}" + ) +else() + string( + COMPARE + NOTEQUAL + "$ENV{XCODE_XCCONFIG_FILE}" + "${_polly_xcode_xcconfig_file_path}" + _polly_wrong_xcconfig_path + ) + if(_polly_wrong_xcconfig_path) + polly_fatal_error( + "Unexpected XCODE_XCCONFIG_FILE value: " + " $ENV{XCODE_XCCONFIG_FILE}" + "expected: " + " ${_polly_xcode_xcconfig_file_path}" + ) + endif() +endif() + +set(IPHONEOS_ARCHS arm64) +set(IPHONESIMULATOR_ARCHS "") + +include("${CMAKE_CURRENT_LIST_DIR}/compiler/xcode.cmake") +include("${CMAKE_CURRENT_LIST_DIR}/os/iphone.cmake") +include("${CMAKE_CURRENT_LIST_DIR}/flags/cxx11.cmake") diff --git a/tools/polly/ios-nocodesign-9-2-armv7.cmake b/tools/polly/ios-nocodesign-9-2-armv7.cmake new file mode 100644 index 0000000..fc5c493 --- /dev/null +++ b/tools/polly/ios-nocodesign-9-2-armv7.cmake @@ -0,0 +1,67 @@ +# Copyright (c) 2015, Ruslan Baratov & Michele Caini +# All rights reserved. + +if(DEFINED POLLY_IOS_NOCODESIGN_9_2_ARMV7_CMAKE) + return() +else() + set(POLLY_IOS_NOCODESIGN_9_2_ARMV7_CMAKE 1) +endif() + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_clear_environment_variables.cmake") + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_init.cmake") + +set(IOS_SDK_VERSION 9.2) +set(POLLY_XCODE_COMPILER "clang") +polly_init( + "iOS ${IOS_SDK_VERSION} armv7 (iphoneos + iphonesimulator) / \ +${POLLY_XCODE_COMPILER} / \ +No code sign / \ +c++11 support" + "Xcode" +) + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_common.cmake") + +include(polly_fatal_error) + +# Fix try_compile +include(polly_ios_bundle_identifier) +set(CMAKE_MACOSX_BUNDLE YES) + +# Verify XCODE_XCCONFIG_FILE +set( + _polly_xcode_xcconfig_file_path + "${CMAKE_CURRENT_LIST_DIR}/scripts/NoCodeSign.xcconfig" +) +if(NOT EXISTS "$ENV{XCODE_XCCONFIG_FILE}") + polly_fatal_error( + "Path specified by XCODE_XCCONFIG_FILE environment variable not found" + "($ENV{XCODE_XCCONFIG_FILE})" + "Use this command to set: " + " export XCODE_XCCONFIG_FILE=${_polly_xcode_xcconfig_file_path}" + ) +else() + string( + COMPARE + NOTEQUAL + "$ENV{XCODE_XCCONFIG_FILE}" + "${_polly_xcode_xcconfig_file_path}" + _polly_wrong_xcconfig_path + ) + if(_polly_wrong_xcconfig_path) + polly_fatal_error( + "Unexpected XCODE_XCCONFIG_FILE value: " + " $ENV{XCODE_XCCONFIG_FILE}" + "expected: " + " ${_polly_xcode_xcconfig_file_path}" + ) + endif() +endif() + +set(IPHONEOS_ARCHS armv7) +set(IPHONESIMULATOR_ARCHS "") + +include("${CMAKE_CURRENT_LIST_DIR}/compiler/xcode.cmake") +include("${CMAKE_CURRENT_LIST_DIR}/os/iphone.cmake") +include("${CMAKE_CURRENT_LIST_DIR}/flags/cxx11.cmake") diff --git a/tools/polly/ios-nocodesign-9-2.cmake b/tools/polly/ios-nocodesign-9-2.cmake new file mode 100644 index 0000000..a6ed044 --- /dev/null +++ b/tools/polly/ios-nocodesign-9-2.cmake @@ -0,0 +1,67 @@ +# Copyright (c) 2014, Ruslan Baratov & Michele Caini +# All rights reserved. + +if(DEFINED POLLY_IOS_NOCODESIGN_9_2_CMAKE) + return() +else() + set(POLLY_IOS_NOCODESIGN_9_2_CMAKE 1) +endif() + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_clear_environment_variables.cmake") + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_init.cmake") + +set(IOS_SDK_VERSION 9.2) +set(POLLY_XCODE_COMPILER "clang") +polly_init( + "iOS ${IOS_SDK_VERSION} Universal (iphoneos + iphonesimulator) / \ +${POLLY_XCODE_COMPILER} / \ +No code sign / \ +c++11 support" + "Xcode" +) + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_common.cmake") + +include(polly_fatal_error) + +# Fix try_compile +include(polly_ios_bundle_identifier) +set(CMAKE_MACOSX_BUNDLE YES) + +# Verify XCODE_XCCONFIG_FILE +set( + _polly_xcode_xcconfig_file_path + "${CMAKE_CURRENT_LIST_DIR}/scripts/NoCodeSign.xcconfig" +) +if(NOT EXISTS "$ENV{XCODE_XCCONFIG_FILE}") + polly_fatal_error( + "Path specified by XCODE_XCCONFIG_FILE environment variable not found" + "($ENV{XCODE_XCCONFIG_FILE})" + "Use this command to set: " + " export XCODE_XCCONFIG_FILE=${_polly_xcode_xcconfig_file_path}" + ) +else() + string( + COMPARE + NOTEQUAL + "$ENV{XCODE_XCCONFIG_FILE}" + "${_polly_xcode_xcconfig_file_path}" + _polly_wrong_xcconfig_path + ) + if(_polly_wrong_xcconfig_path) + polly_fatal_error( + "Unexpected XCODE_XCCONFIG_FILE value: " + " $ENV{XCODE_XCCONFIG_FILE}" + "expected: " + " ${_polly_xcode_xcconfig_file_path}" + ) + endif() +endif() + +set(IPHONEOS_ARCHS armv7;armv7s;arm64) +set(IPHONESIMULATOR_ARCHS i386;x86_64) + +include("${CMAKE_CURRENT_LIST_DIR}/compiler/xcode.cmake") +include("${CMAKE_CURRENT_LIST_DIR}/os/iphone.cmake") +include("${CMAKE_CURRENT_LIST_DIR}/flags/cxx11.cmake") diff --git a/tools/polly/ios-nocodesign-9-3-arm64.cmake b/tools/polly/ios-nocodesign-9-3-arm64.cmake new file mode 100644 index 0000000..9a40491 --- /dev/null +++ b/tools/polly/ios-nocodesign-9-3-arm64.cmake @@ -0,0 +1,67 @@ +# Copyright (c) 2014-2016, Ruslan Baratov +# All rights reserved. + +if(DEFINED POLLY_IOS_NOCODESIGN_9_3_ARM64_CMAKE_) + return() +else() + set(POLLY_IOS_NOCODESIGN_9_3_ARM64_CMAKE_ 1) +endif() + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_clear_environment_variables.cmake") + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_init.cmake") + +set(IOS_SDK_VERSION 9.3) +set(POLLY_XCODE_COMPILER "clang") +polly_init( + "iOS ${IOS_SDK_VERSION} / arm64 / \ +${POLLY_XCODE_COMPILER} / \ +No code sign / \ +c++11 support" + "Xcode" +) + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_common.cmake") + +include(polly_fatal_error) + +# Fix try_compile +include(polly_ios_bundle_identifier) +set(CMAKE_MACOSX_BUNDLE YES) + +# Verify XCODE_XCCONFIG_FILE +set( + _polly_xcode_xcconfig_file_path + "${CMAKE_CURRENT_LIST_DIR}/scripts/NoCodeSign.xcconfig" +) +if(NOT EXISTS "$ENV{XCODE_XCCONFIG_FILE}") + polly_fatal_error( + "Path specified by XCODE_XCCONFIG_FILE environment variable not found" + "($ENV{XCODE_XCCONFIG_FILE})" + "Use this command to set: " + " export XCODE_XCCONFIG_FILE=${_polly_xcode_xcconfig_file_path}" + ) +else() + string( + COMPARE + NOTEQUAL + "$ENV{XCODE_XCCONFIG_FILE}" + "${_polly_xcode_xcconfig_file_path}" + _polly_wrong_xcconfig_path + ) + if(_polly_wrong_xcconfig_path) + polly_fatal_error( + "Unexpected XCODE_XCCONFIG_FILE value: " + " $ENV{XCODE_XCCONFIG_FILE}" + "expected: " + " ${_polly_xcode_xcconfig_file_path}" + ) + endif() +endif() + +set(IPHONEOS_ARCHS arm64) +set(IPHONESIMULATOR_ARCHS "") + +include("${CMAKE_CURRENT_LIST_DIR}/compiler/xcode.cmake") +include("${CMAKE_CURRENT_LIST_DIR}/os/iphone.cmake") +include("${CMAKE_CURRENT_LIST_DIR}/flags/cxx11.cmake") diff --git a/tools/polly/ios-nocodesign-9-3-armv7.cmake b/tools/polly/ios-nocodesign-9-3-armv7.cmake new file mode 100644 index 0000000..486e9b2 --- /dev/null +++ b/tools/polly/ios-nocodesign-9-3-armv7.cmake @@ -0,0 +1,67 @@ +# Copyright (c) 2014-2016, Ruslan Baratov +# All rights reserved. + +if(DEFINED POLLY_IOS_NOCODESIGN_9_3_ARMV7_CMAKE_) + return() +else() + set(POLLY_IOS_NOCODESIGN_9_3_ARMV7_CMAKE_ 1) +endif() + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_clear_environment_variables.cmake") + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_init.cmake") + +set(IOS_SDK_VERSION 9.3) +set(POLLY_XCODE_COMPILER "clang") +polly_init( + "iOS ${IOS_SDK_VERSION} / armv7 / \ +${POLLY_XCODE_COMPILER} / \ +No code sign / \ +c++11 support" + "Xcode" +) + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_common.cmake") + +include(polly_fatal_error) + +# Fix try_compile +include(polly_ios_bundle_identifier) +set(CMAKE_MACOSX_BUNDLE YES) + +# Verify XCODE_XCCONFIG_FILE +set( + _polly_xcode_xcconfig_file_path + "${CMAKE_CURRENT_LIST_DIR}/scripts/NoCodeSign.xcconfig" +) +if(NOT EXISTS "$ENV{XCODE_XCCONFIG_FILE}") + polly_fatal_error( + "Path specified by XCODE_XCCONFIG_FILE environment variable not found" + "($ENV{XCODE_XCCONFIG_FILE})" + "Use this command to set: " + " export XCODE_XCCONFIG_FILE=${_polly_xcode_xcconfig_file_path}" + ) +else() + string( + COMPARE + NOTEQUAL + "$ENV{XCODE_XCCONFIG_FILE}" + "${_polly_xcode_xcconfig_file_path}" + _polly_wrong_xcconfig_path + ) + if(_polly_wrong_xcconfig_path) + polly_fatal_error( + "Unexpected XCODE_XCCONFIG_FILE value: " + " $ENV{XCODE_XCCONFIG_FILE}" + "expected: " + " ${_polly_xcode_xcconfig_file_path}" + ) + endif() +endif() + +set(IPHONEOS_ARCHS armv7) +set(IPHONESIMULATOR_ARCHS "") + +include("${CMAKE_CURRENT_LIST_DIR}/compiler/xcode.cmake") +include("${CMAKE_CURRENT_LIST_DIR}/os/iphone.cmake") +include("${CMAKE_CURRENT_LIST_DIR}/flags/cxx11.cmake") diff --git a/tools/polly/ios-nocodesign-9-3-device-hid-sections.cmake b/tools/polly/ios-nocodesign-9-3-device-hid-sections.cmake new file mode 100644 index 0000000..04e425a --- /dev/null +++ b/tools/polly/ios-nocodesign-9-3-device-hid-sections.cmake @@ -0,0 +1,71 @@ +# Copyright (c) 2016, Ruslan Baratov +# Copyright (c) 2016, David Hirvonen +# All rights reserved. + +if(DEFINED POLLY_IOS_NOCODESIGN_9_3_DEVICE_HID_SECTIONS_CMAKE_) + return() +else() + set(POLLY_IOS_NOCODESIGN_9_3_DEVICE_HID_SECTIONS_CMAKE_ 1) +endif() + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_clear_environment_variables.cmake") + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_init.cmake") + +set(IOS_SDK_VERSION 9.3) +set(POLLY_XCODE_COMPILER "clang") +polly_init( + "iOS ${IOS_SDK_VERSION} / Universal (arm64 armv7s armv7) / \ +${POLLY_XCODE_COMPILER} / \ +No code sign / \ +c++11 support / hidden / data-sections / function-sections" + "Xcode" +) + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_common.cmake") + +include(polly_fatal_error) + +# Fix try_compile +include(polly_ios_bundle_identifier) +set(CMAKE_MACOSX_BUNDLE YES) + +# Verify XCODE_XCCONFIG_FILE +set( + _polly_xcode_xcconfig_file_path + "${CMAKE_CURRENT_LIST_DIR}/scripts/NoCodeSign.xcconfig" +) +if(NOT EXISTS "$ENV{XCODE_XCCONFIG_FILE}") + polly_fatal_error( + "Path specified by XCODE_XCCONFIG_FILE environment variable not found" + "($ENV{XCODE_XCCONFIG_FILE})" + "Use this command to set: " + " export XCODE_XCCONFIG_FILE=${_polly_xcode_xcconfig_file_path}" + ) +else() + string( + COMPARE + NOTEQUAL + "$ENV{XCODE_XCCONFIG_FILE}" + "${_polly_xcode_xcconfig_file_path}" + _polly_wrong_xcconfig_path + ) + if(_polly_wrong_xcconfig_path) + polly_fatal_error( + "Unexpected XCODE_XCCONFIG_FILE value: " + " $ENV{XCODE_XCCONFIG_FILE}" + "expected: " + " ${_polly_xcode_xcconfig_file_path}" + ) + endif() +endif() + +set(IPHONEOS_ARCHS armv7;armv7s;arm64) +set(IPHONESIMULATOR_ARCHS "") + +include("${CMAKE_CURRENT_LIST_DIR}/compiler/xcode.cmake") +include("${CMAKE_CURRENT_LIST_DIR}/os/iphone.cmake") +include("${CMAKE_CURRENT_LIST_DIR}/flags/cxx11.cmake") +include("${CMAKE_CURRENT_LIST_DIR}/flags/function-sections.cmake") +include("${CMAKE_CURRENT_LIST_DIR}/flags/data-sections.cmake") +include("${CMAKE_CURRENT_LIST_DIR}/flags/hidden.cmake") diff --git a/tools/polly/ios-nocodesign-9-3-device.cmake b/tools/polly/ios-nocodesign-9-3-device.cmake new file mode 100644 index 0000000..248ebc2 --- /dev/null +++ b/tools/polly/ios-nocodesign-9-3-device.cmake @@ -0,0 +1,67 @@ +# Copyright (c) 2016, Ruslan Baratov +# All rights reserved. + +if(DEFINED POLLY_IOS_NOCODESIGN_9_3_DEVICE_CMAKE_) + return() +else() + set(POLLY_IOS_NOCODESIGN_9_3_DEVICE_CMAKE_ 1) +endif() + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_clear_environment_variables.cmake") + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_init.cmake") + +set(IOS_SDK_VERSION 9.3) +set(POLLY_XCODE_COMPILER "clang") +polly_init( + "iOS ${IOS_SDK_VERSION} / Universal (arm64 armv7s armv7) / \ +${POLLY_XCODE_COMPILER} / \ +No code sign / \ +c++11 support" + "Xcode" +) + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_common.cmake") + +include(polly_fatal_error) + +# Fix try_compile +include(polly_ios_bundle_identifier) +set(CMAKE_MACOSX_BUNDLE YES) + +# Verify XCODE_XCCONFIG_FILE +set( + _polly_xcode_xcconfig_file_path + "${CMAKE_CURRENT_LIST_DIR}/scripts/NoCodeSign.xcconfig" +) +if(NOT EXISTS "$ENV{XCODE_XCCONFIG_FILE}") + polly_fatal_error( + "Path specified by XCODE_XCCONFIG_FILE environment variable not found" + "($ENV{XCODE_XCCONFIG_FILE})" + "Use this command to set: " + " export XCODE_XCCONFIG_FILE=${_polly_xcode_xcconfig_file_path}" + ) +else() + string( + COMPARE + NOTEQUAL + "$ENV{XCODE_XCCONFIG_FILE}" + "${_polly_xcode_xcconfig_file_path}" + _polly_wrong_xcconfig_path + ) + if(_polly_wrong_xcconfig_path) + polly_fatal_error( + "Unexpected XCODE_XCCONFIG_FILE value: " + " $ENV{XCODE_XCCONFIG_FILE}" + "expected: " + " ${_polly_xcode_xcconfig_file_path}" + ) + endif() +endif() + +set(IPHONEOS_ARCHS armv7;armv7s;arm64) +set(IPHONESIMULATOR_ARCHS "") + +include("${CMAKE_CURRENT_LIST_DIR}/compiler/xcode.cmake") +include("${CMAKE_CURRENT_LIST_DIR}/os/iphone.cmake") +include("${CMAKE_CURRENT_LIST_DIR}/flags/cxx11.cmake") diff --git a/tools/polly/ios-nocodesign-9-3-wo-armv7s.cmake b/tools/polly/ios-nocodesign-9-3-wo-armv7s.cmake new file mode 100644 index 0000000..8c58c6d --- /dev/null +++ b/tools/polly/ios-nocodesign-9-3-wo-armv7s.cmake @@ -0,0 +1,67 @@ +# Copyright (c) 2014-2016, Ruslan Baratov +# All rights reserved. + +if(DEFINED POLLY_IOS_NOCODESIGN_9_3_WO_ARMV7S_CMAKE_) + return() +else() + set(POLLY_IOS_NOCODESIGN_9_3_WO_ARMV7S_CMAKE_ 1) +endif() + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_clear_environment_variables.cmake") + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_init.cmake") + +set(IOS_SDK_VERSION 9.3) +set(POLLY_XCODE_COMPILER "clang") +polly_init( + "iOS ${IOS_SDK_VERSION} Universal (iphoneos + iphonesimulator) / No armv7s / \ +${POLLY_XCODE_COMPILER} / \ +No code sign / \ +c++11 support" + "Xcode" +) + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_common.cmake") + +include(polly_fatal_error) + +# Fix try_compile +include(polly_ios_bundle_identifier) +set(CMAKE_MACOSX_BUNDLE YES) + +# Verify XCODE_XCCONFIG_FILE +set( + _polly_xcode_xcconfig_file_path + "${CMAKE_CURRENT_LIST_DIR}/scripts/NoCodeSign.xcconfig" +) +if(NOT EXISTS "$ENV{XCODE_XCCONFIG_FILE}") + polly_fatal_error( + "Path specified by XCODE_XCCONFIG_FILE environment variable not found" + "($ENV{XCODE_XCCONFIG_FILE})" + "Use this command to set: " + " export XCODE_XCCONFIG_FILE=${_polly_xcode_xcconfig_file_path}" + ) +else() + string( + COMPARE + NOTEQUAL + "$ENV{XCODE_XCCONFIG_FILE}" + "${_polly_xcode_xcconfig_file_path}" + _polly_wrong_xcconfig_path + ) + if(_polly_wrong_xcconfig_path) + polly_fatal_error( + "Unexpected XCODE_XCCONFIG_FILE value: " + " $ENV{XCODE_XCCONFIG_FILE}" + "expected: " + " ${_polly_xcode_xcconfig_file_path}" + ) + endif() +endif() + +set(IPHONEOS_ARCHS armv7;arm64) +set(IPHONESIMULATOR_ARCHS i386;x86_64) + +include("${CMAKE_CURRENT_LIST_DIR}/compiler/xcode.cmake") +include("${CMAKE_CURRENT_LIST_DIR}/os/iphone.cmake") +include("${CMAKE_CURRENT_LIST_DIR}/flags/cxx11.cmake") diff --git a/tools/polly/ios-nocodesign-9-3.cmake b/tools/polly/ios-nocodesign-9-3.cmake new file mode 100644 index 0000000..f7602ea --- /dev/null +++ b/tools/polly/ios-nocodesign-9-3.cmake @@ -0,0 +1,67 @@ +# Copyright (c) 2014-2016, Ruslan Baratov +# All rights reserved. + +if(DEFINED POLLY_IOS_NOCODESIGN_9_3_CMAKE_) + return() +else() + set(POLLY_IOS_NOCODESIGN_9_3_CMAKE_ 1) +endif() + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_clear_environment_variables.cmake") + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_init.cmake") + +set(IOS_SDK_VERSION 9.3) +set(POLLY_XCODE_COMPILER "clang") +polly_init( + "iOS ${IOS_SDK_VERSION} Universal (iphoneos + iphonesimulator) / \ +${POLLY_XCODE_COMPILER} / \ +No code sign / \ +c++11 support" + "Xcode" +) + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_common.cmake") + +include(polly_fatal_error) + +# Fix try_compile +include(polly_ios_bundle_identifier) +set(CMAKE_MACOSX_BUNDLE YES) + +# Verify XCODE_XCCONFIG_FILE +set( + _polly_xcode_xcconfig_file_path + "${CMAKE_CURRENT_LIST_DIR}/scripts/NoCodeSign.xcconfig" +) +if(NOT EXISTS "$ENV{XCODE_XCCONFIG_FILE}") + polly_fatal_error( + "Path specified by XCODE_XCCONFIG_FILE environment variable not found" + "($ENV{XCODE_XCCONFIG_FILE})" + "Use this command to set: " + " export XCODE_XCCONFIG_FILE=${_polly_xcode_xcconfig_file_path}" + ) +else() + string( + COMPARE + NOTEQUAL + "$ENV{XCODE_XCCONFIG_FILE}" + "${_polly_xcode_xcconfig_file_path}" + _polly_wrong_xcconfig_path + ) + if(_polly_wrong_xcconfig_path) + polly_fatal_error( + "Unexpected XCODE_XCCONFIG_FILE value: " + " $ENV{XCODE_XCCONFIG_FILE}" + "expected: " + " ${_polly_xcode_xcconfig_file_path}" + ) + endif() +endif() + +set(IPHONEOS_ARCHS armv7;armv7s;arm64) +set(IPHONESIMULATOR_ARCHS i386;x86_64) + +include("${CMAKE_CURRENT_LIST_DIR}/compiler/xcode.cmake") +include("${CMAKE_CURRENT_LIST_DIR}/os/iphone.cmake") +include("${CMAKE_CURRENT_LIST_DIR}/flags/cxx11.cmake") diff --git a/tools/polly/ios-nocodesign-arm64.cmake b/tools/polly/ios-nocodesign-arm64.cmake new file mode 100644 index 0000000..5807dd5 --- /dev/null +++ b/tools/polly/ios-nocodesign-arm64.cmake @@ -0,0 +1,67 @@ +# Copyright (c) 2015, Ruslan Baratov +# All rights reserved. + +if(DEFINED POLLY_IOS_NOCODESIGN_ARM64_CMAKE) + return() +else() + set(POLLY_IOS_NOCODESIGN_ARM64_CMAKE 1) +endif() + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_clear_environment_variables.cmake") + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_init.cmake") + +set(IOS_SDK_VERSION 8.1) +set(POLLY_XCODE_COMPILER "clang") +polly_init( + "iOS ${IOS_SDK_VERSION} Universal (iphoneos + iphonesimulator) / \ +${POLLY_XCODE_COMPILER} / \ +No code sign / \ +c++11 support" + "Xcode" +) + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_common.cmake") + +include(polly_fatal_error) + +# Fix try_compile +include(polly_ios_bundle_identifier) +set(CMAKE_MACOSX_BUNDLE YES) + +# Verify XCODE_XCCONFIG_FILE +set( + _polly_xcode_xcconfig_file_path + "${CMAKE_CURRENT_LIST_DIR}/scripts/NoCodeSign.xcconfig" +) +if(NOT EXISTS "$ENV{XCODE_XCCONFIG_FILE}") + polly_fatal_error( + "Path specified by XCODE_XCCONFIG_FILE environment variable not found" + "($ENV{XCODE_XCCONFIG_FILE})" + "Use this command to set: " + " export XCODE_XCCONFIG_FILE=${_polly_xcode_xcconfig_file_path}" + ) +else() + string( + COMPARE + NOTEQUAL + "$ENV{XCODE_XCCONFIG_FILE}" + "${_polly_xcode_xcconfig_file_path}" + _polly_wrong_xcconfig_path + ) + if(_polly_wrong_xcconfig_path) + polly_fatal_error( + "Unexpected XCODE_XCCONFIG_FILE value: " + " $ENV{XCODE_XCCONFIG_FILE}" + "expected: " + " ${_polly_xcode_xcconfig_file_path}" + ) + endif() +endif() + +set(IPHONEOS_ARCHS arm64) +set(IPHONESIMULATOR_ARCHS "") + +include("${CMAKE_CURRENT_LIST_DIR}/compiler/xcode.cmake") +include("${CMAKE_CURRENT_LIST_DIR}/os/iphone.cmake") +include("${CMAKE_CURRENT_LIST_DIR}/flags/cxx11.cmake") diff --git a/tools/polly/ios-nocodesign-armv7.cmake b/tools/polly/ios-nocodesign-armv7.cmake new file mode 100644 index 0000000..2fe075e --- /dev/null +++ b/tools/polly/ios-nocodesign-armv7.cmake @@ -0,0 +1,67 @@ +# Copyright (c) 2015, Ruslan Baratov +# All rights reserved. + +if(DEFINED POLLY_IOS_NOCODESIGN_ARMV7_CMAKE) + return() +else() + set(POLLY_IOS_NOCODESIGN_ARMV7_CMAKE 1) +endif() + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_clear_environment_variables.cmake") + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_init.cmake") + +set(IOS_SDK_VERSION 8.1) +set(POLLY_XCODE_COMPILER "clang") +polly_init( + "iOS ${IOS_SDK_VERSION} Universal (iphoneos + iphonesimulator) / \ +${POLLY_XCODE_COMPILER} / \ +No code sign / \ +c++11 support" + "Xcode" +) + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_common.cmake") + +include(polly_fatal_error) + +# Fix try_compile +include(polly_ios_bundle_identifier) +set(CMAKE_MACOSX_BUNDLE YES) + +# Verify XCODE_XCCONFIG_FILE +set( + _polly_xcode_xcconfig_file_path + "${CMAKE_CURRENT_LIST_DIR}/scripts/NoCodeSign.xcconfig" +) +if(NOT EXISTS "$ENV{XCODE_XCCONFIG_FILE}") + polly_fatal_error( + "Path specified by XCODE_XCCONFIG_FILE environment variable not found" + "($ENV{XCODE_XCCONFIG_FILE})" + "Use this command to set: " + " export XCODE_XCCONFIG_FILE=${_polly_xcode_xcconfig_file_path}" + ) +else() + string( + COMPARE + NOTEQUAL + "$ENV{XCODE_XCCONFIG_FILE}" + "${_polly_xcode_xcconfig_file_path}" + _polly_wrong_xcconfig_path + ) + if(_polly_wrong_xcconfig_path) + polly_fatal_error( + "Unexpected XCODE_XCCONFIG_FILE value: " + " $ENV{XCODE_XCCONFIG_FILE}" + "expected: " + " ${_polly_xcode_xcconfig_file_path}" + ) + endif() +endif() + +set(IPHONEOS_ARCHS armv7) +set(IPHONESIMULATOR_ARCHS "") + +include("${CMAKE_CURRENT_LIST_DIR}/compiler/xcode.cmake") +include("${CMAKE_CURRENT_LIST_DIR}/os/iphone.cmake") +include("${CMAKE_CURRENT_LIST_DIR}/flags/cxx11.cmake") diff --git a/tools/polly/ios-nocodesign-dep-9-0-cxx14.cmake b/tools/polly/ios-nocodesign-dep-9-0-cxx14.cmake new file mode 100644 index 0000000..49fd881 --- /dev/null +++ b/tools/polly/ios-nocodesign-dep-9-0-cxx14.cmake @@ -0,0 +1,68 @@ +# Copyright (c) 2014-2016, Ruslan Baratov +# All rights reserved. + +if(DEFINED POLLY_IOS_NOCODESIGN_DEP_9_0_CXX14_CMAKE_) + return() +else() + set(POLLY_IOS_NOCODESIGN_DEP_9_0_CXX14_CMAKE_ 1) +endif() + + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_module_path.cmake") +include(polly_clear_environment_variables) +include(polly_init) +include("${CMAKE_CURRENT_LIST_DIR}/os/iphone-default-sdk.cmake") # -> IOS_SDK_VERSION + + +set(IOS_DEPLOYMENT_SDK_VERSION 9.0) +set(POLLY_XCODE_COMPILER "clang") +polly_init( + "iOS ${IOS_SDK_VERSION} / Deployment ${IOS_DEPLOYMENT_SDK_VERSION} / Universal (iphoneos + iphonesimulator) / \ +${POLLY_XCODE_COMPILER} / \ +c++14 support" + "Xcode" +) + +include(polly_common) +include(polly_fatal_error) + +# Fix try_compile +include(polly_ios_bundle_identifier) +set(CMAKE_MACOSX_BUNDLE YES) + +# Verify XCODE_XCCONFIG_FILE +set( + _polly_xcode_xcconfig_file_path + "${CMAKE_CURRENT_LIST_DIR}/scripts/NoCodeSign.xcconfig" +) +if(NOT EXISTS "$ENV{XCODE_XCCONFIG_FILE}") + polly_fatal_error( + "Path specified by XCODE_XCCONFIG_FILE environment variable not found" + "($ENV{XCODE_XCCONFIG_FILE})" + "Use this command to set: " + " export XCODE_XCCONFIG_FILE=${_polly_xcode_xcconfig_file_path}" + ) +else() + string( + COMPARE + NOTEQUAL + "$ENV{XCODE_XCCONFIG_FILE}" + "${_polly_xcode_xcconfig_file_path}" + _polly_wrong_xcconfig_path + ) + if(_polly_wrong_xcconfig_path) + polly_fatal_error( + "Unexpected XCODE_XCCONFIG_FILE value: " + " $ENV{XCODE_XCCONFIG_FILE}" + "expected: " + " ${_polly_xcode_xcconfig_file_path}" + ) + endif() +endif() + +set(IPHONEOS_ARCHS armv7;armv7s;arm64) +set(IPHONESIMULATOR_ARCHS i386;x86_64) + +include("${CMAKE_CURRENT_LIST_DIR}/compiler/xcode.cmake") +include("${CMAKE_CURRENT_LIST_DIR}/os/iphone.cmake") +include("${CMAKE_CURRENT_LIST_DIR}/flags/cxx14.cmake") diff --git a/tools/polly/ios-nocodesign-hid-sections.cmake b/tools/polly/ios-nocodesign-hid-sections.cmake new file mode 100644 index 0000000..6a6c801 --- /dev/null +++ b/tools/polly/ios-nocodesign-hid-sections.cmake @@ -0,0 +1,71 @@ +# Copyright (c) 2014-2016, Ruslan Baratov +# Copyright (c) 2016, David Hirvonen +# All rights reserved. + +if(DEFINED POLLY_IOS_NOCODESIGN_HID_SECTIONS_CMAKE) + return() +else() + set(POLLY_IOS_NOCODESIGN_HID_SECTIONS_CMAKE 1) +endif() + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_clear_environment_variables.cmake") + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_init.cmake") + +set(IOS_SDK_VERSION 8.1) +set(POLLY_XCODE_COMPILER "clang") +polly_init( + "iOS ${IOS_SDK_VERSION} Universal (iphoneos + iphonesimulator) / \ +${POLLY_XCODE_COMPILER} / \ +No code sign / function-sections / data-sections / hidden visibility / \ +c++11 support" + "Xcode" +) + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_common.cmake") + +include(polly_fatal_error) + +# Fix try_compile +include(polly_ios_bundle_identifier) +set(CMAKE_MACOSX_BUNDLE YES) + +# Verify XCODE_XCCONFIG_FILE +set( + _polly_xcode_xcconfig_file_path + "${CMAKE_CURRENT_LIST_DIR}/scripts/NoCodeSign.xcconfig" +) +if(NOT EXISTS "$ENV{XCODE_XCCONFIG_FILE}") + polly_fatal_error( + "Path specified by XCODE_XCCONFIG_FILE environment variable not found" + "($ENV{XCODE_XCCONFIG_FILE})" + "Use this command to set: " + " export XCODE_XCCONFIG_FILE=${_polly_xcode_xcconfig_file_path}" + ) +else() + string( + COMPARE + NOTEQUAL + "$ENV{XCODE_XCCONFIG_FILE}" + "${_polly_xcode_xcconfig_file_path}" + _polly_wrong_xcconfig_path + ) + if(_polly_wrong_xcconfig_path) + polly_fatal_error( + "Unexpected XCODE_XCCONFIG_FILE value: " + " $ENV{XCODE_XCCONFIG_FILE}" + "expected: " + " ${_polly_xcode_xcconfig_file_path}" + ) + endif() +endif() + +set(IPHONEOS_ARCHS armv7;armv7s;arm64) +set(IPHONESIMULATOR_ARCHS i386;x86_64) + +include("${CMAKE_CURRENT_LIST_DIR}/compiler/xcode.cmake") +include("${CMAKE_CURRENT_LIST_DIR}/os/iphone.cmake") +include("${CMAKE_CURRENT_LIST_DIR}/flags/cxx11.cmake") +include("${CMAKE_CURRENT_LIST_DIR}/flags/hidden.cmake") +include("${CMAKE_CURRENT_LIST_DIR}/flags/function-sections.cmake") +include("${CMAKE_CURRENT_LIST_DIR}/flags/data-sections.cmake") diff --git a/tools/polly/ios-nocodesign-wo-armv7s.cmake b/tools/polly/ios-nocodesign-wo-armv7s.cmake new file mode 100644 index 0000000..482d1e1 --- /dev/null +++ b/tools/polly/ios-nocodesign-wo-armv7s.cmake @@ -0,0 +1,67 @@ +# Copyright (c) 2014-2016, Ruslan Baratov +# All rights reserved. + +if(DEFINED POLLY_IOS_NOCODESIGN_WO_ARMV7S_CMAKE_) + return() +else() + set(POLLY_IOS_NOCODESIGN_WO_ARMV7S_CMAKE_ 1) +endif() + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_clear_environment_variables.cmake") + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_init.cmake") + +set(IOS_SDK_VERSION 8.1) +set(POLLY_XCODE_COMPILER "clang") +polly_init( + "iOS ${IOS_SDK_VERSION} Universal (iphoneos + iphonesimulator) / No armv7s / \ +${POLLY_XCODE_COMPILER} / \ +No code sign / \ +c++11 support" + "Xcode" +) + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_common.cmake") + +include(polly_fatal_error) + +# Fix try_compile +include(polly_ios_bundle_identifier) +set(CMAKE_MACOSX_BUNDLE YES) + +# Verify XCODE_XCCONFIG_FILE +set( + _polly_xcode_xcconfig_file_path + "${CMAKE_CURRENT_LIST_DIR}/scripts/NoCodeSign.xcconfig" +) +if(NOT EXISTS "$ENV{XCODE_XCCONFIG_FILE}") + polly_fatal_error( + "Path specified by XCODE_XCCONFIG_FILE environment variable not found" + "($ENV{XCODE_XCCONFIG_FILE})" + "Use this command to set: " + " export XCODE_XCCONFIG_FILE=${_polly_xcode_xcconfig_file_path}" + ) +else() + string( + COMPARE + NOTEQUAL + "$ENV{XCODE_XCCONFIG_FILE}" + "${_polly_xcode_xcconfig_file_path}" + _polly_wrong_xcconfig_path + ) + if(_polly_wrong_xcconfig_path) + polly_fatal_error( + "Unexpected XCODE_XCCONFIG_FILE value: " + " $ENV{XCODE_XCCONFIG_FILE}" + "expected: " + " ${_polly_xcode_xcconfig_file_path}" + ) + endif() +endif() + +set(IPHONEOS_ARCHS armv7;arm64) +set(IPHONESIMULATOR_ARCHS i386;x86_64) + +include("${CMAKE_CURRENT_LIST_DIR}/compiler/xcode.cmake") +include("${CMAKE_CURRENT_LIST_DIR}/os/iphone.cmake") +include("${CMAKE_CURRENT_LIST_DIR}/flags/cxx11.cmake") diff --git a/tools/polly/ios-nocodesign.cmake b/tools/polly/ios-nocodesign.cmake new file mode 100644 index 0000000..c39c26d --- /dev/null +++ b/tools/polly/ios-nocodesign.cmake @@ -0,0 +1,73 @@ +# Copyright (c) 2014-2016, Ruslan Baratov +# All rights reserved. + +if(DEFINED POLLY_IOS_NOCODESIGN_CMAKE_) + return() +else() + set(POLLY_IOS_NOCODESIGN_CMAKE_ 1) +endif() + + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_module_path.cmake") +include(polly_clear_environment_variables) +include(polly_init) +include("${CMAKE_CURRENT_LIST_DIR}/os/iphone-default-sdk.cmake") # -> IOS_SDK_VERSION + +set(POLLY_XCODE_COMPILER "clang") +polly_init( + "iOS ${IOS_SDK_VERSION} Universal (iphoneos + iphonesimulator) / \ +${POLLY_XCODE_COMPILER} / \ +c++14 support" + "Xcode" +) + +include(polly_common) +include(polly_fatal_error) + +# Fix try_compile +include(polly_ios_bundle_identifier) +set(CMAKE_MACOSX_BUNDLE YES) + +# Verify XCODE_XCCONFIG_FILE +set( + _polly_xcode_xcconfig_file_path + "${CMAKE_CURRENT_LIST_DIR}/scripts/NoCodeSign.xcconfig" +) +if(NOT EXISTS "$ENV{XCODE_XCCONFIG_FILE}") + polly_fatal_error( + "Path specified by XCODE_XCCONFIG_FILE environment variable not found" + "($ENV{XCODE_XCCONFIG_FILE})" + "Use this command to set: " + " export XCODE_XCCONFIG_FILE=${_polly_xcode_xcconfig_file_path}" + ) +else() + string( + COMPARE + NOTEQUAL + "$ENV{XCODE_XCCONFIG_FILE}" + "${_polly_xcode_xcconfig_file_path}" + _polly_wrong_xcconfig_path + ) + if(_polly_wrong_xcconfig_path) + polly_fatal_error( + "Unexpected XCODE_XCCONFIG_FILE value: " + " $ENV{XCODE_XCCONFIG_FILE}" + "expected: " + " ${_polly_xcode_xcconfig_file_path}" + ) + endif() +endif() + +# 32 bits support was dropped from iPhoneSdk11.0 +if(IOS_SDK_VERSION VERSION_LESS "11.0") + set(IPHONEOS_ARCHS armv7;armv7s;arm64) + set(IPHONESIMULATOR_ARCHS i386;x86_64) +else() + polly_status_debug("iPhone11.0+ SDK detected, forcing 64 bits builds.") + set(IPHONEOS_ARCHS arm64) + set(IPHONESIMULATOR_ARCHS x86_64) +endif() + +include("${CMAKE_CURRENT_LIST_DIR}/compiler/xcode.cmake") +include("${CMAKE_CURRENT_LIST_DIR}/os/iphone.cmake") +include("${CMAKE_CURRENT_LIST_DIR}/flags/cxx14.cmake") diff --git a/tools/polly/ios.cmake b/tools/polly/ios.cmake new file mode 100644 index 0000000..0b00532 --- /dev/null +++ b/tools/polly/ios.cmake @@ -0,0 +1,48 @@ +# Copyright (c) 2016, Ruslan Baratov +# All rights reserved. + +if(DEFINED POLLY_IOS_CMAKE_) + return() +else() + set(POLLY_IOS_CMAKE_ 1) +endif() + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_module_path.cmake") +include(polly_clear_environment_variables) +include(polly_init) +include("${CMAKE_CURRENT_LIST_DIR}/os/iphone-default-sdk.cmake") # -> IOS_SDK_VERSION + +set(POLLY_XCODE_COMPILER "clang") +polly_init( + "iOS ${IOS_SDK_VERSION} Universal (iphoneos + iphonesimulator) / \ +${POLLY_XCODE_COMPILER} / \ +c++14 support" + "Xcode" +) + +include(polly_common) +include(polly_fatal_error) + +# # Fix try_compile +include(polly_ios_bundle_identifier) +set(CMAKE_MACOSX_BUNDLE YES) + +set(CMAKE_XCODE_ATTRIBUTE_CODE_SIGN_IDENTITY "iPhone Developer") + +# 32 bits support was dropped from iPhoneSdk11.0 +if(IOS_SDK_VERSION VERSION_LESS "11.0") + set(IPHONEOS_ARCHS armv7;armv7s;arm64) + set(IPHONESIMULATOR_ARCHS i386;x86_64) +else() + polly_status_debug("iPhone11.0+ SDK detected, forcing 64 bits builds.") + set(IPHONEOS_ARCHS arm64) + set(IPHONESIMULATOR_ARCHS x86_64) +endif() + +include("${CMAKE_CURRENT_LIST_DIR}/compiler/xcode.cmake") +include("${CMAKE_CURRENT_LIST_DIR}/os/iphone.cmake") +include("${CMAKE_CURRENT_LIST_DIR}/flags/cxx14.cmake") + +if(NOT IOS_SDK_VERSION VERSION_LESS 10.0) + include(polly_ios_development_team) +endif() diff --git a/tools/polly/libcxx-fpic-hid-sections.cmake b/tools/polly/libcxx-fpic-hid-sections.cmake new file mode 100644 index 0000000..35b84ed --- /dev/null +++ b/tools/polly/libcxx-fpic-hid-sections.cmake @@ -0,0 +1,27 @@ +# Copyright (c) 2013, Ruslan Baratov +# Copyright (c) 2016, David Hirvonen +# All rights reserved. + +if(DEFINED POLLY_CLANG_LIBCXX_CXX11_FPIC_HID_SECTIONS_) + return() +else() + set(POLLY_CLANG_LIBCXX_CXX11_FPIC_HID_SECTIONS_ 1) +endif() + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_init.cmake") + +polly_init( + "clang / LLVM Standard C++ Library (libc++) / \ +c++11 support / hidden / data-sections / function-sections" + "Unix Makefiles" +) + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_common.cmake") + +include("${CMAKE_CURRENT_LIST_DIR}/compiler/clang.cmake") +include("${CMAKE_CURRENT_LIST_DIR}/library/std/libcxx.cmake") +include("${CMAKE_CURRENT_LIST_DIR}/flags/cxx11.cmake") +include("${CMAKE_CURRENT_LIST_DIR}/flags/function-sections.cmake") +include("${CMAKE_CURRENT_LIST_DIR}/flags/data-sections.cmake") +include("${CMAKE_CURRENT_LIST_DIR}/flags/hidden.cmake") +include("${CMAKE_CURRENT_LIST_DIR}/flags/fpic.cmake") diff --git a/tools/polly/libcxx-hid-fpic.cmake b/tools/polly/libcxx-hid-fpic.cmake new file mode 100644 index 0000000..f734377 --- /dev/null +++ b/tools/polly/libcxx-hid-fpic.cmake @@ -0,0 +1,23 @@ +# Copyright (c) 2013, Ruslan Baratov, David Hirvonen +# All rights reserved. + +if(DEFINED POLLY_CLANG_LIBCXX_CXX11_HID_FPIC) + return() +else() + set(POLLY_CLANG_LIBCXX_CXX11_HID_FPIC 1) +endif() + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_init.cmake") + +polly_init( + "clang / LLVM Standard C++ Library (libc++) / c++11 support / hidden / FPIC" + "Unix Makefiles" +) + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_common.cmake") + +include("${CMAKE_CURRENT_LIST_DIR}/compiler/clang.cmake") +include("${CMAKE_CURRENT_LIST_DIR}/library/std/libcxx.cmake") +include("${CMAKE_CURRENT_LIST_DIR}/flags/cxx11.cmake") +include("${CMAKE_CURRENT_LIST_DIR}/flags/hidden.cmake") +include("${CMAKE_CURRENT_LIST_DIR}/flags/fpic.cmake") diff --git a/tools/polly/libcxx-hid-sections.cmake b/tools/polly/libcxx-hid-sections.cmake new file mode 100644 index 0000000..c3fb28d --- /dev/null +++ b/tools/polly/libcxx-hid-sections.cmake @@ -0,0 +1,26 @@ +# Copyright (c) 2013, Ruslan Baratov +# Copyright (c) 2016, David Hirvonen +# All rights reserved. + +if(DEFINED POLLY_CLANG_LIBCXX_CXX11_HID_SECTIONS_) + return() +else() + set(POLLY_CLANG_LIBCXX_CXX11_HID_SECTIONS_ 1) +endif() + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_init.cmake") + +polly_init( + "clang / LLVM Standard C++ Library (libc++) / \ +c++11 support / hidden / data-sections / function-sections" + "Unix Makefiles" +) + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_common.cmake") + +include("${CMAKE_CURRENT_LIST_DIR}/compiler/clang.cmake") +include("${CMAKE_CURRENT_LIST_DIR}/library/std/libcxx.cmake") +include("${CMAKE_CURRENT_LIST_DIR}/flags/cxx11.cmake") +include("${CMAKE_CURRENT_LIST_DIR}/flags/function-sections.cmake") +include("${CMAKE_CURRENT_LIST_DIR}/flags/data-sections.cmake") +include("${CMAKE_CURRENT_LIST_DIR}/flags/hidden.cmake") diff --git a/tools/polly/libcxx-hid.cmake b/tools/polly/libcxx-hid.cmake new file mode 100644 index 0000000..4a9793e --- /dev/null +++ b/tools/polly/libcxx-hid.cmake @@ -0,0 +1,22 @@ +# Copyright (c) 2013, Ruslan Baratov +# All rights reserved. + +if(DEFINED POLLY_CLANG_LIBCXX_CXX11_HID_) + return() +else() + set(POLLY_CLANG_LIBCXX_CXX11_HID_ 1) +endif() + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_init.cmake") + +polly_init( + "clang / LLVM Standard C++ Library (libc++) / c++11 support / hidden" + "Unix Makefiles" +) + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_common.cmake") + +include("${CMAKE_CURRENT_LIST_DIR}/compiler/clang.cmake") +include("${CMAKE_CURRENT_LIST_DIR}/library/std/libcxx.cmake") +include("${CMAKE_CURRENT_LIST_DIR}/flags/cxx11.cmake") +include("${CMAKE_CURRENT_LIST_DIR}/flags/hidden.cmake") diff --git a/tools/polly/libcxx-no-sdk.cmake b/tools/polly/libcxx-no-sdk.cmake new file mode 100644 index 0000000..84482b2 --- /dev/null +++ b/tools/polly/libcxx-no-sdk.cmake @@ -0,0 +1,21 @@ +# Copyright (c) 2013-2017, Ruslan Baratov +# All rights reserved. + +if(DEFINED POLLY_CLANG_LIBCXX_NO_SDK_CMAKE_) + return() +else() + set(POLLY_CLANG_LIBCXX_NO_SDK_CMAKE_ 1) +endif() + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_init.cmake") + +polly_init( + "clang / LLVM Standard C++ Library (libc++) / c++11 support / No OSX SDK" + "Unix Makefiles" +) + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_common.cmake") + +include("${CMAKE_CURRENT_LIST_DIR}/compiler/clang.cmake") +include("${CMAKE_CURRENT_LIST_DIR}/library/std/libcxx.cmake") +include("${CMAKE_CURRENT_LIST_DIR}/flags/cxx11.cmake") diff --git a/tools/polly/libcxx.cmake b/tools/polly/libcxx.cmake new file mode 100644 index 0000000..8cbf974 --- /dev/null +++ b/tools/polly/libcxx.cmake @@ -0,0 +1,23 @@ +# Copyright (c) 2013, Ruslan Baratov +# All rights reserved. + +if(DEFINED POLLY_CLANG_LIBCXX_CXX11_CMAKE) + return() +else() + set(POLLY_CLANG_LIBCXX_CXX11_CMAKE 1) +endif() + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_init.cmake") + +polly_init( + "clang / LLVM Standard C++ Library (libc++) / c++11 support" + "Unix Makefiles" +) + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_common.cmake") + +include("${CMAKE_CURRENT_LIST_DIR}/compiler/clang.cmake") +include("${CMAKE_CURRENT_LIST_DIR}/library/std/libcxx.cmake") +include("${CMAKE_CURRENT_LIST_DIR}/flags/cxx11.cmake") + +include("${CMAKE_CURRENT_LIST_DIR}/os/osx.cmake") diff --git a/tools/polly/libcxx14.cmake b/tools/polly/libcxx14.cmake new file mode 100644 index 0000000..15b2562 --- /dev/null +++ b/tools/polly/libcxx14.cmake @@ -0,0 +1,24 @@ +# Copyright (c) 2013-2018, Ruslan Baratov +# Copyright (c) 2018, David Hirvonen +# All rights reserved. + +if(DEFINED POLLY_CLANG_LIBCXX_CXX14_CMAKE) + return() +else() + set(POLLY_CLANG_LIBCXX_CXX14_CMAKE 1) +endif() + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_init.cmake") + +polly_init( + "clang / LLVM Standard C++ Library (libc++) / c++14 support" + "Unix Makefiles" +) + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_common.cmake") + +include("${CMAKE_CURRENT_LIST_DIR}/compiler/clang.cmake") +include("${CMAKE_CURRENT_LIST_DIR}/library/std/libcxx.cmake") +include("${CMAKE_CURRENT_LIST_DIR}/flags/cxx14.cmake") + +include("${CMAKE_CURRENT_LIST_DIR}/os/osx.cmake") diff --git a/tools/polly/library/std/libcxx.cmake b/tools/polly/library/std/libcxx.cmake new file mode 100644 index 0000000..1a11f8d --- /dev/null +++ b/tools/polly/library/std/libcxx.cmake @@ -0,0 +1,19 @@ +# Copyright (c) 2013, 2015, Ruslan Baratov +# All rights reserved. + +if(DEFINED POLLY_LIBRARY_STD_LIBCXX_CMAKE) + return() +else() + set(POLLY_LIBRARY_STD_LIBCXX_CMAKE 1) +endif() + +include(polly_add_cache_flag) + +polly_add_cache_flag(CMAKE_CXX_FLAGS "-stdlib=libc++") + +if(XCODE) + if(XCODE_VERSION VERSION_LESS 6) + polly_add_cache_flag(CMAKE_EXE_LINKER_FLAGS "-stdlib=libc++") + polly_add_cache_flag(CMAKE_SHARED_LINKER_FLAGS "-stdlib=libc++") + endif() +endif() diff --git a/tools/polly/library/std/libstdcxx.cmake b/tools/polly/library/std/libstdcxx.cmake new file mode 100644 index 0000000..2821866 --- /dev/null +++ b/tools/polly/library/std/libstdcxx.cmake @@ -0,0 +1,14 @@ +# Copyright (c) 2013, Ruslan Baratov +# All rights reserved. + +if(DEFINED POLLY_LIBRARY_STD_LIBSTDCXX_CMAKE) + return() +else() + set(POLLY_LIBRARY_STD_LIBSTDCXX_CMAKE 1) +endif() + +include(polly_add_cache_flag) + +polly_add_cache_flag(CMAKE_CXX_FLAGS "-stdlib=libstdc++") +polly_add_cache_flag(CMAKE_EXE_LINKER_FLAGS "-stdlib=libstdc++") +polly_add_cache_flag(CMAKE_SHARED_LINKER_FLAGS "-stdlib=libstdc++") diff --git a/tools/polly/library/std/nolibs.cmake b/tools/polly/library/std/nolibs.cmake new file mode 100644 index 0000000..282a56e --- /dev/null +++ b/tools/polly/library/std/nolibs.cmake @@ -0,0 +1,13 @@ +# Copyright (c) 2013, Ruslan Baratov +# All rights reserved. + +if(DEFINED POLLY_LIBRARY_STD_NOLIBS_CMAKE) + return() +else() + set(POLLY_LIBRARY_STD_NOLIBS_CMAKE 1) +endif() + +include(polly_add_cache_flag) + +polly_add_cache_flag(CMAKE_CXX_FLAGS "-nostdinc++") +polly_add_cache_flag(CMAKE_EXE_LINKER_FLAGS "-nodefaultlibs") diff --git a/tools/polly/linux-gcc-armhf-neon-vfpv4.cmake b/tools/polly/linux-gcc-armhf-neon-vfpv4.cmake new file mode 100644 index 0000000..1c0ab13 --- /dev/null +++ b/tools/polly/linux-gcc-armhf-neon-vfpv4.cmake @@ -0,0 +1,34 @@ +# Copyright (c) 2017, NeroBurner +# All rights reserved. + +# install cross compiler on Ubuntu +# - sudo apt install g++-arm-linux-gnueabihf +# - with gfortran: sudo apt install gfortran-arm-linux-gnueabihf + +if(DEFINED POLLY_LINUX_GCC_ARMHF_NEON_VFPV4_) + return() +else() + set(POLLY_LINUX_GCC_ARMHF_NEON_VFPV4_ 1) +endif() + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_init.cmake") + +polly_init( + "Linux / gcc / armhf / c++11 support / neon-vfpv4" + "Unix Makefiles" +) + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_common.cmake") + +# set system name, this sets the variable CMAKE_CROSSCOMPILING +set(CMAKE_SYSTEM_NAME Linux) +set(CROSS_COMPILE_TOOLCHAIN_PREFIX "arm-linux-gnueabihf") +set(CMAKE_CROSSCOMPILING_EMULATOR qemu-arm) # used for try_run calls + +include( + "${CMAKE_CURRENT_LIST_DIR}/compiler/gcc-cross-compile-simple-layout.cmake" +) +include("${CMAKE_CURRENT_LIST_DIR}/flags/cxx11.cmake") +include("${CMAKE_CURRENT_LIST_DIR}/flags/hardfloat.cmake") +include("${CMAKE_CURRENT_LIST_DIR}/flags/neon-vfpv4.cmake") + diff --git a/tools/polly/linux-gcc-armhf-neon.cmake b/tools/polly/linux-gcc-armhf-neon.cmake new file mode 100644 index 0000000..0a1ad64 --- /dev/null +++ b/tools/polly/linux-gcc-armhf-neon.cmake @@ -0,0 +1,34 @@ +# Copyright (c) 2017, NeroBurner +# All rights reserved. + +# install cross compiler on Ubuntu +# - sudo apt install g++-arm-linux-gnueabihf +# - with gfortran: sudo apt install gfortran-arm-linux-gnueabihf + +if(DEFINED POLLY_LINUX_GCC_ARMHF_NEON_) + return() +else() + set(POLLY_LINUX_GCC_ARMHF_NEON_ 1) +endif() + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_init.cmake") + +polly_init( + "Linux / gcc / armhf / c++11 support / neon" + "Unix Makefiles" +) + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_common.cmake") + +# set system name, this sets the variable CMAKE_CROSSCOMPILING +set(CMAKE_SYSTEM_NAME Linux) +set(CROSS_COMPILE_TOOLCHAIN_PREFIX "arm-linux-gnueabihf") +set(CMAKE_CROSSCOMPILING_EMULATOR qemu-arm) # used for try_run calls + +include( + "${CMAKE_CURRENT_LIST_DIR}/compiler/gcc-cross-compile-simple-layout.cmake" +) +include("${CMAKE_CURRENT_LIST_DIR}/flags/cxx11.cmake") +include("${CMAKE_CURRENT_LIST_DIR}/flags/hardfloat.cmake") +include("${CMAKE_CURRENT_LIST_DIR}/flags/neon.cmake") + diff --git a/tools/polly/linux-gcc-armhf.cmake b/tools/polly/linux-gcc-armhf.cmake new file mode 100644 index 0000000..cd5fc9f --- /dev/null +++ b/tools/polly/linux-gcc-armhf.cmake @@ -0,0 +1,33 @@ +# Copyright (c) 2017, NeroBurner +# All rights reserved. + +# install cross compiler on Ubuntu +# - sudo apt install g++-arm-linux-gnueabihf +# - with gfortran: sudo apt install gfortran-arm-linux-gnueabihf + +if(DEFINED POLLY_LINUX_GCC_ARMHF_) + return() +else() + set(POLLY_LINUX_GCC_ARMHF_ 1) +endif() + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_init.cmake") + +polly_init( + "Linux / gcc / armhf / c++11 support" + "Unix Makefiles" +) + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_common.cmake") + +# set system name, this sets the variable CMAKE_CROSSCOMPILING +set(CMAKE_SYSTEM_NAME Linux) +set(CROSS_COMPILE_TOOLCHAIN_PREFIX "arm-linux-gnueabihf") +set(CMAKE_CROSSCOMPILING_EMULATOR qemu-arm) # used for try_run calls + +include( + "${CMAKE_CURRENT_LIST_DIR}/compiler/gcc-cross-compile-simple-layout.cmake" +) +include("${CMAKE_CURRENT_LIST_DIR}/flags/cxx11.cmake") +include("${CMAKE_CURRENT_LIST_DIR}/flags/hardfloat.cmake") + diff --git a/tools/polly/linux-gcc-jetson-tk1.cmake b/tools/polly/linux-gcc-jetson-tk1.cmake new file mode 100644 index 0000000..e5dce65 --- /dev/null +++ b/tools/polly/linux-gcc-jetson-tk1.cmake @@ -0,0 +1,35 @@ +# Copyright (c) 2017, NeroBurner +# All rights reserved. + +# install cross compiler on Ubuntu +# - sudo apt install g++-arm-linux-gnueabihf +# - with gfortran: sudo apt install gfortran-arm-linux-gnueabihf + +if(DEFINED POLLY_LINUX_GCC_JETSON_TK1_) + return() +else() + set(POLLY_LINUX_GCC_JETSON_TK1_ 1) +endif() + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_init.cmake") + +polly_init( + "Linux / gcc / armhf / c++11 support / neon-vfpv4 / cortex-a15" + "Unix Makefiles" +) + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_common.cmake") + +# set system name, this sets the variable CMAKE_CROSSCOMPILING +set(CMAKE_SYSTEM_NAME Linux) +set(CROSS_COMPILE_TOOLCHAIN_PREFIX "arm-linux-gnueabihf") +set(CMAKE_CROSSCOMPILING_EMULATOR qemu-arm) # used for try_run calls + +include( + "${CMAKE_CURRENT_LIST_DIR}/compiler/gcc-cross-compile-simple-layout.cmake" +) +include("${CMAKE_CURRENT_LIST_DIR}/flags/cxx11.cmake") +include("${CMAKE_CURRENT_LIST_DIR}/flags/hardfloat.cmake") +include("${CMAKE_CURRENT_LIST_DIR}/flags/neon-vfpv4.cmake") +include("${CMAKE_CURRENT_LIST_DIR}/flags/mtune_cortex-a15.cmake") + diff --git a/tools/polly/linux-gcc-x64.cmake b/tools/polly/linux-gcc-x64.cmake new file mode 100644 index 0000000..c771c53 --- /dev/null +++ b/tools/polly/linux-gcc-x64.cmake @@ -0,0 +1,25 @@ +# Copyright (c) 2015, Ruslan Baratov +# All rights reserved. + +if(DEFINED POLLY_LINUX_GCC_X64_) + return() +else() + set(POLLY_LINUX_GCC_X64_ 1) +endif() + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_init.cmake") + +polly_init( + "Linux / gcc / x86_64 / c++11 support" + "Unix Makefiles" +) + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_common.cmake") + +set(CROSS_COMPILE_TOOLCHAIN_PREFIX "x86_64-pc-linux") + +include( + "${CMAKE_CURRENT_LIST_DIR}/compiler/gcc-cross-compile-simple-layout.cmake" +) +include("${CMAKE_CURRENT_LIST_DIR}/flags/cxx11.cmake") +include("${CMAKE_CURRENT_LIST_DIR}/flags/static.cmake") diff --git a/tools/polly/linux-mingw-w32.cmake b/tools/polly/linux-mingw-w32.cmake new file mode 100644 index 0000000..f233a8c --- /dev/null +++ b/tools/polly/linux-mingw-w32.cmake @@ -0,0 +1,29 @@ +# Copyright (c) 2017, NeroBurner +# All rights reserved. + +if(DEFINED POLLY_LINUX_MINGW_W32_) + return() +else() + set(POLLY_LINUX_MINGW_W32_ 1) +endif() + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_init.cmake") + +polly_init( + "Windows / mingw-w64 / i686 / c++11 support / static" + "Unix Makefiles" +) + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_common.cmake") + +# need to set system name for cross compiling from linux to windows +set(CMAKE_SYSTEM_NAME Windows) +set(CROSS_COMPILE_TOOLCHAIN_PREFIX "i686-w64-mingw32") +set(CMAKE_CROSSCOMPILING_EMULATOR wine64) # used for try_run calls + +include( + "${CMAKE_CURRENT_LIST_DIR}/compiler/gcc-cross-compile-simple-layout.cmake" +) +include("${CMAKE_CURRENT_LIST_DIR}/flags/cxx11.cmake") +include("${CMAKE_CURRENT_LIST_DIR}/flags/static.cmake") + diff --git a/tools/polly/linux-mingw-w64-cxx98.cmake b/tools/polly/linux-mingw-w64-cxx98.cmake new file mode 100644 index 0000000..3427738 --- /dev/null +++ b/tools/polly/linux-mingw-w64-cxx98.cmake @@ -0,0 +1,28 @@ +# Copyright (c) 2017, NeroBurner +# All rights reserved. + +if(DEFINED POLLY_LINUX_MINGW_W64_CXX98_) + return() +else() + set(POLLY_LINUX_MINGW_W64_CXX98_ 1) +endif() + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_init.cmake") + +polly_init( + "Windows / mingw-w64 / x86_64 / c++98 support / static" + "Unix Makefiles" +) + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_common.cmake") + +# need to set system name for cross compiling from linux to windows +set(CMAKE_SYSTEM_NAME Windows) +set(CROSS_COMPILE_TOOLCHAIN_PREFIX "x86_64-w64-mingw32") +set(CMAKE_CROSSCOMPILING_EMULATOR wine64) # used for try_run calls + +include( + "${CMAKE_CURRENT_LIST_DIR}/compiler/gcc-cross-compile-simple-layout.cmake" +) + +include("${CMAKE_CURRENT_LIST_DIR}/flags/static.cmake") diff --git a/tools/polly/linux-mingw-w64-gnuxx11.cmake b/tools/polly/linux-mingw-w64-gnuxx11.cmake new file mode 100644 index 0000000..21319d8 --- /dev/null +++ b/tools/polly/linux-mingw-w64-gnuxx11.cmake @@ -0,0 +1,28 @@ +# Copyright (c) 2017, NeroBurner +# All rights reserved. + +if(DEFINED POLLY_LINUX_MINGW_W64_GNUXX11_) + return() +else() + set(POLLY_LINUX_MINGW_W64_GNUXX11_ 1) +endif() + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_init.cmake") + +polly_init( + "Windows / mingw-w64 / x86_64 / gnu++11 support" + "Unix Makefiles" +) + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_common.cmake") + +# need to set system name for cross compiling from linux to windows +set(CMAKE_SYSTEM_NAME Windows) +set(CROSS_COMPILE_TOOLCHAIN_PREFIX "x86_64-w64-mingw32") +set(CMAKE_CROSSCOMPILING_EMULATOR wine64) # used for try_run calls + +include( + "${CMAKE_CURRENT_LIST_DIR}/compiler/gcc-cross-compile-simple-layout.cmake" +) +include("${CMAKE_CURRENT_LIST_DIR}/flags/gnuxx11.cmake") + diff --git a/tools/polly/linux-mingw-w64.cmake b/tools/polly/linux-mingw-w64.cmake new file mode 100644 index 0000000..1f26709 --- /dev/null +++ b/tools/polly/linux-mingw-w64.cmake @@ -0,0 +1,29 @@ +# Copyright (c) 2017, NeroBurner +# All rights reserved. + +if(DEFINED POLLY_LINUX_MINGW_W64_) + return() +else() + set(POLLY_LINUX_MINGW_W64_ 1) +endif() + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_init.cmake") + +polly_init( + "Windows / mingw-w64 / x86_64 / c++11 support / static" + "Unix Makefiles" +) + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_common.cmake") + +# need to set system name for cross compiling from linux to windows +set(CMAKE_SYSTEM_NAME Windows) +set(CROSS_COMPILE_TOOLCHAIN_PREFIX "x86_64-w64-mingw32") +set(CMAKE_CROSSCOMPILING_EMULATOR wine64) # used for try_run calls + +include( + "${CMAKE_CURRENT_LIST_DIR}/compiler/gcc-cross-compile-simple-layout.cmake" +) +include("${CMAKE_CURRENT_LIST_DIR}/flags/cxx11.cmake") +include("${CMAKE_CURRENT_LIST_DIR}/flags/static.cmake") + diff --git a/tools/polly/mingw-c11.cmake b/tools/polly/mingw-c11.cmake new file mode 100644 index 0000000..faa1c2a --- /dev/null +++ b/tools/polly/mingw-c11.cmake @@ -0,0 +1,21 @@ +# Copyright (c) 2014, Ruslan Baratov +# All rights reserved. + +if(DEFINED POLLY_MINGW_CMAKE_) + return() +else() + set(POLLY_MINGW_CMAKE_ 1) +endif() + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_init.cmake") + +polly_init( + "mingw / gcc / c++11 support / C11" + "MinGW Makefiles" +) + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_common.cmake") + +include("${CMAKE_CURRENT_LIST_DIR}/compiler/gcc.cmake") +include("${CMAKE_CURRENT_LIST_DIR}/flags/cxx11.cmake") +include("${CMAKE_CURRENT_LIST_DIR}/flags/c11.cmake") diff --git a/tools/polly/mingw-cxx14.cmake b/tools/polly/mingw-cxx14.cmake new file mode 100644 index 0000000..76cd749 --- /dev/null +++ b/tools/polly/mingw-cxx14.cmake @@ -0,0 +1,20 @@ +# Copyright (c) 2014, Ruslan Baratov +# All rights reserved. + +if(DEFINED POLLY_MINGW_CXX14_CMAKE_) + return() +else() + set(POLLY_MINGW_CXX14_CMAKE_ 1) +endif() + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_init.cmake") + +polly_init( + "mingw / gcc / c++14 support" + "MinGW Makefiles" +) + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_common.cmake") + +include("${CMAKE_CURRENT_LIST_DIR}/compiler/gcc.cmake") +include("${CMAKE_CURRENT_LIST_DIR}/flags/cxx14.cmake") diff --git a/tools/polly/mingw-cxx17.cmake b/tools/polly/mingw-cxx17.cmake new file mode 100644 index 0000000..b660210 --- /dev/null +++ b/tools/polly/mingw-cxx17.cmake @@ -0,0 +1,20 @@ +# Copyright (c) 2014, Ruslan Baratov +# All rights reserved. + +if(DEFINED POLLY_MINGW_CXX17_CMAKE_) + return() +else() + set(POLLY_MINGW_CXX17_CMAKE_ 1) +endif() + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_init.cmake") + +polly_init( + "mingw / gcc / c++17 support" + "MinGW Makefiles" +) + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_common.cmake") + +include("${CMAKE_CURRENT_LIST_DIR}/compiler/gcc.cmake") +include("${CMAKE_CURRENT_LIST_DIR}/flags/cxx17.cmake") diff --git a/tools/polly/mingw.cmake b/tools/polly/mingw.cmake new file mode 100644 index 0000000..165e335 --- /dev/null +++ b/tools/polly/mingw.cmake @@ -0,0 +1,20 @@ +# Copyright (c) 2014, Ruslan Baratov +# All rights reserved. + +if(DEFINED POLLY_MINGW_CMAKE_) + return() +else() + set(POLLY_MINGW_CMAKE_ 1) +endif() + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_init.cmake") + +polly_init( + "mingw / gcc / c++11 support" + "MinGW Makefiles" +) + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_common.cmake") + +include("${CMAKE_CURRENT_LIST_DIR}/compiler/gcc.cmake") +include("${CMAKE_CURRENT_LIST_DIR}/flags/cxx11.cmake") diff --git a/tools/polly/msys-cxx14.cmake b/tools/polly/msys-cxx14.cmake new file mode 100644 index 0000000..6e1d0b2 --- /dev/null +++ b/tools/polly/msys-cxx14.cmake @@ -0,0 +1,20 @@ +# Copyright (c) 2014, Ruslan Baratov +# All rights reserved. + +if(DEFINED POLLY_MSYS_CXX14_CMAKE_) + return() +else() + set(POLLY_MSYS_CXX14_CMAKE_ 1) +endif() + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_init.cmake") + +polly_init( + "MSYS / gcc / c++14 support" + "MSYS Makefiles" +) + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_common.cmake") + +include("${CMAKE_CURRENT_LIST_DIR}/compiler/gcc.cmake") +include("${CMAKE_CURRENT_LIST_DIR}/flags/cxx14.cmake") diff --git a/tools/polly/msys-cxx17.cmake b/tools/polly/msys-cxx17.cmake new file mode 100644 index 0000000..57e4ca7 --- /dev/null +++ b/tools/polly/msys-cxx17.cmake @@ -0,0 +1,20 @@ +# Copyright (c) 2014, Ruslan Baratov +# All rights reserved. + +if(DEFINED POLLY_MSYS_CXX17_CMAKE_) + return() +else() + set(POLLY_MSYS_CXX17_CMAKE_ 1) +endif() + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_init.cmake") + +polly_init( + "MSYS / gcc / c++17 support" + "MSYS Makefiles" +) + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_common.cmake") + +include("${CMAKE_CURRENT_LIST_DIR}/compiler/gcc.cmake") +include("${CMAKE_CURRENT_LIST_DIR}/flags/cxx17.cmake") diff --git a/tools/polly/msys.cmake b/tools/polly/msys.cmake new file mode 100644 index 0000000..74b4451 --- /dev/null +++ b/tools/polly/msys.cmake @@ -0,0 +1,20 @@ +# Copyright (c) 2014, Ruslan Baratov +# All rights reserved. + +if(DEFINED POLLY_MSYS_CMAKE_) + return() +else() + set(POLLY_MSYS_CMAKE_ 1) +endif() + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_init.cmake") + +polly_init( + "MSYS / gcc / c++11 support" + "MSYS Makefiles" +) + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_common.cmake") + +include("${CMAKE_CURRENT_LIST_DIR}/compiler/gcc.cmake") +include("${CMAKE_CURRENT_LIST_DIR}/flags/cxx11.cmake") diff --git a/tools/polly/ninja-vs-12-2013-win64.cmake b/tools/polly/ninja-vs-12-2013-win64.cmake new file mode 100644 index 0000000..641d317 --- /dev/null +++ b/tools/polly/ninja-vs-12-2013-win64.cmake @@ -0,0 +1,19 @@ +# Copyright (c) 2016, Ruslan Baratov +# All rights reserved. + +if(DEFINED POLLY_NINJA_VS_12_2013_WIN64_CMAKE_) + return() +else() + set(POLLY_NINJA_VS_12_2013_WIN64_CMAKE_ 1) +endif() + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_init.cmake") + +polly_init( + "Ninja / Visual Studio 2013 / x64" + "Ninja" +) + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_common.cmake") + +include("${CMAKE_CURRENT_LIST_DIR}/compiler/cl.cmake") diff --git a/tools/polly/ninja-vs-14-2015-win64.cmake b/tools/polly/ninja-vs-14-2015-win64.cmake new file mode 100644 index 0000000..68a3a50 --- /dev/null +++ b/tools/polly/ninja-vs-14-2015-win64.cmake @@ -0,0 +1,19 @@ +# Copyright (c) 2016, Ruslan Baratov +# All rights reserved. + +if(DEFINED POLLY_NINJA_VS_14_2015_WIN64_CMAKE_) + return() +else() + set(POLLY_NINJA_VS_14_2015_WIN64_CMAKE_ 1) +endif() + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_init.cmake") + +polly_init( + "Ninja / Visual Studio 2015 / x64" + "Ninja" +) + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_common.cmake") + +include("${CMAKE_CURRENT_LIST_DIR}/compiler/cl.cmake") diff --git a/tools/polly/ninja-vs-15-2017-win64-cxx17.cmake b/tools/polly/ninja-vs-15-2017-win64-cxx17.cmake new file mode 100644 index 0000000..1412a9b --- /dev/null +++ b/tools/polly/ninja-vs-15-2017-win64-cxx17.cmake @@ -0,0 +1,20 @@ +# Copyright (c) 2016, 2018, Ruslan Baratov +# All rights reserved. + +if(DEFINED POLLY_NINJA_VS_15_2017_WIN64_CXX17_CMAKE_) + return() +else() + set(POLLY_NINJA_VS_15_2017_WIN64_CXX17_CMAKE_ 1) +endif() + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_init.cmake") + +polly_init( + "Ninja / Visual Studio 2017 / x64 / C++17" + "Ninja" +) + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_common.cmake") + +include("${CMAKE_CURRENT_LIST_DIR}/compiler/cl.cmake") +include("${CMAKE_CURRENT_LIST_DIR}/flags/vs-cxx17.cmake") diff --git a/tools/polly/ninja-vs-15-2017-win64.cmake b/tools/polly/ninja-vs-15-2017-win64.cmake new file mode 100644 index 0000000..c4953da --- /dev/null +++ b/tools/polly/ninja-vs-15-2017-win64.cmake @@ -0,0 +1,19 @@ +# Copyright (c) 2016, 2018, Ruslan Baratov +# All rights reserved. + +if(DEFINED POLLY_NINJA_VS_15_2017_WIN64_CMAKE_) + return() +else() + set(POLLY_NINJA_VS_15_2017_WIN64_CMAKE_ 1) +endif() + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_init.cmake") + +polly_init( + "Ninja / Visual Studio 2017 / x64" + "Ninja" +) + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_common.cmake") + +include("${CMAKE_CURRENT_LIST_DIR}/compiler/cl.cmake") diff --git a/tools/polly/nmake-vs-12-2013-win64.cmake b/tools/polly/nmake-vs-12-2013-win64.cmake new file mode 100644 index 0000000..50e9540 --- /dev/null +++ b/tools/polly/nmake-vs-12-2013-win64.cmake @@ -0,0 +1,17 @@ +# Copyright (c) 2014, Ruslan Baratov +# All rights reserved. + +if(DEFINED POLLY_NMAKE_VS_12_2013_WIN64_CMAKE_) + return() +else() + set(POLLY_NMAKE_VS_12_2013_WIN64_CMAKE_ 1) +endif() + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_init.cmake") + +polly_init( + "NMake / Visual Studio 2013 / x64" + "NMake Makefiles" +) + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_common.cmake") diff --git a/tools/polly/nmake-vs-12-2013.cmake b/tools/polly/nmake-vs-12-2013.cmake new file mode 100644 index 0000000..20f21ce --- /dev/null +++ b/tools/polly/nmake-vs-12-2013.cmake @@ -0,0 +1,17 @@ +# Copyright (c) 2014, Ruslan Baratov +# All rights reserved. + +if(DEFINED POLLY_NMAKE_VS_12_2013_CMAKE_) + return() +else() + set(POLLY_NMAKE_VS_12_2013_CMAKE_ 1) +endif() + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_init.cmake") + +polly_init( + "NMake / Visual Studio 2013 / x86" + "NMake Makefiles" +) + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_common.cmake") diff --git a/tools/polly/nmake-vs-15-2017-win64-cxx17.cmake b/tools/polly/nmake-vs-15-2017-win64-cxx17.cmake new file mode 100644 index 0000000..8e353d9 --- /dev/null +++ b/tools/polly/nmake-vs-15-2017-win64-cxx17.cmake @@ -0,0 +1,18 @@ +# Copyright (c) 2014, 2018, Ruslan Baratov +# All rights reserved. + +if(DEFINED POLLY_NMAKE_VS_15_2017_WIN64_CXX17_CMAKE_) + return() +else() + set(POLLY_NMAKE_VS_15_2017_WIN64_CXX17_CMAKE_ 1) +endif() + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_init.cmake") + +polly_init( + "NMake / Visual Studio 2017 / x64 / C++17" + "NMake Makefiles" +) + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_common.cmake") +include("${CMAKE_CURRENT_LIST_DIR}/flags/vs-cxx17.cmake") diff --git a/tools/polly/nmake-vs-15-2017-win64.cmake b/tools/polly/nmake-vs-15-2017-win64.cmake new file mode 100644 index 0000000..511767f --- /dev/null +++ b/tools/polly/nmake-vs-15-2017-win64.cmake @@ -0,0 +1,17 @@ +# Copyright (c) 2014, 2018, Ruslan Baratov +# All rights reserved. + +if(DEFINED POLLY_NMAKE_VS_15_2017_WIN64_CMAKE_) + return() +else() + set(POLLY_NMAKE_VS_15_2017_WIN64_CMAKE_ 1) +endif() + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_init.cmake") + +polly_init( + "NMake / Visual Studio 2017 / x64" + "NMake Makefiles" +) + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_common.cmake") diff --git a/tools/polly/openbsd-egcc-cxx11-static-std.cmake b/tools/polly/openbsd-egcc-cxx11-static-std.cmake new file mode 100644 index 0000000..f309ea1 --- /dev/null +++ b/tools/polly/openbsd-egcc-cxx11-static-std.cmake @@ -0,0 +1,24 @@ +# Copyright (c) 2013, Ruslan Baratov +# All rights reserved. + +if(DEFINED POLLY_CLANG_OPENBSD_CMAKE) + return() +else() + set(POLLY_CLANG_OPENBSD_CMAKE 1) +endif() + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_init.cmake") + +polly_init( + "openbsd / egcc / GNU Standard C++ Library (libstdc++) / c++11 support" + "Unix Makefiles" +) + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_common.cmake") + +include("${CMAKE_CURRENT_LIST_DIR}/compiler/egcc.cmake") +#include("${CMAKE_CURRENT_LIST_DIR}/library/std/libstdcxx.cmake") +include("${CMAKE_CURRENT_LIST_DIR}/flags/cxx11.cmake") +include("${CMAKE_CURRENT_LIST_DIR}/flags/fpic.cmake") +include("${CMAKE_CURRENT_LIST_DIR}/flags/static-std.cmake") + diff --git a/tools/polly/os/android.cmake b/tools/polly/os/android.cmake new file mode 100644 index 0000000..f7e05de --- /dev/null +++ b/tools/polly/os/android.cmake @@ -0,0 +1,64 @@ +# Copyright (c) 2015, Ruslan Baratov +# All rights reserved. + +if(DEFINED POLLY_OS_ANDROID_CMAKE_) + return() +else() + set(POLLY_OS_ANDROID_CMAKE_ 1) +endif() + +include(polly_fatal_error) + +string(COMPARE EQUAL "${ANDROID_NDK_VERSION}" "" _is_empty) +if(_is_empty) + polly_fatal_error("ANDROID_NDK_VERSION is not defined") +endif() + +set(_env_ndk "$ENV{ANDROID_NDK_${ANDROID_NDK_VERSION}}") +string(COMPARE EQUAL "${_env_ndk}" "" _is_empty) +if(_is_empty) + polly_fatal_error( + "Environment variable 'ANDROID_NDK_${ANDROID_NDK_VERSION}' not set" + ) +endif() + +set(ANDROID_NDK "${_env_ndk}") + +string(COMPARE EQUAL "${CMAKE_SYSTEM_VERSION}" "" _is_empty) +if(_is_empty) + polly_fatal_error("CMAKE_SYSTEM_VERSION is not defined") +endif() + +set(CMAKE_SYSTEM_NAME "Android") + +if(CMAKE_VERSION VERSION_LESS 3.7.1) + polly_fatal_error( + "Minimum CMake version for Android is 3.7.1:" + "* http://polly.readthedocs.io/en/latest/toolchains/android.html#android-ndk-x-api-y" + ) +endif() + +macro(find_host_program) + set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER) + set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY NEVER) + set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE NEVER) + if(CMAKE_HOST_WIN32) + set(WIN32 1) + set(UNIX) + elseif(CMAKE_HOST_APPLE) + set(APPLE 1) + set(UNIX) + endif() + find_program(${ARGN}) + set(WIN32) + set(APPLE) + set(UNIX 1) + set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM ONLY) + set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY) + set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY) +endmacro() + +# ANDROID macro is not defined by CMake 3.7+, however it is used by +# some packages like OpenCV +# (https://gitlab.kitware.com/cmake/cmake/merge_requests/62) +add_definitions("-DANDROID") diff --git a/tools/polly/os/cygwin.cmake b/tools/polly/os/cygwin.cmake new file mode 100644 index 0000000..cc268a0 --- /dev/null +++ b/tools/polly/os/cygwin.cmake @@ -0,0 +1,12 @@ +# Copyright (c) 2014, Ruslan Baratov +# All rights reserved. + +if(DEFINED POLLY_OS_CYGWIN_CMAKE_) + return() +else() + set(POLLY_OS_CYGWIN_CMAKE_ 1) +endif() + +include(polly_add_cache_flag) + +polly_add_cache_flag(CMAKE_CXX_FLAGS "-U__STRICT_ANSI__") diff --git a/tools/polly/os/iphone-default-sdk.cmake b/tools/polly/os/iphone-default-sdk.cmake new file mode 100644 index 0000000..6ba5f33 --- /dev/null +++ b/tools/polly/os/iphone-default-sdk.cmake @@ -0,0 +1,73 @@ +# This script sets the following variables : +# IOS_SDK_VERSION : will contain the version number of the default iOS SDK (example : 11.0) +# IPHONEOS_SDK_ROOT : full path to the SDK +# IPHONEOS_ROOT +# XCODE_DEVELOPER_ROOT + +if(DEFINED POLLY_IPHONE_DEFAULT_SDK_CMAKE) + return() +else() + set(POLLY_IPHONE_DEFAULT_SDK_CMAKE 1) +endif() + +include(polly_status_debug) + +# polly_find_xcode_ios_defaults : +# fills +# * XCODE_DEVELOPER_ROOT +# * IPHONEOS_ROOT +# * IPHONEOS_SDK_ROOT +macro (polly_find_xcode_ios_defaults) + find_program(XCODE_SELECT_EXECUTABLE xcode-select) + if(NOT XCODE_SELECT_EXECUTABLE) + polly_fatal_error("xcode-select not found") + endif() + execute_process( + COMMAND + ${XCODE_SELECT_EXECUTABLE} + "-print-path" + OUTPUT_VARIABLE + XCODE_DEVELOPER_ROOT # /.../Xcode.app/Contents/Developer + OUTPUT_STRIP_TRAILING_WHITESPACE + RESULT_VARIABLE + _XCODE_DEVELOPER_ROOT_STATUS + ) + if(NOT "${_XCODE_DEVELOPER_ROOT_STATUS}" EQUAL "0") + polly_fatal_error("Could not find XCODE_DEVELOPER_ROOT. + The command + ${XCODE_SELECT_EXECUTABLE} -print-path + failed with the following status : ${_XCODE_DEVELOPER_ROOT_STATUS} + ") + endif() + + set(IPHONEOS_ROOT "${XCODE_DEVELOPER_ROOT}/Platforms/iPhoneOS.platform/Developer") + # The defautl SDK is at ${IPHONEOS_ROOT}/SDKs/iPhoneOS.sdk + set(IPHONEOS_SDK_ROOT "${IPHONEOS_ROOT}/SDKs/iPhoneOS.sdk") + polly_status_debug("XCODE_DEVELOPER_ROOT=${XCODE_DEVELOPER_ROOT}") + polly_status_debug("IPHONEOS_ROOT=${IPHONEOS_ROOT}") + polly_status_debug("IPHONEOS_SDK_ROOT=${IPHONEOS_SDK_ROOT}") +endmacro() + +polly_find_xcode_ios_defaults() + +# The version number of the SDK can be accessed by reading the SDKSettings.plist file with the command : +# defaults read ${IPHONEOS_SDK_ROOT}/SDKSettings.plist DefaultDeploymentTarget +execute_process( + COMMAND + "defaults" + read + ${IPHONEOS_SDK_ROOT}/SDKSettings.plist + DefaultDeploymentTarget + RESULT_VARIABLE _POLLY_PROCESS_RESULT + OUTPUT_VARIABLE IOS_SDK_VERSION + OUTPUT_STRIP_TRAILING_WHITESPACE + ERROR_STRIP_TRAILING_WHITESPACE +) +if(NOT "${_POLLY_PROCESS_RESULT}" EQUAL "0") + polly_fatal_error("Could not read the iPhoneSDK version (). + The command + defaults read ${IPHONEOS_SDK_ROOT}/SDKSettings.plist DefaultDeploymentTarget + failed with the following status : ${_POLLY_PROCESS_RESULT} + ") +endif() +polly_status_debug("IOS_SDK_VERSION=${IOS_SDK_VERSION}") diff --git a/tools/polly/os/iphone.cmake b/tools/polly/os/iphone.cmake new file mode 100644 index 0000000..30cb297 --- /dev/null +++ b/tools/polly/os/iphone.cmake @@ -0,0 +1,165 @@ +# Copyright (c) 2014, Ruslan Baratov +# All rights reserved. + +if(DEFINED POLLY_OS_IPHONE_CMAKE) + return() +else() + set(POLLY_OS_IPHONE_CMAKE 1) +endif() + +set(CMAKE_OSX_SYSROOT "iphoneos" CACHE STRING "System root for iOS" FORCE) +set(CMAKE_XCODE_EFFECTIVE_PLATFORMS "-iphoneos;-iphonesimulator") + +# find 'iphoneos' and 'iphonesimulator' roots and version +find_program(XCODE_SELECT_EXECUTABLE xcode-select) +if(NOT XCODE_SELECT_EXECUTABLE) + polly_fatal_error("xcode-select not found") +endif() + +if(XCODE_VERSION VERSION_LESS "5.0.0") + polly_fatal_error("Works since Xcode 5.0.0 (current ver: ${XCODE_VERSION})") +endif() + +if(CMAKE_VERSION VERSION_LESS "3.5") + polly_fatal_error( + "CMake minimum required version for iOS is 3.5 (current ver: ${CMAKE_VERSION})" + ) +endif() + +string(COMPARE EQUAL "$ENV{DEVELOPER_DIR}" "" _is_empty) +if(NOT _is_empty) + polly_status_debug("Developer root (env): $ENV{DEVELOPER_DIR}") +endif() + +execute_process( + COMMAND + ${XCODE_SELECT_EXECUTABLE} + "-print-path" + OUTPUT_VARIABLE + XCODE_DEVELOPER_ROOT # /.../Xcode.app/Contents/Developer + OUTPUT_STRIP_TRAILING_WHITESPACE +) + +polly_status_debug("Developer root: ${XCODE_DEVELOPER_ROOT}") + +find_program(XCODEBUILD_EXECUTABLE xcodebuild) +if(NOT XCODEBUILD_EXECUTABLE) + polly_fatal_error("xcodebuild not found") +endif() + +# Check version exists +execute_process( + COMMAND + "${XCODEBUILD_EXECUTABLE}" + -showsdks + -sdk + "iphoneos${IOS_SDK_VERSION}" + RESULT_VARIABLE + IOS_SDK_VERSION_RESULT + OUTPUT_QUIET + ERROR_QUIET +) +if(NOT "${IOS_SDK_VERSION_RESULT}" EQUAL 0) + polly_fatal_error("iOS version `${IOS_SDK_VERSION}` not found (${IOS_SDK_VERSION_RESULT})") +endif() + +# iPhone simulator root +set( + IPHONESIMULATOR_ROOT + "${XCODE_DEVELOPER_ROOT}/Platforms/iPhoneSimulator.platform/Developer" +) +if(NOT EXISTS "${IPHONESIMULATOR_ROOT}") + polly_fatal_error( + "IPHONESIMULATOR_ROOT not found (${IPHONESIMULATOR_ROOT})\n" + "XCODE_DEVELOPER_ROOT: ${XCODE_DEVELOPER_ROOT}\n" + ) +endif() + +# iPhone simulator SDK root +set( + IPHONESIMULATOR_SDK_ROOT + "${IPHONESIMULATOR_ROOT}/SDKs/iPhoneSimulator${IOS_SDK_VERSION}.sdk" +) + +if(NOT EXISTS ${IPHONESIMULATOR_SDK_ROOT}) + polly_fatal_error( + "IPHONESIMULATOR_SDK_ROOT not found (${IPHONESIMULATOR_SDK_ROOT})\n" + "IPHONESIMULATOR_ROOT: ${IPHONESIMULATOR_ROOT}\n" + "IOS_SDK_VERSION: ${IOS_SDK_VERSION}\n" + ) +endif() + +# iPhone root +set( + IPHONEOS_ROOT + "${XCODE_DEVELOPER_ROOT}/Platforms/iPhoneOS.platform/Developer" +) +if(NOT EXISTS "${IPHONEOS_ROOT}") + polly_fatal_error( + "IPHONEOS_ROOT not found (${IPHONEOS_ROOT})\n" + "XCODE_DEVELOPER_ROOT: ${XCODE_DEVELOPER_ROOT}\n" + ) +endif() + +# iPhone SDK root +set(IPHONEOS_SDK_ROOT "${IPHONEOS_ROOT}/SDKs/iPhoneOS${IOS_SDK_VERSION}.sdk") + +if(NOT EXISTS ${IPHONEOS_SDK_ROOT}) + hunter_fatal_error( + "IPHONEOS_SDK_ROOT not found (${IPHONEOS_SDK_ROOT})\n" + "IPHONEOS_ROOT: ${IPHONEOS_ROOT}\n" + "IOS_SDK_VERSION: ${IOS_SDK_VERSION}\n" + ) +endif() + +string(COMPARE EQUAL "${IOS_DEPLOYMENT_SDK_VERSION}" "" _is_empty) +if(_is_empty) + set( + CMAKE_XCODE_ATTRIBUTE_IPHONEOS_DEPLOYMENT_TARGET + "${IOS_SDK_VERSION}" + ) +else() + set( + CMAKE_XCODE_ATTRIBUTE_IPHONEOS_DEPLOYMENT_TARGET + "${IOS_DEPLOYMENT_SDK_VERSION}" + ) +endif() + +# Emulate OpenCV toolchain -- +set(IOS YES) +# -- end + +# Set iPhoneOS architectures +set(archs "") +foreach(arch ${IPHONEOS_ARCHS}) + set(archs "${archs} ${arch}") +endforeach() +set(CMAKE_XCODE_ATTRIBUTE_ARCHS[sdk=iphoneos*] "${archs}") +set(CMAKE_XCODE_ATTRIBUTE_VALID_ARCHS[sdk=iphoneos*] "${archs}") + +# Set iPhoneSimulator architectures +set(archs "") +foreach(arch ${IPHONESIMULATOR_ARCHS}) + set(archs "${archs} ${arch}") +endforeach() +set(CMAKE_XCODE_ATTRIBUTE_ARCHS[sdk=iphonesimulator*] "${archs}") +set(CMAKE_XCODE_ATTRIBUTE_VALID_ARCHS[sdk=iphonesimulator*] "${archs}") + +# Introduced in iOS 9.0 +set(CMAKE_XCODE_ATTRIBUTE_ENABLE_BITCODE NO) + +# This will set CMAKE_CROSSCOMPILING to TRUE. +# CMAKE_CROSSCOMPILING needed for try_run: +# * https://cmake.org/cmake/help/latest/command/try_run.html#behavior-when-cross-compiling +# (used in CURL) +set(CMAKE_SYSTEM_NAME "Darwin") + +# Set CMAKE_SYSTEM_PROCESSOR for one-arch toolchain +# (needed for OpenCV 3.3) +set(_all_archs ${IPHONESIMULATOR_ARCHS} ${IPHONEOS_ARCHS}) +list(LENGTH _all_archs _all_archs_len) +if(_all_archs_len EQUAL 1) + set(CMAKE_SYSTEM_PROCESSOR ${_all_archs}) +else() + set(CMAKE_SYSTEM_PROCESSOR "") +endif() diff --git a/tools/polly/os/osx.cmake b/tools/polly/os/osx.cmake new file mode 100644 index 0000000..088e6c0 --- /dev/null +++ b/tools/polly/os/osx.cmake @@ -0,0 +1,103 @@ +# Copyright (c) 2015, Ruslan Baratov +# All rights reserved. + +if(DEFINED POLLY_OS_OSX_CMAKE_) + return() +else() + set(POLLY_OS_OSX_CMAKE_ 1) +endif() + +# Toolchain can be loaded from Linux too (e.g. by libcxx or gcc) +if(NOT APPLE) + return() +endif() + +if(IOS) + polly_fatal_error("Not for iOS") +endif() + +# find 'osx' root +find_program(XCODE_SELECT_EXECUTABLE xcode-select) +if(NOT XCODE_SELECT_EXECUTABLE) + polly_fatal_error("xcode-select not found") +endif() + +string(COMPARE EQUAL "$ENV{DEVELOPER_DIR}" "" _is_empty) +if(NOT _is_empty) + polly_status_debug("Developer root (env): $ENV{DEVELOPER_DIR}") +endif() + +execute_process( + COMMAND + ${XCODE_SELECT_EXECUTABLE} + "-print-path" + OUTPUT_VARIABLE + XCODE_DEVELOPER_ROOT # /.../Xcode.app/Contents/Developer + OUTPUT_STRIP_TRAILING_WHITESPACE +) + +polly_status_debug("Developer root: ${XCODE_DEVELOPER_ROOT}") + +string(COMPARE EQUAL "${OSX_SDK_VERSION}" "" _is_empty) +if(_is_empty) + execute_process( + COMMAND xcrun --show-sdk-version + RESULT_VARIABLE _result + OUTPUT_VARIABLE OSX_SDK_VERSION + OUTPUT_STRIP_TRAILING_WHITESPACE + ) + + if(NOT _result EQUAL 0) + polly_fatal_error("'xcrun --show-sdk-version' failed") + endif() +endif() + +set( + __osx_sysroot_suggestion_1 + "${XCODE_DEVELOPER_ROOT}/Platforms/MacOSX.platform/Developer/SDKs/MacOSX${OSX_SDK_VERSION}.sdk" +) + +# With a full Xcode install, typically `xcode-select -print-path` is something like: +# /Applications/Xcode.app/Contents/Developer +# +# But with just Xcode command line tools installed, the path is: +# /Library/Developer/CommandLineTools +# +# In the CommandLineTools case, the SDKs folder is at a different relative path. +set( + __osx_sysroot_suggestion_2 + "${XCODE_DEVELOPER_ROOT}/SDKs/MacOSX${OSX_SDK_VERSION}.sdk" +) + +if(EXISTS "${__osx_sysroot_suggestion_1}") + set(__osx_sysroot "${__osx_sysroot_suggestion_1}") +elseif(EXISTS "${__osx_sysroot_suggestion_2}") + set(__osx_sysroot "${__osx_sysroot_suggestion_2}") +else() + # If OSX_SDK_VERSION is not set, the SDK version is computed using + # xcrun. However, it is possible for the version reported by xcrun to not + # be present in the SDKs folder. In that case, xcrun can also give the + # full path to a valid SDK. + execute_process( + COMMAND xcrun --show-sdk-path + RESULT_VARIABLE _result + OUTPUT_VARIABLE __osx_sysroot_suggestion_3 + OUTPUT_STRIP_TRAILING_WHITESPACE + ) + + if(NOT _result EQUAL 0) + polly_fatal_error("'xcrun --show-sdk-path' failed") + endif() + + if(EXISTS "${__osx_sysroot_suggestion_3}") + set(__osx_sysroot "${__osx_sysroot_suggestion_3}") + else() + polly_fatal_error("OS X SDK does not exist at ${__osx_sysroot_suggestion_1} or ${__osx_sysroot_suggestion_2} or ${__osx_sysroot_suggestion_3}") + endif() +endif() + +set( + CMAKE_OSX_SYSROOT + "${__osx_sysroot}" + CACHE STRING "System root for OSX" FORCE +) diff --git a/tools/polly/os/raspberry-pi-hardfloat.cmake b/tools/polly/os/raspberry-pi-hardfloat.cmake new file mode 100644 index 0000000..a15b7f6 --- /dev/null +++ b/tools/polly/os/raspberry-pi-hardfloat.cmake @@ -0,0 +1,18 @@ +# Copyright (c) 2017, Alexandre Pretyman +# All rights reserved. + +if(DEFINED POLLY_OS_RASPBERRY_PI_HARDFLOAT_CMAKE) + return() +else() + set(POLLY_OS_RASPBERRY_PI_HARDFLOAT_CMAKE 1) +endif() + +include(polly_add_cache_flag) + +foreach(_flag -mfloat-abi=hard -mlittle-endian -munaligned-access) + polly_add_cache_flag(CMAKE_C_FLAGS "${_flag}") + polly_add_cache_flag(CMAKE_CXX_FLAGS "${_flag}") +endforeach() + +set(CMAKE_SYSTEM_NAME "Linux" CACHE STRING "") + diff --git a/tools/polly/os/raspberry-pi1.cmake b/tools/polly/os/raspberry-pi1.cmake new file mode 100644 index 0000000..340b8c8 --- /dev/null +++ b/tools/polly/os/raspberry-pi1.cmake @@ -0,0 +1,20 @@ +# Copyright (c) 2017, Alexandre Pretyman +# All rights reserved. + +if(DEFINED POLLY_OS_RASPBERRY_PI1_CMAKE) + return() +else() + set(POLLY_OS_RASPBERRY_PI1_CMAKE 1) +endif() + +include(polly_add_cache_flag) + +# -mcpu=arm1176jzf-s not compatible, removed +foreach(_flag -mfpu=vfp) + polly_add_cache_flag(CMAKE_C_FLAGS "${_flag}") + polly_add_cache_flag(CMAKE_CXX_FLAGS "${_flag}") +endforeach() + +set(CMAKE_SYSTEM_PROCESSOR "armv6" CACHE INTERNAL "") +set(RASPBERRY_PI 1 CACHE INTERNAL "") +set(CMAKE_SYSTEM_NAME "Linux" CACHE INTERNAL "") diff --git a/tools/polly/os/raspberry-pi2.cmake b/tools/polly/os/raspberry-pi2.cmake new file mode 100644 index 0000000..7c44405 --- /dev/null +++ b/tools/polly/os/raspberry-pi2.cmake @@ -0,0 +1,19 @@ +# Copyright (c) 2017, Alexandre Pretyman +# All rights reserved. + +if(DEFINED POLLY_OS_RASPBERRY_PI2_CMAKE) + return() +else() + set(POLLY_OS_RASPBERRY_PI2_CMAKE 1) +endif() + +include(polly_add_cache_flag) + +foreach(_flag -mcpu=cortex-a7 -mfpu=neon-vfpv4) + polly_add_cache_flag(CMAKE_C_FLAGS "${_flag}") + polly_add_cache_flag(CMAKE_CXX_FLAGS "${_flag}") +endforeach() + +set(CMAKE_SYSTEM_PROCESSOR "armv7-a" CACHE INTERNAL "") +set(RASPBERRY_PI 2 CACHE INTERNAL "") + diff --git a/tools/polly/os/raspberry-pi3.cmake b/tools/polly/os/raspberry-pi3.cmake new file mode 100644 index 0000000..7370fca --- /dev/null +++ b/tools/polly/os/raspberry-pi3.cmake @@ -0,0 +1,19 @@ +# Copyright (c) 2017, Alexandre Pretyman +# All rights reserved. + +if(DEFINED POLLY_OS_RASPBERRY_PI3_CMAKE) + return() +else() + set(POLLY_OS_RASPBERRY_PI3_CMAKE 1) +endif() + +include(polly_add_cache_flag) + +foreach(_flag -mcpu=cortex-a53 -mfpu=neon-fp-armv8) + polly_add_cache_flag(CMAKE_C_FLAGS "${_flag}") + polly_add_cache_flag(CMAKE_CXX_FLAGS "${_flag}") +endforeach() + +set(CMAKE_SYSTEM_PROCESSOR "armv7-l" CACHE INTERNAL "") +set(RASPBERRY_PI 3 CACHE INTERNAL "") + diff --git a/tools/polly/os/vc-mdd-android.cmake b/tools/polly/os/vc-mdd-android.cmake new file mode 100644 index 0000000..abd9079 --- /dev/null +++ b/tools/polly/os/vc-mdd-android.cmake @@ -0,0 +1,215 @@ +# Copyright (c) 2016, Ruslan Baratov +# All rights reserved. + +if(DEFINED POLLY_OS_VC_MDD_ANDROID_CMAKE_) + return() +else() + set(POLLY_OS_VC_MDD_ANDROID_CMAKE_ 1) +endif() + +cmake_minimum_required(VERSION 3.4) + +include(polly_fatal_error) + +if("${ANDROID_NDK_VERSION}" STREQUAL "") + polly_fatal_error("ANDROID_NDK_VERSION not set") +endif() + +if("${ANDROID_NATIVE_API_LEVEL}" STREQUAL "") + polly_fatal_error("ANDROID_NATIVE_API_LEVEL not set") +endif() + +set( + CMAKE_VC_MDD_ANDROID_API_LEVEL + "android-${ANDROID_NATIVE_API_LEVEL}" + CACHE + INTERNAL + "Android API" +) + +if("${ANDROID_ABI}" STREQUAL "") + polly_fatal_error("ANDROID_ABI not set") +endif() + +set( + CMAKE_VC_MDD_ANDROID_USE_OF_STL + "gnustl_static" + CACHE + INTERNAL + "STL variant" +) + +set( + CMAKE_SYSTEM_NAME + "VCMDDAndroid" + CACHE + INTERNAL + "System name" +) + +set(_expected_platform_module "${CMAKE_ROOT}/Modules/Platform/VCMDDAndroid.cmake") + +if(NOT EXISTS "${_expected_platform_module}") + polly_fatal_error( + "File not found:\n ${_expected_platform_module}" + "You are using non-patched CMake version!" + "See http://cgold.readthedocs.io/en/latest/platforms/android/windows.html#experimental-cmake for fix." + ) +endif() + +set(ANDROID "TRUE" CACHE STRING "Is platform Android?") + +get_filename_component( + ANDROID_NDK + "[HKEY_CURRENT_USER\\SOFTWARE\\Microsoft\\VisualStudio\\14.0_Config\\Setup\\vs\\SecondaryInstaller\\AndroidNDK64;NDK_HOME]" + ABSOLUTE + CACHE +) + +if(EXISTS "${ANDROID_NDK}") + polly_status_debug("Android NDK: ${ANDROID_NDK}") +else() + polly_fatal_error("Directory not found: ${ANDROID_NDK}") +endif() + +get_filename_component(_android_dirname "${ANDROID_NDK}" NAME) +if(NOT "${_android_dirname}" STREQUAL "android-ndk-${ANDROID_NDK_VERSION}") + polly_fatal_error( + "Inconsistent ANDROID_NDK_VERSION/ANDROID_NDK:" + " ${ANDROID_NDK_VERSION}/${ANDROID_NDK}" + ) +endif() + +get_filename_component( + ANDROID_ANT_HOME + "[HKEY_CURRENT_USER\\SOFTWARE\\Microsoft\\VisualStudio\\14.0_Config\\Setup\\vs\\SecondaryInstaller\\Ant;ANT_HOME]" + ABSOLUTE + CACHE +) + +if(EXISTS "${ANDROID_ANT_HOME}") + polly_status_debug("Ant HOME: ${ANDROID_ANT_HOME}") +else() + polly_fatal_error("Directory not found: ${ANDROID_ANT_HOME}") +endif() + +if("${ANDROID_ABI}" STREQUAL "armeabi") + set(ANDROID_ARCH_NAME "arm") +elseif("${ANDROID_ABI}" STREQUAL "mips") + set(ANDROID_ARCH_NAME "mips") +elseif("${ANDROID_ABI}" STREQUAL "x86") + set(ANDROID_ARCH_NAME "x86") +else() + polly_fatal_error("Unexpected ANDROID_ABI: ${ANDROID_ABI}") +endif() + +if("${ANDROID_ARCH_NAME}" STREQUAL "x86") + set(ANDROID_TOOLCHAIN_NAME "x86-4.9") + set(ANDROID_TOOLCHAIN_MACHINE_NAME "i686-linux-android") +elseif("${ANDROID_ARCH_NAME}" STREQUAL "arm") + set(ANDROID_TOOLCHAIN_NAME "arm-linux-androideabi-4.9") + set(ANDROID_TOOLCHAIN_MACHINE_NAME "arm-linux-androideabi") +else() + polly_fatal_error("Unexpected ANDROID_ARCH_NAME: ${ANDROID_ARCH_NAME}") +endif() + +set(ANDROID_TOOLCHAIN_ROOT "${ANDROID_NDK}/toolchains/${ANDROID_TOOLCHAIN_NAME}/prebuilt/windows-x86_64") +if(NOT EXISTS "${ANDROID_TOOLCHAIN_ROOT}") + polly_fatal_error("Directory not found: ${ANDROID_TOOLCHAIN_ROOT}") +endif() + +set( + ANDROID_SYSROOT + "${ANDROID_NDK}/platforms/android-${ANDROID_NATIVE_API_LEVEL}/arch-${ANDROID_ARCH_NAME}" + CACHE + INTERNAL + "Android system root" +) + +if(NOT EXISTS "${ANDROID_SYSROOT}") + polly_fatal_error("Directory not found: ${ANDROID_SYSROOT}") +endif() + +set(_dir1 "${ANDROID_TOOLCHAIN_ROOT}/bin") +if(NOT EXISTS "${_dir1}") + polly_fatal_error("Directory not found: ${_dir1}") +endif() + +set(_dir2 "${ANDROID_TOOLCHAIN_ROOT}/${ANDROID_TOOLCHAIN_MACHINE_NAME}") +if(NOT EXISTS "${_dir2}") + polly_fatal_error("Directory not found: ${_dir2}") +endif() + +set(CMAKE_FIND_ROOT_PATH "${_dir1}" "${_dir2}" "${ANDROID_SYSROOT}") + +# Support AndroidApk.cmake (https://github.com/hunter-packages/android-apk) { + +set( + ANDROID_ANT_COMMAND + "${ANDROID_ANT_HOME}/bin/ant.bat" + CACHE + INTERNAL + "Path to ant" +) + +set( + CMAKE_GDBSERVER + "${ANDROID_NDK}/prebuilt/android-${ANDROID_ARCH_NAME}/gdbserver/gdbserver" + CACHE + INTERNAL + "Path to 'gdbserver'" +) +if(NOT EXISTS "${CMAKE_GDBSERVER}") + polly_fatal_error("File not found: ${CMAKE_GDBSERVER}") +endif() + +set(ANDROID_API_LEVEL "${ANDROID_NATIVE_API_LEVEL}") + +# only search for libraries and includes in the ndk toolchain +set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM ONLY) +set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY) +set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY) + +# macro to find packages on the host OS +macro(find_host_package) + set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER) + set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY NEVER) + set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE NEVER) + if(CMAKE_HOST_WIN32) + set(WIN32 1) + set(UNIX) + elseif(CMAKE_HOST_APPLE) + set(APPLE 1) + set(UNIX) + endif() + find_package(${ARGN}) + set(WIN32) + set(APPLE) + set(UNIX 1) + set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM ONLY) + set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY) + set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY) +endmacro() + +# macro to find programs on the host OS +macro(find_host_program) + set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER) + set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY NEVER) + set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE NEVER) + if(CMAKE_HOST_WIN32) + set(WIN32 1) + set(UNIX) + elseif(CMAKE_HOST_APPLE) + set(APPLE 1) + set(UNIX) + endif() + find_program(${ARGN}) + set(WIN32) + set(APPLE) + set(UNIX 1) + set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM ONLY) + set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY) + set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY) +endmacro() + +# } diff --git a/tools/polly/osx-10-10-dep-10-7.cmake b/tools/polly/osx-10-10-dep-10-7.cmake new file mode 100644 index 0000000..8f1993c --- /dev/null +++ b/tools/polly/osx-10-10-dep-10-7.cmake @@ -0,0 +1,29 @@ +# Copyright (c) 2015, Ruslan Baratov +# All rights reserved. + +if(DEFINED POLLY_OSX_10_10_DEP_10_7_CMAKE_) + return() +else() + set(POLLY_OSX_10_10_DEP_10_7_CMAKE_ 1) +endif() + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_init.cmake") + +set(OSX_SDK_VERSION "10.10") +set(POLLY_XCODE_COMPILER "clang") +polly_init( + "Xcode (OS X ${OSX_SDK_VERSION} | Deployment 10.7) / \ +${POLLY_XCODE_COMPILER} / \ +LLVM Standard C++ Library (libc++) / c++11 support" + "Xcode" +) + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_common.cmake") + +include("${CMAKE_CURRENT_LIST_DIR}/compiler/xcode.cmake") + +set(CMAKE_OSX_DEPLOYMENT_TARGET "10.7" CACHE STRING "OS X Deployment target" FORCE) + +include("${CMAKE_CURRENT_LIST_DIR}/library/std/libcxx.cmake") +include("${CMAKE_CURRENT_LIST_DIR}/flags/cxx11.cmake") +include("${CMAKE_CURRENT_LIST_DIR}/os/osx.cmake") diff --git a/tools/polly/osx-10-10-dep-10-9-make.cmake b/tools/polly/osx-10-10-dep-10-9-make.cmake new file mode 100644 index 0000000..7f66faa --- /dev/null +++ b/tools/polly/osx-10-10-dep-10-9-make.cmake @@ -0,0 +1,27 @@ +# Copyright (c) 2016, Ruslan Baratov +# All rights reserved. + +if(DEFINED POLLY_OSX_10_10_DEP_10_9_MAKE_CMAKE_) + return() +else() + set(POLLY_OSX_10_10_DEP_10_9_MAKE_CMAKE_ 1) +endif() + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_init.cmake") + +set(OSX_SDK_VERSION "10.10") +set(POLLY_XCODE_COMPILER "clang") +polly_init( + "Makefile (OS X ${OSX_SDK_VERSION}) / \ +${POLLY_XCODE_COMPILER} / \ +LLVM Standard C++ Library (libc++) / c++11 support" + "Unix Makefiles" +) + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_common.cmake") + +set(CMAKE_OSX_DEPLOYMENT_TARGET "10.9" CACHE STRING "OS X Deployment target" FORCE) + +include("${CMAKE_CURRENT_LIST_DIR}/library/std/libcxx.cmake") +include("${CMAKE_CURRENT_LIST_DIR}/flags/cxx11.cmake") +include("${CMAKE_CURRENT_LIST_DIR}/os/osx.cmake") diff --git a/tools/polly/osx-10-10.cmake b/tools/polly/osx-10-10.cmake new file mode 100644 index 0000000..57f3a2f --- /dev/null +++ b/tools/polly/osx-10-10.cmake @@ -0,0 +1,29 @@ +# Copyright (c) 2015, Ruslan Baratov +# All rights reserved. + +if(DEFINED POLLY_OSX_10_10_CMAKE_) + return() +else() + set(POLLY_OSX_10_10_CMAKE_ 1) +endif() + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_init.cmake") + +set(OSX_SDK_VERSION "10.10") +set(POLLY_XCODE_COMPILER "clang") +polly_init( + "Xcode (OS X ${OSX_SDK_VERSION}) / \ +${POLLY_XCODE_COMPILER} / \ +LLVM Standard C++ Library (libc++) / c++11 support" + "Xcode" +) + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_common.cmake") + +include("${CMAKE_CURRENT_LIST_DIR}/compiler/xcode.cmake") + +set(CMAKE_OSX_DEPLOYMENT_TARGET "10.10" CACHE STRING "OS X Deployment target" FORCE) + +include("${CMAKE_CURRENT_LIST_DIR}/library/std/libcxx.cmake") +include("${CMAKE_CURRENT_LIST_DIR}/flags/cxx11.cmake") +include("${CMAKE_CURRENT_LIST_DIR}/os/osx.cmake") diff --git a/tools/polly/osx-10-11-hid-sections-lto.cmake b/tools/polly/osx-10-11-hid-sections-lto.cmake new file mode 100644 index 0000000..3e0d1d6 --- /dev/null +++ b/tools/polly/osx-10-11-hid-sections-lto.cmake @@ -0,0 +1,34 @@ +# Copyright (c) 2015, Ruslan Baratov +# Copyright (c) 2016, David Hirvonen +# All rights reserved. + +if(DEFINED POLLY_OSX_10_11_HID_SECTIONS_LTO_CMAKE_) + return() +else() + set(POLLY_OSX_10_11_HID_SECTIONS_LTO_CMAKE_ 1) +endif() + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_init.cmake") + +set(OSX_SDK_VERSION "10.11") +set(POLLY_XCODE_COMPILER "clang") +polly_init( + "Xcode (OS X ${OSX_SDK_VERSION}) / \ +${POLLY_XCODE_COMPILER} / \ +LLVM Standard C++ Library (libc++) / c++11 support / hidden / function-sections / data-sections / LTO" + "Xcode" +) + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_common.cmake") + +include("${CMAKE_CURRENT_LIST_DIR}/compiler/xcode.cmake") + +set(CMAKE_OSX_DEPLOYMENT_TARGET "10.11" CACHE STRING "OS X Deployment target" FORCE) + +include("${CMAKE_CURRENT_LIST_DIR}/library/std/libcxx.cmake") +include("${CMAKE_CURRENT_LIST_DIR}/flags/cxx11.cmake") +include("${CMAKE_CURRENT_LIST_DIR}/flags/function-sections.cmake") +include("${CMAKE_CURRENT_LIST_DIR}/flags/data-sections.cmake") +include("${CMAKE_CURRENT_LIST_DIR}/flags/hidden.cmake") +include("${CMAKE_CURRENT_LIST_DIR}/flags/lto.cmake") +include("${CMAKE_CURRENT_LIST_DIR}/os/osx.cmake") diff --git a/tools/polly/osx-10-11-hid-sections.cmake b/tools/polly/osx-10-11-hid-sections.cmake new file mode 100644 index 0000000..c486c1e --- /dev/null +++ b/tools/polly/osx-10-11-hid-sections.cmake @@ -0,0 +1,33 @@ +# Copyright (c) 2015, Ruslan Baratov +# Copyright (c) 2016, David Hirvonen +# All rights reserved. + +if(DEFINED POLLY_OSX_10_11_HID_SECTIONS_CMAKE_) + return() +else() + set(POLLY_OSX_10_11_HID_SECTIONS_CMAKE_ 1) +endif() + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_init.cmake") + +set(OSX_SDK_VERSION "10.11") +set(POLLY_XCODE_COMPILER "clang") +polly_init( + "Xcode (OS X ${OSX_SDK_VERSION}) / \ +${POLLY_XCODE_COMPILER} / \ +LLVM Standard C++ Library (libc++) / c++11 support / hidden / function-sections / data-sections" + "Xcode" +) + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_common.cmake") + +include("${CMAKE_CURRENT_LIST_DIR}/compiler/xcode.cmake") + +set(CMAKE_OSX_DEPLOYMENT_TARGET "10.11" CACHE STRING "OS X Deployment target" FORCE) + +include("${CMAKE_CURRENT_LIST_DIR}/library/std/libcxx.cmake") +include("${CMAKE_CURRENT_LIST_DIR}/flags/cxx11.cmake") +include("${CMAKE_CURRENT_LIST_DIR}/flags/function-sections.cmake") +include("${CMAKE_CURRENT_LIST_DIR}/flags/data-sections.cmake") +include("${CMAKE_CURRENT_LIST_DIR}/flags/hidden.cmake") +include("${CMAKE_CURRENT_LIST_DIR}/os/osx.cmake") diff --git a/tools/polly/osx-10-11-lto.cmake b/tools/polly/osx-10-11-lto.cmake new file mode 100644 index 0000000..51724b1 --- /dev/null +++ b/tools/polly/osx-10-11-lto.cmake @@ -0,0 +1,30 @@ +# Copyright (c) 2015, Ruslan Baratov +# All rights reserved. + +if(DEFINED POLLY_OSX_10_11_LTO_CMAKE_) + return() +else() + set(POLLY_OSX_10_11_LTO_CMAKE_ 1) +endif() + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_init.cmake") + +set(OSX_SDK_VERSION "10.11") +set(POLLY_XCODE_COMPILER "clang") +polly_init( + "Xcode (OS X ${OSX_SDK_VERSION}) / \ +${POLLY_XCODE_COMPILER} / \ +LLVM Standard C++ Library (libc++) / c++11 support / LTO" + "Xcode" +) + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_common.cmake") + +include("${CMAKE_CURRENT_LIST_DIR}/compiler/xcode.cmake") + +set(CMAKE_OSX_DEPLOYMENT_TARGET "10.11" CACHE STRING "OS X Deployment target" FORCE) + +include("${CMAKE_CURRENT_LIST_DIR}/library/std/libcxx.cmake") +include("${CMAKE_CURRENT_LIST_DIR}/flags/cxx11.cmake") +include("${CMAKE_CURRENT_LIST_DIR}/flags/lto.cmake") +include("${CMAKE_CURRENT_LIST_DIR}/os/osx.cmake") diff --git a/tools/polly/osx-10-11-make.cmake b/tools/polly/osx-10-11-make.cmake new file mode 100644 index 0000000..78c224a --- /dev/null +++ b/tools/polly/osx-10-11-make.cmake @@ -0,0 +1,27 @@ +# Copyright (c) 2016, Ruslan Baratov +# All rights reserved. + +if(DEFINED POLLY_OSX_10_11_MAKE_CMAKE_) + return() +else() + set(POLLY_OSX_10_11_MAKE_CMAKE_ 1) +endif() + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_init.cmake") + +set(OSX_SDK_VERSION "10.11") +set(POLLY_XCODE_COMPILER "clang") +polly_init( + "Makefile (OS X ${OSX_SDK_VERSION}) / \ +${POLLY_XCODE_COMPILER} / \ +LLVM Standard C++ Library (libc++) / c++11 support" + "Unix Makefiles" +) + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_common.cmake") + +set(CMAKE_OSX_DEPLOYMENT_TARGET "10.11" CACHE STRING "OS X Deployment target" FORCE) + +include("${CMAKE_CURRENT_LIST_DIR}/library/std/libcxx.cmake") +include("${CMAKE_CURRENT_LIST_DIR}/flags/cxx11.cmake") +include("${CMAKE_CURRENT_LIST_DIR}/os/osx.cmake") diff --git a/tools/polly/osx-10-11-sanitize-address.cmake b/tools/polly/osx-10-11-sanitize-address.cmake new file mode 100644 index 0000000..bd2fab0 --- /dev/null +++ b/tools/polly/osx-10-11-sanitize-address.cmake @@ -0,0 +1,30 @@ +# Copyright (c) 2016, Ruslan Baratov +# All rights reserved. + +if(DEFINED POLLY_OSX_10_11_SANITIZE_ADDRESS_CMAKE_) + return() +else() + set(POLLY_OSX_10_11_SANITIZE_ADDRESS_CMAKE_ 1) +endif() + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_init.cmake") + +set(OSX_SDK_VERSION "10.11") +set(POLLY_XCODE_COMPILER "clang") +polly_init( + "Xcode (OS X ${OSX_SDK_VERSION}) / \ +${POLLY_XCODE_COMPILER} / \ +LLVM Standard C++ Library (libc++) / Clang address sanitizer / c++11 support" + "Xcode" +) + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_common.cmake") + +include("${CMAKE_CURRENT_LIST_DIR}/compiler/xcode.cmake") + +set(CMAKE_OSX_DEPLOYMENT_TARGET "10.11" CACHE STRING "OS X Deployment target" FORCE) + +include("${CMAKE_CURRENT_LIST_DIR}/library/std/libcxx.cmake") +include("${CMAKE_CURRENT_LIST_DIR}/flags/cxx11.cmake") +include("${CMAKE_CURRENT_LIST_DIR}/os/osx.cmake") +include("${CMAKE_CURRENT_LIST_DIR}/flags/sanitize_address.cmake") diff --git a/tools/polly/osx-10-11.cmake b/tools/polly/osx-10-11.cmake new file mode 100644 index 0000000..5c9b165 --- /dev/null +++ b/tools/polly/osx-10-11.cmake @@ -0,0 +1,29 @@ +# Copyright (c) 2015, Ruslan Baratov +# All rights reserved. + +if(DEFINED POLLY_OSX_10_11_CMAKE_) + return() +else() + set(POLLY_OSX_10_11_CMAKE_ 1) +endif() + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_init.cmake") + +set(OSX_SDK_VERSION "10.11") +set(POLLY_XCODE_COMPILER "clang") +polly_init( + "Xcode (OS X ${OSX_SDK_VERSION}) / \ +${POLLY_XCODE_COMPILER} / \ +LLVM Standard C++ Library (libc++) / c++11 support" + "Xcode" +) + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_common.cmake") + +include("${CMAKE_CURRENT_LIST_DIR}/compiler/xcode.cmake") + +set(CMAKE_OSX_DEPLOYMENT_TARGET "10.11" CACHE STRING "OS X Deployment target" FORCE) + +include("${CMAKE_CURRENT_LIST_DIR}/library/std/libcxx.cmake") +include("${CMAKE_CURRENT_LIST_DIR}/flags/cxx11.cmake") +include("${CMAKE_CURRENT_LIST_DIR}/os/osx.cmake") diff --git a/tools/polly/osx-10-12-cxx14.cmake b/tools/polly/osx-10-12-cxx14.cmake new file mode 100644 index 0000000..4f15256 --- /dev/null +++ b/tools/polly/osx-10-12-cxx14.cmake @@ -0,0 +1,29 @@ +# Copyright (c) 2016, Ruslan Baratov +# All rights reserved. + +if(DEFINED POLLY_OSX_10_12_CXX14_CMAKE_) + return() +else() + set(POLLY_OSX_10_12_CXX14_CMAKE_ 1) +endif() + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_init.cmake") + +set(OSX_SDK_VERSION "10.12") +set(POLLY_XCODE_COMPILER "clang") +polly_init( + "Xcode (OS X ${OSX_SDK_VERSION}) / \ +${POLLY_XCODE_COMPILER} / \ +LLVM Standard C++ Library (libc++) / c++14 support" + "Xcode" +) + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_common.cmake") + +include("${CMAKE_CURRENT_LIST_DIR}/compiler/xcode.cmake") + +set(CMAKE_OSX_DEPLOYMENT_TARGET "10.12" CACHE STRING "OS X Deployment target" FORCE) + +include("${CMAKE_CURRENT_LIST_DIR}/library/std/libcxx.cmake") +include("${CMAKE_CURRENT_LIST_DIR}/flags/cxx14.cmake") +include("${CMAKE_CURRENT_LIST_DIR}/os/osx.cmake") diff --git a/tools/polly/osx-10-12-cxx17.cmake b/tools/polly/osx-10-12-cxx17.cmake new file mode 100644 index 0000000..e61cdec --- /dev/null +++ b/tools/polly/osx-10-12-cxx17.cmake @@ -0,0 +1,29 @@ +# Copyright (c) 2016, Ruslan Baratov +# All rights reserved. + +if(DEFINED POLLY_OSX_10_12_CXX17_CMAKE_) + return() +else() + set(POLLY_OSX_10_12_CXX17_CMAKE_ 1) +endif() + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_init.cmake") + +set(OSX_SDK_VERSION "10.12") +set(POLLY_XCODE_COMPILER "clang") +polly_init( + "Xcode (OS X ${OSX_SDK_VERSION}) / \ +${POLLY_XCODE_COMPILER} / \ +LLVM Standard C++ Library (libc++) / c++17 support" + "Xcode" +) + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_common.cmake") + +include("${CMAKE_CURRENT_LIST_DIR}/compiler/xcode.cmake") + +set(CMAKE_OSX_DEPLOYMENT_TARGET "10.12" CACHE STRING "OS X Deployment target" FORCE) + +include("${CMAKE_CURRENT_LIST_DIR}/library/std/libcxx.cmake") +include("${CMAKE_CURRENT_LIST_DIR}/flags/cxx17.cmake") +include("${CMAKE_CURRENT_LIST_DIR}/os/osx.cmake") diff --git a/tools/polly/osx-10-12-cxx98.cmake b/tools/polly/osx-10-12-cxx98.cmake new file mode 100644 index 0000000..f89fa7c --- /dev/null +++ b/tools/polly/osx-10-12-cxx98.cmake @@ -0,0 +1,29 @@ +# Copyright (c) 2016, Ruslan Baratov +# All rights reserved. + +if(DEFINED POLLY_OSX_10_12_CXX98_CMAKE_) + return() +else() + set(POLLY_OSX_10_12_CXX98_CMAKE_ 1) +endif() + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_init.cmake") + +set(OSX_SDK_VERSION "10.12") +set(POLLY_XCODE_COMPILER "clang") +polly_init( + "Xcode (OS X ${OSX_SDK_VERSION}) / \ +${POLLY_XCODE_COMPILER} / \ +LLVM Standard C++ Library (libc++) / c++98 support" + "Xcode" +) + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_common.cmake") + +include("${CMAKE_CURRENT_LIST_DIR}/compiler/xcode.cmake") + +set(CMAKE_OSX_DEPLOYMENT_TARGET "10.12" CACHE STRING "OS X Deployment target" FORCE) + +include("${CMAKE_CURRENT_LIST_DIR}/library/std/libcxx.cmake") +include("${CMAKE_CURRENT_LIST_DIR}/flags/cxx98.cmake") +include("${CMAKE_CURRENT_LIST_DIR}/os/osx.cmake") diff --git a/tools/polly/osx-10-12-dep-10-10-lto.cmake b/tools/polly/osx-10-12-dep-10-10-lto.cmake new file mode 100644 index 0000000..621523c --- /dev/null +++ b/tools/polly/osx-10-12-dep-10-10-lto.cmake @@ -0,0 +1,30 @@ +# Copyright (c) 2015, 2018, Ruslan Baratov +# All rights reserved. + +if(DEFINED POLLY_OSX_10_12_DEP_10_10_LTO_CMAKE_) + return() +else() + set(POLLY_OSX_10_12_DEP_10_10_LTO_CMAKE_ 1) +endif() + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_init.cmake") + +set(OSX_SDK_VERSION "10.12") +set(POLLY_XCODE_COMPILER "clang") +polly_init( + "Xcode (OS X ${OSX_SDK_VERSION} | Deployment 10.10) / \ +${POLLY_XCODE_COMPILER} / \ +LLVM Standard C++ Library (libc++) / c++11 support / LTO" + "Xcode" +) + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_common.cmake") + +include("${CMAKE_CURRENT_LIST_DIR}/compiler/xcode.cmake") + +set(CMAKE_OSX_DEPLOYMENT_TARGET "10.10" CACHE STRING "OS X Deployment target" FORCE) + +include("${CMAKE_CURRENT_LIST_DIR}/library/std/libcxx.cmake") +include("${CMAKE_CURRENT_LIST_DIR}/flags/cxx11.cmake") +include("${CMAKE_CURRENT_LIST_DIR}/flags/lto.cmake") +include("${CMAKE_CURRENT_LIST_DIR}/os/osx.cmake") diff --git a/tools/polly/osx-10-12-dep-10-10.cmake b/tools/polly/osx-10-12-dep-10-10.cmake new file mode 100644 index 0000000..893fc81 --- /dev/null +++ b/tools/polly/osx-10-12-dep-10-10.cmake @@ -0,0 +1,29 @@ +# Copyright (c) 2015, Ruslan Baratov +# All rights reserved. + +if(DEFINED POLLY_OSX_10_12_DEP_10_10_CMAKE_) + return() +else() + set(POLLY_OSX_10_12_DEP_10_10_CMAKE_ 1) +endif() + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_init.cmake") + +set(OSX_SDK_VERSION "10.12") +set(POLLY_XCODE_COMPILER "clang") +polly_init( + "Xcode (OS X ${OSX_SDK_VERSION} | Deployment 10.10) / \ +${POLLY_XCODE_COMPILER} / \ +LLVM Standard C++ Library (libc++) / c++11 support" + "Xcode" +) + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_common.cmake") + +include("${CMAKE_CURRENT_LIST_DIR}/compiler/xcode.cmake") + +set(CMAKE_OSX_DEPLOYMENT_TARGET "10.10" CACHE STRING "OS X Deployment target" FORCE) + +include("${CMAKE_CURRENT_LIST_DIR}/library/std/libcxx.cmake") +include("${CMAKE_CURRENT_LIST_DIR}/flags/cxx11.cmake") +include("${CMAKE_CURRENT_LIST_DIR}/os/osx.cmake") diff --git a/tools/polly/osx-10-12-hid-sections.cmake b/tools/polly/osx-10-12-hid-sections.cmake new file mode 100644 index 0000000..251dc17 --- /dev/null +++ b/tools/polly/osx-10-12-hid-sections.cmake @@ -0,0 +1,33 @@ +# Copyright (c) 2016-2017, Ruslan Baratov +# Copyright (c) 2016-2017, David Hirvonen +# All rights reserved. + +if(DEFINED POLLY_OSX_10_12_HID_SECTIONS_CMAKE_) + return() +else() + set(POLLY_OSX_10_12_HID_SECTIONS_CMAKE_ 1) +endif() + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_init.cmake") + +set(OSX_SDK_VERSION "10.12") +set(POLLY_XCODE_COMPILER "clang") +polly_init( + "Xcode (OS X ${OSX_SDK_VERSION}) / \ +${POLLY_XCODE_COMPILER} / \ +LLVM Standard C++ Library (libc++) / c++11 support / hidden / function-sections / data-sections " + "Xcode" +) + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_common.cmake") + +include("${CMAKE_CURRENT_LIST_DIR}/compiler/xcode.cmake") + +set(CMAKE_OSX_DEPLOYMENT_TARGET "10.12" CACHE STRING "OS X Deployment target" FORCE) + +include("${CMAKE_CURRENT_LIST_DIR}/library/std/libcxx.cmake") +include("${CMAKE_CURRENT_LIST_DIR}/flags/cxx11.cmake") +include("${CMAKE_CURRENT_LIST_DIR}/os/osx.cmake") +include("${CMAKE_CURRENT_LIST_DIR}/flags/function-sections.cmake") +include("${CMAKE_CURRENT_LIST_DIR}/flags/data-sections.cmake") +include("${CMAKE_CURRENT_LIST_DIR}/flags/hidden.cmake") diff --git a/tools/polly/osx-10-12-lto.cmake b/tools/polly/osx-10-12-lto.cmake new file mode 100644 index 0000000..0036b86 --- /dev/null +++ b/tools/polly/osx-10-12-lto.cmake @@ -0,0 +1,30 @@ +# Copyright (c) 2016-2017, Ruslan Baratov +# All rights reserved. + +if(DEFINED POLLY_OSX_10_12_LTO_CMAKE_) + return() +else() + set(POLLY_OSX_10_12_LTO_CMAKE_ 1) +endif() + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_init.cmake") + +set(OSX_SDK_VERSION "10.12") +set(POLLY_XCODE_COMPILER "clang") +polly_init( + "Xcode (OS X ${OSX_SDK_VERSION}) / \ +${POLLY_XCODE_COMPILER} / \ +LLVM Standard C++ Library (libc++) / c++11 support / LTO" + "Xcode" +) + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_common.cmake") + +include("${CMAKE_CURRENT_LIST_DIR}/compiler/xcode.cmake") + +set(CMAKE_OSX_DEPLOYMENT_TARGET "10.12" CACHE STRING "OS X Deployment target" FORCE) + +include("${CMAKE_CURRENT_LIST_DIR}/library/std/libcxx.cmake") +include("${CMAKE_CURRENT_LIST_DIR}/flags/cxx11.cmake") +include("${CMAKE_CURRENT_LIST_DIR}/flags/lto.cmake") +include("${CMAKE_CURRENT_LIST_DIR}/os/osx.cmake") diff --git a/tools/polly/osx-10-12-make.cmake b/tools/polly/osx-10-12-make.cmake new file mode 100644 index 0000000..2dbf8e4 --- /dev/null +++ b/tools/polly/osx-10-12-make.cmake @@ -0,0 +1,27 @@ +# Copyright (c) 2016, Ruslan Baratov +# All rights reserved. + +if(DEFINED POLLY_OSX_10_12_MAKE_CMAKE_) + return() +else() + set(POLLY_OSX_10_12_MAKE_CMAKE_ 1) +endif() + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_init.cmake") + +set(OSX_SDK_VERSION "10.12") +set(POLLY_XCODE_COMPILER "clang") +polly_init( + "Makefile (OS X ${OSX_SDK_VERSION}) / \ +${POLLY_XCODE_COMPILER} / \ +LLVM Standard C++ Library (libc++) / c++11 support" + "Unix Makefiles" +) + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_common.cmake") + +set(CMAKE_OSX_DEPLOYMENT_TARGET "10.12" CACHE STRING "OS X Deployment target" FORCE) + +include("${CMAKE_CURRENT_LIST_DIR}/library/std/libcxx.cmake") +include("${CMAKE_CURRENT_LIST_DIR}/flags/cxx11.cmake") +include("${CMAKE_CURRENT_LIST_DIR}/os/osx.cmake") diff --git a/tools/polly/osx-10-12-ninja.cmake b/tools/polly/osx-10-12-ninja.cmake new file mode 100644 index 0000000..92f5f56 --- /dev/null +++ b/tools/polly/osx-10-12-ninja.cmake @@ -0,0 +1,27 @@ +# Copyright (c) 2016, Ruslan Baratov +# All rights reserved. + +if(DEFINED POLLY_OSX_10_12_MAKE_CMAKE_) + return() +else() + set(POLLY_OSX_10_12_MAKE_CMAKE_ 1) +endif() + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_init.cmake") + +set(OSX_SDK_VERSION "10.12") +set(POLLY_XCODE_COMPILER "clang") +polly_init( + "Ninja (OS X ${OSX_SDK_VERSION}) / \ +${POLLY_XCODE_COMPILER} / \ +LLVM Standard C++ Library (libc++) / c++11 support" + "Ninja" +) + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_common.cmake") + +set(CMAKE_OSX_DEPLOYMENT_TARGET "10.12" CACHE STRING "OS X Deployment target" FORCE) + +include("${CMAKE_CURRENT_LIST_DIR}/library/std/libcxx.cmake") +include("${CMAKE_CURRENT_LIST_DIR}/flags/cxx11.cmake") +include("${CMAKE_CURRENT_LIST_DIR}/os/osx.cmake") diff --git a/tools/polly/osx-10-12-sanitize-address-hid-sections.cmake b/tools/polly/osx-10-12-sanitize-address-hid-sections.cmake new file mode 100644 index 0000000..13bade4 --- /dev/null +++ b/tools/polly/osx-10-12-sanitize-address-hid-sections.cmake @@ -0,0 +1,34 @@ +# Copyright (c) 2016, Ruslan Baratov +# Copyright (c) 2016, David Hirvonen +# All rights reserved. + +if(DEFINED POLLY_OSX_10_12_SANITIZE_ADDRESS_HID_SECTIONS_CMAKE_) + return() +else() + set(POLLY_OSX_10_12_SANITIZE_ADDRESS_HID_SECTIONS_CMAKE_ 1) +endif() + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_init.cmake") + +set(OSX_SDK_VERSION "10.12") +set(POLLY_XCODE_COMPILER "clang") +polly_init( + "Xcode (OS X ${OSX_SDK_VERSION}) / \ +${POLLY_XCODE_COMPILER} / \ +LLVM Standard C++ Library (libc++) / Clang address sanitizer / c++11 support / hidden / function-sections / data-sections " + "Xcode" +) + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_common.cmake") + +include("${CMAKE_CURRENT_LIST_DIR}/compiler/xcode.cmake") + +set(CMAKE_OSX_DEPLOYMENT_TARGET "10.12" CACHE STRING "OS X Deployment target" FORCE) + +include("${CMAKE_CURRENT_LIST_DIR}/library/std/libcxx.cmake") +include("${CMAKE_CURRENT_LIST_DIR}/flags/cxx11.cmake") +include("${CMAKE_CURRENT_LIST_DIR}/os/osx.cmake") +include("${CMAKE_CURRENT_LIST_DIR}/flags/sanitize_address.cmake") +include("${CMAKE_CURRENT_LIST_DIR}/flags/function-sections.cmake") +include("${CMAKE_CURRENT_LIST_DIR}/flags/data-sections.cmake") +include("${CMAKE_CURRENT_LIST_DIR}/flags/hidden.cmake") diff --git a/tools/polly/osx-10-12-sanitize-address.cmake b/tools/polly/osx-10-12-sanitize-address.cmake new file mode 100644 index 0000000..a294c06 --- /dev/null +++ b/tools/polly/osx-10-12-sanitize-address.cmake @@ -0,0 +1,31 @@ +# Copyright (c) 2016, Ruslan Baratov +# Copyright (c) 2016, David Hirvonen +# All rights reserved. + +if(DEFINED POLLY_OSX_10_12_SANITIZE_ADDRESS_CMAKE_) + return() +else() + set(POLLY_OSX_10_12_SANITIZE_ADDRESS_CMAKE_ 1) +endif() + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_init.cmake") + +set(OSX_SDK_VERSION "10.12") +set(POLLY_XCODE_COMPILER "clang") +polly_init( + "Xcode (OS X ${OSX_SDK_VERSION}) / \ +${POLLY_XCODE_COMPILER} / \ +LLVM Standard C++ Library (libc++) / Clang address sanitizer / c++11 support" + "Xcode" +) + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_common.cmake") + +include("${CMAKE_CURRENT_LIST_DIR}/compiler/xcode.cmake") + +set(CMAKE_OSX_DEPLOYMENT_TARGET "10.12" CACHE STRING "OS X Deployment target" FORCE) + +include("${CMAKE_CURRENT_LIST_DIR}/library/std/libcxx.cmake") +include("${CMAKE_CURRENT_LIST_DIR}/flags/cxx11.cmake") +include("${CMAKE_CURRENT_LIST_DIR}/os/osx.cmake") +include("${CMAKE_CURRENT_LIST_DIR}/flags/sanitize_address.cmake") diff --git a/tools/polly/osx-10-12.cmake b/tools/polly/osx-10-12.cmake new file mode 100644 index 0000000..cffd6fb --- /dev/null +++ b/tools/polly/osx-10-12.cmake @@ -0,0 +1,29 @@ +# Copyright (c) 2016, Ruslan Baratov +# All rights reserved. + +if(DEFINED POLLY_OSX_10_12_CMAKE_) + return() +else() + set(POLLY_OSX_10_12_CMAKE_ 1) +endif() + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_init.cmake") + +set(OSX_SDK_VERSION "10.12") +set(POLLY_XCODE_COMPILER "clang") +polly_init( + "Xcode (OS X ${OSX_SDK_VERSION}) / \ +${POLLY_XCODE_COMPILER} / \ +LLVM Standard C++ Library (libc++) / c++11 support" + "Xcode" +) + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_common.cmake") + +include("${CMAKE_CURRENT_LIST_DIR}/compiler/xcode.cmake") + +set(CMAKE_OSX_DEPLOYMENT_TARGET "10.12" CACHE STRING "OS X Deployment target" FORCE) + +include("${CMAKE_CURRENT_LIST_DIR}/library/std/libcxx.cmake") +include("${CMAKE_CURRENT_LIST_DIR}/flags/cxx11.cmake") +include("${CMAKE_CURRENT_LIST_DIR}/os/osx.cmake") diff --git a/tools/polly/osx-10-13-cxx14.cmake b/tools/polly/osx-10-13-cxx14.cmake new file mode 100644 index 0000000..48d7479 --- /dev/null +++ b/tools/polly/osx-10-13-cxx14.cmake @@ -0,0 +1,29 @@ +# Copyright (c) 2016, 2018 Ruslan Baratov +# All rights reserved. + +if(DEFINED POLLY_OSX_10_13_CXX14_CMAKE_) + return() +else() + set(POLLY_OSX_10_13_CXX14_CMAKE_ 1) +endif() + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_init.cmake") + +set(OSX_SDK_VERSION "10.13") +set(POLLY_XCODE_COMPILER "clang") +polly_init( + "Xcode (OS X ${OSX_SDK_VERSION}) / \ +${POLLY_XCODE_COMPILER} / \ +LLVM Standard C++ Library (libc++) / c++14 support" + "Xcode" +) + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_common.cmake") + +include("${CMAKE_CURRENT_LIST_DIR}/compiler/xcode.cmake") + +set(CMAKE_OSX_DEPLOYMENT_TARGET "10.13" CACHE STRING "OS X Deployment target" FORCE) + +include("${CMAKE_CURRENT_LIST_DIR}/library/std/libcxx.cmake") +include("${CMAKE_CURRENT_LIST_DIR}/flags/cxx14.cmake") +include("${CMAKE_CURRENT_LIST_DIR}/os/osx.cmake") diff --git a/tools/polly/osx-10-13-cxx17.cmake b/tools/polly/osx-10-13-cxx17.cmake new file mode 100644 index 0000000..d4632aa --- /dev/null +++ b/tools/polly/osx-10-13-cxx17.cmake @@ -0,0 +1,29 @@ +# Copyright (c) 2016, 2018 Ruslan Baratov +# All rights reserved. + +if(DEFINED POLLY_OSX_10_13_CXX17_CMAKE_) + return() +else() + set(POLLY_OSX_10_13_CXX17_CMAKE_ 1) +endif() + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_init.cmake") + +set(OSX_SDK_VERSION "10.13") +set(POLLY_XCODE_COMPILER "clang") +polly_init( + "Xcode (OS X ${OSX_SDK_VERSION}) / \ +${POLLY_XCODE_COMPILER} / \ +LLVM Standard C++ Library (libc++) / c++17 support" + "Xcode" +) + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_common.cmake") + +include("${CMAKE_CURRENT_LIST_DIR}/compiler/xcode.cmake") + +set(CMAKE_OSX_DEPLOYMENT_TARGET "10.13" CACHE STRING "OS X Deployment target" FORCE) + +include("${CMAKE_CURRENT_LIST_DIR}/library/std/libcxx.cmake") +include("${CMAKE_CURRENT_LIST_DIR}/flags/cxx17.cmake") +include("${CMAKE_CURRENT_LIST_DIR}/os/osx.cmake") diff --git a/tools/polly/osx-10-13-dep-10-10-cxx14.cmake b/tools/polly/osx-10-13-dep-10-10-cxx14.cmake new file mode 100644 index 0000000..7c7a558 --- /dev/null +++ b/tools/polly/osx-10-13-dep-10-10-cxx14.cmake @@ -0,0 +1,29 @@ +# Copyright (c) 2016, Ruslan Baratov +# All rights reserved. + +if(DEFINED POLLY_OSX_10_13_DEP_10_10_CXX14_CMAKE_) + return() +else() + set(POLLY_OSX_10_13_DEP_10_10_CXX14_CMAKE_ 1) +endif() + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_init.cmake") + +set(OSX_SDK_VERSION "10.13") +set(POLLY_XCODE_COMPILER "clang") +polly_init( + "Xcode (OS X ${OSX_SDK_VERSION} | Deployment 10.10) / \ +${POLLY_XCODE_COMPILER} / \ +LLVM Standard C++ Library (libc++) / c++14 support" + "Xcode" +) + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_common.cmake") + +include("${CMAKE_CURRENT_LIST_DIR}/compiler/xcode.cmake") + +set(CMAKE_OSX_DEPLOYMENT_TARGET "10.10" CACHE STRING "OS X Deployment target" FORCE) + +include("${CMAKE_CURRENT_LIST_DIR}/library/std/libcxx.cmake") +include("${CMAKE_CURRENT_LIST_DIR}/flags/cxx14.cmake") +include("${CMAKE_CURRENT_LIST_DIR}/os/osx.cmake") diff --git a/tools/polly/osx-10-13-dep-10-10-cxx17.cmake b/tools/polly/osx-10-13-dep-10-10-cxx17.cmake new file mode 100644 index 0000000..5a33269 --- /dev/null +++ b/tools/polly/osx-10-13-dep-10-10-cxx17.cmake @@ -0,0 +1,29 @@ +# Copyright (c) 2016, Ruslan Baratov +# All rights reserved. + +if(DEFINED POLLY_OSX_10_13_DEP_10_10_CXX17_CMAKE_) + return() +else() + set(POLLY_OSX_10_13_DEP_10_10_CXX17_CMAKE_ 1) +endif() + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_init.cmake") + +set(OSX_SDK_VERSION "10.13") +set(POLLY_XCODE_COMPILER "clang") +polly_init( + "Xcode (OS X ${OSX_SDK_VERSION} | Deployment 10.10) / \ +${POLLY_XCODE_COMPILER} / \ +LLVM Standard C++ Library (libc++) / c++17 support" + "Xcode" +) + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_common.cmake") + +include("${CMAKE_CURRENT_LIST_DIR}/compiler/xcode.cmake") + +set(CMAKE_OSX_DEPLOYMENT_TARGET "10.10" CACHE STRING "OS X Deployment target" FORCE) + +include("${CMAKE_CURRENT_LIST_DIR}/library/std/libcxx.cmake") +include("${CMAKE_CURRENT_LIST_DIR}/flags/cxx17.cmake") +include("${CMAKE_CURRENT_LIST_DIR}/os/osx.cmake") diff --git a/tools/polly/osx-10-13-dep-10-10.cmake b/tools/polly/osx-10-13-dep-10-10.cmake new file mode 100644 index 0000000..1927833 --- /dev/null +++ b/tools/polly/osx-10-13-dep-10-10.cmake @@ -0,0 +1,29 @@ +# Copyright (c) 2016, Ruslan Baratov +# All rights reserved. + +if(DEFINED POLLY_OSX_10_13_DEP_10_10_CMAKE_) + return() +else() + set(POLLY_OSX_10_13_DEP_10_10_CMAKE_ 1) +endif() + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_init.cmake") + +set(OSX_SDK_VERSION "10.13") +set(POLLY_XCODE_COMPILER "clang") +polly_init( + "Xcode (OS X ${OSX_SDK_VERSION} | Deployment 10.10) / \ +${POLLY_XCODE_COMPILER} / \ +LLVM Standard C++ Library (libc++) / c++11 support" + "Xcode" +) + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_common.cmake") + +include("${CMAKE_CURRENT_LIST_DIR}/compiler/xcode.cmake") + +set(CMAKE_OSX_DEPLOYMENT_TARGET "10.10" CACHE STRING "OS X Deployment target" FORCE) + +include("${CMAKE_CURRENT_LIST_DIR}/library/std/libcxx.cmake") +include("${CMAKE_CURRENT_LIST_DIR}/flags/cxx11.cmake") +include("${CMAKE_CURRENT_LIST_DIR}/os/osx.cmake") diff --git a/tools/polly/osx-10-13-i386-cxx14.cmake b/tools/polly/osx-10-13-i386-cxx14.cmake new file mode 100644 index 0000000..e50254d --- /dev/null +++ b/tools/polly/osx-10-13-i386-cxx14.cmake @@ -0,0 +1,32 @@ +# Copyright (c) 2016, 2018 Ruslan Baratov +# All rights reserved. + +if(DEFINED POLLY_OSX_10_13_CXX14_CMAKE_) + return() +else() + set(POLLY_OSX_10_13_CXX14_CMAKE_ 1) +endif() + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_init.cmake") + +set(OSX_SDK_VERSION "10.13") +set(POLLY_XCODE_COMPILER "clang") + +set(CMAKE_OSX_ARCHITECTURES i386 CACHE INTERNAL "") + +polly_init( + "Xcode (OS X ${OSX_SDK_VERSION}) / \ +${POLLY_XCODE_COMPILER} / ${CMAKE_OSX_ARCHITECTURES} \ +LLVM Standard C++ Library (libc++) / c++14 support" + "Xcode" +) + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_common.cmake") + +include("${CMAKE_CURRENT_LIST_DIR}/compiler/xcode.cmake") + +set(CMAKE_OSX_DEPLOYMENT_TARGET "10.13" CACHE STRING "OS X Deployment target" FORCE) + +include("${CMAKE_CURRENT_LIST_DIR}/library/std/libcxx.cmake") +include("${CMAKE_CURRENT_LIST_DIR}/flags/cxx14.cmake") +include("${CMAKE_CURRENT_LIST_DIR}/os/osx.cmake") diff --git a/tools/polly/osx-10-13-make-cxx14.cmake b/tools/polly/osx-10-13-make-cxx14.cmake new file mode 100644 index 0000000..8683ff9 --- /dev/null +++ b/tools/polly/osx-10-13-make-cxx14.cmake @@ -0,0 +1,27 @@ +# Copyright (c) 2016, 2018 Ruslan Baratov +# All rights reserved. + +if(DEFINED POLLY_OSX_10_13_MAKE_CXX14_CMAKE_) + return() +else() + set(POLLY_OSX_10_13_MAKE_CXX14_CMAKE_ 1) +endif() + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_init.cmake") + +set(OSX_SDK_VERSION "10.13") +set(POLLY_XCODE_COMPILER "clang") +polly_init( + "Makefile (OS X ${OSX_SDK_VERSION}) / \ +${POLLY_XCODE_COMPILER} / \ +LLVM Standard C++ Library (libc++) / c++14 support" + "Unix Makefiles" +) + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_common.cmake") + +set(CMAKE_OSX_DEPLOYMENT_TARGET "10.13" CACHE STRING "OS X Deployment target" FORCE) + +include("${CMAKE_CURRENT_LIST_DIR}/library/std/libcxx.cmake") +include("${CMAKE_CURRENT_LIST_DIR}/flags/cxx14.cmake") +include("${CMAKE_CURRENT_LIST_DIR}/os/osx.cmake") diff --git a/tools/polly/osx-10-13.cmake b/tools/polly/osx-10-13.cmake new file mode 100644 index 0000000..453c86e --- /dev/null +++ b/tools/polly/osx-10-13.cmake @@ -0,0 +1,29 @@ +# Copyright (c) 2016, Ruslan Baratov +# All rights reserved. + +if(DEFINED POLLY_OSX_10_13_CMAKE_) + return() +else() + set(POLLY_OSX_10_13_CMAKE_ 1) +endif() + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_init.cmake") + +set(OSX_SDK_VERSION "10.13") +set(POLLY_XCODE_COMPILER "clang") +polly_init( + "Xcode (OS X ${OSX_SDK_VERSION}) / \ +${POLLY_XCODE_COMPILER} / \ +LLVM Standard C++ Library (libc++) / c++11 support" + "Xcode" +) + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_common.cmake") + +include("${CMAKE_CURRENT_LIST_DIR}/compiler/xcode.cmake") + +set(CMAKE_OSX_DEPLOYMENT_TARGET "10.13" CACHE STRING "OS X Deployment target" FORCE) + +include("${CMAKE_CURRENT_LIST_DIR}/library/std/libcxx.cmake") +include("${CMAKE_CURRENT_LIST_DIR}/flags/cxx11.cmake") +include("${CMAKE_CURRENT_LIST_DIR}/os/osx.cmake") diff --git a/tools/polly/osx-10-14-cxx14.cmake b/tools/polly/osx-10-14-cxx14.cmake new file mode 100644 index 0000000..28dab93 --- /dev/null +++ b/tools/polly/osx-10-14-cxx14.cmake @@ -0,0 +1,29 @@ +# Copyright (c) 2016, 2018 Ruslan Baratov +# All rights reserved. + +if(DEFINED POLLY_OSX_10_14_CXX14_CMAKE_) + return() +else() + set(POLLY_OSX_10_14_CXX14_CMAKE_ 1) +endif() + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_init.cmake") + +set(OSX_SDK_VERSION "10.14") +set(POLLY_XCODE_COMPILER "clang") +polly_init( + "Xcode (OS X ${OSX_SDK_VERSION}) / \ +${POLLY_XCODE_COMPILER} / \ +LLVM Standard C++ Library (libc++) / c++14 support" + "Xcode" +) + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_common.cmake") + +include("${CMAKE_CURRENT_LIST_DIR}/compiler/xcode.cmake") + +set(CMAKE_OSX_DEPLOYMENT_TARGET "10.14" CACHE STRING "OS X Deployment target" FORCE) + +include("${CMAKE_CURRENT_LIST_DIR}/library/std/libcxx.cmake") +include("${CMAKE_CURRENT_LIST_DIR}/flags/cxx14.cmake") +include("${CMAKE_CURRENT_LIST_DIR}/os/osx.cmake") diff --git a/tools/polly/osx-10-14-cxx17.cmake b/tools/polly/osx-10-14-cxx17.cmake new file mode 100644 index 0000000..47c7d57 --- /dev/null +++ b/tools/polly/osx-10-14-cxx17.cmake @@ -0,0 +1,29 @@ +# Copyright (c) 2016, 2018 Ruslan Baratov +# All rights reserved. + +if(DEFINED POLLY_OSX_10_14_CXX17_CMAKE_) + return() +else() + set(POLLY_OSX_10_14_CXX17_CMAKE_ 1) +endif() + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_init.cmake") + +set(OSX_SDK_VERSION "10.14") +set(POLLY_XCODE_COMPILER "clang") +polly_init( + "Xcode (OS X ${OSX_SDK_VERSION}) / \ +${POLLY_XCODE_COMPILER} / \ +LLVM Standard C++ Library (libc++) / c++17 support" + "Xcode" +) + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_common.cmake") + +include("${CMAKE_CURRENT_LIST_DIR}/compiler/xcode.cmake") + +set(CMAKE_OSX_DEPLOYMENT_TARGET "10.14" CACHE STRING "OS X Deployment target" FORCE) + +include("${CMAKE_CURRENT_LIST_DIR}/library/std/libcxx.cmake") +include("${CMAKE_CURRENT_LIST_DIR}/flags/cxx17.cmake") +include("${CMAKE_CURRENT_LIST_DIR}/os/osx.cmake") diff --git a/tools/polly/osx-10-14-dep-10-10-cxx14.cmake b/tools/polly/osx-10-14-dep-10-10-cxx14.cmake new file mode 100644 index 0000000..0e05fae --- /dev/null +++ b/tools/polly/osx-10-14-dep-10-10-cxx14.cmake @@ -0,0 +1,29 @@ +# Copyright (c) 2016, Ruslan Baratov +# All rights reserved. + +if(DEFINED POLLY_OSX_10_14_DEP_10_10_CXX14_CMAKE_) + return() +else() + set(POLLY_OSX_10_14_DEP_10_10_CXX14_CMAKE_ 1) +endif() + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_init.cmake") + +set(OSX_SDK_VERSION "10.14") +set(POLLY_XCODE_COMPILER "clang") +polly_init( + "Xcode (OS X ${OSX_SDK_VERSION} | Deployment 10.10) / \ +${POLLY_XCODE_COMPILER} / \ +LLVM Standard C++ Library (libc++) / c++14 support" + "Xcode" +) + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_common.cmake") + +include("${CMAKE_CURRENT_LIST_DIR}/compiler/xcode.cmake") + +set(CMAKE_OSX_DEPLOYMENT_TARGET "10.10" CACHE STRING "OS X Deployment target" FORCE) + +include("${CMAKE_CURRENT_LIST_DIR}/library/std/libcxx.cmake") +include("${CMAKE_CURRENT_LIST_DIR}/flags/cxx14.cmake") +include("${CMAKE_CURRENT_LIST_DIR}/os/osx.cmake") diff --git a/tools/polly/osx-10-14-dep-10-10-cxx17.cmake b/tools/polly/osx-10-14-dep-10-10-cxx17.cmake new file mode 100644 index 0000000..4ae7e0e --- /dev/null +++ b/tools/polly/osx-10-14-dep-10-10-cxx17.cmake @@ -0,0 +1,29 @@ +# Copyright (c) 2016, Ruslan Baratov +# All rights reserved. + +if(DEFINED POLLY_OSX_10_14_DEP_10_10_CXX17_CMAKE_) + return() +else() + set(POLLY_OSX_10_14_DEP_10_10_CXX17_CMAKE_ 1) +endif() + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_init.cmake") + +set(OSX_SDK_VERSION "10.14") +set(POLLY_XCODE_COMPILER "clang") +polly_init( + "Xcode (OS X ${OSX_SDK_VERSION} | Deployment 10.10) / \ +${POLLY_XCODE_COMPILER} / \ +LLVM Standard C++ Library (libc++) / c++17 support" + "Xcode" +) + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_common.cmake") + +include("${CMAKE_CURRENT_LIST_DIR}/compiler/xcode.cmake") + +set(CMAKE_OSX_DEPLOYMENT_TARGET "10.10" CACHE STRING "OS X Deployment target" FORCE) + +include("${CMAKE_CURRENT_LIST_DIR}/library/std/libcxx.cmake") +include("${CMAKE_CURRENT_LIST_DIR}/flags/cxx17.cmake") +include("${CMAKE_CURRENT_LIST_DIR}/os/osx.cmake") diff --git a/tools/polly/osx-10-14-dep-10-10.cmake b/tools/polly/osx-10-14-dep-10-10.cmake new file mode 100644 index 0000000..aa96091 --- /dev/null +++ b/tools/polly/osx-10-14-dep-10-10.cmake @@ -0,0 +1,29 @@ +# Copyright (c) 2016, Ruslan Baratov +# All rights reserved. + +if(DEFINED POLLY_OSX_10_14_DEP_10_10_CMAKE_) + return() +else() + set(POLLY_OSX_10_14_DEP_10_10_CMAKE_ 1) +endif() + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_init.cmake") + +set(OSX_SDK_VERSION "10.14") +set(POLLY_XCODE_COMPILER "clang") +polly_init( + "Xcode (OS X ${OSX_SDK_VERSION} | Deployment 10.10) / \ +${POLLY_XCODE_COMPILER} / \ +LLVM Standard C++ Library (libc++) / c++11 support" + "Xcode" +) + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_common.cmake") + +include("${CMAKE_CURRENT_LIST_DIR}/compiler/xcode.cmake") + +set(CMAKE_OSX_DEPLOYMENT_TARGET "10.10" CACHE STRING "OS X Deployment target" FORCE) + +include("${CMAKE_CURRENT_LIST_DIR}/library/std/libcxx.cmake") +include("${CMAKE_CURRENT_LIST_DIR}/flags/cxx11.cmake") +include("${CMAKE_CURRENT_LIST_DIR}/os/osx.cmake") diff --git a/tools/polly/osx-10-14.cmake b/tools/polly/osx-10-14.cmake new file mode 100644 index 0000000..6fe06cf --- /dev/null +++ b/tools/polly/osx-10-14.cmake @@ -0,0 +1,29 @@ +# Copyright (c) 2018, Ruslan Baratov +# All rights reserved. + +if(DEFINED POLLY_OSX_10_14_CMAKE_) + return() +else() + set(POLLY_OSX_10_14_CMAKE_ 1) +endif() + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_init.cmake") + +set(OSX_SDK_VERSION "10.14") +set(POLLY_XCODE_COMPILER "clang") +polly_init( + "Xcode (OS X ${OSX_SDK_VERSION}) / \ +${POLLY_XCODE_COMPILER} / \ +LLVM Standard C++ Library (libc++) / c++11 support" + "Xcode" +) + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_common.cmake") + +include("${CMAKE_CURRENT_LIST_DIR}/compiler/xcode.cmake") + +set(CMAKE_OSX_DEPLOYMENT_TARGET "10.14" CACHE STRING "OS X Deployment target" FORCE) + +include("${CMAKE_CURRENT_LIST_DIR}/library/std/libcxx.cmake") +include("${CMAKE_CURRENT_LIST_DIR}/flags/cxx11.cmake") +include("${CMAKE_CURRENT_LIST_DIR}/os/osx.cmake") diff --git a/tools/polly/osx-10-7.cmake b/tools/polly/osx-10-7.cmake new file mode 100644 index 0000000..e2fa795 --- /dev/null +++ b/tools/polly/osx-10-7.cmake @@ -0,0 +1,29 @@ +# Copyright (c) 2015, Ruslan Baratov +# All rights reserved. + +if(DEFINED POLLY_OSX_10_7_CMAKE_) + return() +else() + set(POLLY_OSX_10_7_CMAKE_ 1) +endif() + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_init.cmake") + +set(OSX_SDK_VERSION "10.7") +set(POLLY_XCODE_COMPILER "clang") +polly_init( + "Xcode (OS X ${OSX_SDK_VERSION}) / \ +${POLLY_XCODE_COMPILER} / \ +LLVM Standard C++ Library (libc++) / c++11 support" + "Xcode" +) + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_common.cmake") + +include("${CMAKE_CURRENT_LIST_DIR}/compiler/xcode.cmake") + +set(CMAKE_OSX_DEPLOYMENT_TARGET "10.7" CACHE STRING "OS X Deployment target" FORCE) + +include("${CMAKE_CURRENT_LIST_DIR}/library/std/libcxx.cmake") +include("${CMAKE_CURRENT_LIST_DIR}/flags/cxx11.cmake") +include("${CMAKE_CURRENT_LIST_DIR}/os/osx.cmake") diff --git a/tools/polly/osx-10-8.cmake b/tools/polly/osx-10-8.cmake new file mode 100644 index 0000000..e663a34 --- /dev/null +++ b/tools/polly/osx-10-8.cmake @@ -0,0 +1,29 @@ +# Copyright (c) 2015, Ruslan Baratov +# All rights reserved. + +if(DEFINED POLLY_OSX_10_8_CMAKE_) + return() +else() + set(POLLY_OSX_10_8_CMAKE_ 1) +endif() + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_init.cmake") + +set(OSX_SDK_VERSION "10.8") +set(POLLY_XCODE_COMPILER "clang") +polly_init( + "Xcode (OS X ${OSX_SDK_VERSION}) / \ +${POLLY_XCODE_COMPILER} / \ +LLVM Standard C++ Library (libc++) / c++11 support" + "Xcode" +) + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_common.cmake") + +include("${CMAKE_CURRENT_LIST_DIR}/compiler/xcode.cmake") + +set(CMAKE_OSX_DEPLOYMENT_TARGET "10.8" CACHE STRING "OS X Deployment target" FORCE) + +include("${CMAKE_CURRENT_LIST_DIR}/library/std/libcxx.cmake") +include("${CMAKE_CURRENT_LIST_DIR}/flags/cxx11.cmake") +include("${CMAKE_CURRENT_LIST_DIR}/os/osx.cmake") diff --git a/tools/polly/osx-10-9.cmake b/tools/polly/osx-10-9.cmake new file mode 100644 index 0000000..0e488a3 --- /dev/null +++ b/tools/polly/osx-10-9.cmake @@ -0,0 +1,29 @@ +# Copyright (c) 2015, Ruslan Baratov +# All rights reserved. + +if(DEFINED POLLY_OSX_10_9_CMAKE_) + return() +else() + set(POLLY_OSX_10_9_CMAKE_ 1) +endif() + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_init.cmake") + +set(OSX_SDK_VERSION "10.9") +set(POLLY_XCODE_COMPILER "clang") +polly_init( + "Xcode (OS X ${OSX_SDK_VERSION}) / \ +${POLLY_XCODE_COMPILER} / \ +LLVM Standard C++ Library (libc++) / c++11 support" + "Xcode" +) + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_common.cmake") + +include("${CMAKE_CURRENT_LIST_DIR}/compiler/xcode.cmake") + +set(CMAKE_OSX_DEPLOYMENT_TARGET "10.9" CACHE STRING "OS X Deployment target" FORCE) + +include("${CMAKE_CURRENT_LIST_DIR}/library/std/libcxx.cmake") +include("${CMAKE_CURRENT_LIST_DIR}/flags/cxx11.cmake") +include("${CMAKE_CURRENT_LIST_DIR}/os/osx.cmake") diff --git a/tools/polly/raspberrypi1-cxx11-pic-static-std.cmake b/tools/polly/raspberrypi1-cxx11-pic-static-std.cmake new file mode 100644 index 0000000..2a13df1 --- /dev/null +++ b/tools/polly/raspberrypi1-cxx11-pic-static-std.cmake @@ -0,0 +1,27 @@ +# Copyright (c) 2015, 2017 Alexandre Pretyman +# Copyright (c) 2017 Ruslan Baratov +# All rights reserved. + +if(DEFINED POLLY_RASPBERRYPI1_CXX11_PIC_CMAKE_) + return() +else() + set(POLLY_RASPBERRYPI1_CXX11_PIC_CMAKE_ 1) +endif() + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_init.cmake") + +polly_init( + "RaspberryPi 1 Cross Compile / C++11 / PIC" + "Unix Makefiles" +) + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_common.cmake") + +include(polly_clear_environment_variables) + +include("${CMAKE_CURRENT_LIST_DIR}/flags/cxx11.cmake") +include("${CMAKE_CURRENT_LIST_DIR}/flags/static-std.cmake") +include("${CMAKE_CURRENT_LIST_DIR}/compiler/gcc-cross-compile-raspberry-pi.cmake") +include("${CMAKE_CURRENT_LIST_DIR}/os/raspberry-pi1.cmake") + +include("${CMAKE_CURRENT_LIST_DIR}/flags/fpic.cmake") diff --git a/tools/polly/raspberrypi1-cxx11-pic.cmake b/tools/polly/raspberrypi1-cxx11-pic.cmake new file mode 100644 index 0000000..ba8e52a --- /dev/null +++ b/tools/polly/raspberrypi1-cxx11-pic.cmake @@ -0,0 +1,26 @@ +# Copyright (c) 2015, 2017 Alexandre Pretyman +# Copyright (c) 2017 Ruslan Baratov +# All rights reserved. + +if(DEFINED POLLY_RASPBERRYPI1_CXX11_PIC_CMAKE_) + return() +else() + set(POLLY_RASPBERRYPI1_CXX11_PIC_CMAKE_ 1) +endif() + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_init.cmake") + +polly_init( + "RaspberryPi 1 Cross Compile / C++11 / PIC" + "Unix Makefiles" +) + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_common.cmake") + +include(polly_clear_environment_variables) + +include("${CMAKE_CURRENT_LIST_DIR}/flags/cxx11.cmake") +include("${CMAKE_CURRENT_LIST_DIR}/compiler/gcc-cross-compile-raspberry-pi.cmake") +include("${CMAKE_CURRENT_LIST_DIR}/os/raspberry-pi1.cmake") + +include("${CMAKE_CURRENT_LIST_DIR}/flags/fpic.cmake") diff --git a/tools/polly/raspberrypi2-cxx11-pic.cmake b/tools/polly/raspberrypi2-cxx11-pic.cmake new file mode 100644 index 0000000..76b1207 --- /dev/null +++ b/tools/polly/raspberrypi2-cxx11-pic.cmake @@ -0,0 +1,26 @@ +# Copyright (c) 2015, 2017 Alexandre Pretyman +# All rights reserved. + +if(DEFINED POLLY_RASPBERRYPI2_CXX11_CMAKE) + return() +else() + set(POLLY_RASPBERRYPI2_CXX11_CMAKE 1) +endif() + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_init.cmake") + +polly_init( + "RaspberryPi 2 Cross Compile / C++11 / PIC" + "Unix Makefiles" +) + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_common.cmake") + +include(polly_clear_environment_variables) + +include("${CMAKE_CURRENT_LIST_DIR}/flags/cxx11.cmake") +include("${CMAKE_CURRENT_LIST_DIR}/compiler/gcc-cross-compile-raspberry-pi.cmake") +include("${CMAKE_CURRENT_LIST_DIR}/os/raspberry-pi2.cmake") +include("${CMAKE_CURRENT_LIST_DIR}/os/raspberry-pi-hardfloat.cmake") + +include("${CMAKE_CURRENT_LIST_DIR}/flags/fpic.cmake") diff --git a/tools/polly/raspberrypi2-cxx11.cmake b/tools/polly/raspberrypi2-cxx11.cmake new file mode 100644 index 0000000..e1b6dfb --- /dev/null +++ b/tools/polly/raspberrypi2-cxx11.cmake @@ -0,0 +1,25 @@ +# Copyright (c) 2015, 2017 Alexandre Pretyman +# All rights reserved. + +if(DEFINED POLLY_RASPBERRYPI2_CXX11_CMAKE) + return() +else() + set(POLLY_RASPBERRYPI2_CXX11_CMAKE 1) +endif() + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_init.cmake") + +polly_init( + "RaspberryPi 2 Cross Compile / C++11" + "Unix Makefiles" +) + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_common.cmake") + +include(polly_clear_environment_variables) + +include("${CMAKE_CURRENT_LIST_DIR}/flags/cxx11.cmake") +include("${CMAKE_CURRENT_LIST_DIR}/compiler/gcc-cross-compile-raspberry-pi.cmake") +include("${CMAKE_CURRENT_LIST_DIR}/os/raspberry-pi2.cmake") +include("${CMAKE_CURRENT_LIST_DIR}/os/raspberry-pi-hardfloat.cmake") + diff --git a/tools/polly/raspberrypi3-cxx11.cmake b/tools/polly/raspberrypi3-cxx11.cmake new file mode 100644 index 0000000..cbfb5c1 --- /dev/null +++ b/tools/polly/raspberrypi3-cxx11.cmake @@ -0,0 +1,24 @@ +# Copyright (c) 2015, 2017 Alexandre Pretyman +# All rights reserved. + +if(DEFINED POLLY_RASPBERRYPI3_CXX11_CMAKE) + return() +else() + set(POLLY_RASPBERRYPI3_CXX11_CMAKE 1) +endif() + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_init.cmake") + +polly_init( + "RaspberryPi 3 Cross Compile / C++11" + "Unix Makefiles" +) + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_common.cmake") + +include(polly_clear_environment_variables) + +include("${CMAKE_CURRENT_LIST_DIR}/flags/cxx11.cmake") +include("${CMAKE_CURRENT_LIST_DIR}/compiler/gcc-cross-compile-raspberry-pi.cmake") +include("${CMAKE_CURRENT_LIST_DIR}/os/raspberry-pi3.cmake") +include("${CMAKE_CURRENT_LIST_DIR}/os/raspberry-pi-hardfloat.cmake") diff --git a/tools/polly/raspberrypi3-gcc-pic-hid-sections.cmake b/tools/polly/raspberrypi3-gcc-pic-hid-sections.cmake new file mode 100644 index 0000000..9dfd323 --- /dev/null +++ b/tools/polly/raspberrypi3-gcc-pic-hid-sections.cmake @@ -0,0 +1,29 @@ +# Copyright (c) 2015, 2017 Alexandre Pretyman +# All rights reserved. + +if(DEFINED POLLY_RASPBERRYPI3_CXX11_CMAKE) + return() +else() + set(POLLY_RASPBERRYPI3_CXX11_CMAKE 1) +endif() + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_init.cmake") + +polly_init( + "RaspberryPi 3 / gcc / PIC / c++11 support / hidden / function-sections / data-sections" + "Unix Makefiles" +) + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_common.cmake") + +include(polly_clear_environment_variables) + +include("${CMAKE_CURRENT_LIST_DIR}/flags/cxx11.cmake") +include("${CMAKE_CURRENT_LIST_DIR}/compiler/gcc-cross-compile-raspberry-pi.cmake") +include("${CMAKE_CURRENT_LIST_DIR}/os/raspberry-pi3.cmake") +include("${CMAKE_CURRENT_LIST_DIR}/os/raspberry-pi-hardfloat.cmake") + +include("${CMAKE_CURRENT_LIST_DIR}/flags/fpic.cmake") +include("${CMAKE_CURRENT_LIST_DIR}/flags/function-sections.cmake") +include("${CMAKE_CURRENT_LIST_DIR}/flags/data-sections.cmake") +include("${CMAKE_CURRENT_LIST_DIR}/flags/hidden.cmake") diff --git a/tools/polly/sanitize-address-cxx17-pic.cmake b/tools/polly/sanitize-address-cxx17-pic.cmake new file mode 100644 index 0000000..06fa3ef --- /dev/null +++ b/tools/polly/sanitize-address-cxx17-pic.cmake @@ -0,0 +1,22 @@ +# Copyright (c) 2014, 2018 Ruslan Baratov +# All rights reserved. + +if(DEFINED POLLY_SANITIZE_ADDRESS_CXX17_PIC_CMAKE_) + return() +else() + set(POLLY_SANITIZE_ADDRESS_CXX17_PIC_CMAKE_ 1) +endif() + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_init.cmake") + +polly_init( + "Clang address sanitizer / c++17 support / PIC" + "Unix Makefiles" +) + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_common.cmake") + +include("${CMAKE_CURRENT_LIST_DIR}/compiler/clang.cmake") +include("${CMAKE_CURRENT_LIST_DIR}/flags/cxx17.cmake") +include("${CMAKE_CURRENT_LIST_DIR}/flags/fpic.cmake") +include("${CMAKE_CURRENT_LIST_DIR}/flags/sanitize_address.cmake") diff --git a/tools/polly/sanitize-address-cxx17.cmake b/tools/polly/sanitize-address-cxx17.cmake new file mode 100644 index 0000000..b15b329 --- /dev/null +++ b/tools/polly/sanitize-address-cxx17.cmake @@ -0,0 +1,22 @@ +# Copyright (c) 2014, 2018 Ruslan Baratov +# All rights reserved. + +if(DEFINED POLLY_SANITIZE_ADDRESS_CXX17_CMAKE_) + return() +else() + set(POLLY_SANITIZE_ADDRESS_CXX17_CMAKE_ 1) +endif() + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_init.cmake") + +polly_init( + "Clang address sanitizer / c++17 support" + "Unix Makefiles" +) + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_common.cmake") + +include("${CMAKE_CURRENT_LIST_DIR}/compiler/clang.cmake") +include("${CMAKE_CURRENT_LIST_DIR}/flags/cxx17.cmake") + +include("${CMAKE_CURRENT_LIST_DIR}/flags/sanitize_address.cmake") diff --git a/tools/polly/sanitize-address.cmake b/tools/polly/sanitize-address.cmake new file mode 100644 index 0000000..f69a4b6 --- /dev/null +++ b/tools/polly/sanitize-address.cmake @@ -0,0 +1,22 @@ +# Copyright (c) 2014, Ruslan Baratov +# All rights reserved. + +if(DEFINED POLLY_SANITIZE_ADDRESS_CMAKE_) + return() +else() + set(POLLY_SANITIZE_ADDRESS_CMAKE_ 1) +endif() + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_init.cmake") + +polly_init( + "Clang address sanitizer / c++11 support" + "Unix Makefiles" +) + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_common.cmake") + +include("${CMAKE_CURRENT_LIST_DIR}/compiler/clang.cmake") +include("${CMAKE_CURRENT_LIST_DIR}/flags/cxx11.cmake") + +include("${CMAKE_CURRENT_LIST_DIR}/flags/sanitize_address.cmake") diff --git a/tools/polly/sanitize-leak-cxx17-pic.cmake b/tools/polly/sanitize-leak-cxx17-pic.cmake new file mode 100644 index 0000000..2003130 --- /dev/null +++ b/tools/polly/sanitize-leak-cxx17-pic.cmake @@ -0,0 +1,22 @@ +# Copyright (c) 2014, 2018 Ruslan Baratov +# All rights reserved. + +if(DEFINED POLLY_SANITIZE_LEAK_CXX17_PIC_CMAKE_) + return() +else() + set(POLLY_SANITIZE_LEAK_CXX17_PIC_CMAKE_ 1) +endif() + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_init.cmake") + +polly_init( + "Clang memory leaks sanitizer / c++17 support / PIC" + "Unix Makefiles" +) + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_common.cmake") + +include("${CMAKE_CURRENT_LIST_DIR}/compiler/clang.cmake") +include("${CMAKE_CURRENT_LIST_DIR}/flags/cxx17.cmake") +include("${CMAKE_CURRENT_LIST_DIR}/flags/fpic.cmake") +include("${CMAKE_CURRENT_LIST_DIR}/flags/sanitize_leak.cmake") diff --git a/tools/polly/sanitize-leak-cxx17.cmake b/tools/polly/sanitize-leak-cxx17.cmake new file mode 100644 index 0000000..3847422 --- /dev/null +++ b/tools/polly/sanitize-leak-cxx17.cmake @@ -0,0 +1,22 @@ +# Copyright (c) 2014, 2018 Ruslan Baratov +# All rights reserved. + +if(DEFINED POLLY_SANITIZE_LEAK_CXX17_CMAKE_) + return() +else() + set(POLLY_SANITIZE_LEAK_CXX17_CMAKE_ 1) +endif() + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_init.cmake") + +polly_init( + "Clang memory leaks sanitizer / c++17 support" + "Unix Makefiles" +) + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_common.cmake") + +include("${CMAKE_CURRENT_LIST_DIR}/compiler/clang.cmake") +include("${CMAKE_CURRENT_LIST_DIR}/flags/cxx17.cmake") + +include("${CMAKE_CURRENT_LIST_DIR}/flags/sanitize_leak.cmake") diff --git a/tools/polly/sanitize-leak.cmake b/tools/polly/sanitize-leak.cmake new file mode 100644 index 0000000..a5ff6ae --- /dev/null +++ b/tools/polly/sanitize-leak.cmake @@ -0,0 +1,22 @@ +# Copyright (c) 2014, Ruslan Baratov +# All rights reserved. + +if(DEFINED POLLY_SANITIZE_LEAK_CMAKE_) + return() +else() + set(POLLY_SANITIZE_LEAK_CMAKE_ 1) +endif() + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_init.cmake") + +polly_init( + "Clang memory leaks sanitizer / c++11 support" + "Unix Makefiles" +) + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_common.cmake") + +include("${CMAKE_CURRENT_LIST_DIR}/compiler/clang.cmake") +include("${CMAKE_CURRENT_LIST_DIR}/flags/cxx11.cmake") + +include("${CMAKE_CURRENT_LIST_DIR}/flags/sanitize_leak.cmake") diff --git a/tools/polly/sanitize-memory.cmake b/tools/polly/sanitize-memory.cmake new file mode 100644 index 0000000..9ed77fb --- /dev/null +++ b/tools/polly/sanitize-memory.cmake @@ -0,0 +1,21 @@ +# Copyright (c) 2014, Ruslan Baratov +# All rights reserved. + +if(DEFINED POLLY_SANITIZE_MEMORY_CMAKE_) + return() +else() + set(POLLY_SANITIZE_MEMORY_CMAKE_ 1) +endif() + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_init.cmake") + +polly_init( + "Clang memory sanitizer / c++11 support" + "Unix Makefiles" +) + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_common.cmake") + +include("${CMAKE_CURRENT_LIST_DIR}/compiler/clang.cmake") +include("${CMAKE_CURRENT_LIST_DIR}/flags/cxx11.cmake") +include("${CMAKE_CURRENT_LIST_DIR}/flags/sanitize_memory.cmake") diff --git a/tools/polly/sanitize-thread-cxx17-pic.cmake b/tools/polly/sanitize-thread-cxx17-pic.cmake new file mode 100644 index 0000000..3bb2252 --- /dev/null +++ b/tools/polly/sanitize-thread-cxx17-pic.cmake @@ -0,0 +1,22 @@ +# Copyright (c) 2014, 2018 Ruslan Baratov +# All rights reserved. + +if(DEFINED POLLY_SANITIZE_THREAD_CXX17_PIC_CMAKE_) + return() +else() + set(POLLY_SANITIZE_THREAD_CXX17_PIC_CMAKE_ 1) +endif() + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_init.cmake") + +polly_init( + "Clang thread sanitizer / c++17 support / PIC" + "Unix Makefiles" +) + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_common.cmake") + +include("${CMAKE_CURRENT_LIST_DIR}/compiler/clang.cmake") +include("${CMAKE_CURRENT_LIST_DIR}/flags/cxx17.cmake") +include("${CMAKE_CURRENT_LIST_DIR}/flags/fpic.cmake") +include("${CMAKE_CURRENT_LIST_DIR}/flags/sanitize_thread.cmake") diff --git a/tools/polly/sanitize-thread-cxx17.cmake b/tools/polly/sanitize-thread-cxx17.cmake new file mode 100644 index 0000000..ba105c7 --- /dev/null +++ b/tools/polly/sanitize-thread-cxx17.cmake @@ -0,0 +1,21 @@ +# Copyright (c) 2014, 2018 Ruslan Baratov +# All rights reserved. + +if(DEFINED POLLY_SANITIZE_THREAD_CXX17_CMAKE_) + return() +else() + set(POLLY_SANITIZE_THREAD_CXX17_CMAKE_ 1) +endif() + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_init.cmake") + +polly_init( + "Clang thread sanitizer / c++17 support" + "Unix Makefiles" +) + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_common.cmake") + +include("${CMAKE_CURRENT_LIST_DIR}/compiler/clang.cmake") +include("${CMAKE_CURRENT_LIST_DIR}/flags/cxx17.cmake") +include("${CMAKE_CURRENT_LIST_DIR}/flags/sanitize_thread.cmake") diff --git a/tools/polly/sanitize-thread.cmake b/tools/polly/sanitize-thread.cmake new file mode 100644 index 0000000..b86182f --- /dev/null +++ b/tools/polly/sanitize-thread.cmake @@ -0,0 +1,21 @@ +# Copyright (c) 2014, Ruslan Baratov +# All rights reserved. + +if(DEFINED POLLY_SANITIZE_THREAD_CMAKE_) + return() +else() + set(POLLY_SANITIZE_THREAD_CMAKE_ 1) +endif() + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_init.cmake") + +polly_init( + "Clang thread sanitizer / c++11 support" + "Unix Makefiles" +) + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_common.cmake") + +include("${CMAKE_CURRENT_LIST_DIR}/compiler/clang.cmake") +include("${CMAKE_CURRENT_LIST_DIR}/flags/cxx11.cmake") +include("${CMAKE_CURRENT_LIST_DIR}/flags/sanitize_thread.cmake") diff --git a/tools/polly/scripts/Info.plist b/tools/polly/scripts/Info.plist new file mode 100644 index 0000000..c6a6112 --- /dev/null +++ b/tools/polly/scripts/Info.plist @@ -0,0 +1,24 @@ + + + + + CFBundleExecutable + __BUNDLE_EXECUTABLE__ + CFBundleDevelopmentRegion + English + CFBundleIdentifier + com.github.ruslo.polly + CFBundleInfoDictionaryVersion + 6.0 + CFBundlePackageType + FMWK + CFBundleSignature + ???? + CFBundleShortVersionString + 1.0 + CFBundleVersion + 1 + MinimumOSVersion + __MINIMUM_OS_VERSION__ + + diff --git a/tools/polly/scripts/NoCodeSign.xcconfig b/tools/polly/scripts/NoCodeSign.xcconfig new file mode 100644 index 0000000..b963993 --- /dev/null +++ b/tools/polly/scripts/NoCodeSign.xcconfig @@ -0,0 +1,4 @@ +CODE_SIGN_IDENTITY="" +CODE_SIGNING_REQUIRED="NO" +CODE_SIGN_ENTITLEMENTS="" +CODE_SIGNING_ALLOWED="NO" diff --git a/tools/polly/scripts/clang-analyze.sh b/tools/polly/scripts/clang-analyze.sh new file mode 100755 index 0000000..2d3cd07 --- /dev/null +++ b/tools/polly/scripts/clang-analyze.sh @@ -0,0 +1,38 @@ +#!/bin/bash + +# Copyright (c) 2014, Ruslan Baratov +# All rights reserved. + +set -x + +for x in "$@"; +do + if [ "${x}" == "-c" ]; + then + temp_out="`mktemp /tmp/polly-clang-analyze.out.XXXXX`" + temp_bin="`mktemp /tmp/polly-clang-analyze.bin.XXXXX`" + + # analyze + # -w : ignore regular compiler warnings so 'temp_out' only contains + # messages from analyzer. '-w' should not be a part of toolchain flags + # since Hunter toolchain-id calculated using '#pragma message' output which + # is implemented as a warning message (hence will be suppressed by '-w') + clang --analyze -w "$@" -o "${temp_bin}" 2> "${temp_out}" + + RESULT=0 + [ "$?" == 0 ] || RESULT=1 + [ -s "${temp_out}" ] && RESULT=1 + + cat "${temp_out}"; + rm -f "${temp_out}" + rm -f "${temp_bin}" + + if [ "${RESULT}" == "1" ]; + then + exit 1; + fi + fi +done + +# compile real code +clang "$@" diff --git a/tools/polly/scripts/clangxx-analyze.sh b/tools/polly/scripts/clangxx-analyze.sh new file mode 100755 index 0000000..e2d1bb7 --- /dev/null +++ b/tools/polly/scripts/clangxx-analyze.sh @@ -0,0 +1,38 @@ +#!/bin/bash + +# Copyright (c) 2014, Ruslan Baratov +# All rights reserved. + +set -x + +for x in "$@"; +do + if [ "${x}" == "-c" ]; + then + temp_out="`mktemp /tmp/polly-clang-analyze.out.XXXXX`" + temp_bin="`mktemp /tmp/polly-clang-analyze.bin.XXXXX`" + + # analyze + # -w : ignore regular compiler warnings so 'temp_out' only contains + # messages from analyzer. '-w' should not be a part of toolchain flags + # since Hunter toolchain-id calculated using '#pragma message' output which + # is implemented as a warning message (hence will be suppressed by '-w') + clang++ --analyze -w "$@" -o "${temp_bin}" 2> "${temp_out}" + + RESULT=0 + [ "$?" == 0 ] || RESULT=1 + [ -s "${temp_out}" ] && RESULT=1 + + cat "${temp_out}"; + rm -f "${temp_out}" + rm -f "${temp_bin}" + + if [ "${RESULT}" == "1" ]; + then + exit 1; + fi + fi +done + +# compile real code +clang++ "$@" diff --git a/tools/polly/utilities/polly_add_cache_flag.cmake b/tools/polly/utilities/polly_add_cache_flag.cmake new file mode 100644 index 0000000..53209cc --- /dev/null +++ b/tools/polly/utilities/polly_add_cache_flag.cmake @@ -0,0 +1,31 @@ +# Copyright (c) 2014, Ruslan Baratov +# All rights reserved. + +# Add flag to CACHE variable. Do nothing if flag already exists. +# +# Note: +# flags should be added one by one since this function check that +# substring "flag" already exists in string "var_name". +# +# Bad: +# polly_add_cache_flag(CMAKE_CXX_FLAGS "-opt1 -opt2 -opt3") +# +# Good: +# polly_add_cache_flag(CMAKE_CXX_FLAGS "-opt1") +# polly_add_cache_flag(CMAKE_CXX_FLAGS "-opt2") +# polly_add_cache_flag(CMAKE_CXX_FLAGS "-opt3") +# +function(polly_add_cache_flag var_name flag) + set(spaced_string " ${${var_name}} ") + string(FIND "${spaced_string}" " ${flag} " flag_index) + if(NOT flag_index EQUAL -1) + return() + endif() + string(COMPARE EQUAL "" "${${var_name}}" is_empty) + if(is_empty) + # beautify: avoid extra space at the end if var_name is empty + set("${var_name}" "${flag}" CACHE STRING "" FORCE) + else() + set("${var_name}" "${flag} ${${var_name}}" CACHE STRING "" FORCE) + endif() +endfunction() diff --git a/tools/polly/utilities/polly_clear_environment_variables.cmake b/tools/polly/utilities/polly_clear_environment_variables.cmake new file mode 100644 index 0000000..3ce8136 --- /dev/null +++ b/tools/polly/utilities/polly_clear_environment_variables.cmake @@ -0,0 +1,290 @@ +# Error while building using 'ExternalProject_Add': + +#CMake Error at /.../share/cmake/Modules/Platform/Darwin.cmake:211 (message): +# CMAKE_OSX_DEPLOYMENT_TARGET is '10.9' but CMAKE_OSX_SYSROOT: +# "iphoneos" +# is not set to a MacOSX SDK with a recognized version. Either set +# CMAKE_OSX_SYSROOT to a valid SDK or set CMAKE_OSX_DEPLOYMENT_TARGET to +# empty. + +unset(ENV{ACTION}) +unset(ENV{AD_HOC_CODE_SIGNING_ALLOWED}) +unset(ENV{ALTERNATE_GROUP}) +unset(ENV{ALTERNATE_MODE}) +unset(ENV{ALTERNATE_OWNER}) +unset(ENV{ALWAYS_SEARCH_USER_PATHS}) +unset(ENV{ALWAYS_USE_SEPARATE_HEADERMAPS}) +unset(ENV{APPLE_INTERNAL_DEVELOPER_DIR}) +unset(ENV{APPLE_INTERNAL_DIR}) +unset(ENV{APPLE_INTERNAL_DOCUMENTATION_DIR}) +unset(ENV{APPLE_INTERNAL_LIBRARY_DIR}) +unset(ENV{APPLE_INTERNAL_TOOLS}) +unset(ENV{APPLY_RULES_IN_COPY_FILES}) +unset(ENV{ARCHS_STANDARD_32_64_BIT}) +unset(ENV{ARCHS_STANDARD_32_BIT}) +unset(ENV{ARCHS_STANDARD_64_BIT}) +unset(ENV{ARCHS_STANDARD_INCLUDING_64_BIT}) +unset(ENV{ARCHS_STANDARD}) +unset(ENV{ARCHS_UNIVERSAL_IPHONE_OS}) +unset(ENV{ARCHS}) +unset(ENV{AVAILABLE_PLATFORMS}) +unset(ENV{BUILD_COMPONENTS}) +unset(ENV{BUILD_DIR}) +unset(ENV{BUILD_ROOT}) +unset(ENV{BUILD_STYLE}) +unset(ENV{BUILD_VARIANTS}) +unset(ENV{BUILT_PRODUCTS_DIR}) +unset(ENV{CACHE_ROOT}) +unset(ENV{CCHROOT}) +unset(ENV{CHMOD}) +unset(ENV{CHOWN}) +unset(ENV{CLASS_FILE_DIR}) +unset(ENV{CLEAN_PRECOMPS}) +unset(ENV{CLONE_HEADERS}) +unset(ENV{CMAKE_OSX_DEPLOYMENT_TARGET}) +unset(ENV{CODESIGNING_FOLDER_PATH}) +unset(ENV{CODE_SIGNING_ALLOWED}) +unset(ENV{CODE_SIGNING_REQUIRED}) +unset(ENV{CODE_SIGN_CONTEXT_CLASS}) +unset(ENV{COMBINE_HIDPI_IMAGES}) +unset(ENV{COMMAND_MODE}) +unset(ENV{COMPOSITE_SDK_DIRS}) +unset(ENV{COMPRESS_PNG_FILES}) +unset(ENV{CONFIGURATION_BUILD_DIR}) +unset(ENV{CONFIGURATION_TEMP_DIR}) +unset(ENV{CONFIGURATION}) +unset(ENV{COPYING_PRESERVES_HFS_DATA}) +unset(ENV{COPY_PHASE_STRIP}) +unset(ENV{COPY_RESOURCES_FROM_STATIC_FRAMEWORKS}) +unset(ENV{CP}) +unset(ENV{CREATE_INFOPLIST_SECTION_IN_BINARY}) +unset(ENV{CURRENT_ARCH}) +unset(ENV{CURRENT_VARIANT}) +unset(ENV{DEAD_CODE_STRIPPING}) +unset(ENV{DEBUGGING_SYMBOLS}) +unset(ENV{DEBUG_INFORMATION_FORMAT}) +unset(ENV{DEFAULT_COMPILER}) +unset(ENV{DEFAULT_KEXT_INSTALL_PATH}) +unset(ENV{DEPLOYMENT_LOCATION}) +unset(ENV{DEPLOYMENT_POSTPROCESSING}) +unset(ENV{DERIVED_FILES_DIR}) +unset(ENV{DERIVED_FILE_DIR}) +unset(ENV{DERIVED_SOURCES_DIR}) +unset(ENV{DEVELOPER_APPLICATIONS_DIR}) +unset(ENV{DEVELOPER_BIN_DIR}) +# unset(ENV{DEVELOPER_DIR}) # Keep it to allow Xcode switching +unset(ENV{DEVELOPER_FRAMEWORKS_DIR_QUOTED}) +unset(ENV{DEVELOPER_FRAMEWORKS_DIR}) +unset(ENV{DEVELOPER_LIBRARY_DIR}) +unset(ENV{DEVELOPER_SDK_DIR}) +unset(ENV{DEVELOPER_TOOLS_DIR}) +unset(ENV{DEVELOPER_USR_DIR}) +unset(ENV{DEVELOPMENT_LANGUAGE}) +unset(ENV{DO_HEADER_SCANNING_IN_JAM}) +unset(ENV{DSTROOT}) +unset(ENV{DT_TOOLCHAIN_DIR}) +unset(ENV{DWARF_DSYM_FILE_NAME}) +unset(ENV{DWARF_DSYM_FILE_SHOULD_ACCOMPANY_PRODUCT}) +unset(ENV{DWARF_DSYM_FOLDER_PATH}) +unset(ENV{EFFECTIVE_PLATFORM_NAME}) +unset(ENV{EMBEDDED_PROFILE_NAME}) +unset(ENV{ENABLE_HEADER_DEPENDENCIES}) +unset(ENV{ENTITLEMENTS_REQUIRED}) +unset(ENV{EXCLUDED_INSTALLSRC_SUBDIRECTORY_PATTERNS}) +unset(ENV{EXCLUDED_RECURSIVE_SEARCH_PATH_SUBDIRECTORIES}) +unset(ENV{FILE_LIST}) +unset(ENV{FIXED_FILES_DIR}) +unset(ENV{FRAMEWORK_VERSION}) +unset(ENV{GCC3_VERSION}) +unset(ENV{GCC_GENERATE_DEBUGGING_SYMBOLS}) +unset(ENV{GCC_INLINES_ARE_PRIVATE_EXTERN}) +unset(ENV{GCC_OPTIMIZATION_LEVEL}) +unset(ENV{GCC_PFE_FILE_C_DIALECTS}) +unset(ENV{GCC_PREPROCESSOR_DEFINITIONS}) +unset(ENV{GCC_SYMBOLS_PRIVATE_EXTERN}) +unset(ENV{GCC_THUMB_SUPPORT}) +unset(ENV{GCC_TREAT_WARNINGS_AS_ERRORS}) +unset(ENV{GCC_VERSION_IDENTIFIER}) +unset(ENV{GCC_VERSION}) +unset(ENV{GENERATE_MASTER_OBJECT_FILE}) +unset(ENV{GENERATE_PKGINFO_FILE}) +unset(ENV{GENERATE_PROFILING_CODE}) +unset(ENV{GID}) +unset(ENV{GROUP}) +unset(ENV{HEADERMAP_INCLUDES_FLAT_ENTRIES_FOR_TARGET_BEING_BUILT}) +unset(ENV{HEADERMAP_INCLUDES_FRAMEWORK_ENTRIES_FOR_ALL_PRODUCT_TYPES}) +unset(ENV{HEADERMAP_INCLUDES_NONPUBLIC_NONPRIVATE_HEADERS}) +unset(ENV{HEADERMAP_INCLUDES_PROJECT_HEADERS}) +unset(ENV{HEADER_SEARCH_PATHS}) +unset(ENV{ICONV}) +unset(ENV{INFOPLIST_EXPAND_BUILD_SETTINGS}) +unset(ENV{INFOPLIST_OUTPUT_FORMAT}) +unset(ENV{INFOPLIST_PREPROCESS}) +unset(ENV{INSTALL_DIR}) +unset(ENV{INSTALL_GROUP}) +unset(ENV{INSTALL_MODE_FLAG}) +unset(ENV{INSTALL_OWNER}) +unset(ENV{INSTALL_ROOT}) +unset(ENV{IPHONEOS_DEPLOYMENT_TARGET}) # ! +unset(ENV{JAVAC_DEFAULT_FLAGS}) +unset(ENV{JAVA_APP_STUB}) +unset(ENV{JAVA_ARCHIVE_CLASSES}) +unset(ENV{JAVA_ARCHIVE_TYPE}) +unset(ENV{JAVA_COMPILER}) +unset(ENV{JAVA_FRAMEWORK_RESOURCES_DIRS}) +unset(ENV{JAVA_JAR_FLAGS}) +unset(ENV{JAVA_SOURCE_SUBDIR}) +unset(ENV{JAVA_USE_DEPENDENCIES}) +unset(ENV{JAVA_ZIP_FLAGS}) +unset(ENV{JIKES_DEFAULT_FLAGS}) +unset(ENV{KEEP_PRIVATE_EXTERNS}) +unset(ENV{LD_DEPENDENCY_INFO_FILE}) +unset(ENV{LD_GENERATE_MAP_FILE}) +unset(ENV{LD_MAP_FILE_PATH}) +unset(ENV{LD_NO_PIE}) +unset(ENV{LD_QUOTE_LINKER_ARGUMENTS_FOR_COMPILER_DRIVER}) +unset(ENV{LEGACY_DEVELOPER_DIR}) +unset(ENV{LEX}) +unset(ENV{LIBRARY_FLAG_NOSPACE}) +unset(ENV{LIBRARY_KEXT_INSTALL_PATH}) +unset(ENV{LINKER_DISPLAYS_MANGLED_NAMES}) +unset(ENV{LINK_FILE_LIST_normal_armv7}) +unset(ENV{LINK_WITH_STANDARD_LIBRARIES}) +unset(ENV{LOCAL_ADMIN_APPS_DIR}) +unset(ENV{LOCAL_APPS_DIR}) +unset(ENV{LOCAL_DEVELOPER_DIR}) +unset(ENV{LOCAL_LIBRARY_DIR}) +unset(ENV{MAC_OS_X_PRODUCT_BUILD_VERSION}) +unset(ENV{MAC_OS_X_VERSION_ACTUAL}) +unset(ENV{MAC_OS_X_VERSION_MAJOR}) +unset(ENV{MAC_OS_X_VERSION_MINOR}) +unset(ENV{MAKEFLAGS}) +unset(ENV{MAKELEVEL}) +unset(ENV{MFLAGS}) +unset(ENV{MODULE_CACHE_DIR}) +unset(ENV{NATIVE_ARCH_32_BIT}) +unset(ENV{NATIVE_ARCH_64_BIT}) +unset(ENV{NATIVE_ARCH_ACTUAL}) +unset(ENV{NATIVE_ARCH}) +unset(ENV{NO_COMMON}) +unset(ENV{OBJECT_FILE_DIR_normal}) +unset(ENV{OBJECT_FILE_DIR}) +unset(ENV{OBJROOT}) +unset(ENV{ONLY_ACTIVE_ARCH}) +unset(ENV{OPTIMIZATION_LEVEL}) +unset(ENV{OSAC}) +unset(ENV{OS}) +unset(ENV{OTHER_CFLAGS}) +unset(ENV{OTHER_CPLUSPLUSFLAGS}) +unset(ENV{OTHER_LDFLAGS}) +unset(ENV{PASCAL_STRINGS}) +unset(ENV{PATH_PREFIXES_EXCLUDED_FROM_HEADER_DEPENDENCIES}) +unset(ENV{PKGINFO_FILE_PATH}) +unset(ENV{PLATFORM_DEVELOPER_APPLICATIONS_DIR}) +unset(ENV{PLATFORM_DEVELOPER_BIN_DIR}) +unset(ENV{PLATFORM_DEVELOPER_LIBRARY_DIR}) +unset(ENV{PLATFORM_DEVELOPER_SDK_DIR}) +unset(ENV{PLATFORM_DEVELOPER_TOOLS_DIR}) +unset(ENV{PLATFORM_DEVELOPER_USR_DIR}) +unset(ENV{PLATFORM_DIR}) +unset(ENV{PLATFORM_NAME}) +unset(ENV{PLATFORM_PREFERRED_ARCH}) +unset(ENV{PLATFORM_PRODUCT_BUILD_VERSION}) +unset(ENV{PLIST_FILE_OUTPUT_FORMAT}) +unset(ENV{PRECOMPS_INCLUDE_HEADERS_FROM_BUILT_PRODUCTS_DIR}) +unset(ENV{PRECOMP_DESTINATION_DIR}) +unset(ENV{PRESERVE_DEAD_CODE_INITS_AND_TERMS}) +unset(ENV{PRODUCT_NAME}) +unset(ENV{PRODUCT_SETTINGS_PATH}) +unset(ENV{PROFILING_CODE}) +unset(ENV{PROJECT_DERIVED_FILE_DIR}) +unset(ENV{PROJECT_DIR}) +unset(ENV{PROJECT_FILE_PATH}) +unset(ENV{PROJECT_NAME}) +unset(ENV{PROJECT_TEMP_DIR}) +unset(ENV{PROJECT_TEMP_ROOT}) +unset(ENV{PROJECT}) +unset(ENV{RECURSIVE_SEARCH_PATHS_FOLLOW_SYMLINKS}) +unset(ENV{REMOVE_CVS_FROM_RESOURCES}) +unset(ENV{REMOVE_GIT_FROM_RESOURCES}) +unset(ENV{REMOVE_HG_FROM_RESOURCES}) +unset(ENV{REMOVE_SVN_FROM_RESOURCES}) +unset(ENV{REZ_COLLECTOR_DIR}) +unset(ENV{REZ_OBJECTS_DIR}) +unset(ENV{SCAN_ALL_SOURCE_FILES_FOR_INCLUDES}) +unset(ENV{SCRIPT_INPUT_FILE_COUNT}) +unset(ENV{SCRIPT_OUTPUT_FILE_COUNT}) +unset(ENV{SDKROOT}) # ! +unset(ENV{SDK_DIR}) +unset(ENV{SDK_NAME}) +unset(ENV{SDK_PRODUCT_BUILD_VERSION}) +unset(ENV{SED}) +unset(ENV{SEPARATE_STRIP}) +unset(ENV{SEPARATE_SYMBOL_EDIT}) +unset(ENV{SET_DIR_MODE_OWNER_GROUP}) +unset(ENV{SET_FILE_MODE_OWNER_GROUP}) +unset(ENV{SHARED_DERIVED_FILE_DIR}) +unset(ENV{SHARED_PRECOMPS_DIR}) +unset(ENV{SKIP_INSTALL}) +unset(ENV{SOURCE_ROOT}) +unset(ENV{SRCROOT}) +unset(ENV{STRINGS_FILE_OUTPUT_ENCODING}) +unset(ENV{STRIP_INSTALLED_PRODUCT}) +unset(ENV{STRIP_STYLE}) +unset(ENV{SUPPORTED_DEVICE_FAMILIES}) +unset(ENV{SUPPORTED_PLATFORMS}) +unset(ENV{SYMROOT}) +unset(ENV{SYSTEM_ADMIN_APPS_DIR}) +unset(ENV{SYSTEM_APPS_DIR}) +unset(ENV{SYSTEM_CORE_SERVICES_DIR}) +unset(ENV{SYSTEM_DEMOS_DIR}) +unset(ENV{SYSTEM_DEVELOPER_APPS_DIR}) +unset(ENV{SYSTEM_DEVELOPER_BIN_DIR}) +unset(ENV{SYSTEM_DEVELOPER_DEMOS_DIR}) +unset(ENV{SYSTEM_DEVELOPER_DIR}) +unset(ENV{SYSTEM_DEVELOPER_DOC_DIR}) +unset(ENV{SYSTEM_DEVELOPER_GRAPHICS_TOOLS_DIR}) +unset(ENV{SYSTEM_DEVELOPER_JAVA_TOOLS_DIR}) +unset(ENV{SYSTEM_DEVELOPER_PERFORMANCE_TOOLS_DIR}) +unset(ENV{SYSTEM_DEVELOPER_RELEASENOTES_DIR}) +unset(ENV{SYSTEM_DEVELOPER_TOOLS_DOC_DIR}) +unset(ENV{SYSTEM_DEVELOPER_TOOLS_RELEASENOTES_DIR}) +unset(ENV{SYSTEM_DEVELOPER_TOOLS}) +unset(ENV{SYSTEM_DEVELOPER_USR_DIR}) +unset(ENV{SYSTEM_DEVELOPER_UTILITIES_DIR}) +unset(ENV{SYSTEM_DOCUMENTATION_DIR}) +unset(ENV{SYSTEM_KEXT_INSTALL_PATH}) +unset(ENV{SYSTEM_LIBRARY_DIR}) +unset(ENV{TARGETED_DEVICE_FAMILY}) +unset(ENV{TARGETNAME}) +unset(ENV{TARGET_BUILD_DIR}) +unset(ENV{TARGET_NAME}) +unset(ENV{TARGET_TEMP_DIR}) +unset(ENV{TEMP_DIR}) +unset(ENV{TEMP_FILES_DIR}) +unset(ENV{TEMP_FILE_DIR}) +unset(ENV{TEMP_ROOT}) +unset(ENV{TOOLCHAINS}) +unset(ENV{UID}) +unset(ENV{UNSTRIPPED_PRODUCT}) +unset(ENV{USER_APPS_DIR}) +unset(ENV{USER_LIBRARY_DIR}) +unset(ENV{USE_DYNAMIC_NO_PIC}) +unset(ENV{USE_HEADERMAP}) +unset(ENV{USE_HEADER_SYMLINKS}) +unset(ENV{VALIDATE_PRODUCT}) +unset(ENV{VALID_ARCHS}) +unset(ENV{VERBOSE_PBXCP}) +unset(ENV{VERSION_INFO_BUILDER}) +unset(ENV{VERSION_INFO_FILE}) +unset(ENV{VERSION_INFO_STRING}) +unset(ENV{WARNING_CFLAGS}) +unset(ENV{XCODE_APP_SUPPORT_DIR}) +unset(ENV{XCODE_PRODUCT_BUILD_VERSION}) +unset(ENV{XCODE_VERSION_ACTUAL}) +unset(ENV{XCODE_VERSION_MAJOR}) +unset(ENV{XCODE_VERSION_MINOR}) +unset(ENV{XPCSERVICES_FOLDER_PATH}) +unset(ENV{YACC}) +unset(ENV{arch}) +unset(ENV{variant}) diff --git a/tools/polly/utilities/polly_common.cmake b/tools/polly/utilities/polly_common.cmake new file mode 100644 index 0000000..8173b33 --- /dev/null +++ b/tools/polly/utilities/polly_common.cmake @@ -0,0 +1,49 @@ +# Copyright (c) 2013, Ruslan Baratov +# All rights reserved. + +if(DEFINED POLLY_UTILITIES_COMMON_CMAKE) + return() +else() + set(POLLY_UTILITIES_COMMON_CMAKE 1) +endif() + +option(POLLY_STATUS_PRINT "Print process messages" ON) +option(POLLY_STATUS_DEBUG "Print all process messages" OFF) + +# Add extra cmake modules +include("${CMAKE_CURRENT_LIST_DIR}/polly_module_path.cmake") + +include(polly_fatal_error) +include(polly_status_debug) +include(polly_status_print) + +# All well-known variables must be CACHE type: +# http://www.cmake.org/pipermail/cmake/2012-January/048429.html + +# Check and print customization variables +if(NOT POLLY_TOOLCHAIN_NAME) + polly_fatal_error("POLLY_TOOLCHAIN_NAME is empty") +endif() + +if(NOT POLLY_TOOLCHAIN_TAG) + polly_fatal_error("POLLY_TOOLCHAIN_TAG is empty") +endif() + +polly_status_print("Used toolchain: ${POLLY_TOOLCHAIN_NAME}") +polly_status_debug("Used tag: ${POLLY_TOOLCHAIN_TAG}") + +# support for hunter (github.com/ruslo/hunter) +set(HUNTER_INSTALL_TAG ${POLLY_TOOLCHAIN_TAG}) + +# Other +if(NOT CMAKE_DEBUG_POSTFIX) + polly_status_debug("CMAKE_DEBUG_POSTFIX is empty") + set( + CMAKE_DEBUG_POSTFIX + "d" + CACHE + STRING + "Debug postfix (e.g. libmy.a libmyd.a)" + ) + polly_status_debug("CMAKE_DEBUG_POSTFIX set to '${CMAKE_DEBUG_POSTFIX}'") +endif() diff --git a/tools/polly/utilities/polly_fatal_error.cmake b/tools/polly/utilities/polly_fatal_error.cmake new file mode 100644 index 0000000..7116c8f --- /dev/null +++ b/tools/polly/utilities/polly_fatal_error.cmake @@ -0,0 +1,11 @@ +# Copyright (c) 2013, Ruslan Baratov +# All rights reserved. + +function(polly_fatal_error) + foreach(print_message ${ARGV}) + message("") + message(${print_message}) + message("") + endforeach() + message(FATAL_ERROR "") +endfunction() diff --git a/tools/polly/utilities/polly_init.cmake b/tools/polly/utilities/polly_init.cmake new file mode 100644 index 0000000..99ee401 --- /dev/null +++ b/tools/polly/utilities/polly_init.cmake @@ -0,0 +1,26 @@ +# Copyright (c) 2014, Ruslan Baratov +# All rights reserved. + +if(DEFINED POLLY_UTILITIES_POLLY_INIT_CMAKE_) + return() +else() + set(POLLY_UTILITIES_POLLY_INIT_CMAKE_ 1) +endif() + +include("${CMAKE_CURRENT_LIST_DIR}/polly_fatal_error.cmake") + +macro(polly_init name generator) + set(POLLY_TOOLCHAIN_NAME "${name}") + get_filename_component( + POLLY_TOOLCHAIN_TAG "${CMAKE_CURRENT_LIST_FILE}" NAME_WE + ) + + string(COMPARE EQUAL "${CMAKE_GENERATOR}" "${generator}" _polly_correct) + if(NOT _polly_correct) + polly_fatal_error( + "Please change generator to: ${generator}\n" + "(Current generator: ${CMAKE_GENERATOR})" + ) + endif() + set(HUNTER_CMAKE_GENERATOR "${generator}") +endmacro() diff --git a/tools/polly/utilities/polly_ios_bundle_identifier.cmake b/tools/polly/utilities/polly_ios_bundle_identifier.cmake new file mode 100644 index 0000000..1189996 --- /dev/null +++ b/tools/polly/utilities/polly_ios_bundle_identifier.cmake @@ -0,0 +1,21 @@ +# Copyright (c) 2016, Ruslan Baratov +# All rights reserved. + +if(DEFINED POLLY_UTILITIES_POLLY_IOS_BUNDLE_IDENTIFIER_CMAKE_) + return() +else() + set(POLLY_UTILITIES_POLLY_IOS_BUNDLE_IDENTIFIER_CMAKE_ 1) +endif() + +include(polly_status_debug) + +string(COMPARE EQUAL "$ENV{POLLY_IOS_BUNDLE_IDENTIFIER}" "" _is_empty) +if(_is_empty) + set(MACOSX_BUNDLE_GUI_IDENTIFIER "com.example") +else() + set(MACOSX_BUNDLE_GUI_IDENTIFIER $ENV{POLLY_IOS_BUNDLE_IDENTIFIER}) +endif() + +polly_status_debug( + "Using Xcode bundle identifier: ${MACOSX_BUNDLE_GUI_IDENTIFIER}" +) diff --git a/tools/polly/utilities/polly_ios_development_team.cmake b/tools/polly/utilities/polly_ios_development_team.cmake new file mode 100644 index 0000000..506f363 --- /dev/null +++ b/tools/polly/utilities/polly_ios_development_team.cmake @@ -0,0 +1,28 @@ +# Copyright (c) 2016, Ruslan Baratov +# All rights reserved. + +if(DEFINED POLLY_UTILITIES_POLLY_IOS_DEVELOPMENT_TEAM_CMAKE_) + return() +else() + set(POLLY_UTILITIES_POLLY_IOS_DEVELOPMENT_TEAM_CMAKE_ 1) +endif() + +include("${CMAKE_CURRENT_LIST_DIR}/polly_fatal_error.cmake") +include("${CMAKE_CURRENT_LIST_DIR}/polly_status_debug.cmake") + +string(COMPARE EQUAL "$ENV{POLLY_IOS_DEVELOPMENT_TEAM}" "" _is_empty) +if(_is_empty) + polly_fatal_error( + "Environment variable POLLY_IOS_DEVELOPMENT_TEAM is empty" + " (see details: http://polly.readthedocs.io/en/latest/toolchains/ios/errors/polly_ios_development_team.html)" + ) +endif() + +set( + CMAKE_XCODE_ATTRIBUTE_DEVELOPMENT_TEAM + "$ENV{POLLY_IOS_DEVELOPMENT_TEAM}" +) + +polly_status_debug( + "Using iOS development team id: ${CMAKE_XCODE_ATTRIBUTE_DEVELOPMENT_TEAM}" +) diff --git a/tools/polly/utilities/polly_module_path.cmake b/tools/polly/utilities/polly_module_path.cmake new file mode 100644 index 0000000..683c257 --- /dev/null +++ b/tools/polly/utilities/polly_module_path.cmake @@ -0,0 +1,3 @@ +# Add extra cmake modules +list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_LIST_DIR}/../find") +list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_LIST_DIR}") diff --git a/tools/polly/utilities/polly_status_debug.cmake b/tools/polly/utilities/polly_status_debug.cmake new file mode 100644 index 0000000..bfa9e8d --- /dev/null +++ b/tools/polly/utilities/polly_status_debug.cmake @@ -0,0 +1,10 @@ +# Copyright (c) 2013, Ruslan Baratov +# All rights reserved. + +function(polly_status_debug) + foreach(print_message ${ARGV}) + if(POLLY_STATUS_DEBUG) + message(STATUS "[polly *** DEBUG ***] ${print_message}") + endif() + endforeach() +endfunction() diff --git a/tools/polly/utilities/polly_status_print.cmake b/tools/polly/utilities/polly_status_print.cmake new file mode 100644 index 0000000..04e65fc --- /dev/null +++ b/tools/polly/utilities/polly_status_print.cmake @@ -0,0 +1,10 @@ +# Copyright (c) 2013, Ruslan Baratov +# All rights reserved. + +function(polly_status_print) + foreach(print_message ${ARGV}) + if(POLLY_STATUS_PRINT OR POLLY_STATUS_DEBUG) + message(STATUS "[polly] ${print_message}") + endif() + endforeach() +endfunction() diff --git a/tools/polly/vs-10-2010.cmake b/tools/polly/vs-10-2010.cmake new file mode 100644 index 0000000..804615d --- /dev/null +++ b/tools/polly/vs-10-2010.cmake @@ -0,0 +1,17 @@ +# Copyright (c) 2015, Ruslan Baratov +# All rights reserved. + +if(DEFINED POLLY_VS_10_2010_CMAKE_) + return() +else() + set(POLLY_VS_10_2010_CMAKE_ 1) +endif() + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_init.cmake") + +polly_init( + "Visual Studio 10 2010" + "Visual Studio 10 2010" +) + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_common.cmake") diff --git a/tools/polly/vs-11-2012-arm.cmake b/tools/polly/vs-11-2012-arm.cmake new file mode 100644 index 0000000..96a419f --- /dev/null +++ b/tools/polly/vs-11-2012-arm.cmake @@ -0,0 +1,17 @@ +# Copyright (c) 2015, Ruslan Baratov +# All rights reserved. + +if(DEFINED POLLY_VS_11_2012_ARM_CMAKE_) + return() +else() + set(POLLY_VS_11_2012_ARM_CMAKE_ 1) +endif() + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_init.cmake") + +polly_init( + "Visual Studio 11 2012 ARM" + "Visual Studio 11 2012 ARM" +) + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_common.cmake") diff --git a/tools/polly/vs-11-2012-win64.cmake b/tools/polly/vs-11-2012-win64.cmake new file mode 100644 index 0000000..ec11791 --- /dev/null +++ b/tools/polly/vs-11-2012-win64.cmake @@ -0,0 +1,17 @@ +# Copyright (c) 2015, Ruslan Baratov +# All rights reserved. + +if(DEFINED POLLY_VS_11_2012_WIN64_CMAKE_) + return() +else() + set(POLLY_VS_11_2012_WIN64_CMAKE_ 1) +endif() + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_init.cmake") + +polly_init( + "Visual Studio 11 2012 Win64" + "Visual Studio 11 2012 Win64" +) + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_common.cmake") diff --git a/tools/polly/vs-11-2012.cmake b/tools/polly/vs-11-2012.cmake new file mode 100644 index 0000000..6e1e623 --- /dev/null +++ b/tools/polly/vs-11-2012.cmake @@ -0,0 +1,17 @@ +# Copyright (c) 2015, Ruslan Baratov +# All rights reserved. + +if(DEFINED POLLY_VS_11_2012_CMAKE_) + return() +else() + set(POLLY_VS_11_2012_CMAKE_ 1) +endif() + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_init.cmake") + +polly_init( + "Visual Studio 11 2012" + "Visual Studio 11 2012" +) + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_common.cmake") diff --git a/tools/polly/vs-12-2013-arm.cmake b/tools/polly/vs-12-2013-arm.cmake new file mode 100644 index 0000000..d55ff1d --- /dev/null +++ b/tools/polly/vs-12-2013-arm.cmake @@ -0,0 +1,17 @@ +# Copyright (c) 2014, Ruslan Baratov +# All rights reserved. + +if(DEFINED POLLY_VS_12_2013_ARM_CMAKE_) + return() +else() + set(POLLY_VS_12_2013_ARM_CMAKE_ 1) +endif() + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_init.cmake") + +polly_init( + "Visual Studio 12 2013 ARM" + "Visual Studio 12 2013 ARM" +) + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_common.cmake") diff --git a/tools/polly/vs-12-2013-mt.cmake b/tools/polly/vs-12-2013-mt.cmake new file mode 100644 index 0000000..abccfcf --- /dev/null +++ b/tools/polly/vs-12-2013-mt.cmake @@ -0,0 +1,19 @@ +# Copyright (c) 2014, Ruslan Baratov +# All rights reserved. + +if(DEFINED POLLY_VS_12_2013_CMAKE_) + return() +else() + set(POLLY_VS_12_2013_CMAKE_ 1) +endif() + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_init.cmake") + +polly_init( + "Visual Studio 12 2013 / MT (static)" + "Visual Studio 12 2013" +) + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_common.cmake") + +include("${CMAKE_CURRENT_LIST_DIR}/flags/vs-mt.cmake") diff --git a/tools/polly/vs-12-2013-win64.cmake b/tools/polly/vs-12-2013-win64.cmake new file mode 100644 index 0000000..4910289 --- /dev/null +++ b/tools/polly/vs-12-2013-win64.cmake @@ -0,0 +1,17 @@ +# Copyright (c) 2014, Ruslan Baratov +# All rights reserved. + +if(DEFINED POLLY_VS_12_2013_WIN64_CMAKE_) + return() +else() + set(POLLY_VS_12_2013_WIN64_CMAKE_ 1) +endif() + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_init.cmake") + +polly_init( + "Visual Studio 12 2013 Win64" + "Visual Studio 12 2013 Win64" +) + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_common.cmake") diff --git a/tools/polly/vs-12-2013-xp.cmake b/tools/polly/vs-12-2013-xp.cmake new file mode 100644 index 0000000..1d648f4 --- /dev/null +++ b/tools/polly/vs-12-2013-xp.cmake @@ -0,0 +1,17 @@ +# Copyright (c) 2014, Ruslan Baratov +# All rights reserved. + +if(DEFINED POLLY_VS_12_2013_XP_CMAKE_) + return() +else() + set(POLLY_VS_12_2013_XP_CMAKE_ 1) +endif() + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_init.cmake") + +polly_init( + "Visual Studio 12 2013" + "Visual Studio 12 2013" +) + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_common.cmake") diff --git a/tools/polly/vs-12-2013.cmake b/tools/polly/vs-12-2013.cmake new file mode 100644 index 0000000..b69e717 --- /dev/null +++ b/tools/polly/vs-12-2013.cmake @@ -0,0 +1,17 @@ +# Copyright (c) 2014, Ruslan Baratov +# All rights reserved. + +if(DEFINED POLLY_VS_12_2013_CMAKE_) + return() +else() + set(POLLY_VS_12_2013_CMAKE_ 1) +endif() + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_init.cmake") + +polly_init( + "Visual Studio 12 2013" + "Visual Studio 12 2013" +) + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_common.cmake") diff --git a/tools/polly/vs-14-2015-arm.cmake b/tools/polly/vs-14-2015-arm.cmake new file mode 100644 index 0000000..81c0022 --- /dev/null +++ b/tools/polly/vs-14-2015-arm.cmake @@ -0,0 +1,17 @@ +# Copyright (c) 2016 +# All rights reserved. + +if(DEFINED POLLY_VS_14_2015_ARM_CMAKE_) + return() +else() + set(POLLY_VS_14_2015_ARM_CMAKE_ 1) +endif() + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_init.cmake") + +polly_init( + "Visual Studio 14 2015 ARM" + "Visual Studio 14 2015 ARM" +) + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_common.cmake") diff --git a/tools/polly/vs-14-2015-sdk-8-1.cmake b/tools/polly/vs-14-2015-sdk-8-1.cmake new file mode 100644 index 0000000..09655a7 --- /dev/null +++ b/tools/polly/vs-14-2015-sdk-8-1.cmake @@ -0,0 +1,19 @@ +# Copyright (c) 2016, Ruslan Baratov +# All rights reserved. + +if(DEFINED POLLY_VS_14_2015_SDK_8_1_CMAKE_) + return() +else() + set(POLLY_VS_14_2015_SDK_8_1_CMAKE_ 1) +endif() + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_init.cmake") + +polly_init( + "Visual Studio 14 2015 | SDK 8.1" + "Visual Studio 14 2015" +) + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_common.cmake") + +set(CMAKE_SYSTEM_VERSION 8.1) diff --git a/tools/polly/vs-14-2015-win64-sdk-8-1.cmake b/tools/polly/vs-14-2015-win64-sdk-8-1.cmake new file mode 100644 index 0000000..5ee7d5e --- /dev/null +++ b/tools/polly/vs-14-2015-win64-sdk-8-1.cmake @@ -0,0 +1,19 @@ +# Copyright (c) 2016, Ruslan Baratov +# All rights reserved. + +if(DEFINED POLLY_VS_14_2015_WIN64_SDK_8_1_CMAKE_) + return() +else() + set(POLLY_VS_14_2015_WIN64_SDK_8_1_CMAKE_ 1) +endif() + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_init.cmake") + +polly_init( + "Visual Studio 14 2015 Win64 | SDK 8.1" + "Visual Studio 14 2015 Win64" +) + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_common.cmake") + +set(CMAKE_SYSTEM_VERSION 8.1) diff --git a/tools/polly/vs-14-2015-win64.cmake b/tools/polly/vs-14-2015-win64.cmake new file mode 100644 index 0000000..8282f51 --- /dev/null +++ b/tools/polly/vs-14-2015-win64.cmake @@ -0,0 +1,17 @@ +# Copyright (c) 2016 +# All rights reserved. + +if(DEFINED POLLY_VS_14_2015_WIN64_CMAKE_) + return() +else() + set(POLLY_VS_14_2015_WIN64_CMAKE_ 1) +endif() + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_init.cmake") + +polly_init( + "Visual Studio 14 2015 Win64" + "Visual Studio 14 2015 Win64" +) + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_common.cmake") diff --git a/tools/polly/vs-14-2015.cmake b/tools/polly/vs-14-2015.cmake new file mode 100644 index 0000000..3120676 --- /dev/null +++ b/tools/polly/vs-14-2015.cmake @@ -0,0 +1,17 @@ +# Copyright (c) 2015, Ruslan Baratov +# All rights reserved. + +if(DEFINED POLLY_VS_14_2015_CMAKE_) + return() +else() + set(POLLY_VS_14_2015_CMAKE_ 1) +endif() + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_init.cmake") + +polly_init( + "Visual Studio 14 2015" + "Visual Studio 14 2015" +) + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_common.cmake") diff --git a/tools/polly/vs-15-2017-cxx17.cmake b/tools/polly/vs-15-2017-cxx17.cmake new file mode 100644 index 0000000..937ed84 --- /dev/null +++ b/tools/polly/vs-15-2017-cxx17.cmake @@ -0,0 +1,18 @@ +# Copyright (c) 2015-2017, Ruslan Baratov +# All rights reserved. + +if(DEFINED POLLY_VS_15_2017_CXX17_CMAKE_) + return() +else() + set(POLLY_VS_15_2017_CXX17_CMAKE_ 1) +endif() + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_init.cmake") + +polly_init( + "Visual Studio 15 2017 / C++17" + "Visual Studio 15 2017" +) + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_common.cmake") +include("${CMAKE_CURRENT_LIST_DIR}/flags/vs-cxx17.cmake") diff --git a/tools/polly/vs-15-2017-store-10-zw.cmake b/tools/polly/vs-15-2017-store-10-zw.cmake new file mode 100644 index 0000000..2c92f49 --- /dev/null +++ b/tools/polly/vs-15-2017-store-10-zw.cmake @@ -0,0 +1,21 @@ +# Copyright (c) 2015-2018, Ruslan Baratov +# All rights reserved. + +if(DEFINED POLLY_VS_15_2017_STORE_10_ZW_CMAKE_) + return() +else() + set(POLLY_VS_15_2017_STORE_10_ZW_CMAKE_ 1) +endif() + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_init.cmake") + +set(CMAKE_SYSTEM_NAME WindowsStore) +set(CMAKE_SYSTEM_VERSION 10.0) + +polly_init( + "Visual Studio 15 2017 / ${CMAKE_SYSTEM_NAME} ${CMAKE_SYSTEM_VERSION} / ZW" + "Visual Studio 15 2017" +) + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_common.cmake") +include("${CMAKE_CURRENT_LIST_DIR}/flags/vs-zw.cmake") diff --git a/tools/polly/vs-15-2017-win64-cxx14.cmake b/tools/polly/vs-15-2017-win64-cxx14.cmake new file mode 100644 index 0000000..48f92fa --- /dev/null +++ b/tools/polly/vs-15-2017-win64-cxx14.cmake @@ -0,0 +1,18 @@ +# Copyright (c) 2015-2017, Ruslan Baratov +# All rights reserved. + +if(DEFINED POLLY_VS_15_2017_WIN64_CXX14_CMAKE_) + return() +else() + set(POLLY_VS_15_2017_WIN64_CXX14_CMAKE_ 1) +endif() + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_init.cmake") + +polly_init( + "Visual Studio 15 2017 Win64 / C++14" + "Visual Studio 15 2017 Win64" +) + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_common.cmake") +include("${CMAKE_CURRENT_LIST_DIR}/flags/vs-cxx14.cmake") diff --git a/tools/polly/vs-15-2017-win64-cxx17.cmake b/tools/polly/vs-15-2017-win64-cxx17.cmake new file mode 100644 index 0000000..e3c320a --- /dev/null +++ b/tools/polly/vs-15-2017-win64-cxx17.cmake @@ -0,0 +1,18 @@ +# Copyright (c) 2015-2017, Ruslan Baratov +# All rights reserved. + +if(DEFINED POLLY_VS_15_2017_WIN64_CXX17_CMAKE_) + return() +else() + set(POLLY_VS_15_2017_WIN64_CXX17_CMAKE_ 1) +endif() + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_init.cmake") + +polly_init( + "Visual Studio 15 2017 Win64 / C++17" + "Visual Studio 15 2017 Win64" +) + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_common.cmake") +include("${CMAKE_CURRENT_LIST_DIR}/flags/vs-cxx17.cmake") diff --git a/tools/polly/vs-15-2017-win64-llvm-vs2014.cmake b/tools/polly/vs-15-2017-win64-llvm-vs2014.cmake new file mode 100644 index 0000000..0c3430a --- /dev/null +++ b/tools/polly/vs-15-2017-win64-llvm-vs2014.cmake @@ -0,0 +1,17 @@ +# Copyright (c) 2015-2017, Ruslan Baratov +# All rights reserved. + +if(DEFINED POLLY_VS_15_2017_WIN64_CMAKE_) + return() +else() + set(POLLY_VS_15_2017_WIN64_CMAKE_ 1) +endif() + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_init.cmake") + +polly_init( + "Visual Studio 15 2017 Win64 LLVM vs2014" + "Visual Studio 15 2017 Win64" +) + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_common.cmake") diff --git a/tools/polly/vs-15-2017-win64-llvm.cmake b/tools/polly/vs-15-2017-win64-llvm.cmake new file mode 100644 index 0000000..7c8ca6d --- /dev/null +++ b/tools/polly/vs-15-2017-win64-llvm.cmake @@ -0,0 +1,17 @@ +# Copyright (c) 2015-2017, Ruslan Baratov +# All rights reserved. + +if(DEFINED POLLY_VS_15_2017_WIN64_CMAKE_) + return() +else() + set(POLLY_VS_15_2017_WIN64_CMAKE_ 1) +endif() + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_init.cmake") + +polly_init( + "Visual Studio 15 2017 Win64 LLVM" + "Visual Studio 15 2017 Win64" +) + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_common.cmake") diff --git a/tools/polly/vs-15-2017-win64-store-10-cxx17.cmake b/tools/polly/vs-15-2017-win64-store-10-cxx17.cmake new file mode 100644 index 0000000..384b174 --- /dev/null +++ b/tools/polly/vs-15-2017-win64-store-10-cxx17.cmake @@ -0,0 +1,21 @@ +# Copyright (c) 2015-2018, Ruslan Baratov +# All rights reserved. + +if(DEFINED POLLY_VS_15_2017_WIN64_STORE_10_CXX17_CMAKE_) + return() +else() + set(POLLY_VS_15_2017_WIN64_STORE_10_CXX17_CMAKE_ 1) +endif() + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_init.cmake") + +set(CMAKE_SYSTEM_NAME WindowsStore) +set(CMAKE_SYSTEM_VERSION 10.0) + +polly_init( + "Visual Studio 15 2017 Win64 / ${CMAKE_SYSTEM_NAME} ${CMAKE_SYSTEM_VERSION} / C++17" + "Visual Studio 15 2017 Win64" +) + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_common.cmake") +include("${CMAKE_CURRENT_LIST_DIR}/flags/vs-cxx17.cmake") diff --git a/tools/polly/vs-15-2017-win64-store-10-zw.cmake b/tools/polly/vs-15-2017-win64-store-10-zw.cmake new file mode 100644 index 0000000..79c587b --- /dev/null +++ b/tools/polly/vs-15-2017-win64-store-10-zw.cmake @@ -0,0 +1,21 @@ +# Copyright (c) 2015-2018, Ruslan Baratov +# All rights reserved. + +if(DEFINED POLLY_VS_15_2017_WIN64_STORE_10_ZW_CMAKE_) + return() +else() + set(POLLY_VS_15_2017_WIN64_STORE_10_ZW_CMAKE_ 1) +endif() + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_init.cmake") + +set(CMAKE_SYSTEM_NAME WindowsStore) +set(CMAKE_SYSTEM_VERSION 10.0) + +polly_init( + "Visual Studio 15 2017 Win64 / ${CMAKE_SYSTEM_NAME} ${CMAKE_SYSTEM_VERSION} / ZW" + "Visual Studio 15 2017 Win64" +) + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_common.cmake") +include("${CMAKE_CURRENT_LIST_DIR}/flags/vs-zw.cmake") diff --git a/tools/polly/vs-15-2017-win64-z7.cmake b/tools/polly/vs-15-2017-win64-z7.cmake new file mode 100644 index 0000000..26772c8 --- /dev/null +++ b/tools/polly/vs-15-2017-win64-z7.cmake @@ -0,0 +1,18 @@ +# Copyright (c) 2015-2018, Ruslan Baratov +# All rights reserved. + +if(DEFINED POLLY_VS_15_2017_WIN64_Z7_CMAKE_) + return() +else() + set(POLLY_VS_15_2017_WIN64_Z7_CMAKE_ 1) +endif() + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_init.cmake") + +polly_init( + "Visual Studio 15 2017 Win64" + "Visual Studio 15 2017 Win64" +) + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_common.cmake") +include("${CMAKE_CURRENT_LIST_DIR}/flags/vs-z7.cmake") diff --git a/tools/polly/vs-15-2017-win64.cmake b/tools/polly/vs-15-2017-win64.cmake new file mode 100644 index 0000000..d6db379 --- /dev/null +++ b/tools/polly/vs-15-2017-win64.cmake @@ -0,0 +1,17 @@ +# Copyright (c) 2015-2017, Ruslan Baratov +# All rights reserved. + +if(DEFINED POLLY_VS_15_2017_WIN64_CMAKE_) + return() +else() + set(POLLY_VS_15_2017_WIN64_CMAKE_ 1) +endif() + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_init.cmake") + +polly_init( + "Visual Studio 15 2017 Win64" + "Visual Studio 15 2017 Win64" +) + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_common.cmake") diff --git a/tools/polly/vs-15-2017.cmake b/tools/polly/vs-15-2017.cmake new file mode 100644 index 0000000..30638d4 --- /dev/null +++ b/tools/polly/vs-15-2017.cmake @@ -0,0 +1,17 @@ +# Copyright (c) 2015-2017, Ruslan Baratov +# All rights reserved. + +if(DEFINED POLLY_VS_15_2017_CMAKE_) + return() +else() + set(POLLY_VS_15_2017_CMAKE_ 1) +endif() + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_init.cmake") + +polly_init( + "Visual Studio 15 2017" + "Visual Studio 15 2017" +) + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_common.cmake") diff --git a/tools/polly/vs-8-2005.cmake b/tools/polly/vs-8-2005.cmake new file mode 100644 index 0000000..d5c26f3 --- /dev/null +++ b/tools/polly/vs-8-2005.cmake @@ -0,0 +1,17 @@ +# Copyright (c) 2014, Ruslan Baratov +# All rights reserved. + +if(DEFINED POLLY_VS_8_2005_CMAKE_) + return() +else() + set(POLLY_VS_8_2005_CMAKE_ 1) +endif() + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_init.cmake") + +polly_init( + "Visual Studio 8 2005" + "Visual Studio 8 2005" +) + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_common.cmake") diff --git a/tools/polly/vs-9-2008.cmake b/tools/polly/vs-9-2008.cmake new file mode 100644 index 0000000..e547310 --- /dev/null +++ b/tools/polly/vs-9-2008.cmake @@ -0,0 +1,17 @@ +# Copyright (c) 2015, Ruslan Baratov +# All rights reserved. + +if(DEFINED POLLY_VS_9_2008_CMAKE_) + return() +else() + set(POLLY_VS_9_2008_CMAKE_ 1) +endif() + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_init.cmake") + +polly_init( + "Visual Studio 9 2008" + "Visual Studio 9 2008" +) + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_common.cmake") diff --git a/tools/polly/xcode-cxx98.cmake b/tools/polly/xcode-cxx98.cmake new file mode 100644 index 0000000..799732c --- /dev/null +++ b/tools/polly/xcode-cxx98.cmake @@ -0,0 +1,23 @@ +# Copyright (c) 2014-2016, Ruslan Baratov +# All rights reserved. + +if(DEFINED POLLY_XCODE_CXX98_CMAKE_) + return() +else() + set(POLLY_XCODE_CXX98_CMAKE_ 1) +endif() + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_init.cmake") + +set(POLLY_XCODE_COMPILER "clang") +polly_init( + "Xcode / ${POLLY_XCODE_COMPILER} / \ +LLVM Standard C++ Library (libc++) / c++98 support" + "Xcode" +) + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_common.cmake") + +include("${CMAKE_CURRENT_LIST_DIR}/compiler/xcode.cmake") +include("${CMAKE_CURRENT_LIST_DIR}/library/std/libcxx.cmake") +include("${CMAKE_CURRENT_LIST_DIR}/flags/cxx98.cmake") diff --git a/tools/polly/xcode-gcc.cmake b/tools/polly/xcode-gcc.cmake new file mode 100644 index 0000000..b03ae2a --- /dev/null +++ b/tools/polly/xcode-gcc.cmake @@ -0,0 +1,23 @@ +# Copyright (c) 2015, Ruslan Baratov +# All rights reserved. + +if(DEFINED POLLY_XCODE_GCC_CMAKE_) + return() +else() + set(POLLY_XCODE_GCC_CMAKE_ 1) +endif() + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_init.cmake") + +set(POLLY_XCODE_COMPILER "gcc") +polly_init( + "Xcode / ${POLLY_XCODE_COMPILER} / \ +LLVM Standard C++ Library (libc++) / c++11 support" + "Xcode" +) + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_common.cmake") + +include("${CMAKE_CURRENT_LIST_DIR}/compiler/xcode.cmake") +include("${CMAKE_CURRENT_LIST_DIR}/library/std/libcxx.cmake") +include("${CMAKE_CURRENT_LIST_DIR}/flags/cxx11.cmake") diff --git a/tools/polly/xcode-hid-sections.cmake b/tools/polly/xcode-hid-sections.cmake new file mode 100644 index 0000000..be9077c --- /dev/null +++ b/tools/polly/xcode-hid-sections.cmake @@ -0,0 +1,27 @@ +# Copyright (c) 2014-2016, Ruslan Baratov +# Copyright (c) 2016, David Hirvonen +# All rights reserved. + +if(DEFINED POLLY_XCODE_HID_SECTIONS_CMAKE_) + return() +else() + set(POLLY_XCODE_HID_SECTIONS_CMAKE_ 1) +endif() + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_init.cmake") + +set(POLLY_XCODE_COMPILER "clang") +polly_init( + "Xcode / ${POLLY_XCODE_COMPILER} / \ +LLVM Standard C++ Library (libc++) / c++11 support / hidden / data-sections / function-sections" + "Xcode" +) + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_common.cmake") + +include("${CMAKE_CURRENT_LIST_DIR}/compiler/xcode.cmake") +include("${CMAKE_CURRENT_LIST_DIR}/library/std/libcxx.cmake") +include("${CMAKE_CURRENT_LIST_DIR}/flags/cxx11.cmake") +include("${CMAKE_CURRENT_LIST_DIR}/flags/function-sections.cmake") +include("${CMAKE_CURRENT_LIST_DIR}/flags/data-sections.cmake") +include("${CMAKE_CURRENT_LIST_DIR}/flags/hidden.cmake") diff --git a/tools/polly/xcode-nocxx.cmake b/tools/polly/xcode-nocxx.cmake new file mode 100644 index 0000000..902411f --- /dev/null +++ b/tools/polly/xcode-nocxx.cmake @@ -0,0 +1,22 @@ +# Copyright (c) 2014-2016, Ruslan Baratov +# All rights reserved. + +if(DEFINED POLLY_XCODE_NOCXX_CMAKE_) + return() +else() + set(POLLY_XCODE_NOCXX_CMAKE_ 1) +endif() + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_init.cmake") + +set(POLLY_XCODE_COMPILER "clang") +polly_init( + "Xcode / ${POLLY_XCODE_COMPILER} / \ +LLVM Standard C++ Library (libc++)" + "Xcode" +) + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_common.cmake") + +include("${CMAKE_CURRENT_LIST_DIR}/compiler/xcode.cmake") +include("${CMAKE_CURRENT_LIST_DIR}/library/std/libcxx.cmake") diff --git a/tools/polly/xcode-sections.cmake b/tools/polly/xcode-sections.cmake new file mode 100644 index 0000000..c109f00 --- /dev/null +++ b/tools/polly/xcode-sections.cmake @@ -0,0 +1,26 @@ +# Copyright (c) 2014-2016, Ruslan Baratov +# Copyright (c) 2016, David Hirvonen +# All rights reserved. + +if(DEFINED POLLY_XCODE_SECTIONS_CMAKE_) + return() +else() + set(POLLY_XCODE_SECTIONS_CMAKE_ 1) +endif() + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_init.cmake") + +set(POLLY_XCODE_COMPILER "clang") +polly_init( + "Xcode / ${POLLY_XCODE_COMPILER} / \ +LLVM Standard C++ Library (libc++) / c++11 support / data-sections / function-sections" + "Xcode" +) + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_common.cmake") + +include("${CMAKE_CURRENT_LIST_DIR}/compiler/xcode.cmake") +include("${CMAKE_CURRENT_LIST_DIR}/library/std/libcxx.cmake") +include("${CMAKE_CURRENT_LIST_DIR}/flags/cxx11.cmake") +include("${CMAKE_CURRENT_LIST_DIR}/flags/function-sections.cmake") +include("${CMAKE_CURRENT_LIST_DIR}/flags/data-sections.cmake") diff --git a/tools/polly/xcode.cmake b/tools/polly/xcode.cmake new file mode 100644 index 0000000..7def9e2 --- /dev/null +++ b/tools/polly/xcode.cmake @@ -0,0 +1,23 @@ +# Copyright (c) 2014-2015, Ruslan Baratov +# All rights reserved. + +if(DEFINED POLLY_XCODE_CMAKE_) + return() +else() + set(POLLY_XCODE_CMAKE_ 1) +endif() + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_init.cmake") + +set(POLLY_XCODE_COMPILER "clang") +polly_init( + "Xcode / ${POLLY_XCODE_COMPILER} / \ +LLVM Standard C++ Library (libc++) / c++11 support" + "Xcode" +) + +include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_common.cmake") + +include("${CMAKE_CURRENT_LIST_DIR}/compiler/xcode.cmake") +include("${CMAKE_CURRENT_LIST_DIR}/library/std/libcxx.cmake") +include("${CMAKE_CURRENT_LIST_DIR}/flags/cxx11.cmake") diff --git a/vendor/curl b/vendor/curl deleted file mode 160000 index eb51993..0000000 --- a/vendor/curl +++ /dev/null @@ -1 +0,0 @@ -Subproject commit eb5199317ee729ab1893fc629a8f4f0ca7f7aa1e diff --git a/vendor/openssl b/vendor/openssl deleted file mode 160000 index 2b68739..0000000 --- a/vendor/openssl +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 2b687397fda5ebaa413a3f35b1c989c84114cefe diff --git a/vendor/pugixml b/vendor/pugixml deleted file mode 160000 index f53bddd..0000000 --- a/vendor/pugixml +++ /dev/null @@ -1 +0,0 @@ -Subproject commit f53bddd7d5c79c35145ab506e48b18c457026543