diff --git a/packages/p/pugixml/port/overwriteProp.cmake b/packages/p/pugixml/port/overwriteProp.cmake new file mode 100644 index 00000000000..d65683ca589 --- /dev/null +++ b/packages/p/pugixml/port/overwriteProp.cmake @@ -0,0 +1,4 @@ +set_property(GLOBAL PROPERTY TARGET_SUPPORTS_SHARED_LIBS TRUE) +set(CMAKE_SHARED_LIBRARY_CREATE_C_FLAGS "-s SIDE_MODULE=1") +set(CMAKE_SHARED_LIBRARY_CREATE_CXX_FLAGS "-s SIDE_MODULE=1") +set(CMAKE_STRIP FALSE) diff --git a/packages/p/pugixml/xmake.lua b/packages/p/pugixml/xmake.lua index d282269b435..b93de336bfa 100644 --- a/packages/p/pugixml/xmake.lua +++ b/packages/p/pugixml/xmake.lua @@ -14,7 +14,8 @@ package("pugixml") add_deps("cmake") on_install(function (package) - local configs = {} + os.cp(path.join(package:scriptdir(), "port", "overwriteProp.cmake"), "overwriteProp.cmake") + local configs = {"-DCMAKE_PROJECT_INCLUDE=overwriteProp.cmake"} table.insert(configs, "-DCMAKE_BUILD_TYPE=" .. (package:debug() and "Debug" or "Release")) table.insert(configs, "-DBUILD_SHARED_LIBS=" .. (package:config("shared") and "ON" or "OFF")) if package:is_plat("windows") then