SanderMertens / flecs

A fast entity component system (ECS) for C & C++

Home Page:https://www.flecs.dev

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Support building Flecs on Windows without MSVC installed

foxnne opened this issue · comments

Describe the problem you are trying to solve.

I am currently working on the Zig Flecs wrapper alongside a few others, and currently when building Flecs with the Zig compiler on Windows, forcing ECS_TARGET_MSVC is necessary to avoid importing pthread.h, which is not available on Windows.

I believe this is visible on line 15439 of flecs.c

#ifdef ECS_TARGET_MSVC

and further down on lines 15676-77

#else
#include "pthread.h"

Describe the solution you'd like

If I change line 15439 to

- #ifdef ECS_TARGET_MSVC
+ #ifdef ECS_TARGET_WINDOWS

instead, it successfully builds and runs on Windows without MSVC installed.

I'm not sure however what changes need to be made to get this line changed in the amalgamated source.

If this change would be possible without causing any other issues it would be greatly appreciated!

Thanks!

A PR just got merged with the change (thanks @Jared-Miller!) so I'll close the issue. Feel free to reopen if you're still seeing problems!