Skip to content

Unable to statically link without change to CMakeLists.txt #87

@tmathews

Description

@tmathews

Hi, I currently have to add the following to CMakeLists.txt in order to link statically:

diff --git a/CMakeLists.txt b/CMakeLists.txt
index f4f21ef..6699049 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -81,6 +81,8 @@ if(BUILD_SHARED_LIBS)
 
     set_target_properties(tmx PROPERTIES SOVERSION ${API_VERSION})
     set_target_properties(tmx PROPERTIES VERSION ${BUILD_VERSION})
+else()
+    target_compile_definitions(tmx PRIVATE LIBXML_STATIC)
 endif()
 
 # --  Installation

Just wondering if this actually needs to be applied or if I'm doing something wrong. Once I build with this patch I am able to correctly statically link my program.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions