This is no longer an issue once this behavior is understood. Running 'tup init' after removing .tup to takes the current PATH value.
On Windows, If the PATH is set before 'tup init', it seems to find the right version of tools after that. If the PATH is set after 'tup init', it doesn't seem to find the right version of tools. Tup may be storing PATH in the database. I do have to mention that i run with '-no-environ-check' after 'tup init'. It may be a side effect of not checking the environment. On Wednesday, March 29, 2023 at 11:28:18 PM UTC-4 Bitkicker wrote: > I am using different environment variables for each compiler in my bash > profile. I then import the respective variable in the respective tup > variant and assign it to a variable I call COMPILER. That $(COMPILER) > variable is then used in the rule. This way, each variant can create > complete custom setups, including compiler options, etc. for each platform > I am building. > > So, for example, for OSX, it will look like this... > ifdef OSX > import PROJECT_OSX_COMPILER=gcc > > COMPILER = $(PROJECT_OSX_COMPILER) > > CFLAGS += -fdiagnostics-color=always > CFLAGS += -mmacosx-version-min=10.13 > endif > > For Windows, for example, it will then look like this > ifdef WIN32 > import PROJECT_WIN32_COMPILER=clang > import PROJECT_WIN32_SYSTEM_INCLUDE > > COMPILER = $(PROJECT_WIN32_COMPILER) > OUTNAME = libogg.lib > > CFLAGS += -target x86_64-pc-win32 > CFLAGS += -fdeclspec > CFLAGS += -D_CRT_SECURE_NO_WARNINGS > CFLAGS += -D_CRT_NONSTDC_NO_DEPRECATE > CFLAGS += -DWIN32_LEAN_AND_MEAN > > CFLAGS += -isystem "$(PROJECT_WIN32_SYSTEM_INCLUDE)" > endif > > and so on... > > This is not exactly what you're asking but, perhaps, it will give you an > idea for a different approach. > > Guido > > On Tuesday, November 1, 2022 at 8:11:31 AM UTC-7 Satish K wrote: > > Hello, > > I have several projects using different versions of the same compiler. > Since Tup takes the PATH from system environment on windows, it will find > the first one in the PATH that matches the name and uses it. I know that I > can use different system environment variables specific to compiler version > to get around this behavior. > > However, we have a simple practice of using batch files to set the Path > before executing makefile. Is it possible to use batch files to set the > compiler path before invoking Tup ? > > Thanks, > Satish K > > -- -- tup-users mailing list email: [email protected] unsubscribe: [email protected] options: http://groups.google.com/group/tup-users?hl=en --- You received this message because you are subscribed to the Google Groups "tup-users" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/tup-users/0fd6c69c-a347-4bf9-9997-d96ad53d27bbn%40googlegroups.com.
