Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix build on clangcl, except for v8 assembly #9

Merged
merged 1 commit into from
Dec 15, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion common.gypi
Original file line number Diff line number Diff line change
Expand Up @@ -284,9 +284,13 @@
],
'msvs_settings': {
'VCCLCompilerTool': {
# Node has C and C++ dependencies: we want to specify the standards
# independently. Recent versions of Visual Studio support C11 and C17
# https://learn.microsoft.com/en-us/cpp/overview/install-c17-support?view=msvc-170
'LanguageStandard': 'stdcpp17', # can switch to stdcpp20 or better
'LanguageStandard_C': 'stdc11', # can switch to stdc17 or better
'AdditionalOptions': [
'/Zc:__cplusplus',
'-std:c++17'
],
'BufferSecurityCheck': 'true',
'DebugInformationFormat': 1, # /Z7 embed info in .obj files
Expand Down
15 changes: 5 additions & 10 deletions deps/base64/base64.gyp
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,8 @@
}],

# Runtime detection will happen for x86 CPUs
[ 'target_arch in "ia32 x64 x32"', {
# Except for ClangCL.
[ 'target_arch in "ia32 x64 x32" and OS!="win"', {
'defines': [
'HAVE_SSSE3=1',
'HAVE_SSE41=1',
Expand Down Expand Up @@ -159,9 +160,7 @@
}, {
'msvs_settings': {
'VCCLCompilerTool': {
'AdditionalOptions': [
'/arch:AVX'
],
'EnableEnhancedInstructionSet': '3' # gyp uses a digit instead of a string such as 'AVX'
},
},
}],
Expand All @@ -183,9 +182,7 @@
}, {
'msvs_settings': {
'VCCLCompilerTool': {
'AdditionalOptions': [
'/arch:AVX2'
],
'EnableEnhancedInstructionSet': '5' # gyp uses a digit instead of a string such as 'AVX2'
},
},
}],
Expand All @@ -207,9 +204,7 @@
}, {
'msvs_settings': {
'VCCLCompilerTool': {
'AdditionalOptions': [
'/arch:AVX512'
],
'EnableEnhancedInstructionSet': '6' # gyp uses a digit instead of a string such as 'AVX512'
},
},
}],
Expand Down
6 changes: 2 additions & 4 deletions deps/zlib/zlib.gyp
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,11 @@
'type': 'static_library',
'conditions': [
['target_arch in "ia32 x64" and OS!="ios"', {
'defines': [ 'ADLER32_SIMD_SSSE3' ],
'conditions': [
['OS=="win"', {
'defines': [ 'X86_WINDOWS' ],
},{
'defines': [ 'X86_NOT_WINDOWS' ],
'defines': [ 'X86_NOT_WINDOWS', 'ADLER32_SIMD_SSSE3' ],
}],
['OS!="win" or llvm_version!="0.0"', {
'cflags': [ '-mssse3' ],
Expand All @@ -40,12 +39,11 @@
'direct_dependent_settings': {
'conditions': [
['target_arch in "ia32 x64" and OS!="ios"', {
'defines': [ 'ADLER32_SIMD_SSSE3' ],
'conditions': [
['OS=="win"', {
'defines': [ 'X86_WINDOWS' ],
},{
'defines': [ 'X86_NOT_WINDOWS' ],
'defines': [ 'X86_NOT_WINDOWS', 'ADLER32_SIMD_SSSE3' ],
}],
],
}],
Expand Down
3 changes: 3 additions & 0 deletions tools/gyp/pylib/gyp/MSVSSettings.py
Original file line number Diff line number Diff line change
Expand Up @@ -579,6 +579,8 @@ def _ValidateSettings(validators, settings, stderr):
# Options that have the same name in MSVS and MSBuild
_Same(_compile, "AdditionalIncludeDirectories", _folder_list) # /I
_Same(_compile, "AdditionalOptions", _string_list)
_Same(_compile, "LanguageStandard", _string)
_Same(_compile, "LanguageStandard_C", _string)
_Same(_compile, "AdditionalUsingDirectories", _folder_list) # /AI
_Same(_compile, "AssemblerListingLocation", _file_name) # /Fa
_Same(_compile, "BrowseInformationFile", _file_name)
Expand Down Expand Up @@ -675,6 +677,7 @@ def _ValidateSettings(validators, settings, stderr):
"NoExtensions", # /arch:IA32 (vs2012+)
# This one only exists in the new msbuild format.
"AdvancedVectorExtensions2", # /arch:AVX2 (vs2013r2+)
"AdvancedVectorExtensions512", # (vs2019+)
]
),
)
Expand Down
2 changes: 1 addition & 1 deletion tools/gyp/pylib/gyp/msvs_emulation.py
Original file line number Diff line number Diff line change
Expand Up @@ -531,7 +531,7 @@ def GetCflags(self, config):
cl("AdditionalOptions", prefix="")
cl(
"EnableEnhancedInstructionSet",
map={"1": "SSE", "2": "SSE2", "3": "AVX", "4": "IA32", "5": "AVX2"},
map={"1": "SSE", "2": "SSE2", "3": "AVX", "4": "IA32", "5": "AVX2", "6": "AVX512"},
prefix="/arch:",
)
cflags.extend(
Expand Down