-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathcmake.toml
59 lines (47 loc) · 1.71 KB
/
cmake.toml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
[cmake]
version = "3.15"
cmkr-include = "cmake/cmkr.cmake"
cpp-flags = ["-m32"] # this spams a bunch of warning when compiling using msvc, TODO: find a way to only do this with gcc
c-flags = ["-m32"]
[project]
name = "photon"
languages = ["C", "CXX"]
description = "Photon is a mod loader for Portal 2."
[variables]
PORTAL2_DIR = "D:/SteamLibrary/steamapps/common/Portal 2"
[options]
DYNOHOOK_BUILD_STATIC_RUNTIME = false
[target.lodepng]
type = "static"
alias = "lvandeve::lodepng"
sources = ["vendor/lodepng/lodepng.cpp"]
headers = ["vendor/lodepng/lodepng.h"]
msvc.compile-options = ["/MP"]
[target.photon]
type = "shared"
sources = ["src/**.cpp", "src/**.h"]
include-directories = ["src", "vendor", "vendor/DynoHook/include", "build/vendor/DynoHook/exports", "vendor/DynoHook/asmjit/src", "vendor/json/single_include"]
compile-features = ["cxx_std_20"]
compile-definitions = ["NOMINMAX"]
link-libraries = ["dynohook", "lvandeve::lodepng"]
msvc.compile-options = ["/MP"]
gcc.compile-options = ["-fPIC", "-fpermissive"]
gcc.compile-definitions = ["_GNU_SOURCE"]
cmake-before = """
add_subdirectory("vendor/DynoHook" EXCLUDE_FROM_ALL)
""" # cmkr doesnt allow for this option afaik
[target.example-mod]
type = "shared"
sources = ["example-mod/**.cpp", "example-mod/**.h"]
include-directories = ["example-mod", "src/sdk"]
compile-features = ["cxx_std_20"]
compile-definitions = ["NOMINMAX"]
msvc.compile-options = ["/MP"]
gcc.compile-options = ["-fPIC", "-fpermissive"]
gcc.compile-definitions = ["_GNU_SOURCE"]
[[install]]
targets = ["photon"]
destination = "${PORTAL2_DIR}"
[[install]]
targets = ["example-mod"]
destination = "${PORTAL2_DIR}/photon"