Skip to content

Commit

Permalink
build: use modern msbuild_settings in common.gypi
Browse files Browse the repository at this point in the history
  • Loading branch information
targos authored and nodejs-github-bot committed Apr 28, 2024
1 parent bb8cf85 commit 496671f
Showing 1 changed file with 34 additions and 30 deletions.
64 changes: 34 additions & 30 deletions common.gypi
Expand Up @@ -137,9 +137,9 @@
'v8_enable_handle_zapping': 1,
'conditions': [
['node_shared != "true"', {
'MSVC_runtimeType': 1, # MultiThreadedDebug (/MTd)
'MSVC_runtimeType': 'MultiThreadedDebug', # /MTd
}, {
'MSVC_runtimeType': 3, # MultiThreadedDebugDLL (/MDd)
'MSVC_runtimeType': 'MultiThreadedDebugDLL', # /MDd
}],
],
},
Expand All @@ -154,18 +154,22 @@
'cflags': [ '-fPIC' ],
'ldflags': [ '-fPIC' ]
}],
['OS == "win"', {
'msvs_settings': {
'VCLinkerTool': {
'LinkIncremental': 2, # Enable incremental linking
},
},
}],
],
'msvs_settings': {
'VCCLCompilerTool': {
'BasicRuntimeChecks': 3, # /RTC1
'msbuild_settings': {
'ClCompile': {
'BasicRuntimeChecks': 'EnableFastChecks', # /RTC1
'MinimalRebuild': 'false',
'OmitFramePointers': 'false',
'Optimization': 0, # /Od, no optimization
'Optimization': 'Disabled', # /Od, no optimization
'RuntimeLibrary': '<(MSVC_runtimeType)',
},
'VCLinkerTool': {
'LinkIncremental': 2, # enable incremental linking
},
},
'xcode_settings': {
'GCC_OPTIMIZATION_LEVEL': '0', # stop gyp from defaulting to -Os
Expand All @@ -178,9 +182,9 @@
'pgo_use': ' -fprofile-use -fprofile-correction ',
'conditions': [
['node_shared != "true"', {
'MSVC_runtimeType': 0 # MultiThreaded (/MT)
'MSVC_runtimeType': 'MultiThreaded' # /MT
}, {
'MSVC_runtimeType': 2 # MultiThreadedDLL (/MD)
'MSVC_runtimeType': 'MultiThreadedDLL' # /MD
}],
['llvm_version=="0.0"', {
'lto': ' -flto=4 -fuse-linker-plugin -ffat-lto-objects ', # GCC
Expand Down Expand Up @@ -243,19 +247,19 @@
'ldflags': [ '-fPIC' ]
}],
],
'msvs_settings': {
'VCCLCompilerTool': {
'msbuild_settings': {
'ClCompile': {
'conditions': [
['target_arch=="arm64"', {
'FloatingPointModel': 1 # /fp:strict
'FloatingPointModel': 'Strict' # /fp:strict
}]
],
'EnableFunctionLevelLinking': 'true',
'EnableIntrinsicFunctions': 'true',
'FavorSizeOrSpeed': 1, # /Ot, favor speed over size
'InlineFunctionExpansion': 2, # /Ob2, inline anything eligible
'FunctionLevelLinking': 'true',
'IntrinsicFunctions': 'true',
'FavorSizeOrSpeed': 'Speed', # /Ot, favor speed over size
'InlineFunctionExpansion': 'AnySuitable', # /Ob2, inline anything eligible
'OmitFramePointers': 'true',
'Optimization': 3, # /Ox, full optimization
'Optimization': 'Full', # /Ox, full optimization
'RuntimeLibrary': '<(MSVC_runtimeType)',
'RuntimeTypeInfo': 'false',
}
Expand All @@ -282,8 +286,8 @@
'cflags!': ['-Werror'],
}],
],
'msvs_settings': {
'VCCLCompilerTool': {
'msbuild_settings': {
'ClCompile': {
'AdditionalOptions': [
'/Zc:__cplusplus',
# The following option enables c++20 on Windows. This is needed for V8 v12.4+
Expand All @@ -292,29 +296,29 @@
'/Zm2000',
],
'BufferSecurityCheck': 'true',
'DebugInformationFormat': 1, # /Z7 embed info in .obj files
'ExceptionHandling': 0, # /EHsc
'DebugInformationFormat': 'OldStyle', # /Z7 embed info in .obj files
'ExceptionHandling': 'Sync', # /EHsc
'MultiProcessorCompilation': 'true',
'StringPooling': 'true', # pool string literals
'SuppressStartupBanner': 'true',
'WarnAsError': 'false',
'WarningLevel': 3, # /W3
'TreatWarningAsError': 'false',
'WarningLevel': 'Level3', # /W3
},
'VCLinkerTool': {
'Link': {
'target_conditions': [
['_type=="executable"', {
'SubSystem': 1, # /SUBSYSTEM:CONSOLE
'SubSystem': 'Console', # /SUBSYSTEM:CONSOLE
}],
],
'conditions': [
['target_arch=="ia32"', {
'TargetMachine' : 1, # /MACHINE:X86
'TargetMachine' : 'MachineX86', # /MACHINE:X86
}],
['target_arch=="x64"', {
'TargetMachine' : 17, # /MACHINE:X64
'TargetMachine' : 'MachineX64', # /MACHINE:X64
}],
['target_arch=="arm64"', {
'TargetMachine' : 0, # NotSet. MACHINE:ARM64 is inferred from the input files.
'TargetMachine' : 'NotSet', # MACHINE:ARM64 is inferred from the input files.
}],
],
'GenerateDebugInformation': 'true',
Expand Down

0 comments on commit 496671f

Please sign in to comment.