mirror of
https://codeberg.org/dwl/dwl.git
synced 2025-10-27 18:24:16 +00:00
initial Julia test
This commit is contained in:
parent
3d00746904
commit
2630a7dfe4
2
config.h
2
config.h
@ -65,7 +65,7 @@ static const int natural_scrolling = 0;
|
||||
static const char *termcmd[] = { "alacritty", NULL };
|
||||
static const char *menucmd[] = { "bemenu-run", NULL };
|
||||
|
||||
static const Key keys[] = {
|
||||
const Key keys[] = {
|
||||
/* Note that Shift changes certain key codes: c -> C, 2 -> at, etc. */
|
||||
/* modifier key function argument */
|
||||
{ MODKEY, XKB_KEY_p, spawn, {.v = menucmd} },
|
||||
|
||||
11
config.mk
11
config.mk
@ -2,7 +2,14 @@
|
||||
PREFIX = /usr/local
|
||||
|
||||
# Default compile flags (overridable by environment)
|
||||
CFLAGS ?= -g -Wall -Wextra -Werror -Wno-unused-parameter -Wno-sign-compare -Wno-unused-function -Wno-unused-variable -Wdeclaration-after-statement
|
||||
#CFLAGS ?= -g -Wall -Wextra -Werror -Wno-unused-parameter -Wno-sign-compare -Wno-unused-function -Wno-unused-variable -Wdeclaration-after-statement
|
||||
|
||||
# Uncomment to build XWayland support
|
||||
#CFLAGS += -DXWAYLAND
|
||||
CFLAGS += -DXWAYLAND
|
||||
|
||||
JL_BIN = ./julia/julia
|
||||
JL_SHARE = $(shell $(JL_BIN) -e 'print(joinpath(Sys.BINDIR, Base.DATAROOTDIR, "julia"))')
|
||||
CFLAGS += $(shell $(JL_BIN) $(JL_SHARE)/julia-config.jl --cflags)
|
||||
CXXFLAGS += $(shell $(JL_BIN) $(JL_SHARE)/julia-config.jl --cflags)
|
||||
LDFLAGS += $(shell $(JL_BIN) $(JL_SHARE)/julia-config.jl --ldflags)
|
||||
LDLIBS += $(shell $(JL_BIN) $(JL_SHARE)/julia-config.jl --ldlibs)
|
||||
|
||||
8
dwl.c
8
dwl.c
@ -48,6 +48,9 @@
|
||||
#include <wlr/xwayland.h>
|
||||
#endif
|
||||
|
||||
#include <julia.h>
|
||||
JULIA_DEFINE_FAST_TLS // only define this once, in an executable (not in a shared library) if you want fast code.
|
||||
|
||||
/* macros */
|
||||
#define BARF(fmt, ...) do { fprintf(stderr, fmt "\n", ##__VA_ARGS__); exit(EXIT_FAILURE); } while (0)
|
||||
#define EBARF(fmt, ...) BARF(fmt ": %s", ##__VA_ARGS__, strerror(errno))
|
||||
@ -2571,6 +2574,10 @@ main(int argc, char *argv[])
|
||||
if (optind < argc)
|
||||
goto usage;
|
||||
|
||||
/* required: setup the Julia context */
|
||||
jl_init();
|
||||
jl_eval_string("@show(cglobal(:keys))");
|
||||
|
||||
// Wayland requires XDG_RUNTIME_DIR for creating its communications
|
||||
// socket
|
||||
if (!getenv("XDG_RUNTIME_DIR"))
|
||||
@ -2578,6 +2585,7 @@ main(int argc, char *argv[])
|
||||
setup();
|
||||
run(startup_cmd);
|
||||
cleanup();
|
||||
jl_atexit_hook(0);
|
||||
return EXIT_SUCCESS;
|
||||
|
||||
usage:
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user