@@ -14,10 +14,12 @@ use mdbook::MDBook;
1414use mdbook:: errors:: { Result as Result3 } ;
1515use mdbook:: renderer:: RenderContext ;
1616
17- use mdbook_linkcheck ;
18- use mdbook_linkcheck:: errors:: BrokenLinks ;
17+ # [ cfg ( all ( target_arch = "x86_64" , target_os = "linux" ) ) ]
18+ use mdbook_linkcheck:: { self , errors:: BrokenLinks } ;
1919use failure:: Error ;
2020
21+ #[ cfg( not( all( target_arch = "x86_64" , target_os = "linux" ) ) ) ]
22+ use failure:: bail;
2123
2224fn main ( ) {
2325 let d_message = "-d, --dest-dir=[dest-dir]
@@ -90,6 +92,7 @@ fn main() {
9092 } ;
9193}
9294
95+ #[ cfg( all( target_arch = "x86_64" , target_os = "linux" ) ) ]
9396pub fn linkcheck ( args : & ArgMatches < ' _ > ) -> Result < ( ) , Error > {
9497 let book_dir = get_book_dir ( args) ;
9598 let book = MDBook :: load ( & book_dir) . unwrap ( ) ;
@@ -99,6 +102,11 @@ pub fn linkcheck(args: &ArgMatches<'_>) -> Result<(), Error> {
99102 mdbook_linkcheck:: check_links ( & render_ctx)
100103}
101104
105+ #[ cfg( not( all( target_arch = "x86_64" , target_os = "linux" ) ) ) ]
106+ pub fn linkcheck ( args : & ArgMatches < ' _ > ) -> Result < ( ) , Error > {
107+ bail ! ( "mdbook-linkcheck only works on x86_64 linux targets." ) ;
108+ }
109+
102110// Build command implementation
103111pub fn build_1 ( args : & ArgMatches < ' _ > ) -> Result1 < ( ) > {
104112 let book_dir = get_book_dir ( args) ;
0 commit comments