Skip to content

Commit 3af57bf

Browse files
committed
wip: windows build
1 parent a49d921 commit 3af57bf

13 files changed

+8577
-8404
lines changed

dhall/cmakelists.dhall

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ let cmakelists = let T = {
77
}
88
, cxx : Text
99
, linker : Text
10+
, debugBuild : Bool
1011
, cxxflags : List Text
1112
, ldflags : List Text
1213
, sourceTreeParts : List lib.sourceTreePart.Type
@@ -16,6 +17,7 @@ let cmakelists = let T = {
1617
, cxxStandard : Natural
1718
, recursiveLinking : Bool
1819
} in {Type = T, default = {
20+
, debugBuild = False
1921
, cxxflags = [] : List Text
2022
, ldflags = [] : List Text
2123
, sourceTreeParts = [] : List lib.sourceTreePart.Type
@@ -84,6 +86,7 @@ let cmakelistsToText = \(m : cmakelists.Type) ->
8486
-- ++ "set(CMAKE_CXX_STANDARD ${Natural/show m.cxxStandard})\n" -- FIXME why does cmake translate CMAKE_CXX_STANDARD=20 to -std=gnu++20
8587
++ "set(CMAKE_LINKER ${m.linker})\n"
8688
++ "set(CMAKE_CXX_COMPILER ${m.cxx})\n"
89+
++ "set(CMAKE_BUILD_TYPE " ++ (if m.debugBuild then "Debug" else "Release") ++ ")\n"
8790
++ "\n"
8891
++ "add_compile_definitions(${prelude.Text.concatSep "\n" gDefines}\n)\n"
8992
++ "include_directories(${composePathList gIncludeDirs}\n)\n"

scripts/install_3rd_party_git_repos.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ getContribRepo "https://github.com/stergiotis/imgui_knobs.git" "imgui_knobs" "ma
5757
getContribRepo "https://github.com/stergiotis/imgui_toggle.git" "imgui_toggle" "main" "2b95aac1732058521d505d6e506f12aa1a331f90"
5858
getContribRepo "https://github.com/dhall-lang/dhall-lang" "dhall-lang" "master" "v22.0.0"
5959
getContribRepo "https://github.com/google/flatbuffers.git" "flatbuffers" "master" "129ef422e8a4e89d87a7216a865602673a6d0bf3"
60-
getContribRepo "https://github.com/google/skia" "skia" "chrome/m124" ""
60+
getContribRepo "https://github.com/google/skia" "skia" "chrome/m134" ""
6161
getContribRepo "https://github.com/wolfpld/tracy" "tracy" "master" "v0.11.1"
6262
getContribRepo "https://github.com/libsdl-org/SDL.git" "sdl" "main" "7c12c63f63be522af2ad8e8216ea7b2786aa42a0"
6363
getContribRepo "https://github.com/phoboslab/qoi.git" "qoi" "master" "bf7b41c2ff3f24a2031193b62aa76d35e8842b5a"

skia/build_cpp_windows.sh

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ set -ev
33
here=$(dirname "$(readlink -f "$BASH_SOURCE")")
44
cd "$here"
55

6-
./cmakelists.dhall
6+
#./cmakelists.dhall
77

88
generate_buildinfo() {
99
echo -en "#pragma once\nnamespace buildinfo {\n static const char *gitCommit=\""
@@ -22,6 +22,11 @@ mkdir -p build
2222
cd build
2323
cmake -DCMAKE_C_COMPILER="clang" \
2424
-DCMAKE_CXX_COMPILER="clang++" \
25-
-G "Unix Makefiles" \
25+
-G "Ninja" \
2626
../CMakeLists.txt
27-
make -j
27+
cmake --build . -j
28+
#cmake -DCMAKE_C_COMPILER="clang" \
29+
# -DCMAKE_CXX_COMPILER="clang++" \
30+
# -G "Unix Makefiles" \
31+
# ../CMakeLists.txt
32+
#make -j

skia_minimal/build_cpp.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,6 @@ flatc="$here/contrib/flatbuffers/flatc"
99

1010
mkdir -p build
1111
cd build
12-
cmake ../CMakeLists.txt
12+
cmake ../CMakeLists.txt -G Ninja
1313
cmake --build . -j
1414
mv *_exe ..

skia_minimal/build_cpp_windows.sh

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@ export PATH="$PATH:$HOME/bin"
1010

1111
mkdir -p build
1212
cd build
13-
cmake -G "Unix Makefiles" ../CMakeLists.txt
14-
make -j
13+
cmake -DCMAKE_BUILD_TYPE=Release -G "Ninja" ../CMakeLists.txt
14+
#cmake --build . -j
15+
#cmake -DCMAKE_BUILD_TYPE=Release -G "Unix Makefiles" ../CMakeLists.txt
16+
#make -j
1517
mv *_exe ..

skia_minimal/build_sdl3.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
#!/bin/bash
22
set -ev
33
here=$(dirname "$(readlink -f "$BASH_SOURCE")")
4-
cd "$here/contrib/sdl"
4+
cd "$here/../../contrib/sdl"
55
cmake -S . -B build -DSDL_STATIC=off \
66
-DSDL_DYNAMIC=on \
77
-DCMAKE_BUILD_TYPE=RelWithDebInfo
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,13 @@
11
#!/bin/bash
22
set -ev
33
here=$(dirname "$(readlink -f "$BASH_SOURCE")")
4-
cd "$here/contrib/sdl"
4+
cd "$here/../../contrib/sdl"
55
cmake -S . -B build -DSDL_STATIC=off \
66
-DSDL_SHARED=on \
7-
-DCMAKE_BUILD_TYPE=RelWithDebInfo \
7+
-DCMAKE_BUILD_TYPE=Release \
88
-DCMAKE_C_COMPILER=clang \
99
-DCMAKE_CXX_COMPILER=clang++ \
10-
-DSDL_HIDAPI=off
11-
cmake --build build --config RelWithDebInfo -j
10+
-DSDL_HIDAPI=off \
11+
-DCMAKE_CXX_COMPILER=clang++ \
12+
-DCMAKE_C_COMPILER=clang
13+
cmake --build build --config Release -j

skia_minimal/build_skia_shared_windows.sh

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ here=$(dirname "$(readlink -f "$BASH_SOURCE")")
1111
# * missing SK_API declarations for defitions in SkParagraph:
1212
# - https://skia-review.googlesource.com/c/skia/+/878977
1313
# * missing include https://skia-review.googlesource.com/c/skia/+/878977
14-
"$here/patch_skia_m124.sh"
14+
#"$here/patch_skia_m124.sh"
1515

1616
cd "$here/../../contrib/skia"
1717
pwd
@@ -34,7 +34,7 @@ cat > out/Shared/args.gn <<- EOF
3434
is_official_build=true
3535
is_debug=false
3636
is_trivial_abi=false
37-
is_component_build=true
37+
is_component_build=false
3838
skia_use_gl=true
3939
sanitize=""
4040
skia_build_for_debugger=false
@@ -156,5 +156,5 @@ EOF
156156
#./bin/gn args out/Shared --list --short
157157

158158
./third_party/ninja/ninja -v -d keeprsp -C out/Shared
159-
"$here/patch_skia_m124.sh"
160-
./third_party/ninja/ninja -v -d keeprsp -C out/Shared
159+
#"$here/patch_skia_m124.sh"
160+
#./third_party/ninja/ninja -v -d keeprsp -C out/Shared
Lines changed: 143 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,143 @@
1+
#!/bin/bash
2+
set -ev
3+
here=$(dirname "$(readlink -f "$BASH_SOURCE")")
4+
5+
cd "$here/../../contrib/skia"
6+
pwd
7+
export GIT_SYNC_DEPS_SKIP_EMSDK="true"
8+
python tools/git-sync-deps
9+
10+
mkdir -p out/Static
11+
cat > out/Static/args.gn <<- EOF
12+
cc = "clang"
13+
cxx = "clang++"
14+
clang_win="C:/Program Files/LLVM"
15+
win_sdk="C:/Program Files (x86)/WIndows Kits/10"
16+
win_sdk_version=""
17+
win_toolchain_version=""
18+
win_vc=""
19+
20+
#extra_cflags = ["-Wno-psabi"]
21+
extra_cflags = ["-D_HAS_AUTO_PTR_ETC"]
22+
23+
is_official_build=true
24+
is_debug=false
25+
is_trivial_abi=false
26+
is_component_build=false
27+
skia_use_gl=true
28+
sanitize=""
29+
skia_build_for_debugger=false
30+
skia_build_fuzzers=false
31+
skia_build_rust_targets=false
32+
skia_compile_modules=false
33+
skia_compile_sksl_tests=false
34+
skia_disable_tracing=true
35+
skia_disable_vma_stl_shared_mutex=false
36+
skia_enable_android_utils=false
37+
skia_enable_api_available_macro=true
38+
skia_enable_bentleyottmann=true
39+
skia_enable_direct3d_debug_layer=false
40+
skia_enable_discrete_gpu=true
41+
skia_enable_fontmgr_FontConfigInterface=false
42+
skia_enable_fontmgr_android=false
43+
skia_enable_fontmgr_custom_directory=true
44+
skia_enable_fontmgr_custom_embedded=true
45+
skia_enable_fontmgr_custom_empty=true
46+
skia_enable_fontmgr_empty=false
47+
skia_enable_fontmgr_fontconfig=false
48+
skia_enable_fontmgr_fuchsia=false
49+
skia_enable_fontmgr_win=true
50+
skia_enable_fontmgr_win_gdi=true
51+
skia_enable_ganesh=true
52+
skia_enable_gpu=true
53+
#skia_enable_gpu_debug_layers=false
54+
skia_enable_graphite=false
55+
skia_enable_metal_debug_info=false
56+
skia_enable_optimize_size=false
57+
skia_enable_pdf=true
58+
skia_enable_precompile=true
59+
skia_enable_skottie=false
60+
skia_enable_skparagraph=true
61+
skia_enable_skshaper=true
62+
skia_enable_skshaper_tests=false
63+
skia_enable_sksl_tracing=false
64+
skia_enable_skunicode=true
65+
skia_enable_spirv_validation=false
66+
skia_enable_svg=false
67+
skia_enable_tools=false
68+
skia_enable_vello_shaders=false
69+
skia_enable_vulkan_debug_layers=false
70+
skia_enable_winuwp=false
71+
skia_generate_workarounds=false
72+
skia_gl_standard=""
73+
skia_include_multiframe_procs=false
74+
skia_lex=false
75+
skia_pdf_subset_harfbuzz=true
76+
skia_print_native_shaders=false
77+
skia_print_sksl_shaders=false
78+
skia_use_angle=false
79+
skia_use_client_icu=false
80+
skia_use_dawn=false
81+
skia_use_direct3d=false
82+
skia_use_dng_sdk=true
83+
skia_use_egl=false
84+
skia_use_epoxy_egl=false
85+
skia_use_expat=true
86+
skia_use_ffmpeg=false
87+
skia_use_fixed_gamma_text=false
88+
skia_use_fontations=false
89+
skia_use_fontconfig=false
90+
skia_use_fonthost_mac=false
91+
skia_use_freetype=true
92+
skia_use_freetype_woff2=true
93+
skia_use_freetype_zlib=true
94+
skia_use_freetype_zlib_bundled=false
95+
skia_use_gl=true
96+
skia_use_harfbuzz=true
97+
skia_use_icu=true
98+
skia_use_icu4x=false
99+
skia_use_jpeg_gainmaps=false
100+
skia_use_libavif=false
101+
skia_use_libfuzzer_defaults=true
102+
skia_use_libgrapheme=false
103+
skia_use_libheif=false
104+
skia_use_libjpeg_turbo_decode=true
105+
skia_use_libjpeg_turbo_encode=true
106+
skia_use_libjxl_decode=false
107+
skia_use_libpng_decode=true
108+
skia_use_libpng_encode=true
109+
skia_use_libwebp_decode=true
110+
skia_use_libwebp_encode=true
111+
skia_use_lua=false
112+
skia_use_metal=false
113+
skia_use_ndk_images=false
114+
skia_use_no_jpeg_encode=false
115+
skia_use_no_png_encode=false
116+
skia_use_no_webp_encode=false
117+
skia_use_perfetto=false
118+
skia_use_piex=true
119+
skia_use_runtime_icu=false
120+
skia_use_safe_libcxx=false
121+
skia_use_sfml=false
122+
skia_use_system_expat=false
123+
skia_use_system_freetype2=false
124+
skia_use_system_harfbuzz=false
125+
skia_use_system_icu=false
126+
skia_use_system_libjpeg_turbo=false
127+
skia_use_system_libpng=false
128+
skia_use_system_libwebp=false
129+
skia_use_system_zlib=false
130+
skia_use_vma=false
131+
skia_use_vulkan=false
132+
skia_use_webgl=false
133+
skia_use_webgpu=false
134+
skia_use_wuffs=true
135+
skia_use_x11=false
136+
skia_use_xps=true
137+
skia_use_zlib=true
138+
skunicode_tests_enabled=false
139+
werror=false
140+
EOF
141+
142+
./bin/gn.exe gen out/Static
143+
./third_party/ninja/ninja -v -d keeprsp -C out/Static

skia_minimal/copy_libs_windows.sh

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -7,16 +7,16 @@ mkdir -p lib
77
copy() {
88
cp "$(realpath "$1")" "lib/$(basename "$1")"
99
}
10-
copy "$here/contrib/sdl/build/RelWithDebInfo/SDL3.dll"
11-
copy "$here/../../contrib/skia/out/Shared/skparagraph.dll"
12-
copy "$here/../../contrib/skia/out/Shared/skparagraph.dll.lib"
13-
copy "$here/../../contrib/skia/out/Shared/skia.dll"
14-
copy "$here/../../contrib/skia/out/Shared/skia.dll.lib"
15-
copy "$here/../../contrib/skia/out/Shared/skunicode_core.dll"
16-
copy "$here/../../contrib/skia/out/Shared/skunicode_core.dll.lib"
17-
copy "$here/../../contrib/skia/out/Shared/skunicode_icu.dll"
18-
copy "$here/../../contrib/skia/out/Shared/skunicode_icu.dll.lib"
19-
copy "$here/../../contrib/skia/out/Shared/bentleyottmann.dll"
20-
copy "$here/../../contrib/skia/out/Shared/bentleyottmann.dll.lib"
21-
copy "$here/../../contrib/skia/out/Shared/skshaper.dll"
22-
copy "$here/../../contrib/skia/out/Shared/skshaper.dll.lib"
10+
copy "$here/../../contrib/sdl/build/Release/SDL3.dll"
11+
#copy "$here/../../contrib/skia/out/Shared/skparagraph.dll"
12+
#copy "$here/../../contrib/skia/out/Shared/skparagraph.dll.lib"
13+
#copy "$here/../../contrib/skia/out/Shared/skia.dll"
14+
#copy "$here/../../contrib/skia/out/Shared/skia.dll.lib"
15+
#copy "$here/../../contrib/skia/out/Shared/skunicode_core.dll"
16+
#copy "$here/../../contrib/skia/out/Shared/skunicode_core.dll.lib"
17+
#copy "$here/../../contrib/skia/out/Shared/skunicode_icu.dll"
18+
#copy "$here/../../contrib/skia/out/Shared/skunicode_icu.dll.lib"
19+
#copy "$here/../../contrib/skia/out/Shared/bentleyottmann.dll"
20+
#copy "$here/../../contrib/skia/out/Shared/bentleyottmann.dll.lib"
21+
#copy "$here/../../contrib/skia/out/Shared/skshaper.dll"
22+
#copy "$here/../../contrib/skia/out/Shared/skshaper.dll.lib"

0 commit comments

Comments
 (0)