Menu

CodeGit Merge Request #8: Fixes to the Visual Studio 2010 build (open)

Merging...

Merged

Something went wrong. Please, merge manually

Checking if merge is possible...

Something went wrong. Please, merge manually

Jac Goudsmit wants to merge 9 commits from /u/jac_goudsmit/log4cpp/ to master, 2018-02-10

This merge fixes a number of minor problems with the Visual Studio 2010 build, including:
* Adding .gitignore files to prevent files from being accidentally added to source control
* Elimination of all compiler warnings
* Removal of unnecessary settings overrides that wouldn't change the way the compiler and linker worked
* Separation of the NTEventLogAppender.dll resource DLL into a separate project file, to eliminate a race condition during the build

Commit Date  
[c3a563] (VS2010-build-fixes) by Jac Goudsmit Jac Goudsmit

VS2010 build system: Create a separate project for NTEventLogAppender.dll

In the old situation, the NTEventLogAppender.dll resource DLL was created with custom commands, and its compilation was duplicated in no less than THREE projects.

On at least one of my machines, this resulted in a problem because two separate build threads wanted to create the DLL at the same time, and one thread would fail because the other thread was writing the DLL.

I created a new project file so that Debug and Release versions of this resource DLL are only created once, and the build system won't attempt to overwrite a build that it just created as part of the same solution build.

I changed the custom build command for the .mc file slightly: I changed the -h and -r parameter so they use $(IntDir). That directory is excluded in .gitignore so that the newly created files don't accidentally get added to source control.

I removed the commands to compile the resource file from the custom build, since it's just as easy to add the .rc file to the project. Visual Studio can figure out how to compile the resource into the DLL. The only thing that was left to do was to make sure the .rc file in the release directory is not compiled in the debug build and vice versa; I did this by adding both files (debug and release) but excluding each file from the other build.

I removed the .mc file from the projects that previously had it.

I added a dependency on the NTEventLogAppender project to each of the three projects that formerly had the .mc file. Adding a project reference doesn't work because if you do that, Visual Studio goes looking for a library which doesn't exist because there's no code in the DLL.

2017-08-16 07:07:57 Tree
[9b13e2] by Jac Goudsmit Jac Goudsmit

Fixed Visual Studio compiler warning in Appender.cpp

2017-08-16 06:44:23 Tree
[d76dc2] by Jac Goudsmit Jac Goudsmit

Several minor changes to eliminate compiler and linker warnings in VS2010 build

- Modified config-win32.h to disable warnings 4275 (was already conditionally disabled but not for VS2010) and 4996. Replaced French warning text comment with English.
- Excluded DummyThreads, OmniThreads, PThread and snprintf modules from the build, since they weren't in use anyway (enabling them will produce a linker warning that they don't have any public symbols so won't be used).
- Added a few typecasts to RollingFileAppender.cpp and TimeStamp.cpp to fix compiler warnings.

2017-08-15 06:57:03 Tree
[56d384] by Jac Goudsmit Jac Goudsmit

VS2010 build system fixes

