Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .github/CODEOWNERS
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
* @org/Maintainers
16 changes: 8 additions & 8 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,19 +11,19 @@ jobs:
include:
- suffix: x64-win-dx11
os: windows-latest
build_cmd: bin\package.bat /DWIN32_DX11
build_cmd: bin\build.bat /DWIN32_DX11
- suffix: x64-win-gl
os: windows-latest
build_cmd: bin\package.bat /DWIN32_OPENGL
build_cmd: bin\build.bat /DWIN32_OPENGL
- suffix: x64-linux
os: ubuntu-latest
build_cmd: sudo apt update -y && sudo apt install build-essential libx11-dev libxfixes-dev libglx-dev mesa-common-dev libasound2-dev libfreetype-dev libfontconfig-dev -y && ./bin/package-linux.sh
build_cmd: sudo apt update -y && sudo apt install build-essential libx11-dev libxfixes-dev libglx-dev mesa-common-dev libasound2-dev libfreetype-dev libfontconfig-dev -y && ./bin/build-linux.sh
- suffix: x64-mac
os: macos-15-intel
build_cmd: ./bin/package-mac.sh
# - suffix: arm64-mac
# os: macos-latest
# build_cmd: ./bin/package_arm64-mac.sh
build_cmd: ./bin/build-mac.sh
# - suffix: arm64-mac
# os: macos-latest
# build_cmd: arch -arch x86_64 ./bin/build-mac.sh
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4
Expand All @@ -34,5 +34,5 @@ jobs:
uses: actions/upload-artifact@v4.6.0
with:
name: 4cc-${{ matrix.suffix }}
path: current_dist_super_x64/4coder/ # having "x64" in path might have to change
path: build/

60 changes: 30 additions & 30 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,42 +3,50 @@
# Building

## Windows
1. Setup the MSVC toolchain in your environment, this can be done with the `code/custom/bin/setup_cl_x64.bat` script
2. call the `package.bat` script from the code directory (this builds a distribution in the `distributions` directory with all the non-binary dependencies)
1. `$ cd 4cc\code`
2. `.\bin\package.bat`
3. You can also use the `build.bat` script if you want just build the binaries (this produces the build artifacts in the `build` directory, this doesn't produce a functional distribution)
1. `$ cd 4cc\code`
2. `$ .\bin\build.bat`

> [!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](https://visualstudio.microsoft.com/downloads/). Make sure to at least click on "Desktop development with C++" and tick the boxes for MSVC and the Windows SDK.

1. Setup the MSVC toolchain in your environment, this can be done either with the `code/custom/bin/setup_cl_x64.bat` script or by using the development shell in windows terminal
2. Execute this command from the root of the project (the resulting executable will be under the `build` folder in the root of the repo)

```batch
cd 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.

```batch
cd code && .\bin\build.bat /DWIN32_DX11
```

## Linux

> tested on Ubuntu 22.04:

1. 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`
2. Use the `package-linux.sh` script from the code directory (this builds a distribution in the `distributions` directory with all the non-binary dependencies)
1. `$ cd 4cc/code`
2. `$ ./bin/package-linux.sh`

3. You can also use the `build-linux.sh` script if you want just build the binaries, (this produces the build artifacts in the `build` directory, this doesn't produce a functional distribution)
1. `$ cd 4cc/code`
2. `$ ./bin/build-linux.sh`
```sh
sudo apt install build-essential libx11-dev libxfixes-dev libglx-dev mesa-common-dev libasound2-dev libfreetype-dev libfontconfig-dev`
```

2. Execute this command from the root of the project (the resulting executable will be under the `build` folder in the root of the repo)

```sh
cd code && ./bin/build-linux.sh
```

## Mac

> 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`

1. Use the `package-mac.sh` script from the code directory (this builds a distribution in the `distributions` directory with all the non-binary dependencies)
1. `$ cd 4cc/code`
2. `$ ./bin/package-mac.sh`
1. Execute this command from the root of the project (the resulting executable will be under the `build` folder in the root of the repo)

2. You can also use the `build-mac.sh` script if you want just build the binaries, (this produces the build artifacts in the `build` directory, this doesn't produce a functional distribution)
1. `$ cd 4cc/code`
2. `$ ./bin/build-mac.sh`
```sh
cd code && ./bin/build-mac.sh
```

### Older Macs, 10.15.7 Catalina

Expand All @@ -51,20 +59,12 @@ If you are using an older version of mac, such as 10.15.7 Catalina you need to i
## Build script parameter

The build script accepts a parameter (mutually exclusive):
- `/DDEV_BUILD` or `/DDEV_BUILD_X86` (default value) : build without optimizations.
- `/DDEV_BUILD` (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 to `build_optimized` script): build with optimizations.
- `/DOPT_BUILD` (similar to `build_optimized` script): build with optimizations.
Doesn't produce debug symbols.
Defines `FRED_SUPER` macro.
- `/DPACKAGE_SUPER_X64` or `/DPACKAGE_SUPER_X86` (similar to `package` script): package 4coder for distribution.
Turns on optimizations.
Produces debug symbols.
Defines `SHIP_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.
Defines `SHIP_MODE`, `DO_CRAZY_EXPENSIVE_ASSERTS` (on Windows) macros.

## API generators

Expand Down
Loading