How to include static library based on CMAKE generator - lua

I'm trying to add lua static library onto my project using CMAKE. But what I found from lua documents that they have several version of Visual Studio libraries for 32/64-bit architecture.
I need to learn is there a option on CMAKE to identify the architecture and generator used for generating required files.
Thanks in advance

There's a host of system inspection variables and information variables which CMake offers. I'll try to list some which might be applicable in your case:
CMAKE_CL_64: true if the compiler being used is Microsoft's CL targetting a 64-bit architecture
MSVC: true if using a Miscrosoft Visual C++ compiler
CMAKE_GENERATOR: the generator being used
CMAKE_GENERATOR_PLATFORM: generator-specific target platform name
CMAKE_SIZEOF_VOID_P: size of void*, in bytes
You should also be aware that CMake ships with a FindLua module, so you might find the decision already implemented for you in that module. (I have never used it myself, so I do not now whether/how it works).

Related

What does "vc14_vc15" mean in opencv-4.6.0-vc14_vc15.exe?

I'm trying to download a windows pre-built binary of Opencv, and from https://sourceforge.net/projects/opencvlibrary/files/4.6.0/ I see a file named opencv-4.6.0-vc14_vc15.exe.
What does vc14_vc15 mean here? vc14 I guess it's VS2015, then vc15 is VS2017, but what's the point to list vs versions as to opencv binaries?
If the binary is compiler version specific, why not separate it into vc14 and vc15? Are they compatible? if it's compatible, why not just say vc15?
Can I use vs 2019/2022 to create a project and link to this version?
Can I use gcc (on windows of course) to compile a project and link to this version?
I'm really confused.
Thanks.

Can i compile in memory source code to executable with clang?

reading this link :http://fdiv.net/2012/08/15/compiling-code-clang-api
i see i can load c/c++ file and compile it just fine to executable..
but i did't found any info if i have some kind of source code in c/c++
that my application generating or other way ..
in short can i pass the stage where i load the c file , and just build my own logic to compile to executable ?
Of course you can. And there is already a project for that purpose
Dig its source codes as your wish :)
Cling
What is Cling
Cling is an interactive C++ interpreter, built on the top of
LLVM and Clang libraries. Its advantages over the standard
interpreters are that it has command line prompt and uses
just-in-time (JIT) compiler for compilation. Many of the developers
(e.g. Mono in their project called CSharpRepl) of such kind
of software applications name them interactive compilers.
One of Cling's main goals is to provide contemporary, high-performance
alternative of the current C++ interpreter in the ROOT project -
CINT. The backward-compatibility with CINT is major priority during
the development.

compiled vala itself with vala on windows

I'm not sure if this question is correct but...
Ok, is possible compiled the source vala in vala
because I bean downloading vala source code and inside has many vala files
here vala release source code
https://wiki.gnome.org/Vala/Release
I have been installed on windows this version
https://code.google.com/p/vala-win32/downloads/list
vala-0.12.0.exe
I wont compile the last vala release whit the vala on windows
oky, gracias :D
please, not confused with this question,
Compiling a Vala source On Windows
If 0.20.1 is enough, you can use http://www.tarnyko.net/en/?q=node/35 and possibly avoid this whole thing.
If you really need 0.22.0, Vala release tarballs don't actually require valac to compile—they contain all the generated C. You should be able to use the build system included with Vala (like Robert Rozas mentioned, or via cygwin) to generate executables even without valac installed.
GNOME wiki recommends using either MSYS2 or WSL (Windows 10 only) to get Vala compiler. Another option is using ValaForWindows, which aims to be the easiest option to install and use.

Global Management of Multiple Compilers in Lazarus IDE

I've been searching around the Lazarus IDE documentation for a bit, and thus far only found information related to cross compiling, so I was hoping someone could give me a straight answer on this. I'm currently working on a project that will require compilation for 32-bit Windows as well as 64-bit Windows. Additionally, I've already set up both versions of the Free Pascal Compiler. Does Lazarus have any built in functionality for configuring in both compilers, and then based on the build target, using the appropriate compiler? Ideally, this would be done at a global level, so that the configuration persists across projects, but if it can only be done at the project level, I don't mind doing it that way.
On further reading, I think I found my answer. I didn't realize it, but fpc has the same sort of front-end functionality as gcc. With that said, implementing the functionality described in my question is just a matter of installing the compiler as a cross compiler, rather than as an independent compiler. Since it doesn't look like you can use the x86_64 compiler to create a 32-bit version, you'll have to compile the 32-bit version, and then crosscompile the 64-bit version. In my case, I first compiled and installed the Win32 compiler using:
make all install INSTALL_PREFIX=C:\path\to\lazarus\1.0.8\fpc\2.6.3 OS_TARGET=win32 CPU_TARGET=i686 PP=ppc386.exe
Next, I compiled and crossinstalled the 64-bit compiler:
make crossall crossinstall INSTALL_PREFIX=C:\path\to\lazarus\1.0.8\fpc\2.6.3 OS_TARGET=win64 CPU_TARGET=x86_64
To confirm that it worked, you can find an executable called, ppcrossx64 in your C:\path\to\lazarus\1.0.8\fpc\2.6.3\bin\i386-win32 folder.

When will a newer version of flex for windows be available?

I'm using flex (lexical analyzer, not Adobe Flex) on a project. However, I want to be able to compile on Windows platforms as well, but the Windows version's newest version is only 2.5.4a, so it won't compile my file for version 2.5.35. And no, I can't downgrade to the highest supported Windows version.
Anyone know about plans to upgrade the windows version, or have a suggestion to compile on windows anyway?
You can ask on the mailing list, or get involved in the Flex project yourself. I think the code-base for Flex has remained static for a while, but I don't know who maintains the Windows port. In the interim...
I would recommend including the produced source in your project.
Generate the lexer on a Linux system to produce your lex.c/lex.h files (or whatever)
Include those files in your Win32 C source before you build
If you don't have direct access to a Linux system, a virtual machine might be a good idea. The Flex source should be complaint to some C standard that builds on Windows, but most of the POSIX differences can be altered to use Win32 API fairly easily.
Maybe distribute as:
/src/source_files.c
/src/lex.l
/src/win32_lex/lex.c
This way systems with a modern flex can generate the source from the lex file, and Windows systems compiling the source can use the complementary pre-processed C files.
Short of using some user-space POSIX (Cygwin or whatever).
A little bit of tweaking required, but isn't that portability for you!
Windows builds of flex 2.5.35 do exist, but unfortunately they are not self contained. You can download the MINGW build here, and the Cygwin build here; see also another stackoverflow question. Each build requires that its respective (MINGW or Cygwin) kernel be installed.

Resources