diff --git a/.gitignore b/.gitignore index 64b6972..a50b07d 100644 --- a/.gitignore +++ b/.gitignore @@ -328,3 +328,4 @@ $RECYCLE.BIN/ # End of https://www.toptal.com/developers/gitignore/api/linux,vim,c,cmake,macos,visualstudiocode,windows,node build/ +*.bak \ No newline at end of file diff --git a/CMakeLists.txt b/CMakeLists.txt index 9faabdc..9922b54 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,6 +1,13 @@ cmake_minimum_required(VERSION 3.5) project(ivy C) +if (WIN32) + set(CMAKE_RC_COMPILER_INIT windres) + enable_language(RC) + SET(CMAKE_RC_COMPILE_OBJECT + " -O coff -i -o ") +endif () + set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/bin) set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/lib) set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/lib) diff --git a/asm/CMakeLists.txt b/asm/CMakeLists.txt index e3c294e..a847506 100644 --- a/asm/CMakeLists.txt +++ b/asm/CMakeLists.txt @@ -1,9 +1,13 @@ file(GLOB_RECURSE asm_sources *.c *.h include/ivy/asm/*.h) +if (WIN32) + set(rc_file ${CMAKE_CURRENT_SOURCE_DIR}/../res/build/asm.rc) +endif () + if (IVY_STATIC) - add_library(ivy-asm STATIC ${asm_sources}) + add_library(ivy-asm STATIC ${asm_sources} ${rc_file}) else () - add_library(ivy-asm SHARED ${asm_sources}) + add_library(ivy-asm SHARED ${asm_sources} ${rc_file}) endif () target_include_directories(ivy-asm PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}/include/) diff --git a/common/CMakeLists.txt b/common/CMakeLists.txt index 85b60af..0a2e4bf 100644 --- a/common/CMakeLists.txt +++ b/common/CMakeLists.txt @@ -1,9 +1,13 @@ file(GLOB_RECURSE common_sources *.c *.h include/ivy/*.h) +if (WIN32) + set(rc_file ${CMAKE_CURRENT_SOURCE_DIR}/../res/build/common.rc) +endif () + if (IVY_STATIC) - add_library(ivy-common STATIC ${common_sources}) + add_library(ivy-common STATIC ${common_sources} ${rc_file}) else () - add_library(ivy-common SHARED ${common_sources}) + add_library(ivy-common SHARED ${common_sources} ${rc_file}) endif () target_include_directories(ivy-common PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}/include/) diff --git a/frontend/CMakeLists.txt b/frontend/CMakeLists.txt index 60541fb..5db2745 100644 --- a/frontend/CMakeLists.txt +++ b/frontend/CMakeLists.txt @@ -8,8 +8,12 @@ file(GLOB ivy_sources file(GLOB_RECURSE sys_sources sys/${system_name}/*.c sys/${system_name}/*.h) + +if (WIN32) + set(rc_file ${CMAKE_CURRENT_SOURCE_DIR}/../res/build/frontend.rc) +endif () -add_executable(ivy ${ivy_sources} ${sys_sources}) +add_executable(ivy ${ivy_sources} ${sys_sources} ${rc_file}) target_link_libraries( ivy ivy-rt diff --git a/frontend/cmd/repl.c b/frontend/cmd/repl.c index 718816e..c1ffe73 100644 --- a/frontend/cmd/repl.c +++ b/frontend/cmd/repl.c @@ -29,6 +29,18 @@ static void skip_line(struct ivy_lexer *lex) int repl(const b_command *cmd, const b_arglist *args, const b_array *_) { + b_printf("[bold,bright_red]error[[E0384][reset,bold,white]: cannot assign twice to immutable variable `i`[reset]\n"); + b_printf("[bold,bright_blue] -->[reset] src/main.rs:7:3\n"); + b_printf("[bold,bright_blue] |[reset]\n"); + b_printf("[bold,bright_blue]4 |[reset] let i = 0;\n"); + b_printf("[bold,bright_blue] | -[reset]\n"); + b_printf("[bold,bright_blue] | |[reset]\n"); + b_printf("[bold,bright_blue] | first assignment to `i`[reset]\n"); + b_printf("[bold,bright_blue] | help: make this binding mutable: `mut i`[reset]\n"); + b_printf("[bold,bright_blue]...[reset]\n"); + b_printf("[bold,bright_blue]7 |[reset] i += 1;\n"); + b_printf("[bold,bright_blue] |[bold,bright_red] ^^^^^^ cannot assign twice to immutable variable[reset]\n"); + bool show_lex = b_arglist_get_count(args, OPT_SHOW_LEX_TOKENS, B_COMMAND_INVALID_ID) > 0; bool show_ast diff --git a/lang/CMakeLists.txt b/lang/CMakeLists.txt index fc8cdd4..e199c42 100644 --- a/lang/CMakeLists.txt +++ b/lang/CMakeLists.txt @@ -1,9 +1,13 @@ file(GLOB_RECURSE lang_sources *.c *.h include/ivy/lang/*.h) +if (WIN32) + set(rc_file ${CMAKE_CURRENT_SOURCE_DIR}/../res/build/lang.rc) +endif () + if (IVY_STATIC) - add_library(ivy-lang STATIC ${lang_sources}) + add_library(ivy-lang STATIC ${lang_sources} ${rc_file}) else () - add_library(ivy-lang SHARED ${lang_sources}) + add_library(ivy-lang SHARED ${lang_sources} ${rc_file}) endif () target_include_directories(ivy-lang PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}/include/) diff --git a/res/gfx/logo-small.ico b/res/gfx/logo-small.ico new file mode 100644 index 0000000..38b5d6c Binary files /dev/null and b/res/gfx/logo-small.ico differ diff --git a/res/gfx/logo.ico b/res/gfx/logo.ico new file mode 100644 index 0000000..c33e8b3 Binary files /dev/null and b/res/gfx/logo.ico differ diff --git a/res/gfx/logo.png b/res/gfx/logo.png new file mode 100644 index 0000000..858b480 Binary files /dev/null and b/res/gfx/logo.png differ diff --git a/res/gfx/logo.svg b/res/gfx/logo.svg new file mode 100644 index 0000000..0e8983e --- /dev/null +++ b/res/gfx/logo.svg @@ -0,0 +1,63 @@ + + +hanging plants,households,houseplants,nature,plantsOriginal keywords: hanging plants,households,houseplants,nature,plants. This clipart was ripped from the Microsoft website, then uploaded to https://archive.org/details/MS_Clipart_Collection. (The original WMF file can be found within that item, under the folder MC900335402). From there, it was then converted by Trumad to svg using https://github.com/hidekatsu-izuno/wmf2svg in a bulk operation. All the converted files can be found at https://archive.org/details/MS_Clipart_Collection_SVG + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/rt/CMakeLists.txt b/rt/CMakeLists.txt index df028a7..cd95751 100644 --- a/rt/CMakeLists.txt +++ b/rt/CMakeLists.txt @@ -1,9 +1,13 @@ file(GLOB_RECURSE rt_sources *.c *.h include/ivy/rt/*.h) +if (WIN32) + set(rc_file ${CMAKE_CURRENT_SOURCE_DIR}/../res/build/rt.rc) +endif () + if (IVY_STATIC) - add_library(ivy-rt STATIC ${rt_sources}) + add_library(ivy-rt STATIC ${rt_sources} ${rc_file}) else () - add_library(ivy-rt SHARED ${rt_sources}) + add_library(ivy-rt SHARED ${rt_sources} ${rc_file}) endif () target_include_directories(ivy-rt PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}/include/)