mirror of
https://github.com/OrcaSlicer/OrcaSlicer.git
synced 2026-09-02 06:47:04 +00:00
clang-cl defines MSVC in CMake, but some guarded blocks apply flags or behavior that are specific to cl.exe and should not be passed to clang-cl. Exclude Clang from those MSVC-only branches so clang-cl follows the compatible compiler path instead of inheriting cl.exe-only settings.
21 lines
585 B
CMake
21 lines
585 B
CMake
cmake_minimum_required(VERSION 3.13)
|
|
|
|
project(miniz)
|
|
|
|
add_library(miniz INTERFACE)
|
|
|
|
add_library(miniz_static STATIC
|
|
miniz.c
|
|
miniz.h
|
|
)
|
|
|
|
if(${CMAKE_C_COMPILER_ID} STREQUAL "GNU")
|
|
target_compile_definitions(miniz_static PRIVATE _GNU_SOURCE)
|
|
elseif (CMAKE_C_COMPILER_ID STREQUAL "Clang" AND CMAKE_C_COMPILER_FRONTEND_VARIANT STREQUAL "MSVC")
|
|
target_compile_options(miniz_static PRIVATE /clang:-Wno-error=incompatible-pointer-types)
|
|
endif()
|
|
|
|
target_link_libraries(miniz INTERFACE miniz_static)
|
|
target_include_directories(miniz SYSTEM INTERFACE ${CMAKE_CURRENT_SOURCE_DIR})
|
|
|