Commit Graph

126 Commits

Author SHA1 Message Date
Dan Sinclair
3f072e158c Move TARGETDIR as well 2019-10-15 16:47:28 -04:00
Dan Sinclair
167201430d Make runtests configurable.
This CL allows setting the location of glslangValidator and spirv-remap
when calling the runtests script. A test target is added to CMake to
execute runtests and sets the location to the build folder for the two
applications.
2019-10-15 15:21:21 -04:00
Ryan Harrison
1aeceaea7d Fix config issues and revert previous fixes for semi-colon issues
This reverts commit 41261d95a4.
This reverts commit 7c9accb653.

Instead of trying to work around all of the potential semicolon issues
in glslang, making it conform to Chromium's style, mark the code
explicitly as non-chromium in the BUILD.gn, so chromium doesn't
attempt to enforce its style rules on glslang.

Fixes #1931
2019-10-15 14:45:02 -04:00
durswd
0539823243 Added an option to make pch enabled in Cmake 2019-10-16 02:28:40 +09:00
Fabian Wahlster
03be018a47 find Python and add External subdir only if BUILD_EXTERNAL option was set (on by default) and /External dir exists 2019-10-15 11:00:23 +02:00
Ryan Harrison
41261d95a4 Forgot that GCC doesn't recognize this flag 2019-10-11 13:18:07 -04:00
Ryan Harrison
7c9accb653 Remove unnecessary semi-colons and add warning about them
These are causing integration issues with Chromium down stream since
it is more strict about these.
2019-10-11 11:25:04 -04:00
Kai Ninomiya
230117a02c use custom es6 modularization instead of MODULARIZE=1 2019-09-18 00:04:09 -07:00
Kai Ninomiya
4391924ac5 Separate GLSLANG_WEB (min-size build) and Emscripten options
Allows building non-min-size builds with Emscripten.
Adds ENABLE_GLSLANG_WEB_DEVEL.
Moves the glslang.js files to OSDependent/Web.
Small cleanups and docs update.
2019-09-17 23:18:03 -07:00
John Kessenich
eaf4496312 Web: Complete the removal of vendor-specific #ifdef's, including CMake. 2019-08-20 23:21:56 -06:00
John Kessenich
23d27751e8 Web: Selectively remove a few key features, using #ifndef GLSLANG_WEB
Save about 100K.

N.B.: This is done by eliminating a function call, at a high level,
not by #ifdef'ing a bunch of code.

Also, removed no longer needed *_EXTENSION #ifdef in the code not
needed by GLSLANG_WEB.
2019-08-20 23:21:55 -06:00
Kai Ninomiya
a91561d583 enable build for node 2019-08-20 13:10:53 -07:00
Ryan Harrison
7eb3e6e07a Make non-emscripten flags platform agnostic. 2019-08-09 11:19:07 -04:00
Ryan Harrison
c1063cd5e2 Converted ENABLE_HLSL to a dependent option, so it can be always disabled in web builds 2019-08-09 10:56:51 -04:00
Ryan Harrison
c96e42dca8 Add WASM build target for Web version of glslang
This adds build rules to support generating a WASM binary to be used
on the web. The API exposed to web applications is definated in the
new glslang.js.cpp file.
2019-08-08 15:08:10 -04:00
Ryan Harrison
8126eb1962 Convert no RTTI rule to be compiler specific
MSVC uses a different flag for disabling RTTI, so is currently
including RTTI information and throwing warnings.
2019-07-30 11:25:19 -04:00
Ryan Harrison
bbf172b518 Explicitly remove RTTI in the top-level build config
Fixes #1831
2019-07-12 14:25:18 -04:00
John Kessenich
6fef1ca6f9 Latest known-good SPIRV-Tools: WARNING: Needs python 3.x.
You may need to install python 3.x and also
[windows users] may need to get it in your path in front of python 2.7.x.

