Skip to content
This repository has been archived by the owner on Feb 12, 2025. It is now read-only.

Valid looking command fails due to invalid arguments #51

Open
chris-easton opened this issue May 8, 2023 · 0 comments
Open

Valid looking command fails due to invalid arguments #51

chris-easton opened this issue May 8, 2023 · 0 comments

Comments

@chris-easton
Copy link

I'm seeing an issue that I'm not sure how to solve. A valid looking command, e.g.:

[INFO] CMD: clang -o test main.c foo.c

Fails with:

clang: error: no such file or directory: 'main.c foo.c'

The following is the content of a shell script to set-up a minimal example:

#!/usr/bin/env bash

cat << EOF > foo.c
void foo() {
}
EOF

cat << EOF > main.c
void main() {
}
EOF


cat << EOF > nobuild.c
#include <stdio.h>
#include <string.h>
#define NOBUILD_IMPLEMENTATION
#include "./nobuild.h"

int main(int argc, char ** argv)
{
  GO_REBUILD_URSELF(argc, argv);

  Cstr_Array file_array = cstr_array_make(NULL, NULL);
  FOREACH_FILE_IN_DIR(file, ".", {
    if (ENDS_WITH(file, ".c") && !ENDS_WITH(file, "nobuild.c"))
    {
      file_array = cstr_array_append(file_array, file);
    }
  });

  CMD("clang", "-o", "test", cstr_array_join(" ", file_array));

  return 0;
}
EOF
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant