I've got a test package building of 2.6 but I need to fix a problem before I can start builds for Fedora/RPM Fusion.
I'm already using CMAKE_RELEASE_TYPE=RelWithDebInfo and cmake is honoring the required C/CXX flags that Fedora requires but it's still adding -O3 after the Fedora flags which contain (and require) -O2.
I know cmake already includes system specific build flags but I can't quite find where these are being generated. Any ideas?
Thanks,
Richard
export CFLAGS=xxx does not work ?
Else
cmake -DCMAKE_C_FLAGS=xxxxx or similar should work
Exporting works, I guess what I'm trying to say that the internal flags are overriding my flags, i.e. I'm specing -O2 but later in the list of options I'm seeing -O3. I assume the last flag wins?
Richard
yes, the last flag wins
Assuming you are building in release mode
adding
cmake -DCMAKE_C_FLAGS_RELEASE="-O2" -DCMAKE_CXX_FLAGS_RELEASE="-O2" xxxx
should do it
I'll keep working on this... As much as I like cmake in general, this is one of the areas that can be very frustrating.
Trying "cmake --system-information" I get the following:
...
CMAKE_CXX_FLAGS == ""
CMAKE_CXX_FLAGS_DEBUG == "-g"
CMAKE_CXX_FLAGS_MINSIZEREL == "-Os -DNDEBUG"
CMAKE_CXX_FLAGS_RELEASE == "-O3 -DNDEBUG"
CMAKE_CXX_FLAGS_RELWITHDEBINFO == "-O2 -g"
CMAKE_C_FLAGS == ""
CMAKE_C_FLAGS_DEBUG == "-g"
CMAKE_C_FLAGS_MINSIZEREL == "-Os -DNDEBUG"
CMAKE_C_FLAGS_RELEASE == "-O3 -DNDEBUG"
CMAKE_C_FLAGS_RELWITHDEBINFO == "-O2 -g"
...
Which tells me that my "-DCMAKE_RELEASE_TYPE=RelWithDebInfo" should be doing the job... unless it's being overriden somewhere...
Thanks,
Richard
Ok, getting closer. It looks like it's only ffmpeg that's building with -O3...
Richard
from memory, one of the ffmpeg file does not like to be compiled with -O2
You'll run out of registers or something