string(REPLACE ";" " " kconfigs "${kconfigs}")
string(REPLACE ";" " " kconfig_projbuilds "${kconfig_projbuilds}")
+ # Place the long environment arguments into an input file
+ # to work around command line length limits for execute_process
+ # on Windows & CMake < 3.11
+ configure_file(
+ "${idf_path}/tools/kconfig_new/confgen.env.in"
+ "${CMAKE_CURRENT_BINARY_DIR}/confgen.env")
+
set(confgen_basecommand
${python} ${idf_path}/tools/kconfig_new/confgen.py
--kconfig ${root_kconfig}
--config ${sdkconfig}
${defaults_arg}
- --env "COMPONENT_KCONFIGS=${kconfigs}"
- --env "COMPONENT_KCONFIGS_PROJBUILD=${kconfig_projbuilds}"
- --env "IDF_CMAKE=y"
- --env "IDF_TARGET=${idf_target}")
+ --env-file "${CMAKE_CURRENT_BINARY_DIR}/confgen.env")
idf_build_get_property(build_dir BUILD_DIR)
set(config_dir ${build_dir}/config)
--- /dev/null
+{
+ "COMPONENT_KCONFIGS": "${kconfigs}",
+ "COMPONENT_KCONFIGS_PROJBUILD": "${kconfig_projbuilds}",
+ "IDF_CMAKE": "y",
+ "IDF_TARGET": "${idf_target}"
+}
parser.add_argument('--env', action='append', default=[],
help='Environment to set when evaluating the config file', metavar='NAME=VAL')
+ parser.add_argument('--env-file', type=argparse.FileType('r'),
+ help='Optional file to load environment variables from. Contents '
+ 'should be a JSON object where each key/value pair is a variable.')
+
args = parser.parse_args()
for fmt, filename in args.output:
for name, value in args.env:
os.environ[name] = value
+ if args.env_file is not None:
+ env = json.load(args.env_file)
+ os.environ.update(env)
+
config = kconfiglib.Kconfig(args.kconfig)
config.disable_redun_warnings()
config.disable_override_warnings()