Skip to content

Commit

Permalink
Fixed: Cross compilation with MinGW-12 under Linux
Browse files Browse the repository at this point in the history
  • Loading branch information
TheNicker committed Jun 26, 2024
1 parent b17ad23 commit a6216ea
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 2 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -384,3 +384,4 @@ MigrationBackup/
#Exteranls
/CMakeSettings.json
out/
/build*
11 changes: 11 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,17 @@ project(ImageCodec)
#Image Codec
set(CMAKE_CXX_STANDARD 20)

if (${CMAKE_SYSTEM_NAME} STREQUAL "Windows" AND ${CMAKE_HOST_SYSTEM_NAME} STREQUAL "Linux")
message("Cross compiling: Host: linux, Target: Windows")
set(CMAKE_FIND_ROOT_PATH /usr/x86_64-w64-mingw32)
set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY)
set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY)
set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM BOTH)
set(CMAKE_SYSTEM_PROCESSOR x86_64)
set(CMAKE_SYSTEM_VERSION 10)
endif()


include_directories(./ImageCodec/Include)
include_directories(./External/LLUtils/Include)

Expand Down
2 changes: 1 addition & 1 deletion Codecs/CodecJPG/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ add_library (${TargetName} ${sourceFiles} )
set(libjpeg-turboFolder ../../External/libjpeg-turbo)
#Enable ASM provided by NASM

if (${CMAKE_SYSTEM_NAME} MATCHES "Windows")
if (${CMAKE_SYSTEM_NAME} MATCHES "Windows" AND NOT ${CMAKE_HOST_SYSTEM_NAME} STREQUAL "Linux")
set(CMAKE_ASM_NASM_COMPILER ${CMAKE_CURRENT_SOURCE_DIR}/../../External/bintools/nasm-2.15.05/nasm.exe)
endif()
#set(ENV{ASM_NASM} ${CMAKE_CURRENT_SOURCE_DIR}/../../External/bintools/nasm-2.15.05/nasm.exe)
Expand Down
2 changes: 1 addition & 1 deletion External/libjpeg-turbo
Submodule libjpeg-turbo updated 1 files
+1 −1 CMakeLists.txt

0 comments on commit a6216ea

Please sign in to comment.