2022-06-03 06:20:55 +08:00
|
|
|
diff --git a/src/native/corehost/nethost/CMakeLists.txt b/src/native/corehost/nethost/CMakeLists.txt
|
|
|
|
index a9f44e720..0f24d4458 100644
|
|
|
|
--- a/src/native/corehost/nethost/CMakeLists.txt
|
|
|
|
+++ b/src/native/corehost/nethost/CMakeLists.txt
|
|
|
|
@@ -1,11 +1,14 @@
|
|
|
|
# Licensed to the .NET Foundation under one or more agreements.
|
2020-01-07 05:14:20 +08:00
|
|
|
# The .NET Foundation licenses this file to you under the MIT license.
|
|
|
|
|
2022-06-03 06:20:55 +08:00
|
|
|
+cmake_minimum_required (VERSION 3.14.5)
|
2020-01-07 05:14:20 +08:00
|
|
|
project(nethost)
|
|
|
|
|
|
|
|
set(DOTNET_PROJECT_NAME "nethost")
|
|
|
|
|
|
|
|
# Include directories
|
2022-06-03 06:20:55 +08:00
|
|
|
+include(../../../../eng/native/configurepaths.cmake)
|
|
|
|
+include("${CLR_ENG_NATIVE_DIR}/configurecompiler.cmake")
|
2020-01-07 05:14:20 +08:00
|
|
|
include_directories(../fxr)
|
|
|
|
|
|
|
|
# CMake does not recommend using globbing since it messes with the freshness checks
|
2022-06-03 06:20:55 +08:00
|
|
|
@@ -19,12 +22,23 @@ if(CLR_CMAKE_TARGET_WIN32)
|
2020-01-07 05:14:20 +08:00
|
|
|
Exports.def)
|
|
|
|
endif()
|
|
|
|
|
|
|
|
+if(BUILD_SHARED_LIBS)
|
|
|
|
include(../lib.cmake)
|
2022-06-03 06:20:55 +08:00
|
|
|
+set(targets nethost)
|
2020-01-07 05:14:20 +08:00
|
|
|
+else()
|
2022-06-03 06:20:55 +08:00
|
|
|
+include(../hostmisc/hostmisc.cmake)
|
2020-01-07 05:14:20 +08:00
|
|
|
include(../lib_static.cmake)
|
2022-06-03 06:20:55 +08:00
|
|
|
+add_library(nethost INTERFACE)
|
|
|
|
+target_link_libraries(nethost INTERFACE libnethost)
|
|
|
|
+set(targets libnethost nethost)
|
|
|
|
+target_include_directories(libnethost INTERFACE $<INSTALL_INTERFACE:include>)
|
2020-01-07 05:14:20 +08:00
|
|
|
+endif()
|
2022-06-03 06:20:55 +08:00
|
|
|
+target_include_directories(nethost INTERFACE $<INSTALL_INTERFACE:include>)
|
2020-01-07 05:14:20 +08:00
|
|
|
|
|
|
|
add_definitions(-DFEATURE_LIBHOST=1)
|
|
|
|
add_definitions(-DNETHOST_EXPORT)
|
|
|
|
|
2022-06-03 06:20:55 +08:00
|
|
|
+if(NOT BUILD_SHARED_LIBS)
|
|
|
|
# Copy static lib PDB to the project output directory
|
|
|
|
if (WIN32)
|
|
|
|
set_target_properties(libnethost PROPERTIES
|
|
|
|
@@ -32,15 +46,18 @@ if (WIN32)
|
|
|
|
COMPILE_PDB_OUTPUT_DIRECTORY "${PROJECT_BINARY_DIR}"
|
|
|
|
)
|
|
|
|
endif(WIN32)
|
|
|
|
+endif()
|
|
|
|
|
|
|
|
-install(FILES ../coreclr_delegates.h DESTINATION corehost)
|
|
|
|
-install(FILES ../hostfxr.h DESTINATION corehost)
|
2020-01-07 05:14:20 +08:00
|
|
|
-install(FILES nethost.h DESTINATION corehost)
|
2022-06-03 06:20:55 +08:00
|
|
|
-install_with_stripped_symbols(nethost TARGETS corehost)
|
|
|
|
+set(NETHOST_HEADERS nethost.h ../coreclr_delegates.h ../hostfxr.h)
|
|
|
|
+install(FILES ${NETHOST_HEADERS} DESTINATION include)
|
|
|
|
+install(TARGETS ${targets} EXPORT unofficial-nethost-config
|
|
|
|
+ ARCHIVE DESTINATION lib
|
|
|
|
+ LIBRARY DESTINATION lib
|
|
|
|
+ RUNTIME DESTINATION bin
|
|
|
|
+)
|
|
|
|
|
|
|
|
-# Only Windows creates a symbols file for static libs.
|
|
|
|
-if (WIN32)
|
|
|
|
- install_with_stripped_symbols(libnethost TARGETS corehost)
|
|
|
|
-else()
|
|
|
|
- install(TARGETS libnethost DESTINATION corehost)
|
|
|
|
-endif(WIN32)
|
2020-01-07 05:14:20 +08:00
|
|
|
\ No newline at end of file
|
2022-06-03 06:20:55 +08:00
|
|
|
+install(EXPORT unofficial-nethost-config
|
|
|
|
+ DESTINATION share/unofficial-nethost
|
|
|
|
+ FILE unofficial-nethost-config.cmake
|
|
|
|
+ NAMESPACE unofficial::nethost::
|
|
|
|
+)
|