Skip to content

Commit b7bd6e3

Browse files
Fix CMakeLists generation (#15777)
1 parent 152834e commit b7bd6e3

File tree

5 files changed

+47
-11
lines changed

5 files changed

+47
-11
lines changed

build/conf/java.conf

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -451,11 +451,6 @@ macro DEFAULT_JUNIT_JAVA_SRCS_LAYOUT() {
451451
FULL_JAVA_SRCS(RESOURCES SRCDIR resources **/* SKIP_CHECK_SRCDIR)
452452
}
453453

454-
macro _HASH_HELPER(Args...) {
455-
.CMD=${hash:Args}
456-
.SEM=${hash:Args}
457-
}
458-
459454
macro _GENTAR_HELPER(HASH_SUF="hash_suf", OUT_DIR[]) {
460455
.CMD=${cwd:BINDIR} $YMAKE_PYTHON ${input:"build/scripts/autotar_gendirs.py"} --pack ${OUT_DIR} --outs ${output;tared;suf=$HASH_SUF:OUT_DIR} ${hide;kv:"tared_kind nodir"}
461456
.SEM=${hide;suf=$HASH_SUF;tared;output:OUT_DIR}

build/conf/opensource.conf

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,9 @@ when ($OPENSOURCE == "yes" && $EXPORT_GRADLE == "yes") {
4141
EXPORT_SEM=yes
4242
EXPORTED_BUILD_SYSTEM_SOURCE_ROOT=${"$"}{PROJECT_SOURCE_DIR}
4343
EXPORTED_BUILD_SYSTEM_BUILD_ROOT=${"$"}{PROJECT_BINARY_DIR}
44+
}
45+
46+
when ($EXPORT_GRADLE == "yes") {
4447
EXPORT_LANG=JAVA
4548
}
4649

@@ -58,6 +61,9 @@ when ($OPENSOURCE == "yes" && $EXPORT_CMAKE == "yes") {
5861
EXPORT_SEM=yes
5962
EXPORTED_BUILD_SYSTEM_SOURCE_ROOT="${PROJECT_SOURCE_DIR}"
6063
EXPORTED_BUILD_SYSTEM_BUILD_ROOT="${PROJECT_BINARY_DIR}"
64+
}
65+
66+
when ($EXPORT_CMAKE == "yes") {
6167
EXPORT_LANG=CPP
6268
}
6369

build/export_generators/cmake/cmake/conan_provider.cmake

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -349,23 +349,23 @@ macro(append_compiler_executables_configuration)
349349
set(_conan_rc_compiler "")
350350
set(_conan_compilers_list "")
351351
if(CMAKE_C_COMPILER)
352-
set(_conan_c_compiler "\"c\":\"\\\"${CMAKE_C_COMPILER}\\\"\"")
352+
set(_conan_c_compiler "\"c\":\"${CMAKE_C_COMPILER}\"")
353353
set_conan_compiler_if_appleclang(C cc _conan_c_compiler)
354354
list(APPEND _conan_compilers_list ${_conan_c_compiler})
355355
else()
356356
message(WARNING "CMake-Conan: The C compiler is not defined. "
357357
"Please define CMAKE_C_COMPILER or enable the C language.")
358358
endif()
359359
if(CMAKE_CXX_COMPILER)
360-
set(_conan_cpp_compiler "\"cpp\":\"\\\"${CMAKE_CXX_COMPILER}\\\"\"")
360+
set(_conan_cpp_compiler "\"cpp\":\"${CMAKE_CXX_COMPILER}\"")
361361
set_conan_compiler_if_appleclang(CXX c++ _conan_cpp_compiler)
362362
list(APPEND _conan_compilers_list ${_conan_cpp_compiler})
363363
else()
364364
message(WARNING "CMake-Conan: The C++ compiler is not defined. "
365365
"Please define CMAKE_CXX_COMPILER or enable the C++ language.")
366366
endif()
367367
if(CMAKE_RC_COMPILER)
368-
set(_conan_rc_compiler "\"rc\":\"\\\"${CMAKE_RC_COMPILER}\\\"\"")
368+
set(_conan_rc_compiler "\"rc\":\"${CMAKE_RC_COMPILER}\"")
369369
list(APPEND _conan_compilers_list ${_conan_rc_compiler})
370370
# Not necessary to warn if RC not defined
371371
endif()

build/ymake.core.conf

Lines changed: 37 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -487,8 +487,13 @@ macro CHECK_DEPENDENT_DIRS(TYPE, ALL?"UNUSED":"", PEERDIRS?"PEERDIRS":"ALL", RES
487487
SET_APPEND(CHECK_DEPENDENT_DIRS_TYPES $TYPE)
488488
}
489489

490+
macro _HASH_HELPER(Args...) {
491+
.CMD=${hash:Args}
492+
.SEM=${hash:Args}
493+
}
494+
490495
macro _RESOURCE_SEM(INPUTS[], KEYS[], OPTS[]) {
491-
SET(RESOURCE_OUTPUT ${hash:INPUTS}.cpp)
496+
SET(RESOURCE_OUTPUT $_HASH_HELPER($INPUTS $KEYS $OPTS).cpp)
492497
.SEM=target_macroses-ITEM && target_macroses-macro resources && target_macroses-args ${output;global:RESOURCE_OUTPUT} INPUTS ${input:INPUTS} KEYS $KEYS OPTS $OPTS ${hide;tool:"tools/rescompiler/bin"}
493498
}
494499

@@ -2259,12 +2264,14 @@ macro DYNAMIC_DEPS(Path...) {
22592264
### for seamless testing and packaging
22602265
multimodule DYNAMIC_LIBRARY {
22612266
module DLL_BIN: DLL {
2267+
.SEM=_CPP_DYN_LIBRARY_SEM
22622268
.PROXY=yes
22632269
.IGNORED=PROVIDES
22642270
SET(MODULE_TAG DLL)
22652271
}
22662272
module DLL_LIB: _DLL_COMPATIBLE_LIBRARY {
22672273
.CMD=$TOUCH_UNIT_MF
2274+
.SEM=_SEM_IGNORED
22682275
.PEERDIRSELF=DLL_BIN
22692276
.IGNORED=SRCS PEERDIR RUN_PROGRAM PYTHON DYNAMIC_LIBRARY_FROM GENERATE_ENUM_SERIALIZATION GENERATE_ENUM_SERIALIZATION_WITH_HEADER USE_PYTHON2 USE_PYTHON3
22702277
.ALLOWED=DYNAMIC_DEPS
@@ -4510,7 +4517,7 @@ macro DECLARE_IN_DIRS(var_prefix, PATTERN, SRCDIR="", RECURSIVE?"**/":"", EXCLUD
45104517
### @usage: RUN_PROGRAM(tool_path args... [CWD dir] [ENV key=value...] [TOOL tools...] [IN[_NOPARSE] inputs...] [OUT[_NOAUTO] outputs...] [STDOUT[_NOAUTO] output] [OUTPUT_INCLUDES output_includes...] [INDUCED_DEPS $VARs...])
45114518
###
45124519
### Run a program from arcadia.
4513-
### These macros are similar: RUN_PROGRAM, RUN_LUA, PYTHON.
4520+
### These macros are similar: RUN_PYTHON3, RUN_LUA, PYTHON.
45144521
###
45154522
### Parameters:
45164523
### - tool_path - Path to the directory of the tool.
@@ -4584,6 +4591,34 @@ macro RUN_PYTHON3(ScriptPath, IN{input}[], IN_NOPARSE{input}[], OUT{output}[], O
45844591
.SEM=custom_runs-ITEM && custom_runs-depends ${input:IN} ${context=TEXT;input:IN_NOPARSE} ${input:ScriptPath} ${tool:TOOL} ${pre=&& custom_runs-env :ENV} && custom_runs-command python3 ${input:ScriptPath} $Args ${pre=> :STDOUT} ${pre=> :STDOUT_NOAUTO} && custom_runs-outputs ${output:OUT} ${noauto;output:OUT_NOAUTO} ${output:STDOUT} ${noauto;output:STDOUT_NOAUTO} ${pre=&& custom_runs-cwd :CWD} && custom_runs-cmake_packages-ITEM && custom_runs-cmake_packages-name Python3
45854592
}
45864593

4594+
### @usage: RUN_PY3_PROGRAM(tool_path args... [CWD dir] [ENV key=value...] [TOOL tools...] [IN[_NOPARSE] inputs...] [OUT[_NOAUTO] outputs...] [STDOUT[_NOAUTO] output] [OUTPUT_INCLUDES output_includes...] [INDUCED_DEPS $VARs...])
4595+
###
4596+
### When build by ya make - Run a program from arcadia.
4597+
### When exporting to other build systems (Cmake, Gradle, ...) - Run a python script __main__.py in tool project. Of course,
4598+
### for exporting __main__.py must exists in tool project and must support execute by system Python3
4599+
### These macros are similar: RUN_PROGRAM, RUN_PYTHON3, RUN_LUA, PYTHON.
4600+
###
4601+
### Parameters:
4602+
### - tool_path - Path to the directory of the tool.
4603+
### - args... - Program arguments. Relative paths listed in TOOL, IN, OUT, STDOUT become absolute.
4604+
### - CWD dir - Absolute path of the working directory.
4605+
### - ENV key=value... - Environment variables.
4606+
### - TOOL tools... - Auxiliary tool directories.
4607+
### - IN[_NOPARSE] inputs... - Input files. NOPARSE inputs are treated as textual and not parsed for dependencies regardless of file extensions.
4608+
### - OUT[_NOAUTO] outputs... - Output files. NOAUTO outputs are not automatically added to the build process.
4609+
### - STDOUT[_NOAUTO] output - Redirect the standard output to the output file.
4610+
### - OUTPUT_INCLUDES output_includes... - Includes of the output files that are needed to build them.
4611+
### - INDUCED_DEPS $VARs... - Dependencies for generated files. Unlike `OUTPUT_INCLUDES` these may target files further in processing chain.
4612+
### In order to do so VAR should be filled by PREPARE_INDUCED_DEPS macro, stating target files (by type) and set of dependencies
4613+
###
4614+
### For absolute paths use ${ARCADIA_ROOT} and ${ARCADIA_BUILD_ROOT}, or
4615+
### ${CURDIR} and ${BINDIR} which are expanded where the outputs are used.
4616+
### Note that Tool is always built for the host platform, so be careful to provide that tool can be built for all Arcadia major host platforms (Linux, MacOS and Windows).
4617+
macro RUN_PY3_PROGRAM(Tool, IN{input}[], IN_NOPARSE{input}[], OUT{output}[], OUT_NOAUTO{output}[], TOOL{tool}[], OUTPUT_INCLUDES[], INDUCED_DEPS[], STDOUT="", STDOUT_NOAUTO="", CWD="", ENV[], Args...) {
4618+
.CMD=$RUN_PROGRAM($Tool $Args ${pre=IN :IN} ${pre=IN_NOPARSE :IN_NOPARSE} ${pre=OUT :OUT} ${pre=OUT_NOAUTO :OUT_NOAUTO} ${pre=TOOL :TOOL} ${pre=OUTPUT_INCLUDES :OUTPUT_INCLUDES} ${pre=INDUCED_DEPS :INDUCED_DEPS} ${pre=STDOUT :STDOUT} ${pre=STDOUT_NOAUTO :STDOUT_NOAUTO} ${pre=CWD :CWD} ${pre=ENV :ENV})
4619+
.SEM=$RUN_PYTHON3(${ARCADIA_ROOT}/${Tool}/__main__.py $Args ${pre=IN :IN} ${pre=IN_NOPARSE :IN_NOPARSE} ${pre=OUT :OUT} ${pre=OUT_NOAUTO :OUT_NOAUTO} ${pre=TOOL :TOOL} ${pre=OUTPUT_INCLUDES :OUTPUT_INCLUDES} ${pre=INDUCED_DEPS :INDUCED_DEPS} ${pre=STDOUT :STDOUT} ${pre=STDOUT_NOAUTO :STDOUT_NOAUTO} ${pre=CWD :CWD} ${pre=ENV :ENV})
4620+
}
4621+
45874622
# tag:java-specific
45884623
macro _RUN_ANTLR_BASE(IN{input}[], IN_NOPARSE{input}[], OUT{output}[], OUT_NOAUTO{output}[], OUTPUT_INCLUDES[], INDUCED_DEPS[], TOOL[], STDOUT="", STDOUT_NOAUTO="", CWD="", JAR[], SEM="run_java", ENV[], HIDE_OUTPUT?"stderr2stdout":"stdout2stderr", Args...) {
45894624
PEERDIR(build/platform/java/jdk $JDK_RESOURCE_PEERDIR)

generate_cmake

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -185,7 +185,7 @@ if __name__ == "__main__":
185185

186186
# In original script there are targets kikimr/docs/ru/docs_oss ydb ydb/tests/oss/launch library/cpp/actors tools/rescompiler/bin
187187
generate_graph_command = f'{ymake_binary_path} --build-root "{ydb_tmp_folder_path}" --config "{dump_export_path}"\
188-
--plugins-root "{plugins_folder_path}" --xs --xx --sem-graph --keep-going\
188+
--plugins-root "{plugins_folder_path}" --xs --xx --sem-graph --keep-going --foreign-on-nosem\
189189
ydb ydb/tests/oss/launch tools/rescompiler/bin > {graph_export_path}'
190190
print(f"Generate graph command {generate_graph_command}")
191191

0 commit comments

Comments
 (0)