Skip to content
Open
Show file tree
Hide file tree
Changes from all 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
8 changes: 8 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -279,6 +279,14 @@ target_include_directories(
)

# Generate and install .pc file
# Stamp the AL version into consuming binaries via a linker-defined symbol.
# --defsym is specific to GNU-compatible linkers: Apple's ld64 and MSVC's
# link.exe reject it, so only emit the flag where it is supported.
if(APPLE OR WIN32)
set(AL_PC_VERSION_SYMBOL_FLAG "")
else()
set(AL_PC_VERSION_SYMBOL_FLAG " -Wl,--defsym,AL_VER_${PROJECT_VERSION}=0")
endif()
configure_file(pkgconfig/al-core.pc.in al-core.pc @ONLY)
include(GNUInstallDirs)
install(
Expand Down
2 changes: 1 addition & 1 deletion pkgconfig/al-core.pc.in
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,4 @@ Version: @PROJECT_VERSION@
Description: IMAS Access Layer core libraries for C.
URL: https://imas.iter.org
Cflags: -I${includedir}
Libs: -L${libdir} -lal -Wl,--defsym,AL_VER_@PROJECT_VERSION@=0 -Wl,-rpath,${libdir}
Libs: -L${libdir} -lal@AL_PC_VERSION_SYMBOL_FLAG@ -Wl,-rpath,${libdir}
Loading