Skip to content
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

Improve cmake support, with installation #38

Merged
merged 1 commit into from
May 21, 2023
Merged

Improve cmake support, with installation #38

merged 1 commit into from
May 21, 2023

Conversation

Andre-LA
Copy link
Owner

Note: this was only tested on "x64 Native Tools Command Prompt" environment on Windows, using the clang compiler, next month Linux support will be tested.

With that, Nene it's not supposed to be used as a sub-directory of a game project (unless if the developer choice to), instead, Nene should be used just as SDL2 it's generally used: having a single (at least per-version) compiled version available on the system.

With basic support to CMake install (cmake --install), that's easier to accomplish, for instance, all the dlls required to run the game are easily available on the bin directory of the installation directory (that is, cmake's "prefix"), while the required headers for compilation are available on the include, and the nene.lib static library on lib directory.

Here's a example to compile a single C source file (using clang on Windows, consider that nene was installed using cmake --install build --prefix nene, that is, the final output it's on the nene directory):

> clang -fuse-ld=lld-link -Xlinker /subsystem:windows my_source.c -I nene\include\ -I nene\include\SDL2 -lSDL2main -lSDL2 -lSDL2_image -lSDL2_mixer -lSDL2_ttf -lnene -lshell32 -L nene\lib -o my_source.exe

This PR is related with #36.

Note: this was only tested on "x64 Native Tools Command Prompt" enviroment on Windows, using the clang compiler.
@Andre-LA Andre-LA merged commit 8e1cef6 into main May 21, 2023
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.

1 participant