View Issue Details Jump to Notes ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0014728CMakeCMakepublic2014-02-02 23:132015-01-05 08:39
ReporterNAKAMURA Takumi 
Assigned ToBen Boeckel 
PrioritynormalSeverityminorReproducibilityalways
StatusclosedResolutionfixed 
PlatformOSOS Version
Product VersionCMake 2.8.12.1 
Target VersionCMake 3.1Fixed in VersionCMake 3.1 
Summary0014728: [CMake/Ninja] add_dependencies() to objlib's user is ignored.
DescriptionSee the case below.
foobar doesn't depend on cmd2 with -GNinja.

It seems works with Unix Makefiles.
Steps To Reproducecmake_minimum_required(VERSION 2.8)

add_custom_target(cmd1 COMMAND echo cmd1)
add_custom_target(cmd2 COMMAND echo cmd2)

add_library(obj.foobar OBJECT foobar.c)
add_executable(foobar $<TARGET_OBJECTS:obj.foobar>)

add_dependencies(obj.foobar cmd1)
add_dependencies(foobar cmd2) # ignored.
TagsNo tags attached.
Attached Files

 Relationships
related to 0014747closed Target dependencies do not trigget build on Ninja 
related to 0014771closedKitware Robot Ninja generator does not always honor SYMBOLIC rules with no command 

  Notes
(0035026)
Brad King (manager)
2014-02-03 13:55

It looks like the inter-target dependency is implemented by adding an order-only dependency of every source compilation rule in the dependent target on the dependency. Since 'foobar' does not have any source files to compile no place every gets the dependency attached.

Peter, I think the link command needs to get the order-only dependencies too.
(0035820)
Ben Boeckel (developer)
2014-05-05 18:28

I've pushed a branch to stage which should address this: dev/ninja-target-dependencies.
(0036298)
Brad King (manager)
2014-07-01 10:17

I've revised Ben's change and merged for testing:

 Ninja: Add order-only dependencies to link commands
 http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=ac8879ce [^]
(0037581)
Robert Maynard (manager)
2015-01-05 08:39

Closing resolved issues that have not been updated in more than 4 months

 Issue History
Date Modified Username Field Change
2014-02-02 23:13 NAKAMURA Takumi New Issue
2014-02-03 13:54 Brad King Assigned To => Peter Kuemmel
2014-02-03 13:54 Brad King Status new => assigned
2014-02-03 13:55 Brad King Note Added: 0035026
2014-02-10 13:40 Brad King Relationship added related to 0014747
2014-02-25 09:50 Brad King Relationship added related to 0014771
2014-04-13 05:44 Peter Kuemmel Assigned To Peter Kuemmel =>
2014-04-13 05:47 Peter Kuemmel Status assigned => confirmed
2014-05-05 18:28 Ben Boeckel Assigned To => Ben Boeckel
2014-05-05 18:28 Ben Boeckel Status confirmed => assigned
2014-05-05 18:28 Ben Boeckel Note Added: 0035820
2014-07-01 10:17 Brad King Note Added: 0036298
2014-07-01 10:17 Brad King Target Version => CMake 3.1
2014-07-02 09:53 Brad King Status assigned => resolved
2014-07-02 09:53 Brad King Resolution open => fixed
2014-07-02 09:53 Brad King Fixed in Version => CMake 3.1
2015-01-05 08:39 Robert Maynard Note Added: 0037581
2015-01-05 08:39 Robert Maynard Status resolved => closed


Copyright © 2000 - 2018 MantisBT Team