Skip to content

Commit 12fb330

Browse files
committed
engine: Vendor linenoise library
Linenoise-Source: https://github.com/antirez/linenoise Linenoise-Commit: 93b2db9bd4968f76148dd62cdadf050ed50b84b3 Linenoise-Date: 2023-03-27
1 parent e59a636 commit 12fb330

File tree

10 files changed

+2010
-0
lines changed

10 files changed

+2010
-0
lines changed

NOTICE.md

+6
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,12 @@ The following third-party libraries are included in the Cloe repository:
4646
- Website: https://jothepro.github.io/doxygen-awesome-css
4747
- Source: docs/_vendor/doxygen-awesome
4848

49+
- Linenoise
50+
- License: BSD2
51+
- License-Source: https://raw.githubusercontent.com/antirez/linenoise/master/LICENSE
52+
- Website: https://github.com/antirez/linenoise
53+
- Source: engine/vendor/linenoise
54+
4955
The following third-party libraries are used by this project (these are usually
5056
installed with the help of Conan):
5157

engine/conanfile.py

+1
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ class CloeEngine(ConanFile):
3737
exports_sources = [
3838
"src/*",
3939
"webui/*",
40+
"vendor/*",
4041
"CMakeLists.txt",
4142
]
4243

engine/vendor/linenoise/.gitignore

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
linenoise_example
2+
*.dSYM
3+
history.txt
+36
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
cmake_minimum_required(VERSION 3.15 FATAL_ERROR)
2+
3+
project(linenoise LANGUAGES C)
4+
5+
include(GNUInstallDirs)
6+
7+
add_library(linenoise
8+
linenoise.c
9+
linenoise.h
10+
)
11+
add_library(linenoise::linenoise ALIAS linenoise)
12+
target_include_directories(linenoise
13+
PUBLIC
14+
"$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}>"
15+
"$<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}>"
16+
)
17+
install(TARGETS linenoise
18+
EXPORT linenoiseTargets
19+
LIBRARY
20+
ARCHIVE
21+
RUNTIME
22+
)
23+
install(FILES linenoise.h
24+
DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}
25+
)
26+
27+
include(CTest)
28+
if(BUILD_TESTING)
29+
add_executable(linenoise-example
30+
example.c
31+
)
32+
target_link_libraries(linenoise-example
33+
PRIVATE
34+
linenoise
35+
)
36+
endif()

engine/vendor/linenoise/LICENSE

+25
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
Copyright (c) 2010-2014, Salvatore Sanfilippo <antirez at gmail dot com>
2+
Copyright (c) 2010-2013, Pieter Noordhuis <pcnoordhuis at gmail dot com>
3+
4+
All rights reserved.
5+
6+
Redistribution and use in source and binary forms, with or without
7+
modification, are permitted provided that the following conditions are met:
8+
9+
* Redistributions of source code must retain the above copyright notice,
10+
this list of conditions and the following disclaimer.
11+
12+
* Redistributions in binary form must reproduce the above copyright notice,
13+
this list of conditions and the following disclaimer in the documentation
14+
and/or other materials provided with the distribution.
15+
16+
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
17+
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
18+
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
19+
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
20+
ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
21+
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
22+
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
23+
ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
24+
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
25+
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

engine/vendor/linenoise/Makefile

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
linenoise_example: linenoise.h linenoise.c
2+
3+
linenoise_example: linenoise.c example.c
4+
$(CC) -Wall -W -Os -g -o linenoise_example linenoise.c example.c
5+
6+
clean:
7+
rm -f linenoise_example

0 commit comments

Comments
 (0)