diff --git a/Kernel/libWireworld.wl b/Kernel/libWireworld.wl index 8cd6e91..ead6e44 100644 --- a/Kernel/libWireworld.wl +++ b/Kernel/libWireworld.wl @@ -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[]} |>] ]; @@ -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 |>] ]; @@ -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 |>] ]; diff --git a/scripts/build_library.wls b/scripts/build_library.wls index 9f04fc1..c7f9c66 100755 --- a/scripts/build_library.wls +++ b/scripts/build_library.wls @@ -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,