-1

I'm not really familiar with CMake at all but I got the task to clean-up the CXXFlags that are used (-O2 and -O3).

The Log prints out: "USING CXXFLAGS = '-g -O2 -fdebug-prefix-map=/build/cgal-ZyilPF/cgal-4.11=. -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -frounding-math -O3 -DNDEBUG'"

I've found out that -O2 and -O3 are for optimization, but I wonder how it is possible that both are used?

lmschwarz
  • 1
  • 2
  • Did you specify -O2 in your configuration? Please create an [MCVE]. What is the source of your cmake configuration files? `The Log` What Log? How to reproduce it? – KamilCuk Aug 25 '20 at 14:09

1 Answers1

1

In GCC manual, it says:

If you use multiple -O options, with or without level numbers, the last such option is the one that is effective.

So if you use GCC, -O3 works in your case. I'm not sure about other compilers.

Hanjoung Lee
  • 2,123
  • 1
  • 12
  • 20