mirror of
https://github.com/Ed94/gencpp.git
synced 2024-12-22 07:44:45 -08:00
Compare commits
3 Commits
f90c0a59b6
...
d89c9a6072
Author | SHA1 | Date | |
---|---|---|---|
d89c9a6072 | |||
6aa99ac1d5 | |||
3989f5fa83 |
@ -2,7 +2,6 @@
|
|||||||
# It will most likely need a partial rewrite to segment the build process into separate script invocations based on the OS.
|
# It will most likely need a partial rewrite to segment the build process into separate script invocations based on the OS.
|
||||||
# That or just rewrite it in an sh script and call it a day.
|
# That or just rewrite it in an sh script and call it a day.
|
||||||
|
|
||||||
Import-Module ./helpers/target_arch.psm1
|
|
||||||
$target_arch = Join-Path $PSScriptRoot 'helpers/target_arch.psm1'
|
$target_arch = Join-Path $PSScriptRoot 'helpers/target_arch.psm1'
|
||||||
$devshell = Join-Path $PSScriptRoot 'helpers/devshell.ps1'
|
$devshell = Join-Path $PSScriptRoot 'helpers/devshell.ps1'
|
||||||
$format_cpp = Join-Path $PSScriptRoot 'helpers/format_cpp.psm1'
|
$format_cpp = Join-Path $PSScriptRoot 'helpers/format_cpp.psm1'
|
||||||
@ -10,7 +9,29 @@ $refactor_unreal = Join-Path $PSScriptRoot 'refactor_unreal.ps1'
|
|||||||
$incremental_checks = Join-Path $PSScriptRoot 'helpers/incremental_checks.ps1'
|
$incremental_checks = Join-Path $PSScriptRoot 'helpers/incremental_checks.ps1'
|
||||||
$vendor_toolchain = Join-Path $PSScriptRoot 'helpers/vendor_toolchain.ps1'
|
$vendor_toolchain = Join-Path $PSScriptRoot 'helpers/vendor_toolchain.ps1'
|
||||||
|
|
||||||
$path_root = git rev-parse --show-toplevel
|
Import-Module $target_arch
|
||||||
|
|
||||||
|
function Get-ScriptRepoRoot {
|
||||||
|
$currentPath = $PSScriptRoot
|
||||||
|
while ($currentPath -ne $null -and $currentPath -ne "")
|
||||||
|
{
|
||||||
|
if (Test-Path (Join-Path $currentPath ".git")) {
|
||||||
|
return $currentPath
|
||||||
|
}
|
||||||
|
# Also check for .git file which indicates a submodule
|
||||||
|
$gitFile = Join-Path $currentPath ".git"
|
||||||
|
if (Test-Path $gitFile -PathType Leaf)
|
||||||
|
{
|
||||||
|
$gitContent = Get-Content $gitFile
|
||||||
|
if ($gitContent -match "gitdir: (.+)") {
|
||||||
|
return $currentPath
|
||||||
|
}
|
||||||
|
}
|
||||||
|
$currentPath = Split-Path $currentPath -Parent
|
||||||
|
}
|
||||||
|
throw "Unable to find repository root"
|
||||||
|
}
|
||||||
|
$path_root = Get-ScriptRepoRoot
|
||||||
|
|
||||||
Import-Module $target_arch
|
Import-Module $target_arch
|
||||||
Import-Module $format_cpp
|
Import-Module $format_cpp
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
API_Export, GEN_API_Export_Code
|
API_Export, GEN_API_Export_Code
|
||||||
API_Import, GEN_API_Import_Code
|
API_Import, GEN_API_Import_Code
|
||||||
UE_DEPRECATED, UE_DEPRECATED
|
COREUOBJECT_API, COREUOBJECT_API
|
||||||
UMG_API, UMG_API
|
ENGINE_API, ENGINE_API
|
||||||
COREUOBJECT_API, COREUOBJECT_API
|
|
||||||
ENGINE_API, ENGINE_API
|
|
||||||
GAMEPLAYABILITIES_API, GAMEPLAYABILITIES_API
|
GAMEPLAYABILITIES_API, GAMEPLAYABILITIES_API
|
||||||
|
UMG_API, UMG_API
|
||||||
|
UE_DEPRECATED, UE_DEPRECATED
|
||||||
|
|
@ -1,6 +1,6 @@
|
|||||||
#define GEN_DEFINE_LIBRARY_CODE_CONSTANTS
|
#define GEN_DEFINE_LIBRARY_CODE_CONSTANTS
|
||||||
#define GEN_ENFORCE_STRONG_CODE_TYPES
|
#define GEN_ENFORCE_STRONG_CODE_TYPES
|
||||||
#define GEN_EXPOSE_BACKEDN
|
#define GEN_EXPOSE_BACKEND
|
||||||
#include "gen.cpp"
|
#include "gen.cpp"
|
||||||
|
|
||||||
#include "helpers/push_ignores.inline.hpp"
|
#include "helpers/push_ignores.inline.hpp"
|
||||||
@ -104,54 +104,6 @@ int gen_main()
|
|||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case Preprocess_Pragma:
|
|
||||||
{
|
|
||||||
macros.append(code);
|
|
||||||
continue;
|
|
||||||
|
|
||||||
local_persist bool found = false;
|
|
||||||
if (found)
|
|
||||||
{
|
|
||||||
macros.append(code);
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (code->Content.starts_with(txt("region ForceInline Definition")))
|
|
||||||
{
|
|
||||||
macros.append(code);
|
|
||||||
++ code;
|
|
||||||
|
|
||||||
CodeBody replacement = parse_global_body(StrC(txt(
|
|
||||||
R"(#ifdef GEN_COMPILER_MSVC
|
|
||||||
#define FORCEINLINE __forceinline
|
|
||||||
#define neverinline __declspec( noinline )
|
|
||||||
#elif defined( GEN_COMPILER_GCC )
|
|
||||||
#define FORCEINLINE inline __attribute__( ( __always_inline__ ) )
|
|
||||||
#define neverinline __attribute__( ( __noinline__ ) )
|
|
||||||
#elif defined( GEN_COMPILER_CLANG )
|
|
||||||
#if __has_attribute( __always_inline__ )
|
|
||||||
#define FORCEINLINE inline __attribute__( ( __always_inline__ ) )
|
|
||||||
#define neverinline __attribute__( ( __noinline__ ) )
|
|
||||||
#else
|
|
||||||
#define FORCEINLINE
|
|
||||||
#define neverinline
|
|
||||||
#endif
|
|
||||||
#else
|
|
||||||
#define FORCEINLINE
|
|
||||||
#define neverinline
|
|
||||||
#endif)")));
|
|
||||||
macros.append(replacement);
|
|
||||||
|
|
||||||
while (code->Type != ECode::Preprocess_Pragma
|
|
||||||
|| ! code->Content.starts_with(txt("endregion ForceInline Definition")))
|
|
||||||
++ code;
|
|
||||||
|
|
||||||
macros.append( code );
|
|
||||||
found = true;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
|
|
||||||
default:
|
default:
|
||||||
macros.append(code);
|
macros.append(code);
|
||||||
break;
|
break;
|
||||||
|
Loading…
Reference in New Issue
Block a user