Am Dienstag, 23. September 2014 um 13:53:08, schrieb Roman Lebedev <[email protected]> > Hello. > > I'm using Debian GNU/Linux sid. > When i'm trying to build enblend after running cmake with > *-DENABLE_SSE2:BOOL=ON*, it fails: > > $ make > [ 3%] Generating signature.h > Possible precedence issue with control flow operator at /home/lebedevri/src/ > enblend/enblend.hg/src/DefaultSig.pm line 137. > Scanning dependencies of target enblend > [ 7%] Building CXX object src/CMakeFiles/enblend.dir/filenameparse.cc.o > /home/lebedevri/src/enblend/enblend.hg/src/filenameparse.cc:1:0: error: CPU > you selected does not support x86-64 instruction set > src/CMakeFiles/enblend.dir/build.make:60: recipe for target > 'src/CMakeFiles/enblend.dir/filenameparse.cc.o' failed > make[2]: *** [src/CMakeFiles/enblend.dir/filenameparse.cc.o] Error 1 > CMakeFiles/Makefile2:81: recipe for target 'src/CMakeFiles/enblend.dir/all' > failed > make[1]: *** [src/CMakeFiles/enblend.dir/all] Error 2 > Makefile:137: recipe for target 'all' failed > make: *** [all] Error 2 > This happens with GCC-4.9 and GCC-4.6 (and others too, probably). > > Attached patch fixes issue for me by replacing hardcoded *-mtune=pentium4 *in > CMAKE_CXX_FLAGS_RELEASE > by *-march=native* or *-mtune=native* or *-mtune=generic* depending on > which one is working. > > *Note*: it might be a good idea to set CXXFLAGS to *-mtune=generic* when > doing build for release (for redistribution of binaries), but i have not > found anything about this in CMakeLists.txt > > If there is anything wrong with my patch, i am ready to fix it. > > Thanks! >
Nothing wrong, as far as I can see.
You could also make a new macro (in CMakeModules/HuginMacros.cmake) like
macro(set_sse_cxx_flags)
and use it in CMakeLists.txt
IF(ENABLE_SSE2)
set_sse_cxx_flags()
ENDIF(ENABLE_SSE2)
Just my 2 cents
Kornel
signature.asc
Description: This is a digitally signed message part.
