Skip to content

Commit

Permalink
MMDevice/MMCore[J]: Remove unused macro defs
Browse files Browse the repository at this point in the history
Remove preprocessor definitions from MMDevice/MMCore/MMCoreJ_wrap
.vcxproj files

This is to maintain the cleanup done in #415 (specifically,
4536cc0) -- to prevent the vcxproj
build from going out of sync with the experimental Meson build.

- `_DEBUG` - the compiler defines this when using the debug runtime; redundant
- `_LIB` - added by VS by default for static libs; we don't use it
- `_USRDLL` - added by VS by default for DLLs; we don't use it
- `_WINDOWS` - added by VS by default; we don't use it
- `WIN32` - added by VS by default; we prefer `_WIN32`, defined by the compiler

Also delete the single use of `_DEBUG` in `CMMCore::getVersionInfo()`.
It is better not to produce a different version string in a debug build,
because applications may parse this string (for example, a pymmcore test
does that).

All the other macros removed here are not currently used in these
projects.
  • Loading branch information
marktsuchida committed Jan 24, 2024
1 parent ff6ba58 commit fd74a72
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 14 deletions.
3 changes: 0 additions & 3 deletions MMCore/MMCore.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -362,9 +362,6 @@ std::string CMMCore::getVersionInfo() const
std::ostringstream txt;
std::string debug;
txt << "MMCore version " << MMCore_versionMajor << "." << MMCore_versionMinor << "." << MMCore_versionPatch;
#ifdef _DEBUG
txt << " (debug)";
#endif
return txt.str();
}

Expand Down
4 changes: 2 additions & 2 deletions MMCore/MMCore.vcxproj
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@
</Midl>
<ClCompile>
<Optimization>Disabled</Optimization>
<PreprocessorDefinitions>MMDEVICE_CLIENT_BUILD;NOMINMAX;WIN32;_DEBUG;_LIB;_WINDOWS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PreprocessorDefinitions>MMDEVICE_CLIENT_BUILD;NOMINMAX;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
<RuntimeTypeInfo>true</RuntimeTypeInfo>
<PrecompiledHeader>
Expand All @@ -65,7 +65,7 @@
<TargetEnvironment>X64</TargetEnvironment>
</Midl>
<ClCompile>
<PreprocessorDefinitions>MMDEVICE_CLIENT_BUILD;NOMINMAX;WIN32;NDEBUG;_LIB;_WINDOWS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PreprocessorDefinitions>MMDEVICE_CLIENT_BUILD;NOMINMAX;NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<RuntimeTypeInfo>true</RuntimeTypeInfo>
<PrecompiledHeader>
</PrecompiledHeader>
Expand Down
5 changes: 2 additions & 3 deletions MMCoreJ_wrap/MMCoreJ_wrap.vcxproj
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,6 @@
<ClCompile>
<Optimization>Disabled</Optimization>
<AdditionalIncludeDirectories>$(JAVA_HOME)\include\win32;$(JAVA_HOME)\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions>WIN32;_DEBUG;_WINDOWS;_USRDLL;MMCOREJ_WRAP_EXPORTS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
<RuntimeTypeInfo>true</RuntimeTypeInfo>
<PrecompiledHeader>
Expand All @@ -73,7 +72,7 @@
</Midl>
<ClCompile>
<AdditionalIncludeDirectories>$(JAVA_HOME)\include\win32;$(JAVA_HOME)\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions>WIN32;NDEBUG;_WINDOWS;_USRDLL;MMCOREJ_WRAP_EXPORTS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<RuntimeTypeInfo>true</RuntimeTypeInfo>
<PrecompiledHeader>
</PrecompiledHeader>
Expand Down Expand Up @@ -147,4 +146,4 @@ copy %swig_out_dir%\*.java %java_src_dir%\ &gt; NUL</Command>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets">
</ImportGroup>
</Project>
</Project>
5 changes: 2 additions & 3 deletions MMDevice/MMDevice-SharedRuntime.vcxproj
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,6 @@
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<ClCompile>
<Optimization>Disabled</Optimization>
<PreprocessorDefinitions>WIN32;_DEBUG;_LIB;%(PreprocessorDefinitions)</PreprocessorDefinitions>
</ClCompile>
<Link>
<SubSystem>Windows</SubSystem>
Expand All @@ -77,7 +76,7 @@
<Optimization>MaxSpeed</Optimization>
<FunctionLevelLinking>true</FunctionLevelLinking>
<IntrinsicFunctions>true</IntrinsicFunctions>
<PreprocessorDefinitions>WIN32;NDEBUG;_LIB;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
</ClCompile>
<Link>
<SubSystem>Windows</SubSystem>
Expand All @@ -89,4 +88,4 @@
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets">
</ImportGroup>
</Project>
</Project>
5 changes: 2 additions & 3 deletions MMDevice/MMDevice-StaticRuntime.vcxproj
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,6 @@
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<ClCompile>
<Optimization>Disabled</Optimization>
<PreprocessorDefinitions>WIN32;_DEBUG;_LIB;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
</ClCompile>
<Link>
Expand All @@ -78,7 +77,7 @@
<Optimization>MaxSpeed</Optimization>
<FunctionLevelLinking>true</FunctionLevelLinking>
<IntrinsicFunctions>true</IntrinsicFunctions>
<PreprocessorDefinitions>WIN32;NDEBUG;_LIB;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<RuntimeLibrary>MultiThreaded</RuntimeLibrary>
</ClCompile>
<Link>
Expand All @@ -91,4 +90,4 @@
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets">
</ImportGroup>
</Project>
</Project>

0 comments on commit fd74a72

Please sign in to comment.