Comments (8)
Thanks :D
will this project include those library configurations out of the box? like CMake does it with find_package(SFML 2 REQUIRED)
or every user should write one of its own
from bake.
Maybe https://github.com/SanderMertens/bake#can-i-link-with-non-bake-libraries
from bake.
Ok, i actually saw that but it didn't work, then i found that this is the problem:
{
"id": "sfml",
"type": "application",
"value": {
"language": "cpp"
},
"lang.c":{
"lib":["sfml-graphics", "sfml-window", "sfml-system","stdc++"]
}
}
I removed the "value": {"language": "cpp"}
section and it works now .. but why? it is a C++ application not C? and why lang.c
instead of lang.cpp
?
from bake.
Ah, I can see why this is a bit confusing. I just added an example to the C++ folder. The correct configuration is:
{
"id": "sfml",
"type": "application",
"value": {
"language": "cpp"
},
"lang.cpp":{
"lib":["sfml-graphics", "sfml-window", "sfml-system","stdc++"]
}
}
Bake's configuration is composed out of generic configuration (id
, type
, value
) and driver-specific configuration (everything else). In this example, everything under "lang.cpp"
is configuration for the C++ driver.
Bake automatically loads the correct language driver based on the "language"
attribute, which by default is C. In your example, you selected C++ as the language, but you provided configuration for the C driver, which is why it wasn't picking up the settings.
When you removed the "language": "cpp"
attribute, the project became a C project, and bake correctly loaded the configuration in "lang.c"
which is why it worked.
In practice, the C and C++ drivers are almost the same (C++ inherits the definitions from C) so most configuration settings apply to both. If you would like to know more about driver configuration, see the READMEs in the driver projects:
C: https://github.com/SanderMertens/bake/tree/master/drivers/lang/c
C++: https://github.com/SanderMertens/bake/tree/master/drivers/lang/cpp
from bake.
Btw, here is a trick that, based on your example, you may find useful. You can encapsulate the SFML configuration, by doing this:
{
"id": "sfml",
"type": "package",
"value": {
"language": "none"
},
"dependee": {
"lang.cpp": {
"lib":["sfml-graphics", "sfml-window", "sfml-system","stdc++"]
}
}
}
Then, in your application project, you can simply do this:
{
"id": "my_sfml_app",
"type": "application",
"value": {
"language": "c++",
"use": ["sfml"]
}
}
Note I changed the name of the application, so that it doesn't clash with the SFML package.
from bake.
That is a good question. It would be nice if bake could provide configurations for well-known libraries out of the box. There could be a folder in the repository called libraries
in which these configurations can be stored. During the bake setup, these libraries will then automatically be made available for user projects.
It would be great if you could upload the sfml configuration, once it is in place
from bake.
I just implemented the above functionality. Any projects you add to the location below will be automatically installed during bake setup:
https://github.com/SanderMertens/bake/tree/master/libraries
See the SDL2 template for an example.
from bake.
Closing the issue as question is answered.
from bake.
Related Issues (20)
- bake.util includes non-standard header <sys/ptrace.h>
- Minor "BAKE_ARCHITECTURE" vs. "BAKE_ARCH" inconsistency HOT 1
- trying to set up bake with vs2019 not working
- --version and --verbosity options use the same short form(-v)
- Implement external driver support
- how can I setup "missing dependency" HOT 1
- Add option to c language driver to skip symbols presence check to build program modules, like Postgresql extensions or similar HOT 1
- sdl2 missing binary
- Failing to link
- Failing to link package HOT 1
- Why System32?
- JSON Compilation Database? HOT 1
- make ~/bake folder location configurable
- Support MSYS2 on Windows
- Project has file with illegal name HOT 1
- C++ compiler options (flags) HOT 1
- Bake setup breaks PATH on windows
- execinfo.h not supported on musl libc.
- --interactive mode ignore certain files/folders
- Correct installation of bake HOT 2
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 bake.