Link System.Globalization.Native into coreclr (#6928)
authorSantiago Fernandez Madero <safern@microsoft.com>
Mon, 3 Feb 2020 21:53:39 +0000 (13:53 -0800)
committerGitHub <noreply@github.com>
Mon, 3 Feb 2020 21:53:39 +0000 (13:53 -0800)
* 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

12 files changed:
eng/pipelines/runtime.yml
src/coreclr/CMakeLists.txt
src/coreclr/build.cmd
src/coreclr/build.sh
src/coreclr/src/dlls/mscoree/coreclr/CMakeLists.txt
src/coreclr/src/libraries-native/CMakeLists.txt [new file with mode: 0644]
src/libraries/Native/Unix/System.Globalization.Native/CMakeLists.txt
src/libraries/Native/Unix/System.IO.Compression.Native/CMakeLists.txt
src/libraries/Native/Unix/System.IO.Ports.Native/CMakeLists.txt
src/libraries/Native/Unix/System.Native/CMakeLists.txt
src/libraries/Native/Unix/System.Net.Security.Native/CMakeLists.txt
src/libraries/Native/Unix/System.Security.Cryptography.Native.Apple/CMakeLists.txt

index e8003721c75e4776e935ce4d1e18ae700d856f7e..117601b565a8fa21ae35e4c0a57eb090ae3f1fa4 100644 (file)
@@ -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'
index 30c01e5ac2459dda004f691d7be5b3a499b25538..49046059eb2bd1d3490b6bd2488eb29fa958bb78 100644 (file)
@@ -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
index a524a8082452756ab7c9ada84b36bb4b8d4e2c53..7e8a3d74c61d2e41267a580aeb16a72bf03584f4 100644 (file)
@@ -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 (
index 6d81c6551309864a80a0238e9a539a113a2b3a67..131fd7ca809f191922415a1da29858a40c79750a 100755 (executable)
@@ -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"
index efd7c60caa51cc60fa06f2a0ab6d0072c9ad4089..ca9d8cd835beb8372961485a04ad129ba938081b 100644 (file)
@@ -123,6 +123,7 @@ else()
         ${END_WHOLE_ARCHIVE}
         mscorrc_debug
         palrt
+        System.Globalization.Native-Static
     )
 endif(WIN32)
 
diff --git a/src/coreclr/src/libraries-native/CMakeLists.txt b/src/coreclr/src/libraries-native/CMakeLists.txt
new file mode 100644 (file)
index 0000000..4835c64
--- /dev/null
@@ -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()
index bef0bc6e6ed73349d7d28dfbb131b38d6e5dfe27..f6380c0b03af1ccdfb2aaebafdc5acc68120d0d4 100644 (file)
@@ -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
@@ -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()
index 0d5338beb85ced2868d097aa4e3cb337be757f54..2b04724e3be994f5406a3291a357bc7997f1d9c2 100644 (file)
@@ -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
index cd524dda785624abe493360501f0a764819287a4..5155a68a823e808be2ec7953c2ef49dced45b17f 100644 (file)
@@ -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
index 74214368eb23b44404d7ce65c307b775274f9806..82e4a84d9dc56ddcda38aa70368f8c81639eea3c 100644 (file)
@@ -60,7 +60,6 @@ endif ()
 add_library(System.Native-Static
     STATIC
     ${NATIVE_SOURCES}
-    ${VERSION_FILE_PATH}
 )
 
 # Disable the "lib" prefix and override default name
index b7a822ac04d7360e9313f8149ca7d76bb600942f..95c99012b71e79c05781404e3c99d2370136de07 100644 (file)
@@ -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
index 6143c43e22b73cfbdb99c473362de7691edbef0d..4bf9929db36b236c560ab84fb4cc3149635564da 100644 (file)
@@ -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.