Skip to content

Commit 26cec9d

Browse files
committed
build: installation workflow supports homebrew clang
1 parent 3d8fa85 commit 26cec9d

File tree

2 files changed

+299
-19
lines changed

2 files changed

+299
-19
lines changed

CMakeUserPresets.json.example

Lines changed: 85 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -312,6 +312,91 @@
312312
"rhs": "Darwin"
313313
},
314314
"generator": "Ninja"
315+
},
316+
{
317+
"name": "debug-macos-clang",
318+
"displayName": "Debug (macOS: clang)",
319+
"description": "Preset for building MrDocs in Debug mode with the clang compiler in macOS.",
320+
"inherits": "debug",
321+
"binaryDir": "${sourceDir}/build/${presetName}",
322+
"cacheVariables": {
323+
"CMAKE_BUILD_TYPE": "Debug",
324+
"LLVM_ROOT": "$env{HOME}/Developer/cpp-libs/llvm-project/install/debug-clang",
325+
"Clang_ROOT": "$env{HOME}/Developer/cpp-libs/llvm-project/install/debug-clang",
326+
"duktape_ROOT": "$env{HOME}/Developer/cpp-libs/duktape/install/debug-clang",
327+
"Duktape_ROOT": "$env{HOME}/Developer/cpp-libs/duktape/install/debug-clang",
328+
"libxml2_ROOT": "$env{HOME}/Developer/cpp-libs/libxml2/install/release-clang",
329+
"LibXml2_ROOT": "$env{HOME}/Developer/cpp-libs/libxml2/install/release-clang",
330+
"MRDOCS_BUILD_TESTS": true,
331+
"MRDOCS_BUILD_DOCS": false,
332+
"MRDOCS_GENERATE_REFERENCE": false,
333+
"MRDOCS_GENERATE_ANTORA_REFERENCE": false,
334+
"CMAKE_C_COMPILER": "/opt/homebrew/opt/llvm/bin/clang",
335+
"CMAKE_CXX_COMPILER": "/opt/homebrew/opt/llvm/bin/clang++",
336+
"CMAKE_MAKE_PROGRAM": "$env{HOME}/Developer/cpp-libs/ninja/ninja",
337+
"CMAKE_AR": "/opt/homebrew/opt/llvm/bin/llvm-ar",
338+
"CMAKE_CXX_COMPILER_AR": "/opt/homebrew/opt/llvm/bin/llvm-ar",
339+
"CMAKE_C_COMPILER_AR": "/opt/homebrew/opt/llvm/bin/llvm-ar",
340+
"CMAKE_RANLIB": "/opt/homebrew/opt/llvm/bin/llvm-ranlib",
341+
"CMAKE_C_COMPILER_LINKER": "/opt/homebrew/bin/ld.lld",
342+
"CMAKE_CXX_COMPILER_LINKER": "/opt/homebrew/bin/ld.lld",
343+
"CMAKE_EXE_LINKER_FLAGS": "-L/opt/homebrew/opt/llvm/lib/c++ -L/opt/homebrew/opt/llvm/lib/unwind -lunwind",
344+
"CMAKE_SHARED_LINKER_FLAGS": "-L/opt/homebrew/opt/llvm/lib/c++ -L/opt/homebrew/opt/llvm/lib/unwind -lunwind",
345+
"CMAKE_MODULE_LINKER_FLAGS": "-L/opt/homebrew/opt/llvm/lib/c++ -L/opt/homebrew/opt/llvm/lib/unwind -lunwind",
346+
"CMAKE_CXX_FLAGS": "-stdlib=libc++ -I/opt/homebrew/opt/llvm/include/c++/v1"
347+
},
348+
"warnings": {
349+
"unusedCli": false
350+
},
351+
"condition": {
352+
"type": "equals",
353+
"lhs": "${hostSystemName}",
354+
"rhs": "Darwin"
355+
},
356+
"generator": "Ninja"
357+
},
358+
{
359+
"name": "debug-macos-clang-asan",
360+
"generator": "Ninja",
361+
"displayName": "Debug (macOS: clang) with ASan",
362+
"description": "Preset for building MrDocs in Debug mode with the clang compiler in macOS.",
363+
"inherits": "debug",
364+
"binaryDir": "${sourceDir}/build/${presetName}",
365+
"cacheVariables": {
366+
"CMAKE_BUILD_TYPE": "Debug",
367+
"LLVM_ROOT": "$env{HOME}/Developer/cpp-libs/llvm-project/install/debug-clang-asan",
368+
"Clang_ROOT": "$env{HOME}/Developer/cpp-libs/llvm-project/install/debug-clang-asan",
369+
"duktape_ROOT": "$env{HOME}/Developer/cpp-libs/duktape/install/debug-clang-asan",
370+
"Duktape_ROOT": "$env{HOME}/Developer/cpp-libs/duktape/install/debug-clang-asan",
371+
"libxml2_ROOT": "",
372+
"LibXml2_ROOT": "",
373+
"MRDOCS_BUILD_TESTS": false,
374+
"MRDOCS_BUILD_DOCS": false,
375+
"MRDOCS_GENERATE_REFERENCE": false,
376+
"MRDOCS_GENERATE_ANTORA_REFERENCE": false,
377+
"CMAKE_C_COMPILER": "/opt/homebrew/opt/llvm/bin/clang",
378+
"CMAKE_CXX_COMPILER": "/opt/homebrew/opt/llvm/bin/clang++",
379+
"CMAKE_MAKE_PROGRAM": "$env{HOME}/Developer/cpp-libs/ninja/ninja",
380+
"CMAKE_AR": "/opt/homebrew/opt/llvm/bin/llvm-ar",
381+
"CMAKE_CXX_COMPILER_AR": "/opt/homebrew/opt/llvm/bin/llvm-ar",
382+
"CMAKE_C_COMPILER_AR": "/opt/homebrew/opt/llvm/bin/llvm-ar",
383+
"CMAKE_RANLIB": "/opt/homebrew/opt/llvm/bin/llvm-ranlib",
384+
"CMAKE_C_COMPILER_LINKER": "/opt/homebrew/bin/ld.lld",
385+
"CMAKE_CXX_COMPILER_LINKER": "/opt/homebrew/bin/ld.lld",
386+
"CMAKE_EXE_LINKER_FLAGS": "-L/opt/homebrew/opt/llvm/lib/c++ -L/opt/homebrew/opt/llvm/lib/unwind -lunwind -fsanitize=address",
387+
"CMAKE_SHARED_LINKER_FLAGS": "-L/opt/homebrew/opt/llvm/lib/c++ -L/opt/homebrew/opt/llvm/lib/unwind -lunwind -fsanitize=address",
388+
"CMAKE_MODULE_LINKER_FLAGS": "-L/opt/homebrew/opt/llvm/lib/c++ -L/opt/homebrew/opt/llvm/lib/unwind -lunwind -fsanitize=address",
389+
"CMAKE_C_FLAGS": "-fsanitize=address -fno-sanitize-recover=address -fno-omit-frame-pointer",
390+
"CMAKE_CXX_FLAGS": "-fsanitize=address -fno-sanitize-recover=address -fno-omit-frame-pointer -stdlib=libc++ -I/opt/homebrew/opt/llvm/include/c++/v1"
391+
},
392+
"warnings": {
393+
"unusedCli": false
394+
},
395+
"condition": {
396+
"type": "equals",
397+
"lhs": "${hostSystemName}",
398+
"rhs": "Darwin"
399+
}
315400
}
316401
]
317402
}

0 commit comments

Comments
 (0)