CMakeLists.txt: try to fix issue with commit 278e04ebd6

This commit is contained in:
Gwenhael Goavec-Merou 2026-02-18 17:31:42 +01:00
parent 6e7cab7aa7
commit c8e5cbbdd4
1 changed files with 3 additions and 3 deletions

View File

@ -4,7 +4,6 @@ cmake_minimum_required(VERSION 3.10)
project(openFPGALoader VERSION "1.0.0" LANGUAGES CXX) project(openFPGALoader VERSION "1.0.0" LANGUAGES CXX)
add_definitions(-DVERSION=\"v${PROJECT_VERSION}\") add_definitions(-DVERSION=\"v${PROJECT_VERSION}\")
option(WINDOWS_CROSSCOMPILE "Enable cross-compile on windows" OFF)
#if(CMAKE_SYSTEM_NAME STREQUAL "Windows" AND NOT CMAKE_HOST_SYSTEM_NAME STREQUAL "Windows") #if(CMAKE_SYSTEM_NAME STREQUAL "Windows" AND NOT CMAKE_HOST_SYSTEM_NAME STREQUAL "Windows")
# set(WINDOWS_CROSSCOMPILE ON) # set(WINDOWS_CROSSCOMPILE ON)
#else() #else()
@ -19,7 +18,8 @@ option(ENABLE_OPTIM "Enable build with -O3 optimization level"
option(BUILD_STATIC "Whether or not to build with static libraries" OFF) option(BUILD_STATIC "Whether or not to build with static libraries" OFF)
option(USE_PKGCONFIG "Use pkgconfig to find libraries" ON) option(USE_PKGCONFIG "Use pkgconfig to find libraries" ON)
option(LINK_CMAKE_THREADS "Use CMake find_package to link the threading library" OFF) option(LINK_CMAKE_THREADS "Use CMake find_package to link the threading library" OFF)
option(WINDOWS_STATIC_ZLIB "Link zlib statically for Windows builds" ON) option(WINDOWS_CROSSCOMPILE "Enable cross-compile on windows" OFF)
option(WINDOWS_STATIC_ZLIB "Link zlib statically for Windows builds" ON)
if (${CMAKE_SYSTEM_NAME} MATCHES "Windows") if (${CMAKE_SYSTEM_NAME} MATCHES "Windows")
set(ENABLE_UDEV OFF) set(ENABLE_UDEV OFF)
@ -225,7 +225,7 @@ if (USE_PKGCONFIG)
endif() endif()
# zlib support (gzip) # zlib support (gzip)
if (${CMAKE_SYSTEM_NAME} MATCHES "Windows") if(WINDOWS_CROSSCOMPILE)
if (WINDOWS_STATIC_ZLIB) if (WINDOWS_STATIC_ZLIB)
set(ZLIB_USE_STATIC_LIBS ON) set(ZLIB_USE_STATIC_LIBS ON)
endif() endif()