Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

meson updates #2560

Merged
merged 4 commits into from
Mar 25, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
51 changes: 49 additions & 2 deletions meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,6 @@ cdata.set('PROJECT_VERSION', '@0@.@1@'.format(meson.project_version(), cdata.get
cdata.set('EXV_PACKAGE_VERSION', '@0@.@1@'.format(meson.project_version(), cdata.get('PROJECT_VERSION_TWEAK')))
cdata.set('EXV_PACKAGE_STRING', '@0@ @1@'.format(meson.project_name(), cdata.get('PROJECT_VERSION')))

cdata.set('EXV_HAVE_MMAP', cpp.has_function('mmap'))
cdata.set('EXV_HAVE_MUNMAP', cpp.has_function('munmap'))
cdata.set('EXV_HAVE_STRERROR_R', cpp.has_function('strerror_r'))
cdata.set('EXV_STRERROR_R_CHAR_P', not cpp.compiles('#include <string.h>\nint strerror_r(int,char*,size_t);int main(){}'))

Expand Down Expand Up @@ -341,4 +339,53 @@ executable(
install: true,
)

samples = {
'addmoddel': [],
'conntest': curl_dep,
'convert-test': [],
'easyaccess-test': [],
'exifcomment': [],
'exifdata-test': [],
'exifdata': [],
'exifprint': [],
'exifvalue': [],
'geotag': expat_dep,
'ini-test': inih_dep,
'iotest': [],
'iptceasy': [],
'iptcprint': [],
'iptctest': [],
'key-test': [],
'largeiptc-test': [],
'mmap-test': [],
'mrwthumb': [],
'prevtest': [],
'remotetest': [],
'stringto-test': [],
'taglist': [],
'tiff-test': [],
'write-test': [],
'write2-test': [],
'xmpparse': [],
'xmpparser-test': [],
'xmpprint': [],
'xmpsample': [],
'xmpdump': [],
}

foreach s, d : samples
executable(s, 'samples/@[email protected]'.format(s), dependencies: [exiv2_dep, d], include_directories: exiv2inc)
endforeach

gopt = [
'getopt-test',
'metacopy',
'path-test',
]

ginc = include_directories('app')
foreach g : gopt
executable(g, 'samples/@[email protected]'.format(g), 'app/getopt.cpp', dependencies: exiv2_dep, include_directories: [exiv2inc, ginc])
endforeach

subdir('unitTests')
11 changes: 9 additions & 2 deletions samples/geotag.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,16 @@
#include <sys/types.h>

#include <algorithm>
#include <filesystem>
#include <iostream>

#if __has_include(<filesystem>)
#include <filesystem>
namespace fs = std::filesystem;
#else
#include <experimental/filesystem>
namespace fs = std::experimental::filesystem;
#endif

using namespace std;

#ifdef _WIN32
Expand Down Expand Up @@ -795,7 +802,7 @@ int main(int argc, const char* argv[]) {
printf("%s %s ", arg, types[type]);
if (type == typeImage) {
time_t t = readImageTime(std::string(arg));
auto p = std::filesystem::absolute(std::filesystem::path(arg));
auto p = fs::absolute(fs::path(arg));
std::string path = p.string();
if (t && !path.empty()) {
if (options.verbose)
Expand Down
3 changes: 2 additions & 1 deletion tests/runner.py
100644 → 100755
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#!/usr/bin/env python3
# -*- coding: utf-8 -*-

import argparse
Expand Down Expand Up @@ -64,7 +65,7 @@ def shouldIncludeMethod(attrname):

args = parser.parse_args()
if 'VERBOSE' in os.environ:
args.verbose = 2
args.verbose = 2
conf_file = args.config_file[0]
DEFAULT_ROOT = os.path.abspath(os.path.dirname(conf_file))
system_tests.set_debug_mode(args.debug)
Expand Down