32 Commits

Author SHA1 Message Date
Kawe Mazidjatari
d34b92ed61 Validate encoding for RapidJSON
Improves security. Add kParseValidateEncodingFlag to default flags.
2024-04-05 18:33:10 +02:00
Kawe Mazidjatari
8baef57ca3 Suppress w4295 for thirdparty
DirtySDK uses non-null terminated strings for lookup tables.
2024-04-05 18:33:09 +02:00
Kawe Mazidjatari
b68deadba0 CMake: regroup thirdparty libs in filters 2024-04-05 17:59:53 +02:00
Kawe Mazidjatari
4f4b029538 RapidJSON: use iterative parsing instead
Use iterative parsing to protect against stack overflows in rare cases
2024-04-05 17:56:51 +02:00
Kawe Mazidjatari
1783db92b5 CMake: improve linker performance
Improve linker performance by either enabling GL and LTGC on certain projects at the same time, enabling it for all projects, or disabling it all together
2024-04-05 17:46:57 +02:00
Kawe Mazidjatari
390084c9d8 CMake: remove OPTION_GAMEDLL
Only S3 is supported moving forward; see commit e825a1e7.
2024-04-05 17:19:34 +02:00
Kawe Mazidjatari
5967a0d011 Add additional warning codes to thirdparty warning suppressor 2024-04-05 16:34:29 +02:00
Kawe Mazidjatari
994658c4a2 Fixup hardcoded thirdparty directories in CMake files
Should be obtained from the 'THIRDPARTY_SOURCE_DIR' variable.
2024-04-05 16:21:45 +02:00
Kawe Mazidjatari
5c3b7d1b56 Enable SIMD optimizations for RapidJSON 2023-09-07 11:18:00 +02:00
Kawe Mazidjatari
a44b38eb15 Add new CMake options
Add options for IsRetail() and IsCert().
2023-08-21 20:40:05 +02:00
Kawe Mazidjatari
b967a11ffd Make switching source directories easier
Engine src dir can now be switched with 1 var in CMake.
2023-08-03 16:56:27 +02:00
Kawe Mazidjatari
e673b1e180 Suppress more thirdparty warnings
Only applied on thirdparty code.
2023-07-28 16:44:52 +02:00
Kawe Mazidjatari
89b92342d7 Add option to enable LTCG
CMake option for link-time code generation.
2023-07-03 15:40:45 +02:00
Kawe Mazidjatari
f6f3c7f9a2 More code cleanup
- Set character set to multi-byte (this is because the game is also build with it).
- Utility function 'FileExists' now takes a raw string pointer, this avoids having to construct a fs::path each time its getting called (which is quite a lot!).
- Performed overall cleanup to code containing logic to override load paths. Mostly removing unnecessary copy constructions.
2023-07-03 02:14:39 +02:00
Amos
48d81d2369 Add "PLATFORM_64NITS" define
Should be defined as platform is 64bits only.
2023-06-27 07:53:08 +02:00
Kawe Mazidjatari
884decd090 Set default debugger parameters
The debugger can now be immediately invoked on all runtime projects after generating the solution without having to set anything up.
2023-06-24 15:46:56 +02:00
Kawe Mazidjatari
3f8baf6f68 Allow setting compile options for specific targets
Previously, it was all controlled from the global init (applied to all projects), but some projects need different options. With these changes, you can disable the common options applied in the 'add_module' macro, and set your own if desired.
2023-06-17 00:45:27 +02:00
Kawe Mazidjatari
7c944b6dfb Fix intermittent PDB creation error
Option '/Zf' requires '/Zi', else it gets ignored.
2023-05-25 22:25:33 +02:00
Kawe Mazidjatari
c0c6c735a7 Improve build system
Added option: /Zf (Faster PDB generation); this was required as we enabled /MP. Without this, the compiler regularly fails to create a PDB.
Added option:  /EHsc (Standard C++ exception handling).
2023-05-18 14:07:52 +02:00
Kawe Mazidjatari
9f44bcc818 Treat compiler warnings as errors
Treat them as errors globally. Most of the time a warning is a bug, or problem in code that could be solved in a different (better) manner. Thirdparty code have this disabled. The warnings as errors option can be globally disabled through the CMake GUI, but this is not recommended.
2023-05-15 09:44:26 +02:00
Kawe Mazidjatari
c50f8d86f6 Add option for GameDLL version and source directory
Options could be set from the CMake GUI. By default, GameDLL version is set to 'GAMEDLL_S3', and engine source directory is set to 'r5dev/'.
2023-05-14 16:27:31 +02:00
Kawe Mazidjatari
7078a8b10a Fix syntax error
Fix small syntax error in post build event code.
2023-05-14 12:07:25 +02:00
Kawe Mazidjatari
d8ac2852ba Regenerate 'build.txt' after DLL project builds
This post build event function regenerates the 'build.txt' file after compiling the engine projects. It takes the branch name, commit hash (short), current time and time designator.
2023-05-14 12:03:16 +02:00
Kawe Mazidjatari
b3fc2c5adb Enable profiling for Profile builds
Enable linker option for profiling.
2023-05-14 02:28:53 +02:00
Kawe Mazidjatari
ede19e0472 Improve CMake macro's
Allow setting custom runtime output directories using the 'end_sources' macro. If parameter is empty, it will use "game/" (default).
2023-05-14 01:26:17 +02:00
Kawe Mazidjatari
2fd62b7091 Enable LTCG for executables and shared libraries
Enable Link Time Code Generation as some libraries are compiled using /GL (Whole Program Optimization) which requires the code generation to be delayed to link time. Not doing this will result in longer build times, as the linker has to terminate its progress if it links a library compiled with /GL, and restart this operation using /LTCG.
2023-05-13 19:44:41 +02:00
Kawe Mazidjatari
e5a455e7c7 Apply whole program optimization for certain targets
Only applied to certain targets to prevent bombing compile times; other projects don't really benefit of this.
2023-05-13 11:57:57 +02:00
Kawe Mazidjatari
8dbc2024c6 CMake code improvements
Use the 'add_module' macro to add modules without creating duplicate code. This macro also takes a reuse PCH as parameter, so modules that need a precompiled header, could reuse those from different targets that compile them. This commit also restructures the group order of the generated solution files for easier code navigation.
2023-05-13 00:14:53 +02:00
Kawe Mazidjatari
7a745a404a Add CMake macro for adding modules
Add macro for adding modules and setting all the properties at ones.
2023-05-11 23:50:57 +02:00
Kawe Mazidjatari
ce0ce28040 Cleanup main CMakeLists
Move init to 'Configure.cmake', and enable the use of folders within project files.
2023-05-11 23:50:06 +02:00
Kawe Mazidjatari
d1157fb54b Fix PDB path not getting written properly for shared libraries 2023-05-11 21:04:21 +02:00
Kawe Mazidjatari
807d660883 Add CMake macro's
Macro's performing project wide, and common operations. Crafted for r5sdk, but it is still partially incomplete.
2023-05-09 23:55:46 +02:00