\#if conditional compilation macro

This commit is contained in:
2021-07-12 13:08:38 -06:00
parent befaadf2d5
commit 709a34ebdc
5 changed files with 78 additions and 2 deletions

View File

@@ -0,0 +1,20 @@
package test.cases;
import utest.Assert;
import utest.Test;
import kiss.Prelude;
@:build(kiss.Kiss.build())
class ConditionalCompilationTestCase extends Test {
function testIf() {
#if interp
Assert.isTrue(runningInHaxe);
#else
Assert.isFalse(runningInHaxe);
#end
#if (py || js)
Assert.isTrue(runningInPyOrJs);
#end
}
}

View File

@@ -0,0 +1,3 @@
(defvar runningInHaxe (#if interp true false))
(defvar runningInPyOrJs (#if (or py js) true false))