stash
This commit is contained in:
1
.gitignore
vendored
1
.gitignore
vendored
@@ -1,3 +1,4 @@
|
||||
lib
|
||||
include
|
||||
result*
|
||||
dist-newstyle
|
||||
|
||||
19
generate.sh
19
generate.sh
@@ -1,11 +1,22 @@
|
||||
echo "#"
|
||||
echo "# generating library RGFW.Generated in folder lib"
|
||||
echo "#"
|
||||
echo "# copying header..."
|
||||
|
||||
mkdir lib
|
||||
mkdir lib/include
|
||||
cp rgfw/RGFW.h lib/include/RGFW.h
|
||||
|
||||
echo "# creating c file to generate from..."
|
||||
|
||||
clang -E -DRGFW_IMPLEMENTATION -DRGFW_OPENGL lib/include/RGFW.h -o lib/include/RGFW.c
|
||||
|
||||
echo "# generating library RGFW.Generated..."
|
||||
|
||||
hs-bindgen-cli preprocess \
|
||||
-Irgfw \
|
||||
-Ilib/include \
|
||||
--create-output-dirs \
|
||||
--overwrite-files \
|
||||
--hs-output-dir lib \
|
||||
--module RGFW.Generated \
|
||||
--clang-option=-DRGFW_OPENGL \
|
||||
--clang-option=-DRGFW_EXPORT \
|
||||
RGFW.h
|
||||
|
||||
|
||||
@@ -12,13 +12,17 @@ common warnings
|
||||
|
||||
library
|
||||
import: warnings
|
||||
exposed-modules: RGFW.Generated
|
||||
exposed-modules:
|
||||
, RGFW.Generated
|
||||
, RGFW.Generated.FunPtr
|
||||
, RGFW.Generated.Safe
|
||||
, RGFW.Generated.Unsafe
|
||||
build-depends:
|
||||
, base
|
||||
, primitive
|
||||
, c-expr-runtime
|
||||
, hs-bindgen-runtime
|
||||
include-dirs: rgfw
|
||||
include-dirs: lib/include
|
||||
hs-source-dirs: lib
|
||||
default-language: Haskell2010
|
||||
default-extensions: FlexibleInstances
|
||||
@@ -37,6 +41,6 @@ executable hs-rgfw
|
||||
, xcursor
|
||||
, xrandr
|
||||
, xi
|
||||
include-dirs: rgfw
|
||||
include-dirs: lib/include
|
||||
hs-source-dirs: src
|
||||
default-language: Haskell2010
|
||||
|
||||
@@ -1,6 +1,10 @@
|
||||
module Main where
|
||||
|
||||
import qualified Foreign.Ptr (ToFunPtr)
|
||||
|
||||
import qualified RGFW.Generated as RGFW
|
||||
|
||||
main :: IO ()
|
||||
main = putStrLn "Hello World"
|
||||
main = do
|
||||
putStrLn "Hello World"
|
||||
window <- toFunPtr ()
|
||||
|
||||
Reference in New Issue
Block a user