From 7b34f0fa5d060409be1fb5165ef29e5a159b1e33 Mon Sep 17 00:00:00 2001 From: Richard Levitte Date: Fri, 2 Nov 2018 13:08:38 +0100 Subject: [PATCH] Build: Make it possible to have defines assigned to end products as well This simple fix allows the following construct: PROGRAMS=foo SOURCE[foo]=foo.c bar.c DEFINE[foo]=FOO=1 BAR=0 These will trickle down to the build of object files, so building foo.o and bar.o will be done with these options: -DFOO=1 -DBAR=0 (exact syntax depending on platform, of course) Reviewed-by: Paul Dale (Merged from https://github.com/openssl/openssl/pull/7553) --- Configurations/common.tmpl | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/Configurations/common.tmpl b/Configurations/common.tmpl index b7d2a0777e..bf440d9d88 100644 --- a/Configurations/common.tmpl +++ b/Configurations/common.tmpl @@ -85,7 +85,8 @@ deps => $unified_info{depends}->{$src}, incs => [ @{$unified_info{includes}->{$obj}}, @{$unified_info{includes}->{$bin}} ], - defs => $unified_info{defines}->{$obj}, + defs => [ @{$unified_info{defines}->{$obj}}, + @{$unified_info{defines}->{$bin}} ], %opts); foreach (@{$unified_info{depends}->{$src}}) { dogenerate($_, $obj, $bin, %opts); @@ -108,7 +109,8 @@ deps => $unified_info{depends}->{$obj}, incs => [ @{$unified_info{includes}->{$obj}}, @{$unified_info{includes}->{$bin}} ], - defs => $unified_info{defines}->{$obj}, + defs => [ @{$unified_info{defines}->{$obj}}, + @{$unified_info{defines}->{$bin}} ], %opts); foreach ((@{$unified_info{sources}->{$obj}}, @{$unified_info{depends}->{$obj}})) { -- 2.25.1