Add switch to determine if we are in strict mode.

This commit is contained in:
Gregory John Casamento 2021-08-15 04:27:25 -04:00
parent 82d4d12f82
commit cbd52e03a3
9 changed files with 30 additions and 8 deletions

View file

@ -1,6 +1,6 @@
2021-08-11 Gregory John Casamento <greg.casamento@gmail.com> 2021-08-11 Gregory John Casamento <greg.casamento@gmail.com>
* Framework/PCProjectBuilder.m: Fix issue where environment var * Framework/PCProjectBuilder.m: Quick Fix issue where environment var
was causing build to fail. Explicitly set environment for NSTask was causing build to fail. Explicitly set environment for NSTask
for build to prevent this problem. for build to prevent this problem.

View file

@ -19,7 +19,8 @@
optionsPanel, optionsPanel,
stripButton, stripButton,
sharedLibsButton, sharedLibsButton,
targetPopup targetPopup,
strictButton
); );
Super = NSObject; Super = NSObject;
}; };

View file

@ -366,6 +366,15 @@
verboseBuilding = NO; verboseBuilding = NO;
} }
if ([[projectDict objectForKey:PCBuilderStrict] isEqualToString:@"YES"])
{
strictBuilding = YES;
}
else
{
strictBuilding = NO;
}
return args; return args;
} }
@ -598,14 +607,17 @@
NSMutableDictionary *env = [[NSMutableDictionary alloc] init]; NSMutableDictionary *env = [[NSMutableDictionary alloc] init];
// optionally copy in existing environment first:
// (we could also copy values for a limited set of specific keys, if we wanted.)
[env addEntriesFromDictionary:[[NSProcessInfo processInfo] environment]]; [env addEntriesFromDictionary:[[NSProcessInfo processInfo] environment]];
// then add/remove anything else we might want: if (strictBuilding == NO)
[env removeObjectForKey:@"GNUSTEP_USER_ROOT"]; {
[env setObject: @"no" forKey:@"GNUSTEP_MAKE_STRICT_V2_MODE"];
}
else
{
[env setObject: @"yes" forKey:@"GNUSTEP_MAKE_STRICT_V2_MODE"];
}
makeTask = [[NSTask alloc] init]; makeTask = [[NSTask alloc] init];
// now set the task up to use this newly-built environment:
[makeTask setEnvironment:env]; [makeTask setEnvironment:env];
[makeTask setArguments:buildArgs]; [makeTask setArguments:buildArgs];
[makeTask setCurrentDirectoryPath:[project projectPath]]; [makeTask setCurrentDirectoryPath:[project projectPath]];

View file

@ -86,6 +86,7 @@
[debugButton setRefusesFirstResponder:YES]; [debugButton setRefusesFirstResponder:YES];
[stripButton setRefusesFirstResponder:YES]; [stripButton setRefusesFirstResponder:YES];
[sharedLibsButton setRefusesFirstResponder:YES]; [sharedLibsButton setRefusesFirstResponder:YES];
[strictButton setRefusesFirstResponder:YES];
[self loadProjectProperties:nil]; [self loadProjectProperties:nil];
} }
@ -161,6 +162,8 @@
key = PCBuilderStrip; key = PCBuilderStrip;
if (sender == sharedLibsButton) if (sender == sharedLibsButton)
key = PCBuilderSharedLibs; key = PCBuilderSharedLibs;
if (sender == strictButton)
key = PCBuilderStrict;
[project setProjectDictObject:value forKey:key notify:NO]; [project setProjectDictObject:value forKey:key notify:NO];
} }
@ -191,6 +194,9 @@
[self _setStateForButton:sharedLibsButton [self _setStateForButton:sharedLibsButton
key:PCBuilderSharedLibs key:PCBuilderSharedLibs
defaultState:NSOnState]; defaultState:NSOnState];
[self _setStateForButton:strictButton
key:PCBuilderStrict
defaultState:NSOffState];
} }
@end @end

View file

@ -171,6 +171,7 @@ static NSString * const PCBuilderDebug = @"BUILDER_DEBUG";
static NSString * const PCBuilderStrip = @"BUILDER_STRIP"; static NSString * const PCBuilderStrip = @"BUILDER_STRIP";
static NSString * const PCBuilderVerbose = @"BUILDER_VERBOSE"; static NSString * const PCBuilderVerbose = @"BUILDER_VERBOSE";
static NSString * const PCBuilderSharedLibs = @"BUILDER_SHARED_LIBS"; static NSString * const PCBuilderSharedLibs = @"BUILDER_SHARED_LIBS";
static NSString * const PCBuilderStrict = @"BUILDER_STRICT";
// Application specific // Application specific
static NSString * const PCAppIcon = @"APPLICATIONICON"; static NSString * const PCAppIcon = @"APPLICATIONICON";

View file

@ -55,7 +55,8 @@ typedef enum _ErrorLevel {
// Options panel // Options panel
BOOL verboseBuilding; BOOL verboseBuilding;
BOOL strictBuilding;
NSString *buildStatus; NSString *buildStatus;
NSMutableString *buildStatusTarget; NSMutableString *buildStatusTarget;
NSMutableString *buildTarget; NSMutableString *buildTarget;

View file

@ -39,6 +39,7 @@
NSButton *debugButton; // debug=no NSButton *debugButton; // debug=no
NSButton *stripButton; // strip=yes NSButton *stripButton; // strip=yes
NSButton *sharedLibsButton; // shared=no NSButton *sharedLibsButton; // shared=no
NSButton *strictButton; // GNUSTEP_MAKE_STRICT_V2_MODE yes/no
} }
- (id)initWithProject:(PCProject *)aProject delegate:(id)aDelegate; - (id)initWithProject:(PCProject *)aProject delegate:(id)aDelegate;