From 5afe22030f7a79773595e7f2792562133bd74f3e Mon Sep 17 00:00:00 2001 From: Artem Pavlenko Date: Fri, 19 Mar 2021 16:37:21 +0000 Subject: [PATCH] Fix `proj_version` on macOS --- SConstruct | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/SConstruct b/SConstruct index 9d3fe10d7..e8fe2d84e 100644 --- a/SConstruct +++ b/SConstruct @@ -923,20 +923,17 @@ def CheckGdalData(context, silent=False): def proj_version(context): context.Message('Checking for Proj version >=%s...' % PROJ_MIN_VERSION_STRING) ret, out = context.TryRun(""" -#include -#include +#include "proj.h" +#include #define PROJ_VERSION_ATLEAST(major,minor,micro) \ ((major)*10000+(minor)*100+(micro) <= \ PROJ_VERSION_MAJOR*10000+PROJ_VERSION_MINOR*100+PROJ_VERSION_PATCH) int main() { - std::cout << PROJ_VERSION_ATLEAST(%s, %s, %s) << ";" - << PROJ_VERSION_MAJOR << "." - << PROJ_VERSION_MINOR << "." - << PROJ_VERSION_PATCH; + printf("%d;%d.%d.%d", PROJ_VERSION_ATLEAST{min-version}, PROJ_VERSION_MAJOR, PROJ_VERSION_MINOR, PROJ_VERSION_PATCH); return 0; } -""" % PROJ_MIN_VERSION,'.cpp') +""".replace("{min-version}", str(PROJ_MIN_VERSION)),'.c') if not ret: context.Result('error (could not get version from proj.h)') else: