Skip to content

Commit 9bd6dac

Browse files
authored
Merge pull request #51 from Ed94/dev
2 parents 912cc6b + 212d907 commit 9bd6dac

37 files changed

Lines changed: 13151 additions & 358 deletions

.gitignore

Lines changed: 6 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -16,25 +16,15 @@
1616
gencpp.hpp
1717
gencpp.cpp
1818

19-
# Build results
20-
[Dd]ebug/
21-
[Dd]ebugPublic/
22-
[Rr]elease/
23-
[Rr]eleases/
24-
x64/
25-
x86/
26-
[Ww][Ii][Nn]32/
27-
[Aa][Rr][Mm]/
28-
[Aa][Rr][Mm]64/
29-
bld/
30-
[Bb]in/
31-
[Oo]bj/
32-
[Ll]og/
33-
[Ll]ogs/
34-
vc140.pdb
19+
**/*.lib
20+
**/*.pdb
21+
**/*.exe
22+
**/*.dll
3523

24+
release/**
3625

3726
# Unreal
3827
**/Unreal/*.h
3928
**/Unreal/*.cpp
4029
! **/Unreal/validate.unreal.cpp
30+
project/auxillary/vis_ast/dependencies/temp

.vscode/c_cpp_properties.json

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,8 @@
1212
"GEN_TIME",
1313
"GEN_IMPLEMENTATION",
1414
// "GEN_DONT_USE_NAMESPACE"
15-
"GEN_INTELLISENSE_DIRECTIVES"
15+
"GEN_INTELLISENSE_DIRECTIVES",
16+
"INTELLISENSE_DIRECTIVES"
1617
],
1718
"windowsSdkVersion": "10.0.19041.0",
1819
"compilerPath": "C:/Program Files/Microsoft Visual Studio/2022/Professional/VC/Tools/MSVC/14.29.30133/bin/HostX64/x64/cl.exe",
@@ -31,7 +32,8 @@
3132
"GEN_TIME",
3233
"GEN_IMPLEMENTATION",
3334
// "GEN_DONT_USE_NAMESPACE"
34-
"GEN_INTELLISENSE_DIRECTIVES"
35+
"GEN_INTELLISENSE_DIRECTIVES",
36+
"INTELLISENSE_DIRECTIVES"
3537
],
3638
"windowsSdkVersion": "10.0.19041.0",
3739
"compilerPath": "C:/Users/Ed/scoop/apps/llvm/current/bin/clang++.exe",

.vscode/launch.json

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,15 @@
4040
"args": [],
4141
"cwd": "${workspaceFolder}/singleheader/",
4242
"visualizerFile": "${workspaceFolder}/scripts/gencpp.natvis"
43+
},
44+
{
45+
"type": "cppvsdbg",
46+
"request": "launch",
47+
"name": "Debug raylib refactor vsdbg",
48+
"program": "${workspaceFolder}/project/auxillary/vis_ast/dependencies/raylib/build/raylib_refactor.exe",
49+
"args": [],
50+
"cwd": "${workspaceFolder}/project/auxillary/vis_ast/dependencies/temp/raylib-master/src/",
51+
"visualizerFile": "${workspaceFolder}/scripts/gencpp.natvis"
4352
}
4453
]
4554
}

