Skip to content

Commit 270730f

Browse files
CMake: log additional compiler options
1 parent f6129a6 commit 270730f

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

CMakeLists.txt

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -387,8 +387,14 @@ endforeach()
387387
if(MSVC)
388388
# Treat warnings as errors
389389
set(DILIGENT_MSVC_COMPILE_OPTIONS "" CACHE STRING "Common MSVC compile options")
390+
if (DILIGENT_MSVC_COMPILE_OPTIONS)
391+
message("Additional MSVC compile options: " ${DILIGENT_MSVC_COMPILE_OPTIONS})
392+
endif()
390393

391394
set(DILIGENT_MSVC_DEBUG_COMPILE_OPTIONS "" CACHE STRING "Additional MSVC compile options for debug configuration")
395+
if (DILIGENT_MSVC_DEBUG_COMPILE_OPTIONS)
396+
message("Additional MSVC compile options for debug configuration: " ${DILIGENT_MSVC_DEBUG_COMPILE_OPTIONS})
397+
endif()
392398

393399
# Enable whole program optimization
394400
set(DEFAULT_DILIGENT_MSVC_RELEASE_COMPILE_OPTIONS /GL)
@@ -397,6 +403,9 @@ if(MSVC)
397403
set(DEFAULT_DILIGENT_MSVC_RELEASE_COMPILE_OPTIONS ${DEFAULT_DILIGENT_MSVC_RELEASE_COMPILE_OPTIONS} /arch:AVX2)
398404
endif()
399405
set(DILIGENT_MSVC_RELEASE_COMPILE_OPTIONS ${DEFAULT_DILIGENT_MSVC_RELEASE_COMPILE_OPTIONS} CACHE STRING "Additional MSVC compile options for release configurations")
406+
if (DILIGENT_MSVC_RELEASE_COMPILE_OPTIONS)
407+
message("Additional MSVC compile options for release configurations: " ${DILIGENT_MSVC_RELEASE_COMPILE_OPTIONS})
408+
endif()
400409

401410
# Enable level 4 warnings, but disable
402411
# - w4100 - unreferenced formal parameter
@@ -459,14 +468,23 @@ endif()
459468
if (CMAKE_CXX_COMPILER_ID MATCHES "Clang")
460469
# Treat warnings as errors
461470
set(DILIGENT_CLANG_COMPILE_OPTIONS "" CACHE STRING "Common Clang compile options")
471+
if (DILIGENT_CLANG_COMPILE_OPTIONS)
472+
message("Additional Clang compile options: " ${DILIGENT_CLANG_COMPILE_OPTIONS})
473+
endif()
462474

463475
set(DILIGENT_CLANG_DEBUG_COMPILE_OPTIONS "" CACHE STRING "Additional Clang compile options for debug configuration")
476+
if (DILIGENT_CLANG_DEBUG_COMPILE_OPTIONS)
477+
message("Additional Clang compile options for debug configuration: " ${DILIGENT_CLANG_DEBUG_COMPILE_OPTIONS})
478+
endif()
464479

465480
if("${TARGET_CPU}" STREQUAL "x86_64")
466481
# Enable AVX2
467482
set(DILIGENT_CLANG_RELEASE_COMPILE_OPTIONS "-mavx2")
468483
endif()
469484
set(DILIGENT_CLANG_RELEASE_COMPILE_OPTIONS ${DILIGENT_CLANG_RELEASE_COMPILE_OPTIONS} CACHE STRING "Additional Clang compile options for release configurations")
485+
if (DILIGENT_CLANG_RELEASE_COMPILE_OPTIONS)
486+
message("Additional Clang compile options for release configurations: " ${DILIGENT_CLANG_RELEASE_COMPILE_OPTIONS})
487+
endif()
470488

471489
target_compile_options(Diligent-BuildSettings INTERFACE
472490
${DILIGENT_CLANG_COMPILE_OPTIONS}

0 commit comments

Comments
 (0)