Skip to content

Commit cb1282d

Browse files
specify compilation flags for each target that did not pass the binskim scan
Signed-off-by: Zhu, Shaojie <[email protected]>
1 parent d8b8864 commit cb1282d

File tree

34 files changed

+213
-4
lines changed

34 files changed

+213
-4
lines changed

llvm/lib/Analysis/CMakeLists.txt

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -161,3 +161,9 @@ add_llvm_component_library(LLVMAnalysis
161161
Support
162162
TargetParser
163163
)
164+
165+
if(MSVC and BUILD_COMPILER_FOR_DRIVER)
166+
target_compile_options(LLVMAnalysis PRIVATE
167+
/w34146 /w34244 /w34267
168+
)
169+
endif()

llvm/lib/BinaryFormat/CMakeLists.txt

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,3 +21,9 @@ add_llvm_component_library(LLVMBinaryFormat
2121
Support
2222
TargetParser
2323
)
24+
25+
if(MSVC and BUILD_COMPILER_FOR_DRIVER)
26+
target_compile_options(LLVMBinaryFormat PRIVATE
27+
/w34146 /w34244 /w34267
28+
)
29+
endif()

llvm/lib/Bitcode/Reader/CMakeLists.txt

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,3 +17,9 @@ add_llvm_component_library(LLVMBitReader
1717
Support
1818
TargetParser
1919
)
20+
21+
if(MSVC and BUILD_COMPILER_FOR_DRIVER)
22+
target_compile_options(LLVMBitReader PRIVATE
23+
/w34146 /w34244 /w34267
24+
)
25+
endif()

llvm/lib/Frontend/Offloading/CMakeLists.txt

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,3 +15,9 @@ add_llvm_component_library(LLVMFrontendOffloading
1515
TransformUtils
1616
TargetParser
1717
)
18+
19+
if(MSVC and BUILD_COMPILER_FOR_DRIVER)
20+
target_compile_options(LLVMFrontendOffloading PRIVATE
21+
/w34146 /w34244 /w34267
22+
)
23+
endif()

llvm/lib/Frontend/OpenMP/CMakeLists.txt

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,3 +22,9 @@ add_llvm_component_library(LLVMFrontendOpenMP
2222
BitReader
2323
FrontendOffloading
2424
)
25+
26+
if(MSVC and BUILD_COMPILER_FOR_DRIVER)
27+
target_compile_options(LLVMFrontendOpenMP PRIVATE
28+
/w34146 /w34244 /w34267
29+
)
30+
endif()

llvm/lib/IR/CMakeLists.txt

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -87,3 +87,9 @@ add_llvm_component_library(LLVMCore
8787
Support
8888
TargetParser
8989
)
90+
91+
if(MSVC and BUILD_COMPILER_FOR_DRIVER)
92+
target_compile_options(LLVMCore PRIVATE
93+
/w34146 /w34244 /w34267
94+
)
95+
endif()

llvm/lib/ProfileData/CMakeLists.txt

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,4 +29,10 @@ add_llvm_component_library(LLVMProfileData
2929
TargetParser
3030
)
3131

32+
if(MSVC and BUILD_COMPILER_FOR_DRIVER)
33+
target_compile_options(LLVMProfileData PRIVATE
34+
/w34146 /w34244 /w34267
35+
)
36+
endif()
37+
3238
add_subdirectory(Coverage)

llvm/lib/Remarks/CMakeLists.txt

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,3 +21,9 @@ add_llvm_component_library(LLVMRemarks
2121
DEPENDS
2222
intrinsics_gen
2323
)
24+
25+
if(MSVC and BUILD_COMPILER_FOR_DRIVER)
26+
target_compile_options(LLVMRemarks PRIVATE
27+
/w34146 /w34244 /w34267
28+
)
29+
endif()

llvm/lib/Support/CMakeLists.txt

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -291,13 +291,11 @@ add_llvm_component_library(LLVMSupport
291291
LINK_COMPONENTS
292292
Demangle
293293
)
294-
295-
if(MSVC)
296-
if(BUILD_COMPILER_FOR_DRIVER)
294+
295+
if(MSVC and BUILD_COMPILER_FOR_DRIVER)
297296
target_compile_options(LLVMSupport PRIVATE
298297
/w34146 /w34244 /w34267
299298
)
300-
endif()
301299
endif()
302300

303301
set(llvm_system_libs ${system_libs})

llvm/lib/TargetParser/CMakeLists.txt

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,3 +39,9 @@ add_llvm_component_library(LLVMTargetParser
3939
DEPENDS
4040
RISCVTargetParserTableGen
4141
)
42+
43+
if(MSVC and BUILD_COMPILER_FOR_DRIVER)
44+
target_compile_options(LLVMTargetParser PRIVATE
45+
/w34146 /w34244 /w34267
46+
)
47+
endif()

0 commit comments

Comments
 (0)