Skip to content

Commit

Permalink
dll maybe
Browse files Browse the repository at this point in the history
  • Loading branch information
JustDoom authored Mar 23, 2024
1 parent 3edddb9 commit 9fcff6f
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 15 deletions.
4 changes: 3 additions & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,9 @@ jobs:
uses: actions/upload-artifact@v2
with:
name: windows-executable
path: build/src/Debug/*.exe
path: |
build/src/Debug/*.exe
build/src/Debug/*.dll
# - name: Configure build environment for target architecture
# run: |
Expand Down
5 changes: 0 additions & 5 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,5 @@ project(8ChocChip
LANGUAGES CXX
VERSION 0.1)

# Set the path to the vcpkg toolchain file for Windows
if(WIN32)
set(CMAKE_TOOLCHAIN_FILE "C:/tools/vcpkg/scripts/buildsystems/vcpkg.cmake" CACHE STRING "Vcpkg toolchain file")
endif()

add_subdirectory(dependencies)
add_subdirectory(src)
19 changes: 10 additions & 9 deletions src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,14 @@ add_executable(8ChocChip main.cpp
Cpu.h)
target_link_libraries(8ChocChip PRIVATE sfml-graphics sfml-audio)

if (WIN32)
foreach (SFML_LIB ${SFML_LIBRARIES})
get_filename_component(SFML_LIB_DIR ${SFML_LIB} DIRECTORY)
file(GLOB SFML_DLLS "${SFML_LIB_DIR}/*.dll")
foreach (SFML_DLL ${SFML_DLLS})
add_custom_command(TARGET 8ChocChip POST_BUILD COMMAND
${CMAKE_COMMAND} -E copy_if_different ${SFML_DLL} $<TARGET_FILE_DIR:8ChocChip>)
endforeach()
endforeach()
# Copy DLLs needed for runtime on Windows
if(WIN32)
if (BUILD_SHARED_LIBS)
add_custom_command(TARGET 8ChocChip POST_BUILD
COMMAND ${CMAKE_COMMAND} -E copy_if_different
$<TARGET_FILE:sfml-graphics>
$<TARGET_FILE:sfml-window>
$<TARGET_FILE:sfml-system>
$<TARGET_FILE_DIR:8ChocChip>)
endif()
endif()

0 comments on commit 9fcff6f

Please sign in to comment.