[Interest] Static build of Qt - debug mode and plugins

Jakub Narolewski izowiuz at gmail.com
Sun Aug 25 19:45:27 CEST 2019


Ah yes, mystery solved. As usual – the butler did it. I suppose I  should read my own code more carefully.
In case of Release builds I’m adding “-flto” switch to the resulting object using this line of code:

if (NOT CMAKE_BUILD_TYPE STREQUAL "Debug")
	if (WIN32)
		SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /Ox /fp:fast")
	endif (WIN32)

	if (LINUX)
		SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -flto -funroll-all-loops -pthread")
	endif (LINUX)

	if (APPLE)
		SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -flto")
	endif (APPLE)
endif (NOT CMAKE_BUILD_TYPE STREQUAL "Debug")

When I also force it to exist in Debug builds the order of target_link_libraries function does not matter anymore and application builds just fine.
Sorry for the noise.

Thanks again for your help :]

Narolewski Jakub

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.qt-project.org/pipermail/interest/attachments/20190825/c2bcf49a/attachment.html>


More information about the Interest mailing list