Commit Graph

117 Commits (adb2768154da901e04a603dc22916d39438ab907)

Author SHA1 Message Date
Loïc Bartoletti 6b9e7b2eec CMake: Add FindCairo.cmake to fix build on FreeBSD 2022-10-18 13:24:44 -04:00
verylowfreq f7415048a5 Web: Emscripten port updated to current tools. Add saving of options in local storage. 2022-08-21 14:13:22 +03:00
whitequark 5ca6d04e02 Add a very experimental Emscripten port.
Web: Emscripten port updated to current tools. Add saving of options in local storage.

U  Web: Emscripten port updated to current tools. Add saving of options in local storage.
2022-08-21 13:36:50 +03:00
ruevs bc4244e099 Win32, MSVC: Enable Multi-processor Compilation (/MP) with Visual Studio
Makes compiling from the Visual Studio IDE much faster when using the
solution and projects generated by cmake.

For the externals I hijack the `disable_warnings` function.
2022-07-08 18:43:16 -05:00
ruevs d6e1b23006 Win32: Allow 32 bit SolveSpace to access up to 4GB of RAM.
Link 32 bit SolveSpace for Windows with /LARGEADDRESSAWARE which allows
it to access up to 3GB of RAM on a properly configured 32 bit Windows and
up to 4GB on 64 bit.

See: https://msdn.microsoft.com/en-us/library/aa366778
https://docs.microsoft.com/en-us/cpp/build/reference/largeaddressaware-handle-large-addresses
https://docs.microsoft.com/en-us/windows/win32/debug/pe-format#characteristics
https://docs.microsoft.com/en-us/previous-versions/windows/it-pro/windows-server-2003/cc786709
https://docs.microsoft.com/en-us/windows/win32/memory/4-gigabyte-tuning

Fixes: #1261
2022-06-30 07:43:37 -05:00
Ryan Pavlik ec1c2289e5 Eigen includes are needed in more places.
Also remove erroneous redundant extlib/eigen mentions.
2022-05-17 22:09:48 -05:00
Paul Kahler a4416a4cae
Update CMakeLists.txt 2022-05-12 13:51:21 -04:00
Paul Kahler 0c09d9df0c
Update CMakeLists.txt 2022-05-12 09:57:47 -04:00
EvilSpirit c0f075671b Eigen library integration into solver.
Co-authored-by: Ryan Pavlik <ryan.pavlik@collabora.com>
Co-authored-by: Koen Schmeets <hello@koenschmeets.nl>
2021-12-31 14:40:47 -05:00
Ryan Pavlik dca5ce607d Add Eigen to build. 2021-12-31 14:40:47 -05:00
Ryan Pavlik 974175dfbc Fix CMake warnings 2021-12-30 13:59:58 -05:00
Ryan Pavlik 006539b945 Clean up/simplify build 2021-12-30 13:59:58 -05:00
Tom Sutcliffe 645febfcd6 Set OSX minimum supported version 2021-08-15 12:28:46 -04:00
Koen Schmeets 2a56ba661e Fix debugging and profiling on macOS 2021-04-04 11:40:10 -04:00
Koen Schmeets 8105699d5e Add apple arm64 support 2021-04-04 11:40:10 -04:00
Koen Schmeets 222c80e4c1
Add OpenMP debug information to conf screen (#869)
* Add OpenMP debug information to conf screen

* Revert casing and whitespace in CMakeLists.txt

* Remove unnecessary comment src/CMakeLists.txt
2020-12-29 14:09:10 -05:00
ruevs 942bf3f354 Remove Q3DO export.
It was added in 3a3a2755b as a potential way to export colorful meshes
to Horizon EDA but ended up being supported only by SolveSpace. Since no
software can consume the exported q3do files the feature is superfluous.

See https://github.com/solvespace/solvespace/issues/795 for details.
2020-11-21 13:02:39 -05:00
Koen Schmeets 73bbbdef83 Travis: include libomp in macOS .app 2020-10-26 02:26:54 +01:00
Maximilian Federle 24720a0024 Revert "CMake: use sanitizer flags for internal targets only"
This reverts commit 68b1abf77f.

The warnings are valuable and shouldn't be cast aside.
As of 8f509f1, we special case macOS and don't set -fno-sanitize-recover
to allow CI to succeed.
In the future, this could be made stricter again by only suppressing
known bugs, which ideally should also be fixed or reported upstream.
2020-10-24 17:10:47 +02:00
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