Skip to content

Commit

Permalink
Privatise compiler options.
Browse files Browse the repository at this point in the history
  • Loading branch information
enetheru committed Dec 6, 2024
1 parent 7fd846f commit c3304b7
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 4 deletions.
6 changes: 2 additions & 4 deletions cmake/common_compiler_flags.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ function( common_compiler_flags )

# These compiler options reflect what is in godot/SConstruct.
target_compile_options( ${TARGET_NAME}
PUBLIC
PRIVATE
# Disable exception handling. Godot doesn't use exceptions anywhere, and this
# saves around 20% of binary size and very significant build time.
$<${DISABLE_EXCEPTIONS}:
Expand Down Expand Up @@ -90,8 +90,6 @@ function( common_compiler_flags )
/wd4514 # C4514 (unreferenced inline function has been removed)
/wd4714 # C4714 (function marked as __forceinline not inlined)
/wd4820 # C4820 (padding added after construct)

/utf-8
>

# Clang and GNU common options
Expand Down Expand Up @@ -153,7 +151,7 @@ function( common_compiler_flags )
)

target_link_options( ${TARGET_NAME}
PUBLIC
PRIVATE
$<${IS_MSVC}:
/WX # treat link warnings as errors.
/MANIFEST:NO # We dont need a manifest
Expand Down
7 changes: 7 additions & 0 deletions test/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,13 @@ target_link_libraries( godot-cpp-test
PRIVATE
godot-cpp::${TEST_TARGET} )

# These compiler options reflect what is in godot/SConstruct.
target_compile_options( godot-cpp-test
PRIVATE
# Interpret source code files using utf8
$<${IS_MSVC}:/utf-8>
)

### Get useful properties of the library
get_target_property( GODOT_PLATFORM godot-cpp::${TEST_TARGET} GODOT_PLATFORM )
get_target_property( GODOT_TARGET godot-cpp::${TEST_TARGET} GODOT_TARGET )
Expand Down

0 comments on commit c3304b7

Please sign in to comment.