summaryrefslogtreecommitdiff
blob: ec75efc22b970ef0954b4e08af079d8574d5a52f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
From 753a6a4efd5fcb42a86a5f62b64c29393513d807 Mon Sep 17 00:00:00 2001
From: Victor Mustya <victor.mustya@intel.com>
Date: Thu, 29 Dec 2022 05:03:39 +0000
Subject: [PATCH]  Fix open source build for some configurations

When building for some Linux distros, cmake configures IGC to build all
the libraries as shared by default. So we have to explicitly configure
all the libraries as static or object.
---
 IGC/Options/CMakeLists.txt                                   | 2 +-
 IGC/VectorCompiler/CMCL/lib/Support/CMakeLists.txt           | 2 +-
 IGC/VectorCompiler/lib/BiF/CMakeLists.txt                    | 2 +-
 IGC/VectorCompiler/lib/Driver/CMakeLists.txt                 | 2 +-
 IGC/VectorCompiler/lib/GenXCodeGen/CMakeLists.txt            | 2 +-
 IGC/VectorCompiler/lib/GenXCodeGen/TargetInfo/CMakeLists.txt | 2 +-
 IGC/VectorCompiler/lib/GenXOpts/CMakeLists.txt               | 2 +-
 IGC/VectorCompiler/lib/InternalIntrinsics/CMakeLists.txt     | 2 +-
 IGC/VectorCompiler/lib/Support/CMakeLists.txt                | 2 +-
 IGC/VectorCompiler/lib/Utils/GenX/CMakeLists.txt             | 2 +-
 IGC/VectorCompiler/lib/Utils/General/CMakeLists.txt          | 2 +-
 11 files changed, 11 insertions(+), 11 deletions(-)

diff --git a/IGC/Options/CMakeLists.txt b/IGC/Options/CMakeLists.txt
index 834d74d37ce..1dc079d1c1e 100644
--- a/IGC/Options/CMakeLists.txt
+++ b/IGC/Options/CMakeLists.txt
@@ -6,7 +6,7 @@
 #
 #============================ end_copyright_notice =============================
 
-add_library(IGCOptions "")
+add_library(IGCOptions STATIC "")
 
 add_subdirectory(src)
 add_subdirectory(include/igc/Options)
diff --git a/IGC/VectorCompiler/CMCL/lib/Support/CMakeLists.txt b/IGC/VectorCompiler/CMCL/lib/Support/CMakeLists.txt
index ebab3db0005..eda77667ddf 100644
--- a/IGC/VectorCompiler/CMCL/lib/Support/CMakeLists.txt
+++ b/IGC/VectorCompiler/CMCL/lib/Support/CMakeLists.txt
@@ -12,7 +12,7 @@ set(CM_CL_SUPPORT_SOURCES
   InitializePasses.cpp
   )
 
