1
0
mirror of synced 2024-11-28 01:20:51 +01:00
Commit Graph

53 Commits

Author SHA1 Message Date
xndcn
75e5dbaaa4
build: Fix incorrect name case in FindmbedTLS.cmake (#1817)
Corrected MBEDTLS_FIND_REQUIRED to mbedTLS_FIND_REQUIRED, since the
package name is "mbedTLS" for case sensitive environment
2024-07-21 20:34:23 +02:00
WerWolv
03d344c0a2 build: Streamline definition on plugin features 2024-07-08 18:12:46 +02:00
WerWolv
1f5e4ceb0c feat: Added basic support for lz4 decompression to the pattern language 2024-07-07 10:26:24 +02:00
WerWolv
4020ac9843 impr: Added nicer console warning when .NET runtime isn't installed 2024-07-02 23:15:54 +02:00
WerWolv
b94a4288bf fix: Standard magic file not getting bundled into executable correctly 2024-06-29 19:43:24 +02:00
WerWolv
2aef5e4eef build: Lock install path in rpath behind an option 2024-06-28 22:21:10 +02:00
WerWolv
5a10613dd2 build: Add lib folder to all plugin's RPATH 2024-06-25 23:17:15 +02:00
WerWolv
d7c5c84110 build: Don't link plugins with plugin test library except in the test CI 2024-06-25 21:54:48 +02:00
David Mentler
bdaf1e4151
build: Xcode accomodating CMake setup (#1688)
### Problem description
This PR implements some rudimentary Xcode support for building and
editing ImHex.

### Implementation description

#### Problem 1: Xcode is a multi-configuration buildsystem
The project is already rather CMake generator independent, thus it did
not need to change much to support Xcode's multi-configuration paradigm:

By default, CMake generates a `.xcodeproj` in which targets build their
artifacts into the specified `<>_OUTPUT_DIRECTORY`, postfixed by the
currently active configuration. To better fit the existing paradigm, I
instead opted ot introduce `IMHEX_MAIN_OUTPUT_DIRECTORY`. This variable
is equal to the previously used `RUNTIME_OUTPUT_DIRECTORY` when using
other generators, and is changed to include a configuration specific
_prefix_ when used with Xcode.

The result is different output directories when using Xcode, and no
changes when using any other generator.

#### Problem 2: ImHex does not support AppleClang
To allow building the codebase with Xcode, I have introduced
`IMHEX_IDE_HELPERS_OVERRIDE_XCODE_COMPILER`. Specifying this option to
`ON` will force CMake to honor the user specified compiler settings,
even when using the Xcode generator.

In practice this can be used together with the new "xcode" CMakePreset
to build the project with mainline clang using `xcodebuild`, or Xcode
itself by generating a buildsystem like so:
```
cmake --preset xcode -DCMAKE_PREFIX_PATH=/opt/homebrew/opt/llvm@17
```

This solution is of course not without flaws. The inner workings are a
particularly ugly hack, and mainline clang does not implement the
necessary extensions to allow Xcode to index the code. Regardless this
option is useful to enable future work in terms of bundling/signing
macOS applications in the "intended" way using Xcode without additional
source modifications.

#### Problem 3: Vanilla CMake + Xcode = Bad developer UX 
By default, the CMake generated `.xcodeproj` is a mess. Tons of targets
are scattered about, and source files are not organized beyond grouping
them into a "Source Files" and "Header Files" group.

Even "Header Files" is missing, because the ImHex build system does not
regard private header files of libraries as sources of a target, and
Xcode does not try to guess this information.

The solution is twofold:
* Additional code has been added which organizes the targets into a neat
folder structure
* Additional code was added behind a configuration flag
`IMHEX_IDE_HELPERS_INTRUSIVE_IDE_TWEAKS` which automatically creates
source file trees in Xcode targets, and discovers the non-declared
header files via the folder convention.

### Screenshots
N/A

### Additional things

As a bonus: `IMHEX_OFFLINE_BUILD` assumes that ImHex-Patterns is cloned
into the source tree. I have added an additional fallback that tries to
locate it as a sibling folder of `${CMAKE_SOURCE_DIR}`, as this meshes
better with my filesystem setup.

The setup was tested with `CMake 3.29.2`, `Xcode 15.2`, and `llvm@17`
from homebrew.
2024-05-20 10:12:57 +00:00
WerWolv
1e91505e6e fix: .NET script loader not initializing correctly on macOS 2024-05-18 11:10:55 +02:00
WerWolv
567ccbfc3a build: Don't postprocess libimhex.dylib 2024-03-22 22:18:18 +01:00
WerWolv
0d58307e82 build: Fix bundling issues on macOS 2024-03-22 17:24:44 +01:00
iTrooz
0fb43ccc2b
fix: Use find_library() instead of find_file() to find system yara library (#1581)
Discord discussion:
https://discord.com/channels/789833418631675954/789840633414025246/1213564050848485427
2024-03-19 20:23:33 +01:00
WerWolv
deafb6fe08 build: Allow precompiled headers to be turned off 2024-03-02 11:51:33 +01:00
WerWolv
030aee17f5 build: Disable precompiled headers in plugins again 2024-03-02 10:57:51 +01:00
WerWolv
bb3de7d510 fix: Build with precompiled headers on Linux 2024-02-29 21:15:51 +01:00
WerWolv
dd62bee264 build: Added precompiled headers 2024-02-29 19:57:20 +01:00
iTrooz
47362559ef
tests: Add infrastructure for testing plugins (#1538)
This PR adds a test architecture to be able to test plugins

Main infrastructure done by @WerWolv

---------

Co-authored-by: WerWolv <werwolv98@gmail.com>
2024-02-26 20:51:08 +01:00
Nik
e475e763db
build: Hopefully fix macOS x86 build issues (#1556)
#1109
2024-02-17 21:01:57 +01:00
WerWolv
dfc249135f build: Make plugin RPATH on Linux point to the plugins folder 2024-02-07 21:51:59 +01:00
WerWolv
10f6aa3e4e fix: Default magic database not being bundled correctly 2024-01-30 21:19:43 +01:00
WerWolv
76e304c34e build: Fix various issues with linking, clang and unity builds 2024-01-29 22:57:39 +01:00
Nik
6ae86ce906
build: Get rid of pkgconfig as much as possible (#1517) 2024-01-26 12:13:22 +01:00
WerWolv
390c1469b1 build: Fix rpath issues on macOS 2024-01-24 22:30:40 +01:00
WerWolv
cc3a9f1e81 build: Fix finding .NET runtime when there's multiple installed versions 2024-01-22 14:59:23 +01:00
WerWolv
0097d1782e build: Fix external plugins not having a imhex version set 2024-01-04 12:01:40 +01:00
WerWolv
cd72ff1f84 build: Fix installing external plugins 2024-01-04 10:25:29 +01:00
Nik
950eaea8af
impr: Make decompression support actually useful (#1481) 2023-12-31 11:39:24 +01:00
Nik
61bfe10bc2
refactor: Rework features that use external libraries into optional plugins (#1470) 2023-12-23 21:09:41 +01:00
Nik
84bfd10416
build: Restructured entire custom plugin system (#1469) 2023-12-22 23:39:38 +01:00
WerWolv
e370fdb0fc build: Add support for unity builds 2023-11-30 10:22:15 +01:00
WerWolv
71df45a347 build: Compile plugins as cmake module libraries instead of shared libraries 2023-11-23 23:01:11 +01:00
WerWolv
9e0b02f86e build: Update .NET version 2023-11-20 22:55:49 +01:00
WerWolv
a4e14497a5 build: Force set .NET library/include directory variables 2023-11-20 22:49:06 +01:00
WerWolv
de3e92e21b build: Use different method of enforcing nethost.h 2023-11-19 16:11:17 +01:00
WerWolv
981ae5067c build: Try force reconfiguring when nethost header isn't found 2023-11-19 12:03:17 +01:00
iTrooz
7405219fb8 build: Make ImHex buildable for MacOS arm64 (#1414) 2023-11-11 20:56:30 +01:00
WerWolv
c444ad9280 impr: Bundle default magic file with application 2023-10-29 19:43:45 +01:00
iTrooz
d15bd4771d
feat: Support for building ImHex for the web (#1328)
Co-authored-by: WerWolv <werwolv98@gmail.com>
Co-authored-by: AnnsAnn <git@annsann.eu>
2023-10-04 12:00:32 +02:00
Nik
a1dc979217
build: Fixed plugins not having their C++ version set correctly 2023-08-22 19:29:03 +02:00
WerWolv
f67e808d0b build: Add plugins to main dependency 2023-07-27 10:45:11 +02:00
WerWolv
e1d0a057ff build: Set plugin output directory correctly 2023-07-27 02:07:36 +02:00
WerWolv
94a02c4b6d build: Streamlined plugin creation process 2023-07-27 00:53:04 +02:00
Nik
5171bea0bf
feat: Added cross-platform .NET scripts support (#1185)
This PR intends to add support for .NET scripts that can extend ImHex's
functionality in a portable and cross-platform way.

---------

Co-authored-by: Justus Garbe <55301990+Nowilltolife@users.noreply.github.com>
2023-07-15 14:29:14 +02:00
Nik
48a57cd981
feat: Added stacktrace printing on crashes (#892)
* feat: Added simple stack trace output

* feat: Added backtrace wrapper

* build: Added libbacktrace include dirs to build

* build: Fixed libbacktrace variables

* build: More backtrace variable fixes

* build: Try to find backtrace include

* build: Get backtrace header from cmake script

* feat: Added backtrace support for execinfo

* feat: Added support for StackWalk on Windows
2023-01-17 21:38:56 +01:00
WerWolv
85823e8e5d build: Removed all usages of Python 2022-12-29 23:32:57 +01:00
WerWolv
e16be09f9a build: Allow ImHex to open any file types on macOS 2022-08-10 19:18:32 +02:00
WerWolv
d8219ad971
build: Cleaned up cmake build structure (#399)
* build: Cleanup build process, move main application to /main folder

* build: Try fixing MacOS bundling

* build: Fixed swapped parameters

* build: One imhex -> main too much

* build: Move resources to a better location

* build: Try to fix macos bundle creation

* build: More bundle fixes

* build: Fixed syntax

* build: Another try

* build: Added macos debugging stuff

* build: Fix bundle path

* build: Removed duplicated adding of Frameworks folder to rpath

* build: Removed debugging
2022-01-15 00:14:12 +01:00
Kuruyia
72ec6baf79
sys: Fix macOS compilation (as of 2dc1886) (#317)
* sys: Updated curl to latest version

* sys: Fix macOS compilation

* ui: Fix splash screen OpenGL init for macOS

* sys: Fix std::min compile errors

* git: Re-enabled macos workflow

* sys: Remove includes of the range library

* build: Find OpenGL using CMake

* sys/build: Fix bundled plugins on macOS

* build: Copy plugins to bundle when creating a bundle

* build: Fixup bundled plugins

* sys: Search for plugins in the bundle instead of in Application Support

* sys: Allow resources to be placed in multiple directories on macOS

* build: Output built plugins to the plugins/ directory when not creating a bundle on macOS

* sys: Fix Application Support paths on macOS

* sys: Define ftruncate64 on macOS

* sys: Fix absolute value computation for std::string::at on macOS

Co-authored-by: WerWolv <werwolv98@gmail.com>
2021-10-09 23:07:58 +02:00
Foster Brereton
ac53b4bcab
Add rpath to binary executable on macOS (#258)
* removing superfluous slash from paths

* Add a necessary rpath to the imhex binary

* add a little error handling to dlopen

* fall back on en-US if no language specified in prefs

* PR changes as per @WerWolv
2021-06-18 20:09:36 +02:00