Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Generated CMakeLists.txt contains nil #4865

Closed
smac89 opened this issue Mar 22, 2024 · 2 comments
Closed

Generated CMakeLists.txt contains nil #4865

smac89 opened this issue Mar 22, 2024 · 2 comments
Labels
Milestone

Comments

@smac89
Copy link

smac89 commented Mar 22, 2024

Xmake Version

2.8.8+20240303

Operating System Version and Architecture

Archlinux x86_64 6.8.1-arch1-1

Describe Bug

The generated the CMakeLists.txt contains nil for each target being compiled. The offending part looks like this for each target:

if(MSVC)
    target_compile_options(target_name PRIVATE nil)
else()
    target_compile_options(target_name PRIVATE nil)
endif()

When I remove these parts, it works fine

Expected Behavior

That code should not be included

Project Configuration

set_xmakever("2.8.8")
set_warnings("everything")
set_defaultmode("debug")
set_config("cc", "clang")
set_config("cxx", "clang++")

add_rules("mode.debug", "mode.release")
add_requires("libsdl ~2.30.*")
add_requires("conan::spdlog 1.13.0", { alias = "spdlog", configs = { shared = false } })
add_cxflags("-mshstk", {tools = {"gcc", "clang"}})

if is_mode("debug") then
    set_symbols("debug")
    set_optimize("fast")
end

target("capture")
    set_kind("binary")
    set_languages("c17", "c++17")
    add_files("src/main.cpp")
    add_includedirs("include")
    add_cxflags("-fstack-protector-strong", {tools = {"gcc", "clang"}})
    add_packages("libsdl", "spdlog", "libassert")
    if is_plat("linux") then
        includes("src/linux")
        add_deps("libcapture", {inherit = true})
    end

And the other project:

add_requires("xcb", {system = true})
add_requires("libxi", {system = true})
add_requires("xcb-util-wm", {system = true})
add_requires("xcb-util-errors", {system = false})
add_requires("libassert ~1.2.*", { configs = { decompose = true, private = true } })

target("libcapture")
    set_kind("static")
    add_files("./**.cpp")
    add_includedirs("include", "$(projectdir)/include")
    add_packages("spdlog")
    add_packages("xcb", "libxi", "xcb-util-wm", "xcb-util-errors", "libassert")
    add_syslinks("pthread")

Additional Information and Error Logs

I don't think there is need for further explanation. I'm just getting started with xmake, so maybe I configured something wrong. It would be nice to get some feedback on that as well.

@smac89 smac89 added the bug label Mar 22, 2024
waruqi added a commit that referenced this issue Mar 22, 2024
@waruqi
Copy link
Member

waruqi commented Mar 22, 2024

try it again. xmake update -s dev or you can use set_warnings("all") instead of set_warnings("everything") first.

@waruqi waruqi added this to the v2.9.1 milestone Mar 22, 2024
@smac89
Copy link
Author

smac89 commented Mar 22, 2024

Amazing! set_warnings("all" or "allextra") works for me. I guess I'll wait until 2.9.1 is available in the repos.

Thank you!

@smac89 smac89 closed this as completed Mar 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants