Skip to content

Commit

Permalink
Minimum CMake downgrade for Linux (#39044) (#40471)
Browse files Browse the repository at this point in the history
Co-authored-by: Santiago Fernandez Madero <safern@microsoft.com>
Co-authored-by: Jan Vorlicek <janvorli@microsoft.com>

Co-authored-by: Jeremy Koritzinsky <jekoritz@microsoft.com>
Co-authored-by: Santiago Fernandez Madero <safern@microsoft.com>
Co-authored-by: Jan Vorlicek <janvorli@microsoft.com>
  • Loading branch information
4 people authored Aug 7, 2020
1 parent 7b82cf1 commit bf45665
Show file tree
Hide file tree
Showing 44 changed files with 249 additions and 165 deletions.
9 changes: 2 additions & 7 deletions eng/native/build-commons.sh
Original file line number Diff line number Diff line change
Expand Up @@ -48,11 +48,6 @@ check_prereqs()
{
echo "Checking prerequisites..."

if ! cmake --help 2>&1 | grep -q \\-B; then
echo "Please install cmake v3.14.5 or newer from https://www.cmake.org/download/."
exit 1
fi

if [[ "$__HostOS" == "OSX" ]]; then
# Check presence of pkg-config on the path
command -v pkg-config 2>/dev/null || { echo >&2 "Please install pkg-config before running this script, see https://github.com/dotnet/runtime/blob/master/docs/workflow/requirements/macos-requirements.md"; exit 1; }
Expand Down Expand Up @@ -177,8 +172,8 @@ EOF
cmake_command="emcmake $cmake_command"
fi

echo "Executing $cmake_command --build \"$intermediatesDir\" --target install -j $__NumProc"
$cmake_command --build "$intermediatesDir" --target install -j "$__NumProc"
echo "Executing $cmake_command --build \"$intermediatesDir\" --target install -- -j $__NumProc"
$cmake_command --build "$intermediatesDir" --target install -- -j "$__NumProc"
fi

local exit_code="$?"
Expand Down
78 changes: 44 additions & 34 deletions eng/native/configurecompiler.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,6 @@ set(CMAKE_C_STANDARD_REQUIRED ON)
set(CMAKE_CXX_STANDARD 11)
set(CMAKE_CXX_STANDARD_REQUIRED ON)

cmake_policy(SET CMP0083 NEW)

include(CheckCXXCompilerFlag)

# "configureoptimization.cmake" must be included after CLR_CMAKE_HOST_UNIX has been set.
Expand Down Expand Up @@ -40,11 +38,18 @@ set(CMAKE_CXX_FLAGS_CHECKED "")
set(CMAKE_EXE_LINKER_FLAGS_CHECKED "")
set(CMAKE_SHARED_LINKER_FLAGS_CHECKED "")

set(CMAKE_SHARED_LINKER_FLAGS_DEBUG "")
set(CMAKE_SHARED_LINKER_FLAGS_RELEASE "")
set(CMAKE_SHARED_LINKER_FLAGS_RELWITHDEBINFO "")
set(CMAKE_EXE_LINKER_FLAGS_DEBUG "")
set(CMAKE_EXE_LINKER_FLAGS_DEBUG "")
set(CMAKE_EXE_LINKER_FLAGS_RELWITHDEBINFO "")

add_compile_definitions("$<$<OR:$<CONFIG:DEBUG>,$<CONFIG:CHECKED>>:DEBUG;_DEBUG;_DBG;URTBLDENV_FRIENDLY=Checked;BUILDENV_CHECKED=1>")
add_compile_definitions("$<$<OR:$<CONFIG:RELEASE>,$<CONFIG:RELWITHDEBINFO>>:NDEBUG;URTBLDENV_FRIENDLY=Retail>")

if (MSVC)
add_link_options(/GUARD:CF)
add_linker_flag(/GUARD:CF)

# Linker flags
#
Expand All @@ -57,48 +62,51 @@ if (MSVC)
endif ()

#Do not create Side-by-Side Assembly Manifest
add_link_options($<$<STREQUAL:$<TARGET_PROPERTY:TYPE>,SHARED_LIBRARY>:/MANIFEST:NO>)
set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} /MANIFEST:NO")
# can handle addresses larger than 2 gigabytes
add_link_options($<$<STREQUAL:$<TARGET_PROPERTY:TYPE>,SHARED_LIBRARY>:/LARGEADDRESSAWARE>)
set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} /LARGEADDRESSAWARE")
#Compatible with Data Execution Prevention
add_link_options($<$<STREQUAL:$<TARGET_PROPERTY:TYPE>,SHARED_LIBRARY>:/NXCOMPAT>)
set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} /NXCOMPAT")
#Use address space layout randomization
add_link_options($<$<STREQUAL:$<TARGET_PROPERTY:TYPE>,SHARED_LIBRARY>:/DYNAMICBASE>)
set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} /DYNAMICBASE")
#shrink pdb size
add_link_options($<$<STREQUAL:$<TARGET_PROPERTY:TYPE>,SHARED_LIBRARY>:/PDBCOMPRESS>)
set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} /PDBCOMPRESS")