.vscode/settings.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,9 @@
2828
"functional": "cpp",
2929
"vector": "cpp",
3030
"list": "cpp",
31-
"xhash": "cpp"
31+
"xhash": "cpp",
32+
"glfw3.h": "c",
33+
"stdbool.h": "c"
3234
},
3335
"C_Cpp.intelliSenseEngineFallback": "disabled",
3436
"mesonbuild.configureOnOpen": true,
Lines changed: 106 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,106 @@
1+
Clear-Host
2+
3+
$path_root = git rev-parse --show-toplevel
4+
$path_scripts = Join-Path $path_root 'scripts'
5+
6+
$target_arch = Join-Path $path_scripts 'helpers/target_arch.psm1'
7+
$devshell = Join-Path $path_scripts 'helpers/devshell.ps1'
8+
$format_cpp = Join-Path $path_scripts 'helpers/format_cpp.psm1'
9+
$incremental_checks = Join-Path $path_scripts 'helpers/incremental_checks.ps1'
10+
$vendor_toolchain = Join-Path $path_scripts 'helpers/vendor_toolchain.ps1'
11+
12+
$path_project = Join-Path $path_root 'project'
13+
$path_aux = Join-Path $path_project 'auxillary'
14+
$path_vis_root = Join-Path $path_aux 'vis_ast'
15+
$path_binaries = Join-Path $path_vis_root 'binaries'
16+
$path_build = Join-Path $path_vis_root 'build'
17+
$path_code = Join-Path $path_vis_root 'code'
18+
$path_win32 = Join-Path $path_code 'win32'
19+
20+
Import-Module $target_arch
21+
Import-Module $format_cpp
22+
23+
#region Arguments
24+
$vendor = $null
25+
$optimize = $null
26+
$debug = $null
27+
$analysis = $false
28+
$dev = $false
29+
$verbose = $null
30+
$platform = $null
31+
$module_specified = $false
32+
33+
[array] $vendors = @( "clang", "msvc" )
34+
35+
# This is a really lazy way of parsing the args, could use actual params down the line...
36+
37+
if ( $args ) { $args | ForEach-Object {
38+
switch ($_){
39+
{ $_ -in $vendors } { $vendor = $_; break }
40+
"optimize" { $optimize = $true }
41+
"debug" { $debug = $true }
42+
"analysis" { $analysis = $true }
43+
"dev" { $dev = $true }
44+
"verbose" { $verbose = $true }
45+
"platform" { $platform = $true; $module_specified = $true }
46+
}
47+
}}
48+
#endregion Argument
49+
50+
if ( -not $module_specified )
51+
{
52+
$platform = $true
53+
}
54+
55+
# Load up toolchain configuraion
56+
. $vendor_toolchain
57+
. $incremental_checks
58+
59+
write-host "Building Vis AST with $vendor"
60+
61+
if ( (Test-Path $path_build) -eq $false ) {
62+
New-Item $path_build -ItemType Directory
63+
}
64+
65+
if ( (Test-Path $path_binaries) -eq $false ) {
66+
New-Item $path_binaries -ItemType Directory
67+
}
68+
69+
$includes = @(
70+
$paht_code
71+
)
72+
73+
# Microsoft
74+
$lib_gdi32 = 'Gdi32.lib'
75+
$lib_xinput = 'Xinput.lib'
76+
$lib_user32 = 'User32.lib'
77+
$lib_winmm = 'Winmm.lib'
78+
79+
$stack_size = 1024 * 1024 * 4
80+
81+
$compiler_args = @(
82+
($flag_define + 'UNICODE'),
83+
($flag_define + '_UNICODE')
84+
( $flag_define + 'INTELLISENSE_DIRECTIVES=0'),
85+
# ($flag_set_stack_size + $stack_size)
86+
$flag_wall
87+
$flag_warnings_as_errors
88+
$flag_optimize_intrinsics
89+
)
90+
91+
if ( $dev ) {
92+
$compiler_args += ( $flag_define + 'Build_Development=1' )
93+
}
94+
else {
95+
$compiler_args += ( $flag_define + 'Build_Development=0' )
96+
}
97+
98+
$linker_args = @(
99+
$flag_link_win_subsystem_windows,
100+
$flag_link_optiiize_references
101+
)
102+
103+
$unit = join-path $path_code 'vis_ast_windows.cpp'
104+
$executable = join-path $path_binaries 'vis_ast.exe'
105+
106+
$build_result = build-simple $path_build $includes $compiler_args $linker_args $unit $executable

project/auxillary/vis_ast/clean.ps1

