-
Notifications
You must be signed in to change notification settings - Fork 12
Expand file tree
/
Copy pathMcrtComputationCompileOptions.cmake
More file actions
53 lines (51 loc) · 3.46 KB
/
McrtComputationCompileOptions.cmake
File metadata and controls
53 lines (51 loc) · 3.46 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
# Copyright 2023-2024 DreamWorks Animation LLC
# SPDX-License-Identifier: Apache-2.0
function(${PROJECT_NAME}_cxx_compile_options target)
if (CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
target_compile_options(${target}
PRIVATE
$<$<BOOL:${ABI_SET_VERSION}>:
-fabi-version=${ABI_VERSION} # corrects the promotion behavior of C++11 scoped enums and the mangling of template argument packs.
>
-fexceptions # Enable exception handling.
-fno-omit-frame-pointer # TODO: add a note
-fno-strict-aliasing # TODO: add a note
-fpermissive # Downgrade some diagnostics about nonconformant code from errors to warnings.
-march=core-avx2 # Specify the name of the target architecture
-pipe # Use pipes rather than intermediate files.
-pthread # Define additional macros required for using the POSIX threads library.
-w # Inhibit all warning messages.
-Wall # Enable most warning messages.
-Wcast-align # Warn about pointer casts which increase alignment.
-Wcast-qual # Warn about casts which discard qualifiers.
-Wdisabled-optimization # Warn when an optimization pass is disabled.
-Wextra # This enables some extra warning flags that are not enabled by -Wall
-Woverloaded-virtual # Warn about overloaded virtual function names.
-Wno-conversion # Disable certain warnings that are enabled by -Wall
-Wno-sign-compare # Disable certain warnings that are enabled by -Wall
-Wno-switch # Disable certain warnings that are enabled by -Wall
-Wno-system-headers # Disable certain warnings that are enabled by -Wall
-Wno-unused-parameter # Disable certain warnings that are enabled by -Wall
$<$<CONFIG:RELWITHDEBINFO>:
-O3 # the default is -O2 for RELWITHDEBINFO
>
)
elseif (CMAKE_CXX_COMPILER_ID STREQUAL Clang)
target_compile_options(${target}
# TODO: Some if not all of these should probably be PUBLIC
PRIVATE
-march=core-avx2 # Specify the name of the target architecture
-mavx # x86 options
-fdelayed-template-parsing # Shader.h has a template method that uses a moonray class which is no available to scene_rdl2 and is only used in moonray+
-Wno-deprecated-declarations # disable auto_ptr deprecated warnings from log4cplus-1.
-Wno-unused-value # For opt-debug build MNRY_VERIFY(exp) the value is not used.
)
elseif (CMAKE_CXX_COMPILER_ID STREQUAL Intel)
target_compile_options(${target}
# TODO: Some if not all of these should probably be PUBLIC
PRIVATE
-march=core-avx2 # Specify the name of the target architecture
-mavx # x86 options
)
endif()
endfunction()