(arg1, cmake_args: "list[str]", cmake_dir: Union[str, None] = None, cwd: Union[str, None] = None)
| 562 | |
| 563 | |
| 564 | def run_cmake(arg1, cmake_args: "list[str]", cmake_dir: Union[str, None] = None, cwd: Union[str, None] = None): |
| 565 | if cmake_dir is None: |
| 566 | P = ".." |
| 567 | else: |
| 568 | P = cmake_dir |
| 569 | |
| 570 | wasm = [] |
| 571 | if "wasm" in flags: |
| 572 | wasm.append("emcmake") |
| 573 | |
| 574 | cmake_flags: list[str] = [] |
| 575 | if not WASM or not WASM_CMAKE_IS_USING_INIT_VARS: |
| 576 | # For WASM we provide flags using just environment variables. |
| 577 | # If we provide them using cmake vars, it will override emscripten toolchain flags. |
| 578 | # Unsure if we need this in general even for non-WASM builds. |
| 579 | cmake_flags.extend( |
| 580 | [ |
| 581 | f"-DCMAKE_CXX_FLAGS='{os.environ['CXXFLAGS']}'", |
| 582 | f"-DCMAKE_C_FLAGS='{os.environ['CFLAGS']}'", |
| 583 | ] |
| 584 | ) |
| 585 | |
| 586 | run( |
| 587 | [ |
| 588 | *wasm, |
| 589 | "cmake", |
| 590 | P, |
| 591 | *cmake_flags, |
| 592 | *cmake_args, |
| 593 | f"-DCMAKE_BUILD_TYPE={BUILD_CFG}", |
| 594 | f"-DBUILD_SHARED_LIBS={OFF_ON[not BUILD_STATIC]}", |
| 595 | f"-DCMAKE_SHARED_LINKER_FLAGS={os.environ['LDFLAGS']}", |
| 596 | ], |
| 597 | cwd=cwd, |
| 598 | ) |
| 599 | |
| 600 | |
| 601 | def git_clone_or_pull_repository(clone_url: str, target_dir: str, revision: Union[str, None] = None) -> None: |
no test coverage detected