diff --git a/.github/workflows/gen-docs.yml b/.github/workflows/gen-docs.yml index 0247dd442..19b0f4efa 100644 --- a/.github/workflows/gen-docs.yml +++ b/.github/workflows/gen-docs.yml @@ -32,6 +32,7 @@ jobs: cd build cmake .. make + ls - name: Cache. uses: actions/cache@v2 diff --git a/src/tools/md4c.cy b/src/tools/md4c.cy index a792e2814..dc53477b9 100644 --- a/src/tools/md4c.cy +++ b/src/tools/md4c.cy @@ -1,5 +1,11 @@ -- ./src/tools/cbindgen.cy -o src/tools/md4c.cy ~/repos/md4c/src/md4c.h -I/opt/homebrew/Cellar/llvm/17.0.5/include -libpath libmd4c.dylib -stripPrefix MD +var Root.libPath = switch os.system: +case 'linux' => 'libmd4c.so' +case 'windows' => 'md4c.dll' +case 'macos' => 'libmd4c.dylib' +else => throw error.Unsupported + -- CBINDGEN MARKER -- Code below is generated by cbindgen.cy type CHAR int @@ -158,7 +164,7 @@ func load(): ffi.cbind(SPAN_WIKILINK_S, [ATTRIBUTE]) ffi.cbind(PARSER_S, [.uint, .uint, .voidPtr, .voidPtr, .voidPtr, .voidPtr, .voidPtr, .voidPtr, .voidPtr]) ffi.cfunc('md_parse', [.voidPtr, .uint, .voidPtr, .voidPtr], .int) - my lib = ffi.bindLib('libmd4c.dylib', [genMap: true]) + my lib = ffi.bindLib(libPath, [genMap: true]) md_parse = lib.md_parse return lib