summaryrefslogtreecommitdiff
path: root/CONTRIBUTION.md
diff options
context:
space:
mode:
authorJay Kwak <82421531+jkwak-work@users.noreply.github.com>2024-04-24 18:35:46 -0700
committerGitHub <noreply@github.com>2024-04-24 18:35:46 -0700
commit52dcb5bd44aa15f07826062c53fae344d55959e9 (patch)
tree9303a69b335289bf9143330bf06d5ea69969854d /CONTRIBUTION.md
parent941961e5dad5afa51095450b8d57380c322900c0 (diff)
Updating CONTRIBUTION guide to use CMake (#4017)
Releated to #3703 Removing the build instruction with Premake and replacing it with an instruction with CMake. It is because we are going to move over to CMake anytime soon. Bumping the required CMake version to 3.25.0. When CMakePresets.json has "version:6", it requires CMake version to be 3.25 or above. See the URL below for more information, https://cmake.org/cmake/help/latest/release/3.25.html CMakeLists.txt copies the prebuilt binary files from external/slang-binaries/bin/windows-x64 CMakeLists.txt was copying "slang-llvm.dll" to build/Release/lib directory when it should have been build/Release/bin. It made slang-test to ignore all FILECHECK tests. This is fixed. Co-authored-by: Yong He <yonghe@outlook.com>
Diffstat (limited to 'CONTRIBUTION.md')
-rw-r--r--CONTRIBUTION.md35
1 files changed, 21 insertions, 14 deletions
diff --git a/CONTRIBUTION.md b/CONTRIBUTION.md
index 594e32a9f..fb5f9e5e2 100644
--- a/CONTRIBUTION.md
+++ b/CONTRIBUTION.md
@@ -73,28 +73,35 @@ Please follow the instructions of how to [Building Slang from Source](docs/build
For a quick reference, follow the instructions below.
#### Windows
-Find where the premake executable is. The location may change when we upgrade Premake.
-```
-C:\git\slang> where /r external\slang-binaries\premake premake*.exe
-```
+Download and install CMake from [CMake.org/download](https://cmake.org/download)
-Run the premake with the following command line options after replacing "PREMAKE" with the result from the previous command.
+Run CMake with the following command to generate a Visual Studio 2022 Solution:
```
-# For VisualStudio 2019
-C:\git\slang> PREMAKE vs2019 --deps=true --arch=x64
-# For VisualStudio 2017
-C:\git\slang> PREMAKE vs2017 --deps=true --arch=x64
+# For VisualStudio 2022
+C:\git\slang> cmake.exe --preset vs2022
```
Open slang.sln with VisualStudio IDE and build it for "x64".
+Or you can build with a following command:
+```
+C:\git\slang> cmake.exe --build --preset release
+```
+
#### Linux
-Find where the premake is and run it with gmake2 option.
+Install CMake and Ninja.
+```
+$ sudo apt-get install cmake ninja-build
+```
+
+Run CMake with a following command to generate Makefile:
+```
+$ cmake --preset default
+```
+
+Build with a following command:
```
-$ PREMAKE="$(find external/slang-binaries/premake -type f -iname 'premake5' | grep bin/linux-64)"
-$ chmod u+x "$PREMAKE"
-$ "$PREMAKE" gmake2 --deps=true --arch=x64
-$ make config=release_x64
+$ cmake --build --preset release
```
### Making Changes