summaryrefslogtreecommitdiffhomepage
path: root/proto-wine/CMakeLists.txt
diff options
context:
space:
mode:
authorStanislaw Halik <sthalik@misaki.pl>2018-12-12 16:16:36 +0100
committerStanislaw Halik <sthalik@misaki.pl>2018-12-12 17:28:24 +0100
commitc503daf6c6b99beb7d811c952fd52d763aa008ca (patch)
tree0a3a5181829c7b4d68a100696d7d66be94931607 /proto-wine/CMakeLists.txt
parentfe0bbcc24ae2d0916135a8f7553ee46c9b463b44 (diff)
proto/wine: fixes
- use SDK_WINE boolean - improve logic when building for X-Plane only - rename when building for X-Plane - conditionalize Wine-related stuff - move starting the wrapper to initialize() as it should be done - use more C++17 - update header usage
Diffstat (limited to 'proto-wine/CMakeLists.txt')
-rw-r--r--proto-wine/CMakeLists.txt20
1 files changed, 13 insertions, 7 deletions
diff --git a/proto-wine/CMakeLists.txt b/proto-wine/CMakeLists.txt
index 86559435..ec24ed5a 100644
--- a/proto-wine/CMakeLists.txt
+++ b/proto-wine/CMakeLists.txt
@@ -1,10 +1,16 @@
if(NOT WIN32)
- set(SDK_WINE_PREFIX "" CACHE PATH "Wine install prefix")
- set(SDK_WINE_NO_WRAPPER FALSE CACHE BOOL "disable Wine wrapper -- use Wine only for X-Plane")
- if(SDK_WINE_PREFIX)
+ set(SDK_WINE "" CACHE BOOL "Build for Wine")
+ set(no-wrapper FALSE)
+ if(NOT SDK_WINE AND SDK_XPLANE)
+ set(no-wrapper TRUE)
+ endif()
+ if(SDK_WINE OR no-wrapper)
+ if(no-wrapper)
+ add_definitions(-DOTR_WINE_NO_WRAPPER)
+ endif()
otr_module(proto-wine)
- target_link_libraries(opentrack-proto-wine opentrack-csv)
- if(NOT SDK_WINE_NO_WRAPPER)
+ if(NOT no-wrapper)
+ target_link_libraries(opentrack-proto-wine opentrack-csv)
set(my-rt -lrt)
if(APPLE)
set(my-rt)
@@ -14,11 +20,11 @@ if(NOT WIN32)
add_custom_command(
OUTPUT opentrack-wrapper-wine.exe.so
DEPENDS ${wine-deps}
- COMMAND ${SDK_WINE_PREFIX}/bin/wineg++ -g -DNOMINMAX -O2 -m32 -std=c++17 -fPIC -o
+ COMMAND wineg++ -g -DNOMINMAX -O2 -m32 -std=c++17 -fPIC -o
opentrack-wrapper-wine.exe -I "${CMAKE_SOURCE_DIR}" -I "${CMAKE_BINARY_DIR}"
${wine-deps}
${my-rt})
- add_custom_target(wine-wrapper ALL DEPENDS opentrack-wrapper-wine.exe.so)
+ add_custom_target(wine-wrapper DEPENDS opentrack-wrapper-wine.exe.so)
add_dependencies(opentrack-proto-wine wine-wrapper)
add_dependencies(wine-wrapper opentrack-compat)
install(FILES "${CMAKE_CURRENT_BINARY_DIR}/opentrack-wrapper-wine.exe.so" DESTINATION ${opentrack-hier-pfx})