What is the bootstrap option in protobuf compiler? - protocol-buffers

In generator.cc file in protobuf compiler there is an option enabled from command line for "bootstrap", but the concept itself is not explained anywhere.
It can be seen on this line.
What is this boostrap option?

Related

With vcpkg portfile, how to insert regular CMake command?

I'm trying to customize a lib installed through vcpkg with regular CMake commands.
The only thing I need to tweak is to enable a preprocessor, e.g., BUILD_WITH_THIS_OPTINAL_FEATURE.
With Visual Studio, it's pretty straightforward: Just add it to the C/C++ > Preprocessor property of the project. But with vcpkg, it's unclear how to mix it with its own functions.
Say if I have a portfile ready under
E:\_dev\vcpkg\ports\mylib\portfile.cmake
I'd really love to let it know that I want to
add_compile_definitions(BUILD_WITH_THIS_OPTINAL_FEATURE)
But doing so directly in portfile.cmake gives me
CMake Error at ports/mylib/portfile.cmake:38 (add_compile_definitions):
Unknown CMake command "add_compile_definitions".
Anyone knows how?
Solved it myself.
I just need to add the following to vcpkg_configure_cmake's OPTIONS input arg
-DBUILD_WITH_THIS_OPTINAL_FEATURE=ON

Build chaincode(hyperledger) on Atom on Windows fail

I'm trying to build simple chaincode example in Atom editor on Windows but build fails (I'm using go-plus package) with following error:
fatal error: ltdl.h: No such file or directory #include ltdl.h
I know that using flag: -tags nopkcs11 will solve the problem, but how can i configure go-plus/Atom to use this flag?
I believe there is still an open issue for go-plus to support build tags. I have not used Atom in a while, but the only option I can think of would be to try to use a Makefile (which is not the easiest thing in the world on Windows since most of the built-in Atom commands assume GNU commands being available).
If you are open to moving to something like Visual Studio Code it does support build tags.
Perhaps we should actually reverse the build tag within Fabric and require you to enabled pkcs11 with a tag rather than disable it with a tag. I debated this when first adding the tag. Feel free to open up a JIRA item for this.

Compiling and embedding lua into a C++ application

For portability reasons, I'd like to compile lua from source when I compile my C++ code. I use lua to read input file.
If I understand correctly, lua's readme mentions that it's possible to do that through src/Makefile. I can't really read it that well. Has anyone figured out how to do it?
is it possible to have it in one command? gcc ....
bonus: how to put it in cmake ?
Lua has a makefile that needs your target platform to build to so you will need to specify make [target platform].
But that is right in the beginning of the readme.
You could try to call the make command from inside your build process.
Cheers
[UPDATE based on the comments]
If you use:
make a PLAT=[target platform]
on the command line in the src directory it will only build the liblua.a library for the target platform then you will just need to copy that file to wherever you need and link against it.

How can I compile C++ code with GCC compiler?

I wrote C++ code in notepad and want to compile with GCC compiler. Is GCC compiler a program? from which site I can download it? I don't have any information about it. What can I do?
You can start by downloading Code::Blocks, its an cross-platform IDE that can be downloaded including MinGW GCC compiler.
http://www.codeblocks.org/
But if You're using Linux you can use just a "gcc" command in the terminal.
GCC is a program. if you have linux its probably installed. to chek just type in the console line gcc. if you get a out put with the syntax - it's installed else - type the command that's suggested. in order to compile something type:
gcc <file name>
it will create a .out file that you could run from the console line.
for more info type:
man gcc
You can also use C-free 5.0 which is small and can use many compilers. Small ide. You just need to make it automatically choose the library and inclue paths.
If you're on Windows you can try one of ports: mingw.
If you're on Linux, you probably have it installed (try gcc --version) or at least available from repository (check your distributions "installer").
There is also a number of (free) IDEs that you can also get and use them instead of notepad. Google for Eclipse/CDT, Netbeans, code::blocks, etc.

Code::blocks verbose build

I want to see the actual commands sent to g++ during a Code::Blocks build. I want to see exactly what command-line arguments it uses in the compile and link steps, and I don't want to have to poke around in the build settings GUI to do it.
Alternatively, converting the Code::Blocks project to an equivalent Makefile would work, but I see nowhere where I can do that, either...
Edit
I ended up using a Code::Blocks plugin, "cbMakeGen", to generate a makefile from which I removed some #s. Then I was able to see the commands. Surely there is an easier way...
I see you already solved the problem, but there's still a bit more to that.
Code::Blocks can write a build log when the following option is checked:
Settings->Compiler and debugger->Global compiler settings->{slide tabs to the right}->Build options tab->Save build log to HTML.
Besides, you can use "cbp2make" to convert Code::Blocks projects to makefiles. This is not a plugin like "cbMakeGen", but a stand-alone command-line tool. See also http://forums.codeblocks.org/index.php/topic,13675.0.html .
Besides the logging to html you can also go to
Settings->Compiler and debugger->Global compiler settings->{slide tabs to the right}->Other Settings and in that tab set 'Compiler Logging:' to 'full command line' (from drop down menu).
Now you can see the gcc command line in the console when you build.

Resources