mirror of
https://github.com/smyalygames/checklist-tester.git
synced 2025-05-18 14:34:12 +02:00
build(plugin): fix compile options to compile as library
This commit is contained in:
parent
8341e86766
commit
fe52804365
@ -3,19 +3,25 @@ cmake_minimum_required(VERSION 3.27)
|
|||||||
project(XPL-Checklist-Connector CXX)
|
project(XPL-Checklist-Connector CXX)
|
||||||
|
|
||||||
set(CMAKE_CXX_STANDARD 17)
|
set(CMAKE_CXX_STANDARD 17)
|
||||||
|
set(CMAKE_BUILD_TYPE Release)
|
||||||
|
|
||||||
# Set compile options for XPLM
|
# Set compile options for XPLM
|
||||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DXPLM200=1 -DXPLM210=1 -DXPLM300=1 -DXPLM301=1 -DXPLM302=1 -DXPLM303=1 -DXPLM401=1 -fvisibility=hidden -shared -rdynamic -nodefaultlibs -undefined_warning -lGL -lGLU")
|
add_definitions(-DXPLM200=1 -DXPLM210=1 -DXPLM300=1 -DXPLM301=1 -DXPLM302=1 -DXPLM303=1 -DXPLM401=1)
|
||||||
|
|
||||||
# Set output directory in X-Plane plugin structure
|
set(GCC_COVERAGE_COMPILE_FLAGS "-fPIC -fvisibility=hidden")
|
||||||
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin/lin_x64)
|
set(GCC_COVERAGE_LINK_FLAGS "-m64 -static-libgcc -shared")
|
||||||
|
|
||||||
find_package(unofficial-x-plane CONFIG REQUIRED)
|
find_package(unofficial-x-plane CONFIG REQUIRED)
|
||||||
|
|
||||||
add_executable(XPL-Checklist-Connector main.cpp)
|
add_library(${PROJECT_NAME} SHARED main.cpp)
|
||||||
|
|
||||||
target_link_libraries(XPL-Checklist-Connector PRIVATE unofficial::x-plane::xplm unofficial::x-plane::xpwidgets unofficial::x-plane::xplm_cpp)
|
target_link_libraries(${PROJECT_NAME} PRIVATE unofficial::x-plane::xplm unofficial::x-plane::xpwidgets unofficial::x-plane::xplm_cpp)
|
||||||
|
|
||||||
# Rename compiled file to X-Plane conventions
|
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${GCC_COVERAGE_COMPILE_FLAGS}")
|
||||||
set_target_properties(XPL-Checklist-Connector PROPERTIES RUNTIME_OUTPUT_NAME "lin")
|
|
||||||
set_target_properties(XPL-Checklist-Connector PROPERTIES SUFFIX ".xpl")
|
set_target_properties(${PROJECT_NAME} PROPERTIES
|
||||||
|
LIBRARY_OUTPUT_DIRECTORY ${CMAKE_SOURCE_DIR}/build/${PROJECT_NAME}/lin_x64
|
||||||
|
PREFIX ""
|
||||||
|
SUFFIX ".xpl"
|
||||||
|
LINK_FLAGS ${GCC_COVERAGE_LINK_FLAGS}
|
||||||
|
)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user