If you don't need the external projects (i.e., SPIRV-Tools) and don't want
to upgrade to python 3, don't create the External subdirectory and CMake
won't require python 3.  (CMake has a bug that makes it find the wrong one
on a first pass if the top level does not require the version needed by
lower levels.)
2019-05-09 10:11:54 -06:00
Nuno Subtil
424612c0e7 build: Do not cache debug library suffix
For nested project builds, writing CMAKE_DEBUG_POSTFIX into the cache
ends up affecting other projects. Caching this value doesn't seem to be
required in practice, so this change removes the cache tag.
2019-01-25 09:30:37 -08:00
Jeff Bolz
0a93cfbb79 Update to newest SPIRV-Tools. It checks the Vulkan rule that all resources must have a set and binding decoration, which many tests fail. So add code to set a default value of zero. Also disable PCH for Ninja builds. 2018-12-11 20:58:29 -06:00
David Neto
0392544b7a PCH filename depends on current binary dir
Fixes #1572
2018-11-12 17:09:07 -05:00
Jeff Bolz
02ed310ac3 Rename PCH macro to glslang_pch (to avoid name collision) and update to latest spirv-tools 2018-11-07 09:35:31 -06:00
Jeff Bolz
22d0b7cbad Use precompiled headers for some glslang projects 2018-10-31 15:38:08 -05:00
John Kessenich
5d6b567950
Merge pull request #1436 from karl-lunarg/karl-ccache
build: Add ccache option to CMake config
2018-07-18 20:39:31 -07:00
Matthew Albrecht
f9c2aeb736 Allowed debug postfix to be changed. 2018-07-07 17:00:08 -05:00
Matthew Albrecht
857f25cfd2 Added the cmake option to disable building SPVRemapper. 2018-07-07 16:54:34 -05:00
Karl Schultz
23770b9aae build: Add ccache option to CMake config
This is totally optional, but lets people build this repo with
ccache to improve rebuild speeds.  It also can help a great deal
on ccache-enabled CI systems like Travis-CI.  We build fixed
revisions of glslang a lot on Travis, so this will be a big help
with CI machine loading.
2018-07-06 12:12:09 -06:00
John Kessenich
b9e9e57f12
Merge pull request #1326 from mattparks/patch1
Allowed for LIB_TYPE to be set to switch between static and shared libs for glslang, SPIRV, and HLSL
2018-04-11 18:14:46 -06:00
John Kessenich
5d8d7882be Fix #1328: ENABLE_HLSL=OFF breaking build. 2018-04-05 19:52:38 -06:00
Matthew Albrecht
6c5f649ae8 Allowed for LIB_TYPE to be set to switch between static and shared libs for glslang, SPIRV, and HLSL 2018-03-30 09:32:03 -05:00
GregF
fb03a55e0f Only print legalization warning if optimizer disabled 2018-03-29 13:17:54 -06:00
Tim Diekmann
aab0001220 Set cmake-policy CMP0048 to NEW 2017-10-10 16:26:31 +02:00
John Kessenich
9cf5dfbdc7 Merge pull request #1063 from LoopDawg/remapper-error-cleanup
Remapper: make remapper robust against non-exiting error handlers
2017-09-23 06:32:02 -06:00
GregF
fd34f0e602 CMake changes for HLSL legalization
Cmake now looks for External/spirv-tools. If found, it links in
SPIRV-Tools-opt and SPVRemapper, and adds -DENABLE_OPT to build.
2017-09-21 17:01:47 -06:00
LoopDawg
8004d36528 Remapper: make remapper robust against non-exiting error handlers
Remapper errors are generally fatal: there has been some unexpected situation while
parsing the SPV binary, and there is no reasonable way to carry on.  The
errorHandler() function is called in this case, which by default exits, but
it is possible to submit a handler which does not.  In that case the remapper would
carry on in a bad state.

This change ensures a graceful termination of the remap() function.

While a try {} catch {} construct would be the ideal and safe way to do this,
that's off limits for certain environments, so this tries to do the same thing
with explicit code, to catch all the bailout paths.
2017-09-20 15:19:43 -06:00
d3x0r
f8f494ff14 Add option to skip installation
As a static target, when included in other cmake projects, it is not needed to install these libraries and headers as part of this build, and just need to link to this.
2017-07-04 05:54:57 -07:00
David Seifert
22afc38b55 Modernise CMake #2
This reverts commit cfc69d95af.
* Change CMAKE_INSTALL_PREFIX default on Windows in order
  to prevent permission denied errors when trying to install
  to "Program Files".
2017-04-29 11:23:15 +02:00
John Kessenich
cfc69d95af Revert "Modernise CMake" 2017-04-28 22:04:24 -06:00
David Seifert
8f824265ea Make test suite optional by using CTest 2017-04-28 22:46:52 +02:00
David Seifert
5a5699bdbd Modernise CMake
* Use `GNUInstallDirs` in order to respect GNU conventions.
  This is especially important for multi-arch/multi-lib setups.
* Specify position independent mode building properly, without
  using the historic hack of adding `-fPIC` as a definition.
  This makes the build system more portable.
