Skip to content

Commit

Permalink
Update Setup.hs (#51)
Browse files Browse the repository at this point in the history
Adds if condition where if the OS is Windows it will add some additional arguments for the current LLVM Library to be findable.
  • Loading branch information
MilesLitteral authored Apr 12, 2024
1 parent 1cc6c64 commit 2b1da50
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion Setup.hs
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ import Data.Char
import Data.List
import Data.Maybe

import System.Info
import System.Directory
import System.FilePath

Expand Down Expand Up @@ -84,9 +85,10 @@ buildTblgen confFlags = do
cppFlags <- words <$> llvmConfig ["--cppflags"]
includeDir <- trim <$> llvmConfig ["--includedir"]
cc <- getCC confFlags
let windowsLLVMVersion = "-" ++ (show $ head $ versionNumbers llvmVersion)
ensureDirectory $ cwd </> ".bin"
cc $ sources ++ cxxFlags ++ ldFlags ++
[ "-lMLIR", "-lLLVM", "-lMLIRTableGen", "-lLLVMTableGen"
[ "-lMLIR", if os == "mingw32" then "-lLLVM" ++ windowsLLVMVersion else "-lLLVM", "-lMLIRTableGen", "-lLLVMTableGen"
, "-o", cwd </> ".bin/mlir-hs-tblgen"]
let tblgenProgram = ConfiguredProgram
{ programId = "mlir-hs-tblgen"
Expand Down

0 comments on commit 2b1da50

Please sign in to comment.