Skip to content

Commit

Permalink
Link System.Globalization.Native into coreclr (dotnet#6928)
Browse files Browse the repository at this point in the history
* Link System.Globalization.Native into coreclr

* Add more paths to coreclr subset filters

* Fix linux build

* PR Feedback

* PR Feedback 2

* Fix build (pass -DREPO_ROOT_DIR only on coreclr atm), System.IO.Ports.Native needs to be built first

* Remove version header file from static libs

* Remove CORECLR_BUILD variable definition
  • Loading branch information
safern authored Feb 3, 2020
1 parent d6d3caa commit be3ebf6
Show file tree
Hide file tree
Showing 12 changed files with 33 additions and 24 deletions.
2 changes: 2 additions & 0 deletions eng/pipelines/runtime.yml
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,8 @@ jobs:
- subset: coreclr
include:
- src/libraries/System.Private.CoreLib/*
- src/libraries/Native/Unix/System.Globalization.Native/*
- src/libraries/Native/Unix/Common/*
exclude:
- eng/Version.Details.xml
- '*.md'
Expand Down
2 changes: 2 additions & 0 deletions src/coreclr/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,8 @@ endif(CLR_CROSS_COMPONENTS_BUILD)
#-------------------
include(pgosupport.cmake)

add_subdirectory(src/libraries-native)

#-----------------------------------------
# Add Projects
# - project which require platform header not clr's
Expand Down
2 changes: 1 addition & 1 deletion src/coreclr/build.cmd
Original file line number Diff line number Diff line change
Expand Up @@ -457,7 +457,7 @@ if %__BuildCrossArchNative% EQU 1 (

set __CMakeBinDir=%__CrossComponentBinDir%
set "__CMakeBinDir=!__CMakeBinDir:\=/!"
set __ExtraCmakeArgs="-DCLR_CROSS_COMPONENTS_BUILD=1" "-DCLR_CMAKE_TARGET_ARCH=%__BuildArch%" "-DCLR_CMAKE_TARGET_OS=%__BuildOS%" "-DCLR_CMAKE_PGO_INSTRUMENT=%__PgoInstrument%" "-DCLR_CMAKE_OPTDATA_PATH=%__PgoOptDataPath%" "-DCLR_CMAKE_PGO_OPTIMIZE=%__PgoOptimize%" "-DCMAKE_SYSTEM_VERSION=10.0" "-DCLR_ENG_NATIVE_DIR=%__RepoRootDir%/eng/native"
set __ExtraCmakeArgs="-DCLR_CROSS_COMPONENTS_BUILD=1" "-DCLR_CMAKE_TARGET_ARCH=%__BuildArch%" "-DCLR_CMAKE_TARGET_OS=%__BuildOS%" "-DCLR_CMAKE_PGO_INSTRUMENT=%__PgoInstrument%" "-DCLR_CMAKE_OPTDATA_PATH=%__PgoOptDataPath%" "-DCLR_CMAKE_PGO_OPTIMIZE=%__PgoOptimize%" "-DCMAKE_SYSTEM_VERSION=10.0" "-DCLR_ENG_NATIVE_DIR=%__RepoRootDir%/eng/native" "-DCLR_REPO_ROOT_DIR=%__RepoRootDir%"
call "%__SourceDir%\pal\tools\gen-buildsys.cmd" "%__ProjectDir%" "%__CrossCompIntermediatesDir%" %__VSVersion% %__CrossArch% !__ExtraCmakeArgs!

if not !errorlevel! == 0 (
Expand Down
2 changes: 1 addition & 1 deletion src/coreclr/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -503,7 +503,7 @@ restore_optdata
generate_event_logging

# Build the coreclr (native) components.
__CMakeArgs="-DCLR_CMAKE_PGO_INSTRUMENT=$__PgoInstrument -DCLR_CMAKE_OPTDATA_PATH=$__PgoOptDataPath -DCLR_CMAKE_PGO_OPTIMIZE=$__PgoOptimize $__CMakeArgs"
__CMakeArgs="-DCLR_CMAKE_PGO_INSTRUMENT=$__PgoInstrument -DCLR_CMAKE_OPTDATA_PATH=$__PgoOptDataPath -DCLR_CMAKE_PGO_OPTIMIZE=$__PgoOptimize -DCLR_REPO_ROOT_DIR=\"$__RepoRootDir\" $__CMakeArgs"

if [[ "$__SkipConfigure" == 0 && "$__CodeCoverage" == 1 ]]; then
__CMakeArgs="-DCLR_CMAKE_ENABLE_CODE_COVERAGE=1 $__CMakeArgs"
Expand Down
1 change: 1 addition & 0 deletions src/coreclr/src/dlls/mscoree/coreclr/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,7 @@ else()
${END_WHOLE_ARCHIVE}
mscorrc_debug
palrt
System.Globalization.Native-Static
)
endif(WIN32)

Expand Down
5 changes: 5 additions & 0 deletions src/coreclr/src/libraries-native/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
set(CMAKE_INCLUDE_CURRENT_DIR ON)

if(CLR_CMAKE_HOST_UNIX AND NOT CLR_CROSS_COMPONENTS_BUILD)
add_subdirectory(${CLR_REPO_ROOT_DIR}/src/libraries/Native/Unix/System.Globalization.Native System.Globalization.Native)
endif()
Original file line number Diff line number Diff line change
Expand Up @@ -58,23 +58,25 @@ set(NATIVEGLOBALIZATION_SOURCES
)

include_directories(${UTYPES_H})
include_directories("../Common")

add_library(System.Globalization.Native
SHARED
${NATIVEGLOBALIZATION_SOURCES}
${VERSION_FILE_PATH}
)
if (GEN_SHARED_LIB)
add_library(System.Globalization.Native
SHARED
${NATIVEGLOBALIZATION_SOURCES}
${VERSION_FILE_PATH}
)

target_link_libraries(System.Globalization.Native
dl
)
target_link_libraries(System.Globalization.Native
dl
)

install_library_and_symbols (System.Globalization.Native)
install_library_and_symbols (System.Globalization.Native)
endif()

add_library(System.Globalization.Native-Static
STATIC
${NATIVEGLOBALIZATION_SOURCES}
${VERSION_FILE_PATH}
)

# Disable the "lib" prefix and override default name
Expand All @@ -84,11 +86,13 @@ set_target_properties(System.Globalization.Native-Static PROPERTIES OUTPUT_NAME
install (TARGETS System.Globalization.Native-Static DESTINATION .)

if(NOT CMAKE_SYSTEM_NAME STREQUAL Darwin)
add_custom_command(TARGET System.Globalization.Native POST_BUILD
COMMENT "Verifying System.Globalization.Native.so dependencies"
COMMAND ${CMAKE_CURRENT_SOURCE_DIR}/../verify-so.sh
$<TARGET_FILE:System.Globalization.Native>
"Verification failed. System.Globalization.Native.so has undefined dependencies. These are likely ICU APIs that need to be added to icushim.h."
VERBATIM
)
if (GEN_SHARED_LIB)
add_custom_command(TARGET System.Globalization.Native POST_BUILD
COMMENT "Verifying System.Globalization.Native.so dependencies"
COMMAND ${CMAKE_CURRENT_SOURCE_DIR}/../verify-so.sh
$<TARGET_FILE:System.Globalization.Native>
"Verification failed. System.Globalization.Native.so has undefined dependencies. These are likely ICU APIs that need to be added to icushim.h."
VERBATIM
)
endif()
endif()
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,6 @@ endif ()
add_library(System.IO.Compression.Native-Static
STATIC
${NATIVECOMPRESSION_SOURCES}
${VERSION_FILE_PATH}
)

# Disable the "lib" prefix and override default name
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ add_library(System.IO.Ports.Native-Static
STATIC
pal_termios.c
pal_serial.c
${VERSION_FILE_PATH}
)

# Disable the "lib" prefix and override default name
Expand Down
1 change: 0 additions & 1 deletion src/libraries/Native/Unix/System.Native/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,6 @@ endif ()
add_library(System.Native-Static
STATIC
${NATIVE_SOURCES}
${VERSION_FILE_PATH}
)

# Disable the "lib" prefix and override default name
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@ add_library(System.Net.Security.Native
add_library(System.Net.Security.Native-Static
STATIC
${NATIVEGSS_SOURCES}
${VERSION_FILE_PATH}
)

# Disable the "lib" prefix and override default name
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@ add_library(System.Security.Cryptography.Native.Apple
add_library(System.Security.Cryptography.Native.Apple-Static
STATIC
${NATIVECRYPTO_SOURCES}
${VERSION_FILE_PATH}
)

# Disable the "lib" prefix.
Expand Down

0 comments on commit be3ebf6

Please sign in to comment.