Skip to content

Commit

Permalink
fix build
Browse files Browse the repository at this point in the history
  • Loading branch information
NaC-L committed May 22, 2024
1 parent 3e1af76 commit d2f5126
Show file tree
Hide file tree
Showing 3 changed files with 35 additions and 17 deletions.
15 changes: 12 additions & 3 deletions CMakeLists.txt

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

30 changes: 16 additions & 14 deletions cmake.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,25 +5,27 @@ cmkr-include = "cmake/cmkr.cmake"
[project]
name = "Mergen"

[conditions]
windows = "WIN32"

[variables]
CMAKE_MODULE_PATH = "cmake"
CMAKE_MODULE_PATH = "${CMAKE_CURRENT_SOURCE_DIR}/cmake"
CMAKE_CXX_FLAGS_DEBUG = "-O0 -gfull"

[find-package.LLVM]
[fetch-content.linux-pe]
git = "https://github.com/can1357/linux-pe"
tag = "be6d1f6"

[subdir.linux-pe]
[fetch-content.Zydis]
git = "https://github.com/zyantific/zydis"
tag = "v4.1.0"

[target.Zydis]
type = "static"
alias = "Zydis::Zydis"
sources = ["Zydis-4.1.0/Zydis/Zydis.c"]
headers = ["Zydis-4.1.0/Zydis/Zydis.h"]
include-directories = ["Zydis-4.1.0"]
private-include-directories = ["Zydis-4.1.0/Zydis"]
compile-definitions = ["ZYCORE_STATIC_BUILD", "ZYDIS_STATIC_BUILD"]
[find-package.LLVM-Wrapper]

[target.lifter]
type = "executable"
sources = ["lifter/*.cpp"]
sources = ["lifter/*.cpp","lifter/*.hpp"]
headers = ["lifter/*.h"]
link-libraries = ["Zydis::Zydis", "LLVM", "linux-pe"]
compile-features = ["cxx_std_20"]
link-libraries = ["Zydis", "LLVM-Wrapper", "linux-pe"]
windows.link-libraries = ["Zydis", "LLVM-Wrapper", "linux-pe", "Ws2_32"]
compile-features = ["cxx_std_20"]
7 changes: 7 additions & 0 deletions docs/BUILDING.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,3 +21,10 @@ docker build . -t mergen
```bash
docker run -it --rm mergen
```


## Building with Windows
If you have built llvm, this command should work.
```
cmake .. -DCMAKE_BUILD_TYPE=Release -DCMAKE_CXX_COMPILER="clang++" -DCMAKE_C_COMPILER="clang" -G "Ninja" -DLLVM_DIR="<path_to_llvm_dir>\build\lib\cmake\llvm" -DLLVM_INCLUDE_DIRS=<path_to_llvm_include_dirs> -DLLVM_LIBRARY_DIR=<path_to_llvm_library_dir>
```

0 comments on commit d2f5126

Please sign in to comment.