A lightweight cross-platform build system for c/c++, written in python
Project description
===============================
pybythec
===============================
.. image:: https://img.shields.io/pypi/v/pybythec.svg
:target: https://pypi.python.org/pypi/pybythec
.. image:: https://img.shields.io/travis/glowtree/pybythec.svg
:target: https://travis-ci.org/glowtree/pybythec
Install
--------
pip install pybythec
Usage
--------
Create a pybythec.json file (or .pybythec.json) in the same directory as your c / c++ files.
'./example/projects/Simple/src/pybythec.json' has the simplest example and to start you might want to try something similar:
{
"target": "Simple",
"binaryType": "exe",
"sources": "main.cpp",
"installPath": "."
}
Then from the command line run:
pybythec
Clean your project with:
pybythec -cl
Clean your project and all it's dependencies with:
pybythec -cla
Look at other exmples in the './example' directory to see how to build a static library, a dynamic library, and also an executable with library dependencies.
pybythec assumes your already have the compiler / linker you want to use installed on your machine, currently gcc, clang and msvc are supported.
When you install pybythec with pip it will add a file called .pybythecGlobals.json to your home directory.
This is a master file that declares all of your compiler and linker configurations.
You can edit this as needed for system-wide configuration.
If you want to move this file just be sure to have an environment variable called PYBYTHEC_GLOBALS point to the new location
for example:
export PYBYTHEC_GLOBALS=/Users/user/dev/.myPybythecGlobals.json
or for windows powershell:
$env:PYBYTHEC_GLOBALS="C:/Users/user/dev/.myPybythecGlobals.json"
There are up to 3 configuration files for any given build: global, project and local, where project overrides global,
and local overrides both global and project.
You can point pybythec to the project configuration file with the environment variable PYBYTHEC_PROJECT.
for example: export PYBYTHEC_PROJECT=/Users/user/dev/myProject/.myProjectConfig.json
pybythec will always look for your local file in your current directoy, and it must be called pybythec.json or .pybythec.json.
You don't need all 3 to build, in fact you could even put everything into one of those 3 files if you really wanted to.
The configuration files allow for nested declarations so that you can get specific for your building needs.
For example if I want a preprocessor declaration that's project wide but only used when building on OS X for gcc, I can add the
following to my project level config file:
"defines":
{
"osx": {
"gcc" : "SOME_DEFINE"
}
}
You can use environmet variables in your configuration files simply by prepending with $, for example
"libPaths": "$SHARED/lib"
Currently pybythec supports gcc/g++, clang/clang++ and msvc
More documentation to come!!!
Credits
---------
Tools used in rendering this package:
* `cookiecutter-pypackage`_
.. _`cookiecutter-pypackage`: https://github.com/audreyr/cookiecutter-pypackage
pybythec
===============================
.. image:: https://img.shields.io/pypi/v/pybythec.svg
:target: https://pypi.python.org/pypi/pybythec
.. image:: https://img.shields.io/travis/glowtree/pybythec.svg
:target: https://travis-ci.org/glowtree/pybythec
Install
--------
pip install pybythec
Usage
--------
Create a pybythec.json file (or .pybythec.json) in the same directory as your c / c++ files.
'./example/projects/Simple/src/pybythec.json' has the simplest example and to start you might want to try something similar:
{
"target": "Simple",
"binaryType": "exe",
"sources": "main.cpp",
"installPath": "."
}
Then from the command line run:
pybythec
Clean your project with:
pybythec -cl
Clean your project and all it's dependencies with:
pybythec -cla
Look at other exmples in the './example' directory to see how to build a static library, a dynamic library, and also an executable with library dependencies.
pybythec assumes your already have the compiler / linker you want to use installed on your machine, currently gcc, clang and msvc are supported.
When you install pybythec with pip it will add a file called .pybythecGlobals.json to your home directory.
This is a master file that declares all of your compiler and linker configurations.
You can edit this as needed for system-wide configuration.
If you want to move this file just be sure to have an environment variable called PYBYTHEC_GLOBALS point to the new location
for example:
export PYBYTHEC_GLOBALS=/Users/user/dev/.myPybythecGlobals.json
or for windows powershell:
$env:PYBYTHEC_GLOBALS="C:/Users/user/dev/.myPybythecGlobals.json"
There are up to 3 configuration files for any given build: global, project and local, where project overrides global,
and local overrides both global and project.
You can point pybythec to the project configuration file with the environment variable PYBYTHEC_PROJECT.
for example: export PYBYTHEC_PROJECT=/Users/user/dev/myProject/.myProjectConfig.json
pybythec will always look for your local file in your current directoy, and it must be called pybythec.json or .pybythec.json.
You don't need all 3 to build, in fact you could even put everything into one of those 3 files if you really wanted to.
The configuration files allow for nested declarations so that you can get specific for your building needs.
For example if I want a preprocessor declaration that's project wide but only used when building on OS X for gcc, I can add the
following to my project level config file:
"defines":
{
"osx": {
"gcc" : "SOME_DEFINE"
}
}
You can use environmet variables in your configuration files simply by prepending with $, for example
"libPaths": "$SHARED/lib"
Currently pybythec supports gcc/g++, clang/clang++ and msvc
More documentation to come!!!
Credits
---------
Tools used in rendering this package:
* `cookiecutter-pypackage`_
.. _`cookiecutter-pypackage`: https://github.com/audreyr/cookiecutter-pypackage
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
pybythec-0.2.7.tar.gz
(15.2 kB
view hashes)