Comments (6)
How about passing a second parameter to load_module('compiler', 'c') then
C.executable(...) And C.objects(...)
On Wed, Oct 7, 2015, 5:08 AM Niklas Rosenstein [email protected]
wrote:
The compiler modules should get rule functions that will generate the
correct commands to build object files, libraries and executables.C = load_module('compiler')
build_dir = join(project_dir, 'build')C.cc_objects('Objects',
sources = glob(join(project_dir, 'src/*/.c')),
includes = [join(project_dir, 'include')],
)C.cc_executable('Bin',
program = 'main',
inputs = Objects,
)—
Reply to this email directly or view it on GitHub
https://github.com/craftr-build/craftr/issues/14.
from craftr-build-4.x.
There might be data in the module that you would want to use when declaring a target, eg. let's say to enable all warnings.
C.cc_objects('Objects',
sources = glob(join(project_dir, 'src/*.c')),
additional_flags = [C.wall],
)
But yes, maybe something like this would be possible instead, but all flags would need to be duplicated on the C
and CXX
objects.
C = load_module('compiler').C
C.objects('Objects',
sources = glob(join(project_dir, 'src/*.c')),
additional_flags = [C.wall],
)
I can imagine that it could become a cleaner implementation using classes and inheritance, though, so thanks for the idea.
from craftr-build-4.x.
As long as setting the flags is obvious and easy seems reasonable. I assume
based on what you've written the syntax for other 'compiler's' would be:
Cxx = load_module('compiler').cxx
Asm = load_module('compiler').asm
....
Also, is it going to be "easy" for programmers to create there own
'compiler' modules and 'register" them with Creatr?
On Sun, Oct 11, 2015 at 6:41 AM Niklas Rosenstein [email protected]
wrote:
There might be data in the module that you would want to use when
declaring a target, eg. let's say to enable all warnings.C.cc_objects('Objects',
sources = glob(join(project_dir, 'src/*.c')),
additional_flags = [C.wall],
)But yes, maybe something like this would be possible instead, but all
flags would need to be duplicated on the C and CXX objects.C = load_module('compiler').C
C.objects('Objects',
sources = glob(join(project_dir, 'src/*.c')),
additional_flags = [C.wall],
)—
Reply to this email directly or view it on GitHub
https://github.com/craftr-build/craftr/issues/14#issuecomment-147192931.
from craftr-build-4.x.
Whoops Craftr :)
On Sun, Oct 11, 2015 at 6:49 PM Wink Saville [email protected] wrote:
As long as setting the flags is obvious and easy seems reasonable. I
assume based on what you've written the syntax for other 'compiler's' would
be:Cxx = load_module('compiler').cxx
Asm = load_module('compiler').asm
....Also, is it going to be "easy" for programmers to create there own
'compiler' modules and 'register" them with Creatr?On Sun, Oct 11, 2015 at 6:41 AM Niklas Rosenstein <
[email protected]> wrote:There might be data in the module that you would want to use when
declaring a target, eg. let's say to enable all warnings.C.cc_objects('Objects',
sources = glob(join(project_dir, 'src/*.c')),
additional_flags = [C.wall],
)But yes, maybe something like this would be possible instead, but all
flags would need to be duplicated on the C and CXX objects.C = load_module('compiler').C
C.objects('Objects',
sources = glob(join(project_dir, 'src/*.c')),
additional_flags = [C.wall],
)—
Reply to this email directly or view it on GitHub
https://github.com/craftr-build/craftr/issues/14#issuecomment-147192931
.
from craftr-build-4.x.
Almost, yes. Currently it looks like this:
# craftr_module(hello_world)
P = load_module('platform')
Cxx = load_module('compiler').CxxCompiler()
Cxx.detect()
build_dir = join(project_dir, 'build')
Cxx.objects(
'Objects',
sources = glob(join(project_dir, 'source/**/*.cpp')),
)
Cxx.executable(
'Program',
name = join(build_dir, 'main'),
inputs = [Objects],
)
Implemented in c90c4a7.
from craftr-build-4.x.
The minimum would be: release (-O2), debug (-O0 -g), debugoptimized (-O2
-g) but critically the author needs to be able to remove any predefined
flags and provide exactly what the author requires. In Meson these are
"buildtype's" and one of them is "plain" which sets the "compiler" flags
globally always to empty when creating a compiler. I suggest Craftr should
allow the flags to be defined as each "compiler" is created and the syntax
should allow adding to the defaults or replace the defaults.
My two centavos :)
On Wed, Oct 14, 2015 at 6:33 AM Niklas Rosenstein [email protected]
wrote:
Closed #14 https://github.com/craftr-build/craftr/issues/14.
—
Reply to this email directly or view it on GitHub
https://github.com/craftr-build/craftr/issues/14#event-435203796.
from craftr-build-4.x.
Related Issues (20)
- Windows: Invalid syntax in bash files with angle brackets in environment variables
- Java: Multiple -cp,-classpath arguments is incorrect
- Changes to session.path not reflected after first call to load()
- NameError in pyutils.strip_flags: shell is not defined
- Java: Support generating single executable from JAR
- Python 3.6.2 Automatic target name deduction behaves differently
- Make craftr print to stderr HOT 1
- example.c "craftr export" fails with "ValueError: a target with the name 'examples.c-1.0.0.program' already exists" HOT 6
- Support for MSVC from non-standard locations
- Reduce overhead introduced by routing every Ninja command through Craftr HOT 3
- Reduce CraftrBuildGraph.json size by merging equal environment mappings
- Add option to produce an OS notification when the build completed HOT 1
- Add support for the the AMD Optimizing C/C++ Compiler HOT 1
- Find a better method to deal with the Windows command length limit
- Support VS 2017 Build Tools
- Add proper error message when build script or build graph doesn't exist
- MSVC: Output a combined .pdb output file from linker/archiver
- Windows: Create response files for too long commands when .bat files are exported
- Add logging facility for build scripts for organized output
- Update command-line interface
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from craftr-build-4.x.