Whitespace-only changes.
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
#if INTELLISENSE_DIRECTIVES
2+
#include "vendor/compiler.hpp"
3+
#endif
4+
5+
#define global static // Global variables
6+
#define internal static // Internal linkage
7+
#define local_persist static // Local Persisting variables
8+
9+
#define api_c extern "C"
10+
11+
#define ccast( type, value ) ( const_cast< type >( (value) ) )
12+
#define pcast( type, value ) ( * reinterpret_cast< type* >( & ( value ) ) )
13+
#define rcast( type, value ) reinterpret_cast< type >( value )
14+
#define scast( type, value ) static_cast< type >( value )
15+
16+
#define do_once() for ( local_persist b32 once = true; once; once = false )
17+
#define stmt( ... ) do { __VA_ARGS__; } while ( 0 )
18+
19+
#define array_count( array ) ( sizeof( array ) / sizeof( ( array )[0] ) )
20+
21+
#define kilobytes( x ) ( ( x ) * ( s64 )( 1024 ) )
22+
#define megabytes( x ) ( kilobytes( x ) * ( s64 )( 1024 ) )
23+
#define gigabytes( x ) ( megabytes( x ) * ( s64 )( 1024 ) )
24+
#define terabytes( x ) ( gigabytes( x ) * ( s64 )( 1024 ) )
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
// Platform architecture
2+
3+
#if defined( _WIN64 ) || defined( __x86_64__ ) || defined( _M_X64 ) || defined( __64BIT__ ) || defined( __powerpc64__ ) || defined( __ppc64__ ) || defined( __aarch64__ )
4+
# ifndef ARCH_64_BIT
5+
# define ARCH_64_BIT 1
6+
# endif
7+
#else
8+
# error A 32-bit architecture is not supported
9+
#endif
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
// Platform compiler
2+
3+
#if defined( _MSC_VER )
4+
# define Compiler_MSVC 1
5+
#elif defined( __clang__ )
6+
# define Compiler_Clang 1
7+
#else
8+
# error "Unknown compiler"
9+
#endif
10+
11+
#if defined( __has_attribute )
12+
# define HAS_ATTRIBUTE( attribute ) __has_attribute( attribute )
13+
#else
14+
# define HAS_ATTRIBUTE( attribute ) ( 0 )
15+
#endif
16+
17+
#ifdef Compiler_Clang
18+
# define compiler_decorated_func_name __PRETTY_NAME__
19+
#elif defined(Compiler_MSVC)
20+
# define compiler_decorated_func_name __FUNCDNAME__
21+
#endif
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
#pragma once
2+
#if INTELLISENSE_DIRECTIVES
3+
#include "compiler.hpp"
4+
#endif
5+
6+
#ifdef Compiler_MSVC
7+
#pragma warning( disable: 4201 ) // Support for non-standard nameless struct or union extesnion
8+
#pragma warning( disable: 4100 ) // Support for unreferenced formal parameters
9+
#pragma warning( disable: 4800 ) // Support implicit conversion to bools
10+
#pragma warning( disable: 4365 ) // Support for signed/unsigned mismatch auto-conversion
11+
#pragma warning( disable: 4189 ) // Support for unused variables
12+
#pragma warning( disable: 4514 ) // Support for unused inline functions
13+
#pragma warning( disable: 4505 ) // Support for unused static functions
14+
#pragma warning( disable: 5045 ) // Compiler will insert Spectre mitigation for memory load if /Qspectre switch specified
15+
#pragma warning( disable: 5264 ) // Support for 'const' variables unused
16+
#pragma warning( disable: 4820 ) // Support auto-adding padding to structs
17+
#pragma warning( disable: 4711 ) // Support automatic inline expansion
18+
#pragma warning( disable: 4710 ) // Support automatic inline expansion
19+
#pragma warning( disable: 4805 ) // Support comparisons of s32 to bool.
20+
#pragma warning( disable: 5246 ) // Support for initialization of subobject without braces.
21+
#endif
22+
23+
#ifdef Compiler_Clang
24+
#pragma clang diagnostic push
25+
#pragma clang diagnostic ignored "-Wunused-const-variable"
26+
#pragma clang diagnostic ignored "-Wswitch"
27+
#pragma clang diagnostic ignored "-Wunused-variable"
28+
#pragma clang diagnostic ignored "-Wunused-local-typedef"
29+
#pragma clang diagnostic ignored "-Wunknown-pragmas"
30+
#pragma clang diagnostic ignored "-Wvarargs"
31+
#pragma clang diagnostic ignored "-Wunused-function"
32+
#pragma clang diagnostic ignored "-Wunused-but-set-variable"
33+
#pragma clang diagnostic ignored "-Wmissing-braces"
34+
#endif

0 commit comments

Comments
 (0)