mirror of
https://github.com/Ed94/gencpp.git
synced 2024-12-23 00:04:45 -08:00
Compare commits
No commits in common. "96ffca3094fecfd2475421c686064143c670923c" and "b5cf633e98adafde0891675f1451d6341ea15b1e" have entirely different histories.
96ffca3094
...
b5cf633e98
3
.vscode/settings.json
vendored
3
.vscode/settings.json
vendored
@ -56,8 +56,7 @@
|
|||||||
"new": "cpp",
|
"new": "cpp",
|
||||||
"typeinfo": "cpp",
|
"typeinfo": "cpp",
|
||||||
"unordered_map": "cpp",
|
"unordered_map": "cpp",
|
||||||
"xstddef": "cpp",
|
"xstddef": "cpp"
|
||||||
"gen_singleheader.h": "c"
|
|
||||||
},
|
},
|
||||||
"C_Cpp.intelliSenseEngineFallback": "disabled",
|
"C_Cpp.intelliSenseEngineFallback": "disabled",
|
||||||
"mesonbuild.configureOnOpen": true,
|
"mesonbuild.configureOnOpen": true,
|
||||||
|
@ -7,7 +7,7 @@
|
|||||||
|
|
||||||
#if GEN_COMPILER_MSVC
|
#if GEN_COMPILER_MSVC
|
||||||
#ifdef GEN_DYN_LINK
|
#ifdef GEN_DYN_LINK
|
||||||
#ifdef GEN_DYN_EXPORT
|
#ifdef GEN_EXPORTS
|
||||||
#define GEN_API __declspec(dllexport)
|
#define GEN_API __declspec(dllexport)
|
||||||
#else
|
#else
|
||||||
#define GEN_API __declspec(dllimport)
|
#define GEN_API __declspec(dllimport)
|
||||||
|
@ -350,8 +350,6 @@ word CodeVar, gen_CodeVar
|
|||||||
|
|
||||||
// Code Interface
|
// Code Interface
|
||||||
|
|
||||||
word Context, gen_Context
|
|
||||||
|
|
||||||
namespace code_, gen_code_
|
namespace code_, gen_code_
|
||||||
|
|
||||||
word Code_Global, gen_Code_Global
|
word Code_Global, gen_Code_Global
|
||||||
|
@ -1,9 +1,8 @@
|
|||||||
#define GEN_IMPLEMENTATION
|
#define GEN_IMPLEMENTATION
|
||||||
#include "gen/gen_singleheader.h"
|
#include "gen/gen_singleheader.h"
|
||||||
|
|
||||||
int gen_main()
|
int main()
|
||||||
{
|
{
|
||||||
// init();
|
// init();
|
||||||
__debugbreak();
|
__debugbreak();
|
||||||
return 0;
|
|
||||||
}
|
}
|
@ -1,3 +0,0 @@
|
|||||||
#define GEN_IMPLEMENTATION
|
|
||||||
#define GEN_DONT_ENFORCE_GEN_TIME_GUARD
|
|
||||||
#include "gen/gen_singleheader.h"
|
|
@ -18,12 +18,12 @@ Push-Location $path_root
|
|||||||
$vendor = $null
|
$vendor = $null
|
||||||
$release = $null
|
$release = $null
|
||||||
[bool] $verbose = $false
|
[bool] $verbose = $false
|
||||||
|
[bool] $shared = $false
|
||||||
|
[bool] $dyn_link = $false
|
||||||
[bool] $base = $false
|
[bool] $base = $false
|
||||||
[bool] $segmented = $false
|
[bool] $segmented = $false
|
||||||
[bool] $singleheader = $false
|
[bool] $singleheader = $false
|
||||||
[bool] $c_lib = $false
|
[bool] $c_library = $false
|
||||||
[bool] $c_lib_static = $false
|
|
||||||
[bool] $c_lib_dyn = $false
|
|
||||||
[bool] $unreal = $false
|
[bool] $unreal = $false
|
||||||
[bool] $test = $false
|
[bool] $test = $false
|
||||||
|
|
||||||
@ -37,12 +37,12 @@ if ( $args ) { $args | ForEach-Object {
|
|||||||
"verbose" { $verbose = $true }
|
"verbose" { $verbose = $true }
|
||||||
"release" { $release = $true }
|
"release" { $release = $true }
|
||||||
"debug" { $release = $false }
|
"debug" { $release = $false }
|
||||||
|
"shared" { $shared = $true }
|
||||||
|
"dyn_link" { $dyn_link = $true }
|
||||||
"base" { $base = $true }
|
"base" { $base = $true }
|
||||||
"segmented" { $segmented = $true }
|
"segmented" { $segmented = $true }
|
||||||
"singleheader" { $singleheader = $true }
|
"singleheader" { $singleheader = $true }
|
||||||
"c_lib" { $c_lib = $true }
|
"c_library" { $c_library = $true }
|
||||||
"c_lib_static" { $c_lib_static = $true }
|
|
||||||
"c_lib_dyn" { $c_lib_dyn = $true }
|
|
||||||
"unreal" { $unreal = $true }
|
"unreal" { $unreal = $true }
|
||||||
"test" { $test = $true }
|
"test" { $test = $true }
|
||||||
}
|
}
|
||||||
@ -75,9 +75,7 @@ else {
|
|||||||
$cannot_build = $base -eq $false
|
$cannot_build = $base -eq $false
|
||||||
$cannot_build = $cannot_build -and $segmented -eq $false
|
$cannot_build = $cannot_build -and $segmented -eq $false
|
||||||
$cannot_build = $cannot_build -and $singleheader -eq $false
|
$cannot_build = $cannot_build -and $singleheader -eq $false
|
||||||
$cannot_build = $cannot_build -and $c_lib -eq $false
|
$cannot_build = $cannot_build -and $c_library -eq $false
|
||||||
$cannot_build = $cannot_build -and $c_lib_static -eq $false
|
|
||||||
$cannot_build = $cannot_build -and $c_lib_dyn -eq $false
|
|
||||||
$cannot_build = $cannot_build -and $unreal -eq $false
|
$cannot_build = $cannot_build -and $unreal -eq $false
|
||||||
$cannot_build = $cannot_build -and $test -eq $false
|
$cannot_build = $cannot_build -and $test -eq $false
|
||||||
if ( $cannot_build ) {
|
if ( $cannot_build ) {
|
||||||
@ -215,7 +213,7 @@ if ( $singleheader )
|
|||||||
Pop-Location
|
Pop-Location
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( $c_lib -or $c_lib_static -or $c_lib_dyn )
|
if ( $c_library )
|
||||||
{
|
{
|
||||||
$path_build = join-path $path_c_library build
|
$path_build = join-path $path_c_library build
|
||||||
$path_gen = join-path $path_c_library gen
|
$path_gen = join-path $path_c_library gen
|
||||||
@ -251,38 +249,34 @@ if ( $c_lib -or $c_lib_static -or $c_lib_dyn )
|
|||||||
write-host "`nc_library generator completed in $($time_taken.TotalMilliseconds) ms"
|
write-host "`nc_library generator completed in $($time_taken.TotalMilliseconds) ms"
|
||||||
}
|
}
|
||||||
Pop-Location
|
Pop-Location
|
||||||
}
|
|
||||||
|
|
||||||
if ( $c_lib_static )
|
|
||||||
{
|
|
||||||
$includes = @( $path_c_library )
|
$includes = @( $path_c_library )
|
||||||
$unit = join-path $path_c_library "gen_c_lib.c"
|
$unit = join-path $path_c_library "gen.c"
|
||||||
$path_lib = join-path $path_build "gencpp_c11.lib"
|
$executable = join-path $path_build "gen_c_library_test.exe"
|
||||||
|
|
||||||
$compiler_args = @()
|
if ($vendor -eq "clang") {
|
||||||
$compiler_args += $flag_all_c
|
$compiler_args += '-x'
|
||||||
$compiler_args += $flag_updated_cpp_macro
|
$compiler_args += 'c'
|
||||||
$compiler_args += $flag_c11
|
$compiler_args += '-std=c11'
|
||||||
|
} elseif ($vendor -eq "msvc") {
|
||||||
|
$compiler_args += "/TC" # Compile as C
|
||||||
|
$compiler_args += "/Zc:__cplusplus" # Fix __cplusplus macro
|
||||||
|
$compiler_args += "/std:c11"
|
||||||
|
}
|
||||||
|
|
||||||
$linker_args = @()
|
$result = build-simple $path_build $includes $compiler_args $linker_args $unit $executable
|
||||||
$result = build-simple $path_build $includes $compiler_args $linker_args $unit $path_lib
|
|
||||||
}
|
|
||||||
|
|
||||||
if ( $c_lib_dyn )
|
Push-Location $path_c_library
|
||||||
{
|
if ( Test-Path( $executable ) ) {
|
||||||
$includes = @( $path_c_library )
|
write-host "`nRunning c_library test"
|
||||||
$unit = join-path $path_c_library "gen_c_lib.c"
|
$time_taken = Measure-Command { & $executable
|
||||||
$path_dll = join-path $path_build "gencpp_c11.dll"
|
| ForEach-Object {
|
||||||
|
write-host `t $_ -ForegroundColor Green
|
||||||
$compiler_args = @()
|
}
|
||||||
$compiler_args += $flag_all_c
|
}
|
||||||
$compiler_args += $flag_updated_cpp_macro
|
write-host "`nc_library generator completed in $($time_taken.TotalMilliseconds) ms"
|
||||||
$compiler_args += $flag_c11
|
}
|
||||||
$compiler_args += ( $flag_define + 'GEN_DYN_LINK' )
|
Pop-Location
|
||||||
$compiler_args += ( $flag_define + 'GEN_DYN_EXPORT' )
|
|
||||||
|
|
||||||
$linker_args = @()
|
|
||||||
$result = build-simple $path_build $includes $compiler_args $linker_args $unit $path_dll
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( $unreal )
|
if ( $unreal )
|
||||||
@ -325,24 +319,47 @@ if ( $unreal )
|
|||||||
. $refactor_unreal
|
. $refactor_unreal
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( $test )
|
# TODO(Ed): The unit testing needs a full rewrite
|
||||||
|
if ( $test -and $false )
|
||||||
{
|
{
|
||||||
$path_test_c_lib = join-path $path_test c_library
|
$path_gen = join-path $path_test gen
|
||||||
$path_build = join-path $path_test_c_lib build
|
$path_gen_build = join-path $path_gen build
|
||||||
|
$path_build = join-path $path_test build
|
||||||
|
$path_original = join-path $path_gen original
|
||||||
|
$path_components = join-path $path_original components
|
||||||
|
$path_dependencies = join-path $path_original dependencies
|
||||||
|
$path_helpers = join-path $path_original helpers
|
||||||
|
|
||||||
if ( -not(Test-Path($path_build) )) {
|
if ( -not(Test-Path($path_build) )) {
|
||||||
New-Item -ItemType Directory -Path $path_build
|
New-Item -ItemType Directory -Path $path_build
|
||||||
}
|
}
|
||||||
|
if ( -not(Test-Path($path_gen) )) {
|
||||||
|
New-Item -ItemType Directory -Path $path_gen
|
||||||
|
}
|
||||||
|
if ( -not(Test-Path($path_gen_build) )) {
|
||||||
|
New-Item -ItemType Directory -Path $path_gen_build
|
||||||
|
}
|
||||||
|
if ( -not(test-path $path_original)) {
|
||||||
|
new-item -ItemType Directory -Path $path_original
|
||||||
|
}
|
||||||
|
if ( -not(test-path $path_components)) {
|
||||||
|
new-item -ItemType Directory -Path $path_components
|
||||||
|
}
|
||||||
|
if ( -not(test-path $path_dependencies)) {
|
||||||
|
new-item -ItemType Directory -Path $path_dependencies
|
||||||
|
}
|
||||||
|
if ( -not(test-path $path_helpers)) {
|
||||||
|
new-item -ItemType Directory -Path $path_helpers
|
||||||
|
}
|
||||||
|
|
||||||
$includes = @( $path_c_library )
|
$path_bootstrap = join-path $path_project gen
|
||||||
$unit = join-path $path_test_c_lib "gen.c"
|
|
||||||
$executable = join-path $path_build "gen_c_library_test.exe"
|
$includes = @( $path_bootstrap )
|
||||||
|
$unit = join-path $path_test "test.cpp"
|
||||||
|
$executable = join-path $path_build "test.exe"
|
||||||
|
|
||||||
$compiler_args = @()
|
$compiler_args = @()
|
||||||
$compiler_args += ( $flag_define + 'GEN_TIME' )
|
$compiler_args += ( $flag_define + 'GEN_TIME' )
|
||||||
$compiler_args += $flag_all_c
|
|
||||||
$compiler_args += $flag_updated_cpp_macro
|
|
||||||
$compiler_args += $flag_c11
|
|
||||||
|
|
||||||
$linker_args = @(
|
$linker_args = @(
|
||||||
$flag_link_win_subsystem_console
|
$flag_link_win_subsystem_console
|
||||||
@ -350,15 +367,16 @@ if ( $test )
|
|||||||
|
|
||||||
$result = build-simple $path_build $includes $compiler_args $linker_args $unit $executable
|
$result = build-simple $path_build $includes $compiler_args $linker_args $unit $executable
|
||||||
|
|
||||||
Push-Location $path_test_c_lib
|
Push-Location $path_test
|
||||||
|
Write-Host $path_test
|
||||||
if ( Test-Path( $executable ) ) {
|
if ( Test-Path( $executable ) ) {
|
||||||
write-host "`nRunning c_library test"
|
write-host "`nRunning test generator"
|
||||||
$time_taken = Measure-Command { & $executable
|
$time_taken = Measure-Command { & $executable
|
||||||
| ForEach-Object {
|
| ForEach-Object {
|
||||||
write-host `t $_ -ForegroundColor Green
|
write-host `t $_ -ForegroundColor Green
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
write-host "`nc_library generator completed in $($time_taken.TotalMilliseconds) ms"
|
write-host "`nTest generator completed in $($time_taken.TotalMilliseconds) ms"
|
||||||
}
|
}
|
||||||
Pop-Location
|
Pop-Location
|
||||||
}
|
}
|
||||||
|
@ -22,40 +22,6 @@ if ( $dev ) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
# Add new function for running lib.exe
|
|
||||||
function run-archiver
|
|
||||||
{
|
|
||||||
param( $archiver, $library, $lib_args )
|
|
||||||
|
|
||||||
write-host "`Creating library $library"
|
|
||||||
if ( $verbose ) {
|
|
||||||
write-host "Lib manager config:"
|
|
||||||
$lib_args | ForEach-Object {
|
|
||||||
write-host $_ -ForegroundColor Cyan
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
$time_taken = Measure-Command {
|
|
||||||
& $archiver $lib_args 2>&1 | ForEach-Object {
|
|
||||||
$color = 'White'
|
|
||||||
switch ($_){
|
|
||||||
{ $_ -match "error" } { $color = 'Red' ; break }
|
|
||||||
{ $_ -match "warning" } { $color = 'Yellow'; break }
|
|
||||||
}
|
|
||||||
write-host `t $_ -ForegroundColor $color
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if ( $LASTEXITCODE -eq 0 ) {
|
|
||||||
write-host "$library creation finished in $($time_taken.TotalMilliseconds) ms`n"
|
|
||||||
return $true
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
write-host "Library creation failed for $library`n" -ForegroundColor Red
|
|
||||||
return $false
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
function run-compiler
|
function run-compiler
|
||||||
{
|
{
|
||||||
param( $compiler, $unit, $compiler_args )
|
param( $compiler, $unit, $compiler_args )
|
||||||
@ -129,8 +95,7 @@ function run-linker
|
|||||||
if ( $vendor -match "clang" )
|
if ( $vendor -match "clang" )
|
||||||
{
|
{
|
||||||
# https://clang.llvm.org/docs/ClangCommandLineReference.html
|
# https://clang.llvm.org/docs/ClangCommandLineReference.html
|
||||||
$flag_all_c = @('-x', 'c')
|
$flag_all_c = '-x c'
|
||||||
$flag_c11 = '-std=c11'
|
|
||||||
$flag_all_cpp = '-x c++'
|
$flag_all_cpp = '-x c++'
|
||||||
$flag_compile = '-c'
|
$flag_compile = '-c'
|
||||||
$flag_color_diagnostics = '-fcolor-diagnostics'
|
$flag_color_diagnostics = '-fcolor-diagnostics'
|
||||||
@ -209,8 +174,8 @@ if ( $vendor -match "clang" )
|
|||||||
$map = join-path $path_output (split-path $map -Leaf)
|
$map = join-path $path_output (split-path $map -Leaf)
|
||||||
|
|
||||||
# This allows dll reloads at runtime to work (jankily, use below if not interested)
|
# This allows dll reloads at runtime to work (jankily, use below if not interested)
|
||||||
# $pdb = $binary -replace '\.(exe|dll)$', "_$(get-random).pdb"
|
$pdb = $binary -replace '\.(exe|dll)$', "_$(get-random).pdb"
|
||||||
$pdb = $binary -replace '\.(exe|dll)$', ".pdb"
|
# $pdb = $binary -replace '\.(exe|dll)$', ".pdb"
|
||||||
|
|
||||||
$compiler_args += @(
|
$compiler_args += @(
|
||||||
$flag_no_color_diagnostics,
|
$flag_no_color_diagnostics,
|
||||||
@ -288,8 +253,8 @@ if ( $vendor -match "clang" )
|
|||||||
$map = join-path $path_output (split-path $map -Leaf)
|
$map = join-path $path_output (split-path $map -Leaf)
|
||||||
|
|
||||||
# This allows dll reloads at runtime to work (jankily, use below if not interested)
|
# This allows dll reloads at runtime to work (jankily, use below if not interested)
|
||||||
# $pdb = $binary -replace '\.(exe|dll)$', "_$(get-random).pdb"
|
$pdb = $binary -replace '\.(exe|dll)$', "_$(get-random).pdb"
|
||||||
$pdb = $binary -replace '\.(exe|dll)$', ".pdb"
|
# $pdb = $binary -replace '\.(exe|dll)$', ".pdb"
|
||||||
|
|
||||||
$compiler_args += @(
|
$compiler_args += @(
|
||||||
$flag_no_color_diagnostics,
|
$flag_no_color_diagnostics,
|
||||||
@ -343,22 +308,10 @@ if ( $vendor -match "clang" )
|
|||||||
$linker_args += $_ + '.lib'
|
$linker_args += $_ + '.lib'
|
||||||
}
|
}
|
||||||
|
|
||||||
# Check if output is a static library
|
|
||||||
# if ( $binary -match '\.lib$' )
|
|
||||||
# {
|
|
||||||
# $lib_args = @()
|
|
||||||
# $lib_args += $flag_nologo
|
|
||||||
# $lib_args += $flag_link_win_machine_64
|
|
||||||
# $lib_args += ( $flag_link_win_path_output + $binary )
|
|
||||||
# $lib_args += $object
|
|
||||||
# return run-archiver $archiver $binary $lib_args
|
|
||||||
# }
|
|
||||||
|
|
||||||
$linker_args += $object
|
$linker_args += $object
|
||||||
return run-linker $linker $binary $linker_args
|
return run-linker $linker $binary $linker_args
|
||||||
}
|
}
|
||||||
|
|
||||||
$archiver = 'llvm-ar'
|
|
||||||
$compiler = 'clang++'
|
$compiler = 'clang++'
|
||||||
$linker = 'lld-link'
|
$linker = 'lld-link'
|
||||||
}
|
}
|
||||||
@ -367,7 +320,6 @@ if ( $vendor -match "msvc" )
|
|||||||
{
|
{
|
||||||
# https://learn.microsoft.com/en-us/cpp/build/reference/compiler-options-listed-by-category?view=msvc-170
|
# https://learn.microsoft.com/en-us/cpp/build/reference/compiler-options-listed-by-category?view=msvc-170
|
||||||
$flag_all_c = '/TC'
|
$flag_all_c = '/TC'
|
||||||
$flag_c11 = '/std:c11'
|
|
||||||
$flag_all_cpp = '/TP'
|
$flag_all_cpp = '/TP'
|
||||||
$flag_compile = '/c'
|
$flag_compile = '/c'
|
||||||
$flag_debug = '/Zi'
|
$flag_debug = '/Zi'
|
||||||
@ -380,7 +332,6 @@ if ( $vendor -match "msvc" )
|
|||||||
$flag_dll = '/LD'
|
$flag_dll = '/LD'
|
||||||
$flag_dll_debug = '/LDd'
|
$flag_dll_debug = '/LDd'
|
||||||
$flag_linker = '/link'
|
$flag_linker = '/link'
|
||||||
# $flag_link_lib = '/lib'
|
|
||||||
$flag_link_dll = '/DLL'
|
$flag_link_dll = '/DLL'
|
||||||
$flag_link_no_incremental = '/INCREMENTAL:NO'
|
$flag_link_no_incremental = '/INCREMENTAL:NO'
|
||||||
$flag_link_mapfile = '/MAP:'
|
$flag_link_mapfile = '/MAP:'
|
||||||
@ -403,17 +354,15 @@ if ( $vendor -match "msvc" )
|
|||||||
$flag_optimized_debug_forceinline = '/d2Obforceinline'
|
$flag_optimized_debug_forceinline = '/d2Obforceinline'
|
||||||
$flag_optimized_debug = '/Zo'
|
$flag_optimized_debug = '/Zo'
|
||||||
$flag_
|
$flag_
|
||||||
# $flag_out_name = '/OUT:'
|
$flag_out_name = '/OUT:'
|
||||||
$flag_path_interm = '/Fo'
|
$flag_path_interm = '/Fo'
|
||||||
$flag_path_debug = '/Fd'
|
$flag_path_debug = '/Fd'
|
||||||
$flag_path_output = '/Fe'
|
$flag_path_output = '/Fe'
|
||||||
$flag_preprocess_conform = '/Zc:preprocessor'
|
$flag_preprocess_conform = '/Zc:preprocessor'
|
||||||
$flag_updated_cpp_macro = "/Zc:__cplusplus"
|
|
||||||
$flag_set_stack_size = '/F'
|
$flag_set_stack_size = '/F'
|
||||||
$flag_syntax_only = '/Zs'
|
$flag_syntax_only = '/Zs'
|
||||||
$flag_wall = '/Wall'
|
$flag_wall = '/Wall'
|
||||||
$flag_warnings_as_errors = '/WX'
|
$flag_warnings_as_errors = '/WX'
|
||||||
$flag_lib_list = '/LIST'
|
|
||||||
|
|
||||||
function build
|
function build
|
||||||
{
|
{
|
||||||
@ -425,8 +374,8 @@ if ( $vendor -match "msvc" )
|
|||||||
$map = join-path $path_output (split-path $map -Leaf)
|
$map = join-path $path_output (split-path $map -Leaf)
|
||||||
|
|
||||||
# This allows dll reloads at runtime to work (jankily, use below if not interested)
|
# This allows dll reloads at runtime to work (jankily, use below if not interested)
|
||||||
# $pdb = $binary -replace '\.(exe|dll)$', "_$(get-random).pdb"
|
$pdb = $binary -replace '\.(exe|dll)$', "_$(get-random).pdb"
|
||||||
$pdb = $binary -replace '\.(exe|dll)$', ".pdb"
|
# $pdb = $binary -replace '\.(exe|dll)$', ".pdb"
|
||||||
|
|
||||||
$compiler_args += @(
|
$compiler_args += @(
|
||||||
$flag_nologo,
|
$flag_nologo,
|
||||||
@ -512,8 +461,8 @@ if ( $vendor -match "msvc" )
|
|||||||
$map = join-path $path_output (split-path $map -Leaf)
|
$map = join-path $path_output (split-path $map -Leaf)
|
||||||
|
|
||||||
# This allows dll reloads at runtime to work (jankily, use below if not interested)
|
# This allows dll reloads at runtime to work (jankily, use below if not interested)
|
||||||
# $pdb = $binary -replace '\.(exe|dll)$', "_$(get-random).pdb"
|
$pdb = $binary -replace '\.(exe|dll)$', "_$(get-random).pdb"
|
||||||
$pdb = $binary -replace '\.(exe|dll)$', ".pdb"
|
# $pdb = $binary -replace '\.(exe|dll)$', ".pdb"
|
||||||
|
|
||||||
$compiler_args += @(
|
$compiler_args += @(
|
||||||
$flag_nologo,
|
$flag_nologo,
|
||||||
@ -559,17 +508,6 @@ if ( $vendor -match "msvc" )
|
|||||||
return $false;
|
return $false;
|
||||||
}
|
}
|
||||||
|
|
||||||
# Check if output is a static library
|
|
||||||
if ( $binary -match '\.lib$' )
|
|
||||||
{
|
|
||||||
$lib_args = @()
|
|
||||||
$lib_args += $flag_nologo
|
|
||||||
$lib_args += $flag_link_win_machine_64
|
|
||||||
$lib_args += ( $flag_link_win_path_output + $binary )
|
|
||||||
$lib_args += $object
|
|
||||||
return run-archiver $archiver $binary $lib_args
|
|
||||||
}
|
|
||||||
|
|
||||||
$linker_args += @(
|
$linker_args += @(
|
||||||
$flag_nologo,
|
$flag_nologo,
|
||||||
$flag_link_win_machine_64,
|
$flag_link_win_machine_64,
|
||||||
@ -584,19 +522,10 @@ if ( $vendor -match "msvc" )
|
|||||||
else {
|
else {
|
||||||
}
|
}
|
||||||
|
|
||||||
# Check if output is a dynamic library
|
|
||||||
if ( $binary -match '\.dll$' ) {
|
|
||||||
$linker_args += $flag_link_dll
|
|
||||||
}
|
|
||||||
$linker_args += $object
|
$linker_args += $object
|
||||||
# Write-Host "link args:"
|
|
||||||
# $linker_args | ForEach-Object {
|
|
||||||
# Write-Host "`t$_" -ForegroundColor Yellow
|
|
||||||
# }
|
|
||||||
return run-linker $linker $binary $linker_args
|
return run-linker $linker $binary $linker_args
|
||||||
}
|
}
|
||||||
|
|
||||||
$archiver = 'lib'
|
|
||||||
$compiler = 'cl'
|
$compiler = 'cl'
|
||||||
$linker = 'link'
|
$linker = 'link'
|
||||||
}
|
}
|
||||||
|
@ -4,14 +4,16 @@ Import-Module $misc
|
|||||||
$build = Join-Path $PSScriptRoot 'build.ci.ps1'
|
$build = Join-Path $PSScriptRoot 'build.ci.ps1'
|
||||||
|
|
||||||
if ( $IsWindows ) {
|
if ( $IsWindows ) {
|
||||||
& $build release msvc debug base segmented singleheader unreal c_lib c_lib_static c_lib_dyn
|
& $build release msvc base segmented singleheader unreal c_library msvc debug
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
& $build release clang base segmented singleheader unreal c_library msvc debug
|
||||||
}
|
}
|
||||||
|
|
||||||
$path_root = Get-ScriptRepoRoot
|
$path_root = Get-ScriptRepoRoot
|
||||||
$path_docs = Join-Path $path_root docs
|
$path_docs = Join-Path $path_root docs
|
||||||
$path_base = Join-Path $path_root base
|
$path_base = Join-Path $path_root base
|
||||||
$path_c_library = Join-Path $path_root gen_c_library
|
$path_c_library = Join-Path $path_root gen_c_library
|
||||||
$path_c_library_build = Join-Path $path_c_library build
|
|
||||||
$path_c_library_gen = Join-Path $path_c_library gen
|
$path_c_library_gen = Join-Path $path_c_library gen
|
||||||
$path_segmented = Join-Path $path_root gen_segmented
|
$path_segmented = Join-Path $path_root gen_segmented
|
||||||
$path_segmented_gen = Join-Path $path_segmented gen
|
$path_segmented_gen = Join-Path $path_segmented gen
|
||||||
@ -85,20 +87,6 @@ Copy-Item -Verbose -Path $path_c_library_gen\gen.h -Destination $path
|
|||||||
Compress-Archive -Path $path_release_content\* -DestinationPath $path_release\gencpp_c11_segmented.zip -Force
|
Compress-Archive -Path $path_release_content\* -DestinationPath $path_release\gencpp_c11_segmented.zip -Force
|
||||||
Remove-Item -Path $path_release_content -Recurse
|
Remove-Item -Path $path_release_content -Recurse
|
||||||
|
|
||||||
# C Library Segmented
|
|
||||||
prep-ReleaseContent
|
|
||||||
Copy-Item -Verbose -Path $path_c_library\Readme.md -Destination $path_release_content
|
|
||||||
Copy-Item -Verbose -Path $path_c_library_gen\gen.dep.c -Destination $path_release_content
|
|
||||||
Copy-Item -Verbose -Path $path_c_library_gen\gen.dep.h -Destination $path_release_content
|
|
||||||
Copy-Item -Verbose -Path $path_c_library_gen\gen.c -Destination $path_release_content
|
|
||||||
Copy-Item -Verbose -Path $path_c_library_gen\gen.h -Destination $path_release_content
|
|
||||||
Compress-Archive -Path $path_release_content\* -DestinationPath $path_release\gencpp_c11_segmented.zip -Force
|
|
||||||
Remove-Item -Path $path_release_content -Recurse
|
|
||||||
|
|
||||||
# C Lib Static & Dyanmic Libs
|
|
||||||
Copy-Item -Verbose -Path $path_c_library_build\gencpp_c11.lib -Destination $path_release
|
|
||||||
Copy-Item -Verbose -Path $path_c_library_build\gencpp_c11.dll -Destination $path_release
|
|
||||||
|
|
||||||
# Base
|
# Base
|
||||||
|
|
||||||
prep-ReleaseContent
|
prep-ReleaseContent
|
||||||
|
Loading…
Reference in New Issue
Block a user