mirror of
https://github.com/swiftlang/swift-cmark.git
synced 2026-01-18 17:31:20 +01:00
build: propagate the static define for Swift
When building a Swift target against this library we need to ensure that we pass along `-DCMARK_GFM_STATIC_DEFINE` to the Clang Importer. This is required to build SwiftFormat against this library statically.
This commit is contained in:
@@ -30,8 +30,12 @@ add_library(libcmark-gfm
|
||||
syntax_extension.c
|
||||
utf8.c
|
||||
xml.c)
|
||||
target_compile_definitions(libcmark-gfm PUBLIC
|
||||
$<$<NOT:$<BOOL:${BUILD_SHARED_LIBS}>>:CMARK_GFM_STATIC_DEFINE>)
|
||||
if(NOT BUILD_SHARED_LIBS)
|
||||
target_compile_definitions(libcmark-gfm PUBLIC
|
||||
CMARK_GFM_STATIC_DEFINE)
|
||||
target_compile_options(libcmark-gfm PUBLIC
|
||||
$<$<COMPILE_LANGUAGE:Swift>:-Xcc -DCMARK_GFM_STATIC_DEFINE>)
|
||||
endif()
|
||||
target_include_directories(libcmark-gfm PUBLIC
|
||||
$<BUILD_INTERFACE:${CMAKE_CURRENT_BINARY_DIR}>
|
||||
$<BUILD_INTERFACE:${PROJECT_SOURCE_DIR}/src/include>
|
||||
|
||||
Reference in New Issue
Block a user