-
Notifications
You must be signed in to change notification settings - Fork 3.5k
pkgconfig variables support in CMake toolchain file #17101
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
Changes from 1 commit
5c1f039
cc7b0f7
8bc8ec2
6e8ae1c
f3a4d51
d439aa8
86b81fa
15f7812
bfc2f5a
e80be51
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -261,6 +261,20 @@ if (NOT CMAKE_FIND_ROOT_PATH_MODE_PACKAGE) | |
| set(CMAKE_FIND_ROOT_PATH_MODE_PACKAGE ONLY) | ||
| endif() | ||
|
|
||
| set(_em_pkgconfig_libdir "${EMSCRIPTEN_SYSROOT}/local/lib/pkgconfig" "${EMSCRIPTEN_SYSROOT}/lib/pkgconfig") | ||
| if("${CMAKE_VERSION}" VERSION_LESS "3.20") | ||
| file(TO_NATIVE_PATH "${_em_pkgconfig_libdir}" _em_pkgconfig_libdir) | ||
| if(CMAKE_HOST_UNIX) | ||
| string(REPLACE ";" ":" _em_pkgconfig_libdir "${_em_pkgconfig_libdir}") | ||
| string(REPLACE "\\ " " " _em_pkgconfig_libdir "${_em_pkgconfig_libdir}") | ||
| endif() | ||
| else() | ||
| cmake_path(CONVERT "${_em_pkgconfig_libdir}" TO_NATIVE_PATH_LIST _em_pkgconfig_libdir) | ||
| endif() | ||
| set(ENV{PKG_CONFIG_LIBDIR} "${_em_pkgconfig_libdir}") | ||
| set(ENV{PKG_CONFIG_PATH} "$ENV{EM_PKG_CONFIG_PATH}") # Stops caller's PKG_CONFIG_PATH from propagating. | ||
|
||
| unset(_em_pkgconfig_libdir) | ||
|
|
||
| option(EMSCRIPTEN_GENERATE_BITCODE_STATIC_LIBRARIES "If set, static library targets generate LLVM bitcode files (.bc). If disabled (default), UNIX ar archives (.a) are generated." OFF) | ||
| if (EMSCRIPTEN_GENERATE_BITCODE_STATIC_LIBRARIES) | ||
| message(FATAL_ERROR "EMSCRIPTEN_GENERATE_BITCODE_STATIC_LIBRARIES is not compatible with the llvm backend") | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I wonder if we should also set PKG_CONFIG_SYSROOT_DIR here? (doesn't have to be part of this change).
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd suggest to leave it out for now. We'd want to get consistent behaviour for CMake and building.py and PKG_CONFIG_SYSROOT_DIR can easily become a journey on its own (LIBDIR is good enough for most use cases, and SYSROOT affects only the PATH, not LIBDIR).