add_link_options($<$<STREQUAL:$<TARGET_PROPERTY:TYPE>,SHARED_LIBRARY>:/DEBUG>)
add_link_options($<$<STREQUAL:$<TARGET_PROPERTY:TYPE>,SHARED_LIBRARY>:/IGNORE:4197,4013,4254,4070,4221>)
add_link_options($<$<STREQUAL:$<TARGET_PROPERTY:TYPE>,SHARED_LIBRARY>:/SUBSYSTEM:WINDOWS,${WINDOWS_SUBSYSTEM_VERSION}>)
set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} /DEBUG")
set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} /IGNORE:4197,4013,4254,4070,4221")
set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} /SUBSYSTEM:WINDOWS,${WINDOWS_SUBSYSTEM_VERSION}")

set(CMAKE_STATIC_LINKER_FLAGS "${CMAKE_STATIC_LINKER_FLAGS} /IGNORE:4221")

add_link_options($<$<STREQUAL:$<TARGET_PROPERTY:TYPE>,EXECUTABLE>:/DEBUG>)
add_link_options($<$<STREQUAL:$<TARGET_PROPERTY:TYPE>,EXECUTABLE>:/PDBCOMPRESS>)
add_link_options($<$<STREQUAL:$<TARGET_PROPERTY:TYPE>,EXECUTABLE>:/STACK:1572864>)
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} /DEBUG")
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} /PDBCOMPRESS")
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} /STACK:1572864")

# Debug build specific flags
add_link_options($<$<AND:$<OR:$<CONFIG:DEBUG>,$<CONFIG:CHECKED>>,$<STREQUAL:$<TARGET_PROPERTY:TYPE>,SHARED_LIBRARY>>:/NOVCFEATURE>)
set(CMAKE_SHARED_LINKER_FLAGS_DEBUG "${CMAKE_SHARED_LINKER_FLAGS_DEBUG} /NOVCFEATURE")
set(CMAKE_SHARED_LINKER_FLAGS_CHECKED "${CMAKE_SHARED_LINKER_FLAGS_CHECKED} /NOVCFEATURE")

# Checked build specific flags
add_link_options($<$<CONFIG:CHECKED>:/INCREMENTAL:NO>) # prevent "warning LNK4075: ignoring '/INCREMENTAL' due to '/OPT:REF' specification"
add_link_options($<$<CONFIG:CHECKED>:/OPT:REF>)
add_link_options($<$<CONFIG:CHECKED>:/OPT:NOICF>)
add_linker_flag(/INCREMENTAL:NO CHECKED) # prevent "warning LNK4075: ignoring '/INCREMENTAL' due to '/OPT:REF' specification"
add_linker_flag(/OPT:REF CHECKED)
add_linker_flag(/OPT:NOICF CHECKED)

# Release build specific flags
add_link_options($<$<CONFIG:RELEASE>:/LTCG>)
add_link_options($<$<CONFIG:RELEASE>:/OPT:REF>)
add_link_options($<$<CONFIG:RELEASE>:/OPT:ICF>)
add_linker_flag(/LTCG RELEASE)
add_linker_flag(/OPT:REF RELEASE)
add_linker_flag(/OPT:ICF RELEASE)
add_linker_flag(/INCREMENTAL:NO RELEASE)
set(CMAKE_STATIC_LINKER_FLAGS_RELEASE "${CMAKE_STATIC_LINKER_FLAGS_RELEASE} /LTCG")

