Skip to content

GitLab

  • Projects
  • Groups
  • Snippets
  • Help
    • Loading...
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in / Register
CMake
CMake
  • Project overview
    • Project overview
    • Details
    • Activity
    • Releases
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 3,191
    • Issues 3,191
    • List
    • Boards
    • Labels
    • Service Desk
    • Milestones
  • Merge Requests 14
    • Merge Requests 14
  • CI / CD
    • CI / CD
    • Pipelines
    • Jobs
    • Schedules
  • Operations
    • Operations
    • Incidents
    • Environments
  • Packages & Registries
    • Packages & Registries
    • Container Registry
  • Analytics
    • Analytics
    • CI / CD
    • Repository
    • Value Stream
  • External Wiki
    • External Wiki
  • Members
    • Members
  • Collapse sidebar
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
  • CMake
  • CMakeCMake
  • Issues
  • #18894

Closed
Open
Opened Feb 08, 2019 by yrHeTaTeJlb@yrHeTaTeJlbContributor

Applying GENEX_EVAL to property that already contains GENEX_EVAL

There is following code:

cmake_minimum_required(VERSION 3.12)
project(test CXX)
add_executable(foo foo.cpp)

set_target_properties(
   foo
   PROPERTIES
   "a" "$<GENEX_EVAL:$<TARGET_PROPERTY:b>>"
   "b" "$<GENEX_EVAL:$<TARGET_PROPERTY:c>>"
   "c" "$<GENEX_EVAL:$<TARGET_PROPERTY:d>>"
   "d" "$<1:macarena>"
   )

target_compile_options(foo PRIVATE "$<TARGET_GENEX_EVAL:foo,$<TARGET_PROPERTY:foo,a>>")

a reads b, b reads c, c reads d, d have to be expanded as macarena.

I expect compilation error due to unknown compiler option macarena.

But:

  • cmake 3.13.1 on Linux(Centos 7) just crashes.
  • cmake 3.12.4 on Windows 10 produces following error:
CMake Error at CMakeLists.txt:14 (target_compile_options):

  Error evaluating generator expression:

    $<GENEX_EVAL:$<TARGET_PROPERTY:c>>

  Dependency loop found.


CMake Error at CMakeLists.txt:14 (target_compile_options):
  Loop step 1

    $<GENEX_EVAL:$<TARGET_PROPERTY:b>>



CMake Error at CMakeLists.txt:14 (target_compile_options):
  Loop step 2

    $<TARGET_GENEX_EVAL:foo,$<TARGET_PROPERTY:foo,a>>



CMake Error:
  Loop step 3

    $<GENEX_EVAL:$<TARGET_PROPERTY:c>>

Probably if I update cmake on Windows I get crash as well.

Am I doing something wrong or this is cmake bug?

UPD:

I believe that problem places are assert in TargetPropertyNode::Evaluate and and if in cmGeneratorExpressionDAGChecker::CheckGraph(). If I remove them, everything works as expected.

Edited Feb 08, 2019 by yrHeTaTeJlb
To upload designs, you'll need to enable LFS and have admin enable hashed storage. More information
Assignee
Assign to
3.14.0
Milestone
3.14.0 (Past due)
Assign milestone
Time tracking
None
Due date
None
Reference: cmake/cmake#18894