@@ -26,14 +26,6 @@ project(
26
26
include (CMakePackageConfigHelpers)
27
27
include (GNUInstallDirs)
28
28
29
- #set(BUILD_SHARED_LIBS OFF CACHE STRING "")
30
- #set(CMAKE_CXX_EXTENSIONS OFF CACHE STRING "")
31
- # VFALCO this is to link optimized llvm for debug builds
32
- #set(CMAKE_MSVC_RUNTIME_LIBRARY "MultiThreadedDLL" CACHE STRING "")
33
- #set(CMAKE_INTERPROCEDURAL_OPTIMIZATION_RELEASE ON CACHE STRING "")
34
- #set(CMAKE_INTERPROCEDURAL_OPTIMIZATION_MINSIZEREL ON CACHE STRING "")
35
- #set(CMAKE_INTERPROCEDURAL_OPTIMIZATION_RELWITHDEBINFO ON CACHE STRING "")
36
-
37
29
option (MRDOX_BUILD_TESTS "Build tests" ${BUILD_TESTING} )
38
30
option (MRDOX_BUILD_SHARED "Link shared" OFF )
39
31
option (MRDOX_BUILD_DOCS "Configure install target" OFF )
@@ -58,11 +50,7 @@ if (WIN32)
58
50
add_definitions (
59
51
-D_CRT_SECURE_NO_WARNINGS
60
52
-D_SILENCE_CXX20_CISO646_REMOVED_WARNING)
61
- if ("${CMAKE_GENERATOR_PLATFORM} " STREQUAL "Win32" ) # 32-bit
62
- add_compile_options (
63
- /arch:SSE2
64
- )
65
- elseif ("${CMAKE_GENERATOR_PLATFORM} " STREQUAL "Win64" ) # 64-bit
53
+ if ("${CMAKE_GENERATOR_PLATFORM} " STREQUAL "Win64" ) # 64-bit
66
54
add_compile_options (
67
55
/arch:AMD64
68
56
)
@@ -149,6 +137,21 @@ target_include_directories(mrdox-core SYSTEM PUBLIC ${LLVM_INCLUDE_DIRS})
149
137
target_include_directories (mrdox-core SYSTEM PUBLIC ${CLANG_INCLUDE_DIRS} )
150
138
target_link_libraries (mrdox-core PUBLIC fmt::fmt duktape::duktape)
151
139
140
+ # Clang
141
+ if (CLANG_SIMPLE_LIBS)
142
+ target_link_libraries (mrdox-core PUBLIC LLVM clang clang-cpp)
143
+ else ()
144
+ target_link_libraries (mrdox-core
145
+ PUBLIC
146
+ clangAST
147
+ clangBasic
148
+ clangFrontend
149
+ clangIndex
150
+ clangTooling
151
+ clangToolingCore
152
+ clangToolingInclusions)
153
+ endif ()
154
+
152
155
# Windows, Win64
153
156
if (WIN32 )
154
157
target_compile_definitions (
@@ -197,7 +200,6 @@ file(GLOB_RECURSE TOOL_SOURCES CONFIGURE_DEPENDS tool/*.cpp)
197
200
file (GLOB_RECURSE TOOL_INCLUDES CONFIGURE_DEPENDS tool/*.hpp)
198
201
add_executable (mrdox ${TOOL_SOURCES} ${TOOL_INCLUDES} )
199
202
200
- target_compile_features (mrdox PUBLIC cxx_std_20)
201
203
target_include_directories (mrdox
202
204
PUBLIC
203
205
"$<BUILD_INTERFACE:${PROJECT_SOURCE_DIR} /include/>"
@@ -207,72 +209,12 @@ target_include_directories(mrdox
207
209
"${PROJECT_SOURCE_DIR} /lib"
208
210
"${PROJECT_SOURCE_DIR} /tool"
209
211
)
210
- target_compile_definitions (
211
- mrdox
212
- PUBLIC
213
- ${MRDOX_LINK_MODE_DEFINITION}
214
- PRIVATE
215
- -DMRDOX_TOOL
216
- )
217
212
213
+ target_compile_definitions (mrdox PRIVATE -DMRDOX_TOOL)
218
214
target_link_libraries (mrdox PUBLIC mrdox-core)
219
-
220
- # LLVM
221
- target_link_libraries (mrdox PUBLIC ${llvm_libs} )
222
- target_include_directories (mrdox SYSTEM PUBLIC ${LLVM_INCLUDE_DIRS} )
223
-
224
- # Clang
225
- if (CLANG_SIMPLE_LIBS)
226
- target_link_libraries (mrdox PUBLIC LLVM clang clang-cpp)
227
- else ()
228
- target_link_libraries (mrdox
229
- PUBLIC
230
- clangAST
231
- clangBasic
232
- clangFrontend
233
- clangIndex
234
- clangTooling
235
- clangToolingCore
236
- clangToolingInclusions)
237
- endif ()
238
- target_include_directories (mrdox SYSTEM PUBLIC ${CLANG_INCLUDE_DIRS} )
239
-
240
- # fmt
241
- target_link_libraries (mrdox PUBLIC fmt::fmt duktape::duktape)
242
-
243
- # Windows, Win64
244
- if (WIN32 )
245
- target_compile_definitions (
246
- mrdox
247
- PUBLIC
248
- -D_WIN32_WINNT=0x0601
249
- -D_CRT_SECURE_NO_WARNINGS
250
- -D_SILENCE_CXX20_CISO646_REMOVED_WARNING
251
- -DFMT_HEADER_ONLY # because of _ITERATOR_DEBUG_LEVEL
252
- )
253
- get_target_property (LLVM_CONFIGURATION_TYPE LLVMCore IMPORTED_CONFIGURATIONS )
254
- if (LLVM_CONFIGURATION_TYPE STREQUAL RELWITHDEBINFO)
255
- target_compile_definitions (mrdox PUBLIC -D_ITERATOR_DEBUG_LEVEL=0)
256
- target_compile_options (mrdox PUBLIC /MD )
257
- endif ()
258
- if (MSVC )
259
- target_compile_options (
260
- mrdox
261
- PUBLIC
262
- /permissive- # strict C++
263
- /W4 # enable all warnings
264
- /MP # multi-processor compilation
265
- /EHs # C++ Exception handling
266
- )
267
- endif ()
268
- endif ()
269
-
270
215
if (MRDOX_CLANG)
271
216
target_compile_options (
272
217
mrdox
273
- PUBLIC
274
- -Wno-unused-private -field
275
- -Wno-unused-value
276
218
PRIVATE
277
219
-Wno-covered-switch-default
278
220
)
@@ -289,80 +231,20 @@ file(GLOB_RECURSE TEST_SOURCES CONFIGURE_DEPENDS test/*.cpp)
289
231
file (GLOB_RECURSE TEST_INCLUDES CONFIGURE_DEPENDS test /*.hpp)
290
232
add_executable (mrdox-test ${TEST_SOURCES} ${TEST_INCLUDES} )
291
233
292
- target_compile_features (mrdox-test PUBLIC cxx_std_20)
293
234
target_include_directories (mrdox-test
294
235
PRIVATE
295
236
"${PROJECT_SOURCE_DIR} /include"
296
237
"${PROJECT_SOURCE_DIR} /lib"
297
238
"${PROJECT_SOURCE_DIR} /test"
298
239
"${PROJECT_SOURCE_DIR} /tool"
299
240
)
300
- target_compile_definitions (
301
- mrdox-test
302
- PUBLIC
303
- ${MRDOX_LINK_MODE_DEFINITION}
304
- PRIVATE
305
- -DMRDOX_TOOL
306
- )
307
241
242
+ target_compile_definitions (mrdox PRIVATE -DMRDOX_TOOL)
308
243
target_link_libraries (mrdox-test PUBLIC mrdox-core)
309
244
310
- # LLVM
311
- target_link_libraries (mrdox-test PUBLIC ${llvm_libs} )
312
- target_include_directories (mrdox-test SYSTEM PUBLIC ${LLVM_INCLUDE_DIRS} )
313
-
314
- # Clang
315
- if (CLANG_SIMPLE_LIBS)
316
- target_link_libraries (mrdox-test PUBLIC LLVM clang clang-cpp)
317
- else ()
318
- target_link_libraries (mrdox-test
319
- PUBLIC
320
- clangAST
321
- clangBasic
322
- clangFrontend
323
- clangIndex
324
- clangTooling
325
- clangToolingCore
326
- clangToolingInclusions)
327
- endif ()
328
- target_include_directories (mrdox-test SYSTEM PUBLIC ${CLANG_INCLUDE_DIRS} )
329
-
330
- # fmt
331
- target_link_libraries (mrdox-test PUBLIC fmt::fmt duktape::duktape)
332
-
333
- # Windows, Win64
334
- if (WIN32 )
335
- target_compile_definitions (
336
- mrdox-test
337
- PUBLIC
338
- -D_WIN32_WINNT=0x0601
339
- -D_CRT_SECURE_NO_WARNINGS
340
- -D_SILENCE_CXX20_CISO646_REMOVED_WARNING
341
- -DFMT_HEADER_ONLY # because of _ITERATOR_DEBUG_LEVEL
342
- )
343
- get_target_property (LLVM_CONFIGURATION_TYPE LLVMCore IMPORTED_CONFIGURATIONS )
344
- if (LLVM_CONFIGURATION_TYPE STREQUAL RELWITHDEBINFO)
345
- target_compile_definitions (mrdox-test PUBLIC -D_ITERATOR_DEBUG_LEVEL=0)
346
- target_compile_options (mrdox-test PUBLIC /MD )
347
- endif ()
348
- if (MSVC )
349
- target_compile_options (
350
- mrdox-test
351
- PUBLIC
352
- /permissive- # strict C++
353
- /W4 # enable all warnings
354
- /MP # multi-processor compilation
355
- /EHs # C++ Exception handling
356
- )
357
- endif ()
358
- endif ()
359
-
360
245
if (MRDOX_CLANG)
361
246
target_compile_options (
362
247
mrdox-test
363
- PUBLIC
364
- -Wno-unused-private -field
365
- -Wno-unused-value
366
248
PRIVATE
367
249
-Wno-covered-switch-default
368
250
)
0 commit comments