Skip to content

cmCustomCommand: Refactor with unique_ptr

Takumi Nakamura requested to merge chapuni/cmake:cc/trunk into master

Abstract

  • Introduce setters in cmCustomCommand. Prune a constructor with positional parameters.
  • Hoist creating cmCustomCommand to cmAddCustom*.cxx.
  • No behavior changes intended.

Goal

  • To add a property to add_custom_command, we can simply edit cmCustomCommand and its users.

A problem

  • To add a property to add_custom_command, so many changes would be required.
  • cmCustomCommand::cmCustomCommand(...) is used with default parameters in many places. Positional parameters are not suitable there.

About this branch

  • I split commits unsquashed intentionally. I am certain it will help step-by-step confirmation. I can squash them later.
  • Tested only on Linux.

TODO(I don't do for now)

  • I discovered that std::move() could be applied to many setters. I didn't do for now, since most of them would be the paths I don't use usually. Feel free to try applying std::move().

Known problem

  • in Source/cmGlobalVisualStudio8Generator.cxx, stdPipesUTF8 was set to cc::escapeOldStyle. I guess it would be unintentional.

Topic-rename: custom-command-unique_ptr

Edited by Brad King

Merge request reports