Skip to content
This repository has been archived by the owner on Nov 20, 2024. It is now read-only.

Commit

Permalink
Minor cmake code review
Browse files Browse the repository at this point in the history
  • Loading branch information
walbourn committed Dec 10, 2022
1 parent 2f2d0f5 commit ba3978c
Show file tree
Hide file tree
Showing 21 changed files with 98 additions and 77 deletions.
19 changes: 10 additions & 9 deletions BasicCompute11/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ set(CMAKE_RUNTIME_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/bin/CMake")

set(CMAKE_MAP_IMPORTED_CONFIG_RELWITHDEBINFO Release)

if (DEFINED VCPKG_TARGET_ARCHITECTURE)
if(DEFINED VCPKG_TARGET_ARCHITECTURE)
set(DIRECTX_ARCH ${VCPKG_TARGET_ARCHITECTURE})
elseif(CMAKE_GENERATOR_PLATFORM MATCHES "^[Ww][Ii][Nn]32$")
set(DIRECTX_ARCH x86)
Expand Down Expand Up @@ -48,10 +48,12 @@ if(MSVC)
target_compile_options(${PROJECT_NAME} PRIVATE "$<$<NOT:$<CONFIG:DEBUG>>:/guard:ehcont>")
target_link_options(${PROJECT_NAME} PRIVATE "$<$<NOT:$<CONFIG:DEBUG>>:/guard:ehcont>")
endif()
else()
target_compile_definitions(${PROJECT_NAME} PRIVATE $<IF:$<CONFIG:DEBUG>,_DEBUG,NDEBUG>)
endif()

if(NOT ${DIRECTX_ARCH} MATCHES "^arm")
if (${CMAKE_SIZEOF_VOID_P} EQUAL "4")
if(${CMAKE_SIZEOF_VOID_P} EQUAL "4")
set(ARCH_SSE2 $<$<CXX_COMPILER_ID:MSVC>:/arch:SSE2> $<$<NOT:$<CXX_COMPILER_ID:MSVC>>:-msse2>)
else()
set(ARCH_SSE2 $<$<NOT:$<CXX_COMPILER_ID:MSVC>>:-msse2>)
Expand All @@ -60,35 +62,34 @@ if(NOT ${DIRECTX_ARCH} MATCHES "^arm")
target_compile_options(${PROJECT_NAME} PRIVATE ${ARCH_SSE2})
endif()

if ( CMAKE_CXX_COMPILER_ID MATCHES "Clang" )
if( CMAKE_CXX_COMPILER_ID MATCHES "Clang" )
target_compile_options(${PROJECT_NAME} PRIVATE
-Wpedantic -Wextra
"-Wno-c++98-compat" "-Wno-c++98-compat-pedantic"
"-Wno-exit-time-destructors" "-Wno-global-constructors" "-Wno-language-extension-token"
"-Wno-missing-prototypes" "-Wno-missing-variable-declarations" "-Wno-reserved-id-macro"
"-Wno-extra-semi-stmt" "-Wno-float-equal")
elseif(MINGW)
target_compile_definitions(${PROJECT_NAME} PRIVATE $<IF:$<CONFIG:DEBUG>,_DEBUG,NDEBUG>)
target_compile_options(${PROJECT_NAME} PRIVATE -Wno-ignored-attributes)
target_link_options(${PROJECT_NAME} PRIVATE -municode)
elseif ( CMAKE_CXX_COMPILER_ID MATCHES "MSVC" )
elseif( CMAKE_CXX_COMPILER_ID MATCHES "MSVC" )
target_compile_options(${PROJECT_NAME} PRIVATE
/sdl /permissive- /Zc:__cplusplus
"/wd4061" "/wd4365" "/wd4514" "/wd4571" "/wd4668" "/wd4710" "/wd4820" "/wd5039" "/wd5045")

if (CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL 19.24)
if(CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL 19.24)
target_compile_options(${PROJECT_NAME} PRIVATE /ZH:SHA_256)
endif()

if (CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL 19.26)
if(CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL 19.26)
target_compile_options(${PROJECT_NAME} PRIVATE /Zc:preprocessor /wd5105)
endif()

if ((CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL 19.27) AND (NOT (${DIRECTX_ARCH} MATCHES "^arm")))
if((CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL 19.27) AND (NOT (${DIRECTX_ARCH} MATCHES "^arm")))
target_link_options(${PROJECT_NAME} PRIVATE /CETCOMPAT)
endif()

if (CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL 19.34)
if(CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL 19.34)
target_compile_options(${PROJECT_NAME} PRIVATE /wd5262 /wd5264)
endif()
endif()
Expand Down
19 changes: 10 additions & 9 deletions BasicHLSL11/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ set(CMAKE_RUNTIME_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/bin/CMake")

set(CMAKE_MAP_IMPORTED_CONFIG_RELWITHDEBINFO Release)

if (DEFINED VCPKG_TARGET_ARCHITECTURE)
if(DEFINED VCPKG_TARGET_ARCHITECTURE)
set(DIRECTX_ARCH ${VCPKG_TARGET_ARCHITECTURE})
elseif(CMAKE_GENERATOR_PLATFORM MATCHES "^[Ww][Ii][Nn]32$")
set(DIRECTX_ARCH x86)
Expand Down Expand Up @@ -56,10 +56,12 @@ if(MSVC)
target_compile_options(${PROJECT_NAME} PRIVATE "$<$<NOT:$<CONFIG:DEBUG>>:/guard:ehcont>")
target_link_options(${PROJECT_NAME} PRIVATE "$<$<NOT:$<CONFIG:DEBUG>>:/guard:ehcont>")
endif()
else()
target_compile_definitions(${PROJECT_NAME} PRIVATE $<IF:$<CONFIG:DEBUG>,_DEBUG,NDEBUG>)
endif()

if(NOT ${DIRECTX_ARCH} MATCHES "^arm")
if (${CMAKE_SIZEOF_VOID_P} EQUAL "4")
if(${CMAKE_SIZEOF_VOID_P} EQUAL "4")
set(ARCH_SSE2 $<$<CXX_COMPILER_ID:MSVC>:/arch:SSE2> $<$<NOT:$<CXX_COMPILER_ID:MSVC>>:-msse2>)
else()
set(ARCH_SSE2 $<$<NOT:$<CXX_COMPILER_ID:MSVC>>:-msse2>)
Expand All @@ -68,35 +70,34 @@ if(NOT ${DIRECTX_ARCH} MATCHES "^arm")
target_compile_options(${PROJECT_NAME} PRIVATE ${ARCH_SSE2})
endif()

if ( CMAKE_CXX_COMPILER_ID MATCHES "Clang" )
if( CMAKE_CXX_COMPILER_ID MATCHES "Clang" )
target_compile_options(${PROJECT_NAME} PRIVATE
-Wpedantic -Wextra
"-Wno-c++98-compat" "-Wno-c++98-compat-pedantic"
"-Wno-exit-time-destructors" "-Wno-global-constructors" "-Wno-language-extension-token"
"-Wno-missing-prototypes" "-Wno-missing-variable-declarations" "-Wno-reserved-id-macro"
"-Wno-extra-semi-stmt")
elseif(MINGW)
target_compile_definitions(${PROJECT_NAME} PRIVATE $<IF:$<CONFIG:DEBUG>,_DEBUG,NDEBUG>)
target_compile_options(${PROJECT_NAME} PRIVATE -Wno-ignored-attributes)
target_link_options(${PROJECT_NAME} PRIVATE -municode)
elseif ( CMAKE_CXX_COMPILER_ID MATCHES "MSVC" )
elseif( CMAKE_CXX_COMPILER_ID MATCHES "MSVC" )
target_compile_options(${PROJECT_NAME} PRIVATE
/sdl /permissive- /Zc:__cplusplus
"/wd4061" "/wd4365" "/wd4514" "/wd4571" "/wd4668" "/wd4710" "/wd4820" "/wd5039" "/wd5045")

if (CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL 19.24)
if(CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL 19.24)
target_compile_options(${PROJECT_NAME} PRIVATE /ZH:SHA_256)
endif()

if (CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL 19.26)
if(CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL 19.26)
target_compile_options(${PROJECT_NAME} PRIVATE /Zc:preprocessor /wd5105)
endif()

if ((CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL 19.27) AND (NOT (${DIRECTX_ARCH} MATCHES "^arm")))
if((CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL 19.27) AND (NOT (${DIRECTX_ARCH} MATCHES "^arm")))
target_link_options(${PROJECT_NAME} PRIVATE /CETCOMPAT)
endif()

if (CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL 19.34)
if(CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL 19.34)
target_compile_options(${PROJECT_NAME} PRIVATE /wd5262 /wd5264)
endif()
endif()
Expand Down
19 changes: 10 additions & 9 deletions BasicHLSLFX11/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ set(CMAKE_RUNTIME_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/bin/CMake")

set(CMAKE_MAP_IMPORTED_CONFIG_RELWITHDEBINFO Release)

if (DEFINED VCPKG_TARGET_ARCHITECTURE)
if(DEFINED VCPKG_TARGET_ARCHITECTURE)
set(DIRECTX_ARCH ${VCPKG_TARGET_ARCHITECTURE})
elseif(CMAKE_GENERATOR_PLATFORM MATCHES "^[Ww][Ii][Nn]32$")
set(DIRECTX_ARCH x86)
Expand Down Expand Up @@ -59,10 +59,12 @@ if(MSVC)
target_compile_options(${PROJECT_NAME} PRIVATE "$<$<NOT:$<CONFIG:DEBUG>>:/guard:ehcont>")
target_link_options(${PROJECT_NAME} PRIVATE "$<$<NOT:$<CONFIG:DEBUG>>:/guard:ehcont>")
endif()
else()
target_compile_definitions(${PROJECT_NAME} PRIVATE $<IF:$<CONFIG:DEBUG>,_DEBUG,NDEBUG>)
endif()

if(NOT ${DIRECTX_ARCH} MATCHES "^arm")
if (${CMAKE_SIZEOF_VOID_P} EQUAL "4")
if(${CMAKE_SIZEOF_VOID_P} EQUAL "4")
set(ARCH_SSE2 $<$<CXX_COMPILER_ID:MSVC>:/arch:SSE2> $<$<NOT:$<CXX_COMPILER_ID:MSVC>>:-msse2>)
else()
set(ARCH_SSE2 $<$<NOT:$<CXX_COMPILER_ID:MSVC>>:-msse2>)
Expand All @@ -71,35 +73,34 @@ if(NOT ${DIRECTX_ARCH} MATCHES "^arm")
target_compile_options(${PROJECT_NAME} PRIVATE ${ARCH_SSE2})
endif()

if ( CMAKE_CXX_COMPILER_ID MATCHES "Clang" )
if( CMAKE_CXX_COMPILER_ID MATCHES "Clang" )
target_compile_options(${PROJECT_NAME} PRIVATE
-Wpedantic -Wextra
"-Wno-c++98-compat" "-Wno-c++98-compat-pedantic"
"-Wno-exit-time-destructors" "-Wno-global-constructors" "-Wno-language-extension-token"
"-Wno-missing-prototypes" "-Wno-missing-variable-declarations" "-Wno-reserved-id-macro"
"-Wno-extra-semi-stmt" "-Wno-double-promotion")
elseif(MINGW)
target_compile_definitions(${PROJECT_NAME} PRIVATE $<IF:$<CONFIG:DEBUG>,_DEBUG,NDEBUG>)
target_compile_options(${PROJECT_NAME} PRIVATE -Wno-ignored-attributes)
target_link_options(${PROJECT_NAME} PRIVATE -municode)
elseif ( CMAKE_CXX_COMPILER_ID MATCHES "MSVC" )
elseif( CMAKE_CXX_COMPILER_ID MATCHES "MSVC" )
target_compile_options(${PROJECT_NAME} PRIVATE
/sdl /permissive- /Zc:__cplusplus
"/wd4061" "/wd4365" "/wd4514" "/wd4571" "/wd4668" "/wd4710" "/wd4820" "/wd5039" "/wd5045")

if (CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL 19.24)
if(CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL 19.24)
target_compile_options(${PROJECT_NAME} PRIVATE /ZH:SHA_256)
endif()

if (CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL 19.26)
if(CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL 19.26)
target_compile_options(${PROJECT_NAME} PRIVATE /Zc:preprocessor /wd5105)
endif()

if ((CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL 19.27) AND (NOT (${DIRECTX_ARCH} MATCHES "^arm")))
if((CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL 19.27) AND (NOT (${DIRECTX_ARCH} MATCHES "^arm")))
target_link_options(${PROJECT_NAME} PRIVATE /CETCOMPAT)
endif()

if (CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL 19.34)
if(CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL 19.34)
target_compile_options(${PROJECT_NAME} PRIVATE /wd5262 /wd5264)
endif()
endif()
Expand Down
19 changes: 10 additions & 9 deletions ComputeShaderSort11/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ set(CMAKE_RUNTIME_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/bin/CMake")

set(CMAKE_MAP_IMPORTED_CONFIG_RELWITHDEBINFO Release)

if (DEFINED VCPKG_TARGET_ARCHITECTURE)
if(DEFINED VCPKG_TARGET_ARCHITECTURE)
set(DIRECTX_ARCH ${VCPKG_TARGET_ARCHITECTURE})
elseif(CMAKE_GENERATOR_PLATFORM MATCHES "^[Ww][Ii][Nn]32$")
set(DIRECTX_ARCH x86)
Expand Down Expand Up @@ -48,10 +48,12 @@ if(MSVC)
target_compile_options(${PROJECT_NAME} PRIVATE "$<$<NOT:$<CONFIG:DEBUG>>:/guard:ehcont>")
target_link_options(${PROJECT_NAME} PRIVATE "$<$<NOT:$<CONFIG:DEBUG>>:/guard:ehcont>")
endif()
else()
target_compile_definitions(${PROJECT_NAME} PRIVATE $<IF:$<CONFIG:DEBUG>,_DEBUG,NDEBUG>)
endif()

if(NOT ${DIRECTX_ARCH} MATCHES "^arm")
if (${CMAKE_SIZEOF_VOID_P} EQUAL "4")
if(${CMAKE_SIZEOF_VOID_P} EQUAL "4")
set(ARCH_SSE2 $<$<CXX_COMPILER_ID:MSVC>:/arch:SSE2> $<$<NOT:$<CXX_COMPILER_ID:MSVC>>:-msse2>)
else()
set(ARCH_SSE2 $<$<NOT:$<CXX_COMPILER_ID:MSVC>>:-msse2>)
Expand All @@ -60,35 +62,34 @@ if(NOT ${DIRECTX_ARCH} MATCHES "^arm")
target_compile_options(${PROJECT_NAME} PRIVATE ${ARCH_SSE2})
endif()

if ( CMAKE_CXX_COMPILER_ID MATCHES "Clang" )
if( CMAKE_CXX_COMPILER_ID MATCHES "Clang" )
target_compile_options(${PROJECT_NAME} PRIVATE
-Wpedantic -Wextra
"-Wno-c++98-compat" "-Wno-c++98-compat-pedantic"
"-Wno-exit-time-destructors" "-Wno-global-constructors" "-Wno-language-extension-token"
"-Wno-missing-prototypes" "-Wno-missing-variable-declarations" "-Wno-reserved-id-macro"
"-Wno-extra-semi-stmt" "-Wno-float-equal")
elseif(MINGW)
target_compile_definitions(${PROJECT_NAME} PRIVATE $<IF:$<CONFIG:DEBUG>,_DEBUG,NDEBUG>)
target_compile_options(${PROJECT_NAME} PRIVATE -Wno-ignored-attributes)
target_link_options(${PROJECT_NAME} PRIVATE -municode)
elseif ( CMAKE_CXX_COMPILER_ID MATCHES "MSVC" )
elseif( CMAKE_CXX_COMPILER_ID MATCHES "MSVC" )
target_compile_options(${PROJECT_NAME} PRIVATE
/sdl /permissive- /Zc:__cplusplus
"/wd4061" "/wd4365" "/wd4514" "/wd4571" "/wd4668" "/wd4710" "/wd4820" "/wd5039" "/wd5045")

if (CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL 19.24)
if(CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL 19.24)
target_compile_options(${PROJECT_NAME} PRIVATE /ZH:SHA_256)
endif()

if (CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL 19.26)
if(CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL 19.26)
target_compile_options(${PROJECT_NAME} PRIVATE /Zc:preprocessor /wd5105)
endif()

if ((CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL 19.27) AND (NOT (${DIRECTX_ARCH} MATCHES "^arm")))
if((CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL 19.27) AND (NOT (${DIRECTX_ARCH} MATCHES "^arm")))
target_link_options(${PROJECT_NAME} PRIVATE /CETCOMPAT)
endif()

if (CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL 19.34)
if(CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL 19.34)
target_compile_options(${PROJECT_NAME} PRIVATE /wd5262 /wd5264)
endif()
endif()
Expand Down
3 changes: 2 additions & 1 deletion Direct3D11Tutorials/Tutorial01/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,8 @@ if(MSVC)
target_compile_options(${PROJECT_NAME} PRIVATE "$<$<NOT:$<CONFIG:DEBUG>>:/guard:ehcont>")
target_link_options(${PROJECT_NAME} PRIVATE "$<$<NOT:$<CONFIG:DEBUG>>:/guard:ehcont>")
endif()
else()
target_compile_definitions(${PROJECT_NAME} PRIVATE $<IF:$<CONFIG:DEBUG>,_DEBUG,NDEBUG>)
endif()

if(NOT ${DIRECTX_ARCH} MATCHES "^arm")
Expand All @@ -76,7 +78,6 @@ if ( CMAKE_CXX_COMPILER_ID MATCHES "Clang" )
"-Wno-missing-prototypes" "-Wno-missing-variable-declarations" "-Wno-reserved-id-macro"
"-Wno-extra-semi-stmt")
elseif(MINGW)
target_compile_definitions(${PROJECT_NAME} PRIVATE $<IF:$<CONFIG:DEBUG>,_DEBUG,NDEBUG>)
target_compile_options(${PROJECT_NAME} PRIVATE -Wno-ignored-attributes)
target_link_options(${PROJECT_NAME} PRIVATE -municode)
elseif ( CMAKE_CXX_COMPILER_ID MATCHES "MSVC" )
Expand Down
3 changes: 2 additions & 1 deletion Direct3D11Tutorials/Tutorial02/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,8 @@ if(MSVC)
target_compile_options(${PROJECT_NAME} PRIVATE "$<$<NOT:$<CONFIG:DEBUG>>:/guard:ehcont>")
target_link_options(${PROJECT_NAME} PRIVATE "$<$<NOT:$<CONFIG:DEBUG>>:/guard:ehcont>")
endif()
else()
target_compile_definitions(${PROJECT_NAME} PRIVATE $<IF:$<CONFIG:DEBUG>,_DEBUG,NDEBUG>)
endif()

if(NOT ${DIRECTX_ARCH} MATCHES "^arm")
Expand All @@ -76,7 +78,6 @@ if ( CMAKE_CXX_COMPILER_ID MATCHES "Clang" )
"-Wno-missing-prototypes" "-Wno-missing-variable-declarations" "-Wno-reserved-id-macro"
"-Wno-extra-semi-stmt")
elseif(MINGW)
target_compile_definitions(${PROJECT_NAME} PRIVATE $<IF:$<CONFIG:DEBUG>,_DEBUG,NDEBUG>)
target_compile_options(${PROJECT_NAME} PRIVATE -Wno-ignored-attributes)
target_link_options(${PROJECT_NAME} PRIVATE -municode)
elseif ( CMAKE_CXX_COMPILER_ID MATCHES "MSVC" )
Expand Down
3 changes: 2 additions & 1 deletion Direct3D11Tutorials/Tutorial03/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,8 @@ if(MSVC)
target_compile_options(${PROJECT_NAME} PRIVATE "$<$<NOT:$<CONFIG:DEBUG>>:/guard:ehcont>")
target_link_options(${PROJECT_NAME} PRIVATE "$<$<NOT:$<CONFIG:DEBUG>>:/guard:ehcont>")
endif()
else()
target_compile_definitions(${PROJECT_NAME} PRIVATE $<IF:$<CONFIG:DEBUG>,_DEBUG,NDEBUG>)
endif()

if(NOT ${DIRECTX_ARCH} MATCHES "^arm")
Expand All @@ -76,7 +78,6 @@ if ( CMAKE_CXX_COMPILER_ID MATCHES "Clang" )
"-Wno-missing-prototypes" "-Wno-missing-variable-declarations" "-Wno-reserved-id-macro"
"-Wno-extra-semi-stmt")
elseif(MINGW)
target_compile_definitions(${PROJECT_NAME} PRIVATE $<IF:$<CONFIG:DEBUG>,_DEBUG,NDEBUG>)
target_compile_options(${PROJECT_NAME} PRIVATE -Wno-ignored-attributes)
target_link_options(${PROJECT_NAME} PRIVATE -municode)
elseif ( CMAKE_CXX_COMPILER_ID MATCHES "MSVC" )
Expand Down
3 changes: 2 additions & 1 deletion Direct3D11Tutorials/Tutorial04/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,8 @@ if(MSVC)
target_compile_options(${PROJECT_NAME} PRIVATE "$<$<NOT:$<CONFIG:DEBUG>>:/guard:ehcont>")
target_link_options(${PROJECT_NAME} PRIVATE "$<$<NOT:$<CONFIG:DEBUG>>:/guard:ehcont>")
endif()
else()
target_compile_definitions(${PROJECT_NAME} PRIVATE $<IF:$<CONFIG:DEBUG>,_DEBUG,NDEBUG>)
endif()

if(NOT ${DIRECTX_ARCH} MATCHES "^arm")
Expand All @@ -76,7 +78,6 @@ if ( CMAKE_CXX_COMPILER_ID MATCHES "Clang" )
"-Wno-missing-prototypes" "-Wno-missing-variable-declarations" "-Wno-reserved-id-macro"
"-Wno-extra-semi-stmt")
elseif(MINGW)
target_compile_definitions(${PROJECT_NAME} PRIVATE $<IF:$<CONFIG:DEBUG>,_DEBUG,NDEBUG>)
target_compile_options(${PROJECT_NAME} PRIVATE -Wno-ignored-attributes)
target_link_options(${PROJECT_NAME} PRIVATE -municode)
elseif ( CMAKE_CXX_COMPILER_ID MATCHES "MSVC" )
Expand Down
3 changes: 2 additions & 1 deletion Direct3D11Tutorials/Tutorial05/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,8 @@ if(MSVC)
target_compile_options(${PROJECT_NAME} PRIVATE "$<$<NOT:$<CONFIG:DEBUG>>:/guard:ehcont>")
target_link_options(${PROJECT_NAME} PRIVATE "$<$<NOT:$<CONFIG:DEBUG>>:/guard:ehcont>")
endif()
else()
target_compile_definitions(${PROJECT_NAME} PRIVATE $<IF:$<CONFIG:DEBUG>,_DEBUG,NDEBUG>)
endif()

