1
0
mirror of https://github.com/vlang/v.git synced 2023-08-10 21:13:21 +03:00

V.js: on linux -lm is needed

This commit is contained in:
Delyan Angelov 2019-09-16 22:00:59 +03:00 committed by Alexander Medvednikov
parent ca239fcf98
commit 083d747302
2 changed files with 29 additions and 4 deletions

View File

@ -6,6 +6,10 @@ matrix:
dist: xenial dist: xenial
sudo: required sudo: required
addons: addons:
snaps:
- name: node
channel: latest/edge
confinement: classic
apt: apt:
sources: sources:
- ubuntu-toolchain-r-test - ubuntu-toolchain-r-test
@ -75,11 +79,27 @@ script:
./v test v ./v test v
fi fi
- | - |
if [[ "${TRAVIS_OS_NAME}" == "osx" ]]; then if [[ "${TRAVIS_OS_NAME}" == "linux" ]]; then
## aliases do not work for some reason in travis, just use full commands :-|
echo "Nodejs version:"
snap run node --version
# Build hi.js # Build hi.js
echo "println('Hello from V.js')" > hi.js echo "fn main(){ println('Hello from V.js') }" > hi.v
./v -o hi.js hi.v && node hi.js ./v -o hi.js hi.v
snap run node hi.js
fi
- |
if [[ "${TRAVIS_OS_NAME}" == "osx" ]]; then
echo "Nodejs version:"
node --version
# Build hi.js
echo "fn main(){ println('Hello from V.js') }" > hi.v
./v -o hi.js hi.v
## the node on osx requires --harmony-class-fields for now
node --harmony-class-fields hi.js
fi
- |
if [[ "${TRAVIS_OS_NAME}" == "osx" ]]; then
# Build Vid # Build Vid
git clone https://github.com/vlang/vid git clone https://github.com/vlang/vid
cd vid && ../v -debug -o vid . cd vid && ../v -debug -o vid .

View File

@ -168,6 +168,11 @@ fn (v mut V) cc() {
a << ' -ldl ' a << ' -ldl '
} }
} }
if v.os == .js && os.user_os() == 'linux' {
a << '-lm'
}
if v.os == .windows { if v.os == .windows {
a << '-DUNICODE -D_UNICODE' a << '-DUNICODE -D_UNICODE'
} }