# ReleaseWithDebugInfo build specific flags
add_link_options($<$<CONFIG:RELWITHDEBINFO>:/LTCG>)
add_link_options($<$<CONFIG:RELWITHDEBINFO>:/OPT:REF>)
add_link_options($<$<CONFIG:RELWITHDEBINFO>:/OPT:ICF>)
add_linker_flag(/LTCG RELWITHDEBINFO)
add_linker_flag(/OPT:REF RELWITHDEBINFO)
add_linker_flag(/OPT:ICF RELWITHDEBINFO)
set(CMAKE_STATIC_LINKER_FLAGS_RELWITHDEBINFO "${CMAKE_STATIC_LINKER_FLAGS_RELWITHDEBINFO} /LTCG")

# Force uCRT to be dynamically linked for Release build
add_link_options("$<$<CONFIG:RELEASE>:/NODEFAULTLIB:libucrt.lib;/DEFAULTLIB:ucrt.lib>")
add_linker_flag(/NODEFAULTLIB:libucrt.lib RELEASE)
add_linker_flag(/DEFAULTLIB:ucrt.lib RELEASE)

elseif (CLR_CMAKE_HOST_UNIX)
# Set the values to display when interactively configuring CMAKE_BUILD_TYPE
Expand Down Expand Up @@ -157,11 +165,10 @@ elseif (CLR_CMAKE_HOST_UNIX)

# -fdata-sections -ffunction-sections: each function has own section instead of one per .o file (needed for --gc-sections)
# -O1: optimization level used instead of -O0 to avoid compile error "invalid operand for inline asm constraint"
add_compile_definitions("$<$<OR:$<CONFIG:DEBUG>,$<CONFIG:CHECKED>>:${CLR_SANITIZE_CXX_OPTIONS};-fdata-sections;--ffunction-sections;-O1>")
add_link_options($<$<AND:$<OR:$<CONFIG:DEBUG>,$<CONFIG:CHECKED>>,$<STREQUAL:$<TARGET_PROPERTY:TYPE>,EXECUTABLE>>:${CLR_SANITIZE_LINK_OPTIONS}>)

add_compile_options("$<$<OR:$<CONFIG:DEBUG>,$<CONFIG:CHECKED>>:${CLR_SANITIZE_CXX_OPTIONS};-fdata-sections;--ffunction-sections;-O1>")
add_linker_flag("${CLR_SANITIZE_LINK_OPTIONS}" DEBUG CHECKED)
# -Wl and --gc-sections: drop unused sections\functions (similar to Windows /Gy function-level-linking)
add_link_options("$<$<AND:$<OR:$<CONFIG:DEBUG>,$<CONFIG:CHECKED>>,$<STREQUAL:$<TARGET_PROPERTY:TYPE>,SHARED_LIBRARY>>:${CLR_SANITIZE_LINK_OPTIONS};-Wl,--gc-sections>")
add_linker_flag("-Wl,--gc-sections" DEBUG CHECKED)
endif ()
endif(UPPERCASE_CMAKE_BUILD_TYPE STREQUAL DEBUG OR UPPERCASE_CMAKE_BUILD_TYPE STREQUAL CHECKED)
endif(MSVC)
Expand All @@ -173,15 +180,18 @@ endif(MSVC)
# ./build-native.sh cmakeargs "-DCLR_ADDITIONAL_COMPILER_OPTIONS=<...>" cmakeargs "-DCLR_ADDITIONAL_LINKER_FLAGS=<...>"
#
if(CLR_CMAKE_HOST_UNIX)
add_link_options(${CLR_ADDITIONAL_LINKER_FLAGS})
foreach(ADDTL_LINKER_FLAG ${CLR_ADDITIONAL_LINKER_FLAGS})
add_linker_flag(${ADDTL_LINKER_FLAG})
endforeach()
endif(CLR_CMAKE_HOST_UNIX)

