forked from Mirrors/flatpak-builder
builder: Move CFLAGS/CXXFLAGS handling into BuilderOptions
parent
e233705379
commit
c07b1807d1
|
@ -759,7 +759,6 @@ builder_module_build (BuilderModule *self,
|
|||
int i;
|
||||
g_auto(GStrv) env = NULL;
|
||||
g_auto(GStrv) build_args = NULL;
|
||||
const char *cflags, *cxxflags;
|
||||
g_autoptr(GFile) source_dir = NULL;
|
||||
g_autoptr(GFile) source_subdir = NULL;
|
||||
const char *source_subdir_relative = NULL;
|
||||
|
@ -832,14 +831,6 @@ builder_module_build (BuilderModule *self,
|
|||
env = builder_options_get_env (self->build_options, context);
|
||||
build_args = builder_options_get_build_args (self->build_options, context);
|
||||
|
||||
cflags = builder_options_get_cflags (self->build_options, context);
|
||||
if (cflags)
|
||||
env = g_environ_setenv (env, "CFLAGS", cflags, TRUE);
|
||||
|
||||
cxxflags = builder_options_get_cxxflags (self->build_options, context);
|
||||
if (cxxflags)
|
||||
env = g_environ_setenv (env, "CXXFLAGS", cxxflags, TRUE);
|
||||
|
||||
if (self->cmake)
|
||||
{
|
||||
cmake_file = g_file_get_child (source_subdir, "CMakeLists.txt");
|
||||
|
|
|
@ -550,6 +550,7 @@ builder_options_get_env (BuilderOptions *self, BuilderContext *context)
|
|||
GList *l;
|
||||
int i;
|
||||
char **envp = NULL;
|
||||
const char *cflags, *cxxflags;
|
||||
|
||||
for (l = options; l != NULL; l = l->next)
|
||||
{
|
||||
|
@ -577,7 +578,17 @@ builder_options_get_env (BuilderOptions *self, BuilderContext *context)
|
|||
}
|
||||
}
|
||||
|
||||
return builder_context_extend_env (context, envp);
|
||||
envp = builder_context_extend_env (context, envp);
|
||||
|
||||
cflags = builder_options_get_cflags (self, context);
|
||||
if (cflags)
|
||||
envp = g_environ_setenv (envp, "CFLAGS", cflags, TRUE);
|
||||
|
||||
cxxflags = builder_options_get_cxxflags (self, context);
|
||||
if (cxxflags)
|
||||
envp = g_environ_setenv (envp, "CXXFLAGS", cxxflags, TRUE);
|
||||
|
||||
return envp;
|
||||
}
|
||||
|
||||
char **
|
||||
|
|
Loading…
Reference in New Issue