Skip to content

Commit

Permalink
Specify default exe extension on wasm32 to be .wasm
Browse files Browse the repository at this point in the history
  • Loading branch information
TerrorJack committed Dec 13, 2022
1 parent 63b0f6f commit 4454816
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
5 changes: 3 additions & 2 deletions Cabal/src/Distribution/Simple/BuildPaths.hs
Original file line number Diff line number Diff line change
Expand Up @@ -235,8 +235,9 @@ mkGenericSharedBundledLibName platform comp lib
-- | Default extension for executable files on the current platform.
-- (typically @\"\"@ on Unix and @\"exe\"@ on Windows or OS\/2)
exeExtension :: Platform -> String
exeExtension (Platform _arch os) = case os of
Windows -> "exe"
exeExtension platform = case platform of
Platform _ Windows -> "exe"
Platform Wasm32 _ -> "wasm"
_ -> ""

-- | Extension for object files. For GHC the extension is @\"o\"@.
Expand Down
7 changes: 4 additions & 3 deletions Cabal/src/Distribution/Simple/Utils.hs
Original file line number Diff line number Diff line change
Expand Up @@ -1535,12 +1535,13 @@ dropExeExtension filepath =
-- | List of possible executable file extensions on the current build
-- platform.
exeExtensions :: [String]
exeExtensions = case buildOS of
exeExtensions = case (buildArch, buildOS) of
-- Possible improvement: on Windows, read the list of extensions from the
-- PATHEXT environment variable. By default PATHEXT is ".com; .exe; .bat;
-- .cmd".
Windows -> ["", "exe"]
Ghcjs -> ["", "exe"]
(_, Windows) -> ["", "exe"]
(_, Ghcjs) -> ["", "exe"]
(Wasm32, _) -> ["", "wasm"]
_ -> [""]

-- ------------------------------------------------------------
Expand Down

0 comments on commit 4454816

Please sign in to comment.