How does cmake handle duplicate build options

38 Views Asked by At

My repo has a bit messy CMAKEList which configures many compile options. If I enable -Og but the legacy later also defines -O3, which option are chosen effective? Is it

  1. First one appears
  2. Last one appears
  3. Looser option (or stricter option)

Another example would be enable lto and disable lto (just an example)

Alwasy appreciate the community for sharing valuable knowledge!

0

There are 0 best solutions below