Polly

🔧 Collection of CMake toolchain files and scripts for cross-platform build and CI testing (GCC, Visual Studio, iOS, Android, Clang analyzer, sanitizers etc.)
Alternatives To Polly
Project NameStarsDownloadsRepos Using ThisPackages Using ThisMost Recent CommitTotal ReleasesLatest ReleaseOpen IssuesLicenseLanguage
Jsonnet6,266612618 hours ago58December 21, 2021258apache-2.0Jsonnet
Jsonnet - The data templating language
Sol23,394
2 months ago147mitC++
Sol3 (sol2 v3.0) - a C++ <-> Lua API wrapper with advanced features and top notch performance - is here, and it's great! Documentation:
Compile Time Regular Expressions2,765
a month ago85apache-2.0C++
Compile Time Regular Expression in C++
Benchmarks2,568
22 days ago49mitMakefile
Some benchmarks of different languages
Epijudge2,550
6 months ago77otherC++
EPI Judge - Preview Release
Yyjson2,481
12 days ago6mitC
The fastest JSON library in C
Osxcross2,419
11 days ago101gpl-2.0C++
Mac OS X cross toolchain for Linux, FreeBSD, OpenBSD and Android (Termux)
C1,991
8 months ago1September 07, 202214mitShell
Compile and execute C "scripts" in one go!
Ccache1,890
2 days ago12May 16, 202250otherC++
ccache – a fast compiler cache
Judge01,430
5 days ago87gpl-3.0HTML
🔥 The most advanced open-source online code execution system in the world.
Alternatives To Polly
Select To Compare


Alternative Project Comparisons
Readme

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:

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

Toolchains

Android

iOS

Raspberry Pi

Clang tools

Windows

Cross compiling

Usage

Just define CMAKE_TOOLCHAIN_FILE variable:

> 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 -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 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

Popular Clang Projects
Popular Gcc Projects
Popular Compilers Categories
Related Searches

Get A Weekly Email With Trending Projects For These Categories
No Spam. Unsubscribe easily at any time.
Cmake
Xcode
Travis
Gcc
Clang
Travis Ci
Appveyor