* Only detect C++ (and not C) to slightly speed up configuring.
* Specify C++11 mode using modern CMake idioms.
* Fix some whitespace issues.
2017-04-28 22:46:52 +02:00
DragoonX6
8155934be6 Fix building on MinGW-w64
Some HLSL to Spirv tests fail.
2017-03-12 04:54:37 +01:00
John Kessenich
dc1a8196cf Infrastructure: Support standard build with ENABLE_HLSL set to off. 2017-01-11 14:50:16 -07:00
Alex Szpakowski
ff21a25bc8 Change disabled-by-default DISABLE_HLSL option to enabled-by-default ENABLE_HLSL.
Matches existing options.
2017-01-09 18:10:14 -04:00
Alex Szpakowski
84eabf7ea7 Add a CMake option to disable compilation of HLSL input support. 2017-01-08 21:20:25 -04:00
John Kessenich
3c264ce8f3 Merge pull request #639 from hrydgard/master
CMake: Add option to make it possible to not build the executables
2016-12-20 11:02:11 -07:00
Henrik Rydgård
868746ad55 Add option to make it possible not to build the executables 2016-12-20 01:56:00 +01:00
chaoc
0ad6a4e60d Add support for SPV_NV_sample_mask_override_coverage 2016-12-19 16:29:34 -08:00
Dominik Witczak
daff1a2523 #517: Enable AMD extensions by default 2016-09-27 10:30:14 +02:00
Wesley Griffin
ac39cdc2f8 bump required CMake version down to 2.8.11 since no features are required in cmake>2.8.11 and this allows building on stock CentOS 7 2016-08-01 15:36:15 -04:00
John Kessenich
2f003ac4e6 Merge pull request #393 from steve-lunarg/warning-enable
Build: Add g++/clang warnings to match some enabled by /W4 in MSVC
2016-07-21 14:46:21 -06:00
LoopDawg
6d478956ac Add g++/clang warnings to match some enabled by /W4 in MSVC. 2016-07-21 09:59:18 -06:00
Rex Xu
9d93a2370d Implement 4 AMD-specific extensions.
- Support GL_AMD_shader_ballot (SPV_AMD_shader_ballot).
- Support GL_AMD_shader_trinary_minmax (SPV_AMD_shader_trinary_minmax).
- Support GL_AMD_shader_explicit_vertex_parameter
  (SPV_AMD_shader_explicit_vertex_parameter).
- Support GL_AMD_gcn_shader (SPV_AMD_gcn_shader).
2016-07-20 16:18:05 +08:00
David Neto
b37dc0e458 For MinGW, statically link exes against basic runtimes
Avoids the need to ship basic runtimes like libgcc_s_sjlj-1.dll
with the executables.
2016-06-02 14:37:24 -04:00
Brad Davis
1e194e8613 Produce different names for files in debug builds on MSVC 2016-05-25 13:08:34 -07:00
Andrew Woloszyn
db0eaf9887 Updated cmake to better organize folders and options.
This adds solution folders that properly group gtest/glslang/hlsl.
This also marks gtest options as advanced so they don't show up
in cmake-gui by default.
2016-05-05 14:45:53 -04:00
Lei Zhang
045e02af75 Bump minimum required CMake version to 2.8.12.
CMake 2.8.12 added support for target_include_directories(), among
other features, and we would like to use it.
2016-05-04 13:06:15 -04:00
John Kessenich
1c7e70763b Merge branch 'master' into hlsl-frontend 2016-04-03 20:36:48 -06:00
Eric Engestrom
6a6d6dda95 fix spelling mistakes 2016-04-03 01:17:13 +01:00
Lei Zhang
414eb60482 Link in Google Test framework.
The existing test harness is a homemade shell script. All the tests
and the expected results are written in plain text files. The harness
just reads in a test, invoke the glslangValidator binary on it, and
compare the result with the golden file. All tests are kinda
integration tests.

This patch add Google Test as an external project, which provides a
new harness for reading shader source files, compile to SPIR-V, and
then compare with the expected output.
2016-03-31 10:31:30 -04:00
John Kessenich
e01a9bc8c0 HLSL: Plumb in HLSL parse context and keywords, and most basic HLSL parser and test. 2016-03-12 21:40:08 -07:00
John Kessenich
5d60ca5744 Platforms: Remove support for Windows XP executables.
Dealing with the 110 toolset seems not worth it.
2015-12-08 14:26:26 -07:00
baldurk
876a0e392e Add an osinclude.h below each OS directory, redirects by platform macro
* Linux folder has been renamed to Unix, to match defines and so that it
  compiles on OS X.
* This removes the need for a per-platform include search path for the
  right OS folder
2015-11-16 18:05:18 +01:00
Chad Versace
4cbf748b13 cmake: Don't override CMAKE_INSTALL_PREFIX
Stop forcing CMAKE_INSTALL_PREFIX="install". If the user manually set
CMAKE_INSTALL_PREFIX, then trust that he knows what he's doing.

This patch does NOT change the project's default value ("install") of
CMAKE_INSTALL_PREFIX.

