View Issue Details Jump to Notes ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0015472CMake(No Category)public2015-03-23 20:152016-06-10 14:31
ReporterStephen Kelly 
Assigned ToKitware Robot 
PrioritynormalSeverityminorReproducibilityhave not tried
StatusclosedResolutionmoved 
PlatformOSOS Version
Product Version 
Target VersionFixed in Version 
Summary0015472: CMake does not deduplicate defines which have the same name but different value
Description  cmake_minimum_required(VERSION 2.8)
  project(cmaketest)

  add_executable(mn main.cpp)
  target_compile_definitions(mn PRIVATE TESTD=1 TESTD=3)

  set_source_files_properties(main.cpp PROPERTIES COMPILE_DEFINITIONS TESTD=5)


CMake currently passes all of the defines, and the compiler (gcc at least) warns about redefinition.
TagsNo tags attached.
Attached Files

 Relationships

  Notes
(0038284)
Brad King (manager)
2015-03-24 08:56

Hmm. I'm not sure this is possible because the generators put the target-wide definitions in one place and the per-source definitions in another. They are combined by the native build tool.

Options:

a. Do nothing
b. Warn earlier
c. Transform the source file rule to use -UTESTD -DTESTD=5.
(0042744)
Kitware Robot (administrator)
2016-06-10 14:29

Resolving issue as `moved`.

This issue tracker is no longer used. Further discussion of this issue may take place in the current CMake Issues page linked in the banner at the top of this page.

 Issue History
Date Modified Username Field Change
2015-03-23 20:15 Stephen Kelly New Issue
2015-03-24 08:56 Brad King Note Added: 0038284
2016-06-10 14:29 Kitware Robot Note Added: 0042744
2016-06-10 14:29 Kitware Robot Status new => resolved
2016-06-10 14:29 Kitware Robot Resolution open => moved
2016-06-10 14:29 Kitware Robot Assigned To => Kitware Robot
2016-06-10 14:31 Kitware Robot Status resolved => closed


Copyright © 2000 - 2018 MantisBT Team