if(CLR_CMAKE_HOST_LINUX)
add_compile_options($<$<COMPILE_LANGUAGE:ASM>:-Wa,--noexecstack>)
add_link_options(-Wl,--build-id=sha1 -Wl,-z,relro,-z,now)
add_linker_flag(-Wl,--build-id=sha1)
add_linker_flag(-Wl,-z,relro,-z,now)
elseif(CLR_CMAKE_HOST_FREEBSD)
add_compile_options($<$<COMPILE_LANGUAGE:ASM>:-Wa,--noexecstack>)
add_link_options(LINKER:--build-id=sha1)
add_linker_flag("-Wl,--build-id=sha1")
elseif(CLR_CMAKE_HOST_SUNOS)
add_compile_options($<$<COMPILE_LANGUAGE:ASM>:-Wa,--noexecstack>)
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fstack-protector")
Expand Down Expand Up @@ -361,7 +371,7 @@ if (CLR_CMAKE_HOST_UNIX)
if(CLR_CMAKE_HOST_OSX)
set(MACOS_VERSION_MIN_FLAGS -mmacosx-version-min=10.12)
add_compile_options(${MACOS_VERSION_MIN_FLAGS})
add_link_options(${MACOS_VERSION_MIN_FLAGS})
add_linker_flag(${MACOS_VERSION_MIN_FLAGS})
endif(CLR_CMAKE_HOST_OSX)
endif(CLR_CMAKE_HOST_UNIX)

Expand Down Expand Up @@ -517,7 +527,7 @@ if(CLR_CMAKE_ENABLE_CODE_COVERAGE)

add_compile_options(-fprofile-arcs)
add_compile_options(-ftest-coverage)
add_link_options(--coverage)
add_linker_flag(--coverage)
else()
message(FATAL_ERROR "Code coverage builds not supported on current platform")
endif(CLR_CMAKE_HOST_UNIX)
Expand Down
22 changes: 4 additions & 18 deletions eng/native/configureplatform.cmake
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
include(CheckPIESupported)
include(${CMAKE_CURRENT_LIST_DIR}/functions.cmake)

# If set, indicates that this is not an officially supported release
Expand Down Expand Up @@ -382,24 +381,11 @@ else()
endif()

if(NOT CLR_CMAKE_TARGET_BROWSER)
# Skip check_pie_supported call on Android as ld from llvm toolchain with NDK API level 21
# complains about missing linker flag `-no-pie` (while level 28's ld does support this flag,
# but since we know that PIE is supported, we can safely skip this redundant check).
#
# The default linker on Solaris also does not support PIE.
if(NOT CLR_CMAKE_TARGET_ANDROID AND NOT CLR_CMAKE_TARGET_SUNOS)
# All code we build should be compiled as position independent
get_property(languages GLOBAL PROPERTY ENABLED_LANGUAGES)
if("CXX" IN_LIST languages)
set(CLR_PIE_LANGUAGE CXX)
else()
set(CLR_PIE_LANGUAGE C)
endif()
check_pie_supported(OUTPUT_VARIABLE PIE_SUPPORT_OUTPUT LANGUAGES ${CLR_PIE_LANGUAGE})
if(NOT MSVC AND NOT CMAKE_${CLR_PIE_LANGUAGE}_LINK_PIE_SUPPORTED)
message(WARNING "PIE is not supported at link time: ${PIE_SUPPORT_OUTPUT}.\n"
"PIE link options will not be passed to linker.")
endif()
if(NOT CLR_CMAKE_TARGET_ANDROID AND NOT CLR_CMAKE_TARGET_SUNOS AND NOT CLR_CMAKE_TARGET_OSX AND NOT CLR_CMAKE_HOST_TVOS AND NOT CLR_CMAKE_HOST_IOS AND NOT MSVC)
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -pie")
add_compile_options($<$<STREQUAL:$<TARGET_PROPERTY:TYPE>,EXECUTABLE>:-fPIE>)
add_compile_options($<$<STREQUAL:$<TARGET_PROPERTY:TYPE>,SHARED_LIBRARY>:-fPIC>)
endif()

set(CMAKE_POSITION_INDEPENDENT_CODE ON)
Expand Down
28 changes: 25 additions & 3 deletions eng/native/functions.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ function(preprocess_compile_asm)
set(options "")
set(oneValueArgs TARGET OUTPUT_OBJECTS)
set(multiValueArgs ASM_FILES)
cmake_parse_arguments(PARSE_ARGV 0 COMPILE_ASM "${options}" "${oneValueArgs}" "${multiValueArgs}")
cmake_parse_arguments(COMPILE_ASM "${options}" "${oneValueArgs}" "${multiValueArgs}" ${ARGV})

