view extern/libcompat/win/dlfcn/CMakeLists.txt @ 961:32f93ef20122

irccd: add Irccd.Util API and other things in server
author David Demelier <markand@malikania.fr>
date Mon, 25 Jan 2021 22:48:55 +0100
parents 21a91311c8ea
children
line wrap: on
line source

project(dl)
add_library(
	dl
	STATIC
	${dl_SOURCE_DIR}/dlfcn.h
	${dl_SOURCE_DIR}/dlfcn.c
)

# Correctly export the location of installed includes in the target
target_include_directories(
	dl
	PUBLIC
		$<BUILD_INTERFACE:${dl_SOURCE_DIR}>
		$<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}>
)

if (CMAKE_C_COMPILER_ID MATCHES "MSVC")
	target_compile_definitions(dl PRIVATE _CRT_SECURE_NO_WARNINGS)
endif ()

install(
	TARGETS dl
	RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
	LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
	ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}
)