Welcome to the 4coder community repository.
- Setup the MSVC toolchain in your environment, this can be done with the
code/custom/bin/setup_cl_x64.bat
script - call the
package.bat
script from the code directory (this builds a distribution in thedistributions
directory with all the non-binary dependencies)$ cd 4cc\code
.\bin\package.bat
- You can also use the
build.bat
script if you want just build the binaries (this produces the build artifacts in thebuild
directory, this doesn't produce a functional distribution)$ cd 4cc\code
$ .\bin\build.bat
In addition to the parameter listed below, you can specify which backend to use by passing one of those parameters to the build scripts:
/DWIN32_OPENGL
(default) to use the OpenGL backend./DWIN32_DX11
to use the Direct3D 11 backend.
tested 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
-
Use the
package-linux.sh
script from the code directory (this builds a distribution in thedistributions
directory with all the non-binary dependencies)$ cd 4cc/code
$ ./bin/package-linux.sh
-
You can also use the
build-linux.sh
script if you want just build the binaries, (this produces the build artifacts in thebuild
directory, this doesn't produce a functional distribution)$ cd 4cc/code
$ ./bin/build-linux.sh
4coder targets x86_64. If you are using a M1+ ARM CPU you need to prefix the build scripts commands with:
arch -arch x86_64
-
Use the
package-mac.sh
script from the code directory (this builds a distribution in thedistributions
directory with all the non-binary dependencies)$ cd 4cc/code
$ ./bin/package-mac.sh
-
You can also use the
build-mac.sh
script if you want just build the binaries, (this produces the build artifacts in thebuild
directory, this doesn't produce a functional distribution)$ cd 4cc/code
$ ./bin/build-mac.sh
If you are using an older version of mac, such as 10.15.7 Catalina you need to install the realpath command:
$ sudo port install coreutils
- macports names the
realpath
commandgrealpath
, so make a symbolic link in order to use build-mac.sh:
$ sudo ln -s /opt/local/bin/grealpath /opt/local/bin/realpath
The build script accepts a parameter (mutually exclusive):
/DDEV_BUILD
or/DDEV_BUILD_X86
(default value) : build without optimizations. Produces debug symbols. Defines:FRED_INTERNAL
,FRED_SUPER
,DO_CRAZY_EXPENSIVE_ASSERTS
(on Windows) macros./DOPT_BUILD
or/DOPT_BUILD_X86
(similar tobuild_optimized
script): build with optimizations. Doesn't produce debug symbols. DefinesFRED_SUPER
macro./DPACKAGE_SUPER_X64
or/DPACKAGE_SUPER_X86
(similar topackage
script): package 4coder for distribution. Turns on optimizations. Produces debug symbols. DefinesSHIP_MODE
,FRED_SUPER
,DO_CRAZY_EXPENSIVE_ASSERTS
(on Windows) macros./DPACKAGE_DEMO_X64
or/DPACKAGE_DEMO_X86
: packages 4coder demo for distribution. Turns on optimizations. Produces debug symbols. DefinesSHIP_MODE
,DO_CRAZY_EXPENSIVE_ASSERTS
(on Windows) macros.