Skip to content

Commit 17ee2ef

Browse files
committed
Revert "build: extend fmt integration options"
This reverts commit 0458f28.
1 parent 9094337 commit 17ee2ef

File tree

3 files changed

+32
-113
lines changed

3 files changed

+32
-113
lines changed

.github/workflows/ci.yml

+3-5
Original file line numberDiff line numberDiff line change
@@ -37,10 +37,8 @@ jobs:
3737
msvc 14.34
3838
standards: '>=20'
3939
max-standards: 1
40-
latest-factors: ''
41-
factors: |
42-
gcc Fetch-Content
43-
trace-commands: true
40+
latest-factors: gcc
41+
factors: clang # Don't include Asan because `clang/AST/Decl.h` fails
4442

4543
build:
4644
needs: cpp-matrix
@@ -94,7 +92,7 @@ jobs:
9492
id: package-install
9593
with:
9694
apt-get: ${{ matrix.install }} openjdk-11-jdk ninja-build
97-
vcpkg: ${{ ( !matrix.fetch-content && 'fmt' ) || '' }} libxml2[tools]
95+
vcpkg: fmt libxml2[tools]
9896
cc: ${{ steps.setup-cpp.outputs.cc || matrix.cc }}
9997
ccflags: ${{ matrix.ccflags }}
10098
cxx: ${{ steps.setup-cpp.outputs.cxx || matrix.cxx }}

CMakeLists.txt

+28-65
Original file line numberDiff line numberDiff line change
@@ -85,65 +85,36 @@ add_definitions(${LLVM_DEFINITIONS})
8585
llvm_map_components_to_libnames(llvm_libs all)
8686

8787
# Duktape
88-
find_package(duktape CONFIG)
89-
if (duktape_FOUND)
90-
if (NOT TARGET duktape::duktape)
91-
add_library(duktape INTERFACE)
92-
target_link_libraries(duktape main ${DUKTAPE_LIBRARY})
93-
target_include_directories(duktape INTERFACE ${DUKTAPE_INCLUDE_DIRS})
94-
target_include_directories(duktape PUBLIC ${DUKTAPE_SOURCE_ROOT}/src)
95-
add_library(duktape::duktape ALIAS duktape)
88+
if(NOT DEFINED DUKTAPE_SOURCE_ROOT)
89+
set(DUKTAPE_SOURCE_ROOT $ENV{DUKTAPE_SOURCE_ROOT})
90+
endif()
91+
if (NOT DUKTAPE_SOURCE_ROOT)
92+
include(FetchContent)
93+
if (POLICY CMP0135)
94+
cmake_policy(SET CMP0135 NEW)
9695
endif()
97-
else()
98-
if (NOT DEFINED DUKTAPE_SOURCE_ROOT)
99-
set(DUKTAPE_SOURCE_ROOT $ENV{DUKTAPE_SOURCE_ROOT})
100-
endif ()
101-
if (NOT DUKTAPE_SOURCE_ROOT)
102-
include(FetchContent)
103-
if (POLICY CMP0135)
104-
cmake_policy(SET CMP0135 NEW)
105-
endif ()
106-
FetchContent_Declare(
107-
duktape
108-
URL https://github.com/svaarala/duktape/releases/download/v2.7.0/duktape-2.7.0.tar.xz
109-
)
110-
FetchContent_GetProperties(duktape)
111-
if (NOT duktape_POPULATED)
112-
FetchContent_Populate(duktape)
113-
set(DUKTAPE_SOURCE_ROOT ${duktape_SOURCE_DIR})
114-
endif ()
115-
endif ()
116-
add_library(duktape ${DUKTAPE_SOURCE_ROOT}/src/duktape.c ${DUKTAPE_SOURCE_ROOT}/src/duktape.h)
117-
target_include_directories(duktape PUBLIC ${DUKTAPE_SOURCE_ROOT}/src)
118-
add_library(duktape::duktape ALIAS duktape)
119-
if (CMAKE_CXX_COMPILER_ID MATCHES "Clang|GNU")
120-
target_compile_options(duktape PRIVATE -w)
121-
elseif (CMAKE_CXX_COMPILER_ID STREQUAL "MSVC")
122-
target_compile_options(duktape PRIVATE /w)
123-
endif ()
124-
endif ()
96+
FetchContent_Declare(
97+
duktape
98+
URL https://github.com/svaarala/duktape/releases/download/v2.7.0/duktape-2.7.0.tar.xz
99+
)
100+
FetchContent_GetProperties(duktape)
101+
if(NOT duktape_POPULATED)
102+
FetchContent_Populate(duktape)
103+
set(DUKTAPE_SOURCE_ROOT ${duktape_SOURCE_DIR})
104+
endif()
105+
endif()
106+
add_library(duktape ${DUKTAPE_SOURCE_ROOT}/src/duktape.c ${DUKTAPE_SOURCE_ROOT}/src/duktape.h)
107+
target_include_directories(duktape PUBLIC ${DUKTAPE_SOURCE_ROOT}/src)
108+
add_library(duktape::duktape ALIAS duktape)
109+
if (CMAKE_CXX_COMPILER_ID MATCHES "Clang|GNU")
110+
target_compile_options(duktape PRIVATE -w)
111+
elseif (CMAKE_CXX_COMPILER_ID STREQUAL "MSVC")
112+
target_compile_options(duktape PRIVATE /w)
113+
endif()
125114

