Coder Social home page Coder Social logo

ikorolev93 / ycm-generator Goto Github PK

View Code? Open in Web Editor NEW

This project forked from rdnetto/ycm-generator

0.0 1.0 0.0 356 KB

Generates config files for YouCompleteMe (https://github.com/Valloric/YouCompleteMe)

License: GNU General Public License v3.0

Python 93.39% Shell 4.08% Vim Script 2.53%

ycm-generator's Introduction

YCM-Generator

This is a script which generates a list of compiler flags from a project with an arbitrary build system. It can be used to:

It works by building the project with a fake toolchain, which simply and filters compiler flags to be stored in the resulting file.

It is reasonably fast, taking ~10 seconds to generate a configuration file for the Linux kernel.

Installation

Add NeoBundle 'rdnetto/YCM-Generator' to your vimrc (or the equivalent for your plugin manager).

Alternatively, Arch Linux users can install YCM-Generator using the (unofficial) AUR package.

Usage

Run ./config_gen.py PROJECT_DIRECTORY, where PROJECT_DIRECTORY is the root directory of your project's build system (i.e. the one containing the root Makefile, etc.)

You can also invoke it from within Vim using the :YcmGenerateConfig or :CCGenerateConfig commands to generate a config file for the current directory. These commands accept the same arguments as ./config_gen.py, but do not require the project directory to be specified (it defaults to the current working directory).

Requirements and Limitations

  • Requirements:

    • Python 2
    • Clang
  • Supported build systems:

    • make
    • cmake
    • qmake
    • autotools

Your build system should support specifying the compiler through the CC/CXX environment variables, or not use an absolute path to the compiler.

Some flags present in the resulting configuration file may be mutually exclusive with each other - reading the generated file prior to use is recommended.

Documentation & Support

  • run ./config_gen.py --help to see the complete list of supported options.
  • if you receive the error message ERROR: No commands were logged to the build logs, try using the --verbose flag to see any error messages
    • some build systems require certain environment variables to be set. Note that these will not be used by YCM-Generator by default, unless --preserve-environment is used
    • if you open an issue regarding this error message, please include the output when running with --verbose and a link to the project repo (if possible)

Development

Patches are welcome. Please submit pull requests against the develop branch.

Windows support

The script is currently supported under Unices (Linux, NixOS[1], BSD, OS X) only. Implementing Windows support consists of porting the contents of fake-toolchain/Unix. If you are interested in implementing/testing this, please open a pull request.

[1] May require --preserve-environment - see #19

Test Cases

The following projects are used for testing:

Project Build system Notes
Linux kernel Kbuild (Make)
Vim-qt Autotools
Clementine Cmake
ExtPlane Qmake Should be tested with both versions of Qt.

License

YCM-Generator is published under the GNU GPLv3.

ycm-generator's People

Contributors

rdnetto avatar the-compiler avatar esdrubal avatar aumuell avatar robertaudi avatar iliis avatar proudzhu avatar

Watchers

 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.