Merge "clean up msvs project generation"
This commit is contained in:
commit
27c04aaa67
@ -32,7 +32,7 @@ Options:
|
|||||||
--name=project_name Name of the project (required)
|
--name=project_name Name of the project (required)
|
||||||
--proj-guid=GUID GUID to use for the project
|
--proj-guid=GUID GUID to use for the project
|
||||||
--module-def=filename File containing export definitions (for DLLs)
|
--module-def=filename File containing export definitions (for DLLs)
|
||||||
--ver=version Version (7,8) of visual studio to generate for
|
--ver=version Version (7,8,9) of visual studio to generate for
|
||||||
-Ipath/to/include Additional include directories
|
-Ipath/to/include Additional include directories
|
||||||
-DFLAG[=value] Preprocessor macros to define
|
-DFLAG[=value] Preprocessor macros to define
|
||||||
-Lpath/to/lib Additional library search paths
|
-Lpath/to/lib Additional library search paths
|
||||||
@ -132,7 +132,7 @@ generate_filter() {
|
|||||||
open_tag Filter \
|
open_tag Filter \
|
||||||
Name=$name \
|
Name=$name \
|
||||||
Filter=$pats \
|
Filter=$pats \
|
||||||
UniqueIdentifier=`generate_uuid`
|
UniqueIdentifier=`generate_uuid` \
|
||||||
|
|
||||||
file_list_sz=${#file_list[@]}
|
file_list_sz=${#file_list[@]}
|
||||||
for i in ${!file_list[@]}; do
|
for i in ${!file_list[@]}; do
|
||||||
@ -145,31 +145,21 @@ generate_filter() {
|
|||||||
if [ "$pat" == "asm" ] && $asm_use_custom_step; then
|
if [ "$pat" == "asm" ] && $asm_use_custom_step; then
|
||||||
for plat in "${platforms[@]}"; do
|
for plat in "${platforms[@]}"; do
|
||||||
for cfg in Debug Release; do
|
for cfg in Debug Release; do
|
||||||
open_tag FileConfiguration \
|
open_tag FileConfiguration \
|
||||||
Name="${cfg}|${plat}"
|
Name="${cfg}|${plat}" \
|
||||||
|
|
||||||
tag Tool \
|
tag Tool \
|
||||||
Name="VCCustomBuildTool" \
|
Name="VCCustomBuildTool" \
|
||||||
Description="Assembling \$(InputFileName)" \
|
Description="Assembling \$(InputFileName)" \
|
||||||
CommandLine="$(eval echo \$asm_${cfg}_cmdline)"\
|
CommandLine="$(eval echo \$asm_${cfg}_cmdline)" \
|
||||||
Outputs="\$(InputName).obj"
|
Outputs="\$(InputName).obj" \
|
||||||
|
|
||||||
close_tag FileConfiguration
|
close_tag FileConfiguration
|
||||||
done
|
done
|
||||||
done
|
done
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ "${f##*.}" == "cpp" ]; then
|
close_tag File
|
||||||
for plat in "${platforms[@]}"; do
|
|
||||||
for cfg in Debug Release; do
|
|
||||||
open_tag FileConfiguration \
|
|
||||||
Name="${cfg}|${plat}"
|
|
||||||
tag Tool \
|
|
||||||
Name="VCCLCompilerTool" \
|
|
||||||
CompileAs="2"
|
|
||||||
close_tag FileConfiguration
|
|
||||||
done
|
|
||||||
done
|
|
||||||
fi
|
|
||||||
close_tag File
|
|
||||||
|
|
||||||
break
|
break
|
||||||
fi
|
fi
|
||||||
@ -185,57 +175,61 @@ unset target
|
|||||||
for opt in "$@"; do
|
for opt in "$@"; do
|
||||||
optval="${opt#*=}"
|
optval="${opt#*=}"
|
||||||
case "$opt" in
|
case "$opt" in
|
||||||
--help|-h) show_help
|
--help|-h) show_help
|
||||||
;;
|
;;
|
||||||
--target=*) target="${optval}"
|
--target=*) target="${optval}"
|
||||||
;;
|
;;
|
||||||
--out=*) outfile="$optval"
|
--out=*) outfile="$optval"
|
||||||
;;
|
;;
|
||||||
--name=*) name="${optval}"
|
--name=*) name="${optval}"
|
||||||
;;
|
;;
|
||||||
--proj-guid=*) guid="${optval}"
|
--proj-guid=*) guid="${optval}"
|
||||||
;;
|
;;
|
||||||
--module-def=*)
|
--module-def=*) link_opts="${link_opts} ModuleDefinitionFile=${optval}"
|
||||||
link_opts="${link_opts} ModuleDefinitionFile=${optval}"
|
;;
|
||||||
;;
|
--exe) proj_kind="exe"
|
||||||
--exe) proj_kind="exe"
|
;;
|
||||||
;;
|
--lib) proj_kind="lib"
|
||||||
--lib) proj_kind="lib"
|
;;
|
||||||
;;
|
--static-crt) use_static_runtime=true
|
||||||
--static-crt) use_static_runtime=true
|
;;
|
||||||
;;
|
--ver=*)
|
||||||
--ver=*) vs_ver="$optval"
|
vs_ver="$optval"
|
||||||
case $optval in
|
case "$optval" in
|
||||||
[789])
|
[789])
|
||||||
;;
|
;;
|
||||||
*) die Unrecognized Visual Studio Version in $opt
|
*) die Unrecognized Visual Studio Version in $opt
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
;;
|
;;
|
||||||
-I*) opt="${opt%/}"
|
-I*)
|
||||||
incs="${incs}${incs:+;}"${opt##-I}""
|
opt="${opt%/}"
|
||||||
yasmincs="${yasmincs} ${opt}"
|
incs="${incs}${incs:+;}"${opt##-I}""
|
||||||
;;
|
yasmincs="${yasmincs} ${opt}"
|
||||||
-D*) defines="${defines}${defines:+;}${opt##-D}"
|
;;
|
||||||
;;
|
-D*) defines="${defines}${defines:+;}${opt##-D}"
|
||||||
-L*) # fudge . to $(OutDir)
|
;;
|
||||||
if [ "${opt##-L}" == "." ]; then
|
-L*) # fudge . to $(OutDir)
|
||||||
libdirs="${libdirs}${libdirs:+;}"\$(OutDir)""
|
if [ "${opt##-L}" == "." ]; then
|
||||||
else
|
libdirs="${libdirs}${libdirs:+;}"\$(OutDir)""
|
||||||
# Also try directories for this platform/configuration
|
else
|
||||||
libdirs="${libdirs}${libdirs:+;}"${opt##-L}""
|
# Also try directories for this platform/configuration
|
||||||
libdirs="${libdirs}${libdirs:+;}"${opt##-L}/\$(PlatformName)/\$(ConfigurationName)""
|
libdirs="${libdirs}${libdirs:+;}"${opt##-L}""
|
||||||
libdirs="${libdirs}${libdirs:+;}"${opt##-L}/\$(PlatformName)""
|
libdirs="${libdirs}${libdirs:+;}"${opt##-L}/\$(PlatformName)/\$(ConfigurationName)""
|
||||||
fi
|
libdirs="${libdirs}${libdirs:+;}"${opt##-L}/\$(PlatformName)""
|
||||||
;;
|
fi
|
||||||
-l*) libs="${libs}${libs:+ }${opt##-l}.lib"
|
;;
|
||||||
;;
|
-l*) libs="${libs}${libs:+ }${opt##-l}.lib"
|
||||||
-*) die_unknown $opt
|
;;
|
||||||
;;
|
-*) die_unknown $opt
|
||||||
*) file_list[${#file_list[@]}]="$opt"
|
;;
|
||||||
case "$opt" in
|
*)
|
||||||
*.asm) uses_asm=true;;
|
file_list[${#file_list[@]}]="$opt"
|
||||||
esac
|
case "$opt" in
|
||||||
|
*.asm) uses_asm=true
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
;;
|
||||||
esac
|
esac
|
||||||
done
|
done
|
||||||
outfile=${outfile:-/dev/stdout}
|
outfile=${outfile:-/dev/stdout}
|
||||||
@ -278,8 +272,7 @@ done
|
|||||||
|
|
||||||
# List Keyword for this target
|
# List Keyword for this target
|
||||||
case "$target" in
|
case "$target" in
|
||||||
x86*)
|
x86*) keyword="ManagedCProj"
|
||||||
keyword="ManagedCProj"
|
|
||||||
;;
|
;;
|
||||||
*) die "Unsupported target $target!"
|
*) die "Unsupported target $target!"
|
||||||
esac
|
esac
|
||||||
@ -296,155 +289,185 @@ case "$target" in
|
|||||||
asm_Release_cmdline="yasm -Xvc -f \$(PlatformName) ${yasmincs} "\$(InputPath)""
|
asm_Release_cmdline="yasm -Xvc -f \$(PlatformName) ${yasmincs} "\$(InputPath)""
|
||||||
;;
|
;;
|
||||||
*) die "Unsupported target $target!"
|
*) die "Unsupported target $target!"
|
||||||
|
;;
|
||||||
esac
|
esac
|
||||||
|
|
||||||
generate_vcproj() {
|
generate_vcproj() {
|
||||||
case "$proj_kind" in
|
case "$proj_kind" in
|
||||||
exe) vs_ConfigurationType=1
|
exe) vs_ConfigurationType=1
|
||||||
;;
|
;;
|
||||||
*) vs_ConfigurationType=4
|
*) vs_ConfigurationType=4
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
|
|
||||||
echo "<?xml version=\"1.0\" encoding=\"Windows-1252\"?>"
|
echo "<?xml version=\"1.0\" encoding=\"Windows-1252\"?>"
|
||||||
open_tag VisualStudioProject \
|
open_tag VisualStudioProject \
|
||||||
ProjectType="Visual C++" \
|
ProjectType="Visual C++" \
|
||||||
Version="${vs_ver_id}" \
|
Version="${vs_ver_id}" \
|
||||||
Name="${name}" \
|
Name="${name}" \
|
||||||
ProjectGUID="{${guid}}" \
|
ProjectGUID="{${guid}}" \
|
||||||
RootNamespace="${name}" \
|
RootNamespace="${name}" \
|
||||||
Keyword="${keyword}"
|
Keyword="${keyword}" \
|
||||||
|
|
||||||
open_tag Platforms
|
open_tag Platforms
|
||||||
for plat in "${platforms[@]}"; do
|
for plat in "${platforms[@]}"; do
|
||||||
tag Platform Name="$plat"
|
tag Platform Name="$plat"
|
||||||
done
|
done
|
||||||
close_tag Platforms
|
close_tag Platforms
|
||||||
|
|
||||||
open_tag ToolFiles
|
open_tag ToolFiles
|
||||||
case "$target" in
|
case "$target" in
|
||||||
x86*) $uses_asm && tag ToolFile RelativePath="$self_dirname/../x86-msvs/yasm.rules"
|
x86*) $uses_asm && tag ToolFile RelativePath="$self_dirname/../x86-msvs/yasm.rules"
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
close_tag ToolFiles
|
close_tag ToolFiles
|
||||||
|
|
||||||
open_tag Configurations
|
open_tag Configurations
|
||||||
for plat in "${platforms[@]}"; do
|
for plat in "${platforms[@]}"; do
|
||||||
plat_no_ws=`echo $plat | sed 's/[^A-Za-z0-9_]/_/g'`
|
plat_no_ws=`echo $plat | sed 's/[^A-Za-z0-9_]/_/g'`
|
||||||
open_tag Configuration \
|
open_tag Configuration \
|
||||||
Name="Debug|$plat" \
|
Name="Debug|$plat" \
|
||||||
OutputDirectory="\$(SolutionDir)$plat_no_ws/\$(ConfigurationName)" \
|
OutputDirectory="\$(SolutionDir)$plat_no_ws/\$(ConfigurationName)" \
|
||||||
IntermediateDirectory="$plat_no_ws/\$(ConfigurationName)/${name}" \
|
IntermediateDirectory="$plat_no_ws/\$(ConfigurationName)/${name}" \
|
||||||
ConfigurationType="$vs_ConfigurationType" \
|
ConfigurationType="$vs_ConfigurationType" \
|
||||||
CharacterSet="1"
|
CharacterSet="1" \
|
||||||
|
|
||||||
case "$target" in
|
case "$target" in
|
||||||
x86*) tag Tool \
|
x86*)
|
||||||
Name="VCCLCompilerTool" \
|
case "$name" in
|
||||||
Optimization="0" \
|
*)
|
||||||
AdditionalIncludeDirectories="$incs" \
|
tag Tool \
|
||||||
PreprocessorDefinitions="WIN32;_DEBUG;_CRT_SECURE_NO_WARNINGS;_CRT_SECURE_NO_DEPRECATE;$defines" \
|
Name="VCCLCompilerTool" \
|
||||||
RuntimeLibrary="$debug_runtime" \
|
Optimization="0" \
|
||||||
UsePrecompiledHeader="0" \
|
AdditionalIncludeDirectories="$incs" \
|
||||||
WarningLevel="3" \
|
PreprocessorDefinitions="WIN32;_DEBUG;_CRT_SECURE_NO_WARNINGS;_CRT_SECURE_NO_DEPRECATE;$defines" \
|
||||||
DebugInformationFormat="1" \
|
RuntimeLibrary="$debug_runtime" \
|
||||||
Detect64BitPortabilityProblems="true" \
|
UsePrecompiledHeader="0" \
|
||||||
|
WarningLevel="3" \
|
||||||
|
DebugInformationFormat="1" \
|
||||||
|
Detect64BitPortabilityProblems="true" \
|
||||||
|
|
||||||
$uses_asm && tag Tool Name="YASM" IncludePaths="$incs" Debug="1"
|
$uses_asm && tag Tool Name="YASM" IncludePaths="$incs" Debug="1"
|
||||||
|
;;
|
||||||
|
esac
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
|
|
||||||
case "$proj_kind" in
|
case "$proj_kind" in
|
||||||
exe)
|
exe)
|
||||||
case "$target" in
|
case "$target" in
|
||||||
x86*) tag Tool \
|
x86*)
|
||||||
Name="VCLinkerTool" \
|
case "$name" in
|
||||||
AdditionalDependencies="$debug_libs \$(NoInherit)" \
|
*)
|
||||||
AdditionalLibraryDirectories="$libdirs" \
|
tag Tool \
|
||||||
GenerateDebugInformation="true" \
|
Name="VCLinkerTool" \
|
||||||
ProgramDatabaseFile="\$(OutDir)/${name}.pdb" \
|
AdditionalDependencies="$debug_libs \$(NoInherit)" \
|
||||||
|
AdditionalLibraryDirectories="$libdirs" \
|
||||||
|
GenerateDebugInformation="true" \
|
||||||
|
ProgramDatabaseFile="\$(OutDir)/${name}.pdb" \
|
||||||
|
;;
|
||||||
|
esac
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
;;
|
;;
|
||||||
lib)
|
lib)
|
||||||
case "$target" in
|
case "$target" in
|
||||||
*) tag Tool \
|
x86*)
|
||||||
Name="VCLibrarianTool" \
|
tag Tool \
|
||||||
OutputFile="\$(OutDir)/${name}${lib_sfx}d.lib" \
|
Name="VCLibrarianTool" \
|
||||||
;;
|
OutputFile="\$(OutDir)/${name}${lib_sfx}d.lib" \
|
||||||
|
|
||||||
|
;;
|
||||||
esac
|
esac
|
||||||
;;
|
;;
|
||||||
dll) tag Tool \
|
dll)
|
||||||
Name="VCLinkerTool" \
|
tag Tool \
|
||||||
AdditionalDependencies="\$(NoInherit)" \
|
Name="VCLinkerTool" \
|
||||||
LinkIncremental="2" \
|
AdditionalDependencies="\$(NoInherit)" \
|
||||||
GenerateDebugInformation="true" \
|
LinkIncremental="2" \
|
||||||
AssemblyDebug="1" \
|
GenerateDebugInformation="true" \
|
||||||
TargetMachine="1" \
|
AssemblyDebug="1" \
|
||||||
$link_opts
|
TargetMachine="1" \
|
||||||
|
$link_opts \
|
||||||
|
|
||||||
|
;;
|
||||||
esac
|
esac
|
||||||
|
|
||||||
close_tag Configuration
|
close_tag Configuration
|
||||||
|
|
||||||
open_tag Configuration \
|
open_tag Configuration \
|
||||||
Name="Release|$plat" \
|
Name="Release|$plat" \
|
||||||
OutputDirectory="\$(SolutionDir)$plat_no_ws/\$(ConfigurationName)" \
|
OutputDirectory="\$(SolutionDir)$plat_no_ws/\$(ConfigurationName)" \
|
||||||
IntermediateDirectory="$plat_no_ws/\$(ConfigurationName)/${name}" \
|
IntermediateDirectory="$plat_no_ws/\$(ConfigurationName)/${name}" \
|
||||||
ConfigurationType="$vs_ConfigurationType" \
|
ConfigurationType="$vs_ConfigurationType" \
|
||||||
CharacterSet="1" \
|
CharacterSet="1" \
|
||||||
WholeProgramOptimization="0"
|
WholeProgramOptimization="0" \
|
||||||
|
|
||||||
case "$target" in
|
case "$target" in
|
||||||
x86*) tag Tool \
|
x86*)
|
||||||
Name="VCCLCompilerTool" \
|
case "$name" in
|
||||||
AdditionalIncludeDirectories="$incs" \
|
*)
|
||||||
PreprocessorDefinitions="WIN32;NDEBUG;_CRT_SECURE_NO_WARNINGS;_CRT_SECURE_NO_DEPRECATE;$defines" \
|
tag Tool \
|
||||||
RuntimeLibrary="$release_runtime" \
|
Name="VCCLCompilerTool" \
|
||||||
UsePrecompiledHeader="0" \
|
AdditionalIncludeDirectories="$incs" \
|
||||||
WarningLevel="3" \
|
PreprocessorDefinitions="WIN32;NDEBUG;_CRT_SECURE_NO_WARNINGS;_CRT_SECURE_NO_DEPRECATE;$defines" \
|
||||||
DebugInformationFormat="0" \
|
RuntimeLibrary="$release_runtime" \
|
||||||
Detect64BitPortabilityProblems="true"
|
UsePrecompiledHeader="0" \
|
||||||
|
WarningLevel="3" \
|
||||||
|
DebugInformationFormat="0" \
|
||||||
|
Detect64BitPortabilityProblems="true" \
|
||||||
|
|
||||||
$uses_asm && tag Tool Name="YASM" IncludePaths="$incs"
|
$uses_asm && tag Tool Name="YASM" IncludePaths="$incs"
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
|
||||||
case "$proj_kind" in
|
case "$proj_kind" in
|
||||||
exe)
|
exe)
|
||||||
case "$target" in
|
case "$target" in
|
||||||
x86*) tag Tool \
|
x86*)
|
||||||
Name="VCLinkerTool" \
|
case "$name" in
|
||||||
AdditionalDependencies="$libs \$(NoInherit)" \
|
*)
|
||||||
AdditionalLibraryDirectories="$libdirs" \
|
tag Tool \
|
||||||
|
Name="VCLinkerTool" \
|
||||||
|
AdditionalDependencies="$libs \$(NoInherit)" \
|
||||||
|
AdditionalLibraryDirectories="$libdirs" \
|
||||||
|
|
||||||
|
;;
|
||||||
|
esac
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
;;
|
;;
|
||||||
lib)
|
lib)
|
||||||
case "$target" in
|
case "$target" in
|
||||||
*) tag Tool \
|
x86*)
|
||||||
Name="VCLibrarianTool" \
|
tag Tool \
|
||||||
OutputFile="\$(OutDir)/${name}${lib_sfx}.lib" \
|
Name="VCLibrarianTool" \
|
||||||
;;
|
OutputFile="\$(OutDir)/${name}${lib_sfx}.lib" \
|
||||||
|
|
||||||
|
;;
|
||||||
esac
|
esac
|
||||||
;;
|
;;
|
||||||
dll) # note differences to debug version: LinkIncremental, AssemblyDebug
|
dll) # note differences to debug version: LinkIncremental, AssemblyDebug
|
||||||
tag Tool \
|
tag Tool \
|
||||||
Name="VCLinkerTool" \
|
Name="VCLinkerTool" \
|
||||||
AdditionalDependencies="\$(NoInherit)" \
|
AdditionalDependencies="\$(NoInherit)" \
|
||||||
LinkIncremental="1" \
|
LinkIncremental="1" \
|
||||||
GenerateDebugInformation="true" \
|
GenerateDebugInformation="true" \
|
||||||
TargetMachine="1" \
|
TargetMachine="1" \
|
||||||
$link_opts
|
$link_opts \
|
||||||
|
|
||||||
|
;;
|
||||||
esac
|
esac
|
||||||
|
|
||||||
close_tag Configuration
|
close_tag Configuration
|
||||||
done
|
done
|
||||||
close_tag Configurations
|
close_tag Configurations
|
||||||
|
|
||||||
open_tag Files
|
open_tag Files
|
||||||
generate_filter srcs "Source Files" "cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx"
|
generate_filter srcs "Source Files" "c;def;odl;idl;hpj;bat;asm;asmx"
|
||||||
generate_filter hdrs "Header Files" "h;hpp;hxx;hm;inl;inc;xsd"
|
generate_filter hdrs "Header Files" "h;hm;inl;inc;xsd"
|
||||||
generate_filter resrcs "Resource Files" "rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav"
|
generate_filter resrcs "Resource Files" "rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav"
|
||||||
generate_filter resrcs "Build Files" "mk"
|
generate_filter resrcs "Build Files" "mk"
|
||||||
close_tag Files
|
close_tag Files
|
||||||
|
Loading…
x
Reference in New Issue
Block a user