Skip to content

Commit

Permalink
fix(cmake): configuration generation fails when BUILD_TESTS is OFF (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
MiroKaku authored Nov 27, 2024
1 parent d5854ae commit 8d2e322
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 @@ -113,9 +113,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 8d2e322

Please sign in to comment.