Skip to content

(cmake, meson) append shared/static libraries flag by default when installing packages#6409

Merged
waruqi merged 1 commit intoxmake-io:devfrom
Arthapz:fix-cmake-meson-sharedlibraries
May 9, 2025
Merged

(cmake, meson) append shared/static libraries flag by default when installing packages#6409
waruqi merged 1 commit intoxmake-io:devfrom
Arthapz:fix-cmake-meson-sharedlibraries

Conversation

@Arthapz
Copy link
Member

@Arthapz Arthapz commented May 8, 2025

  • Before adding new features and new modules, please go to issues to submit the relevant feature description first.
  • Write good commit messages and use the same coding conventions as the rest of the project.
  • Please commit code to dev branch and we will merge into master branch in feature
  • Ensure your edited codes with four spaces instead of TAB.

  • 增加新特性和新模块之前,请先到issues提交相关特性说明,经过讨论评估确认后,再进行相应的代码提交,避免做无用工作。
  • 编写友好可读的提交信息,并使用与工程代码相同的代码规范,代码请用4个空格字符代替tab缩进。
  • 请提交代码到dev分支,如果通过,我们会在特定时间合并到master分支上。
  • 为了规范化提交日志的格式,commit消息,不要用中文,请用英文描述。

@Arthapz Arthapz changed the title (cmake, meson) append shared/static libraries by default when relevent (cmake, meson) append shared/static libraries flag by default when installing packages May 8, 2025
@Arthapz Arthapz force-pushed the fix-cmake-meson-sharedlibraries branch 3 times, most recently from 86f4c8f to 7047e17 Compare May 8, 2025 20:39
opt.cross = true
local envs = {}
envs.CMAKE_BUILD_TYPE = package:is_debug() and "Debug" or "Release"
envs.BUILD_SHARED_LIBS = package:config("shared") and "ON" or "OFF"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why? _get_configs_for_generic will add them, and we need also check flags exist

Copy link
Member Author

@Arthapz Arthapz May 9, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it doesn't seem to me that _get_configs_for_generic is called for cross

here it's generic OR cross

    if package:is_cross() then
        _get_configs_for_cross(package, configs, opt)
    else
        _get_configs_for_generic(package, configs, opt)
    end

if package:is_cross() then

and here

elseif package:is_cross() then
if is_cross is true, _get_configs_for_generic is not called

    elseif package:is_cross() then
        _get_configs_for_cross(package, configs, opt)
    elseif package:config("toolchains") then
        -- we still need find system libraries,
        -- it just pass toolchain environments if the toolchain is compatible with host
        if _is_toolchain_compatible_with_host(package) then
            _get_configs_for_host_toolchain(package, configs, opt)
        else
            _get_configs_for_cross(package, configs, opt)
        end
    else
        _get_configs_for_generic(package, configs, opt)
    end

and _get_configs_for_generic is not called from _get_configs_for_cross

or i miss something ?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ok

@Arthapz Arthapz force-pushed the fix-cmake-meson-sharedlibraries branch from 7047e17 to d2510d1 Compare May 9, 2025 12:22
@waruqi waruqi added this to the v3.0.0 milestone May 9, 2025
@waruqi waruqi merged commit d88bd9c into xmake-io:dev May 9, 2025
22 checks passed
@Arthapz Arthapz deleted the fix-cmake-meson-sharedlibraries branch September 18, 2025 09:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants