Usage: build [options]
Options:
-m=<string>, --mode=<string>
Sets build mode
Available modes:
- debug
- release
Default: debug
-gl=<string> --gl-api=<string>
Sets the graphics API to use
Available backends:
- OpenGL
- DX11 (Windows only)
Default: OpenGL
-s, --symbols
Adds debug symbols. Already set by --mode=debug.
-o, --optimizations
Adds optimizations. Already set by --mode=release.
-h, --help
Display this help text and exit
-v, --verbose
Display build debug information like command currentely executing
Note
4coder needs the MSVC compiler and windows SDK from the "Desktop development with C++" component. If you don’t have this already, you can download the installer here. Make sure to at least click on "Desktop development with C++" and tick the boxes for MSVC and the Windows SDK.
- Execute this command from the root of the project (the resulting executable will be under the
buildfolder in the root of the repo)
.\build.battested on Ubuntu 22.04:
- Get required libraries (apt names):
sudo apt install build-essential libx11-dev libxfixes-dev libglx-dev mesa-common-dev libasound2-dev libfreetype-dev libfontconfig-dev`- Execute this command from the root of the project (the resulting executable will be under the
buildfolder in the root of the repo)
./build.sh4coder targets x86_64. If you are using a M1+ ARM CPU you need to prefix the build scripts commands with:
arch -arch x86_64
- Execute this command from the root of the project (the resulting executable will be under the
buildfolder in the root of the repo)
./build.sh
# For M1+ Macs
arch -arch x86_64 ./build.sh4coder uses several small programs to generate some headers and source files. Those do not run automatically, you must build them and run them when needed (which shouldn't really happen).
code\4ed_font_api.cppcreates, incode\generated,font_api.h,font_api.cpp,font_api_constructor.cpp(not used) andfont_api_master_list.h(not used);code\4ed_graphics_api.cppcreates, incode\generated,graphics_api.handgraphics_api.cpp,graphics_api_constructor.cpp(not used) andgraphics_api_master_list.h(not used);code\4ed_system_api.cppcreates, incode\custom\generated,system_api.h,system_api.cpp,system_api_constructor.cpp,system_api_master_list.h;code\4ed_api_parser_main.cppis a little different, as it parses source files passed as parameters to search for functions and type preceded byapi(some_api_name)and creates 4 files in thecode\custom\generated. It is used to generatecustom_api.h,custom_api.cpp,custom_api_constructor.cppandcustom_api_master_list.hby passingcode\4ed_api_implementation.cppas a parameter.
You need to compile one of those file and run it from the code directory.
There is also code\4ed_api_check.cpp to verify the generated file but it's not clear at the moment what to check against.
code\4ed_generate_keycodes.cppis also a bit appart as it generatescode\custom\generated\4coder_event_codes.hwhich are keyboard key codes and some event hook ids.