diff extern/libcompat/win/dlfcn/CMakeLists.txt @ 948:21a91311c8ea

cmake: switch back, GNU make is painful
author David Demelier <markand@malikania.fr>
date Sat, 16 Jan 2021 17:58:46 +0100
parents
children
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/extern/libcompat/win/dlfcn/CMakeLists.txt	Sat Jan 16 17:58:46 2021 +0100
@@ -0,0 +1,26 @@
+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}
+)