Skip to content

Commit

Permalink
fix: update build on windows; update path in ci
Browse files Browse the repository at this point in the history
  • Loading branch information
ttytm committed Nov 11, 2024
1 parent 344a399 commit c027ed1
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 3 deletions.
16 changes: 15 additions & 1 deletion curl/build.vsh
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,21 @@ mut cmd := cli.Command{
// TODO: build in temp then remove old and move new from temp.
rmdir_all(dst_dir) or {} // Remove old library files.
silent := cmd.flags.get_bool('silent')!
$if windows { setup_windows(silent)! } $else { setup(silent)! }
$if windows {
setup_windows(silent)!
defer {
println('\nOn Windows, libcurl requires access to a compatible curl.exe.')
println('A reliable way is to use the curl.exe that is shipped with every libcurl version.')
println("Add '${curl_mod_dir.replace('/', os.path_separator)}\\libcurl\\bin' to your PATH to make it accessible.")
if getenv('CI') != '' {
// For now, don't automatically update PATH outside of CI, as it's
// easily corrupted and might cause annoyances on a users machine.
system('setx PATH "%PATH%;C:\\${vmodules_dir()}\\vibe\\curl\\libcurl\\bin"')
}
}
} $else {
setup(silent)!
}
println('\rFinished!')
}
}
Expand Down
8 changes: 6 additions & 2 deletions curl/lib.v
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,14 @@ import instructions
import state

#flag -I@VMODROOT/curl/libcurl/include
#flag -L@VMODROOT/curl/libcurl
#flag windows @VMODROOT/curl/libcurl/libcurl.dll
#include "curl/curl.h"

#flag windows @VMODROOT/curl/libcurl/bin/libcurl-x64.dll
$if !windows {
#flag -L@VMODROOT/curl/libcurl
#flag -lcurl
}

pub type Handle = C.CURL

pub type LinkedList = C.curl_slist
Expand Down

0 comments on commit c027ed1

Please sign in to comment.