I am compiling WireGuard within Xcode, which requires setting up make
as an external build tool. However, the compilation would fail every time, and I couldn't figure it out. I realized that the directory I was giving to the external tool was not correct in the log.
Following the wireguard instructions, I set the external tool directory to:
${BUILD_DIR%Build/*}SourcePackages/checkouts/wireguard-apple/Sources/WireGuardKitGo
This should remove the Build/*
suffix from the BUILD_DIR
variable, however, it instead returns empty, so the directory is passed as the relative directory:
SourcePackages/checkouts/wireguard-apple/Sources/WireGuardKitGo
If I instead replace the directory with:
${BUILD_DIR}/../../SourcePackages/checkouts/wireguard-apple/Sources/WireGuardKitGo
it works as intended. I can run ${BUILD_DIR%Build/*}
in bash and it returns as expected, so is this an issue within Xcode, am I not formatting the substitution correctly, or am I off base entirely?