From e79cb700c1832493afe21e7654856ee99540f8f7 Mon Sep 17 00:00:00 2001 From: Christien Rioux Date: Sun, 13 Dec 2015 01:39:35 -0800 Subject: [PATCH] formalize windows build add static linked version of everything --- CMakeLists.txt | 23 ++- build_vs2013/tlc/tlc.vcxproj | 140 ++++++++++++++++++ build_vs2013/turbo_linecount.sln | 28 ++++ .../turbo_linecount/turbo_linecount.vcxproj | 138 ++++++++++++++++- .../turbo_linecount_static.vcxproj | 122 +++++++++++++++ src/main.cpp | 2 +- src/turbo_linecount.h | 4 +- 7 files changed, 450 insertions(+), 7 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index f780cc2..09ef5cf 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -2,9 +2,27 @@ CMAKE_MINIMUM_REQUIRED(VERSION 3.0.0) PROJECT (turbo_linecount) IF(MSVC) + + OPTION (USE_STATIC_RUNTIME "Use Static Runtime" OFF) + SET(CMAKE_CONFIGURATION_TYPES "Debug;Release" CACHE STRING "limited configs" FORCE) - SET(CMAKE_CXX_FLAGS_RELEASE "/Ox /Ob2") - SET(CMAKE_C_FLAGS_RELEASE "/Ox /Ob2") + + SET(CMAKE_CXX_FLAGS_DEBUG "/Od /MDd") + SET(CMAKE_C_FLAGS_DEBUG "/Od /MDd") + SET(CMAKE_CXX_FLAGS_RELEASE "/Ox /Ob2 /MD") + SET(CMAKE_C_FLAGS_RELEASE "/Ox /Ob2 /MD") + + # Force static runtime libraries + IF(USE_STATIC_RUNTIME) + MESSAGE("Using Static Runtime") + FOREACH(flag + CMAKE_C_FLAGS_RELEASE CMAKE_C_FLAGS_RELWITHDEBINFO + CMAKE_C_FLAGS_DEBUG CMAKE_C_FLAGS_DEBUG_INIT + CMAKE_CXX_FLAGS_RELEASE CMAKE_CXX_FLAGS_RELWITHDEBINFO + CMAKE_CXX_FLAGS_DEBUG CMAKE_CXX_FLAGS_DEBUG_INIT) + STRING(REPLACE "/MD" "/MT" "${flag}" "${${flag}}") + ENDFOREACH() + ENDIF() ELSE() FIND_PACKAGE (Threads REQUIRED) SET(CMAKE_CXX_FLAGS_RELEASE "-O3") @@ -16,6 +34,7 @@ ADD_LIBRARY (turbo_linecount SHARED src/turbo_linecount.cpp src/turbo_linecount. ADD_LIBRARY (turbo_linecount_static STATIC src/turbo_linecount.cpp src/turbo_linecount.h) ADD_EXECUTABLE (tlc src/main.cpp) + IF(THREADS_HAVE_PTHREAD_ARG) SET_PROPERTY(TARGET tlc PROPERTY COMPILE_OPTIONS "-pthread") SET_PROPERTY(TARGET tlc PROPERTY INTERFACE_COMPILE_OPTIONS "-pthread") diff --git a/build_vs2013/tlc/tlc.vcxproj b/build_vs2013/tlc/tlc.vcxproj index 8ea98c8..4a44c46 100644 --- a/build_vs2013/tlc/tlc.vcxproj +++ b/build_vs2013/tlc/tlc.vcxproj @@ -1,6 +1,14 @@  + + Debug DLL + Win32 + + + Debug DLL + x64 + Debug Win32 @@ -9,6 +17,14 @@ Debug x64 + + Release DLL + Win32 + + + Release DLL + x64 + Release Win32 @@ -39,12 +55,24 @@ v120 Unicode + + Application + true + v120 + Unicode + Application true v120 Unicode + + Application + true + v120 + Unicode + Application false @@ -52,6 +80,13 @@ true Unicode + + Application + false + v120 + true + Unicode + Application false @@ -59,34 +94,65 @@ true Unicode + + Application + false + v120 + true + Unicode + + + + + + + + + + + + + true + + true + true + + true + false + + false + false + + false + @@ -94,6 +160,21 @@ Level3 Disabled WIN32;_DEBUG;_CONSOLE;_LIB;%(PreprocessorDefinitions) + MultiThreadedDebug + + + Console + true + + + + + + + Level3 + Disabled + WIN32;_DEBUG;_CONSOLE;_LIB;%(PreprocessorDefinitions) + MultiThreadedDebugDLL Console @@ -107,6 +188,21 @@ Level3 Disabled WIN32;_DEBUG;_CONSOLE;_LIB;%(PreprocessorDefinitions) + MultiThreadedDebug + + + Console + true + + + + + + + Level3 + Disabled + WIN32;_DEBUG;_CONSOLE;_LIB;%(PreprocessorDefinitions) + MultiThreadedDebugDLL Console @@ -125,6 +221,28 @@ Speed AnySuitable true + MultiThreaded + + + Console + true + true + true + + + + + Level3 + + + Full + true + true + WIN32;NDEBUG;_CONSOLE;_LIB;%(PreprocessorDefinitions) + Speed + AnySuitable + true + MultiThreadedDLL Console @@ -145,6 +263,28 @@ AnySuitable Speed true + MultiThreaded + + + Console + true + true + true + + + + + Level3 + + + Full + true + true + WIN32;NDEBUG;_CONSOLE;_LIB;%(PreprocessorDefinitions) + AnySuitable + Speed + true + MultiThreadedDLL Console diff --git a/build_vs2013/turbo_linecount.sln b/build_vs2013/turbo_linecount.sln index b03517f..57ecaf8 100644 --- a/build_vs2013/turbo_linecount.sln +++ b/build_vs2013/turbo_linecount.sln @@ -11,32 +11,60 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "turbo_linecount_static", "t EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug DLL|Win32 = Debug DLL|Win32 + Debug DLL|x64 = Debug DLL|x64 Debug|Win32 = Debug|Win32 Debug|x64 = Debug|x64 + Release DLL|Win32 = Release DLL|Win32 + Release DLL|x64 = Release DLL|x64 Release|Win32 = Release|Win32 Release|x64 = Release|x64 EndGlobalSection GlobalSection(ProjectConfigurationPlatforms) = postSolution + {E5D80D5A-FDE6-44FE-9E97-DF3D470DD5E9}.Debug DLL|Win32.ActiveCfg = Debug DLL|Win32 + {E5D80D5A-FDE6-44FE-9E97-DF3D470DD5E9}.Debug DLL|Win32.Build.0 = Debug DLL|Win32 + {E5D80D5A-FDE6-44FE-9E97-DF3D470DD5E9}.Debug DLL|x64.ActiveCfg = Debug DLL|x64 + {E5D80D5A-FDE6-44FE-9E97-DF3D470DD5E9}.Debug DLL|x64.Build.0 = Debug DLL|x64 {E5D80D5A-FDE6-44FE-9E97-DF3D470DD5E9}.Debug|Win32.ActiveCfg = Debug|Win32 {E5D80D5A-FDE6-44FE-9E97-DF3D470DD5E9}.Debug|Win32.Build.0 = Debug|Win32 {E5D80D5A-FDE6-44FE-9E97-DF3D470DD5E9}.Debug|x64.ActiveCfg = Debug|x64 {E5D80D5A-FDE6-44FE-9E97-DF3D470DD5E9}.Debug|x64.Build.0 = Debug|x64 + {E5D80D5A-FDE6-44FE-9E97-DF3D470DD5E9}.Release DLL|Win32.ActiveCfg = Release DLL|Win32 + {E5D80D5A-FDE6-44FE-9E97-DF3D470DD5E9}.Release DLL|Win32.Build.0 = Release DLL|Win32 + {E5D80D5A-FDE6-44FE-9E97-DF3D470DD5E9}.Release DLL|x64.ActiveCfg = Release DLL|x64 + {E5D80D5A-FDE6-44FE-9E97-DF3D470DD5E9}.Release DLL|x64.Build.0 = Release DLL|x64 {E5D80D5A-FDE6-44FE-9E97-DF3D470DD5E9}.Release|Win32.ActiveCfg = Release|Win32 {E5D80D5A-FDE6-44FE-9E97-DF3D470DD5E9}.Release|Win32.Build.0 = Release|Win32 {E5D80D5A-FDE6-44FE-9E97-DF3D470DD5E9}.Release|x64.ActiveCfg = Release|x64 {E5D80D5A-FDE6-44FE-9E97-DF3D470DD5E9}.Release|x64.Build.0 = Release|x64 + {76AA0AD7-A400-467D-8D9D-12D787043C0A}.Debug DLL|Win32.ActiveCfg = Debug DLL|Win32 + {76AA0AD7-A400-467D-8D9D-12D787043C0A}.Debug DLL|Win32.Build.0 = Debug DLL|Win32 + {76AA0AD7-A400-467D-8D9D-12D787043C0A}.Debug DLL|x64.ActiveCfg = Debug DLL|x64 + {76AA0AD7-A400-467D-8D9D-12D787043C0A}.Debug DLL|x64.Build.0 = Debug DLL|x64 {76AA0AD7-A400-467D-8D9D-12D787043C0A}.Debug|Win32.ActiveCfg = Debug|Win32 {76AA0AD7-A400-467D-8D9D-12D787043C0A}.Debug|Win32.Build.0 = Debug|Win32 {76AA0AD7-A400-467D-8D9D-12D787043C0A}.Debug|x64.ActiveCfg = Debug|x64 {76AA0AD7-A400-467D-8D9D-12D787043C0A}.Debug|x64.Build.0 = Debug|x64 + {76AA0AD7-A400-467D-8D9D-12D787043C0A}.Release DLL|Win32.ActiveCfg = Release DLL|Win32 + {76AA0AD7-A400-467D-8D9D-12D787043C0A}.Release DLL|Win32.Build.0 = Release DLL|Win32 + {76AA0AD7-A400-467D-8D9D-12D787043C0A}.Release DLL|x64.ActiveCfg = Release DLL|x64 + {76AA0AD7-A400-467D-8D9D-12D787043C0A}.Release DLL|x64.Build.0 = Release DLL|x64 {76AA0AD7-A400-467D-8D9D-12D787043C0A}.Release|Win32.ActiveCfg = Release|Win32 {76AA0AD7-A400-467D-8D9D-12D787043C0A}.Release|Win32.Build.0 = Release|Win32 {76AA0AD7-A400-467D-8D9D-12D787043C0A}.Release|x64.ActiveCfg = Release|x64 {76AA0AD7-A400-467D-8D9D-12D787043C0A}.Release|x64.Build.0 = Release|x64 + {C6E64E54-0635-4A2B-B404-145EA82A761F}.Debug DLL|Win32.ActiveCfg = Debug DLL|Win32 + {C6E64E54-0635-4A2B-B404-145EA82A761F}.Debug DLL|Win32.Build.0 = Debug DLL|Win32 + {C6E64E54-0635-4A2B-B404-145EA82A761F}.Debug DLL|x64.ActiveCfg = Debug DLL|x64 + {C6E64E54-0635-4A2B-B404-145EA82A761F}.Debug DLL|x64.Build.0 = Debug DLL|x64 {C6E64E54-0635-4A2B-B404-145EA82A761F}.Debug|Win32.ActiveCfg = Debug|Win32 {C6E64E54-0635-4A2B-B404-145EA82A761F}.Debug|Win32.Build.0 = Debug|Win32 {C6E64E54-0635-4A2B-B404-145EA82A761F}.Debug|x64.ActiveCfg = Debug|x64 {C6E64E54-0635-4A2B-B404-145EA82A761F}.Debug|x64.Build.0 = Debug|x64 + {C6E64E54-0635-4A2B-B404-145EA82A761F}.Release DLL|Win32.ActiveCfg = Release DLL|Win32 + {C6E64E54-0635-4A2B-B404-145EA82A761F}.Release DLL|Win32.Build.0 = Release DLL|Win32 + {C6E64E54-0635-4A2B-B404-145EA82A761F}.Release DLL|x64.ActiveCfg = Release DLL|x64 + {C6E64E54-0635-4A2B-B404-145EA82A761F}.Release DLL|x64.Build.0 = Release DLL|x64 {C6E64E54-0635-4A2B-B404-145EA82A761F}.Release|Win32.ActiveCfg = Release|Win32 {C6E64E54-0635-4A2B-B404-145EA82A761F}.Release|Win32.Build.0 = Release|Win32 {C6E64E54-0635-4A2B-B404-145EA82A761F}.Release|x64.ActiveCfg = Release|x64 diff --git a/build_vs2013/turbo_linecount/turbo_linecount.vcxproj b/build_vs2013/turbo_linecount/turbo_linecount.vcxproj index cb5516d..5c863d4 100644 --- a/build_vs2013/turbo_linecount/turbo_linecount.vcxproj +++ b/build_vs2013/turbo_linecount/turbo_linecount.vcxproj @@ -1,6 +1,14 @@  + + Debug DLL + Win32 + + + Debug DLL + x64 + Debug Win32 @@ -9,6 +17,14 @@ Debug x64 + + Release DLL + Win32 + + + Release DLL + x64 + Release Win32 @@ -36,12 +52,24 @@ v120 Unicode + + DynamicLibrary + true + v120 + Unicode + DynamicLibrary true v120 Unicode + + DynamicLibrary + true + v120 + Unicode + DynamicLibrary false @@ -49,6 +77,13 @@ true Unicode + + DynamicLibrary + false + v120 + true + Unicode + DynamicLibrary false @@ -56,34 +91,65 @@ true Unicode + + DynamicLibrary + false + v120 + true + Unicode + + + + + + + + + + + + + true + + true + true + + true + false + + false + false + + false + @@ -91,6 +157,21 @@ Level3 Disabled WIN32;_DEBUG;_WINDOWS;_USRDLL;LINECOUNT_EXPORTS;%(PreprocessorDefinitions) + MultiThreadedDebug + + + Windows + true + + + + + + + Level3 + Disabled + WIN32;_DEBUG;_WINDOWS;_USRDLL;LINECOUNT_EXPORTS;%(PreprocessorDefinitions) + MultiThreadedDebugDLL Windows @@ -104,6 +185,21 @@ Level3 Disabled WIN32;_DEBUG;_WINDOWS;_USRDLL;LINECOUNT_EXPORTS;%(PreprocessorDefinitions) + MultiThreadedDebug + + + Windows + true + + + + + + + Level3 + Disabled + WIN32;_DEBUG;_WINDOWS;_USRDLL;LINECOUNT_EXPORTS;%(PreprocessorDefinitions) + MultiThreadedDebugDLL Windows @@ -119,10 +215,29 @@ true true WIN32;NDEBUG;_WINDOWS;_USRDLL;LINECOUNT_EXPORTS;%(PreprocessorDefinitions) + None + MultiThreaded + + + Windows + true + true + + + + + Level3 + + + MaxSpeed + true + true + WIN32;NDEBUG;_WINDOWS;_USRDLL;LINECOUNT_EXPORTS;%(PreprocessorDefinitions) + None + MultiThreadedDLL Windows - true true true @@ -136,10 +251,29 @@ true true WIN32;NDEBUG;_WINDOWS;_USRDLL;LINECOUNT_EXPORTS;%(PreprocessorDefinitions) + None + MultiThreaded + + + Windows + true + true + + + + + Level3 + + + MaxSpeed + true + true + WIN32;NDEBUG;_WINDOWS;_USRDLL;LINECOUNT_EXPORTS;%(PreprocessorDefinitions) + None + MultiThreadedDLL Windows - true true true diff --git a/build_vs2013/turbo_linecount_static/turbo_linecount_static.vcxproj b/build_vs2013/turbo_linecount_static/turbo_linecount_static.vcxproj index f467491..5b48783 100644 --- a/build_vs2013/turbo_linecount_static/turbo_linecount_static.vcxproj +++ b/build_vs2013/turbo_linecount_static/turbo_linecount_static.vcxproj @@ -1,6 +1,14 @@  + + Debug DLL + Win32 + + + Debug DLL + x64 + Debug Win32 @@ -9,6 +17,14 @@ Debug x64 + + Release DLL + Win32 + + + Release DLL + x64 + Release Win32 @@ -36,12 +52,24 @@ v120 Unicode + + StaticLibrary + true + v120 + Unicode + StaticLibrary true v120 Unicode + + StaticLibrary + true + v120 + Unicode + StaticLibrary false @@ -49,6 +77,13 @@ true Unicode + + StaticLibrary + false + v120 + true + Unicode + StaticLibrary false @@ -56,21 +91,40 @@ true Unicode + + StaticLibrary + false + v120 + true + Unicode + + + + + + + + + + + + + @@ -80,6 +134,21 @@ Level3 Disabled WIN32;_DEBUG;_LIB;%(PreprocessorDefinitions) + MultiThreadedDebug + + + Windows + true + + + + + + + Level3 + Disabled + WIN32;_DEBUG;_LIB;%(PreprocessorDefinitions) + MultiThreadedDebugDLL Windows @@ -93,6 +162,21 @@ Level3 Disabled WIN32;_DEBUG;_LIB;%(PreprocessorDefinitions) + MultiThreadedDebug + + + Windows + true + + + + + + + Level3 + Disabled + WIN32;_DEBUG;_LIB;%(PreprocessorDefinitions) + MultiThreadedDebugDLL Windows @@ -108,6 +192,25 @@ true true WIN32;NDEBUG;_LIB;%(PreprocessorDefinitions) + MultiThreaded + + + Windows + true + true + true + + + + + Level3 + + + MaxSpeed + true + true + WIN32;NDEBUG;_LIB;%(PreprocessorDefinitions) + MultiThreadedDLL Windows @@ -125,6 +228,25 @@ true true WIN32;NDEBUG;_LIB;%(PreprocessorDefinitions) + MultiThreaded + + + Windows + true + true + true + + + + + Level3 + + + MaxSpeed + true + true + WIN32;NDEBUG;_LIB;%(PreprocessorDefinitions) + MultiThreadedDLL Windows diff --git a/src/main.cpp b/src/main.cpp index 85e5c38..622b384 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -45,7 +45,7 @@ void help(const TCHAR *argv0) void version(void) { - _tprintf(_T("lc (linecount) %d.%2.2d\nCopyright (c) 2015 Christien Rioux\n"), LINECOUNT_VERSION_MAJOR, LINECOUNT_VERSION_MINOR); + _tprintf(_T("tlc (turbo-linecount) %d.%2.2d\nCopyright (c) 2015 Christien Rioux\n"), TURBOLINECOUNT_VERSION_MAJOR, TURBOLINECOUNT_VERSION_MINOR); } ////////////////////////////////////////////////////// diff --git a/src/turbo_linecount.h b/src/turbo_linecount.h index 45fc3ed..6f50f7f 100644 --- a/src/turbo_linecount.h +++ b/src/turbo_linecount.h @@ -9,8 +9,8 @@ #ifndef __INC_TURBO_LINECOUNT_H #define __INC_TURBO_LINECOUNT_H -#define LINECOUNT_VERSION_MAJOR 1 -#define LINECOUNT_VERSION_MINOR 0 +#define TURBOLINECOUNT_VERSION_MAJOR 1 +#define TURBOLINECOUNT_VERSION_MINOR 0 #ifdef __cplusplus