get_include_directories_asm(ASM_INCLUDE_DIRECTORIES)

Expand Down Expand Up @@ -241,7 +241,7 @@ function(target_precompile_header)
set(options "")
set(oneValueArgs TARGET HEADER)
set(multiValueArgs ADDITIONAL_INCLUDE_DIRECTORIES)
cmake_parse_arguments(PARSE_ARGV 0 PRECOMPILE_HEADERS "${options}" "${oneValueArgs}" "${multiValueArgs}")
cmake_parse_arguments(PRECOMPILE_HEADERS "${options}" "${oneValueArgs}" "${multiValueArgs}" ${ARGV})

if ("${PRECOMPILE_HEADERS_TARGET}" STREQUAL "")
message(SEND_ERROR "No target supplied to target_precompile_header.")
Expand Down Expand Up @@ -360,7 +360,7 @@ endfunction()
function(install_clr)
set(oneValueArgs ADDITIONAL_DESTINATION)
set(multiValueArgs TARGETS)
cmake_parse_arguments(PARSE_ARGV 0 INSTALL_CLR "${options}" "${oneValueArgs}" "${multiValueArgs}")
cmake_parse_arguments(INSTALL_CLR "${options}" "${oneValueArgs}" "${multiValueArgs}" ${ARGV})

if ("${INSTALL_CLR_TARGETS}" STREQUAL "")
message(FATAL_ERROR "At least one target must be passed to install_clr(TARGETS )")
Expand Down Expand Up @@ -416,6 +416,15 @@ function(disable_pax_mprotect targetName)
endif()
endfunction()

if (CMAKE_VERSION VERSION_LESS "3.12")
# Polyfill add_compile_definitions when it is unavailable
function(add_compile_definitions)
get_directory_property(DIR_COMPILE_DEFINITIONS COMPILE_DEFINITIONS)
list(APPEND DIR_COMPILE_DEFINITIONS ${ARGV})
set_directory_properties(PROPERTIES COMPILE_DEFINITIONS "${DIR_COMPILE_DEFINITIONS}")
endfunction()
endif()

function(_add_executable)
if(NOT WIN32)
add_executable(${ARGV} ${VERSION_FILE_PATH})
Expand Down Expand Up @@ -479,3 +488,16 @@ function(generate_module_index Target ModuleIndexFile)
DEPENDS ${ModuleIndexFile}
)
endfunction(generate_module_index)

# add_linker_flag(Flag [Config1 Config2 ...])
function(add_linker_flag Flag)
if (ARGN STREQUAL "")
set("CMAKE_EXE_LINKER_FLAGS" "${CMAKE_EXE_LINKER_FLAGS} ${Flag}" PARENT_SCOPE)
set("CMAKE_SHARED_LINKER_FLAGS" "${CMAKE_SHARED_LINKER_FLAGS} ${Flag}" PARENT_SCOPE)
else()
foreach(Config ${ARGN})
set("CMAKE_EXE_LINKER_FLAGS_${Config}" "${CMAKE_EXE_LINKER_FLAGS_${Config}} ${Flag}" PARENT_SCOPE)
set("CMAKE_SHARED_LINKER_FLAGS_${Config}" "${CMAKE_SHARED_LINKER_FLAGS_${Config}} ${Flag}" PARENT_SCOPE)
endforeach()
endif()
endfunction()
8 changes: 6 additions & 2 deletions eng/native/gen-buildsys.sh
Original file line number Diff line number Diff line change
Expand Up @@ -91,12 +91,16 @@ if [[ "$build_arch" == "wasm" ]]; then
cmake_command="emcmake $cmake_command"
fi

# We have to be able to build with CMake 3.6.2, so we can't use the -S or -B options
pushd "$3"

# Include CMAKE_USER_MAKE_RULES_OVERRIDE as uninitialized since it will hold its value in the CMake cache otherwise can cause issues when branch switching
$cmake_command \
-G "$generator" \
"-DCMAKE_BUILD_TYPE=$buildtype" \
"-DCMAKE_INSTALL_PREFIX=$__CMakeBinDir" \
$cmake_extra_defines \
$__UnprocessedCMakeArgs \
-S "$1" \
-B "$3"
"$1"

