Skip to content

Commit

Permalink
build: impertively define output name for static library
Browse files Browse the repository at this point in the history
When building with an older CMake, the generator expression is not
evaluated properly and embedded into the final output name which is
incorrect.  This should repair the ability to build with an older CMake.
  • Loading branch information
compnerd authored and jgm committed Aug 17, 2021
1 parent 15762d7 commit 599da32
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -98,9 +98,15 @@ if (CMARK_STATIC)
cmark_add_compile_options(${STATICLIBRARY})
set_target_properties(${STATICLIBRARY} PROPERTIES
COMPILE_FLAGS -DCMARK_STATIC_DEFINE
OUTPUT_NAME "cmark$<$<BOOL:${MSVC}>:_static>"
POSITION_INDEPENDENT_CODE ON
VERSION ${PROJECT_VERSION})
if(MSVC)
set_target_properties(${STATICLIBRARY} PROPERTIES
OUTPUT_NAME cmark_static)
else()
set_target_properties(${STATICLIBRARY} PROPERTIES
OUTPUT_NAME cmark)
endif()
target_include_directories(${STATICLIBRARY} INTERFACE
$<INSTALL_INTERFACE:include>
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}>
Expand Down

0 comments on commit 599da32

Please sign in to comment.