Skip to content

Commit 4b97fb6

Browse files
committed
Privatise compiler options.
1 parent af5f610 commit 4b97fb6

File tree

2 files changed

+9
-4
lines changed

2 files changed

+9
-4
lines changed

cmake/common_compiler_flags.cmake

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ function( common_compiler_flags )
4848

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

9795
# Clang and GNU common options
@@ -153,7 +151,7 @@ function( common_compiler_flags )
153151
)
154152

155153
target_link_options( ${TARGET_NAME}
156-
PUBLIC
154+
PRIVATE
157155
$<${IS_MSVC}:
158156
/WX # treat link warnings as errors.
159157
/MANIFEST:NO # We dont need a manifest

test/CMakeLists.txt

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,13 @@ target_link_libraries( godot-cpp-test
2020
PRIVATE
2121
godot-cpp::${TEST_TARGET} )
2222

23+
# These compiler options reflect what is in godot/SConstruct.
24+
target_compile_options( godot-cpp-test
25+
PRIVATE
26+
# Interpret source code files using utf8
27+
$<${IS_MSVC}:/utf-8>
28+
)
29+
2330
### Get useful properties of the library
2431
get_target_property( GODOT_PLATFORM godot-cpp::${TEST_TARGET} GODOT_PLATFORM )
2532
get_target_property( GODOT_TARGET godot-cpp::${TEST_TARGET} GODOT_TARGET )

0 commit comments

Comments
 (0)