Commit Graph

98 Commits (da87a680938d3f47549dcf759f8b01b6e321d81b)

Author SHA1 Message Date
Koen Schmeets 8f509f1452
Travis: CI improvements and fixing edge builds (#766)
- Fix release notes by using edge deploy provider, see: https://github.com/travis-ci/dpl/pull/1069
- Deploy only on master branch
- Move to arm64-graviton2
- Rename debian -> ubuntu
- Remove appveyor.yml
- Remove redundant deploy stage in build step names
- Get rid of bash code in files using sh, and explicitly use bash in sign-macos.sh script
- Add missing newline to build-windows.sh
- Build x86 for Windows
- Enable OpenMP in test builds
- Disable sanitizers on macOS test build
- Disallow failures on snap build
2020-10-24 11:08:40 +02:00
Maximilian Federle 68b1abf77f CMake: use sanitizer flags for internal targets only
Previously sanitizer flags were set unconditionally for
all code, including that of external libraries.
Set them only for targets in src/, tests/ and exposed/.

Unfortunately, the linker equivalent to add_compile_options,
add_link_options, is only available for CMake version >= 3.13.
So add the sanitizer flags manually to each target's linker options.
2020-10-23 19:39:36 +02:00
ruevs 400056cded CMake: Give ENABLE_LTO a default and a description so it shows up in cmake-gui 2020-10-21 19:32:11 -04:00
Maximilian Federle 8a2e77d035 CMake: fix LTO on Linux
LTO/IPO with non-Intel compilers on Linux requires policy CMP0069 to be set to NEW.
Set it explicitly until cmake_minimum_required is raised to >= 3.9

Also explicitly check whether the current environment actually supports IPO.
2020-10-20 19:47:22 -04:00
Koen Schmeets 8e7416f3fd
Travis: Build improvements and fixes (#751)
- Add OpenMP to macOS build
- Use as many cores as possible in CI
- Update travis osx image to xcode12.2
- Ignore .vscode folder
- In `.travis/sign-macos.sh`, only create keychain when `CI` variable is present
- Only run macOS deploy stage when a tag is pushed
2020-10-20 09:39:26 +02:00
Koen Schmeets 91684fe6f4 Add macOS travis config, fix issue in CMakeLists.txt causing macOS build to break 2020-10-17 13:19:54 -04:00
phkahler d575da8611 Add cmake option ENABLE_LTO for link time optimization on Release builds. 2020-09-21 17:26:10 -04:00
xzcvczx f0623fa5ba
CMake: don't install mimalloc. 2020-07-12 20:57:02 +00:00
наб cbac182edf Add and build mimalloc at 07c6e60a5a3bd7de09e4a170cd97bafba59cfafd 2020-07-12 02:37:07 +00:00
whitequark a80a0337a5 Disable OpenMP.
This is unfortunate, but OpenMP is not available on some toolchains
(most MinGW builds) and, more importantly, breaks the distribution
model we use on Windows, which is a single self-contained executable.

Leave the OpenMP disabled by default everywhere so that we don't have
any second-class platforms where SolveSpace is slower than on first-
class ones.

Fixes #631.
2020-06-21 01:15:28 +00:00
whitequark 521473ee4b Win32: use CRT heap instead of our own.
Historically SolveSpace used its own heap on Windows since it gave
better control and debugging options, but a lot of development these
days happens on Linux, where that heap was a stub around malloc/free,
and also Windows debugging tools got a lot better.

In terms of immediate benefit, this commit fixes heap corruption
on Windows introduced in commits b4e1ce44 and 47e82798, caused
by allocating with HEAP_NO_SERIALIZE in parallel from OpenMP threads.
Without HEAP_NO_SERIALIZE there's no performance benefit to keeping
our own heap, either.

The vl() function is also removed because for development there are
better tools now, and the only place where it was permanently called
from became a no-op, since temporary heap always validates after
FreeAllTemporary() recreates it.
2020-05-10 05:35:42 +00:00
whitequark 74103eee81 CMake: expand sanitizer support to include TSan. 2020-05-10 02:52:39 +00:00
whitequark 47e82798da CMake: detect OpenMP and use if available.
This is a missing part of commit b4e1ce44.
2020-05-09 19:46:16 +00:00
nabijaczleweli 645353cbdc Force SSE2 floats for i686 targets
Both GCC and Clang use x87 instructions by default on 32-bit x86
targets, but the loss of precision resulting from that has yielded
crashing tests (see referenced issue), and it can be safely assumed
there are very few CPUs that both don't support SSE2 and are expected to
run SolveSpace

This commit also removes a now-redundant check for 32-bit Windows
against TARGET, which doesn't seem to be actually set by CMake at all

Ref: #565
2020-03-24 17:31:21 +00:00
nabijaczleweli e355a095c4 Force vendor zlib, png, and FreeType on Win32, too
This has lead to linker problems if the environment does have standard
versions of zlib/png (like from MSYS2), see discussion in referenced
issue

Closes #559
2020-03-15 03:03:24 +00:00
whitequark 0b786e6e2b CMake: review minimum required CMake version.
It turns out that using cmake_policy(VERSION) is effectively same as
using cmake_minimum_required(VERSION) because it is a hard error
if the CMake running the script is too old. As such, replace 22525e65
with two changes:
  * Set the minimum required version to 3.7.2 (Debian stretch),
    which also configures policies.
  * If CMake is at least as new as 3.11.0, then set the policies
    according to that version.
This should actually have the intended behavior.
2019-12-02 18:51:58 +00:00
whitequark 22525e6515 CMake: update policy to 3.11.
In particular this enables linking with GLVND on Linux by default.
2019-11-26 11:23:37 +00:00
whitequark fb536a155d Test for -ffile-prefix-map support instead of comparing versions.
Comparing versions is not viable because Apple clang has its own
versioning scheme which is also undocumented.
2019-11-24 18:55:46 +00:00
whitequark 690f87cf4a On GNU-compatible compilers, avoid embedding paths into binaries.
This is helpful for reproducible builds, and also makes it easier
to debug binaries built on another system.
2019-11-23 16:57:35 +00:00
Koen Schmeets b5ccf5acf5 macOS: fix CMake Xcode generator.
This is done by setting `CMAKE_RUNTIME_OUTPUT_DIRECTORY` to `$<1:${CMAKE_BINARY_DIR}/bin>`
2019-11-23 13:20:45 +00:00
Ruevski 260769c03b Win32: Restore Windows XP Compatibility
By setting WINVER=0x0501 (Windows XP) in CMakeLists.txt and adding a few
missing defines in guiwin.cpp and configuring OPENGL=1 in CMake
Solvespace (3.0~25b6eba1) compiles and works perfectly on Windows XP.
Tested with MinGW GCC-6.3.0-1
2019-05-23 14:42:55 +00:00
whitequark e9b9dca2ca Win32: use native OpenGL drivers, if available.
After this commit, if the target system does have modern OpenGL
drivers installed, ANGLE is configured to use them, bypassing most
translation (shaders still have to be translated from ESSL to GLSL).

If there are no OpenGL drivers, such as if the graphics drivers were
installed via Windows Update, DirectX translation is still used. This
results in a very noticeable startup delay and minor performance
degradation.

In addition it is no longer necessary to build with -DOPENGL=1 to be
able to run the binary in wine; everything works out of the box.
Before, wine's incomplete HLSL translator would crash.

This change required renaming the variable `texture` in shaders,
since it shadows the Core GLSL function with the same name, and ANGLE
translates texture2D() calls to texture() calls.
2019-05-23 10:58:31 +00:00
whitequark e7b75f19c3 Revert "CMake: replace GetGitCommitHash with .gitattributes and $Id$."
This reverts commit c962357b35.

$Id$ inserts the SHA1 of the *blob*, not the *commit*, and is
therefore completely worthless.
2019-05-01 08:32:59 +00:00
Sergiusz Bazanski 3a3a2755bf Implement Q3DO export.
We plan to use flatbuffers in the future for the next generation of
the .slvs file format, so flatbuffers are built unconditionally; and
the Q3DO exporter itself is tiny.
2019-03-28 08:53:37 +00:00
whitequark c962357b35 CMake: replace GetGitCommitHash with .gitattributes and $Id$. 2019-02-10 09:41:11 +00:00
whitequark efc3da4579 CMake: add an ENABLE_CLI flag. 2018-07-18 11:49:06 +00:00
whitequark c1f1c7c409 Add a platform abstraction for 6-DOF input devices.
This commit mostly just moves code around.
2018-07-18 01:05:19 +00:00
whitequark ba71dba024 CMake: use correct gtkmm version constraint.
Many GL APIs appeared in GTK in version 3.16, but in gtkmm only in
version 3.18.
2018-07-12 12:19:59 +00:00
whitequark f37881a2e3 macOS: bundle and statically link external dependencies.
This fixes numerous linking issues where updated system libraries
on macOS cause errors on startup in newer OS versions.
2018-07-12 11:15:31 +00:00
whitequark c5a3b43665 CMake: support sanitizers on gcc builds, too.
This also fixes Travis Linux builds.
2018-07-11 04:52:11 +00:00
whitequark 13695be03a CMake: update required version to 3.2.
We use continue(), which was introduced in 3.2.
2017-11-06 05:40:49 +00:00
whitequark ecb6550b5c Change mentions of OpenGL 2 to OpenGL 3.
We ended up in a confusing state where OpenGL 2 (like in "gl2")
actually refers to OpenGL ES 2, which roughly corresponds to
OpenGL 3. Rectify that.
2017-04-06 07:20:50 +00:00
whitequark 6b67cfe63f Except when using OpenGL ES 2, use OpenGL 3.2+ Core profile.
This is primarily done to lower the GTK version dependency below
GTK 3.22, since GTK 3.22 is unlikely to be widely availale any
time soon.
2017-01-13 23:43:02 +00:00
Elvira Khabirova 4f04406121 Implement a gettext .po file parser. 2017-01-05 12:14:40 +00:00
whitequark 934f33f4c0 Update zlib, libpng and Freetype submodules to latest versions.
In particular this fixes an issue with the Freetype build system
where re-running CMake would rebuild it from scratch every time.
2017-01-03 01:28:07 +00:00
whitequark 6b8f937894 Win32: fix compatibility with MSVC x64 builds. 2017-01-03 00:52:24 +00:00
whitequark e127b28a2d CMake: allow building the CLI without the GUI. 2017-01-02 22:13:20 +00:00
whitequark 9253e5f229 GTK: update gtkmm dependency.
Pre-3.22 gtkmm doesn't have Gtk::GLArea::set_use_es(), which we
require.
2017-01-02 20:46:18 +00:00
whitequark 7dbbd75969 Drop support for GTK 2.
It's a deprecated platform that has weird OpenGL-related bugs and
is incompatible with using EGL anyway. It was clear we're going
to drop it, the only question was when. Answer: now.
2017-01-02 16:20:12 +00:00
whitequark d1ddc6ee07 Win32: fix inclusion of manifest, to get back visual styles.
This commit fixes four issues:
  * Instead of WRITE,APPEND, resource.rc was generated using
    WRITE,WRITE, which erased #include <windows.h> and prevented
    any symbolic definitions (like RT_MANIFEST) from working.
    This silently included them using a string type instead,
    which did nothing.
  * WINVER is bumped to Win7, since that's what we target now.
  * Index of RT_MANIFEST is changed to 2, since that's what
    it has to be when ISOLATION_AWARE_ENABLED is defined.
  * Platform is not restricted to X86 in manifest, since there
    is no point in doing so.
2016-12-04 20:33:46 +00:00
whitequark 6989a3d068 CMake: Cairo is required for CLI, not just tests. 2016-12-04 19:05:51 +00:00
whitequark 9301dec98d Use the same code for loading resources in all executables.
All of our executables need resources; e.g. the vector font is
a resource and it is necessary for generation. Before this commit,
the GUI executable loaded the resources in a nice way, and everything
else did it in a very ad-hoc, fragile way.

After this commit, all executables are placed in <build>/bin and
follow the same algorithm:
  * On Windows, resources are compiled and linked into every
    executable.
  * On Linux, resources are copied into <build>/res (which is
    tried first) and <prefix>/share/solvespace (which is tried
    second).
  * On macOS, resources are copied into <build>/res (which is
    tried first) and <build>/bin/solvespace.app/Contents/Resources
    (which is tried second).

In practice this means that we can add as many executables as we want
without duplicating lots of code. In addition, on macOS, we can
place supplementary executables into the bundle, and they can use
resources from the bundle transparently.
2016-11-28 06:18:42 +00:00
whitequark 8dc60f61c1 Fix Windows build with -DOPENGL=1.
This is mostly useful when testing the Windows functionality
on Linux, as wine is currently unable to compile the shaders
that ANGLE outputs.
2016-11-19 05:14:06 +00:00
whitequark d3f2ac7513 Remove most dependencies on config.h.
The only thing we need it anymore is the package version and platform
configuration, so only include it for that. As a result, less files
are rebuilt when the git commit changes and config.h is regenerated.
2016-11-19 01:00:11 +00:00
whitequark 0ae0343fc7 Add a simple benchmarking harness. 2016-11-18 13:55:24 +00:00
whitequark c8ff17f4a2 Add OpenGL 2 support on Windows using ANGLE.
This commit performs two main changes:
  * Alters the shaders to use only strictly conformant GLSL 2.0.
  * Alters the Windows UI to use ANGLE via GL ES 2.0 and EGL 1.4.

This commit also drops official support for Windows XP, since ANGLE
requires a non-XP toolset to build. It is still possible to build
SolveSpace for Windows XP using:

  cmake -T v120_xp -DOPENGL=1
2016-11-18 11:38:45 +00:00
whitequark d151eb56fc CMake: reject in-tree builds.
We do not support clobbering the source tree with build products,
nor recommend this in any documentation, and this already leads to
weird bugs with the resource system. Show an explicit error in this
case to avoid confusion.
2016-11-03 07:25:57 +00:00
whitequark fbe2705ebe CMake: disable unsigned overflow sanitizer check.
This seems too aggressive for us; it breaks the hash function and
I would prefer to not add tool-specific exclusions in the code.
2016-08-07 19:27:58 +00:00
whitequark 068ed2816a CMake: fix typo. 2016-08-07 17:33:27 +00:00
whitequark a2a50927e9 CMake: make code coverage work with Clang.
Clang uses a slightly different .gcno/.gcda format than GCC, and
it is necessary to point lcov to `llvm-cov gcov` instead of `gcov`.
2016-08-01 05:39:18 +00:00