-
Notifications
You must be signed in to change notification settings - Fork 129
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #74 from janestreet/v0.12.0-for-win
backport fix for popcount detection on windows
- Loading branch information
Showing
5 changed files
with
25 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
open Configurator.V1 | ||
|
||
let program = | ||
{| | ||
int main(int argc, char ** argv) | ||
{ | ||
return __builtin_popcount(argc); | ||
} | ||
|} | ||
;; | ||
|
||
let () = | ||
let output = ref "" in | ||
main | ||
~name:"discover" | ||
~args:[ "-o", Set_string output, "FILENAME output file" ] | ||
(fun c -> | ||
let has_popcnt = c_test c ~c_flags:[ "-mpopcnt" ] program in | ||
Flags.write_sexp !output (if has_popcnt then [ "-mpopcnt" ] else [])) | ||
;; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
(* empty *) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
(executables (names discover) (libraries dune.configurator) | ||
(preprocess no_preprocessing)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters