Commit bab7ce3
committed
build: make -O3 actually reach the optimized runtime
CMake appends CMAKE_CXX_FLAGS_<CONFIG> after CMAKE_CXX_FLAGS, and clang
honours the last -O on the command line. AGP builds the release variant as
RelWithDebInfo, whose default flags are "-O2 -g -DNDEBUG", so the -O3 set in
CMAKE_CXX_FLAGS was overridden and every shipped runtime was compiled at -O2.
Append -O3 to CMAKE_CXX_FLAGS_RELWITHDEBINFO inside the same branch so it
comes last. The -O3 in CMAKE_CXX_FLAGS stays: CMAKE_CXX_FLAGS_DEBUG carries
no -O, so a Debug-config build with -Poptimized still needs it.1 parent e63df3d commit bab7ce3
1 file changed
Lines changed: 5 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
63 | 63 | | |
64 | 64 | | |
65 | 65 | | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
66 | 71 | | |
67 | 72 | | |
68 | 73 | | |
| |||
0 commit comments