popd
2 changes: 1 addition & 1 deletion src/coreclr/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
cmake_minimum_required(VERSION 3.14.5)
cmake_minimum_required(VERSION 3.6.2)

cmake_policy(SET CMP0042 NEW)

Expand Down
17 changes: 15 additions & 2 deletions src/coreclr/pgosupport.cmake
Original file line number Diff line number Diff line change
@@ -1,5 +1,18 @@
include(CheckIPOSupported)
check_ipo_supported(RESULT HAVE_LTO)
include(CheckCXXSourceCompiles)
include(CheckCXXCompilerFlag)

# VC++ guarantees support for LTCG (LTO's equivalent)
if(NOT WIN32)
# Function required to give CMAKE_REQUIRED_* local scope
function(check_have_lto)
set(CMAKE_REQUIRED_FLAGS -flto)
set(CMAKE_REQUIRED_LIBRARIES -flto -fuse-ld=gold)
check_cxx_source_compiles("int main() { return 0; }" HAVE_LTO)
endfunction(check_have_lto)
check_have_lto()

check_cxx_compiler_flag(-faligned-new COMPILER_SUPPORTS_F_ALIGNED_NEW)
endif(NOT WIN32)

# Adds Profile Guided Optimization (PGO) flags to the current target
function(add_pgo TargetName)
Expand Down
1 change: 1 addition & 0 deletions src/coreclr/src/ToolBox/SOS/DacTableGen/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
cmake_minimum_required(VERSION 3.8)
# Quick note: The CMake C# support is using the CSC bundled with the MSBuild that the native build runs on, not the one supplied by the local .NET SDK.

project(DacTableGen LANGUAGES CSharp)
Expand Down
6 changes: 4 additions & 2 deletions src/coreclr/src/binder/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -82,11 +82,13 @@ endif(CLR_CMAKE_TARGET_WIN32)
convert_to_absolute_path(BINDER_SOURCES ${BINDER_SOURCES})
convert_to_absolute_path(BINDER_CROSSGEN_SOURCES ${BINDER_CROSSGEN_SOURCES})

add_library_clr(v3binder
add_library_clr(v3binder_obj
OBJECT
${BINDER_SOURCES}
)
add_dependencies(v3binder eventing_headers)
add_dependencies(v3binder_obj eventing_headers)
add_library(v3binder INTERFACE)
target_sources(v3binder INTERFACE $<TARGET_OBJECTS:v3binder_obj>)

add_library_clr(v3binder_crossgen
STATIC
Expand Down
6 changes: 4 additions & 2 deletions src/coreclr/src/classlibnative/bcltype/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,11 @@ set(BCLTYPE_SOURCES
variant.cpp
)

add_library_clr(bcltype
add_library_clr(bcltype_obj
OBJECT
${BCLTYPE_SOURCES}
)

add_dependencies(bcltype eventing_headers)
add_dependencies(bcltype_obj eventing_headers)
add_library(bcltype INTERFACE)
target_sources(bcltype INTERFACE $<TARGET_OBJECTS:bcltype_obj>)
7 changes: 5 additions & 2 deletions src/coreclr/src/classlibnative/float/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,12 @@ set(FLOAT_SOURCES
floatsingle.cpp
)

add_library_clr(comfloat_wks
add_library_clr(comfloat_wks_obj
OBJECT
${FLOAT_SOURCES}
)

add_dependencies(comfloat_wks eventing_headers)
add_dependencies(comfloat_wks_obj eventing_headers)

add_library(comfloat_wks INTERFACE)
target_sources(comfloat_wks INTERFACE $<TARGET_OBJECTS:comfloat_wks_obj>)
4 changes: 3 additions & 1 deletion src/coreclr/src/debug/debug-pal/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -34,4 +34,6 @@ if(CLR_CMAKE_HOST_UNIX)

endif(CLR_CMAKE_HOST_UNIX)

_add_library(debug-pal OBJECT ${TWO_WAY_PIPE_SOURCES})
_add_library(debug-pal_obj OBJECT ${TWO_WAY_PIPE_SOURCES})
add_library(debug-pal INTERFACE)
target_sources(debug-pal INTERFACE $<TARGET_OBJECTS:debug-pal_obj>)
Loading

0 comments on commit bf45665

Please sign in to comment.