Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Sharing build toolchain setup code #12

Closed
springmeyer opened this issue Jul 2, 2017 · 1 comment
Closed

Sharing build toolchain setup code #12

springmeyer opened this issue Jul 2, 2017 · 1 comment

Comments

@springmeyer
Copy link
Contributor

Context

node-cpp-skel now has a single method for setting up mason and the clang++ toolchain. It lives in https://github.com/mapbox/node-cpp-skel/blob/master/scripts/setup.sh and is used like:

./scripts/setup.ch --config local.env
source local.env
# now both `clang++` and `mason` are available and on your PATH

The idea behind this script is to:

  • Make it easy to get clang++ and mason without worrying about the versions (which are controlled in the script)
  • Avoid needing to source a script that might error, which can cause problems on travis: it is best practice for bash scripts need to use set -e to stop on error, but sourcing will accidentally inherit this in the travis shell (and this cane break the travis build oddly). The output of setup.sh (aka local.env) is purely export commands for variables. So this is safe to source without worrying about breaking the travis shell.
  • This script can be a central location for adding further methods/variables needed for building C++ code
  • The script can be used locally as well as on travis ci for installing clang++. For example, a custom clang++ from mason is needed even on OS X for local coverage reporting, as demonstrated at https://github.com/mapbox/node-cpp-skel/blob/master/scripts/coverage.sh

Proposal

This setup.sh script is not specific to node addons, so we could start using and recommending it for all header only C++ libs.

So, @mapsam what do you think about pulling it into hpp-skel and adapting the travis.yml to use it?

springmeyer pushed a commit that referenced this issue Aug 23, 2017
springmeyer pushed a commit that referenced this issue Aug 24, 2017
springmeyer pushed a commit that referenced this issue Aug 24, 2017
address #12 and #13

add back cxxflags
springmeyer pushed a commit that referenced this issue Aug 24, 2017
@springmeyer
Copy link
Contributor Author

Solved by #27

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant