Compare commits
No commits in common. "1318c4983f830693cc614921b68f35ff46646f4a" and "77973fc0266b454f44cdcc7782b1a3debdd6d7aa" have entirely different histories.
1318c4983f
...
77973fc026
21
Makefile
21
Makefile
@ -1,19 +1,12 @@
|
||||
.POSIX:
|
||||
SHELL = /bin/sh
|
||||
CXXFLAGS = -g -std=c++14 -Wall -Wextra -pedantic
|
||||
CPPFLAGS = `sed -ne 's/^project (\([^ )]*\).*/-DPROJECT_NAME="\1"/p' \
|
||||
-e 's/^set (version \([^ )]*\).*/-DPROJECT_VERSION="\1"/p' CMakeLists.txt`
|
||||
CXXFLAGS = -g -std=c++14 -Wall -Wextra -pedantic -static-libstdc++
|
||||
|
||||
sdn: sdn.cpp CMakeLists.txt
|
||||
$(CXX) $(CXXFLAGS) $(CPPFLAGS) $< -o sdn \
|
||||
-lacl `pkg-config --libs --cflags ncursesw`
|
||||
static: sdn.cpp CMakeLists.txt
|
||||
$(CXX) $(CXXFLAGS) $(CPPFLAGS) $< -o sdn \
|
||||
-static-libstdc++ \
|
||||
-Wl,--start-group,-Bstatic \
|
||||
-lacl `pkg-config --static --libs --cflags ncursesw` \
|
||||
-Wl,--end-group,-Bdynamic
|
||||
all: sdn
|
||||
%: %.cpp CMakeLists.txt
|
||||
$(CXX) $(CXXFLAGS) $< -o $@ `pkg-config --libs --cflags ncursesw` -lacl \
|
||||
`sed -ne 's/^project (\([^ )]*\).*/-DPROJECT_NAME="\1"/p' \
|
||||
-e 's/^set (version \([^ )]*\).*/-DPROJECT_VERSION="\1"/p' CMakeLists.txt`
|
||||
clean:
|
||||
rm -f sdn
|
||||
|
||||
.PHONY: static clean
|
||||
.PHONY: all clean
|
||||
|
7
sdn.cpp
7
sdn.cpp
@ -353,6 +353,13 @@ fun print (const ncstring &nc, int limit) -> int {
|
||||
return total_width;
|
||||
}
|
||||
|
||||
fun compute_width (const wstring &w) -> int {
|
||||
int total = 0;
|
||||
for (const auto &c : w)
|
||||
total += wcwidth (c);
|
||||
return total;
|
||||
}
|
||||
|
||||
fun compute_width (const ncstring &nc) -> int {
|
||||
int total = 0;
|
||||
for (const auto &c : nc)
|
||||
|
Loading…
x
Reference in New Issue
Block a user