VC++ simu DLL compilation fixes

This commit is contained in:
Bertrand Songis
2016-03-12 18:31:27 +01:00
parent 8d1121dcc1
commit 958c51b374
4 changed files with 16 additions and 5 deletions
+10 -2
View File
@@ -4,7 +4,7 @@ endforeach()
set(SIMU_SRC ${SIMU_SRC} simpgmspace.cpp)
add_definitions(-DSIMU -g)
add_definitions(-DSIMU)
remove_definitions(-DCLI)
if(Qt5Widgets_FOUND)
@@ -19,6 +19,15 @@ if(Qt5Widgets_FOUND)
add_custom_target(opentx-simulator DEPENDS ${SIMULATOR_TARGET})
endif()
if(MSVC)
set(CMAKE_CXX_FLAGS "/EHsc /LD")
set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} /FORCE:MULTIPLE")
include_directories(${PROJECT_SOURCE_DIR}/winbuild C:/Programs/pthreads/Pre-built.2/include C:/Programs/msinttypes C:/Programs/dirent/include)
target_link_libraries(${SIMULATOR_TARGET} PRIVATE C:/Programs/pthreads/Pre-built.2/lib/pthreadVC2.lib)
else()
add_definitions(-g)
endif()
if(NOT WIN32)
add_executable(simu WIN32 ${SIMU_SRC} ../../simu.cpp)
add_dependencies(simu ${FIRMWARE_DEPENDENCIES})
@@ -48,4 +57,3 @@ if(APPLE)
endforeach()
add_custom_target(opentx-simulators-bundle DEPENDS ${SIMULATOR_BUNDLES})
endif(APPLE)