Skip to content

Commit

Permalink
Separate Go files to control platform-specific Cgo flags
Browse files Browse the repository at this point in the history
  • Loading branch information
otiai10 committed Dec 4, 2022
1 parent 9be0318 commit 060b832
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 7 deletions.
7 changes: 0 additions & 7 deletions client.go
Original file line number Diff line number Diff line change
@@ -1,12 +1,5 @@
package gosseract

// #if __FreeBSD__ >= 10
// #cgo LDFLAGS: -L/usr/local/lib -llept -ltesseract -fopenmp
// #else
// #cgo CXXFLAGS: -std=c++0x
// #cgo LDFLAGS: -llept -ltesseract
// #cgo CPPFLAGS: -Wno-unused-result
// #endif
// #include <stdlib.h>
// #include <stdbool.h>
// #include "tessbridge.h"
Expand Down
4 changes: 4 additions & 0 deletions preprocessflags_freebsd.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
package gosseract

// #cgo LDFLAGS: -L/usr/local/lib -llept -ltesseract -fopenmp
import "C"
10 changes: 10 additions & 0 deletions preprocessflags_x.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
package gosseract

// #cgo CXXFLAGS: -std=c++0x
// #cgo LDFLAGS: -llept -ltesseract
// #cgo CPPFLAGS: -Wno-unused-result
//
// #ifdef __APPLE__

This comment has been minimized.

Copy link
@otiai10

otiai10 Dec 13, 2022

Author Owner

これもホントはダメで、 preprocessflags_darwin.goを作るべき

// #cgo LDFLAGS: -L/usr/local/lib -llept -ltesseract
// #endif
import "C"

0 comments on commit 060b832

Please sign in to comment.