Skip to content

Commit

Permalink
Fixes #74 NO_CUBE_BUILD with reverting to ANDROID_BUILD in baseapi
Browse files Browse the repository at this point in the history
  • Loading branch information
zdenop committed Aug 9, 2015
1 parent 628de5b commit 67ede37
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 10 deletions.
2 changes: 1 addition & 1 deletion android/jni/Android.mk
Expand Up @@ -47,7 +47,7 @@ LOCAL_SRC_FILES := $(LOCAL_SRC_FILES:$(LOCAL_PATH)/%=%)
$(info local src files = $(LOCAL_SRC_FILES))

LOCAL_LDLIBS := -ldl -llog -ljnigraphics
LOCAL_CFLAGS := -DNO_CUBE_BUILD -DGRAPHICS_DISABLED
LOCAL_CFLAGS := -DANDROID_BUILD -DNO_CUBE_BUILD -DGRAPHICS_DISABLED

include $(BUILD_SHARED_LIBRARY)

Expand Down
18 changes: 9 additions & 9 deletions api/baseapi.cpp
Expand Up @@ -792,7 +792,7 @@ int CubeAPITest(Boxa* boxa_blocks, Pixa* pixa_blocks,
ASSERT_HOST(pr_word == word_count);
return 0;
}
#endif
#endif // NO_CUBE_BUILD

/**
* Runs page layout analysis in the mode set by SetPageSegMode.
Expand Down Expand Up @@ -1029,11 +1029,11 @@ bool TessBaseAPI::ProcessPagesMultipageTiff(const l_uint8 *data,
int timeout_millisec,
TessResultRenderer* renderer,
int tessedit_page_number) {
#ifndef NO_CUBE_BUILD
#ifndef ANDROID_BUILD
Pix *pix = NULL;
#ifdef USE_OPENCL
OpenclDevice od;
#endif
#endif // USE_OPENCL
int page = (tessedit_page_number >= 0) ? tessedit_page_number : 0;
for (; ; ++page) {
if (tessedit_page_number >= 0)
Expand All @@ -1043,11 +1043,11 @@ bool TessBaseAPI::ProcessPagesMultipageTiff(const l_uint8 *data,
// FIXME(jbreiden) Not implemented.
pix = od.pixReadMemTiffCl(data, size, page);
} else {
#endif
#endif // USE_OPENCL
pix = pixReadMemTiff(data, size, page);
#ifdef USE_OPENCL
}
#endif
#endif // USE_OPENCL
if (pix == NULL) break;
tprintf("Page %d\n", page + 1);
char page_str[kMaxIntSize];
Expand Down Expand Up @@ -1098,7 +1098,7 @@ bool TessBaseAPI::ProcessPagesInternal(const char* filename,
const char* retry_config,
int timeout_millisec,
TessResultRenderer* renderer) {
#ifndef NO_CUBE_BUILD
#ifndef ANDROID_BUILD
PERF_COUNT_START("ProcessPages")
bool stdInput = !strcmp(filename, "stdin") || !strcmp(filename, "-");
if (stdInput) {
Expand Down Expand Up @@ -1222,10 +1222,10 @@ bool TessBaseAPI::ProcessPage(Pix* pix, int page_index, const char* filename,
failed = Recognize(NULL) < 0;
}
if (tesseract_->tessedit_write_images) {
#ifndef NO_CUBE_BUILD
#ifndef ANDROID_BUILD
Pix* page_pix = GetThresholdedImage();
pixWrite("tessinput.tif", page_pix, IFF_TIFF_G4);
#endif
#endif // ANDROID_BUILD
}
if (failed && retry_config != NULL && retry_config[0] != '\0') {
// Save current config variables before switching modes.
Expand Down Expand Up @@ -2638,7 +2638,7 @@ int TessBaseAPI::NumDawgs() const {
CubeRecoContext *TessBaseAPI::GetCubeRecoContext() const {
return (tesseract_ == NULL) ? NULL : tesseract_->GetCubeRecoContext();
}
#endif
#endif // NO_CUBE_BUILD

/** Escape a char string - remove <>&"' with HTML codes. */
STRING HOcrEscape(const char* text) {
Expand Down

0 comments on commit 67ede37

Please sign in to comment.