Cleaned up buildsuper name convention; added defines to scripts

master
Allen Webster 2020-02-07 17:02:42 -08:00
parent 06aec5df47
commit 3ef04faead
9 changed files with 29 additions and 43 deletions

View File

@ -512,8 +512,19 @@ buildsuper(Arena *arena, char *cdir, char *file, u32 arch){
Temp_Dir temp = fm_pushdir(fm_str(arena, BUILD_DIR));
char *build_script_postfix = "";
if (This_OS == Platform_Mac){
build_script_postfix = "-mac";
switch (This_OS){
case Platform_Windows:
{
build_script_postfix = "-win";
}break;
case Platform_Linux:
{
build_script_postfix = "-linux";
}break;
case Platform_Mac:
{
build_script_postfix = "-mac";
}break;
}
char *build_script = fm_str(arena, "custom/bin/buildsuper_", arch_names[arch], build_script_postfix, BAT);

View File

@ -14,7 +14,7 @@ if [ -z "$SOURCE" ]; then
SOURCE="$(readlink -f "$CODE_HOME/4coder_default_bindings.cpp")"
fi
opts="-Wno-write-strings -Wno-null-dereference -Wno-comment -Wno-switch -Wno-writable-strings -g"
opts="-Wno-write-strings -Wno-null-dereference -Wno-comment -Wno-switch -Wno-writable-strings -g -DOS_LINUX=1 -DOS_WINDOWS=0 -DOS_MAC=1"
arch=-m64
preproc_file=4coder_command_metadata.i

View File

@ -15,7 +15,7 @@ if [ -z "$SOURCE" ]; then
fi
# NOTE(yuval): Removed -Wno-writable-strings as it is the same as -Wno-write-strings
opts="-Wno-write-strings -Wno-null-dereference -Wno-comment -Wno-switch -Wno-missing-declarations -Wno-logical-op-parentheses -g"
opts="-Wno-write-strings -Wno-null-dereference -Wno-comment -Wno-switch -Wno-missing-declarations -Wno-logical-op-parentheses -g -DOS_MAC=1 -DOS_WINDOWS=0 -DOS_LINUX=0"
arch=-m64
preproc_file=4coder_command_metadata.i

View File

@ -34,6 +34,7 @@ if "%2" == "release" (set mode=%release%)
set opts=/W4 /wd4310 /wd4100 /wd4201 /wd4505 /wd4996 /wd4127 /wd4510 /wd4512 /wd4610 /wd4457 /WX
set opts=%opts% /GR- /nologo /FC
set opts=%opts% -I%custom_root%
set opts=%opts% /D OS_WINDOWS=1 /D OS_LINUX=0 /D OS_MAC=0
set opts=%opts% %mode%
set preproc_file=4coder_command_metadata.i

View File

@ -35,7 +35,7 @@ done
PHYS_DIR=`pwd -P`
SOURCE=$PHYS_DIR/$TARGET_FILE
opts="-Wno-write-strings -Wno-null-dereference -Wno-comment -Wno-switch -Wno-writable-strings -g"
opts="-Wno-write-strings -Wno-null-dereference -Wno-comment -Wno-switch -Wno-writable-strings -g -DOS_LINUX=1 -DOS_WINDOWS=0 -DOS_MAC=1"
arch=-m32
cd "$REAL_PWD"

View File

@ -1,30 +0,0 @@
#!/bin/bash
# If any command errors, stop the script
set -e
# Store the real CWD
ME="$(realpath "$0")"
LOCATION="$(dirname "$ME")"
CODE_HOME="$(dirname "$LOCATION")"
# Find the most reasonable candidate build file
SOURCE="$1"
if [ -z "$SOURCE" ]; then
SOURCE="$(readlink -f "$CODE_HOME/4coder_default_bindings.cpp")"
fi
# NOTE(yuval): Removed -Wno-writable-strings as it is the same as -Wno-write-strings
opts="-Wno-write-strings -Wno-null-dereference -Wno-comment -Wno-switch -Wno-missing-declarations -Wno-logical-op-parentheses -g"
arch=-m32
preproc_file=4coder_command_metadata.i
meta_macros="-DMETA_PASS"
clang++ -I"$CODE_HOME" $meta_macros $arch $opts $debug -std=gnu++0x "$SOURCE" -E -o $preproc_file
clang++ -I"$CODE_HOME" $opts $debug -std=gnu++0x "$CODE_HOME/4coder_metadata_generator.cpp" -o "$CODE_HOME/metadata_generator"
"$CODE_HOME/metadata_generator" -R "$CODE_HOME" "$PWD/$preproc_file"
clang++ -I"$CODE_HOME" $arch $opts $debug -std=c++11 "$SOURCE" -shared -o custom_4coder.so -fPIC
rm "$CODE_HOME/metadata_generator"
rm $preproc_file

View File

@ -34,6 +34,7 @@ if "%2" == "release" (set mode=%release%)
set opts=/W4 /wd4310 /wd4100 /wd4201 /wd4505 /wd4996 /wd4127 /wd4510 /wd4512 /wd4610 /wd4457 /WX
set opts=%opts% /GR- /nologo /FC
set opts=%opts% -I%custom_root%
set opts=%opts% /D OS_WINDOWS=1 /D OS_LINUX=0 /D OS_MAC=0
set opts=%opts% %mode%
set preproc_file=4coder_command_metadata.i

View File

@ -1,5 +1,6 @@
4.1.4
+ buildsuper scripts now all come with '-win' '-linux' '-mac' postfixes and pass their OS identifier macro on the build line
+ clipboard is only read when the requests to, or when the collect-all mode is started via the command 'begin_clipboard_collection_mode'
+ 'clear_clipboard' command
+ in config.4coder the variable virtual_whitespace_regular_indent determines the number of space-widths to use as the regular indentation in a virtual whitespace layout

View File

@ -24,23 +24,25 @@ load_paths = {
{ load_paths_only, .os = "mac" },
};
build_super_x64_win32 = "custom\\bin\\buildsuper_x64.bat";
build_super_x86_win32 = "custom\\bin\\buildsuper_x86.bat";
build_super_x64_unix = "custom/bin/buildsuper_x64.sh";
build_super_x86_unix = "custom/bin/buildsuper_x86.sh";
build_super_x64_win32 = "custom\\bin\\buildsuper_x64-win.bat";
build_super_x86_win32 = "custom\\bin\\buildsuper_x86-win.bat";
build_super_x64_linux = "custom/bin/buildsuper_x64-linux.sh";
build_super_x86_linux = "custom/bin/buildsuper_x86-linux.sh";
build_super_x64_mac = "custom/bin/buildsuper_x64-mac.sh";
build_super_x86_mac = "custom/bin/buildsuper_x86-mac.sh";
command_list = {
{ .name = "build super x64",
.out = "*compilation*", .footer_panel = true, .save_dirty_files = true,
.cmd = { {build_super_x64_win32, .os ="win" },
{build_super_x64_unix , .os ="linux"},
{build_super_x64_unix , .os ="mac" }, }, },
{build_super_x64_linux , .os ="linux"},
{build_super_x64_mac , .os ="mac" }, }, },
{ .name = "build super x86",
.out = "*compilation*", .footer_panel = true, .save_dirty_files = true,
.cmd = { {build_super_x86_win32, .os ="win" },
{build_super_x86_unix, .os ="linux" },
{build_super_x86_unix, .os ="mac" }, }, },
{build_super_x86_linux, .os ="linux" },
{build_super_x86_mac, .os ="mac" }, }, },
{ .name = "build C++ lexer generator",
.out = "*compilation*", .footer_panel = true, .save_dirty_files = true,