summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRoy Berube <royberube1965@gmail.com>2017-11-16 08:37:02 -0700
committerRĂ©mi Verschelde <rverschelde@gmail.com>2017-11-16 16:37:02 +0100
commitb361f371f1c9ccfcfb064fee8dfbaacdd6d91cf6 (patch)
treedd576f5532a7219e74f166c109f0c0afcc12ebc5
parent5fa7cf35b2069480ca4c84fac3c0e4c5b903e75c (diff)
Cleanup of Visual Studio project generation (#12929)
Visual studio project file creation had some problems. Files with c extension were listed with cpp extension. Some include files that did not exist were added to the project. This change ensures a file exists before adding it to the project.
-rw-r--r--SConstruct9
1 files changed, 6 insertions, 3 deletions
diff --git a/SConstruct b/SConstruct
index 28bc85da33..10982211ac 100644
--- a/SConstruct
+++ b/SConstruct
@@ -270,9 +270,12 @@ if selected_platform in platform_list:
if len(pieces) > 0:
basename = pieces[0]
basename = basename.replace('\\\\', '/')
- env.vs_srcs = env.vs_srcs + [basename + ".cpp"]
- env.vs_incs = env.vs_incs + [basename + ".h"]
- # print basename
+ if os.path.isfile(basename + ".h"):
+ env.vs_incs = env.vs_incs + [basename + ".h"]
+ if os.path.isfile(basename + ".c"):
+ env.vs_srcs = env.vs_srcs + [basename + ".c"]
+ elif os.path.isfile(basename + ".cpp"):
+ env.vs_srcs = env.vs_srcs + [basename + ".cpp"]
env.AddToVSProject = AddToVSProject
env.extra_suffix = ""