diff options
| -rw-r--r-- | frontend/meson.build | 2 | ||||
| -rw-r--r-- | handlers.go | 4 | ||||
| -rw-r--r-- | meson.build | 20 |
3 files changed, 23 insertions, 3 deletions
diff --git a/frontend/meson.build b/frontend/meson.build index e387145..b0c4b2f 100644 --- a/frontend/meson.build +++ b/frontend/meson.build @@ -12,7 +12,7 @@ endforeach subdir('layouts') -custom_target( +frontend = custom_target( output : 'public', command : [ hugo, diff --git a/handlers.go b/handlers.go index 1ca96d8..4e7bfe6 100644 --- a/handlers.go +++ b/handlers.go @@ -8,14 +8,14 @@ import ( "net/http" ) -//go:embed frontend/public +//go:embed build/frontend/public var frontendEmbed embed.FS func init() { router.HandleFunc("/api/version", version) // frontend must come last to make sure /api takes precedence - frontend, err := fs.Sub(frontendEmbed, "frontend/public") + frontend, err := fs.Sub(frontendEmbed, "build/frontend/public") if err != nil { log.Fatalf("No embedded frontend: %v", err) } diff --git a/meson.build b/meson.build index 451844c..5ee335b 100644 --- a/meson.build +++ b/meson.build @@ -3,4 +3,24 @@ project( version : files('VERSION.txt'), ) +go = find_program('go', required : true) + subdir('frontend') + +finserv_linux_amd64 = custom_target( + input : [ + meson.current_source_dir() / 'main.go', + meson.current_source_dir() / 'handlers.go', + ], + output : 'finserv-linux-amd64', + env : {'GOOS': 'linux', 'GOARCH': 'amd64'}, + command : [ + go, + 'build', + '-o', + '@OUTPUT@', + '@INPUT@', + ], + depends : frontend, + build_by_default : true, +) |
