mirror of
https://git.dev.opencascade.org/repos/occt.git
synced 2025-04-10 18:51:21 +03:00
0033142: Configuration, genproj - ExpToCasExe building fails with generated VS projects
Generate executable single MSVC project per-Unit instead of per-source file.
This commit is contained in:
parent
d6baf70a93
commit
03b0ca59cb
@ -1233,28 +1233,11 @@ proc osutils:convertModules { theModules theSrcDir theSourceDirOther theProjects
|
|||||||
lappend aProjectsInModule($aModule) $aToolKit
|
lappend aProjectsInModule($aModule) $aToolKit
|
||||||
lappend aDependencies [LibToLink $aToolKit $theSrcDir $theSourceDirOther]
|
lappend aDependencies [LibToLink $aToolKit $theSrcDir $theSourceDirOther]
|
||||||
}
|
}
|
||||||
# executables, assume one project per cxx file...
|
# executables
|
||||||
foreach aUnit [OS:executable ${aModule}] {
|
foreach aUnit [OS:executable ${aModule}] {
|
||||||
set aUnitLoc $aUnit
|
lappend aProjects $aUnit
|
||||||
set src_files [_get_used_files $aUnit $theSrcDir false]
|
lappend aProjectsInModule($aModule) $aUnit
|
||||||
set aSrcFiles {}
|
lappend aDependencies [LibToLink $aUnit $theSrcDir $theSourceDirOther]
|
||||||
foreach s $src_files {
|
|
||||||
regexp {source ([^\s]+)} $s dummy name
|
|
||||||
lappend aSrcFiles $name
|
|
||||||
}
|
|
||||||
foreach aSrcFile $aSrcFiles {
|
|
||||||
set aFileExtension [file extension $aSrcFile]
|
|
||||||
if { $aFileExtension == ".cxx" } {
|
|
||||||
set aPrjName [file rootname $aSrcFile]
|
|
||||||
lappend aProjects $aPrjName
|
|
||||||
lappend aProjectsInModule($aModule) $aPrjName
|
|
||||||
if {[file isdirectory $path/$theSrcDir/$aUnitLoc]} {
|
|
||||||
lappend aDependencies [LibToLinkX $aUnitLoc [file rootname $aSrcFile] $theSrcDir $theSourceDirOther]
|
|
||||||
} else {
|
|
||||||
lappend aDependencies {}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -2110,10 +2093,9 @@ proc osutils:tk:execfiles { theFiles theOutDir theCommand thePrefix theExtension
|
|||||||
# Generate Visual Studio project file for executable
|
# Generate Visual Studio project file for executable
|
||||||
proc osutils:vcprojx { theVcVer isUWP theOutDir theToolKit theGuidsMap theSrcDir theSourceDirOther } {
|
proc osutils:vcprojx { theVcVer isUWP theOutDir theToolKit theGuidsMap theSrcDir theSourceDirOther } {
|
||||||
set aVcFiles {}
|
set aVcFiles {}
|
||||||
foreach f [osutils:tk:cxxfiles $theToolKit wnt $theSrcDir] {
|
|
||||||
set aProjTmpl [osutils:vcproj:readtemplate $theVcVer $isUWP 1]
|
set aProjTmpl [osutils:vcproj:readtemplate $theVcVer $isUWP 1]
|
||||||
|
|
||||||
set aProjName [file rootname [file tail $f]]
|
set aProjName $theToolKit
|
||||||
set l_compilable [osutils:compilable wnt]
|
set l_compilable [osutils:compilable wnt]
|
||||||
regsub -all -- {__XQTNAM__} $aProjTmpl $aProjName aProjTmpl
|
regsub -all -- {__XQTNAM__} $aProjTmpl $aProjName aProjTmpl
|
||||||
|
|
||||||
@ -2142,23 +2124,32 @@ proc osutils:vcprojx { theVcVer isUWP theOutDir theToolKit theGuidsMap theSrcDir
|
|||||||
set aVcFilesCxx(units) ""
|
set aVcFilesCxx(units) ""
|
||||||
set aVcFilesHxx(units) ""
|
set aVcFilesHxx(units) ""
|
||||||
|
|
||||||
|
if { "$theVcVer" != "vc7" && "$theVcVer" != "vc8" && "$theVcVer" != "vc9" } {
|
||||||
|
foreach f [osutils:tk:cxxfiles $theToolKit wnt $theSrcDir] {
|
||||||
if { ![info exists written([file tail $f])] } {
|
if { ![info exists written([file tail $f])] } {
|
||||||
set written([file tail $f]) 1
|
set written([file tail $f]) 1
|
||||||
|
|
||||||
if { "$theVcVer" != "vc7" && "$theVcVer" != "vc8" && "$theVcVer" != "vc9" } {
|
|
||||||
append aFilesSection [osutils:vcxproj:cxxfile $f "" 3]
|
append aFilesSection [osutils:vcxproj:cxxfile $f "" 3]
|
||||||
if { ! [info exists aVcFilesCxx($theToolKit)] } { lappend aVcFilesCxx(units) $theToolKit }
|
if { ! [info exists aVcFilesCxx($theToolKit)] } { lappend aVcFilesCxx(units) $theToolKit }
|
||||||
lappend aVcFilesCxx($theToolKit) $f
|
lappend aVcFilesCxx($theToolKit) $f
|
||||||
|
} else {
|
||||||
|
puts "Warning : in vcproj there are more than one occurrences for [file tail $f]"
|
||||||
|
}
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
append aFilesSection "\t\t\t<Filter\n"
|
append aFilesSection "\t\t\t<Filter\n"
|
||||||
append aFilesSection "\t\t\t\tName=\"$theToolKit\"\n"
|
append aFilesSection "\t\t\t\tName=\"$theToolKit\"\n"
|
||||||
append aFilesSection "\t\t\t\t>\n"
|
append aFilesSection "\t\t\t\t>\n"
|
||||||
|
foreach f [osutils:tk:cxxfiles $theToolKit wnt $theSrcDir] {
|
||||||
|
if { ![info exists written([file tail $f])] } {
|
||||||
|
set written([file tail $f]) 1
|
||||||
append aFilesSection [osutils:vcproj:file $theVcVer $f ""]
|
append aFilesSection [osutils:vcproj:file $theVcVer $f ""]
|
||||||
append aFilesSection "\t\t\t</Filter>"
|
|
||||||
}
|
|
||||||
} else {
|
} else {
|
||||||
puts "Warning : in vcproj there are more than one occurrences for [file tail $f]"
|
puts "Warning : in vcproj there are more than one occurrences for [file tail $f]"
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
append aFilesSection "\t\t\t</Filter>"
|
||||||
|
}
|
||||||
|
|
||||||
#puts "$aProjTmpl $aFilesSection"
|
#puts "$aProjTmpl $aFilesSection"
|
||||||
set anIncPaths "..\\..\\..\\inc"
|
set anIncPaths "..\\..\\..\\inc"
|
||||||
regsub -all -- {__TKINC__} $aProjTmpl $anIncPaths aProjTmpl
|
regsub -all -- {__TKINC__} $aProjTmpl $anIncPaths aProjTmpl
|
||||||
@ -2201,7 +2192,7 @@ proc osutils:vcprojx { theVcVer isUWP theOutDir theToolKit theGuidsMap theSrcDir
|
|||||||
|
|
||||||
lappend aVcFiles "$aCommonSettingsFile"
|
lappend aVcFiles "$aCommonSettingsFile"
|
||||||
}
|
}
|
||||||
}
|
|
||||||
return $aVcFiles
|
return $aVcFiles
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user