diff --git a/cmake/macros/LinkHifiLibraries.cmake b/cmake/macros/LinkHifiLibraries.cmake index 70399bedb4..ed37256b10 100644 --- a/cmake/macros/LinkHifiLibraries.cmake +++ b/cmake/macros/LinkHifiLibraries.cmake @@ -21,7 +21,7 @@ macro(LINK_HIFI_LIBRARIES) include_directories("${HIFI_LIBRARY_DIR}/${HIFI_LIBRARY}/src") add_dependencies(${TARGET_NAME} ${HIFI_LIBRARY}) - + # link the actual library - it is static so don't bubble it up target_link_libraries(${TARGET_NAME} ${HIFI_LIBRARY}) diff --git a/cmake/macros/SetupHifiProject.cmake b/cmake/macros/SetupHifiProject.cmake index 79ca0122c9..77df280d1a 100644 --- a/cmake/macros/SetupHifiProject.cmake +++ b/cmake/macros/SetupHifiProject.cmake @@ -34,6 +34,13 @@ macro(SETUP_HIFI_PROJECT) # find these Qt modules and link them to our own target find_package(Qt5 COMPONENTS ${${TARGET_NAME}_DEPENDENCY_QT_MODULES} REQUIRED) + # disable /OPT:REF and /OPT:ICF for the Debug builds + # This will prevent the following linker warnings + # LINK : warning LNK4075: ignoring '/INCREMENTAL' due to '/OPT:ICF' specification + if (WIN32) + set_property(TARGET ${TARGET_NAME} APPEND_STRING PROPERTY LINK_FLAGS_DEBUG "/OPT:NOREF /OPT:NOICF") + endif() + foreach(QT_MODULE ${${TARGET_NAME}_DEPENDENCY_QT_MODULES}) target_link_libraries(${TARGET_NAME} Qt5::${QT_MODULE}) endforeach() diff --git a/interface/CMakeLists.txt b/interface/CMakeLists.txt index 3357b57858..67ce3f3df8 100644 --- a/interface/CMakeLists.txt +++ b/interface/CMakeLists.txt @@ -100,6 +100,13 @@ else() add_executable(${TARGET_NAME} ${INTERFACE_SRCS} ${QM}) endif() +# disable /OPT:REF and /OPT:ICF for the Debug builds +# This will prevent the following linker warnings +# LINK : warning LNK4075: ignoring '/INCREMENTAL' due to '/OPT:ICF' specification +if (WIN32) + set_property(TARGET ${TARGET_NAME} APPEND_STRING PROPERTY LINK_FLAGS_DEBUG "/OPT:NOREF /OPT:NOICF") +endif() + # link required hifi libraries link_hifi_libraries(shared octree environment gpu gl procedural model render recording fbx networking model-networking entities avatars