-
-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #45 from MementoRC/feat/cmake-win-pass
FEAT: Add windows built with CMake
- Loading branch information
Showing
17 changed files
with
429 additions
and
8 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
c_compiler: | ||
- vs2019 | ||
c_stdlib: | ||
- vs | ||
channel_sources: | ||
- conda-forge | ||
channel_targets: | ||
- conda-forge main | ||
cxx_compiler: | ||
- vs2019 | ||
libxml2: | ||
- '2' | ||
target_platform: | ||
- win-64 | ||
zlib: | ||
- '1' | ||
zstd: | ||
- '1.5' |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
echo source %SYS_PREFIX:\=/%/etc/profile.d/conda.sh > conda_build.sh | ||
echo conda activate "${PREFIX}" >> conda_build.sh | ||
echo conda activate --stack "${BUILD_PREFIX}" >> conda_build.sh | ||
echo CONDA_PREFIX=${CONDA_PREFIX//\\//} >> conda_build.sh | ||
type "%RECIPE_DIR%\build.sh" >> conda_build.sh | ||
|
||
set PREFIX=%PREFIX:\=/% | ||
set BUILD_PREFIX=%BUILD_PREFIX:\=/% | ||
set CONDA_PREFIX=%CONDA_PREFIX:\=/% | ||
set RECIPE_DIR=%RECIPE_DIR:\=/% | ||
set SRC_DIR=%SRC_DIR:\=/% | ||
set MSYSTEM=UCRT64 | ||
set MSYS2_PATH_TYPE=inherit | ||
set CHERE_INVOKING=1 | ||
bash -lc "./conda_build.sh" | ||
if errorlevel 1 exit 1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
#!/usr/bin/env bash | ||
set -euxo pipefail | ||
|
||
# --- Functions --- | ||
|
||
source "${RECIPE_DIR}/build_scripts/_functions.sh" | ||
|
||
# --- Main --- | ||
|
||
export ZIG_GLOBAL_CACHE_DIR="${PWD}/zig-global-cache" | ||
export ZIG_LOCAL_CACHE_DIR="${PWD}/zig-local-cache" | ||
|
||
cmake_build_dir="${SRC_DIR}/build-release" | ||
mkdir -p "${cmake_build_dir}" && cp -r "${SRC_DIR}"/zig-source/* "${cmake_build_dir}" | ||
|
||
SYSROOT_ARCH="x86_64" | ||
|
||
_UCRT_LIBPATH="C:\Program Files (x86)\Windows Kits\10\lib\10.0.22621.0\um\x64;C:\Program Files (x86)\Windows Kits\10\lib\10.0.22621.0\ucrt\x64;C:\Windows\System32" | ||
|
||
EXTRA_CMAKE_ARGS+=( \ | ||
"-DCMAKE_BUILD_TYPE=Release" \ | ||
"-DCMAKE_VERBOSE_MAKEFILE=ON" \ | ||
"-DZIG_CMAKE_PREFIX_PATH=${_UCRT_LIBPATH};${LIBPATH}" \ | ||
"-DZIG_TARGET_TRIPLE=${SYSROOT_ARCH}-windows-msvc" \ | ||
"-DZIG_TARGET_MCPU=baseline" \ | ||
) | ||
# "-DZIG_SYSTEM_LIBCXX='c++'" \ | ||
# "-DZIG_USE_LLVM_CONFIG=ON" \ | ||
# "-DZIG_STATIC_LLVM=ON" \ | ||
|
||
configure_cmake "${cmake_build_dir}" "${PREFIX}" | ||
|
||
pushd "${cmake_build_dir}" | ||
# This is very hack-ish, but it seemd impossible to tell stage3/zig to find the needed version, uuid, ole32, etc DLLs | ||
# It goes with a patch of build.zig to accept multiple paths | ||
powershell -Command "(Get-Content config.h) -replace 'ZIG_LLVM_LIB_PATH \"', 'ZIG_LLVM_LIB_PATH \"C:/Windows/System32;C:/Program Files (x86)/Windows Kits/10/Lib/10.0.22621.0/um/x64;\"' | Set-Content config.h" | ||
cat config.h | ||
popd | ||
|
||
cmake_build_install "${cmake_build_dir}" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
--- CMakeLists.txt.old 2024-06-06 14:05:11.000000000 -0500 | ||
+++ CMakeLists.txt 2024-06-22 11:27:13.931633400 -0500 | ||
@@ -731,2 +733,4 @@ | ||
else() | ||
+target_compile_options(zigcpp PRIVATE -MD) | ||
+add_compile_options(/MD /wd4715 /wd4291) | ||
target_compile_options(zigcpp PRIVATE /Zc:preprocessor) |
Oops, something went wrong.