Skip to content

Commit

Permalink
Fix Windows builds
Browse files Browse the repository at this point in the history
  • Loading branch information
ArthaTi committed Sep 24, 2024
1 parent 10dbd2c commit fe93ab0
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 5 deletions.
7 changes: 5 additions & 2 deletions dub.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,10 @@
"configurations": [
{
"name": "default",
"targetType": "staticLibrary"
"targetType": "staticLibrary",
"lflags-linux": [
"--export-dynamic"
]
},
{
"name": "dynamic",
Expand Down Expand Up @@ -128,7 +131,7 @@
],
"sourcePaths": [],
"subConfigurations": {
"fluid": "dynamic"
"fluid": "default"
},
"targetPath": "build",
"targetType": "library",
Expand Down
10 changes: 7 additions & 3 deletions source/fluid/module_view.d
Original file line number Diff line number Diff line change
Expand Up @@ -301,11 +301,11 @@ struct DlangCompiler {

// Find the correct extension for the system
version (Windows)
outputPath = path.setExtension(".dll");
outputPath = path.setExtension(".lib");
else version (OSX)
outputPath = path.setExtension(".dylib");
outputPath = path.setExtension(".a");
else
outputPath = path.setExtension(".so");
outputPath = path.setExtension(".a");

auto cmdline = [executable, sharedLibraryFlag, unittestFlag, path, "-of=" ~ outputPath] ~ importPathsFlag;

Expand Down Expand Up @@ -611,6 +611,8 @@ Frame exampleView(DlangCompiler compiler, Rope prefix, string value, Rope suffix
/// Run a Fluid snippet from a shared library.
private bindbc.SharedLib runSharedLibrary(string path) @trusted {

import std.stdio : stdout, stderr;

// Load the resulting library
auto library = bindbc.load(path.toStringz);

Expand All @@ -627,6 +629,8 @@ private bindbc.SharedLib runSharedLibrary(string path) @trusted {
void function() entrypoint;
bindbc.bindSymbol(library, cast(void**) &entrypoint, "fluid_moduleView_entrypoint");
entrypoint();
stdout.flush();
stderr.flush();

return library;

Expand Down

0 comments on commit fe93ab0

Please sign in to comment.