Skip to content

Commit

Permalink
Library names built in windows do not start with lib.
Browse files Browse the repository at this point in the history
  • Loading branch information
daneelsan committed Jan 22, 2022
1 parent 4268ee1 commit b9cea17
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 5 deletions.
12 changes: 8 additions & 4 deletions Kernel/libWireworld.wl
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,15 @@ InitializeWireworldLibrary
Begin["`Private`"]


$libName = If[$OperatingSystem === "Windows", "", "lib"] <> "Wireworld";

InitializeWireworldLibrary[] :=
Module[{libWireworld, wireworldStepImm, wireworldStepMut},
libWireworld = FindLibrary["libWireworld"];
libWireworld = FindLibrary[$libName];
If[!FileExistsQ[libWireworld],
Return @ Failure["WireworldFailure", <|
"MessageTemplate" -> "Unable to find the `1` library.",
"MessageParameters" -> {"libWireworld." <> Internal`DynamicLibraryExtension[]}
"MessageParameters" -> {$libName <> "." <> Internal`DynamicLibraryExtension[]}
|>]
];

Expand All @@ -26,7 +28,8 @@ InitializeWireworldLibrary[] :=
If[Head[wireworldStepImm] =!= LibraryFunction,
Return @ Failure["WireworldFailure", <|
"MessageTemplate" -> "Unable to load the `1` library function.",
"MessageParameters" -> {"wireworld_step_immutable"}
"MessageParameters" -> {"wireworld_step_immutable"},
"Library" -> libWireworld
|>]
];

Expand All @@ -39,7 +42,8 @@ InitializeWireworldLibrary[] :=
If[Head[wireworldStepMut] =!= LibraryFunction,
Return @ Failure["WireworldFailure", <|
"MessageTemplate" -> "Unable to load the `1` library function.",
"MessageParameters" -> {"wireworld_step_mutable"}
"MessageParameters" -> {"wireworld_step_mutable"},
"Library" -> libWireworld
|>]
];

Expand Down
2 changes: 1 addition & 1 deletion scripts/build_library.wls
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ warningsFlags = {"-Wall", "-Wextra", "-Werror", "-Wno-unused", "-Wno-unused-para
Print["Building the library in ", libDirTarget];
libPath = CCompilerDriver`CreateLibrary[
srcFiles,
"libWireworld",
If[$OperatingSystem === "Windows", "", "lib"] <> "Wireworld",
"ShellCommandFunction" -> EchoLabel["Command:\n"],
"ShellOutputFunction" -> EchoLabel["Output:\n"],
"TargetDirectory" -> libDirTarget,
Expand Down

0 comments on commit b9cea17

Please sign in to comment.