Need help with polly?
Click the “chat” button below for chat support from the developer who created it, or find similar developers for support.

About the developer

ruslo
785 Stars 196 Forks BSD 2-Clause "Simplified" License 1.4K Commits 21 Opened issues

Description

:wrench: Collection of CMake toolchain files and scripts for cross-platform build and CI testing (GCC, Visual Studio, iOS, Android, Clang analyzer, sanitizers etc.)

Services available

!
?

Need anything else?

Contributors list

Polly

Join the chat at https://gitter.im/polly-cmake/Lobby

Collection of CMake toolchain files and scripts.

| Linux/OSX | Windows | |-------------------------------------------------|-----------------------------------------------------| | Build Status | Build Status |

Every toolchain defines compiler/flags and two variables: *

POLLY_TOOLCHAIN_NAME
*
POLLY_TOOLCHAIN_TAG

First 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 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 package manager.

New documentation

  • https://polly.readthedocs.io

Toolchains

Usage

Just define CMAKETOOLCHAINFILE variable: ```bash

cmake -H. -Bbuilds/clang-libstdcxx -DCMAKETOOLCHAINFILE=${POLLYROOT}/clang-libstdcxx.cmake -DCMAKEVERBOSEMAKEFILE=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/clanglibstdcxx /usr/bin/c++ -std=c++11 -stdlib=libstdc++ -o CMakeFiles/.../main.cpp.o -c /.../main.cpp ```

polly.py

This is a python script 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. Please read coding style and agreements before start looking through examples (may explain a lot). Take a look at the Travis config files: mac and linux, it's quite self-explanatory.

Contributing

See CONTRIBUTING.md.

Links

We use cookies. If you continue to browse the site, you agree to the use of cookies. For more information on our use of cookies please see our Privacy Policy.