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

Subprojects not working with debug build on Linux #4

Open
iTrooz opened this issue Nov 23, 2022 · 4 comments
Open

Subprojects not working with debug build on Linux #4

iTrooz opened this issue Nov 23, 2022 · 4 comments

Comments

@iTrooz
Copy link
Contributor

iTrooz commented Nov 23, 2022

libromfs seems to confuse main project and subproject in a debug build on Linux

PoC : https://github.com/iTrooz/libromfs-example (commit iTrooz/libromfs-example@e8fa12b)

With debug build :

GET PROJECT=testProject
GET PROJECT=testProject
11

With release build :

GET PROJECT=testProject
GET PROJECT=subProject
11

Note : this was first found in WerWolv/ImHex#797

@WerWolv
Copy link
Owner

WerWolv commented Dec 1, 2022

I think the issue is that here https://github.com/iTrooz/libromfs-example/blob/main/subProject/CMakeLists.txt#L18 you set the libromfs build folder of the subproject to the same folder as the main project uses. This probably confuses cmake

@iTrooz
Copy link
Contributor Author

iTrooz commented Dec 1, 2022

I just changed it (iTrooz/libromfs-example@138b5ee) but it doesn't seem to change anything, I get the same output

@iTrooz
Copy link
Contributor Author

iTrooz commented Dec 1, 2022

Also, I just noticed something :
When building (make), I get this message :

<command-line>: warning: "LIBROMFS_PROJECT_NAME" redefined
<command-line>: note: this is the location of the previous definition

both Debug and Release builds print this message

@iTrooz
Copy link
Contributor Author

iTrooz commented Dec 6, 2022

Commit WerWolv/ImHex@e3f2541 fixed it in ImHex.

WerWolv quote on why it fixes it :

The issue was that we were using and linking to ImHex's main romfs in libimhex. And that was bleeding out into the plugins since they were linking to it
I completely removed it from libimhex now and only access it from the main application

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

2 participants