Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
CMake
CMake
Commits
b1f3e104
Commit
b1f3e104
authored
Sep 15, 2004
by
Bill Hoffman
Browse files
BUG: make sure env CC and CXX are not set for VS IDE builds
parent
49b554c1
Changes
3
Hide whitespace changes
Inline
Side-by-side
Source/cmGlobalGenerator.cxx
View file @
b1f3e104
...
...
@@ -198,21 +198,25 @@ void cmGlobalGenerator::EnableLanguage(std::vector<std::string>const& languages,
{
cmSystemTools
::
Error
(
"Could not find cmake module file:"
,
determineFile
.
c_str
());
}
// put ${CMake_(LANG)_COMPILER_ENV_VAR}=${CMAKE_(LANG)_COMPILER into the
// environment, in case user scripts want to run configure, or sub cmakes
std
::
string
compilerName
=
"CMAKE_"
;
compilerName
+=
lang
;
compilerName
+=
"_COMPILER"
;
std
::
string
compilerEnv
=
"CMAKE_"
;
compilerEnv
+=
lang
;
compilerEnv
+=
"_COMPILER_ENV_VAR"
;
std
::
string
envVar
=
mf
->
GetRequiredDefinition
(
compilerEnv
.
c_str
());
std
::
string
envVarValue
=
mf
->
GetRequiredDefinition
(
compilerName
.
c_str
());
std
::
string
env
=
envVar
;
env
+=
"="
;
env
+=
envVarValue
;
cmSystemTools
::
PutEnv
(
env
.
c_str
());
// Some generators like visual studio should not use the env variables
// So the global generator can specify that in this variable
if
(
!
mf
->
GetDefinition
(
"CMAKE_GENERATOR_NO_COMPILER_ENV"
))
{
// put ${CMake_(LANG)_COMPILER_ENV_VAR}=${CMAKE_(LANG)_COMPILER into the
// environment, in case user scripts want to run configure, or sub cmakes
std
::
string
compilerName
=
"CMAKE_"
;
compilerName
+=
lang
;
compilerName
+=
"_COMPILER"
;
std
::
string
compilerEnv
=
"CMAKE_"
;
compilerEnv
+=
lang
;
compilerEnv
+=
"_COMPILER_ENV_VAR"
;
std
::
string
envVar
=
mf
->
GetRequiredDefinition
(
compilerEnv
.
c_str
());
std
::
string
envVarValue
=
mf
->
GetRequiredDefinition
(
compilerName
.
c_str
());
std
::
string
env
=
envVar
;
env
+=
"="
;
env
+=
envVarValue
;
cmSystemTools
::
PutEnv
(
env
.
c_str
());
}
}
// **** Step 5, Load the configured language compiler file, if not loaded.
...
...
Source/cmGlobalVisualStudio6Generator.cxx
View file @
b1f3e104
...
...
@@ -30,6 +30,9 @@ void cmGlobalVisualStudio6Generator::EnableLanguage(std::vector<std::string>cons
mf
->
AddDefinition
(
"CMAKE_CFG_INTDIR"
,
"$(IntDir)"
);
mf
->
AddDefinition
(
"CMAKE_GENERATOR_CC"
,
"cl"
);
mf
->
AddDefinition
(
"CMAKE_GENERATOR_CXX"
,
"cl"
);
mf
->
AddDefinition
(
"CMAKE_GENERATOR_RC"
,
"rc"
);
mf
->
AddDefinition
(
"CMAKE_GENERATOR_NO_COMPILER_ENV"
,
"1"
);
mf
->
AddDefinition
(
"CMAKE_GENERATOR_Fortran"
,
"ifort"
);
this
->
GenerateConfigurations
(
mf
);
this
->
cmGlobalGenerator
::
EnableLanguage
(
lang
,
mf
);
}
...
...
Source/cmGlobalVisualStudio7Generator.cxx
View file @
b1f3e104
...
...
@@ -35,6 +35,7 @@ void cmGlobalVisualStudio7Generator::EnableLanguage(std::vector<std::string>cons
mf
->
AddDefinition
(
"CMAKE_GENERATOR_CC"
,
"cl"
);
mf
->
AddDefinition
(
"CMAKE_GENERATOR_CXX"
,
"cl"
);
mf
->
AddDefinition
(
"CMAKE_GENERATOR_RC"
,
"rc"
);
mf
->
AddDefinition
(
"CMAKE_GENERATOR_NO_COMPILER_ENV"
,
"1"
);
mf
->
AddDefinition
(
"CMAKE_GENERATOR_Fortran"
,
"ifort"
);
// Create list of configurations requested by user's cache, if any.
...
...
Brad King
@brad.king
mentioned in issue
#21378 (closed)
·
Oct 29, 2020
mentioned in issue
#21378 (closed)
mentioned in issue #21378
Toggle commit list
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment