1 # ---------------------------------------------------------------------------
3 # Copyright (C) Stephanie Gawroriski <xer@multiphasicapps.net>
4 # ---------------------------------------------------------------------------
5 # SquirrelJME is under the Mozilla Public License Version 2.0.
6 # See license.mkd for licensing and copyright information.
7 # ---------------------------------------------------------------------------
8 # DESCRIPTION: Various hardening options.
10 # For RetroArch disable specific features so they cannot be used
11 if(SQUIRRELJME_IS_LIBRETRO)
12 # Disable dynamic library support, we do not want to allow loading
13 # native libraries of any kind
14 add_compile_definitions(SJME_CONFIG_HAS_NO_DYLIB_SUPPORT=1)
16 # Disable ScritchUI dynamic libraries
17 add_compile_definitions(SJME_CONFIG_SCRITCHUI_NO_DYLIB=1)
18 set(SQUIRRELJME_SCRITCHUI_NO_DYLIB ON)
21 # Strip output executable
22 if(SQUIRRELJME_IS_RELEASE)
23 if(CMAKE_COMPILER_IS_GNUCC OR
24 CMAKE_COMPILER_IS_GNUCXX OR
25 CMAKE_C_COMPILER_ID STREQUAL "GNU" OR
26 CMAKE_CXX_COMPILER_ID STREQUAL "Clang")
27 macro(squirreljme_executable_strip target)
28 add_custom_command(TARGET ${target} POST_BUILD
30 COMMAND "${CMAKE_STRIP}"
31 ARGS --strip-unneeded $<TARGET_FILE:${target}>)
34 CMAKE_C_COMPILER_ID STREQUAL "MSVC" OR
35 CMAKE_CXX_COMPILER_ID STREQUAL "MSVC")
36 macro(squirreljme_executable_strip target)
37 target_link_options(${target}
42 macro(squirreljme_executable_strip target)
46 macro(squirreljme_executable_strip target)