The Wayback Machine - https://web.archive.org/web/20230904083851/https://github.com/rwengine/openrw/commit/c73e5d514d1a1e9a4adc98ae83bfdb4fc00f03f1
Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
cmake+ci: install pdb's + enable on ci
  • Loading branch information
madebr committed Sep 15, 2018
1 parent fdaaef3 commit c73e5d5
Show file tree
Hide file tree
Showing 10 changed files with 53 additions and 48 deletions.
4 changes: 1 addition & 3 deletions .appveyor.yml
Expand Up @@ -17,12 +17,10 @@ environment:
USE_CONAN: 1

platform:
# - Win32
- x64

configuration:
# - Debug
- Release
- RelWithDebInfo

matrix:
fast_finish: false
Expand Down
22 changes: 11 additions & 11 deletions cmake/ctest/build.ctest
Expand Up @@ -6,7 +6,7 @@

set(_ARGS_BOOL
USE_CONAN
DEBUG
BUILD_TYPE
CHECK_IWYU
BUILD_TOOLS
BUILD_VIEWER
Expand Down Expand Up @@ -67,6 +67,12 @@ endif()
message(STATUS "Starting test...")
ctest_start("${MODEL_NAME}" ${_CTEST_START_EXTRA_ARGS})

set(ALL_BUILD_TYPES Release Debug MinSizeRel RelWithDebInfo)
list(FIND ALL_BUILD_TYPES "${BUILD_TYPE}" BUILD_TYPE_INDEX)
if(BUILD_TYPE_INDEX EQUAL -1)
message(FATAL_ERROR "Unknown build type '${BUILD_TYPE}'")
endif()

if(USE_CONAN)
find_program(CONAN_BIN
NAMES conan
Expand Down Expand Up @@ -109,7 +115,7 @@ if(USE_CONAN)
endif()
endif()

if(DEBUG)
if(BUILD_TYPE STREQUAL "Debug")
set(CONAN_CONFIGURATION "Debug")
else()
set(CONAN_CONFIGURATION "Release")
Expand Down Expand Up @@ -149,15 +155,9 @@ if(USE_CONAN)
endif()

# CTEST_CONFIGURATION_TYPE is needed on Windows (no leading underscore)
if(DEBUG)
set(_CMAKE_BUILD_TYPE "Debug")
set(_CTEST_BUILD_CONFIGURATION "Debug")
set(CTEST_CONFIGURATION_TYPE "Debug")
else()
set(_CMAKE_BUILD_TYPE "Release")
set(_CTEST_BUILD_CONFIGURATION "Release")
set(CTEST_CONFIGURATION_TYPE "Release")
endif()
set(_CMAKE_BUILD_TYPE "${BUILD_TYPE}")
set(_CTEST_BUILD_CONFIGURATION "${BUILD_TYPE}")
set(CTEST_CONFIGURATION_TYPE "${BUILD_TYPE}")

set(_CONFIGURE_OPTIONS
"-DBUILD_TOOLS=${BUILD_TOOLS}"
Expand Down
6 changes: 3 additions & 3 deletions cmake/ctest/configure_darwin.ctest
@@ -1,8 +1,8 @@
set(CMAKE_GENERATOR "Xcode")
if(ENV{DEBUG})
set(DEBUG "$ENV{DEBUG}")
if($ENV{DEBUG})
set(BUILD_TYPE "Debug")
else()
set(DEBUG FALSE)
set(BUILD_TYPE "Release")
endif()
set(CONFIGURE_EXTRA_OPTIONS ";")
set(BUILD_EXTRA_FLAGS "")
Expand Down
4 changes: 2 additions & 2 deletions cmake/ctest/configure_linux.ctest
@@ -1,8 +1,8 @@
set(CMAKE_GENERATOR "Unix Makefiles")
if($ENV{DEBUG})
set(DEBUG "$ENV{DEBUG}")
set(BUILD_TYPE "Debug")
else()
set(DEBUG FALSE)
set(BUILD_TYPE "Release")
endif()
set(CONFIGURE_EXTRA_OPTIONS ";")
include(ProcessorCount)
Expand Down
8 changes: 1 addition & 7 deletions cmake/ctest/configure_windows.ctest
Expand Up @@ -25,13 +25,7 @@ endif()
set(CONFIGURE_EXTRA_OPTIONS ";")
set(BUILD_EXTRA_FLAGS "")

if(CONFIGURATION STREQUAL "Debug")
set(DEBUG TRUE)
elseif(CONFIGURATION STREQUAL "Release")
set(DEBUG FALSE)
else()
message(FATAL_ERROR "Unknown configuration '${CONFIGURATION}'")
endif()
set(BUILD_TYPE "${CONFIGURATION}")

set(CONAN_ARCH "x86_64")

Expand Down
29 changes: 22 additions & 7 deletions cmake_configure.cmake
Expand Up @@ -181,21 +181,19 @@ foreach(SAN ${ENABLE_SANITIZERS})
endif()
endforeach()

include(CMakeParseArguments)

function(openrw_target_apply_options)
set(IWYU_MAPPING "${PROJECT_SOURCE_DIR}/openrw_iwyu.imp")
cmake_parse_arguments("OPENRW_APPLY" "" "TARGET" "" ${ARGN})
cmake_parse_arguments("ORW" "INSTALL;INSTALL_PDB" "TARGET" "" ${ARGN})
if(CHECK_IWYU)
iwyu_check(TARGET "${OPENRW_APPLY_TARGET}"
iwyu_check(TARGET "${ORW_TARGET}"
EXTRA_OPTS
"--mapping_file=${IWYU_MAPPING}"
)
endif()

if(CHECK_CLANGTIDY)
clang_tidy_check_target(
TARGET "${OPENRW_APPLY_TARGET}"
TARGET "${ORW_TARGET}"
FORMAT_STYLE "file"
FIX "${CHECK_CLANGTIDY_FIX}"
CHECK_ALL
Expand All @@ -204,15 +202,32 @@ function(openrw_target_apply_options)

if(CMAKE_CXX_COMPILER_ID STREQUAL "AppleClang")
set_property(
TARGET "${OPENRW_APPLY_TARGET}"
TARGET "${ORW_TARGET}"
APPEND
PROPERTY STATIC_LIBRARY_FLAGS "-no_warning_for_no_symbols"
)
elseif(CMAKE_CXX_COMPILER_ID STREQUAL "MSVC")
set_property(
TARGET "${OPENRW_APPLY_TARGET}"
TARGET "${ORW_TARGET}"
APPEND
PROPERTY LINK_FLAGS "/ignore:4099"
)
endif()

if(ORW_INSTALL)
install(
TARGETS "${ORW_TARGET}"
RUNTIME DESTINATION "${CMAKE_INSTALL_BINDIR}"
LIBRARY DESTINATION "${CMAKE_INSTALL_LIBDIR}"
ARCHIVE DESTINATION "${CMAKE_INSTALL_LIBDIR}"
)
endif()
if(ORW_INSTALL_PDB)
if(CMAKE_CXX_COMPILER_ID STREQUAL "MSVC")
install(FILES "$<$<OR:$<CONFIG:DEBUG>,$<CONFIG:RELWITHDEBINFO>>:$<TARGET_PDB_FILE:${ORW_TARGET}>>"
DESTINATION "${CMAKE_INSTALL_BINDIR}"
)
endif()
endif()

endfunction()
7 changes: 3 additions & 4 deletions rwgame/CMakeLists.txt
Expand Up @@ -61,8 +61,7 @@ target_link_libraries(rwgame
SDL2::SDL2
)

openrw_target_apply_options(TARGET rwgame)

install(TARGETS rwgame
RUNTIME DESTINATION "${CMAKE_INSTALL_BINDIR}"
openrw_target_apply_options(
TARGET rwgame
INSTALL INSTALL_PDB
)
5 changes: 3 additions & 2 deletions rwtools/rwfont/CMakeLists.txt
Expand Up @@ -11,6 +11,7 @@ target_link_libraries(rwfontmap
Qt5::Gui
)

install(TARGETS rwfontmap
RUNTIME DESTINATION "${CMAKE_INSTALL_BINDIR}"
openrw_target_apply_options(
TARGET rwfontmap
INSTALL INSTALL_PDB
)
7 changes: 3 additions & 4 deletions rwviewer/CMakeLists.txt
Expand Up @@ -54,10 +54,9 @@ target_link_libraries(rwviewer
Qt5::Widgets
)

openrw_target_apply_options(TARGET rwviewer)

install(TARGETS rwviewer
RUNTIME DESTINATION "${CMAKE_INSTALL_BINDIR}"
openrw_target_apply_options(
TARGET rwviewer
INSTALL INSTALL_PDB
)

if(USE_CONAN)
Expand Down
9 changes: 4 additions & 5 deletions tests/CMakeLists.txt
Expand Up @@ -76,7 +76,10 @@ target_link_libraries(rwtests
Boost::filesystem
)

openrw_target_apply_options(TARGET rwtests)
openrw_target_apply_options(
TARGET rwtests
INSTALL INSTALL_PDB
)

if(SEPARATE_TEST_SUITES)
foreach(TEST ${TESTS})
Expand All @@ -98,7 +101,3 @@ else()
TIMEOUT 300
)
endif()

install(TARGETS rwtests
RUNTIME DESTINATION "${CMAKE_INSTALL_BINDIR}"
)

0 comments on commit c73e5d5

Please sign in to comment.