diff --git a/bin/4ed_build.cpp b/bin/4ed_build.cpp index f76e9880..7e054818 100644 --- a/bin/4ed_build.cpp +++ b/bin/4ed_build.cpp @@ -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); diff --git a/custom/bin/buildsuper_x64.sh b/custom/bin/buildsuper_x64-linux.sh old mode 100755 new mode 100644 similarity index 92% rename from custom/bin/buildsuper_x64.sh rename to custom/bin/buildsuper_x64-linux.sh index 6b49d4ab..988b4c43 --- a/custom/bin/buildsuper_x64.sh +++ b/custom/bin/buildsuper_x64-linux.sh @@ -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 diff --git a/custom/bin/buildsuper_x64-mac.sh b/custom/bin/buildsuper_x64-mac.sh index 7113ed24..f18a1466 100755 --- a/custom/bin/buildsuper_x64-mac.sh +++ b/custom/bin/buildsuper_x64-mac.sh @@ -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 diff --git a/custom/bin/buildsuper_x64.bat b/custom/bin/buildsuper_x64-win.bat similarity index 96% rename from custom/bin/buildsuper_x64.bat rename to custom/bin/buildsuper_x64-win.bat index 57d69fcb..cb199bf9 100644 --- a/custom/bin/buildsuper_x64.bat +++ b/custom/bin/buildsuper_x64-win.bat @@ -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 diff --git a/custom/bin/buildsuper_x86.sh b/custom/bin/buildsuper_x86-linux.sh old mode 100755 new mode 100644 similarity index 94% rename from custom/bin/buildsuper_x86.sh rename to custom/bin/buildsuper_x86-linux.sh index 46d0ab6e..18d247aa --- a/custom/bin/buildsuper_x86.sh +++ b/custom/bin/buildsuper_x86-linux.sh @@ -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" diff --git a/custom/bin/buildsuper_x86-mac.sh b/custom/bin/buildsuper_x86-mac.sh deleted file mode 100755 index fbdb4b2c..00000000 --- a/custom/bin/buildsuper_x86-mac.sh +++ /dev/null @@ -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 diff --git a/custom/bin/buildsuper_x86.bat b/custom/bin/buildsuper_x86-win.bat similarity index 96% rename from custom/bin/buildsuper_x86.bat rename to custom/bin/buildsuper_x86-win.bat index ff76ead7..9d76f744 100644 --- a/custom/bin/buildsuper_x86.bat +++ b/custom/bin/buildsuper_x86-win.bat @@ -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 diff --git a/ship_files/changes.txt b/ship_files/changes.txt index 90c538c2..d87bc237 100644 --- a/ship_files/changes.txt +++ b/ship_files/changes.txt @@ -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 diff --git a/ship_files_super/project.4coder b/ship_files_super/project.4coder index 261a97f0..3568227f 100644 --- a/ship_files_super/project.4coder +++ b/ship_files_super/project.4coder @@ -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,