Page 1 of 1

Compiler function: FileExists()

Posted: Thu Feb 27, 2020 12:46 am
by Sicro
We need a compiler function to check if a file exists.
Otherwise, I see no possibility to solve the following problem without such a function:

Code: Select all

CompilerIf FileExists("/usr/lib/x86_64-linux-gnu/libwebkitgtk-3.0.so.0")
  ; Debian Linux
  #WEBKIT_LIB_PATH$ = "/usr/lib/x86_64-linux-gnu/libwebkitgtk-3.0.so.0"
CompilerElseIf FileExists("/usr/lib/libwebkitgtk-3.0.so.0")
  ; Arch Linux
  #WEBKIT_LIB_PATH$ = "/usr/lib/libwebkitgtk-3.0.so.0"
CompilerEndIf

ImportC #WEBKIT_LIB_PATH$
  ; ...
EndImport

Re: Compiler function: FileExists()

Posted: Thu Feb 27, 2020 2:17 am
by skywalk
Yes, something similar to Zig's build language.
Automation is your friend. :)