if(NOT ${DIRECTX_ARCH} MATCHES "^arm")
Expand All @@ -76,7 +78,6 @@ if ( CMAKE_CXX_COMPILER_ID MATCHES "Clang" )
"-Wno-missing-prototypes" "-Wno-missing-variable-declarations" "-Wno-reserved-id-macro"
"-Wno-extra-semi-stmt")
elseif(MINGW)
target_compile_definitions(${PROJECT_NAME} PRIVATE $<IF:$<CONFIG:DEBUG>,_DEBUG,NDEBUG>)
target_compile_options(${PROJECT_NAME} PRIVATE -Wno-ignored-attributes)
target_link_options(${PROJECT_NAME} PRIVATE -municode)
elseif ( CMAKE_CXX_COMPILER_ID MATCHES "MSVC" )
Expand Down
3 changes: 2 additions & 1 deletion Direct3D11Tutorials/Tutorial06/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,8 @@ if(MSVC)
target_compile_options(${PROJECT_NAME} PRIVATE "$<$<NOT:$<CONFIG:DEBUG>>:/guard:ehcont>")
target_link_options(${PROJECT_NAME} PRIVATE "$<$<NOT:$<CONFIG:DEBUG>>:/guard:ehcont>")
endif()
else
target_compile_definitions(${PROJECT_NAME} PRIVATE $<IF:$<CONFIG:DEBUG>,_DEBUG,NDEBUG>)
endif()

