diff --git a/.gitignore b/.gitignore index 1a1eafe..be576a5 100644 --- a/.gitignore +++ b/.gitignore @@ -20,6 +20,7 @@ docs.json __dummy.html docs/ *.selections.json +build/ # Code coverage *.lst @@ -27,5 +28,5 @@ docs/ # Zig build zig-*/ -#VScode +# VScode .vscode/ \ No newline at end of file diff --git a/dub.sdl b/dub.sdl new file mode 100644 index 0000000..f7d8ca7 --- /dev/null +++ b/dub.sdl @@ -0,0 +1,53 @@ +name "sokol-d" +description "D bindings for sokol" +authors "Matheus Catarino França " +copyright "Copyright 2023-2024 - Matheus Catarino França" +license "Zlib" +version "0.1.0" +buildType "debug" { + buildOptions "debugMode" "debugInfo" +} +buildType "unittest" { + buildOptions "debugMode" "debugInfo" "unittests" +} +buildType "release" { + buildOptions "releaseMode" "inline" "optimize" +} +buildType "release-nobounds" { + buildOptions "releaseMode" "inline" "noBoundsCheck" "optimize" +} +buildType "release-debug" { + buildOptions "releaseMode" "debugInfo" "inline" "optimize" +} +toolchainRequirements dmd=">=2.89.0" ldc=">=1.25.0" gdc=">=9.3.0" +lflags "-L-Lzig-out/lib" "-L-lsokol" +sourcePaths "src" +preBuildCommands "zig build -Dshared -Doptimize=ReleaseFast" +configuration "linux" { + targetType "executable" + targetPath "build/linux" + targetName "sokol-d-example-clear" + dflags "-P-DSOKOL_GLCORE33" platform="linux" + libs "X11" "GL" "asound" "Xi" "Xcursor" platform="linux" + sourceFiles "src/examples/clear.d" + excludedSourceFiles "src/examples/sgl_context.d" "src/examples/triangle.d" "src/examples/saudio.d" "src/examples/debugtext_print.d" "src/examples/mrt.d" "src/examples/user_data.d" "src/examples/cube.d" "src/examples/blend.d" "src/shaders/*.d" +} +configuration "osx" { + targetType "executable" + targetPath "build/osx" + targetName "sokol-d-example-clear" + dflags "-P-DSOKOL_METAL" "-Xcc=-ObjC" "-P-DIMPL" platform="osx" + lflags "-ld_classic" platform="osx" + libs "Cocoa" "QuartzCore" "MetalKit" "Metal" "AudioToolbox" "Foundation" platform="osx" + sourceFiles "src/examples/clear.d" + excludedSourceFiles "src/examples/sgl_context.d" "src/examples/triangle.d" "src/examples/saudio.d" "src/examples/debugtext_print.d" "src/examples/mrt.d" "src/examples/user_data.d" "src/examples/cube.d" "src/examples/blend.d" +} +configuration "windows" { + targetType "executable" + targetPath "build/windows" + targetName "sokol-d-example-clear" + dflags "-P-DSOKOL_D3D11" platform="windows" + libs "kernel32" "user32" "ole32" "gdi32" "d3d11" "dxgi" platform="windows" + sourceFiles "src/examples/clear.d" + excludedSourceFiles "src/examples/sgl_context.d" "src/examples/triangle.d" "src/examples/saudio.d" "src/examples/debugtext_print.d" "src/examples/mrt.d" "src/examples/user_data.d" "src/examples/cube.d" "src/examples/blend.d" +}