Skip to content
GitLab
  • Menu
Projects Groups Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in / Register
  • CMake CMake
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 3,926
    • Issues 3,926
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 18
    • Merge requests 18
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Releases
  • Packages & Registries
    • Packages & Registries
    • Container Registry
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Repository
  • External wiki
    • External wiki
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • CMake
  • CMakeCMake
  • Issues
  • #21185
Closed
Open
Created Sep 12, 2020 by Pablo Romero@pablorcumContributor

UNIX Target system internal flag not working when crosscompiling

I am crosscompiling for QNX on Windows and Linux, and noticed that the UNIX flag is not properly set nor detected, and therefore all crosscompiling projects relying on if(UNIX) checks are silently failing, unless the user notices and forces -DUNIX=ON on their call to cmake.

I have attached a very simple reproduction package including build scripts for Windows and Bash at reproUNIXFlagProblem.zip.

In principle UNIX is set to 1 at Platform/UnixPaths.cmake, which is called indirectly after adding include(Platform/QNX) in my toolchain file. I have debugged a bit, and the line set(UNIX 1) is actually executed, but it is somehow later reverted to its original value before continuing the execution of the main CMakeLists.txt.

Edited Sep 12, 2020 by Pablo Romero
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information
Assignee
Assign to
Time tracking