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

在项目中使一些源文件不使用预编译头 #5960

Open
fengjinfuyl opened this issue Dec 12, 2024 · 5 comments
Open

在项目中使一些源文件不使用预编译头 #5960

fengjinfuyl opened this issue Dec 12, 2024 · 5 comments

Comments

@fengjinfuyl
Copy link

你在什么场景下需要该功能?

一般项目所有源文件都会用到编译头,然而有个别源文件不想使用。在vs中,独立选中某个cpp可以设计不使用编译头。xmake我看到可以设置单个文件的编译选项,但我不知道不使用预编译头的编译选项是什么,搜索议题与社区也未发现有。

描述可能的解决方案

CMAKE中似乎是使用SKIP_PRECOMPILE_HEADERS附加到cpp附属来做的。

描述你认为的候选方案

加个命令add_skip_pch_sources()?

其他信息

No response

@Issues-translate-bot
Copy link

Bot detected the issue body's language is not English, translate it automatically.


Title: Make some source files in the project not use precompiled headers

In what scenario do you need this function?

Generally, all source files in a project will use the compiled header, but some source files do not want to be used. In VS, you can design a cpp independently without using the compiled header. I saw that xmake can set the compilation options of a single file, but I don’t know what the compilation options are without using precompiled headers, and I didn’t find any by searching the issues and communities.

Describe possible solutions

CMAKE seems to be done by using SKIP_PRECOMPILE_HEADERS attached to the cpp attachment.

Describe your alternatives

Add a command add_skip_pch_sources()?

Other information

No response

@fengjinfuyl
Copy link
Author

/Y- 可禁用

@Issues-translate-bot
Copy link

Bot detected the issue body's language is not English, translate it automatically.


/Y- can be disabled

@fengjinfuyl
Copy link
Author

add_files("xxx.cpp",{cxxflags="/Y-"}),没有效果

@fengjinfuyl fengjinfuyl reopened this Dec 13, 2024
@Issues-translate-bot
Copy link

Bot detected the issue body's language is not English, translate it automatically.


add_files("xxx.cpp",{cxxflags="/Y-"}), has no effect

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants