shithub: choc

Download patch

ref: 85e824153a6956f2aab67a395a4826dc50760e33
parent: 5b3b1bbab6c49148b9309d0a9de0ef33e1a63513
author: Max Waine <[email protected]>
date: Sun Dec 30 19:57:50 EST 2018

Fix src/win32 being always included in CMake


--- a/src/CMakeLists.txt
+++ b/src/CMakeLists.txt
@@ -95,9 +95,14 @@
     w_merge.c           w_merge.h
     z_zone.c            z_zone.h)
 
+set(GAME_INCLUDE_DIRS "${CMAKE_CURRENT_BINARY_DIR}/../")
+
 if(MSVC)
     list(APPEND GAME_SOURCE_FILES
          "../win32/win_opendir.c" "../win32/win_opendir.h")
+
+    list(APPEND GAME_INCLUDE_DIRS
+         "${PROJECT_SOURCE_DIR}/win32/")
 endif()
 
 set(DEHACKED_SOURCE_FILES
@@ -126,8 +131,7 @@
     add_executable("${PROGRAM_PREFIX}doom" ${SOURCE_FILES_WITH_DEH})
 endif()
 
-target_include_directories("${PROGRAM_PREFIX}doom"
-                           PRIVATE "${CMAKE_CURRENT_BINARY_DIR}/../" "${PROJECT_SOURCE_DIR}/win32/")
+target_include_directories("${PROGRAM_PREFIX}doom" PRIVATE ${GAME_INCLUDE_DIRS})
 target_link_libraries("${PROGRAM_PREFIX}doom" doom ${EXTRA_LIBS})
 
 if(MSVC)
@@ -141,8 +145,7 @@
     add_executable("${PROGRAM_PREFIX}heretic" ${SOURCE_FILES_WITH_DEH})
 endif()
 
-target_include_directories("${PROGRAM_PREFIX}heretic"
-                           PRIVATE "${CMAKE_CURRENT_BINARY_DIR}/../" "${PROJECT_SOURCE_DIR}/win32/")
+target_include_directories("${PROGRAM_PREFIX}heretic" PRIVATE ${GAME_INCLUDE_DIRS})
 target_link_libraries("${PROGRAM_PREFIX}heretic" heretic ${EXTRA_LIBS})
 
 if(MSVC)
@@ -156,8 +159,7 @@
     add_executable("${PROGRAM_PREFIX}hexen" ${SOURCE_FILES})
 endif()
 
-target_include_directories("${PROGRAM_PREFIX}hexen"
-                           PRIVATE "${CMAKE_CURRENT_BINARY_DIR}/../" "${PROJECT_SOURCE_DIR}/win32/")
+target_include_directories("${PROGRAM_PREFIX}hexen" PRIVATE ${GAME_INCLUDE_DIRS})
 target_link_libraries("${PROGRAM_PREFIX}hexen" hexen ${EXTRA_LIBS})
 
 if(MSVC)
@@ -171,8 +173,7 @@
     add_executable("${PROGRAM_PREFIX}strife" ${SOURCE_FILES_WITH_DEH})
 endif()
 
-target_include_directories("${PROGRAM_PREFIX}strife"
-                           PRIVATE "${CMAKE_CURRENT_BINARY_DIR}/../" "${PROJECT_SOURCE_DIR}/win32/")
+target_include_directories("${PROGRAM_PREFIX}strife" PRIVATE ${GAME_INCLUDE_DIRS})
 target_link_libraries("${PROGRAM_PREFIX}strife" strife ${EXTRA_LIBS})
 
 if(MSVC)