diff options
author | Stanisław Halik <sthalik@misaki.pl> | 2017-05-14 16:22:09 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-05-14 16:22:09 +0200 |
commit | 5c23666b58bb1dd4aea15c0d62a2f716d5be7f52 (patch) | |
tree | e6497e9b55c073be209ec673ef05e62bf57a2c8f /cmake | |
parent | 4701dd3b0c8323a11cf7d5ad09c579a9864a41bd (diff) | |
parent | c392181211b245e74292424500265323c960c1aa (diff) |
Merge branch 'unstable' into unstable
Diffstat (limited to 'cmake')
-rw-r--r-- | cmake/msvc.cmake | 2 | ||||
-rw-r--r-- | cmake/opentrack-boilerplate.cmake | 17 | ||||
-rw-r--r-- | cmake/opentrack-platform.cmake | 1 | ||||
-rw-r--r-- | cmake/opentrack-policy.cmake | 32 | ||||
-rw-r--r-- | cmake/opentrack-qt.cmake | 6 | ||||
-rw-r--r-- | cmake/opentrack-version.cmake | 2 |
6 files changed, 26 insertions, 34 deletions
diff --git a/cmake/msvc.cmake b/cmake/msvc.cmake index bab3f3df..c0aee783 100644 --- a/cmake/msvc.cmake +++ b/cmake/msvc.cmake @@ -43,7 +43,7 @@ if(CMAKE_PROJECT_NAME STREQUAL "opentrack") set(cc "${cc} /GR- /arch:SSE2") endif() -set(silly "${warns_} /MT /Gm") +set(silly "${warns_} -MT -Gm -Zi") set(_CFLAGS "${silly}") set(_CXXFLAGS "${silly}") diff --git a/cmake/opentrack-boilerplate.cmake b/cmake/opentrack-boilerplate.cmake index 58f80573..3c5bd90a 100644 --- a/cmake/opentrack-boilerplate.cmake +++ b/cmake/opentrack-boilerplate.cmake @@ -75,7 +75,7 @@ endfunction() function(otr_compat target) if(NOT MSVC) - set_property(SOURCE ${${target}-moc} APPEND_STRING PROPERTY COMPILE_FLAGS "-w -Wno-error") + set_property(SOURCE ${${target}-moc} APPEND_STRING PROPERTY COMPILE_FLAGS " -w -Wno-error") endif() if(WIN32) target_link_libraries(${target} dinput8 dxguid strmiids) @@ -84,6 +84,8 @@ function(otr_compat target) set(c-props) set(l-props) + get_property(linker-lang TARGET ${target} PROPERTY LINKER_LANGUAGE) + if(CMAKE_COMPILER_IS_GNUCXX) set(c-props " -fvisibility=hidden") if(NOT is-c-only) @@ -95,8 +97,8 @@ function(otr_compat target) set(l-props "-Wl,--as-needed") endif() - set_property(TARGET ${target} APPEND_STRING PROPERTY COMPILE_FLAGS "${c-props} ${arg_COMPILE}") - set_property(TARGET ${target} APPEND_STRING PROPERTY LINK_FLAGS "${l-props} ${arg_LINK}") + set_property(TARGET ${target} APPEND_STRING PROPERTY COMPILE_FLAGS " ${c-props} ${arg_COMPILE}") + set_property(TARGET ${target} APPEND_STRING PROPERTY LINK_FLAGS " ${l-props} ${arg_LINK}") endfunction() include(CMakeParseArguments) @@ -126,11 +128,12 @@ endfunction() function(otr_module n_) message(STATUS "module ${n_}") cmake_parse_arguments(arg - "STATIC;NO-COMPAT;BIN;EXECUTABLE;NO-QT;WIN32-CONSOLE;NO-INSTALL" + "STATIC;NO-COMPAT;BIN;EXECUTABLE;NO-QT;WIN32-CONSOLE;NO-INSTALL;RELINK" "LINK;COMPILE" "SOURCES" ${ARGN} ) + if(NOT "${arg_UNPARSED_ARGUMENTS}" STREQUAL "") message(FATAL_ERROR "otr_module bad formals: ${arg_UNPARSED_ARGUMENTS}") endif() @@ -164,6 +167,12 @@ function(otr_module n_) add_library(${n} ${link-mode} "${${n}-all}") endif() + if(NOT arg_RELINK) + set_property(TARGET ${n} PROPERTY LINK_DEPENDS_NO_SHARED TRUE) + else() + set_property(TARGET ${n} PROPERTY LINK_DEPENDS_NO_SHARED FALSE) + endif() + if(NOT arg_NO-QT) target_link_libraries(${n} ${MY_QT_LIBS}) endif() diff --git a/cmake/opentrack-platform.cmake b/cmake/opentrack-platform.cmake index 5bb7581a..3e0319ac 100644 --- a/cmake/opentrack-platform.cmake +++ b/cmake/opentrack-platform.cmake @@ -43,6 +43,7 @@ endif() if(MSVC) add_definitions(-DNOMINMAX -D_CRT_SECURE_NO_WARNINGS) add_definitions(-D_ITERATOR_DEBUG_LEVEL=0 -D_HAS_ITERATOR_DEBUGGING=0 -D_SECURE_SCL=0) + add_definitions(-DHAS_EXCEPTIONS=0) set(CMAKE_CXX_FLAGS "-std:c++14 ${CMAKE_CXX_FLAGS}") if(SDK_INSTALL_DEBUG_INFO) set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Zi") diff --git a/cmake/opentrack-policy.cmake b/cmake/opentrack-policy.cmake index 2d88e218..7ded20f7 100644 --- a/cmake/opentrack-policy.cmake +++ b/cmake/opentrack-policy.cmake @@ -1,27 +1,5 @@ -if(POLICY CMP0020) - cmake_policy(SET CMP0020 NEW) -endif() - -if(POLICY CMP0058) - cmake_policy(SET CMP0058 NEW) -endif() - -if(POLICY CMP0028) - cmake_policy(SET CMP0028 NEW) -endif() - -if(POLICY CMP0042) - cmake_policy(SET CMP0042 NEW) -endif() - -if(POLICY CMP0063) - cmake_policy(SET CMP0063 NEW) -endif() - -if(POLICY CMP0053) - cmake_policy(SET CMP0053 OLD) -endif() - -if(POLICY CMP0011) - cmake_policy(SET CMP0011 NEW) -endif() +foreach(k CMP0020 CMP0058 CMP0028 CMP0042 CMP0063 CMP0053 CMP0011 CMP0054) + if(POLICY ${k}) + cmake_policy(SET ${k} NEW) + endif() +endforeach() diff --git a/cmake/opentrack-qt.cmake b/cmake/opentrack-qt.cmake index d6c8315b..21bc42e1 100644 --- a/cmake/opentrack-qt.cmake +++ b/cmake/opentrack-qt.cmake @@ -6,7 +6,11 @@ set(MY_QT_LIBS ${Qt5Core_LIBRARIES} ${Qt5Gui_LIBRARIES} ${Qt5Widgets_LIBRARIES} if(WIN32) foreach(i Qt5Core Qt5Gui Qt5Network Qt5SerialPort Qt5Widgets) - install(FILES "${Qt5_DIR}/../../../bin/${i}.dll" DESTINATION .) + set(path "${Qt5_DIR}/../../../bin/${i}") + install(FILES "${path}.dll" DESTINATION .) + if(EXISTS "${path}.pdb") + install(FILES "${path}.pdb" DESTINATION "${opentrack-hier-debug}") + endif() endforeach() install(FILES "${Qt5_DIR}/../../../plugins/platforms/qwindows.dll" DESTINATION "./platforms") endif() diff --git a/cmake/opentrack-version.cmake b/cmake/opentrack-version.cmake index 9cd597d3..00a5df1d 100644 --- a/cmake/opentrack-version.cmake +++ b/cmake/opentrack-version.cmake @@ -40,6 +40,6 @@ endif() add_library(opentrack-version STATIC ${CMAKE_BINARY_DIR}/version.c) if(NOT MSVC) - set_property(TARGET opentrack-version APPEND_STRING PROPERTY COMPILE_FLAGS "-fno-lto") + set_property(TARGET opentrack-version APPEND_STRING PROPERTY COMPILE_FLAGS " -fno-lto") endif() otr_compat(opentrack-version) |