-
-
Notifications
You must be signed in to change notification settings - Fork 454
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add C++20 module build target #1364
Conversation
This is a first working version, I don't know flecs enough for what approaches might be preferred for the define names and usage. |
ef461d7
to
3191967
Compare
Ah, seems my fix for the modularised version of |
g++'s module support is incomplete, and the work around seems to big to be worth it right now. |
@SanderMertens can I have your thoughts on this approach ? |
ab61d20
to
fe5739f
Compare
fe5739f
to
adfc478
Compare
adfc478
to
e03fd47
Compare
Usage in client cmake: ```cmake set(FLECS_M0DULE ON CACHE BOOL "Build flecs module" FORCE) add_subdirectory(path/to/flecs) target_compile_features(flecs-module PUBLIC cxx_std_23) target_link_libraries( someProjectName PRIVATE flecs-module ) ``` In the code, it is then possible to use `import flecs;` to import all the flecs symbols. Still investigating why reflection seems to break, disabled in the module for now. Maintainance: - structs exposed by flecs must be tagged with `FLECS_API_STRUCT` - code within the c++ addon tagged with `FLECS_API` are exposed - globals must be tagged with `FLECS_API_GLOBAL`, which becomes `static` in headers, and export in the module.
Not having it visible breaks compilation on msvc
- Improve define names - Split FLECS_GLOBAL_API in two because `export` comes before template delcarations and `static` afterwards - Fix enum reflection
e03fd47
to
aaca38d
Compare
Closing this PR since #1410 supersedes it. |
Usage in client cmake:
In the code, it is then possible to use
import flecs;
to import all the flecs symbols.Still investigating why reflection seems to break, disabled in the module for now.Fixed.Maintainance:
FLECS_API_STRUCT
FLECS_API
are exposedFLECS_API_GLOBAL
, which becomesstatic
in headers, and export in the module.Closes #1317