if(NOT ${DIRECTX_ARCH} MATCHES "^arm")
Expand All @@ -76,7 +78,6 @@ if ( CMAKE_CXX_COMPILER_ID MATCHES "Clang" )
"-Wno-missing-prototypes" "-Wno-missing-variable-declarations" "-Wno-reserved-id-macro"
"-Wno-extra-semi-stmt")
elseif(MINGW)
target_compile_definitions(${PROJECT_NAME} PRIVATE $<IF:$<CONFIG:DEBUG>,_DEBUG,NDEBUG>)
target_compile_options(${PROJECT_NAME} PRIVATE -Wno-ignored-attributes)
target_link_options(${PROJECT_NAME} PRIVATE -municode)
elseif ( CMAKE_CXX_COMPILER_ID MATCHES "MSVC" )
Expand Down
3 changes: 2 additions & 1 deletion Direct3D11Tutorials/Tutorial07/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,8 @@ if(MSVC)
target_compile_options(${PROJECT_NAME} PRIVATE "$<$<NOT:$<CONFIG:DEBUG>>:/guard:ehcont>")
target_link_options(${PROJECT_NAME} PRIVATE "$<$<NOT:$<CONFIG:DEBUG>>:/guard:ehcont>")
endif()
else()
target_compile_definitions(${PROJECT_NAME} PRIVATE $<IF:$<CONFIG:DEBUG>,_DEBUG,NDEBUG>)
endif()

