diff --git a/extensions/CMakeLists.txt b/extensions/CMakeLists.txt index 135d28d5c..e545b6d6f 100644 --- a/extensions/CMakeLists.txt +++ b/extensions/CMakeLists.txt @@ -17,8 +17,6 @@ include_directories( ${PROJECT_BINARY_DIR}/src ) -include (GenerateExportHeader) - include_directories(. ${CMAKE_CURRENT_BINARY_DIR}) set(CMAKE_C_FLAGS_PROFILE "${CMAKE_C_FLAGS_RELEASE} -pg") @@ -29,6 +27,7 @@ if (CMARK_SHARED) set_target_properties(${LIBRARY} PROPERTIES OUTPUT_NAME "cmark-gfm-extensions" + DEFINE_SYMBOL "cmark-gfm" SOVERSION ${PROJECT_VERSION_MAJOR}.${PROJECT_VERSION_MINOR}.${PROJECT_VERSION_PATCH}.gfm.${PROJECT_VERSION_GFM} VERSION ${PROJECT_VERSION}) @@ -38,9 +37,6 @@ if (CMARK_SHARED) # Avoid name clash between PROGRAM and LIBRARY pdb files. set_target_properties(${LIBRARY} PROPERTIES PDB_NAME cmark-gfm-extensions_dll) - generate_export_header(${LIBRARY} - BASE_NAME cmark-gfm-extensions) - list(APPEND CMARK_INSTALL ${LIBRARY}) target_link_libraries(${LIBRARY} libcmark-gfm) @@ -51,6 +47,7 @@ if (CMARK_STATIC) set_target_properties(${STATICLIBRARY} PROPERTIES COMPILE_FLAGS "-DCMARK_GFM_STATIC_DEFINE -DCMARK_GFM_EXTENSIONS_STATIC_DEFINE" + DEFINE_SYMBOL "cmark-gfm" POSITION_INDEPENDENT_CODE ON) if (MSVC) @@ -63,11 +60,6 @@ if (CMARK_STATIC) VERSION ${PROJECT_VERSION}) endif(MSVC) - if (NOT CMARK_SHARED) - generate_export_header(${STATICLIBRARY} - BASE_NAME cmark-gfm-extensions) - endif() - list(APPEND CMARK_INSTALL ${STATICLIBRARY}) endif() @@ -84,7 +76,6 @@ install(TARGETS ${CMARK_INSTALL} if (CMARK_SHARED OR CMARK_STATIC) install(FILES cmark-gfm-core-extensions.h - ${CMAKE_CURRENT_BINARY_DIR}/cmark-gfm-extensions_export.h DESTINATION include ) diff --git a/extensions/cmark-gfm-core-extensions.h b/extensions/cmark-gfm-core-extensions.h index 3a32f76b0..bc29ffd41 100644 --- a/extensions/cmark-gfm-core-extensions.h +++ b/extensions/cmark-gfm-core-extensions.h @@ -6,45 +6,45 @@ extern "C" { #endif #include "cmark-gfm-extension_api.h" -#include "cmark-gfm-extensions_export.h" +#include "cmark-gfm_export.h" #include #include -CMARK_GFM_EXTENSIONS_EXPORT +CMARK_GFM_EXPORT void cmark_gfm_core_extensions_ensure_registered(void); -CMARK_GFM_EXTENSIONS_EXPORT +CMARK_GFM_EXPORT uint16_t cmark_gfm_extensions_get_table_columns(cmark_node *node); /** Sets the number of columns for the table, returning 1 on success and 0 on error. */ -CMARK_GFM_EXTENSIONS_EXPORT +CMARK_GFM_EXPORT int cmark_gfm_extensions_set_table_columns(cmark_node *node, uint16_t n_columns); -CMARK_GFM_EXTENSIONS_EXPORT +CMARK_GFM_EXPORT uint8_t *cmark_gfm_extensions_get_table_alignments(cmark_node *node); /** Sets the alignments for the table, returning 1 on success and 0 on error. */ -CMARK_GFM_EXTENSIONS_EXPORT +CMARK_GFM_EXPORT int cmark_gfm_extensions_set_table_alignments(cmark_node *node, uint16_t ncols, uint8_t *alignments); -CMARK_GFM_EXTENSIONS_EXPORT +CMARK_GFM_EXPORT int cmark_gfm_extensions_get_table_row_is_header(cmark_node *node); /** Sets whether the node is a table header row, returning 1 on success and 0 on error. */ -CMARK_GFM_EXTENSIONS_EXPORT +CMARK_GFM_EXPORT int cmark_gfm_extensions_set_table_row_is_header(cmark_node *node, int is_header); -CMARK_GFM_EXTENSIONS_EXPORT +CMARK_GFM_EXPORT bool cmark_gfm_extensions_get_tasklist_item_checked(cmark_node *node); /* For backwards compatibility */ #define cmark_gfm_extensions_tasklist_is_checked cmark_gfm_extensions_get_tasklist_item_checked /** Sets whether a tasklist item is "checked" (completed), returning 1 on success and 0 on error. */ -CMARK_GFM_EXTENSIONS_EXPORT +CMARK_GFM_EXPORT int cmark_gfm_extensions_set_tasklist_item_checked(cmark_node *node, bool is_checked); #ifdef __cplusplus