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

Add BUILD_STATIC option to create static libraries #74

Merged
merged 1 commit into from
Dec 10, 2024

Conversation

drdanz
Copy link
Contributor

@drdanz drdanz commented Dec 10, 2024

No description provided.

@drdanz drdanz force-pushed the drdanz/static_libs branch from 9a8f735 to 95d2f4c Compare December 10, 2024 14:10
@iamsergio iamsergio merged commit ea8f2dc into master Dec 10, 2024
29 checks passed
@iamsergio iamsergio deleted the drdanz/static_libs branch December 10, 2024 14:37
@dantti
Copy link
Member

dantti commented Dec 10, 2024

This should use option BUILD_SHARED_LIBS instead.

Copy link
Member

@dantti dantti left a comment

Choose a reason for hiding this comment

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

After those changes I recommend using generate_export_header otherwise having the exports right for Windows requires lots of manual updates to ifdefs

@@ -76,6 +79,13 @@ else()
option(BUILD_TESTS "Build the test harness" ON)
endif()
option(BUILD_QT6 "Build against Qt 6" OFF)
option(BUILD_STATIC "Build statically" OFF)
Copy link
Member

Choose a reason for hiding this comment

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

option(BUILD_SHARED_LIBS "Build in shared lib mode" ON)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

That make sense, but I've been following the same policies used in the other KD* repository that I'm currently packaging for vcpkg, I don't know why BUILD_SHARED_LIBS isn't used anywhere else...

@@ -76,6 +79,13 @@ else()
option(BUILD_TESTS "Build the test harness" ON)
endif()
option(BUILD_QT6 "Build against Qt 6" OFF)
option(BUILD_STATIC "Build statically" OFF)

if(BUILD_STATIC)
Copy link
Member

Choose a reason for hiding this comment

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

then get rid of

@@ -77,7 +77,7 @@ if(GRAPHVIZ_FOUND)
endif()
endif()

add_library(kdstatemachineeditor_core SHARED ${LIB_SRCS})
add_library(kdstatemachineeditor_core ${BUILD_LIBRARY_MODE} ${LIB_SRCS})
Copy link
Member

Choose a reason for hiding this comment

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

also not needed here just add_library(kdstatemachineeditor_core ${LIB_SRCS})

@dantti
Copy link
Member

dantti commented Dec 10, 2024

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.

3 participants