-
-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathCMakeLists.txt
47 lines (35 loc) · 1.35 KB
/
CMakeLists.txt
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
cmake_minimum_required(VERSION 3.10)
project(rpc_wine)
# If your Wineprefix is in 64 bit, disable this (-D32BIT=OFF)
option(32BIT "Build rpc_wine as 32-bit library" ON)
set(CMAKE_CXX_STANDARD 17)
file(GLOB_RECURSE SRC src/*.cc src/*.hh)
# Wine compiler
#set(CMAKE_C_COMPILER "winegcc")
#set(CMAKE_CXX_COMPILER "wineg++")
#set(CMAKE_RC_COMPILER "wrc")
#set(CMAKE_AR "ar")
if (NOT 32BIT)
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ./bin64)
else()
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ./bin32)
endif()
if (NOT CMAKE_BUILD_TYPE)
message(WARNING "No build type has been selected, defaulting to Debug.")
set(CMAKE_BUILD_TYPE DEBUG)
endif()
set(CMAKE_CXX_FLAGS "-O3 -Wall -std=c++17") # -mno-cygwin
set(CMAKE_C_FLAGS_DEBUG "${CMAKE_CXX_FLAGS} -g3 -ggdb")
set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG}")
set(CMAKE_C_FLAGS_RELEASE "${CMAKE_CXX_FLAGS} -s")
set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE}")
find_package(RapidJSON)
include_directories(${RAPIDJSON_INCLUDE_DIRS})
#include_directories(.)
#add_definitions(discord-rpc.spec)
add_library(rpc_wine SHARED ${SRC})
target_link_libraries(rpc_wine pthread) # odbc32 ole32 oleaut32 winspool odbccp32 uuid
set_target_properties(rpc_wine PROPERTIES OUTPUT_NAME "discord-rpc" PREFIX "" SUFFIX ".dll.so")
if (32BIT)
set_target_properties(rpc_wine PROPERTIES COMPILE_FLAGS "-m32" LINK_FLAGS "-m32")
endif()