summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorpommicket <pommicket@gmail.com>2023-01-11 23:07:44 -0500
committerpommicket <pommicket@gmail.com>2023-01-11 23:07:44 -0500
commitdc1e9a3566927fe71bd254f8486be9eb99650783 (patch)
treef1ba1d9a64b392803375b1c19f7a8390e9c88188
parent0c102146685ad0707ddb7e2f8ea1166782c1e76d (diff)
switch to ninja now that we strip ../ from build errors
-rw-r--r--CMakeLists.txt11
-rw-r--r--Makefile6
-rw-r--r--development.md1
-rw-r--r--main.c1
4 files changed, 6 insertions, 13 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 078ed3f..15caed1 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -9,17 +9,10 @@ else()
set(SOURCES main.c)
endif()
-# make the file names absolute so we can go-to-error.
-set(SOURCES_ABSOLUTE )
-foreach(SOURCE ${SOURCES})
- get_filename_component(S ${CMAKE_SOURCE_DIR}/${SOURCE} ABSOLUTE)
- set(SOURCES_ABSOLUTE ${SOURCES_ABSOLUTE};${S})
-endforeach()
-
if (MSVC)
- add_executable(ted WIN32 ${SOURCES_ABSOLUTE})
+ add_executable(ted WIN32 ${SOURCES})
else()
- add_executable(ted ${SOURCES_ABSOLUTE})
+ add_executable(ted ${SOURCES})
endif()
diff --git a/Makefile b/Makefile
index 3ac6e41..5abdf63 100644
--- a/Makefile
+++ b/Makefile
@@ -12,12 +12,12 @@ INSTALL_BIN_DIR=/usr/bin
debug-build: ted compile_commands.json
ted: debug/ted
cp debug/ted .
-compile_commands.json: debug/compile_commands.json
+compile_commands.json: debug/ted
cp debug/compile_commands.json .
debug/ted: *.[ch] libpcre2-32.a CMakeLists.txt
mkdir -p debug
- cd debug && cmake -DCMAKE_EXPORT_COMPILE_COMMANDS=1 -DCMAKE_BUILD_TYPE=Debug ..
- $(MAKE) -C debug
+ cd debug && cmake -DCMAKE_EXPORT_COMPILE_COMMANDS=1 -DCMAKE_BUILD_TYPE=Debug -GNinja ..
+ ninja -C debug
release: *.[ch] libpcre2-32.a
$(CC) main.c -o ted $(RELEASE_CFLAGS) $(LIBS)
release_debug: *.[ch] libpcre2-32.a
diff --git a/development.md b/development.md
index a071b0d..ea3d0f5 100644
--- a/development.md
+++ b/development.md
@@ -3,6 +3,7 @@
## Building
To build the debug version of ted, run `make` (or `make.bat` on Windows).
+By default we use the `ninja` build system (`sudo apt install ninja` or similar).
## Files
diff --git a/main.c b/main.c
index 878b0a5..1caee6c 100644
--- a/main.c
+++ b/main.c
@@ -1,6 +1,5 @@
/*
@TODO:
-- build-command
- rust-analyzer bug reports:
- bad json can give "Unexpected error: client exited without proper shutdown sequence"
- containerName not always given in workspace/symbols