- Removed all pathname overrides from project files. These were probably generated by letting Visual Studio automatically update the project files based on a project file for a previous version of Visual Studio. Removing the path overrides makes VS2010 store the intermediate files in $(IntDir) under the project and store the output files in $(OutDir) under the solution directory. Both $(IntDir) and $(OutDir) are set to the name of the configuration (i.e. "Debug" or "Release" or "Debug with Boost" or "Release with Boost") by default. By using those defaults, all files end up in positions where they don't clash, DLLs end up in the same folders as EXE's that use them. This also eliminates warnings MSB8012 (name mismatches) which are difficult to debug.
- Made the include path the same for all projects: ..\..\include;%(AdditionalIncludeDirectories)
- Made all the projects use the multithreaded DLL (debug or release) as runtime library
- Disabled precompiled header settings. By default, VS2010 doesn't use precompiled headers which is fine. Precompiled headers are a somewhat archaic feature from the times when computers were slower, but they can cause confusing warnings that are not worthy of the time wasted on them.
- Removed overrides for inline function expansion. The compiler and optimizer should be able to figure out which functions are the best ones to expand inline.
- Removed overrides for string pooling. By default, it's automatically enabled when optimizing for speed is enabled.
- Removed overrides for minimal rebuild. This shouldn't be necessary and was probably only enabled because the option was automatically added by the automatic update of the project files from a previous version of Visual Studio
- Removed overrides that generated browse information files. These are rarely used but they add significant time to the build.
- Removed overrides for the "compile as" option. The default is fine and overriding the option with "default" is just extra clutter in the project files.
- Changed all Debug projects to write debug information for Edit and Continue, and all Release projects to write debug information as Program Database files. Having debug information for the release version is useful when debugging programs in the field, or in cases where debug-versions of other programs are linked to release-versions of our DLL.
- Removed incremental linking option for release builds, but enabled incremental linking for debug builds. This is needed for Edit And Continue.
- Removed overrides for /opt linker options. These are used for program-wide optimizations but probably have little or no effect anyway.
- In some projects, individual C++ files had configuration overrides that had no effect. Those were removed. Except in very rare cases, all C++ files should use the configuration from the project. Overriding settings for individual modules leads to conclusion and make maintenance difficult.

2017-08-15 06:35:41 Tree
[74501c] by Jac Goudsmit Jac Goudsmit

VS2010 build system fixes:

Adding .gitignore files for files that get copied from elsewhere

2017-08-15 06:03:22 Tree
[3903a5] by Jac Goudsmit Jac Goudsmit

VS2010 build system: Modifying config manager so all projects get build in all configurations

2017-08-15 03:39:19 Tree
[fb1259] by Jac Goudsmit Jac Goudsmit

Adding more files/dirs to msvc10 .gitignore

2017-08-15 03:36:29 Tree
[73aca9] by Jac Goudsmit Jac Goudsmit

VS2010 build system fix: Add ProjectGUIDs

Added ProjectGUIDs to the test projects that didn't have one.

Visual Studio has a known bug where under some circumstances (e.g. when updating a project created in a previous version of Visual Studio) it doesn't store a project GUID in the project file. But it needs project GUIDs in the solution file to keep track of relations between projects, and if it doesn't find a GUID in the project file, it makes up a new one. So everytime you open the solution, it makes changes to it and wants you to check them into your source control system.

The solution is to manually add the project GUID to the project files which is what I did here.

2017-08-13 09:38:22 Tree
[b5ec09] by Jac Goudsmit Jac Goudsmit

VS2010 build system fixes: Add .gitignore

Added .gitignore to the MSVC10 directory containing files that don't need to be in source control.

2017-08-13 09:18:09 Tree

Discussion

  • Jac Goudsmit

    Jac Goudsmit - 2017-08-23

    Posting this comment to make sure I'm subscribed and will get emails.

     

    Last edit: Jac Goudsmit 2017-08-23
  • Anton-V-K

    Anton-V-K - 2018-02-09

    Good changes! Are they already merged?

     

    Last edit: Anton-V-K 2018-02-09
    • Jac Goudsmit

      Jac Goudsmit - 2018-02-09

      The changes haven't been merged; the project hasn't received any maintenance since July 2017. Alexander Perepelkin and I had a discussion about another merge request that I entered, but it got really quiet even though the project is being downloaded a few hundred times per week, so people are obviously interested in it.
      Maybe you should download my fork at https://sourceforge.net/u/userid-2012122/log4cpp/ ?
      (Use the "jacmaster" branch)

       

      Last edit: Jac Goudsmit 2018-02-09
  • Alexander Perepelkin

    Jac,

    have you been using your build with these changes for that half a year?
    (I somehow missed your input for the build and your later changes to the second MR)

    Alex.

     
    • Jac Goudsmit

      Jac Goudsmit - 2018-02-11

      Hi Alex,

      Yes, I've been using the current head revision of the "jacmaster" branch in my forked tree (534b8fd288edcd8ab5de90bf63dd19940d8e2d3f) at my work, except for the Boost builds because we don't use Boost.

      ===Jac

       

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.