Specifying different compiler flags on individual files

Sysprogs forums Forums VisualGDB Specifying different compiler flags on individual files

Viewing 8 posts - 1 through 8 (of 8 total)
  • Author
    Posts
  • #11413
    jmkresse
    Participant

    How can I specify different compiler flags on individual files in a VisualGDB project? For example, I want to be able to specify different optimization levels on individual files.

    #11414
    support
    Keymaster

    Hi,

    Please ensure you are using the MSBuild subsystem (not GNU Make). Then you can use the regular VS properties for individual files or groups of files to edit various settings.

    #11417
    jmkresse
    Participant

    Sorry, for compatibility reasons, I have to use GNU Make, not MSBuild.

    #11418
    support
    Keymaster

    Hi,

    Sorry, this is not supported for GNU Make. You can try hacking the Makefile at your own risk to achieve that, but we generally recommend switching to MSBuild as it provides a straight-forward way for defining per-file arguments.

    #11419
    jmkresse
    Participant

    I was afraid of that; but, again, that’s not possible for me.

    As a workaround, is it possible to have one project dependent on another one?

     

    #11420
    support
    Keymaster

    Hi,

    Yes, you can use the regular project dependencies/references window in Visual Studio.

    BTW, is there any special reason why you cannot use MSBuild? It provides most of the functionality that GNU Make does.

    #11423
    jmkresse
    Participant

    Thanks! So if I have one project dependent on another, if I build the “upper” project, it will automatically build the “lower” project, if it is out of date?

    And we need to stick to using GNU Make because we may eventually also do these builds on a different platform which only has GNU Make available.

    #11430
    support
    Keymaster

    Hi,

    Yes, but only if you are using Visual Studio to build the projects and both projects are included in the .sln file and selected for build.

    BTW, if you are planning to do remote builds, the VisualGDB MSBuild backend actually generates temporary Makefiles (this reduces latency compared to running each compiler instance separately from the Windows side), so you can copy them manually to your Linux target and build them without VisualGDB as well. This only applies for remotely build projects though.

Viewing 8 posts - 1 through 8 (of 8 total)
  • You must be logged in to reply to this topic.