Skip to content

Commit b0e0dae

Browse files
committed
Fixed windows build flags
1 parent 94e881b commit b0e0dae

1 file changed

Lines changed: 38 additions & 69 deletions

File tree

CMakeLists.txt

Lines changed: 38 additions & 69 deletions
Original file line numberDiff line numberDiff line change
@@ -426,75 +426,44 @@ endif()
426426
# Compile and link options
427427
################################################################################
428428
if(MSVC)
429-
if("${CMAKE_VS_PLATFORM_NAME}" STREQUAL "x64")
430-
target_compile_options(${PROJECT_NAME} PRIVATE
431-
$<$<CONFIG:Debug>:
432-
/w;
433-
/Od;
434-
/MTd
435-
>
436-
$<$<CONFIG:Release>:
437-
/Oi;
438-
/Gy;
439-
/W3;
440-
/MT
441-
>
442-
/permissive-;
443-
/MP;
444-
${DEFAULT_CXX_DEBUG_INFORMATION_FORMAT};
445-
${DEFAULT_CXX_EXCEPTION_HANDLING}
446-
)
447-
target_compile_options(${PROJECT_NAME} PRIVATE $<$<CONFIG:Debug>:/ZI;>)
448-
target_compile_options(${PROJECT_NAME} PRIVATE $<$<CONFIG:Release>:/Zi;>)
449-
elseif("${CMAKE_VS_PLATFORM_NAME}" STREQUAL "Win32")
450-
target_compile_options(${PROJECT_NAME} PRIVATE
451-
$<$<CONFIG:Debug>:
452-
/MTd
453-
>
454-
$<$<CONFIG:Release>:
455-
/O2;
456-
/Oi;
457-
/Gy;
458-
/MT
459-
>
460-
/permissive-;
461-
/MP;
462-
/w;
463-
${DEFAULT_CXX_DEBUG_INFORMATION_FORMAT};
464-
${DEFAULT_CXX_EXCEPTION_HANDLING}
465-
)
466-
endif()
467-
if("${CMAKE_VS_PLATFORM_NAME}" STREQUAL "x64")
468-
target_link_options(${PROJECT_NAME} PRIVATE
469-
$<$<CONFIG:Debug>:
470-
/INCREMENTAL
471-
>
472-
$<$<CONFIG:Release>:
473-
/OPT:REF;
474-
/OPT:ICF;
475-
/INCREMENTAL:NO;
476-
/FORCE:MULTIPLE
477-
>
478-
/MANIFEST:NO;
479-
/DEBUG;
480-
/SUBSYSTEM:WINDOWS
481-
)
482-
elseif("${CMAKE_VS_PLATFORM_NAME}" STREQUAL "Win32")
483-
target_link_options(${PROJECT_NAME} PRIVATE
484-
$<$<CONFIG:Debug>:
485-
/STACK:8777216
486-
>
487-
$<$<CONFIG:Release>:
488-
/OPT:REF;
489-
/OPT:ICF;
490-
/INCREMENTAL:NO;
491-
/FORCE:MULTIPLE
492-
>
493-
/MANIFEST:NO;
494-
/DEBUG;
495-
/SUBSYSTEM:WINDOWS
496-
)
497-
endif()
429+
target_compile_options(${PROJECT_NAME} PRIVATE
430+
$<$<CONFIG:Debug>:
431+
/w;
432+
/Od
433+
>
434+
$<$<CONFIG:Release>:
435+
/Oi;
436+
/Gy;
437+
/W3
438+
>
439+
440+
/wd4024 #different types for formal and actual parameter [x]. Usually seen along side 4047.
441+
/wd4047 #'uintptr_t' differs in levels of indirection from 'Gfx *'. Usually caused by passing a uintptr_t into a function expecting a pointer-types
442+
/wd4090 #'initializing': different 'const' qualifiers. Caused when initializing a non const struct member with a const char*.
443+
/wd4101 # unreferenced local variable. Things like stack pads.
444+
/wd4133 #incompatible types. Usually caused by passing a c string into a function that takes a pointer.
445+
/wd4244 #conversion from [a] to [b]. Used to warn when copying to smaller type without a cast.
446+
/sdl-;
447+
/permissive-;
448+
/MP;
449+
${DEFAULT_CXX_DEBUG_INFORMATION_FORMAT};
450+
${DEFAULT_CXX_EXCEPTION_HANDLING}
451+
)
452+
target_compile_options(${PROJECT_NAME} PRIVATE $<$<CONFIG:Debug>:/ZI;>)
453+
target_link_options(${PROJECT_NAME} PRIVATE
454+
$<$<CONFIG:Debug>:
455+
/INCREMENTAL
456+
>
457+
$<$<CONFIG:Release>:
458+
/OPT:REF;
459+
/OPT:ICF;
460+
/INCREMENTAL:NO;
461+
/FORCE:MULTIPLE
462+
>
463+
/MANIFEST:NO;
464+
/DEBUG;
465+
/SUBSYSTEM:WINDOWS
466+
)
498467

499468
# Remove /RTC from msvc flags
500469
foreach (fentry

0 commit comments

Comments
 (0)