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. How to do condition compilation in .pro file?
Forum Updated to NodeBB v4.3 + New Features

How to do condition compilation in .pro file?

Scheduled Pinned Locked Moved Unsolved General and Desktop
5 Posts 3 Posters 1.1k 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.
  • P Offline
    P Offline
    Publicnamer
    wrote on last edited by Publicnamer
    #1

    I've got several asm files that are each custom code suited to the CPU type. I need to be able to use NASM or AS to compile the correct asm file for the CPU type to generate the needed .o file. Has the .pro file format got any support for conditional compilation like this?

    1 Reply Last reply
    0
    • JoeCFDJ Offline
      JoeCFDJ Offline
      JoeCFD
      wrote on last edited by
      #2

      Does this help?

      CPU_TYPE=NASM(or AS)
      contains(CPU_TYPE, "NASM"){
      }
      else {
      }

      1 Reply Last reply
      0
      • SGaistS Offline
        SGaistS Offline
        SGaist
        Lifetime Qt Champion
        wrote on last edited by
        #3

        Hi and welcome to devnet,

        qmake's QMAKE_HOST.arch might be what you are looking for.

        Interested in AI ? www.idiap.ch
        Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

        P 1 Reply Last reply
        2
        • SGaistS SGaist

          Hi and welcome to devnet,

          qmake's QMAKE_HOST.arch might be what you are looking for.

          P Offline
          P Offline
          Publicnamer
          wrote on last edited by
          #4

          @SGaist That does help yes. Now I have the problem of specifying how to build the .asm files. Is there a way to specify a rule in the .pro for that? Thanks.

          1 Reply Last reply
          0
          • SGaistS Offline
            SGaistS Offline
            SGaist
            Lifetime Qt Champion
            wrote on last edited by
            #5

            You can add a custom compiler like shown here.

            Interested in AI ? www.idiap.ch
            Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

            1 Reply Last reply
            2

            • Login

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