Skip to content

Commit

Permalink
fix(cmake): configuration generation fails when BUILD_TESTS is OFF (L…
Browse files Browse the repository at this point in the history
  • Loading branch information
MiroKaku authored and qiin2333 committed Dec 4, 2024
1 parent 8ea99e6 commit a5d08f2
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions cmake/targets/common.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -106,9 +106,15 @@ set_source_files_properties("${CMAKE_SOURCE_DIR}/third-party/ViGEmClient/src/ViG
string(TOUPPER "x${CMAKE_BUILD_TYPE}" BUILD_TYPE)
if("${BUILD_TYPE}" STREQUAL "XDEBUG")
if(WIN32)
set_source_files_properties("${CMAKE_SOURCE_DIR}/src/nvhttp.cpp"
DIRECTORY "${CMAKE_SOURCE_DIR}" "${CMAKE_SOURCE_DIR}/tests"
PROPERTIES COMPILE_FLAGS -O2)
if (NOT BUILD_TESTS)
set_source_files_properties("${CMAKE_SOURCE_DIR}/src/nvhttp.cpp"
DIRECTORY "${CMAKE_SOURCE_DIR}"
PROPERTIES COMPILE_FLAGS -O2)
else()
set_source_files_properties("${CMAKE_SOURCE_DIR}/src/nvhttp.cpp"
DIRECTORY "${CMAKE_SOURCE_DIR}" "${CMAKE_SOURCE_DIR}/tests"
PROPERTIES COMPILE_FLAGS -O2)
endif()
endif()
else()
add_definitions(-DNDEBUG)
Expand Down

0 comments on commit a5d08f2

Please sign in to comment.