Skip to content

Commit a4bf185

Browse files
committed
Fix compile on macOS
1 parent ff7e1e0 commit a4bf185

File tree

9 files changed

+44
-28
lines changed

9 files changed

+44
-28
lines changed

chapter-0/CMakeLists.txt

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,9 @@ target_include_directories(chapter_0 PUBLIC "${CMAKE_CURRENT_SOURCE_DIR}")
1313

1414
target_link_libraries(chapter_0 vkguide_shared vkbootstrap)
1515

16-
add_custom_command(TARGET chapter_0 POST_BUILD
17-
COMMAND ${CMAKE_COMMAND} -E copy $<TARGET_RUNTIME_DLLS:chapter_0> $<TARGET_FILE_DIR:chapter_0>
18-
COMMAND_EXPAND_LISTS
19-
)
16+
if (WIN32)
17+
add_custom_command(TARGET chapter_0 POST_BUILD
18+
COMMAND ${CMAKE_COMMAND} -E copy $<TARGET_RUNTIME_DLLS:chapter_0> $<TARGET_FILE_DIR:chapter_0>
19+
COMMAND_EXPAND_LISTS
20+
)
21+
endif()

chapter-1/CMakeLists.txt

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,9 @@ target_include_directories(chapter_1 PUBLIC "${CMAKE_CURRENT_SOURCE_DIR}")
1313

1414
target_link_libraries(chapter_1 vkguide_shared vkbootstrap)
1515

16-
add_custom_command(TARGET chapter_1 POST_BUILD
17-
COMMAND ${CMAKE_COMMAND} -E copy $<TARGET_RUNTIME_DLLS:chapter_1> $<TARGET_FILE_DIR:chapter_1>
18-
COMMAND_EXPAND_LISTS
19-
)
16+
if (WIN32)
17+
add_custom_command(TARGET chapter_1 POST_BUILD
18+
COMMAND ${CMAKE_COMMAND} -E copy $<TARGET_RUNTIME_DLLS:chapter_1> $<TARGET_FILE_DIR:chapter_1>
19+
COMMAND_EXPAND_LISTS
20+
)
21+
endif()

chapter-2/CMakeLists.txt

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,9 @@ target_include_directories(chapter_2 PUBLIC "${CMAKE_CURRENT_SOURCE_DIR}")
1414

1515
target_link_libraries(chapter_2 vkguide_shared vkbootstrap imgui)
1616

17-
add_custom_command(TARGET chapter_2 POST_BUILD
18-
COMMAND ${CMAKE_COMMAND} -E copy $<TARGET_RUNTIME_DLLS:chapter_2> $<TARGET_FILE_DIR:chapter_2>
19-
COMMAND_EXPAND_LISTS
20-
)
17+
if (WIN32)
18+
add_custom_command(TARGET chapter_2 POST_BUILD
19+
COMMAND ${CMAKE_COMMAND} -E copy $<TARGET_RUNTIME_DLLS:chapter_2> $<TARGET_FILE_DIR:chapter_2>
20+
COMMAND_EXPAND_LISTS
21+
)
22+
endif()

chapter-3/CMakeLists.txt

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,9 @@ target_include_directories(chapter_3 PUBLIC "${CMAKE_CURRENT_SOURCE_DIR}")
1515

1616
target_link_libraries(chapter_3 vkguide_shared vkbootstrap imgui fastgltf::fastgltf)
1717

18-
add_custom_command(TARGET chapter_3 POST_BUILD
19-
COMMAND ${CMAKE_COMMAND} -E copy $<TARGET_RUNTIME_DLLS:chapter_3> $<TARGET_FILE_DIR:chapter_3>
20-
COMMAND_EXPAND_LISTS
21-
)
18+
if (WIN32)
19+
add_custom_command(TARGET chapter_3 POST_BUILD
20+
COMMAND ${CMAKE_COMMAND} -E copy $<TARGET_RUNTIME_DLLS:chapter_3> $<TARGET_FILE_DIR:chapter_3>
21+
COMMAND_EXPAND_LISTS
22+
)
23+
endif()

chapter-3/vk_engine.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
#include <array>
1212
#include <iostream>
1313
#include <fstream>
14+
#include <thread>
1415

1516
#include "imgui.h"
1617
#include "imgui_impl_sdl2.h"

chapter-4/CMakeLists.txt

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,9 @@ target_include_directories(chapter_4 PUBLIC "${CMAKE_CURRENT_SOURCE_DIR}")
1515

1616
target_link_libraries(chapter_4 vkguide_shared vkbootstrap imgui fastgltf::fastgltf)
1717

18-
add_custom_command(TARGET chapter_4 POST_BUILD
19-
COMMAND ${CMAKE_COMMAND} -E copy $<TARGET_RUNTIME_DLLS:chapter_4> $<TARGET_FILE_DIR:chapter_4>
20-
COMMAND_EXPAND_LISTS
21-
)
18+
if (WIN32)
19+
add_custom_command(TARGET chapter_4 POST_BUILD
20+
COMMAND ${CMAKE_COMMAND} -E copy $<TARGET_RUNTIME_DLLS:chapter_4> $<TARGET_FILE_DIR:chapter_4>
21+
COMMAND_EXPAND_LISTS
22+
)
23+
endif()

chapter-5/CMakeLists.txt

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,9 @@ target_include_directories(chapter_5 PUBLIC "${CMAKE_CURRENT_SOURCE_DIR}")
1717

1818
target_link_libraries(chapter_5 vkguide_shared vkbootstrap imgui fastgltf::fastgltf)
1919

20-
add_custom_command(TARGET chapter_5 POST_BUILD
21-
COMMAND ${CMAKE_COMMAND} -E copy $<TARGET_RUNTIME_DLLS:chapter_5> $<TARGET_FILE_DIR:chapter_5>
22-
COMMAND_EXPAND_LISTS
23-
)
20+
if (WIN32)
21+
add_custom_command(TARGET chapter_5 POST_BUILD
22+
COMMAND ${CMAKE_COMMAND} -E copy $<TARGET_RUNTIME_DLLS:chapter_5> $<TARGET_FILE_DIR:chapter_5>
23+
COMMAND_EXPAND_LISTS
24+
)
25+
endif()

meshbaker/CMakeLists.txt

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,9 @@ target_include_directories(meshbaker PUBLIC "${CMAKE_CURRENT_SOURCE_DIR}")
1313

1414
target_link_libraries(meshbaker vkguide_shared vkbootstrap imgui fastgltf::fastgltf)
1515

16-
add_custom_command(TARGET meshbaker POST_BUILD
17-
COMMAND ${CMAKE_COMMAND} -E copy $<TARGET_RUNTIME_DLLS:meshbaker> $<TARGET_FILE_DIR:meshbaker>
18-
COMMAND_EXPAND_LISTS
19-
)
16+
if (WIN32)
17+
add_custom_command(TARGET meshbaker POST_BUILD
18+
COMMAND ${CMAKE_COMMAND} -E copy $<TARGET_RUNTIME_DLLS:meshbaker> $<TARGET_FILE_DIR:meshbaker>
19+
COMMAND_EXPAND_LISTS
20+
)
21+
endif()

third_party/CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ add_library(imgui STATIC)
3535

3636
target_include_directories(imgui PUBLIC imgui)
3737

38+
target_compile_features(imgui PRIVATE cxx_std_17)
3839
target_sources(imgui PRIVATE
3940
imgui/imgui.h
4041
imgui/imgui.cpp

0 commit comments

Comments
 (0)