Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

gnucc

Package Overview
Dependencies
Maintainers
1
Versions
7
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

gnucc

Wrapper for GCC and G++

  • 1.1.2
  • npm
  • Socket score

Version published
Weekly downloads
1
Maintainers
1
Weekly downloads
 
Created
Source

gnucc

Node.js library for GCC and G++ compilers

  • Simplified options and usage
  • Types and intellisense support
  • Supports compilation of C and C++ files through gcc and g++

Quick Start

This method passes files directly, it is recommended you pass options as shown below.

import { gnucc, gcc, gpp } from 'gnucc';

gnucc('file.cpp'); // compiles to executable

gnucc(input: string, output?: string, log?: boolean); // uses gcc or g++
gcc(input: string, ...); // uses gcc
gpp(input: string, ...); // uses g++

Advanced Usage

This example shows how to manually set some options.

import { gnucc, OPTIMISATION, WARN } from 'gnucc';

await gnucc({
  input: 'src/head.cpp',
  output: 'out/head',
  includes: [
    'src/headers'
  ],
  optimisation: OPTIMISATION.HIGH,
  warning: [WARN.ALL]
});

Automatic Project Compilation

By enabling project mode gnucc handles a lot of the heavy lifting for you.

  • Compiles to .o to reduce compile times in the future.
  • Keeps track of timestamps to only compile required files.
  • Ensures the correct compilers are used.
import { gnucc } from 'gnucc';

await gnucc({
  project: true,
  input: [
    'src/example.cc',
    'src/tester.cc'
  ],
  objOut: 'out/',
  output: 'out/projecttest',
  includes: [
    'src/headers'
  ]
});

Keywords

FAQs

Package last updated on 20 Jan 2019

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc