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

suggest pro when trying to open source with standard #1684

Merged
merged 5 commits into from
Nov 10, 2021

Conversation

joshgoebel
Copy link
Collaborator

@joshgoebel joshgoebel commented Nov 9, 2021

Closes #1643.

Screen Shot 2021-11-09 at 9 07 55 AM

CMakeLists.txt Outdated
@@ -748,9 +748,9 @@ set(TIC80STUDIO_SRC
${TIC80LIB_DIR}/ext/png.c
)

if(${BUILD_PRO})
#if(${BUILD_PRO})
set(TIC80STUDIO_SRC ${TIC80STUDIO_SRC} ${TIC80LIB_DIR}/studio/project.c)
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

This is needed because we need tic_project_ext unless you wanted to factor that out into tools... I'm not sure what the harm is in building this file though - only the single function should actually get linked during compile.

CMakeLists.txt Outdated
@@ -738,6 +738,7 @@ set(TIC80STUDIO_SRC
${TIC80LIB_DIR}/studio/editors/sfx.c
${TIC80LIB_DIR}/studio/editors/music.c
${TIC80LIB_DIR}/studio/studio.c
${TIC80LIB_DIR}/studio/project.c
Copy link
Owner

Choose a reason for hiding this comment

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

project.c should only be built in Pro version, why did you add it here?

Copy link
Owner

Choose a reason for hiding this comment

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

I saw below you added this for the sake of tic_project_ext() function, maybe better move it to the src/tools.c

Copy link
Collaborator Author

@joshgoebel joshgoebel Nov 9, 2021

Choose a reason for hiding this comment

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

I could... but curious, what is the harm in building it if it's never linked (other than tic_project_ext)? I don't see any real harm. What makes it PRO is the define being turned on and enabled, not just whether the project.c file is compiled or not...

Copy link
Owner

Choose a reason for hiding this comment

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

Why should we include it in the project if its code is not used in the PRO build?
Another way, you can add it but pls wrap all the functions with

#if defined(TIC80_PRO)
...
#endif

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

if its code is not used in the PRO build?

But it's code IS used in the build now... so including it makes sense. The functions that aren't referenced are never included always because the linker will just silently discard them.

You're way overthinking this one, but I went ahead and just moved the function to tools...

CMakeLists.txt Outdated Show resolved Hide resolved
src/studio/screens/console.c Outdated Show resolved Hide resolved
@joshgoebel
Copy link
Collaborator Author

Screen Shot 2021-11-10 at 7 55 47 AM

@nesbox
Copy link
Owner

nesbox commented Nov 10, 2021

Looks good, thank you.

@nesbox nesbox merged commit 2646b62 into nesbox:master Nov 10, 2021
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.

Print a more helpful message when trying to load text carts with non-pro version
3 participants