https://bugs.kde.org/show_bug.cgi?id=360249
--- Comment #11 from Jan Kundrát <[email protected]> --- > I wish to know how to disable tests. I sought the information > but did not find it. Probably something like -DCMAKE_DISABLE_FIND_PACKAGE_Qt5Test=true (or Qt5Tests?) should do the trick. Or just do not run `make all` (which is a default target executed by `make`), but `make trojita`, that's even easier. > -fvisibility=hidden -fvisibility-inlines-hidden -O2 -g -DNDEBUG > -fPIC -fPIC Trojita's build system never specifies this particular chunk of CXXFLAGS directly. I've tried grepping my /usr/lib64/cmake, but I don't see an obvious culprit in there. We might workaround by carefuly placing user's CXXFLAGS after any library-provided CXXFLAGS, but in order to fix this, we need to know which module injects these flags. Anyway, this worked for me: $ cd clean/build/dir $ cmake -DCMAKE_CXX_FLAGS="-O0 -march=native" -DCMAKE_BUILD_TYPE=Debug ~/work/prog/trojita $ make -j4 VERBOSE=1 ... /usr/bin/c++ -DQT_CORE_LIB -DQT_NETWORK_LIB -DQT_NO_CAST_FROM_ASCII -DQT_NO_CAST_TO_ASCII -DQT_STRICT_ITERATORS -DQT_USE_FAST_CONCATENATION -DQT_USE_FAST_OPERATOR_PLUS -DQT_USE_QSTRINGBUILDER -Wall -Wsign-compare -O2 -O0 -march=native -std=c++11 -fvisibility=hidden -fvisibility-inlines-hidden -Werror -g -fPIC -I/home/jkt/work/prog/trojita/src -I/home/jkt/work/prog/_trojita-build/cxxflags -isystem /usr/include/qt5 -isystem /usr/include/qt5/QtNetwork -isystem /usr/include/qt5/QtCore -isystem /usr/lib64/qt5/mkspecs/linux-g++ -fPIC -o CMakeFiles/Streams.dir/src/Streams/DeletionWatcher.cpp.o -c /home/jkt/work/prog/trojita/src/Streams/DeletionWatcher.cpp > So, the optimization level is '-O2' even though I specified > '-O0'. The CXXFLAGS > variable in the shell when cmake was called also had '-pipe -march=native' > which are missing, so we see that the variable from the shell > passed to CMake was not used. Considering that you specified both an env var and an explicit option to cmake when configuring, it makes sense that the -DCMAKE_CXX_FLAGS has won. That's not a bug. > I don't see where it is getting double '-O2' from. It is not coming from my > CXXFLAGS or CFLAGS environment variable. It could be > - the line adding -O2 to CMAKE_CXX_FLAGS is being called twice. > - there is some rule where CMAKE_CXX_FLAGS is used twice. > This could happen by being used once directly as CMAKE_CXX_FLAGS and another > being appended to CXXFLAGS. I'm willing to bet that this comes from some external library cmake config. As I wrote above, it's apparently build-type-dependant, so add a -DCMAKE_BUILD_TYPE=Debug and be done with it. -- You are receiving this mail because: You are watching all bug changes.
