I am unable to figure out how to change default build/compile settings. The little default checkbox in the lower left of the project options dialog is gone. The documentation states:
The Default checkbox that appeared at the lower edge of many Project Options pages has been removed from the product. If you want to specify options as the default for multiple projects, the suggested alternative is to use option sets instead.
I'm going round and round about "Options Sets", "Configuration Manager" etc.. Is this even possible? What does "specifying options as the default for multiple projects" mean? If I have multiple projects then that means those projects and their options exists, how can I set a default value to something already set? What about new projects?
That feature really has gone and there is nothing like it any more in the product, to the very best of my knowledge. I think the best you can do is as follows:
Create a new project.
Change the project settings to whatever you want them to be.
Change anything else in the default project that you don't like, for example { Private declarations }.
Add this project to the repository.
use File | New | Customize to move this project template onto the File | New menu for easy access.
Project->Options->Target. You can set up a base configuration, and then provide different options that differ from the base for Debug and Release. You can also create custom option sets, which means that they're different from the standard Debug and Release. You can also have different configurations based on different targets (VCL app's Debug build has different options than a FMX app's Debug build, etc.)
To change the default options first starts with defining "default". You can start as low as the "base configuration" through Project->Options->Delphi Compiler, and then choosing the All Configuration target. You can refine it somewhat by altering the base configuration for the Debug and Release configurations. You can also define your own option sets, using the Save button next to the Target list.
Your specific question about "specifying options as the default for multiple projects" means is the base configuration. From there, you refine those base options to give you debug settings and release settings (which can also be saved as your initial defaults, and refined on a per-project basis).
So, for a specific answer, you can change the default by modifying the base configuration, or by getting more specific by modifying the debug or release configurations that inherit from that base, depending on what your end result needs to be and what you're trying to accomplish.
Related
When debugging Bazel BUILD files, it can be useful to know what values the system has on by default or has determined from the host/target setup (eg. debugging select rules).
Is there a way, either through a query or directly in the BUILD file, to view platform and other configuration values (eg. cpu, os, etc)?
Is it also possible to produce a list of all of these variables? With many different configuration options available, it's easy to lose track of what's there and what they may be set to(eg. crosstool_top, host_crosstool_top, etc).
Not a perfect answer, but adding the --toolchain_resolution_debug flag to the command line gives some visibility into a couple of these values.
https://docs.bazel.build/versions/master/command-line-reference.html#flag--toolchain_resolution_debug
I got two build definition that is mapped to some common folders. When I do check in it prompts me the selection box to pick up either of the build definition.
It gives me the option. Can I change my build definition to select the default based on what is triggered and show it as the first option without need for user to select the right one?
If you have two build definitions configured for the same source control folder then you will always get a choice. There is no way to set a default.
It is recommended to have only one gated-checkin configured to avoid confusion.
I've spent a couple of days exploring option sets (again) in XE3. They look really clever but either they are (still) broken or its me. What I wanted to do was to create a common option set file for a bunch of projects, say CommonOptions.optset. This is easy to create and edit using the View | Configuration Manager item. In this options set file I put a set of relative search paths such as:
..\..\source1;..\..\source2;
etc. These paths are proven to work when entered into the DEBUG or BASE build configuration directly. When I use the Configuration Manager to apply this common option set as a reference, the paths do not work. If I repeat the application using 'Modify Values' it works fine. To be sure, I deleted the DPROJ (and all the .local stuff too) and let Delphi recreate the DPROJ before applying the option set file as reference again. Still no luck.
I have several libraries with 10's of DPROJ's all of different vintages so I really do need a common way of specifying compiler options, don't include version info etc.
Has anyone got this reference thing to work?
Referenced option sets are implemented as plain MSBuild imports. Therefore, all relative paths are relative to the importing project file. You can think of option sets as build configurations from which build configurations in referencing project files may inherit.
I have a complex project group that has about 10 "final" build configurations configured in a tree, where each node has its own option set. Something like this:
Base
Release
Release Generic 1
Release Final 1
...
Release final 5
Release Generic 2
Release Final 6
...
Debug
same as release, but for debug
so, all base, Release, Release Generic X, Release Final Y have their own option set saved in files and added as reference. So you will have
base.optset
Release.optset
Release Generic 1.optset
Release Final 1.optset
..
The main differences between these option sets are various compiler defines enabling/disabling certain features that are organized in the tree mentioned above (hence the build targets and the option sets) and obviously search paths that include the needed stuff.
So each option set also contains different search paths that depend on the respective build configuration.
There are over 100 projects in the project group and most of them relate to one another on different level of configurations, so there are also a bunch of Build Groups, but this is irrelevant for the question as right now I'm trying to build the projects one at a time.
The problem is that every option set is configuring the search path. Up to and including "Release Generic 1.optset" the search path is correctly updated and used. However, the "Release Final 1" and siblings don't get the search paths introduced by "Release Final 1.optset". (I know this because I looked at the compiler messages and checked the parameters passed to dcc32) It appears like the option set is ignored.
Everything is configured with "inherit=true" in the option set.
There is nothing specific in the build configurations, nowhere. Every project uses the configuration in the IDE and option set files only.
Is this issue/limitation documented anywhere/known about? Is there a workaround? Other than applying the option set as value and not by reference.
Thanks.
later edit:
I decided to implement a pretty ugly workaround in order to get moving: basically, replicate teh configuration from "Release Generic 1.optset" into each "Release Final ?.optset"
this has the major disadvantage of having to edit 5 option set files propagating the same modification, when in need of adding something to "Release Generic 1.optset"
Finally I managed to figure out the problem. It's actually a bug in the Delphi IDE in that it messes up the imports in the dproj file.
Specifically, if an optionset is added once, it will not be maintained with the necessary import condition for the rest of the configs.
This usually happens when you add/delete a configuration, the dproj gets busted and optset files no longer get imported for all the configs.
But once your configs are stable and you no longer change them, the dproj remains stable.
I mocked up an application to validate dproj files against these issues, verifying that each config has its optset files in an import directive. I'm yet to make it auto-correct this, as I'm rather busy. But once I manage to find the time, or if there are more people affected by it and require an automatic fix, I'll try to make a release.
Until then, if you noticed the option set is not applied for a specific config, simply find the configs id in dproj (something like Cfg_10 ) and see if you can find an
<Import Condition="'$(Cfg_10)'!='' And Exists('optset file path name')" Project="optio file path name"/>
if not, then add it after the other <import calls
Every time I create a new project in Delphi 2009, it loads up two sets of build settings: Debug and Release. Problem is, the Debug settings are all wrong. It has optimizations on, which makes the debugger lose local variables, and Debug DCUs off, which keeps me from tracing into the VCL.
Is there any way to edit the original template so I don't have to keep changing those two settings every time I create a new project?
Set up the Debug configuration you want using Project|Options, and then check the "Default" button at the lower left of that dialog before saving your changes. That makes those settings the default ones for all new projects.
Note that checking the Default button will not affect existing projects; it only affects new projects you create from that point on.