-
Notifications
You must be signed in to change notification settings - Fork 360
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' into pd-upscaler
- Loading branch information
Showing
31 changed files
with
1,541 additions
and
340 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -12,3 +12,4 @@ src/sdk/generated | |
cmake-build* | ||
.idea/ | ||
build_vs2019_devmode_DMC5.bat | ||
src/CommitHash.autogenerated |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
# Compiling REFramework | ||
|
||
## Necessary prerequisites | ||
|
||
A C++23 compatible compiler is required. Visual Studio 2022 is recommended. Compilers other than MSVC have not been tested. | ||
|
||
CMake is required. | ||
|
||
## Compiling | ||
|
||
### Clone the repository | ||
|
||
#### SSH | ||
``` | ||
git clone [email protected]:praydog/REFramework.git | ||
``` | ||
|
||
#### HTTPS | ||
``` | ||
git clone https://github.com/praydog/REFramework | ||
``` | ||
|
||
### Initialize the submodules | ||
|
||
``` | ||
git submodule update --init --recursive | ||
``` | ||
|
||
### Set up CMake | ||
|
||
#### Command line | ||
|
||
``` | ||
cmake -S . -B build ./build -G "Visual Studio 17 2022" -A x64 -DCMAKE_BUILD_TYPE=Release | ||
cmake --build ./build --config Release | ||
``` | ||
|
||
Keep in mind that not supplying a target will build multiple targets, when you may only need one of them. | ||
|
||
For example, to build only the RE2 target, you can use the following command: | ||
|
||
``` | ||
cmake --build ./build --config Release --target RE2 | ||
``` | ||
|
||
#### VSCode | ||
|
||
1. Install the [CMake Tools](https://marketplace.visualstudio.com/items?itemName=ms-vscode.cmake-tools) extension | ||
2. Open the REFramework folder in VSCode | ||
3. Press `Ctrl+Shift+P` and select `CMake: Configure` | ||
4. When "Select a kit" appears, select `Visual Studio Community 2022 Release - amd64` | ||
5. Select the desired build config (usually `Release` or `RelWithDebInfo`) near the bottom of the window | ||
6. Select the desired build target near the bottom of the window, otherwise all targets will be built | ||
6. You should now be able to compile REFramework by pressing `Ctrl+Shift+P` and selecting `CMake: Build` or by pressing `F7` | ||
|
||
#### Batch script | ||
|
||
In the root of the repository there is a `build_vs2022.bat` script that will build all targets in Release mode. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
@echo off | ||
|
||
IF EXIST "src/CommitHash.autogenerated" ( | ||
echo The file "src/CommitHash.autogenerated" already exists. | ||
exit /b 0 | ||
) | ||
|
||
FOR /F "tokens=*" %%g IN ('git rev-parse HEAD') DO (SET REF_COMMIT_HASH=%%g) | ||
|
||
FOR /F "tokens=*" %%t IN ('git describe --tags --abbrev^=0') DO (SET REF_TAG=%%t) | ||
|
||
FOR /F "tokens=*" %%c IN ('git describe --tags --long') DO ( | ||
FOR /F "tokens=1,2 delims=-" %%a IN ("%%c") DO ( | ||
SET REF_TAG_LONG=%%a | ||
SET REF_COMMITS_PAST_TAG=%%b | ||
) | ||
) | ||
|
||
FOR /F "tokens=*" %%b IN ('git rev-parse --abbrev-ref HEAD') DO (SET REF_BRANCH=%%b) | ||
|
||
FOR /F "tokens=*" %%n IN ('git rev-list --count HEAD') DO (SET REF_TOTAL_COMMITS=%%n) | ||
|
||
FOR /F "tokens=2 delims==" %%a IN ('wmic OS get localdatetime /value') DO ( | ||
SET datetime=%%a | ||
) | ||
|
||
SET year=%datetime:~0,4% | ||
SET month=%datetime:~4,2% | ||
SET day=%datetime:~6,2% | ||
SET hour=%datetime:~8,2% | ||
SET minute=%datetime:~10,2% | ||
|
||
echo #pragma once > src/CommitHash.autogenerated | ||
echo #define REF_COMMIT_HASH "%REF_COMMIT_HASH%" >> src/CommitHash.autogenerated | ||
echo #define REF_TAG "%REF_TAG%" >> src/CommitHash.autogenerated | ||
echo #define REF_TAG_LONG "%REF_TAG_LONG%" >> src/CommitHash.autogenerated | ||
echo #define REF_COMMITS_PAST_TAG %REF_COMMITS_PAST_TAG% >> src/CommitHash.autogenerated | ||
echo #define REF_BRANCH "%REF_BRANCH%" >> src/CommitHash.autogenerated | ||
echo #define REF_TOTAL_COMMITS %REF_TOTAL_COMMITS% >> src/CommitHash.autogenerated | ||
echo #define REF_BUILD_DATE "%day%.%month%.%year%" >> src/CommitHash.autogenerated | ||
echo #define REF_BUILD_TIME "%hour%:%minute%" >> src/CommitHash.autogenerated |
Oops, something went wrong.