Verified Commit 9658d578 authored by Camil Staps's avatar Camil Staps
Browse files

Add options -Pw, -Pd, -Psa, -Pou, -Pfusion, and -Pgeneric_fusion to lift the...

Add options -Pw, -Pd, -Psa, -Pou, -Pfusion, and -Pgeneric_fusion to lift the corresponding options without P to project options

For example, when using -Pfusion -fusion, all project files are compiled
with fusion enabled, and recompiled if necessary (instead of only the
main module).

There are no -Pn options (e.g. -Pnfusion): instead, -Pfusion -nfusion
will lift -nfusion to the project option level.
parent 3443e9b6
Pipeline #49205 passed with stage
in 9 seconds
......@@ -202,6 +202,7 @@ extern char *getenv();
static int clean_options=DEFAULT_OPTIONS;
static int clean_options_mask=0;
static int clean_project_options_mask=0;
static int remove_symbol_table;
static int list_strict_export_types=0,funcmayfail_warning_or_error=0,nowarn=0;
......@@ -1277,7 +1278,16 @@ static int project_node_is_abc_up_to_date (P_NODE project_node)
close_abc_file();
return 0;
}
}
if (((DEBUG_MASK | STRICTNESS_ANALYSIS_MASK | FUSION_MASK | GENERIC_FUSION_MASK | NO_REUSE_UNIQUE_NODES_MASK) & clean_options_mask & clean_project_options_mask & (clean_options ^ abc_options))!=0)
{
if (verbose)
warning_s ("(%s.icl is compiled with different options)", project_node->pro_fname);
close_abc_file();
return 0;
}
{
enum dependency_type dependency_type;
......@@ -2061,17 +2071,17 @@ static int compile_project_node (P_NODE project_node)
options=(options & ~clean_options_mask)
| (clean_options & clean_options_mask);
if (nowarn || ((options & WARNING_MASK)!=0)!=DEFAULT_WARNING)
if (nowarn || (((clean_project_options_mask & WARNING_MASK ? clean_options : options) & WARNING_MASK)!=0)!=DEFAULT_WARNING)
*arg++="-w";
if (((options & DEBUG_MASK)!=0)!=DEFAULT_DEBUG)
if ((((clean_project_options_mask & DEBUG_MASK ? clean_options : options) & DEBUG_MASK)!=0)!=DEFAULT_DEBUG)
*arg++="-d";
if (((options & STRICTNESS_ANALYSIS_MASK)!=0)!=DEFAULT_STRICTNESS_ANALYSIS)
if ((((clean_project_options_mask & STRICTNESS_ANALYSIS_MASK ? clean_options : options) & STRICTNESS_ANALYSIS_MASK)!=0)!=DEFAULT_STRICTNESS_ANALYSIS)
*arg++="-sa";
if ((options & NO_REUSE_UNIQUE_NODES_MASK)==0)
if (((clean_project_options_mask & NO_REUSE_UNIQUE_NODES_MASK ? clean_options : options) & NO_REUSE_UNIQUE_NODES_MASK)==0)
*arg++="-ou";
if ((options & FUSION_MASK)!=0)
if (((clean_project_options_mask & FUSION_MASK ? clean_options : options) & FUSION_MASK)!=0)
*arg++="-fusion";
if ((options & GENERIC_FUSION_MASK)!=0)
if (((clean_project_options_mask & GENERIC_FUSION_MASK ? clean_options : options) & GENERIC_FUSION_MASK)!=0)
*arg++="-generic_fusion";
if (list_strict_export_types)
......@@ -4316,6 +4326,7 @@ static void read_shared_library (char *shared_script_name)
#define option_on(mask) clean_options|=(mask); clean_options_mask|=(mask);
#define option_off(mask) clean_options&=~(mask); clean_options_mask|=(mask);
#define option_is_for_project(mask) clean_project_options_mask|=(mask);
#ifdef __MWERKS__
# include <SIOUX.h>
......@@ -4554,14 +4565,20 @@ int main (int argc,char **argv)
option_on (WARNING_MASK);
} else if (!strcmp (s,"nw")){
option_off (WARNING_MASK);
} else if (!strcmp (s,"Pw")){
option_is_for_project (WARNING_MASK);
} else if (!strcmp (s,"d")){
option_on (DEBUG_MASK);
} else if (!strcmp (s,"nd")){
option_off (DEBUG_MASK);
} else if (!strcmp (s,"Pd")){
option_is_for_project (DEBUG_MASK);
} else if (!strcmp (s,"sa")){
option_on (STRICTNESS_ANALYSIS_MASK);
} else if (!strcmp (s,"nsa")){
option_off (STRICTNESS_ANALYSIS_MASK);
} else if (!strcmp (s,"Psa")){
option_is_for_project (STRICTNESS_ANALYSIS_MASK);
} else if (!strcmp (s,"lt")){
option_on (LIST_TYPES_MASK);
} else if (!strcmp (s,"nlt")){
......@@ -4576,6 +4593,8 @@ int main (int argc,char **argv)
option_off (NO_REUSE_UNIQUE_NODES_MASK);
} else if (!strcmp (s,"nou")){
option_on (NO_REUSE_UNIQUE_NODES_MASK);
} else if (!strcmp (s,"Pou")){
option_is_for_project (NO_REUSE_UNIQUE_NODES_MASK);
/*
} else if (!strcmp (s,"pm")){
option_on (MEMORY_PROFILE);
......@@ -4601,10 +4620,14 @@ int main (int argc,char **argv)
option_on (FUSION_MASK);
} else if (!strcmp (s,"nfusion")){
option_off (FUSION_MASK);
} else if (!strcmp (s,"Pfusion")){
option_is_for_project (FUSION_MASK);
} else if (!strcmp (s,"generic_fusion")){
option_on (GENERIC_FUSION_MASK);
} else if (!strcmp (s,"ngeneric_fusion")){
option_off (GENERIC_FUSION_MASK);
} else if (!strcmp (s,"Pgeneric_fusion")){
option_is_for_project (GENERIC_FUSION_MASK);
} else if (!strcmp (s,"dynamics")){
dynamics=1;
} else if (!strcmp (s,"clc")){
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment