From 4321929879c1ed5b87ff95a99ca7da91e28d18fd Mon Sep 17 00:00:00 2001 From: Ellie Hermaszewska Date: Fri, 8 Dec 2023 19:24:34 +0800 Subject: WIP: CMake (#3326) * More robust input and output selection in generator tools * Add cmake build system * Get slang-test running with cmake * Bump lz4 and miniz dependencies * Make cmake build more declarative * Correct preprocessor logic in slang.h * Add cuda test to compute/simple * Remove empty cmake files * output placement for cmake, and commenting * Correct include paths in spirv-embed-generator * Format cmake with gersemi * Make cmake build clerer * Neaten header generation Also work around https://gitlab.kitware.com/cmake/cmake/-/issues/18399 by introducing correct_generated_properties to set the GENERATED flag in the correct scope * remove unused files * use 3.20 to set GENERATOR property properly * spelling * more flexible linker arg setting * replace slang-static with obj collection * Set rpath and linker path correctly * neaten generated file generation * tests working with cmake build * fix premake5 build * comment and neaten cmake * remove unnecessary dependency * Build aftermath example only when aftermath is enabled * Add slang-llvm and other dependencies * Put modules alongside binaries * Find slang-glslang correctly * Better option handling * comments * add llvm build test * Better option handling * cmake wobble * use UNICODE and _UNICODE * remove other workflows * use ccache * neaten * limit parallel for llvm build * use ninja for build * Windows and Darwin slang-llvm builds * cache key * verbose llvm build * cl on windows * sccache and cl.exe * use cl.exe * Correct package detection * less verbosity * Simplify miniz inclusion * fix build with sccache * Neaten llvm building * neaten * Neaten slang-llvm fetching * more surgical workarounds * Add ci action * Get version from git * better variable naming * add missing include * clean up after premake in cmake * more docs on cmake build * ci wobble * add imgui target * more selective source * do not download swiftshader * Some missing dependencies * only build llvm on dispatch * Disable /Zi in CI where sccache is present * simplify * set PIC for miniz * set policies before project * reengage workaround * more runs on ci * Add cmake presets * Add cpack * move iterator debug level to preset * Correct lib flag * simplify action * Neaten cmake init * Add todo * Add simple test wrapper * Add tests to workflow presets * rename packing preset * Correctly set definitions * docs * correct preset names * Make slang-test depend on test-server/test-process * neaten * use workflow in actions * install docs * Correct module install dir * debug dist workflow * Install headers * neaten header globbing * Neaten dependency handling * make lib and bin variables * Do not set compiler for vs builds, unnecessary * docs * allow setting explicit source for target * maintain archive subdir * cmake docs * install headers * place targets into folders * cmake docs * nest external projects in folder * remove name clash * Neater external packages * meta targets in folder structure * cleaner slang-glslang dll * Add missing static directive to slang-no-embedded-stdlib * more robust module copying * make slang-test the startup project * folder tweak * Make FETCH_BINARY the default on all platforms * Set DEBUG_DIR * add natvis files to source * skip spirv tests * remove test step from debug dist * Add build to .gitignore * redo warnings to be more like premake * Update imgui * clean more premake files * Disable PCH for glslang, gcc throws a warning * Add /MP for msvc builds * warning wobble * Add script to build llvm * Add slang-llvm and generators components * Build slang-llvm in ci * comments * fetch llvm with git * better abi approximation for cache * better sccache key * formatting * Correct logic around disabling problematic debug info for ccache * exclude gcc and clang from windows ci * Make dist workflows use system llvm * naming * restore normal dist builds * formatting * run tests in ci * Correct slang-llvm url setting * Rely on the system to find the test tool library * actions matrix wiggle * cope with OSX ancient bash * Correct compilers on windows * more ci debugging * Correct rpath handling on OSX * neaten * correct path to slang-llvm * Correct rpath separator on osx * Find slang-llvm correctly * smoke tests only on osx * ci wobble * Give MacOS module a dylib suffix * get swiftshader correctly * cope with bsd cp * remove debug output * full tests on osx * ci wobble * Add some vk tests to expected failures * simplify ci * ci wobble * exclude dx12 tests from github ci * remove cmake code for building llvm * warnings * warnings as errors for cl * spirv-tools in path * add aarch64 ci build * Add SLANG_GENERATORS_PATH option for prebuilt generators * neaten * Correct generator target name * remove yaml anchors because github actions does not support them * Demote CMake in docs Also add info on cross compiling * Restore premake CI * use minimal ci for cmake * Write miniz_export for premake build and .gitignore it * Mention build config tool options in docs * Remove redefined macro for miniz * regenerate vs project --- build/visual-studio/core/core.vcxproj | 6 + build/visual-studio/miniz/miniz.vcxproj | 12 +- build/visual-studio/slang-rt/slang-rt.vcxproj | 6 + .../vk-pipeline-create/vk-pipeline-create.vcxproj | 610 ++++++++++----------- .../vk-pipeline-create.vcxproj.filters | 46 +- 5 files changed, 346 insertions(+), 334 deletions(-) (limited to 'build/visual-studio') diff --git a/build/visual-studio/core/core.vcxproj b/build/visual-studio/core/core.vcxproj index 1f8d95a6f..aed281cd5 100644 --- a/build/visual-studio/core/core.vcxproj +++ b/build/visual-studio/core/core.vcxproj @@ -158,6 +158,7 @@ NotUsing Level4 _DEBUG;WIN32_LEAN_AND_MEAN;VC_EXTRALEAN;NOMINMAX;_ITERATOR_DEBUG_LEVEL=0;%(PreprocessorDefinitions) + ..\..\..\external\miniz;%(AdditionalIncludeDirectories) ProgramDatabase Disabled false @@ -175,6 +176,7 @@ NotUsing Level4 _DEBUG;WIN32_LEAN_AND_MEAN;VC_EXTRALEAN;NOMINMAX;_ITERATOR_DEBUG_LEVEL=0;%(PreprocessorDefinitions) + ..\..\..\external\miniz;%(AdditionalIncludeDirectories) ProgramDatabase Disabled false @@ -192,6 +194,7 @@ NotUsing Level4 _DEBUG;WIN32_LEAN_AND_MEAN;VC_EXTRALEAN;NOMINMAX;_ITERATOR_DEBUG_LEVEL=0;%(PreprocessorDefinitions) + ..\..\..\external\miniz;%(AdditionalIncludeDirectories) ProgramDatabase Disabled false @@ -209,6 +212,7 @@ NotUsing Level4 NDEBUG;WIN32_LEAN_AND_MEAN;VC_EXTRALEAN;NOMINMAX;_ITERATOR_DEBUG_LEVEL=0;%(PreprocessorDefinitions) + ..\..\..\external\miniz;%(AdditionalIncludeDirectories) Full true true @@ -229,6 +233,7 @@ NotUsing Level4 NDEBUG;WIN32_LEAN_AND_MEAN;VC_EXTRALEAN;NOMINMAX;_ITERATOR_DEBUG_LEVEL=0;%(PreprocessorDefinitions) + ..\..\..\external\miniz;%(AdditionalIncludeDirectories) Full true true @@ -249,6 +254,7 @@ NotUsing Level4 NDEBUG;WIN32_LEAN_AND_MEAN;VC_EXTRALEAN;NOMINMAX;_ITERATOR_DEBUG_LEVEL=0;%(PreprocessorDefinitions) + ..\..\..\external\miniz;%(AdditionalIncludeDirectories) Full true true diff --git a/build/visual-studio/miniz/miniz.vcxproj b/build/visual-studio/miniz/miniz.vcxproj index 15eb91f8f..6e091585f 100644 --- a/build/visual-studio/miniz/miniz.vcxproj +++ b/build/visual-studio/miniz/miniz.vcxproj @@ -157,7 +157,7 @@ NotUsing Level3 - _DEBUG;WIN32_LEAN_AND_MEAN;VC_EXTRALEAN;NOMINMAX;_ITERATOR_DEBUG_LEVEL=0;%(PreprocessorDefinitions) + _DEBUG;VC_EXTRALEAN;NOMINMAX;_ITERATOR_DEBUG_LEVEL=0;%(PreprocessorDefinitions) ProgramDatabase Disabled false @@ -174,7 +174,7 @@ NotUsing Level3 - _DEBUG;WIN32_LEAN_AND_MEAN;VC_EXTRALEAN;NOMINMAX;_ITERATOR_DEBUG_LEVEL=0;%(PreprocessorDefinitions) + _DEBUG;VC_EXTRALEAN;NOMINMAX;_ITERATOR_DEBUG_LEVEL=0;%(PreprocessorDefinitions) ProgramDatabase Disabled false @@ -191,7 +191,7 @@ NotUsing Level3 - _DEBUG;WIN32_LEAN_AND_MEAN;VC_EXTRALEAN;NOMINMAX;_ITERATOR_DEBUG_LEVEL=0;%(PreprocessorDefinitions) + _DEBUG;VC_EXTRALEAN;NOMINMAX;_ITERATOR_DEBUG_LEVEL=0;%(PreprocessorDefinitions) ProgramDatabase Disabled false @@ -208,7 +208,7 @@ NotUsing Level3 - NDEBUG;WIN32_LEAN_AND_MEAN;VC_EXTRALEAN;NOMINMAX;_ITERATOR_DEBUG_LEVEL=0;%(PreprocessorDefinitions) + NDEBUG;VC_EXTRALEAN;NOMINMAX;_ITERATOR_DEBUG_LEVEL=0;%(PreprocessorDefinitions) Full true true @@ -228,7 +228,7 @@ NotUsing Level3 - NDEBUG;WIN32_LEAN_AND_MEAN;VC_EXTRALEAN;NOMINMAX;_ITERATOR_DEBUG_LEVEL=0;%(PreprocessorDefinitions) + NDEBUG;VC_EXTRALEAN;NOMINMAX;_ITERATOR_DEBUG_LEVEL=0;%(PreprocessorDefinitions) Full true true @@ -248,7 +248,7 @@ NotUsing Level3 - NDEBUG;WIN32_LEAN_AND_MEAN;VC_EXTRALEAN;NOMINMAX;_ITERATOR_DEBUG_LEVEL=0;%(PreprocessorDefinitions) + NDEBUG;VC_EXTRALEAN;NOMINMAX;_ITERATOR_DEBUG_LEVEL=0;%(PreprocessorDefinitions) Full true true diff --git a/build/visual-studio/slang-rt/slang-rt.vcxproj b/build/visual-studio/slang-rt/slang-rt.vcxproj index 35e3ea987..0d88549e2 100644 --- a/build/visual-studio/slang-rt/slang-rt.vcxproj +++ b/build/visual-studio/slang-rt/slang-rt.vcxproj @@ -164,6 +164,7 @@ NotUsing Level4 _DEBUG;WIN32_LEAN_AND_MEAN;VC_EXTRALEAN;NOMINMAX;_ITERATOR_DEBUG_LEVEL=0;SLANG_RT_DYNAMIC;SLANG_RT_DYNAMIC_EXPORT;%(PreprocessorDefinitions) + ..\..\..\external\miniz;%(AdditionalIncludeDirectories) ProgramDatabase Disabled false @@ -182,6 +183,7 @@ NotUsing Level4 _DEBUG;WIN32_LEAN_AND_MEAN;VC_EXTRALEAN;NOMINMAX;_ITERATOR_DEBUG_LEVEL=0;SLANG_RT_DYNAMIC;SLANG_RT_DYNAMIC_EXPORT;%(PreprocessorDefinitions) + ..\..\..\external\miniz;%(AdditionalIncludeDirectories) ProgramDatabase Disabled false @@ -200,6 +202,7 @@ NotUsing Level4 _DEBUG;WIN32_LEAN_AND_MEAN;VC_EXTRALEAN;NOMINMAX;_ITERATOR_DEBUG_LEVEL=0;SLANG_RT_DYNAMIC;SLANG_RT_DYNAMIC_EXPORT;%(PreprocessorDefinitions) + ..\..\..\external\miniz;%(AdditionalIncludeDirectories) ProgramDatabase Disabled false @@ -218,6 +221,7 @@ NotUsing Level4 NDEBUG;WIN32_LEAN_AND_MEAN;VC_EXTRALEAN;NOMINMAX;_ITERATOR_DEBUG_LEVEL=0;SLANG_RT_DYNAMIC;SLANG_RT_DYNAMIC_EXPORT;%(PreprocessorDefinitions) + ..\..\..\external\miniz;%(AdditionalIncludeDirectories) Full true true @@ -239,6 +243,7 @@ NotUsing Level4 NDEBUG;WIN32_LEAN_AND_MEAN;VC_EXTRALEAN;NOMINMAX;_ITERATOR_DEBUG_LEVEL=0;SLANG_RT_DYNAMIC;SLANG_RT_DYNAMIC_EXPORT;%(PreprocessorDefinitions) + ..\..\..\external\miniz;%(AdditionalIncludeDirectories) Full true true @@ -260,6 +265,7 @@ NotUsing Level4 NDEBUG;WIN32_LEAN_AND_MEAN;VC_EXTRALEAN;NOMINMAX;_ITERATOR_DEBUG_LEVEL=0;SLANG_RT_DYNAMIC;SLANG_RT_DYNAMIC_EXPORT;%(PreprocessorDefinitions) + ..\..\..\external\miniz;%(AdditionalIncludeDirectories) Full true true diff --git a/build/visual-studio/vk-pipeline-create/vk-pipeline-create.vcxproj b/build/visual-studio/vk-pipeline-create/vk-pipeline-create.vcxproj index e3634d91e..bc62dce2b 100644 --- a/build/visual-studio/vk-pipeline-create/vk-pipeline-create.vcxproj +++ b/build/visual-studio/vk-pipeline-create/vk-pipeline-create.vcxproj @@ -1,306 +1,306 @@ - - - - - Debug - Win32 - - - Debug - x64 - - - Debug - ARM64 - - - Debug aarch64 - Win32 - - - Debug aarch64 - x64 - - - Debug aarch64 - ARM64 - - - Release - Win32 - - - Release - x64 - - - Release - ARM64 - - - Release aarch64 - Win32 - - - Release aarch64 - x64 - - - Release aarch64 - ARM64 - - - - {9ED23316-AE8B-4018-9407-271F4DDB8CBA} - true - Win32Proj - vk-pipeline-create - - - - Application - true - Unicode - v142 - - - Application - true - Unicode - v142 - - - Application - true - Unicode - v142 - true - - - Application - false - Unicode - v142 - - - Application - false - Unicode - v142 - - - Application - false - Unicode - v142 - true - - - - - - - - - - - - - - - - - - - - - - - - - true - ..\..\..\bin\windows-x86\debug\ - ..\..\..\intermediate\windows-x86\debug\vk-pipeline-create\ - vk-pipeline-create - .exe - - - true - ..\..\..\bin\windows-x64\debug\ - ..\..\..\intermediate\windows-x64\debug\vk-pipeline-create\ - vk-pipeline-create - .exe - - - true - ..\..\..\bin\windows-aarch64\debug\ - ..\..\..\intermediate\windows-aarch64\debug\vk-pipeline-create\ - vk-pipeline-create - .exe - - - false - ..\..\..\bin\windows-x86\release\ - ..\..\..\intermediate\windows-x86\release\vk-pipeline-create\ - vk-pipeline-create - .exe - - - false - ..\..\..\bin\windows-x64\release\ - ..\..\..\intermediate\windows-x64\release\vk-pipeline-create\ - vk-pipeline-create - .exe - - - false - ..\..\..\bin\windows-aarch64\release\ - ..\..\..\intermediate\windows-aarch64\release\vk-pipeline-create\ - vk-pipeline-create - .exe - - - - NotUsing - Level3 - _DEBUG;WIN32_LEAN_AND_MEAN;VC_EXTRALEAN;NOMINMAX;_ITERATOR_DEBUG_LEVEL=0;%(PreprocessorDefinitions) - ..\..\..;..\..\..\external\vulkan\include;%(AdditionalIncludeDirectories) - ProgramDatabase - Disabled - false - MultiThreadedDebug - true - stdcpp17 - - - Console - true - - - - - NotUsing - Level3 - _DEBUG;WIN32_LEAN_AND_MEAN;VC_EXTRALEAN;NOMINMAX;_ITERATOR_DEBUG_LEVEL=0;%(PreprocessorDefinitions) - ..\..\..;..\..\..\external\vulkan\include;%(AdditionalIncludeDirectories) - ProgramDatabase - Disabled - false - MultiThreadedDebug - true - stdcpp17 - - - Console - true - - - - - NotUsing - Level3 - _DEBUG;WIN32_LEAN_AND_MEAN;VC_EXTRALEAN;NOMINMAX;_ITERATOR_DEBUG_LEVEL=0;%(PreprocessorDefinitions) - ..\..\..;..\..\..\external\vulkan\include;%(AdditionalIncludeDirectories) - ProgramDatabase - Disabled - false - MultiThreadedDebug - true - stdcpp17 - - - Console - true - - - - - NotUsing - Level3 - NDEBUG;WIN32_LEAN_AND_MEAN;VC_EXTRALEAN;NOMINMAX;_ITERATOR_DEBUG_LEVEL=0;%(PreprocessorDefinitions) - ..\..\..;..\..\..\external\vulkan\include;%(AdditionalIncludeDirectories) - Full - true - true - false - true - MultiThreaded - true - stdcpp17 - - - Console - true - true - - - - - NotUsing - Level3 - NDEBUG;WIN32_LEAN_AND_MEAN;VC_EXTRALEAN;NOMINMAX;_ITERATOR_DEBUG_LEVEL=0;%(PreprocessorDefinitions) - ..\..\..;..\..\..\external\vulkan\include;%(AdditionalIncludeDirectories) - Full - true - true - false - true - MultiThreaded - true - stdcpp17 - - - Console - true - true - - - - - NotUsing - Level3 - NDEBUG;WIN32_LEAN_AND_MEAN;VC_EXTRALEAN;NOMINMAX;_ITERATOR_DEBUG_LEVEL=0;%(PreprocessorDefinitions) - ..\..\..;..\..\..\external\vulkan\include;%(AdditionalIncludeDirectories) - Full - true - true - false - true - MultiThreaded - true - stdcpp17 - - - Console - true - true - - - - - - - - - - - - {DB00DA62-0533-4AFD-B59F-A67D5B3A0808} - - - {222F7498-B40C-4F3F-A704-DDEB91A4484A} - - - {F5ADB74E-02A7-44FB-AA3B-FC02F8AC7A4B} - - - {3565FE5E-4FA3-11EB-AE93-0242AC130002} - - - {F9BE7957-8399-899E-0C49-E714FDDD4B65} - - - - - + + + + + Debug + Win32 + + + Debug + x64 + + + Debug + ARM64 + + + Debug aarch64 + Win32 + + + Debug aarch64 + x64 + + + Debug aarch64 + ARM64 + + + Release + Win32 + + + Release + x64 + + + Release + ARM64 + + + Release aarch64 + Win32 + + + Release aarch64 + x64 + + + Release aarch64 + ARM64 + + + + {9ED23316-AE8B-4018-9407-271F4DDB8CBA} + true + Win32Proj + vk-pipeline-create + + + + Application + true + Unicode + v142 + + + Application + true + Unicode + v142 + + + Application + true + Unicode + v142 + true + + + Application + false + Unicode + v142 + + + Application + false + Unicode + v142 + + + Application + false + Unicode + v142 + true + + + + + + + + + + + + + + + + + + + + + + + + + true + ..\..\..\bin\windows-x86\debug\ + ..\..\..\intermediate\windows-x86\debug\vk-pipeline-create\ + vk-pipeline-create + .exe + + + true + ..\..\..\bin\windows-x64\debug\ + ..\..\..\intermediate\windows-x64\debug\vk-pipeline-create\ + vk-pipeline-create + .exe + + + true + ..\..\..\bin\windows-aarch64\debug\ + ..\..\..\intermediate\windows-aarch64\debug\vk-pipeline-create\ + vk-pipeline-create + .exe + + + false + ..\..\..\bin\windows-x86\release\ + ..\..\..\intermediate\windows-x86\release\vk-pipeline-create\ + vk-pipeline-create + .exe + + + false + ..\..\..\bin\windows-x64\release\ + ..\..\..\intermediate\windows-x64\release\vk-pipeline-create\ + vk-pipeline-create + .exe + + + false + ..\..\..\bin\windows-aarch64\release\ + ..\..\..\intermediate\windows-aarch64\release\vk-pipeline-create\ + vk-pipeline-create + .exe + + + + NotUsing + Level3 + _DEBUG;WIN32_LEAN_AND_MEAN;VC_EXTRALEAN;NOMINMAX;_ITERATOR_DEBUG_LEVEL=0;%(PreprocessorDefinitions) + ..\..\..;..\..\..\external\vulkan\include;%(AdditionalIncludeDirectories) + ProgramDatabase + Disabled + false + MultiThreadedDebug + true + stdcpp17 + + + Console + true + + + + + NotUsing + Level3 + _DEBUG;WIN32_LEAN_AND_MEAN;VC_EXTRALEAN;NOMINMAX;_ITERATOR_DEBUG_LEVEL=0;%(PreprocessorDefinitions) + ..\..\..;..\..\..\external\vulkan\include;%(AdditionalIncludeDirectories) + ProgramDatabase + Disabled + false + MultiThreadedDebug + true + stdcpp17 + + + Console + true + + + + + NotUsing + Level3 + _DEBUG;WIN32_LEAN_AND_MEAN;VC_EXTRALEAN;NOMINMAX;_ITERATOR_DEBUG_LEVEL=0;%(PreprocessorDefinitions) + ..\..\..;..\..\..\external\vulkan\include;%(AdditionalIncludeDirectories) + ProgramDatabase + Disabled + false + MultiThreadedDebug + true + stdcpp17 + + + Console + true + + + + + NotUsing + Level3 + NDEBUG;WIN32_LEAN_AND_MEAN;VC_EXTRALEAN;NOMINMAX;_ITERATOR_DEBUG_LEVEL=0;%(PreprocessorDefinitions) + ..\..\..;..\..\..\external\vulkan\include;%(AdditionalIncludeDirectories) + Full + true + true + false + true + MultiThreaded + true + stdcpp17 + + + Console + true + true + + + + + NotUsing + Level3 + NDEBUG;WIN32_LEAN_AND_MEAN;VC_EXTRALEAN;NOMINMAX;_ITERATOR_DEBUG_LEVEL=0;%(PreprocessorDefinitions) + ..\..\..;..\..\..\external\vulkan\include;%(AdditionalIncludeDirectories) + Full + true + true + false + true + MultiThreaded + true + stdcpp17 + + + Console + true + true + + + + + NotUsing + Level3 + NDEBUG;WIN32_LEAN_AND_MEAN;VC_EXTRALEAN;NOMINMAX;_ITERATOR_DEBUG_LEVEL=0;%(PreprocessorDefinitions) + ..\..\..;..\..\..\external\vulkan\include;%(AdditionalIncludeDirectories) + Full + true + true + false + true + MultiThreaded + true + stdcpp17 + + + Console + true + true + + + + + + + + + + + + {DB00DA62-0533-4AFD-B59F-A67D5B3A0808} + + + {222F7498-B40C-4F3F-A704-DDEB91A4484A} + + + {F5ADB74E-02A7-44FB-AA3B-FC02F8AC7A4B} + + + {3565FE5E-4FA3-11EB-AE93-0242AC130002} + + + {F9BE7957-8399-899E-0C49-E714FDDD4B65} + + + + + \ No newline at end of file diff --git a/build/visual-studio/vk-pipeline-create/vk-pipeline-create.vcxproj.filters b/build/visual-studio/vk-pipeline-create/vk-pipeline-create.vcxproj.filters index 1068a0300..87f7c2894 100644 --- a/build/visual-studio/vk-pipeline-create/vk-pipeline-create.vcxproj.filters +++ b/build/visual-studio/vk-pipeline-create/vk-pipeline-create.vcxproj.filters @@ -1,24 +1,24 @@ - - - - - {21EB8090-0D4E-1035-B6D3-48EBA215DCB7} - - - {E9C7FDCE-D52A-8D73-7EB0-C5296AF258F6} - - - - - Header Files - - - - - Source Files - - - Source Files - - + + + + + {21EB8090-0D4E-1035-B6D3-48EBA215DCB7} + + + {E9C7FDCE-D52A-8D73-7EB0-C5296AF258F6} + + + + + Header Files + + + + + Source Files + + + Source Files + + \ No newline at end of file -- cgit v1.2.3