Skip to content

Commit 2e5584c

Browse files
committed
build: clean up static define
`CMARK_GFM_EXTENSIONS_STATIC_DEFINE` is never used, remove it. Use CMake to propagate `CMARK_GFM_STATIC_DEFINE` rather than defining it manually and having the clients define it.
1 parent c458cc2 commit 2e5584c

File tree

3 files changed

+4
-7
lines changed

3 files changed

+4
-7
lines changed

Package.swift

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@ import PackageDescription
1111
// link time.
1212
let cSettings: [CSetting] = [
1313
.define("CMARK_GFM_STATIC_DEFINE", .when(platforms: [.windows])),
14-
.define("CMARK_GFM_EXTENSIONS_STATIC_DEFINE", .when(platforms: [.windows])),
1514
]
1615
#else
1716
let cSettings: [CSetting] = []

extensions/CMakeLists.txt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,9 +44,10 @@ endif()
4444

4545
if (CMARK_STATIC)
4646
add_library(${STATICLIBRARY} STATIC ${LIBRARY_SOURCES})
47+
target_compile_definitions(${STATICLIBRARY} PUBLIC
48+
CMARK_GFM_STATIC_DEFINE)
4749

4850
set_target_properties(${STATICLIBRARY} PROPERTIES
49-
COMPILE_FLAGS "-DCMARK_GFM_STATIC_DEFINE -DCMARK_GFM_EXTENSIONS_STATIC_DEFINE"
5051
POSITION_INDEPENDENT_CODE ON)
5152

5253
if (MSVC)

src/CMakeLists.txt

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -55,10 +55,6 @@ elseif(CMARK_STATIC)
5555
target_link_libraries(${PROGRAM} libcmark-gfm-extensions_static libcmark-gfm_static)
5656
endif()
5757

58-
# Disable the PUBLIC declarations when compiling the executable:
59-
set_target_properties(${PROGRAM} PROPERTIES
60-
COMPILE_FLAGS "-DCMARK_GFM_STATIC_DEFINE -DCMARK_GFM_EXTENSIONS_STATIC_DEFINE")
61-
6258
# Check integrity of node structure when compiled as debug:
6359
set(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} -DCMARK_DEBUG_NODES -DDEBUG")
6460
set(CMAKE_LINKER_DEBUG "${CMAKE_LINKER_FLAGS_DEBUG}")
@@ -92,12 +88,13 @@ endif()
9288

9389
if (CMARK_STATIC)
9490
add_library(${STATICLIBRARY} STATIC ${LIBRARY_SOURCES})
91+
target_compile_definitions(${STATICLIBRARY} PUBLIC
92+
CMARK_GFM_STATIC_DEFINE)
9593
target_include_directories(${LIBRARY} PUBLIC
9694
$<BUILD_INTERFACE:${PROJECT_SOURCE_DIR}/src/include>
9795
$<BUILD_INTERFACE:${PROJECT_SOURCE_DIR}/extensions/include>)
9896

9997
set_target_properties(${STATICLIBRARY} PROPERTIES
100-
COMPILE_FLAGS -DCMARK_GFM_STATIC_DEFINE
10198
POSITION_INDEPENDENT_CODE ON)
10299

103100
if (MSVC)

0 commit comments

Comments
 (0)