Skip to content

Commit

Permalink
Update v0.0.9
Browse files Browse the repository at this point in the history
  • Loading branch information
george012 committed Jun 11, 2024
1 parent 119eef5 commit e624165
Show file tree
Hide file tree
Showing 9 changed files with 26 additions and 9 deletions.
2 changes: 1 addition & 1 deletion config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,5 @@ package config

const (
ProjectName = "fltk_go"
ProjectVersion = "v0.0.8"
ProjectVersion = "v0.0.9"
)
33 changes: 25 additions & 8 deletions fltk-build.go
Original file line number Diff line number Diff line change
Expand Up @@ -122,8 +122,8 @@ func main() {
cmakeGenerator = "Unix Makefiles"
}

cmakeCmd := exec.Command(
"cmake", "-G", cmakeGenerator, "-S", "fltk", "-B", "build",
cmakeCmdArgs := []string{
"-G", cmakeGenerator, "-S", "fltk", "-B", "build",
"-DCMAKE_BUILD_TYPE=Release",
"-DFLTK_BUILD_TEST=OFF",
"-DFLTK_BUILD_EXAMPLES=OFF",
Expand All @@ -133,22 +133,39 @@ func main() {
"-DOPTION_USE_SYSTEM_LIBJPEG=OFF",
"-DOPTION_USE_SYSTEM_LIBPNG=OFF",
"-DOPTION_USE_SYSTEM_ZLIB=OFF",
"-DCMAKE_INSTALL_PREFIX="+currentDir,
"-DCMAKE_INSTALL_PREFIX=" + currentDir,
"-DCMAKE_INSTALL_INCLUDEDIR=include",
"-DCMAKE_INSTALL_LIBDIR="+libdir,
"-DFLTK_INCLUDEDIR="+filepath.Join(currentDir, "include"),
"-DFLTK_LIBDIR="+filepath.Join(currentDir, "lib", runtime.GOOS, runtime.GOARCH))
"-DCMAKE_INSTALL_LIBDIR=" + libdir,
"-DFLTK_INCLUDEDIR=" + filepath.Join(currentDir, "include"),
"-DFLTK_LIBDIR=" + filepath.Join(currentDir, "lib", runtime.GOOS, runtime.GOARCH),
}

if runtime.GOOS == "darwin" {
cmakeCmdArgs = append(cmakeCmdArgs, "-DCMAKE_OSX_DEPLOYMENT_TARGET=12.0")
//// Get the SDK path using xcrun
//sdkPathCmd := exec.Command("xcrun", "--sdk", "macosx", "--show-sdk-path")
//sdkPathOutput, err := sdkPathCmd.Output()
//if err != nil {
// fmt.Printf("Error getting SDK path, %v\n", err)
// os.Exit(1)
//}
//sdkPath := strings.TrimSpace(string(sdkPathOutput))
//
//cmakeCmdArgs = append(cmakeCmdArgs, "-DCMAKE_OSX_SYSROOT="+sdkPath)

cmakeCmdArgs = append(cmakeCmdArgs, "-DCMAKE_OSX_SYSROOT="+"/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk")
if runtime.GOARCH == "amd64" {
cmakeCmd.Args = append(cmakeCmd.Args, "-DCMAKE_OSX_ARCHITECTURES=x86_64")
cmakeCmdArgs = append(cmakeCmdArgs, "-DCMAKE_OSX_ARCHITECTURES=x86_64")
} else if runtime.GOARCH == "arm64" {
cmakeCmd.Args = append(cmakeCmd.Args, "-DCMAKE_OSX_ARCHITECTURES=arm64")
cmakeCmdArgs = append(cmakeCmdArgs, "-DCMAKE_OSX_ARCHITECTURES=arm64")
} else {
fmt.Printf("Unsupported MacOS architecture, %s\n", runtime.GOARCH)
os.Exit(1)
}
}

cmakeCmd := exec.Command("cmake", cmakeCmdArgs...)

cmakeCmd.Dir = "fltk_build"
cmakeCmd.Stdout = os.Stdout
cmakeCmd.Stderr = os.Stderr
Expand Down
Binary file modified lib/darwin/amd64/libfltk.a
Binary file not shown.
Binary file modified lib/darwin/amd64/libfltk_forms.a
Binary file not shown.
Binary file modified lib/darwin/amd64/libfltk_gl.a
Binary file not shown.
Binary file modified lib/darwin/amd64/libfltk_images.a
Binary file not shown.
Binary file modified lib/darwin/amd64/libfltk_jpeg.a
Binary file not shown.
Binary file modified lib/darwin/amd64/libfltk_png.a
Binary file not shown.
Binary file modified lib/darwin/amd64/libfltk_z.a
Binary file not shown.

0 comments on commit e624165

Please sign in to comment.