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

new version xmake can not build static lib only containing modules #4832

Open
1821746019 opened this issue Mar 14, 2024 · 7 comments
Open

new version xmake can not build static lib only containing modules #4832

1821746019 opened this issue Mar 14, 2024 · 7 comments

Comments

@1821746019
Copy link

Xmake Version

2.8.8

Operating System Version and Architecture

Win10 22H2

Describe Bug

v2.8.8
image
v2.8.5
image

Expected Behavior

successful build in new version

Project Configuration

test_project.zip

Additional Information and Error Logs

null

@1821746019 1821746019 added the bug label Mar 14, 2024
@waruqi
Copy link
Member

waruqi commented Mar 14, 2024

please try:

target("staticLib_module", function ()
	set_kind("moduleonly")
	add_files("*.ixx", {public = true})
end)

The new version refactors c++20 modules support and adds a moduleonly kind to replace the static kind.

@waruqi waruqi removed the bug label Mar 14, 2024
@1821746019
Copy link
Author

1821746019 commented Mar 14, 2024

The build succeeded. However, the CMakeLists.txt file generated by xmake appears to be incorrect, resulting in a cmake build failure, and IntelliSense in Visual Studio nolonger works normally.
image
image

@waruqi
Copy link
Member

waruqi commented Mar 14, 2024

please provide an example project.

@1821746019
Copy link
Author

this is the exmaple project

xmake project -k cmake
mkdir out
cd out
cmake ..
cmake --build .

@waruqi
Copy link
Member

waruqi commented Mar 14, 2024

cmake generator does not support moduleonly now. @Arthapz

It will only generate add_custom_target(staticLib_module) without any modules files.

@1821746019
Copy link
Author

How is it going? @Arthapz

@Arthapz
Copy link
Member

Arthapz commented Mar 19, 2024

How is it going? @Arthapz

i'll check this week-end, i don't have much time this week

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

No branches or pull requests

3 participants