Skip to content

Fails with Zig as a C compiler (Does not respect existing value of CC in Windows) #152

@eamonburns

Description

@eamonburns

I tried using Zig as a C compiler by setting CC to zig cc:

$env:CC = "zig cc"
make

But I get the following error:

cmd /C mkdir build
gcc -O3 -Wall -fpic -std=gnu99 -shared src/fzf.c -o build/libfzf.dll
process_begin: CreateProcess(NULL, gcc -O3 -Wall -fpic -std=gnu99 -shared src/fzf.c -o build/libfzf.dll, ...) failed.
make (e=2): The system cannot find the file specified.
make: *** [Makefile:24: build/libfzf.dll] Error 2

I am somewhat of a newbie when it comes to make, but it looks like this change fixed it (lines 2-5 in Makefile):

 ifeq ($(OS),Windows_NT)
-    CC = gcc
+    ifndef CC
+        CC = gcc
+    endif
     TARGET := libfzf.dll

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions