diff options
author | Boris Kolpackov <boris@codesynthesis.com> | 2019-08-28 14:43:38 +0200 |
---|---|---|
committer | Boris Kolpackov <boris@codesynthesis.com> | 2019-08-28 14:43:38 +0200 |
commit | 995585489750512a28f84b028b3eea30c3a9c075 (patch) | |
tree | c8f57bd54d42daa39539c4b46a8c635ff63ddb5d /libbuild2 | |
parent | d0842f4a05ac691dc296347ff872eb7a9b83b42d (diff) |
Reduce repetition in buildfiles
Diffstat (limited to 'libbuild2')
-rw-r--r-- | libbuild2/buildfile | 7 | ||||
-rw-r--r-- | libbuild2/c/buildfile | 7 | ||||
-rw-r--r-- | libbuild2/cxx/buildfile | 7 |
3 files changed, 4 insertions, 17 deletions
diff --git a/libbuild2/buildfile b/libbuild2/buildfile index 8d40c28..feabdab 100644 --- a/libbuild2/buildfile +++ b/libbuild2/buildfile @@ -77,7 +77,7 @@ objs{*}: cxx.poptions += -DLIBBUILD2_SHARED_BUILD # used as the build system import path (unless cross-compiling and not # forgetting to escape backslashes on Windows). # -obj{context}: cxx.poptions += "-DBUILD2_HOST_TRIPLET=\"$cxx.target\"" +{obja objs}{context}: cxx.poptions += "-DBUILD2_HOST_TRIPLET=\"$cxx.target\"" # Note that we used to compare complete target triplets but that proved too # strict. For example, we may be running on x86_64-apple-darwin17.7.0 while @@ -87,12 +87,9 @@ cross = ($cxx.target.cpu != $build.host.cpu || \ $cxx.target.system != $build.host.system) if! $cross - obj{context}: cxx.poptions += \ + {obja objs}{context}: cxx.poptions += \ -DBUILD2_IMPORT_PATH=\"$regex.replace($out_root, '\\', '\\\\')\" -obja{context}: cxx.poptions += -DLIBBUILD2_STATIC_BUILD -objs{context}: cxx.poptions += -DLIBBUILD2_SHARED_BUILD - if ($cxx.target.class != 'windows') { cxx.libs += -lpthread diff --git a/libbuild2/c/buildfile b/libbuild2/c/buildfile index 39a5d7a..234a0d7 100644 --- a/libbuild2/c/buildfile +++ b/libbuild2/c/buildfile @@ -45,14 +45,9 @@ cross = ($cxx.target.cpu != $build.host.cpu || \ # Windows). It is used as defaults for BUILD2_DEFAULT_C. # if! $cross -{ - obj{init}: cxx.poptions += \ + {obja objs}{init}: cxx.poptions += \ -DBUILD2_NATIVE_C=\"$regex.replace($recall($c.path), '\\', '\\\\')\" - obja{init}: cxx.poptions += -DLIBBUILD2_C_STATIC_BUILD - objs{init}: cxx.poptions += -DLIBBUILD2_C_SHARED_BUILD -} - # Export options. # lib{build2-c}: diff --git a/libbuild2/cxx/buildfile b/libbuild2/cxx/buildfile index debb574..f7bd126 100644 --- a/libbuild2/cxx/buildfile +++ b/libbuild2/cxx/buildfile @@ -45,14 +45,9 @@ cross = ($cxx.target.cpu != $build.host.cpu || \ # Windows). It is used as defaults for BUILD2_DEFAULT_CXX. # if! $cross -{ - obj{init}: cxx.poptions += \ + {obja objs}{init}: cxx.poptions += \ -DBUILD2_NATIVE_CXX=\"$regex.replace($recall($cxx.path), '\\', '\\\\')\" - obja{init}: cxx.poptions += -DLIBBUILD2_CXX_STATIC_BUILD - objs{init}: cxx.poptions += -DLIBBUILD2_CXX_SHARED_BUILD -} - # Export options. # lib{build2-cxx}: |