mirror of
https://github.com/GerbilSoft/rom-properties.git
synced 2025-06-19 12:05:43 -04:00

librpthreads: Was missing SetMSVCDebugPath and EXCLUDE_FROM_ALL. libunixcommon: Was missing "-fpic -fPIC". [librpbase] ConfReader: Make it public: Config.hpp(20,1): warning C4275: non dll-interface class 'LibRpBase::ConfReader' used as base for dll-interface class 'LibRpBase::Config' ================ RomData::supportedImageTypes_static(): Need to mark RP_LIBROMDATA_PUBLIC in RomData_decl.hpp, not just the definition in each .cpp file. This worked on Linux, but on Windows, it causes an error: Amiibo.cpp(295,18): error C2375: 'LibRomData::Amiibo::supportedImageTypes_static': redefinition; different linkage Note that this will result in more exported symbols than is strictly necessary, but that shouldn't be too much of an issue. ================ Needed to change several libraries from STATIC to OBJECT in order to ensure that files aren't truncated from libromdata. TODO: Is it possible to remove "OBJECT"? It makes a mess in the compiler output, since it links to each .obj individually instead of the .lib files... ================ Need to define RP_BUILDING_FOR_DLL=1 for anything that links to libromdata in order to ensure it has the dllimport definitions set up correctly. This only seems to affect *some* symbols, not all of them... (notably AboutTabText and ComBase data symbols) [libwin32common] Moved IIDs from win_iid.c into IListView.hpp to avoid having to export these symbols from libromdata. ZLIB_LIBRARY -> ZLIB_LIBRARIES Removed ZLIB_LIBRARIES from the KDE4 and KF5 UI frontends, since they don't use zlib directly. ================ Link all tests to libromdata instead of individual static libraries. This reduces the size of the compiled test executables, at the expense of requiring libromdata to be built before the tests can be built. This is required because librptest is linked to libromdata in order to access librptexture to set the rp_image backend. TODO: Only set the rp_image backend in tests that need it instead of always setting it?
61 lines
2.7 KiB
CMake
61 lines
2.7 KiB
CMake
# Split debug information from an executable into a separate file.
|
|
# SPLIT_DEBUG_INFORMATION(EXE_TARGET)
|
|
#
|
|
# References:
|
|
# - http://cmake.3232098.n2.nabble.com/Save-stripped-debugging-information-td6819195.html
|
|
# - http://sourceware.org/bugzilla/show_bug.cgi?id=14527
|
|
# - If debug symbols are stripped before .gnu_debuglink is added,
|
|
# the section will be truncated to .gnu_deb, and hence won't
|
|
# be recognized by gdb.
|
|
# - FIXME: If the above .gnu_debuglink workaround is used, Windows XP
|
|
# and Windows 7 will claim that the executable isn't a valid Win32
|
|
# executable. (Wine ignores it and works fine!)
|
|
#
|
|
MACRO(SET_MSVC_DEBUG_PATH _target)
|
|
IF(MSVC)
|
|
# CMake seems to use weird settings for the PDB file.
|
|
# (at least version 2.8.12.2; 3.0.0 might be different)
|
|
STRING(REGEX REPLACE
|
|
"/Fd<OBJECT_DIR>/"
|
|
"/Fd<TARGET_PDB>"
|
|
CMAKE_C_COMPILE_OBJECT "${CMAKE_C_COMPILE_OBJECT}")
|
|
STRING(REGEX REPLACE
|
|
"/Fd<OBJECT_DIR>/"
|
|
"/Fd<TARGET_PDB>"
|
|
CMAKE_CXX_COMPILE_OBJECT "${CMAKE_CXX_COMPILE_OBJECT}")
|
|
|
|
# Handle target prefixes if not overridden.
|
|
# NOTE: Cannot easily use the TYPE property in a generator expression...
|
|
GET_PROPERTY(TARGET_TYPE TARGET ${_target} PROPERTY TYPE)
|
|
SET(PREFIX_EXPR_1 "$<$<STREQUAL:$<TARGET_PROPERTY:${_target},PREFIX>,>:${CMAKE_${TARGET_TYPE}_PREFIX}>")
|
|
SET(PREFIX_EXPR_2 "$<$<NOT:$<STREQUAL:$<TARGET_PROPERTY:${_target},PREFIX>,>>:$<TARGET_PROPERTY:${_target},PREFIX>>")
|
|
SET(PREFIX_EXPR_FULL "${PREFIX_EXPR_1}${PREFIX_EXPR_2}")
|
|
|
|
# If a custom OUTPUT_NAME was specified, use it.
|
|
SET(OUTPUT_NAME_EXPR_1 "$<$<STREQUAL:$<TARGET_PROPERTY:${_target},OUTPUT_NAME>,>:${_target}>")
|
|
SET(OUTPUT_NAME_EXPR_2 "$<$<NOT:$<STREQUAL:$<TARGET_PROPERTY:${_target},OUTPUT_NAME>,>>:$<TARGET_PROPERTY:${_target},OUTPUT_NAME>>")
|
|
SET(OUTPUT_NAME_EXPR "${OUTPUT_NAME_EXPR_1}${OUTPUT_NAME_EXPR_2}")
|
|
SET(OUTPUT_NAME_FULL "${PREFIX_EXPR_FULL}${OUTPUT_NAME_EXPR}$<TARGET_PROPERTY:${_target},POSTFIX>")
|
|
|
|
SET(OUTPUT_NAME_EXPR_1 "$<TARGET_PROPERTY:${_target},PREFIX>$<TARGET_PROPERTY:${_target},OUTPUT_NAME>$<TARGET_PROPERTY:${_target},POSTFIX>")
|
|
SET(OUTPUT_NAME_EXPR_2 "$<$<STREQUAL:$<TARGET_PROPERTY:${_target},OUTPUT_NAME>,>:$<TARGET_PROPERTY:${_target},PREFIX>${_target}$<TARGET_PROPERTY:${_target},POSTFIX>>")
|
|
|
|
# FIXME: "-dll" suffix seems to be missing here.
|
|
# If it's present in the target name, add it here.
|
|
IF(${_target} MATCHES "-dll$")
|
|
SET(_target_suffix "-dll")
|
|
ELSE()
|
|
UNSET(_target_suffix)
|
|
ENDIF()
|
|
|
|
# Set the target PDB filename.
|
|
SET_TARGET_PROPERTIES(${_target}
|
|
PROPERTIES PDB "$<TARGET_FILE_DIR:${_target}>/${OUTPUT_NAME_EXPR_1}${OUTPUT_NAME_EXPR_2}${_target_suffix}.pdb"
|
|
)
|
|
|
|
UNSET(OUTPUT_NAME_EXPR_1)
|
|
UNSET(OUTPUT_NAME_EXPR_2)
|
|
UNSET(_target_suffix)
|
|
ENDIF(MSVC)
|
|
ENDMACRO(SET_MSVC_DEBUG_PATH)
|