Tue, 04 Oct 2022 19:25:07 +0200
fix over-optimization of strstr
1. it's actually less performant to frequently read bytes
from an array instead of using the native word length
2. the SBO buffer should be local and not static to allow
multi-threading usage
372
a3e494af5c09
adds very simple cmake wrapper
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
1 | # |
a3e494af5c09
adds very simple cmake wrapper
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
2 | # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. |
a3e494af5c09
adds very simple cmake wrapper
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
3 | # |
390
d345541018fa
starts ucx 3.0 development
Mike Becker <universe@uap-core.de>
parents:
372
diff
changeset
|
4 | # Copyright 2021 Mike Becker, Olaf Wintermann All rights reserved. |
372
a3e494af5c09
adds very simple cmake wrapper
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
5 | # |
a3e494af5c09
adds very simple cmake wrapper
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
6 | # Redistribution and use in source and binary forms, with or without |
a3e494af5c09
adds very simple cmake wrapper
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
7 | # modification, are permitted provided that the following conditions are met: |
a3e494af5c09
adds very simple cmake wrapper
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
8 | # |
a3e494af5c09
adds very simple cmake wrapper
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
9 | # 1. Redistributions of source code must retain the above copyright |
a3e494af5c09
adds very simple cmake wrapper
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
10 | # notice, this list of conditions and the following disclaimer. |
a3e494af5c09
adds very simple cmake wrapper
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
11 | # |
a3e494af5c09
adds very simple cmake wrapper
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
12 | # 2. Redistributions in binary form must reproduce the above copyright |
a3e494af5c09
adds very simple cmake wrapper
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
13 | # notice, this list of conditions and the following disclaimer in the |
a3e494af5c09
adds very simple cmake wrapper
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
14 | # documentation and/or other materials provided with the distribution. |
a3e494af5c09
adds very simple cmake wrapper
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
15 | # |
a3e494af5c09
adds very simple cmake wrapper
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
16 | # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" |
a3e494af5c09
adds very simple cmake wrapper
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
17 | # AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE |
a3e494af5c09
adds very simple cmake wrapper
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
18 | # IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE |
a3e494af5c09
adds very simple cmake wrapper
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
19 | # ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE |
a3e494af5c09
adds very simple cmake wrapper
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
20 | # LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR |
a3e494af5c09
adds very simple cmake wrapper
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
21 | # CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF |
a3e494af5c09
adds very simple cmake wrapper
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
22 | # SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS |
a3e494af5c09
adds very simple cmake wrapper
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
23 | # INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN |
a3e494af5c09
adds very simple cmake wrapper
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
24 | # CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) |
a3e494af5c09
adds very simple cmake wrapper
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
25 | # ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE |
a3e494af5c09
adds very simple cmake wrapper
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
26 | # POSSIBILITY OF SUCH DAMAGE. |
a3e494af5c09
adds very simple cmake wrapper
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
27 | # |
a3e494af5c09
adds very simple cmake wrapper
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
28 | |
a3e494af5c09
adds very simple cmake wrapper
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
29 | set(PANDOC_DESTDIR ${CMAKE_BINARY_DIR}/docs/web) |
a3e494af5c09
adds very simple cmake wrapper
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
30 | set(PANDOC_ARGS -c ucx.css -B header.html -A footer.html -T 'UAP Common Extensions') |
390
d345541018fa
starts ucx 3.0 development
Mike Becker <universe@uap-core.de>
parents:
372
diff
changeset
|
31 | set(PANDOC_SRC index.md license.md install.md) |
372
a3e494af5c09
adds very simple cmake wrapper
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
32 | set(LOGO_PATH ../../uaplogo.png) |
a3e494af5c09
adds very simple cmake wrapper
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
33 | |
a3e494af5c09
adds very simple cmake wrapper
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
34 | if (NOT EXISTS ${PANDOC_EXECUTABLE}) |
a3e494af5c09
adds very simple cmake wrapper
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
35 | find_program(PANDOC_EXECUTABLE pandoc) |
a3e494af5c09
adds very simple cmake wrapper
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
36 | if(NOT EXISTS ${PANDOC_EXECUTABLE}) |
417
4b1203dbd0a6
add missing quotation marks
Mike Becker <universe@uap-core.de>
parents:
390
diff
changeset
|
37 | message(WARNING "Pandoc not found, docs-html target will not be generated.") |
372
a3e494af5c09
adds very simple cmake wrapper
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
38 | return() |
a3e494af5c09
adds very simple cmake wrapper
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
39 | endif() |
a3e494af5c09
adds very simple cmake wrapper
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
40 | endif() |
a3e494af5c09
adds very simple cmake wrapper
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
41 | |
a3e494af5c09
adds very simple cmake wrapper
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
42 | message(STATUS "HTML Documentation will be generated at: ${PANDOC_DESTDIR}.") |
a3e494af5c09
adds very simple cmake wrapper
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
43 | file(MAKE_DIRECTORY ${PANDOC_DESTDIR}) |
a3e494af5c09
adds very simple cmake wrapper
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
44 | |
390
d345541018fa
starts ucx 3.0 development
Mike Becker <universe@uap-core.de>
parents:
372
diff
changeset
|
45 | # UCX 3.0 documentation |
372
a3e494af5c09
adds very simple cmake wrapper
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
46 | foreach(source_file ${PANDOC_SRC}) |
a3e494af5c09
adds very simple cmake wrapper
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
47 | string(REPLACE .md .html dest_file ${source_file}) |
a3e494af5c09
adds very simple cmake wrapper
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
48 | string(PREPEND dest_file "${PANDOC_DESTDIR}/") |
a3e494af5c09
adds very simple cmake wrapper
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
49 | list(APPEND PANDOC_DEST ${dest_file}) |
a3e494af5c09
adds very simple cmake wrapper
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
50 | add_custom_command( |
a3e494af5c09
adds very simple cmake wrapper
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
51 | OUTPUT ${dest_file} |
a3e494af5c09
adds very simple cmake wrapper
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
52 | COMMAND ${PANDOC_EXECUTABLE} ${PANDOC_ARGS} -o ${dest_file} ${source_file} |
a3e494af5c09
adds very simple cmake wrapper
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
53 | WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} |
a3e494af5c09
adds very simple cmake wrapper
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
54 | MAIN_DEPENDENCY ${source_file} |
a3e494af5c09
adds very simple cmake wrapper
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
55 | ) |
a3e494af5c09
adds very simple cmake wrapper
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
56 | endforeach() |
a3e494af5c09
adds very simple cmake wrapper
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
57 | |
390
d345541018fa
starts ucx 3.0 development
Mike Becker <universe@uap-core.de>
parents:
372
diff
changeset
|
58 | # UCX 2.1 documentation |
d345541018fa
starts ucx 3.0 development
Mike Becker <universe@uap-core.de>
parents:
372
diff
changeset
|
59 | add_custom_target(docs-html-21 |
d345541018fa
starts ucx 3.0 development
Mike Becker <universe@uap-core.de>
parents:
372
diff
changeset
|
60 | COMMAND ${PANDOC_EXECUTABLE} -c ucx.css -B header-ucx2.html -A footer.html |
d345541018fa
starts ucx 3.0 development
Mike Becker <universe@uap-core.de>
parents:
372
diff
changeset
|
61 | -T 'UAP Common Extensions' -o ${PANDOC_DESTDIR}/modules-ucx2.html modules-ucx2.md |
d345541018fa
starts ucx 3.0 development
Mike Becker <universe@uap-core.de>
parents:
372
diff
changeset
|
62 | WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} |
d345541018fa
starts ucx 3.0 development
Mike Becker <universe@uap-core.de>
parents:
372
diff
changeset
|
63 | DEPENDS modules-ucx2.md |
d345541018fa
starts ucx 3.0 development
Mike Becker <universe@uap-core.de>
parents:
372
diff
changeset
|
64 | COMMENT "Adding UCX 2.1 HTML documentation." |
d345541018fa
starts ucx 3.0 development
Mike Becker <universe@uap-core.de>
parents:
372
diff
changeset
|
65 | ) |
d345541018fa
starts ucx 3.0 development
Mike Becker <universe@uap-core.de>
parents:
372
diff
changeset
|
66 | |
d345541018fa
starts ucx 3.0 development
Mike Becker <universe@uap-core.de>
parents:
372
diff
changeset
|
67 | # Collect all HTML documentation |
372
a3e494af5c09
adds very simple cmake wrapper
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
68 | add_custom_target(docs-html |
a3e494af5c09
adds very simple cmake wrapper
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
69 | COMMAND ${CMAKE_COMMAND} -E copy ucx.css ${PANDOC_DESTDIR}/ucx.css |
a3e494af5c09
adds very simple cmake wrapper
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
70 | COMMAND ${CMAKE_COMMAND} -E copy ${LOGO_PATH} ${PANDOC_DESTDIR}/uaplogo.png |
390
d345541018fa
starts ucx 3.0 development
Mike Becker <universe@uap-core.de>
parents:
372
diff
changeset
|
71 | DEPENDS ${PANDOC_DEST} docs-html-21 |
372
a3e494af5c09
adds very simple cmake wrapper
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
72 | WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} |
a3e494af5c09
adds very simple cmake wrapper
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
73 | COMMENT "Generating HTML documentation with pandoc." |
a3e494af5c09
adds very simple cmake wrapper
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
74 | ) |