Change-Id: I81b46dd1986427b498fe6316bed03f01689987d4
2015-08-31 14:38:06 -07:00
John Kessenich
d49d524b1c Add .gitattributes and normalize a few stray file's line endings 2015-06-26 16:29:10 -06:00
John Kessenich
33e075faad glslang build: force the use of -std=c++11 when building with Clang. David Neto <dneto@google.com>.
git-svn-id: https://cvs.khronos.org/svn/repos/ogl/trunk/ecosystem/public/sdk/tools/glslang@31583 e7fa87d3-cd2b-0410-9028-fcbf551c1848
2015-06-24 16:05:50 +00:00
John Kessenich
4217d2ea22 SPIR-V compression: Add stripping and remapping tools for compressibility of generated SPIR-V.
git-svn-id: https://cvs.khronos.org/svn/repos/ogl/trunk/ecosystem/public/sdk/tools/glslang@31180 e7fa87d3-cd2b-0410-9028-fcbf551c1848
2015-05-13 20:38:44 +00:00
John Kessenich
0df0cdeeeb glslangValidator: Add straightforward SPIR-V support (non-optimizing, ~3.x functionality).
git-svn-id: https://cvs.khronos.org/svn/repos/ogl/trunk/ecosystem/public/sdk/tools/glslang@30032 e7fa87d3-cd2b-0410-9028-fcbf551c1848
2015-03-03 17:09:43 +00:00
John Kessenich
92f9038388 Create dummy side project.
git-svn-id: https://cvs.khronos.org/svn/repos/ogl/trunk/ecosystem/public/sdk/tools/glslang@27519 e7fa87d3-cd2b-0410-9028-fcbf551c1848
2014-07-28 04:21:04 +00:00
John Kessenich
078c010de7 Restore r26190: make code PIC
git-svn-id: https://cvs.khronos.org/svn/repos/ogl/trunk/ecosystem/public/sdk/tools/glslang@26211 e7fa87d3-cd2b-0410-9028-fcbf551c1848
2014-04-14 14:45:55 +00:00
John Kessenich
fde703438f CMake: Collapse into a single library all the libraries under the glslang directory, and represent the proper hierarchy in MSVS. There are still a total of 3 libraries to link against: glslang, OGLCompiler, and OSDependent.
git-svn-id: https://cvs.khronos.org/svn/repos/ogl/trunk/ecosystem/public/sdk/tools/glslang@26137 e7fa87d3-cd2b-0410-9028-fcbf551c1848
2014-03-31 00:06:32 +00:00
John Kessenich
e564fc5e85 Make use of the v110 tool set be Win32 specific.
git-svn-id: https://cvs.khronos.org/svn/repos/ogl/trunk/ecosystem/public/sdk/tools/glslang@26127 e7fa87d3-cd2b-0410-9028-fcbf551c1848
2014-03-28 18:07:35 +00:00
John Kessenich
0af1e7c608 Allow selection of the "Platform Toolset", so that XP binaries can be built.
git-svn-id: https://cvs.khronos.org/svn/repos/ogl/trunk/ecosystem/public/sdk/tools/glslang@25952 e7fa87d3-cd2b-0410-9028-fcbf551c1848
2014-03-17 23:56:45 +00:00
John Kessenich
71241d8221 Allow choice of DLL or static CRT libraries through CMake options.
Also, some trivial miscellaneous build-related changes.


git-svn-id: https://cvs.khronos.org/svn/repos/ogl/trunk/ecosystem/public/sdk/tools/glslang@25811 e7fa87d3-cd2b-0410-9028-fcbf551c1848
2014-03-12 02:34:44 +00:00
John Kessenich
3ce1058dbe update Linux build for latest CMake changes from Windows
git-svn-id: https://cvs.khronos.org/svn/repos/ogl/trunk/ecosystem/public/sdk/tools/glslang@25793 e7fa87d3-cd2b-0410-9028-fcbf551c1848
2014-03-11 06:35:42 +00:00
John Kessenich
d18e2d8adc Add CMake support for Visual Studio and installation, with an expected "install" for CMAKE_INSTALL_PREFIX, and updated test scripts to consume the CMake installation.
git-svn-id: https://cvs.khronos.org/svn/repos/ogl/trunk/ecosystem/public/sdk/tools/glslang@25791 e7fa87d3-cd2b-0410-9028-fcbf551c1848
2014-03-11 02:10:26 +00:00
John Kessenich
0547c2a6bb Add submitted CMake files for Linux builds. All existing ways of building remain in tact.
git-svn-id: https://cvs.khronos.org/svn/repos/ogl/trunk/ecosystem/public/sdk/tools/glslang@25403 e7fa87d3-cd2b-0410-9028-fcbf551c1848
2014-02-19 00:18:25 +00:00