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. With qmake, how to use precompiled headers except for one file?
Forum Updated to NodeBB v4.3 + New Features

With qmake, how to use precompiled headers except for one file?

Scheduled Pinned Locked Moved Solved General and Desktop
qmakeprecompile
3 Posts 2 Posters 859 Views 1 Watching
  • 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.
  • D Offline
    D Offline
    dave2
    wrote on last edited by dave2
    #1

    Suppose we have a project with 100 .cpp files. They are compiled with a precompiled header (for speedup reasons), except for one (let's call it special.cpp) which is not in our hands and, for reasons beyond this discussion, cannot use the precompiled header.

    In my .pro file, how can I prevent qmake from compiling special.cpp with the precompiled header?

    Needs to work with Qt 5.12.0, Visual Studio 2017 and g++ 7.3.

    raven-worxR 1 Reply Last reply
    0
    • D dave2

      Suppose we have a project with 100 .cpp files. They are compiled with a precompiled header (for speedup reasons), except for one (let's call it special.cpp) which is not in our hands and, for reasons beyond this discussion, cannot use the precompiled header.

      In my .pro file, how can I prevent qmake from compiling special.cpp with the precompiled header?

      Needs to work with Qt 5.12.0, Visual Studio 2017 and g++ 7.3.

      raven-worxR Offline
      raven-worxR Offline
      raven-worx
      Moderators
      wrote on last edited by raven-worx
      #2

      @dave2
      i think it might be doable by enabling the precompiled headers by default for the whole project and add a custom compiler to qmake and assign the files which shouldn't be compiled with the precompiled header to it.
      Use QMAKE_CXX and QMAKE_CXX_FLAGS variables

      --- SUPPORT REQUESTS VIA CHAT WILL BE IGNORED ---
      If you have a question please use the forum so others can benefit from the solution in the future

      D 1 Reply Last reply
      3
      • raven-worxR raven-worx

        @dave2
        i think it might be doable by enabling the precompiled headers by default for the whole project and add a custom compiler to qmake and assign the files which shouldn't be compiled with the precompiled header to it.
        Use QMAKE_CXX and QMAKE_CXX_FLAGS variables

        D Offline
        D Offline
        dave2
        wrote on last edited by
        #3

        @raven-worx Thanks!

        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