Add corguids static library build.
authorMikhail Kurinnoi <m.kurinnoi@samsung.com>
Fri, 10 Sep 2021 17:25:35 +0000 (10:25 -0700)
committerAlexander Soldatov/Platform Lab /SRR/Staff Engineer/Samsung Electronics <soldatov.a@samsung.com>
Fri, 10 Sep 2021 17:40:06 +0000 (20:40 +0300)
CMakeLists.txt
src/CMakeLists.txt

index cb2470c63e40fa9a9bed637ee207f8e2f0cf4393..191c47c2770a4f73345eb384c2a8db45773592bf 100644 (file)
@@ -50,8 +50,21 @@ include_directories("${CLR_SRC_DIR}/src/pal/inc/rt")
 include_directories("${CLR_SRC_DIR}/src/inc")
 include_directories("${CLR_BIN_DIR}/inc")
 
+# Build corguids static library from coreclr source files
+if (NOT WIN32)
+    add_compile_options(-Wno-extra-tokens)
+endif()
+add_compile_options(-D_MIDL_USE_GUIDDEF_)
+file(GLOB CORGUIDS_SOURCES "${CLR_SRC_DIR}/src/pal/prebuilt/idl/*_i.cpp")
+add_library(corguids STATIC ${CORGUIDS_SOURCES})
+if (NOT WIN32)
+    target_compile_options(corguids PRIVATE -Wno-unused-parameter)
+    target_include_directories(corguids PRIVATE ${CLR_SRC_DIR}/src/pal/inc ${CLR_SRC_DIR}/src/pal/inc/rt)
+    target_include_directories(corguids PRIVATE ${CLR_SRC_DIR}/src/inc ${CLR_SRC_DIR}/src/debug/inc)
+endif()
+
 # Import CoreCLR libraries
-foreach(static_lib libcorguids libcoreclrpal libpalrt)
+foreach(static_lib libcoreclrpal libpalrt)
   add_library(${static_lib} STATIC IMPORTED)
   set_target_properties(${static_lib} PROPERTIES
     IMPORTED_LOCATION ${CLR_BIN_DIR}/lib/${static_lib}.a
index e74b9b17b1c0e3a6d7162743fd150d70f400efba..3e754fa01d45af5c48829f8ca551c62cd9c79c6a 100644 (file)
@@ -49,7 +49,7 @@ set_property(
 )
 
 target_link_libraries(coreprof
-  # libcorguids
+  corguids
   # utilcodestaticnohost
   # gcinfo
   # mscorrc_debug