Skip to content

Commit

Permalink
Try fix
Browse files Browse the repository at this point in the history
  • Loading branch information
Stepanov Igor committed Jan 9, 2025
1 parent f491b70 commit ce8e021
Showing 1 changed file with 7 additions and 10 deletions.
17 changes: 7 additions & 10 deletions src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -25,24 +25,24 @@ endif()

if(CMAKE_SYSTEM_NAME STREQUAL "Windows")
find_package(vorbis REQUIRED)
if(MSVC)
add_library(luajit SHARED IMPORTED)
if(VCPKG_TARGET_TRIPLET MATCHES "static")
add_library(luajit STATIC IMPORTED)
set_target_properties(
luajit
PROPERTIES
IMPORTED_LOCATION
"$ENV{VCPKG_ROOT}/packages/luajit_${VCPKG_TARGET_TRIPLET}/bin/lua51.dll"
IMPORTED_IMPLIB
"$ENV{VCPKG_ROOT}/packages/luajit_${VCPKG_TARGET_TRIPLET}/lib/lua51.lib"
INTERFACE_INCLUDE_DIRECTORIES
"$ENV{VCPKG_ROOT}/packages/luajit_${VCPKG_TARGET_TRIPLET}/include/luajit"
"$ENV{VCPKG_ROOT}/packages/luajit_${VCPKG_TARGET_TRIPLET}/include/"
)
else()
add_library(luajit STATIC IMPORTED)
add_library(luajit SHARED IMPORTED)
set_target_properties(
luajit
PROPERTIES
IMPORTED_LOCATION
"$ENV{VCPKG_ROOT}/packages/luajit_${VCPKG_TARGET_TRIPLET}/bin/lua51.dll"
IMPORTED_IMPLIB
"$ENV{VCPKG_ROOT}/packages/luajit_${VCPKG_TARGET_TRIPLET}/lib/lua51.lib"
INTERFACE_INCLUDE_DIRECTORIES
"$ENV{VCPKG_ROOT}/packages/luajit_${VCPKG_TARGET_TRIPLET}/include/luajit"
Expand All @@ -61,10 +61,7 @@ else()
add_library(luajit::luajit ALIAS PkgConfig::luajit)
endif()

target_include_directories(
VoxelEngineSrc
PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}
PRIVATE ${LUAJIT_INCLUDE_DIR})
target_include_directories(VoxelEngineSrc PUBLIC ${CMAKE_CURRENT_SOURCE_DIR})

target_link_libraries(
VoxelEngineSrc
Expand Down

0 comments on commit ce8e021

Please sign in to comment.