What is "XX" in CXX in the CMakeLists.txt cmake file

What is "XX" in CXX in the CMakeLists.txt cmake file.
What is its significance.

Why is this β€œXX” not PP vs CPP file?

+9
source share
2 answers

XX means β€œ++” (each X is like a β€œplus” rotated 45 Β°), CXX means β€œC ++”.

Why " CXX "?

  • " C++ " is impossible due to the limitations of macro definitions (they cannot contain + );
  • β€œ CPP ” (for β€œC Plus Plus”) is commonly used to mean β€œ C P re P rocessor”.

For example, in the GNU Makefile, you can define the following "variables":

  • CPPFLAGS : additional flags for the C preprocessor (also used in C ++).
  • CFLAGS : additional flags for the C compiler.
  • CXXFLAGS : additional flags for the C ++ compiler.

(Usually you use CPPFLAGS and CFLAGS for project C and CPPFLAGS and CXXFLAGS for C ++ project.)


See also Difference between CPPFLAGS and CXXFLAGS in GNU Make and CFLAGS vs CPPFLAGS .

Related: Fix C ++ file extension (and duplicate links).

+17
source

Many file systems do not allow the + file names, so for many years to source files C ++ has several naming conventions, including the .cpp , .cc and .cxx .

CMake has a similar problem, as its macro language is built around strings that are not allowed to hold special characters such as + . This is just a limitation on getting the CMake analyzer to become too complex. So when they write CXX , what they really mean is just C++ .

+4
source

Source: https://habr.com/ru/post/1494639/


All Articles