Fixes cmake config break on CMake 3.11 and no nasm (#195)
This commit is contained in:
Родитель
36e7f8fb9d
Коммит
ff070018a7
|
@ -48,7 +48,8 @@ set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${PROJECT_BINARY_DIR}/bin)
|
|||
if ("${CMAKE_C_COMPILER_ID}" STREQUAL "MSVC")
|
||||
include(MSVCStaticCrt)
|
||||
include(MSVCLinkerFlags)
|
||||
add_compile_options("$<$<NOT:$<COMPILE_LANGUAGE:ASM_NASM>>:/ZH:SHA_256>") # Embed hash of source files
|
||||
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} /ZH:SHA_256")
|
||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /ZH:SHA_256")
|
||||
endif()
|
||||
|
||||
# Find all dependencies
|
||||
|
|
|
@ -15,7 +15,11 @@ if ("${CMAKE_C_COMPILER_ID}" STREQUAL "MSVC")
|
|||
string(REGEX REPLACE "/MDd" "" CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG}")
|
||||
|
||||
# Link against the static crt
|
||||
add_compile_options(
|
||||
"$<$<AND:$<NOT:$<COMPILE_LANGUAGE:ASM_NASM>>,$<CONFIG:Debug>>:/MTd>"
|
||||
"$<$<AND:$<NOT:$<COMPILE_LANGUAGE:ASM_NASM>>,$<NOT:$<CONFIG:Debug>>>:/MT>")
|
||||
if ("${CMAKE_BUILD_TYPE}" STREQUAL "Debug")
|
||||
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} /MTd")
|
||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /MTd")
|
||||
else()
|
||||
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} /MT")
|
||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /MT")
|
||||
endif()
|
||||
endif()
|
|
@ -1,6 +1,7 @@
|
|||
if (NOT TARGET turbojpeg)
|
||||
if ("${CMAKE_C_COMPILER_ID}" STREQUAL "MSVC")
|
||||
add_compile_options("$<$<NOT:$<COMPILE_LANGUAGE:ASM_NASM>>:-D_CRT_SECURE_NO_WARNINGS>")
|
||||
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} /D_CRT_SECURE_NO_WARNINGS")
|
||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /D_CRT_SECURE_NO_WARNINGS")
|
||||
endif()
|
||||
|
||||
set(ENABLE_STATIC ON CACHE BOOL "Force libjpeg to enable static lib" FORCE)
|
||||
|
|
Загрузка…
Ссылка в новой задаче