package/pkg-cmake: add CMAKE_SYSTEM_VERSION to toolchainfile.cmake
authorArnout Vandecappelle (Essensium/Mind) <arnout@mind.be>
Thu, 10 Jan 2019 23:05:28 +0000 (00:05 +0100)
committerThomas Petazzoni <thomas.petazzoni@bootlin.com>
Sat, 12 Jan 2019 15:06:51 +0000 (16:06 +0100)
commit36568732e40923d19274f1c997e278a1c4e6c99e
tree8629a911967a2f6501b25a1e70bcbb00f51353ad
parent147f833692fe02d3b5b5907f508491d773927c19
package/pkg-cmake: add CMAKE_SYSTEM_VERSION to toolchainfile.cmake

Quoting the CMake documentation:

  When the CMAKE_SYSTEM_NAME variable is set explicitly to enable cross
  compiling then the value of CMAKE_SYSTEM_VERSION must also be set
  explicitly to specify the target system version.

Thus, we should also set CMAKE_SYSTEM_VERSION in toolchainfile.cmake. It
is supposed to be set to the value of `uname -r` on the target. We don't
have that exact value available (unless we build the kernel), but the
value of BR2_TOOLCHAIN_HEADERS_AT_LEAST contains the (minimum) version
of the kernel it will run on, so it should be OK for all practical
purposes.

Signed-off-by: Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be>
Cc: Samuel Martin <s.martin49@gmail.com>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
package/pkg-cmake.mk
support/misc/toolchainfile.cmake.in