GithubHelp home page GithubHelp logo

cksmith / polly Goto Github PK

View Code? Open in Web Editor NEW

This project forked from ruslo/polly

1.0 2.0 0.0 1.21 MB

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

Home Page: http://goo.gl/5JpHX

License: BSD 2-Clause "Simplified" License

CMake 83.30% Python 16.27% Batchfile 0.01% Shell 0.42%

polly's Introduction

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

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

build.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 build.py --help):

  • build Debug Xcode project:
    • build.py --toolchain xcode --config Debug (_builds/xcode)
  • build and test Release Makefile project with libcxx:
    • build.py --toolchain libcxx --config Release --test (_builds/libcxx-Release)
  • install Debug Xcode project:
    • build.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

polly's People

Contributors

ruslo avatar headupinclouds avatar pretyman avatar skypjack avatar riegl-gc avatar cksmith avatar xpol avatar speps avatar arrtchiu avatar ikliashchou avatar oliverdaniell avatar wangyida avatar yowidin avatar lucamartini avatar belveder79 avatar devexter avatar s-brain avatar jcftang avatar esteve avatar c-r-i-s avatar conanm avatar aturkelson avatar craigscott-crascit avatar cyberunner23 avatar jcewidex avatar fire avatar gitter-badger avatar pthom avatar

Stargazers

 avatar

Watchers

James Cloos avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.