File tree Expand file tree Collapse file tree 4 files changed +17
-2
lines changed
Expand file tree Collapse file tree 4 files changed +17
-2
lines changed Original file line number Diff line number Diff line change @@ -546,7 +546,7 @@ endif()
546546include (DaemonNacl)
547547if (NACL)
548548 add_library (srclibs-nacl-module EXCLUDE_FROM_ALL ${NACLLIST_MODULE} )
549- set_target_properties (srclibs-nacl-module PROPERTIES POSITION_INDEPENDENT_CODE 1 FOLDER "libs" )
549+ set_target_properties (srclibs-nacl-module PROPERTIES POSITION_INDEPENDENT_CODE ${GAME_PIE} FOLDER "libs" )
550550 set (LIBS_BASE ${LIBS_BASE} srclibs-nacl-module)
551551else ()
552552 add_library (srclibs-nacl-native EXCLUDE_FROM_ALL ${NACLLIST_NATIVE} )
@@ -620,7 +620,7 @@ if (BUILD_CLIENT OR BUILD_TTY_CLIENT OR BUILD_SERVER OR BUILD_DUMMY_APP OR NACL)
620620 find_package (ZLIB REQUIRED)
621621 else ()
622622 add_library (srclibs-zlib EXCLUDE_FROM_ALL ${ZLIBLIST} )
623- set_target_properties (srclibs-zlib PROPERTIES POSITION_INDEPENDENT_CODE 1 FOLDER "libs" )
623+ set_target_properties (srclibs-zlib PROPERTIES POSITION_INDEPENDENT_CODE ${GAME_PIE} FOLDER "libs" )
624624 set (ZLIB_INCLUDE_DIRS ${LIB_DIR} /zlib)
625625 set (ZLIB_LIBRARIES srclibs-zlib)
626626 endif ()
Original file line number Diff line number Diff line change @@ -31,6 +31,7 @@ include(DaemonFlags)
3131
3232# Function to setup all the Sgame/Cgame libraries
3333include (CMakeParseArguments)
34+
3435function (GAMEMODULE)
3536 # ParseArguments setup
3637 set (oneValueArgs NAME )
Original file line number Diff line number Diff line change @@ -38,4 +38,17 @@ else()
3838 message ( FATAL_ERROR "Platform not supported" )
3939endif ()
4040
41+ if (USE_NACL_SAIGO)
42+ # Saigo clang reports weird errors when building some cgame and sgame arm nexe with PIE.
43+ # Saigo clang crashes when building amd64 cgame with PIE, sgame builds properly though.
44+ if (NACL_TARGET STREQUAL "armhf" OR NACL_TARGET STREQUAL "amd64" )
45+ set (GAME_PIE 0)
46+ else ()
47+ set (GAME_PIE 1)
48+ endif ()
49+ else ()
50+ set (GAME_PIE 1)
51+ endif ()
52+
53+
4154include ("${DAEMON_DIR} /tools/DaemonArchitecture/DaemonArchitecture.cmake" )
Original file line number Diff line number Diff line change @@ -41,6 +41,7 @@ set(CMAKE_FIND_ROOT_PATH_MODE_PACKAGE ONLY)
4141set (CMAKE_FIND_ROOT_PATH_MODE_PROGRAM BOTH)
4242
4343set (NACL ON )
44+
4445add_definitions (-DUSE_NACL_SAIGO)
4546
4647set (CMAKE_C_FLAGS "" )
You can’t perform that action at this time.
0 commit comments