-add_library(CMCLSupport ${CM_CL_SUPPORT_SOURCES})
+add_library(CMCLSupport STATIC ${CM_CL_SUPPORT_SOURCES})
 
 # LLVM dependencies
 igc_get_llvm_targets(LLVM_LIBS
diff --git a/IGC/VectorCompiler/lib/BiF/CMakeLists.txt b/IGC/VectorCompiler/lib/BiF/CMakeLists.txt
index 6235fc1d21e..c439f334a98 100644
--- a/IGC/VectorCompiler/lib/BiF/CMakeLists.txt
+++ b/IGC/VectorCompiler/lib/BiF/CMakeLists.txt
@@ -275,7 +275,7 @@ add_custom_target(VCBiFPreparation
           ${SPIRV_EXEC_BUILTINS_SRC_PATH}
           ${SPIRV_ATOMIC_BUILTINS_SRC_PATH})
 
-add_library(VCEmbeddedBiF
+add_library(VCEmbeddedBiF OBJECT
   ${PRINTF_OCL_32_CPP_PATH}
   ${PRINTF_OCL_64_CPP_PATH}
   ${PRINTF_ZE_32_CPP_PATH}
diff --git a/IGC/VectorCompiler/lib/Driver/CMakeLists.txt b/IGC/VectorCompiler/lib/Driver/CMakeLists.txt
index 74e4e661e74..fc14937a1c6 100644
--- a/IGC/VectorCompiler/lib/Driver/CMakeLists.txt
+++ b/IGC/VectorCompiler/lib/Driver/CMakeLists.txt
@@ -11,7 +11,7 @@ set(DRIVER_SOURCES
   SPIRVWrapper.cpp
   )
 
-add_library(VCDriver ${DRIVER_SOURCES})
+add_library(VCDriver STATIC ${DRIVER_SOURCES})
 igc_get_llvm_targets(LLVM_LIBS
   Analysis
   BitReader
diff --git a/IGC/VectorCompiler/lib/GenXCodeGen/CMakeLists.txt b/IGC/VectorCompiler/lib/GenXCodeGen/CMakeLists.txt
index 185a7533a89..4c3eada26fb 100644
--- a/IGC/VectorCompiler/lib/GenXCodeGen/CMakeLists.txt
+++ b/IGC/VectorCompiler/lib/GenXCodeGen/CMakeLists.txt
@@ -88,7 +88,7 @@ set(CODEGEN_SOURCES
   GenXFixInvalidFuncName.cpp
 )
 
-add_library(VCCodeGen ${CODEGEN_SOURCES})
+add_library(VCCodeGen STATIC ${CODEGEN_SOURCES})
 add_dependencies(VCCodeGen
   GenXUtilBuild
   GenXCommonTableGen_target
diff --git a/IGC/VectorCompiler/lib/GenXCodeGen/TargetInfo/CMakeLists.txt b/IGC/VectorCompiler/lib/GenXCodeGen/TargetInfo/CMakeLists.txt
index dca9455f464..8a0b66f7b55 100644
--- a/IGC/VectorCompiler/lib/GenXCodeGen/TargetInfo/CMakeLists.txt
+++ b/IGC/VectorCompiler/lib/GenXCodeGen/TargetInfo/CMakeLists.txt
@@ -10,7 +10,7 @@ set(INFO_SOURCES
   GenXTargetInfo.cpp
 )
 
-add_library(VCTargetInfo ${INFO_SOURCES})
+add_library(VCTargetInfo OBJECT ${INFO_SOURCES})
 
 igc_get_llvm_targets(LLVM_LIBS Support)
 
diff --git a/IGC/VectorCompiler/lib/GenXOpts/CMakeLists.txt b/IGC/VectorCompiler/lib/GenXOpts/CMakeLists.txt
index 44ebf851d6e..0f56a8c1a26 100644
--- a/IGC/VectorCompiler/lib/GenXOpts/CMakeLists.txt
+++ b/IGC/VectorCompiler/lib/GenXOpts/CMakeLists.txt
@@ -27,7 +27,7 @@ set(OPT_SOURCES
   CMPacketize/PacketBuilder_misc.cpp
 )
 
-add_library(VCTransforms ${OPT_SOURCES})
+add_library(VCTransforms OBJECT ${OPT_SOURCES})
 
 igc_get_llvm_targets(LLVM_LIBS
   Analysis
diff --git a/IGC/VectorCompiler/lib/InternalIntrinsics/CMakeLists.txt b/IGC/VectorCompiler/lib/InternalIntrinsics/CMakeLists.txt
index 332d74e25dd..060cccc91fc 100644
--- a/IGC/VectorCompiler/lib/InternalIntrinsics/CMakeLists.txt
+++ b/IGC/VectorCompiler/lib/InternalIntrinsics/CMakeLists.txt
@@ -14,7 +14,7 @@ set(LLVM_COMPONENTS
 )
 
 igc_get_llvm_targets(LLVM_LIBS ${LLVM_COMPONENTS})
-add_library(VCInternalIntrinsics
+add_library(VCInternalIntrinsics OBJECT
   InternalIntrinsics.cpp
 )
 
diff --git a/IGC/VectorCompiler/lib/Support/CMakeLists.txt b/IGC/VectorCompiler/lib/Support/CMakeLists.txt
index 047f2528761..12b7bb62cca 100644
--- a/IGC/VectorCompiler/lib/Support/CMakeLists.txt
+++ b/IGC/VectorCompiler/lib/Support/CMakeLists.txt
@@ -15,7 +15,7 @@ set(SUPPORT_SOURCES
   PassPrinters.cpp
   )
 
-add_library(VCSupport ${SUPPORT_SOURCES})
+add_library(VCSupport OBJECT ${SUPPORT_SOURCES})
 igc_get_llvm_targets(LLVM_LIBS
   Support
   Core
diff --git a/IGC/VectorCompiler/lib/Utils/GenX/CMakeLists.txt b/IGC/VectorCompiler/lib/Utils/GenX/CMakeLists.txt
index e5a7bff2392..b77547c6bcd 100644
--- a/IGC/VectorCompiler/lib/Utils/GenX/CMakeLists.txt
+++ b/IGC/VectorCompiler/lib/Utils/GenX/CMakeLists.txt
@@ -21,7 +21,7 @@ set(GENX_UTILS_SOURCES
   TransformArgCopy.cpp
   )
 
-add_library(VCGenXUtils ${GENX_UTILS_SOURCES})
+add_library(VCGenXUtils OBJECT ${GENX_UTILS_SOURCES})
 igc_get_llvm_targets(LLVM_LIBS
   Core
   Support
diff --git a/IGC/VectorCompiler/lib/Utils/General/CMakeLists.txt b/IGC/VectorCompiler/lib/Utils/General/CMakeLists.txt
index 873d45e8025..8408828f748 100644
--- a/IGC/VectorCompiler/lib/Utils/General/CMakeLists.txt
+++ b/IGC/VectorCompiler/lib/Utils/General/CMakeLists.txt
@@ -16,7 +16,7 @@ set(GENERAL_UTILS_SOURCES
   IndexFlattener.cpp
   )
 
-add_library(VCGeneralUtils ${GENERAL_UTILS_SOURCES})
+add_library(VCGeneralUtils OBJECT ${GENERAL_UTILS_SOURCES})
 igc_get_llvm_targets(LLVM_LIBS
   Core
   Support