mirror of
https://github.com/vlang/v.git
synced 2023-08-10 21:13:21 +03:00
stbi: add a link_to_libm.c.v helper, to ensure import stbi
works always.
This commit is contained in:
parent
6d14275106
commit
f86af7237f
21
vlib/stbi/link_to_libm.c.v
Normal file
21
vlib/stbi/link_to_libm.c.v
Normal file
@ -0,0 +1,21 @@
|
|||||||
|
// Copyright (c) 2019-2021 Alexander Medvednikov. All rights reserved.
|
||||||
|
// Use of this source code is governed by an MIT license
|
||||||
|
// that can be found in the LICENSE file.
|
||||||
|
module stbi
|
||||||
|
|
||||||
|
// NB: stbi uses math.h because of `ldexp` and `pow`, for which we *do* have
|
||||||
|
// pure V implementations, but our `math` module still depends on libm
|
||||||
|
// because of 'powf', 'cosf', 'sinf', 'sqrtf' and 'tanf'.
|
||||||
|
|
||||||
|
// TODO: remove this file, when we have pure V implementations for the above
|
||||||
|
// functions too, and so `math` is no longer dependent on `libm` at all.
|
||||||
|
|
||||||
|
#include <math.h>
|
||||||
|
|
||||||
|
$if windows {
|
||||||
|
$if tinyc {
|
||||||
|
#flag @VEXEROOT/thirdparty/tcc/lib/openlibm.o
|
||||||
|
}
|
||||||
|
} $else {
|
||||||
|
#flag -lm
|
||||||
|
}
|
Loading…
Reference in New Issue
Block a user