126115
# fmt
127-
find_package(fmt CONFIG)
128-
if (NOT fmt_FOUND)
129-
if (NOT DEFINED FMT_SOURCE_ROOT)
130-
set(FMT_SOURCE_ROOT $ENV{FMT_SOURCE_ROOT})
131-
endif ()
132-
if (NOT FMT_SOURCE_ROOT)
133-
include(FetchContent)
134-
FetchContent_Declare(
135-
fmt
136-
URL https://github.com/fmtlib/fmt/releases/download/10.0.0/fmt-10.0.0.zip
137-
)
138-
FetchContent_GetProperties(fmt)
139-
if (NOT fmt_POPULATED)
140-
FetchContent_Populate(fmt)
141-
set(FMT_SOURCE_ROOT ${fmt_SOURCE_DIR})
142-
endif ()
143-
endif ()
144-
endif ()
145-
146-
unset(CMAKE_FOLDER) # Dependencies
116+
unset(CMAKE_FOLDER)
117+
find_package(fmt REQUIRED CONFIG)
147118

148119
#-------------------------------------------------
149120
#
@@ -193,16 +164,8 @@ else()
193164
endif()
194165
target_include_directories(mrdox SYSTEM PUBLIC ${CLANG_INCLUDE_DIRS})
195166

196-
# duktape
197-
target_link_libraries(mrdox PRIVATE duktape::duktape)
198-
199167
# fmt
200-
if (fmt_FOUND)
201-
target_link_libraries(mrdox PRIVATE fmt::fmt)
202-
else ()
203-
target_include_directories(mrdox SYSTEM PRIVATE ${FMT_SOURCE_ROOT}/include)
204-
target_compile_definitions(mrdox PRIVATE FMT_HEADER_ONLY)
205-
endif()
168+
target_link_libraries(mrdox PUBLIC fmt::fmt duktape::duktape)
206169

207170
# Windows, Win64
208171
if (WIN32)

docs/modules/ROOT/pages/install.adoc

+1-43
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,6 @@ Binaries are available from our https://github.com/cppalliance/mrdox/releases[Re
88

99
=== Requirements
1010

11-
==== LLVM
12-
1311
MrDox depends on a recent version of LLVM.
1412

1513
Here are the instructions to clone LLVM version required by this project.
@@ -46,49 +44,9 @@ cmake --build . -j <threads>
4644
cmake --install .
4745
----
4846

49-
==== fmt
50-
51-
MrDox uses the `fmt` library to format its messages. The library can be downloaded from https://vcpkg.io/en/getting-started.html[vcpkg] or installed from https://github.com/fmtlib/fmt[their official repository].
52-
53-
When using vcpkg, its toolchain should be provided to the mrdox cmake configure command:
54-
55-
[source,bash]
56-
----
57-
cmake -B [build directory] -S [path to mrdox] -D CMAKE_TOOLCHAIN_FILE=[path to vcpkg]/scripts/buildsystems/vcpkg.cmake
58-
----
59-
60-
When the `fmt` library has been installed from their official release, the library path should be provided to the mrdox cmake configure command:
61-
62-
[source,bash]
63-
----
64-
cmake -B [build directory] -S [path to mrdox] -D FMT_ROOT=[path to installed fmt]
65-
----
66-
67-
Alternatively, when neither option is available, the mrdox configure script will attempt to automatically download the `fmt` library during configuration.
68-
69-
==== duktape
70-
71-
The MrDox templating system uses the duktape JS interpreter for its handlebars templating system. The library can be downloaded from https://vcpkg.io/en/getting-started.html[vcpkg] or installed from https://duktape.org/[their official repository].
72-
73-
When using vcpkg, its toolchain should be provided to the mrdox cmake configure command:
74-
75-
[source,bash]
76-
----
77-
cmake -B [build directory] -S [path to mrdox] -D CMAKE_TOOLCHAIN_FILE=[path to vcpkg]/scripts/buildsystems/vcpkg.cmake
78-
----
79-
80-
When duktape has been installed from their https://github.com/svaarala/duktape/releases/tag/v2.7.0[official release], the duktape source path should be provided to the mrdox cmake configure command:
81-
82-
[source,bash]
83-
----
84-
cmake -B [build directory] -S [path to mrdox] -D DUKTAPE_SOURCE_ROOT=[path to duktape source]
85-
----
86-
87-
Alternatively, when neither option is available, the mrdox configure script will attempt to automatically download duktape during configuration.
88-
8947
=== MrDox
9048

91-
Once the LLVM variants and dependencies are available in `/path/to/llvm+clang`, you can download MrDox:
49+
Once the LLVM variants are available in `/path/to/llvm+clang`, you can download MrDox:
9250

9351
[source,bash]
9452
----

0 commit comments

Comments
 (0)