Skip to content

Conversation

@CaitaXD
Copy link

@CaitaXD CaitaXD commented Sep 9, 2025

I think cc is a Unix thing, when compiling with it mingw should be just gcc.

nob.h Outdated
# if defined(__GNUC__)
# define nob_cc(cmd) nob_cmd_append(cmd, "cc")
# elif defined(__clang__)
# if defined(__GNUC__) && defined(__clang__)
Copy link
Contributor

@KillerxDBr KillerxDBr Jan 8, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This will probably break Visual Studio Clang, since it defines _MSC_VER, and MinGW Clang defines __GNUC__

Copy link
Author

@CaitaXD CaitaXD Jan 31, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is that the only case where those flags can exist at the same time?

Copy link
Author

@CaitaXD CaitaXD Jan 31, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cause if its something that happens in mutiple places it be cool to do something like this

# if defined(__clang__)
#       define COMPILER_CLANG
# elif defined(_MSC_VER)
#       define COMPILER_MSVC
# elif defined(__TINYC__)
#       define COMPILER_TINYC
# elif defined(__GNUC__)
#       define COMPILER_GCC
# endif

As i understood clang is the trouble maker so we just need to check it first?

This also doubles down as documentation

@CaitaXD CaitaXD changed the title Change nob_cc on mingw from cc to gcc Check current compiler at the start of the nob to avoid confusion with clang Jan 31, 2026
@CaitaXD CaitaXD marked this pull request as draft January 31, 2026 03:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants