-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #51 from Ed94/dev
- Loading branch information
Showing
37 changed files
with
13,151 additions
and
358 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
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,106 @@ | ||
Clear-Host | ||
|
||
$path_root = git rev-parse --show-toplevel | ||
$path_scripts = Join-Path $path_root 'scripts' | ||
|
||
$target_arch = Join-Path $path_scripts 'helpers/target_arch.psm1' | ||
$devshell = Join-Path $path_scripts 'helpers/devshell.ps1' | ||
$format_cpp = Join-Path $path_scripts 'helpers/format_cpp.psm1' | ||
$incremental_checks = Join-Path $path_scripts 'helpers/incremental_checks.ps1' | ||
$vendor_toolchain = Join-Path $path_scripts 'helpers/vendor_toolchain.ps1' | ||
|
||
$path_project = Join-Path $path_root 'project' | ||
$path_aux = Join-Path $path_project 'auxillary' | ||
$path_vis_root = Join-Path $path_aux 'vis_ast' | ||
$path_binaries = Join-Path $path_vis_root 'binaries' | ||
$path_build = Join-Path $path_vis_root 'build' | ||
$path_code = Join-Path $path_vis_root 'code' | ||
$path_win32 = Join-Path $path_code 'win32' | ||
|
||
Import-Module $target_arch | ||
Import-Module $format_cpp | ||
|
||
#region Arguments | ||
$vendor = $null | ||
$optimize = $null | ||
$debug = $null | ||
$analysis = $false | ||
$dev = $false | ||
$verbose = $null | ||
$platform = $null | ||
$module_specified = $false | ||
|
||
[array] $vendors = @( "clang", "msvc" ) | ||
|
||
# This is a really lazy way of parsing the args, could use actual params down the line... | ||
|
||
if ( $args ) { $args | ForEach-Object { | ||
switch ($_){ | ||
{ $_ -in $vendors } { $vendor = $_; break } | ||
"optimize" { $optimize = $true } | ||
"debug" { $debug = $true } | ||
"analysis" { $analysis = $true } | ||
"dev" { $dev = $true } | ||
"verbose" { $verbose = $true } | ||
"platform" { $platform = $true; $module_specified = $true } | ||
} | ||
}} | ||
#endregion Argument | ||
|
||
if ( -not $module_specified ) | ||
{ | ||
$platform = $true | ||
} | ||
|
||
# Load up toolchain configuraion | ||
. $vendor_toolchain | ||
. $incremental_checks | ||
|
||
write-host "Building Vis AST with $vendor" | ||
|
||
if ( (Test-Path $path_build) -eq $false ) { | ||
New-Item $path_build -ItemType Directory | ||
} | ||
|
||
if ( (Test-Path $path_binaries) -eq $false ) { | ||
New-Item $path_binaries -ItemType Directory | ||
} | ||
|
||
$includes = @( | ||
$paht_code | ||
) | ||
|
||
# Microsoft | ||
$lib_gdi32 = 'Gdi32.lib' | ||
$lib_xinput = 'Xinput.lib' | ||
$lib_user32 = 'User32.lib' | ||
$lib_winmm = 'Winmm.lib' | ||
|
||
$stack_size = 1024 * 1024 * 4 | ||
|
||
$compiler_args = @( | ||
($flag_define + 'UNICODE'), | ||
($flag_define + '_UNICODE') | ||
( $flag_define + 'INTELLISENSE_DIRECTIVES=0'), | ||
# ($flag_set_stack_size + $stack_size) | ||
$flag_wall | ||
$flag_warnings_as_errors | ||
$flag_optimize_intrinsics | ||
) | ||
|
||
if ( $dev ) { | ||
$compiler_args += ( $flag_define + 'Build_Development=1' ) | ||
} | ||
else { | ||
$compiler_args += ( $flag_define + 'Build_Development=0' ) | ||
} | ||
|
||
$linker_args = @( | ||
$flag_link_win_subsystem_windows, | ||
$flag_link_optiiize_references | ||
) | ||
|
||
$unit = join-path $path_code 'vis_ast_windows.cpp' | ||
$executable = join-path $path_binaries 'vis_ast.exe' | ||
|
||
$build_result = build-simple $path_build $includes $compiler_args $linker_args $unit $executable |
Empty file.
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,24 @@ | ||
#if INTELLISENSE_DIRECTIVES | ||
#include "vendor/compiler.hpp" | ||
#endif | ||
|
||
#define global static // Global variables | ||
#define internal static // Internal linkage | ||
#define local_persist static // Local Persisting variables | ||
|
||
#define api_c extern "C" | ||
|
||
#define ccast( type, value ) ( const_cast< type >( (value) ) ) | ||
#define pcast( type, value ) ( * reinterpret_cast< type* >( & ( value ) ) ) | ||
#define rcast( type, value ) reinterpret_cast< type >( value ) | ||
#define scast( type, value ) static_cast< type >( value ) | ||
|
||
#define do_once() for ( local_persist b32 once = true; once; once = false ) | ||
#define stmt( ... ) do { __VA_ARGS__; } while ( 0 ) | ||
|
||
#define array_count( array ) ( sizeof( array ) / sizeof( ( array )[0] ) ) | ||
|
||
#define kilobytes( x ) ( ( x ) * ( s64 )( 1024 ) ) | ||
#define megabytes( x ) ( kilobytes( x ) * ( s64 )( 1024 ) ) | ||
#define gigabytes( x ) ( megabytes( x ) * ( s64 )( 1024 ) ) | ||
#define terabytes( x ) ( gigabytes( x ) * ( s64 )( 1024 ) ) |
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,9 @@ | ||
// Platform architecture | ||
|
||
#if defined( _WIN64 ) || defined( __x86_64__ ) || defined( _M_X64 ) || defined( __64BIT__ ) || defined( __powerpc64__ ) || defined( __ppc64__ ) || defined( __aarch64__ ) | ||
# ifndef ARCH_64_BIT | ||
# define ARCH_64_BIT 1 | ||
# endif | ||
#else | ||
# error A 32-bit architecture is not supported | ||
#endif |
21 changes: 21 additions & 0 deletions
21
project/auxillary/vis_ast/code/platform/vendor/compiler.hpp
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,21 @@ | ||
// Platform compiler | ||
|
||
#if defined( _MSC_VER ) | ||
# define Compiler_MSVC 1 | ||
#elif defined( __clang__ ) | ||
# define Compiler_Clang 1 | ||
#else | ||
# error "Unknown compiler" | ||
#endif | ||
|
||
#if defined( __has_attribute ) | ||
# define HAS_ATTRIBUTE( attribute ) __has_attribute( attribute ) | ||
#else | ||
# define HAS_ATTRIBUTE( attribute ) ( 0 ) | ||
#endif | ||
|
||
#ifdef Compiler_Clang | ||
# define compiler_decorated_func_name __PRETTY_NAME__ | ||
#elif defined(Compiler_MSVC) | ||
# define compiler_decorated_func_name __FUNCDNAME__ | ||
#endif |
34 changes: 34 additions & 0 deletions
34
project/auxillary/vis_ast/code/platform/vendor/compiler_ignores.hpp
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,34 @@ | ||
#pragma once | ||
#if INTELLISENSE_DIRECTIVES | ||
#include "compiler.hpp" | ||
#endif | ||
|
||
#ifdef Compiler_MSVC | ||
#pragma warning( disable: 4201 ) // Support for non-standard nameless struct or union extesnion | ||
#pragma warning( disable: 4100 ) // Support for unreferenced formal parameters | ||
#pragma warning( disable: 4800 ) // Support implicit conversion to bools | ||
#pragma warning( disable: 4365 ) // Support for signed/unsigned mismatch auto-conversion | ||
#pragma warning( disable: 4189 ) // Support for unused variables | ||
#pragma warning( disable: 4514 ) // Support for unused inline functions | ||
#pragma warning( disable: 4505 ) // Support for unused static functions | ||
#pragma warning( disable: 5045 ) // Compiler will insert Spectre mitigation for memory load if /Qspectre switch specified | ||
#pragma warning( disable: 5264 ) // Support for 'const' variables unused | ||
#pragma warning( disable: 4820 ) // Support auto-adding padding to structs | ||
#pragma warning( disable: 4711 ) // Support automatic inline expansion | ||
#pragma warning( disable: 4710 ) // Support automatic inline expansion | ||
#pragma warning( disable: 4805 ) // Support comparisons of s32 to bool. | ||
#pragma warning( disable: 5246 ) // Support for initialization of subobject without braces. | ||
#endif | ||
|
||
#ifdef Compiler_Clang | ||
#pragma clang diagnostic push | ||
#pragma clang diagnostic ignored "-Wunused-const-variable" | ||
#pragma clang diagnostic ignored "-Wswitch" | ||
#pragma clang diagnostic ignored "-Wunused-variable" | ||
#pragma clang diagnostic ignored "-Wunused-local-typedef" | ||
#pragma clang diagnostic ignored "-Wunknown-pragmas" | ||
#pragma clang diagnostic ignored "-Wvarargs" | ||
#pragma clang diagnostic ignored "-Wunused-function" | ||
#pragma clang diagnostic ignored "-Wunused-but-set-variable" | ||
#pragma clang diagnostic ignored "-Wmissing-braces" | ||
#endif |
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,21 @@ | ||
// Platform OS detection | ||
|
||
#if defined( _WIN32 ) || defined( _WIN64 ) | ||
# ifndef System_Windows | ||
# define System_Windows 1 | ||
# endif | ||
#elif defined( __APPLE__ ) && defined( __MACH__ ) | ||
# ifndef System_MacOS | ||
# define System_MacOS 1 | ||
# endif | ||
#elif defined( __unix__ ) | ||
# if defined( __linux__ ) | ||
# ifndef System_Linux | ||
# define System_linux 1 | ||
# endif | ||
# else | ||
# error This UNIX operating system is not supported | ||
# endif | ||
#else | ||
# error This operating system is not supported | ||
#endif |
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,8 @@ | ||
#if INTELLISENSE_DIRECTIVES | ||
#include "win32.hpp" | ||
#endif | ||
|
||
int __stdcall WinMain( HINSTANCE instance, HINSTANCE prev_instance, char* commandline, int num_cmd_show) | ||
{ | ||
return 0; | ||
} |
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 @@ | ||
using HINSTANCE = void*; |
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,10 @@ | ||
#include "platform/vendor/arch.hpp" | ||
#include "platform/vendor/compiler.hpp" | ||
#include "platform/vendor/compiler_ignores.hpp" | ||
#include "platform/vendor/os.hpp" | ||
|
||
#include "platform/macros.hpp" | ||
|
||
#include "platform/win32/types.hpp" | ||
|
||
#include "platform/win32/launch.cpp" |
Oops, something went wrong.