Skip to content

Commit

Permalink
[sw] Bump minimal C++ standard to C++17.
Browse files Browse the repository at this point in the history
  • Loading branch information
egorpugin committed Dec 26, 2020
1 parent c3e04ab commit b09fa9b
Showing 1 changed file with 9 additions and 7 deletions.
16 changes: 9 additions & 7 deletions sw.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,16 @@ void build(Solution &s)
auto &tess = s.addProject("google.tesseract", "master");
tess += Git("https://github.com/tesseract-ocr/tesseract", "", "{v}");

auto cppstd = cpp17;

auto &libtesseract = tess.addTarget<LibraryTarget>("libtesseract");
{
libtesseract.setChecks("libtesseract");

libtesseract.ExportAllSymbols = true;
libtesseract.PackageDefinitions = true;

libtesseract += cpp14;
libtesseract += cppstd;

libtesseract += "include/.*"_rr;
libtesseract += "src/.*"_rr;
Expand Down Expand Up @@ -102,19 +104,19 @@ void build(Solution &s)

//
auto &tesseract = tess.addExecutable("tesseract");
tesseract += cpp14;
tesseract += cppstd;
tesseract += "src/api/tesseractmain.cpp";
tesseract += libtesseract;

//
auto &tessopt = tess.addStaticLibrary("tessopt");
tessopt += cpp14;
tessopt += cppstd;
tessopt += "src/training/tessopt.*"_rr;
tessopt.Public += libtesseract;

//
auto &common_training = tess.addStaticLibrary("common_training");
common_training += cpp14;
common_training += cppstd;
common_training +=
"src/training/commandlineflags.cpp",
"src/training/commandlineflags.h",
Expand All @@ -140,7 +142,7 @@ void build(Solution &s)

//
auto &unicharset_training = tess.addStaticLibrary("unicharset_training");
unicharset_training += cpp14;
unicharset_training += cppstd;
unicharset_training +=
"src/training/fileio.*"_rr,
"src/training/icuerrorcode.*"_rr,
Expand All @@ -157,7 +159,7 @@ void build(Solution &s)
//
#define ADD_EXE(n, ...) \
auto &n = tess.addExecutable(#n); \
n += cpp14; \
n += cppstd; \
n += "src/training/" #n ".*"_rr; \
n.Public += __VA_ARGS__; \
n
Expand All @@ -177,7 +179,7 @@ void build(Solution &s)
ADD_EXE(set_unicharset_properties, unicharset_training);

ADD_EXE(text2image, unicharset_training);
text2image += cpp14;
text2image += cppstd;
text2image +=
"src/training/boxchar.cpp",
"src/training/boxchar.h",
Expand Down

0 comments on commit b09fa9b

Please sign in to comment.