Add a no-op main for dendritejs when not building under wasm

This commit is contained in:
Kegan Dougal 2020-03-05 17:00:48 +00:00
parent c882437661
commit 18b652f0fb
3 changed files with 27 additions and 6 deletions

View file

@ -3,8 +3,4 @@
# Put installed packages into ./bin
export GOBIN=$PWD/`dirname $0`/bin
# We can't build all packages ala ./cmd/... because ./cmd/dendritejs only works for WASM
find ./cmd -mindepth 1 -maxdepth 1 -type d | grep -v dendritejs | xargs go install -v
# worth compiling it to make sure it's happy though, and who knows maybe they do want to build for wasm ;)
GOOS=js GOARCH=wasm go build -o dendritejs.wasm $PWD/`dirname $0`/cmd/dendritejs
go install -v $PWD/`dirname $0`/cmd/...

View file

@ -1,4 +1,4 @@
// Copyright 2017 Vector Creations Ltd
// Copyright 2020 The Matrix.org Foundation C.I.C.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
@ -12,6 +12,8 @@
// See the License for the specific language governing permissions and
// limitations under the License.
// +build wasm
package main
import (

View file

@ -0,0 +1,23 @@
// Copyright 2020 The Matrix.org Foundation C.I.C.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
// +build !wasm
package main
import "fmt"
func main() {
fmt.Println("dendritejs: no-op when not compiling for WebAssembly")
}