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

Generate libdispatch.pc on non-apple platforms #801

Open
wants to merge 8 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 6 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -285,6 +285,12 @@ else()
set(INSTALL_OS_HEADERS_DIR "include/os" CACHE PATH "Path where the headers will be installed")
endif()

if(NOT APPLE)
Copy link
Member

Choose a reason for hiding this comment

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

This should not happen on Windows or Android, please explicitly check for Linux and BSD.

Copy link
Author

Choose a reason for hiding this comment

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

You are right. We use pkgconfig on windows aswell, but this a specific case. I will change it to UNIX AND NOT APPLE

Copy link
Member

Choose a reason for hiding this comment

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

Who is "we" in this case? We (the swift project) definitely doesn't use pkg-config on Windows, nor does "we" (The Browser Company).

configure_file("${PROJECT_SOURCE_DIR}/cmake/libdispatch.pc.in"
"${PROJECT_BINARY_DIR}/libdispatch.pc" @ONLY)

install(FILES ${PROJECT_BINARY_DIR}/libdispatch.pc DESTINATION ${CMAKE_INSTALL_LIBDIR}/pkgconfig)
endif()

add_subdirectory(dispatch)
add_subdirectory(man)
Expand Down
10 changes: 10 additions & 0 deletions cmake/libdispatch.pc.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
prefix=@CMAKE_INSTALL_PREFIX@
exec_prefix=${prefix}
libdir=${exec_prefix}/@CMAKE_INSTALL_LIBDIR@
includedir=${prefix}/@CMAKE_INSTALL_INCLUDEDIR@

Name: libdispatch
Description: libdispatch (a.k.a. Grand Central Dispatch)
Version: @PROJECT_VERSION@
Libs: -L${libdir} -ldispatch
Cflags: -I${includedir}