Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. QT 6.5.3 and conan/CMake - how to turn off LTCG and /GL in the release build
Forum Updated to NodeBB v4.3 + New Features

QT 6.5.3 and conan/CMake - how to turn off LTCG and /GL in the release build

Scheduled Pinned Locked Moved Unsolved General and Desktop
2 Posts 2 Posters 575 Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • A Offline
    A Offline
    AndrewCQT
    wrote on last edited by
    #1

    I am using "conan" and QT 6.5.3 with the Visual Studio 2019 toolset

    In the conanfile.py for my target I have
    self.requires("qt/6.5.3")

    When creating a "Release" build it appears that the QT6 cmake modules inserts /GL as a compiler option and /LTCG as a link option. Debug builds are not problem.
    These options are part of "Link Time Code Generation"

    I really need to turn off these options for the build of my target but I am finding it impossible to tweak the CMakeLists.txt to do so.

    Things I have tried in the CMakeLists.txt.

    set(CMAKE_INTERPROCEDURAL_OPTIMIZATION FALSE)
    add_compile_options($<$<COMPILE_LANGUAGE:CXX>:/GL->)
    

    When I add the GL- option I get a compiler command line such as below. The /GL- option is overridden by the later /GL option.

      FLAGS = /DWIN32 /D_WINDOWS /GR /EHsc /O2 /Ob2 /DNDEBUG -MD /GL- /diagnostics:caret /Zi -permissive- -Zc:__cplusplus /bigobj /MP /GL /Os -std:c++17
    

    So the mystery is there some way to disable the LTCG turned on by the QT6 CMake modules?

    Christian EhrlicherC 1 Reply Last reply
    0
    • A AndrewCQT

      I am using "conan" and QT 6.5.3 with the Visual Studio 2019 toolset

      In the conanfile.py for my target I have
      self.requires("qt/6.5.3")

      When creating a "Release" build it appears that the QT6 cmake modules inserts /GL as a compiler option and /LTCG as a link option. Debug builds are not problem.
      These options are part of "Link Time Code Generation"

      I really need to turn off these options for the build of my target but I am finding it impossible to tweak the CMakeLists.txt to do so.

      Things I have tried in the CMakeLists.txt.

      set(CMAKE_INTERPROCEDURAL_OPTIMIZATION FALSE)
      add_compile_options($<$<COMPILE_LANGUAGE:CXX>:/GL->)
      

      When I add the GL- option I get a compiler command line such as below. The /GL- option is overridden by the later /GL option.

        FLAGS = /DWIN32 /D_WINDOWS /GR /EHsc /O2 /Ob2 /DNDEBUG -MD /GL- /diagnostics:caret /Zi -permissive- -Zc:__cplusplus /bigobj /MP /GL /Os -std:c++17
      

      So the mystery is there some way to disable the LTCG turned on by the QT6 CMake modules?

      Christian EhrlicherC Offline
      Christian EhrlicherC Offline
      Christian Ehrlicher
      Lifetime Qt Champion
      wrote on last edited by
      #2

      LTCG and GL is not added in my system. Please show a minimal CMakeLists.txt to reproduce the issue. Maybe somewhere the interprocedural optimization is enabled where you did not notice it.

      Qt Online Installer direct download: https://download.qt.io/official_releases/online_installers/
      Visit the Qt Academy at https://academy.qt.io/catalog

      1 Reply Last reply
      0

      • Login

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • Users
      • Groups
      • Search
      • Get Qt Extensions
      • Unsolved