if(NOT ${DIRECTX_ARCH} MATCHES "^arm")
Expand All @@ -78,7 +80,6 @@ if ( CMAKE_CXX_COMPILER_ID MATCHES "Clang" )
"-Wno-missing-prototypes" "-Wno-missing-variable-declarations" "-Wno-reserved-id-macro"
"-Wno-extra-semi-stmt")
elseif(MINGW)
target_compile_definitions(${PROJECT_NAME} PRIVATE $<IF:$<CONFIG:DEBUG>,_DEBUG,NDEBUG>)
target_compile_options(${PROJECT_NAME} PRIVATE -Wno-ignored-attributes)
target_link_options(${PROJECT_NAME} PRIVATE -municode)
elseif ( CMAKE_CXX_COMPILER_ID MATCHES "MSVC" )
Expand Down
3 changes: 2 additions & 1 deletion Direct3D11TutorialsDXUT/Tutorial08/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,8 @@ if(MSVC)
target_compile_options(${PROJECT_NAME} PRIVATE "$<$<NOT:$<CONFIG:DEBUG>>:/guard:ehcont>")
target_link_options(${PROJECT_NAME} PRIVATE "$<$<NOT:$<CONFIG:DEBUG>>:/guard:ehcont>")
endif()
else()
target_compile_definitions(${PROJECT_NAME} PRIVATE $<IF:$<CONFIG:DEBUG>,_DEBUG,NDEBUG>)
endif()

if(NOT ${DIRECTX_ARCH} MATCHES "^arm")
Expand All @@ -76,7 +78,6 @@ if ( CMAKE_CXX_COMPILER_ID MATCHES "Clang" )
"-Wno-missing-prototypes" "-Wno-missing-variable-declarations" "-Wno-reserved-id-macro"
"-Wno-extra-semi-stmt")
elseif(MINGW)
target_compile_definitions(${PROJECT_NAME} PRIVATE $<IF:$<CONFIG:DEBUG>,_DEBUG,NDEBUG>)
target_compile_options(${PROJECT_NAME} PRIVATE -Wno-ignored-attributes)
target_link_options(${PROJECT_NAME} PRIVATE -municode)
elseif ( CMAKE_CXX_COMPILER_ID MATCHES "MSVC" )
Expand Down
Loading

0 comments on commit ba3978c

Please sign in to comment.