mirror of
https://github.com/OpenRCT2/OpenRCT2
synced 2026-01-26 00:04:43 +01:00
Merge pull request #5044 from janisozaur/ninja
Add BUILD_BYPRODUCTS entries to CMakeLists for googletest
This commit is contained in:
@@ -227,7 +227,7 @@ if ((NOT DISABLE_RCT2) AND UNIX)
|
||||
add_custom_target(segfiles DEPENDS openrct2_text openrct2_data)
|
||||
if (NOT USE_MMAP)
|
||||
if (APPLE)
|
||||
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -sectcreate rct2_text __text ${CMAKE_CURRENT_SOURCE_DIR}/build/openrct2_text -sectcreate rct2_data __data ${CMAKE_CURRENT_SOURCE_DIR}/build/openrct2_data -segaddr rct2_data 0x8a4000 -segprot rct2_data rwx rwx -segaddr rct2_text 0x401000 -segprot rct2_text rwx rwx -segaddr __TEXT 0x2000000 -read_only_relocs suppress")
|
||||
set(RCT2_SEGMENT_LINKER_FLAGS "-sectcreate rct2_text __text ${CMAKE_BINARY_DIR}/openrct2_text -sectcreate rct2_data __data ${CMAKE_BINARY_DIR}/openrct2_data -segaddr rct2_data 0x8a4000 -segprot rct2_data rwx rwx -segaddr rct2_text 0x401000 -segprot rct2_text rwx rwx -segaddr __TEXT 0x2000000 -read_only_relocs suppress")
|
||||
else (APPLE)
|
||||
# For Linux we have to use objcopy to wrap regular binaries into a linkable
|
||||
# format. We use specific section names which are then referenced in a
|
||||
@@ -253,7 +253,7 @@ if ((NOT DISABLE_RCT2) AND UNIX)
|
||||
)
|
||||
# can't use GLOB here, as the files don't exist yet at cmake-time
|
||||
set(RCT2_SECTIONS "${CMAKE_BINARY_DIR}/openrct2_data_section.o" "${CMAKE_BINARY_DIR}/openrct2_text_section.o")
|
||||
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -Wl,-T,\"${CMAKE_CURRENT_SOURCE_DIR}/distribution/linux/${LINKER_SCRIPT}\"")
|
||||
set(RCT2_SEGMENT_LINKER_FLAGS "-Wl,-T,\"${CMAKE_CURRENT_SOURCE_DIR}/distribution/linux/${LINKER_SCRIPT}\"")
|
||||
endif (APPLE)
|
||||
endif (NOT USE_MMAP)
|
||||
elseif (USE_MMAP)
|
||||
@@ -387,6 +387,7 @@ else (WIN32)
|
||||
if (NOT APPLE AND NOT USE_MMAP)
|
||||
add_dependencies(${PROJECT} linkable_sections)
|
||||
endif ()
|
||||
set_target_properties(${PROJECT} PROPERTIES LINK_FLAGS ${RCT2_SEGMENT_LINKER_FLAGS})
|
||||
endif (NOT DISABLE_RCT2)
|
||||
add_custom_command(
|
||||
OUTPUT g2.dat
|
||||
@@ -458,6 +459,7 @@ if (UNIX AND (NOT USE_MMAP) AND (NOT DISABLE_RCT2) AND (FORCE32))
|
||||
add_executable(testpaint EXCLUDE_FROM_ALL ${ORCT2_RIDE_SOURCES} ${ORCT2_RIDE_DEP_SOURCES} ${ORCT2_TESTPAINT_SOURCES} ${RCT2_SECTIONS})
|
||||
target_include_directories(testpaint PRIVATE "src/")
|
||||
set_target_properties(testpaint PROPERTIES COMPILE_FLAGS "-DNO_VEHICLES -D__TESTPAINT__ -Wno-unused")
|
||||
set_target_properties(testpaint PROPERTIES LINK_FLAGS ${RCT2_SEGMENT_LINKER_FLAGS})
|
||||
add_dependencies(testpaint segfiles)
|
||||
endif ()
|
||||
|
||||
|
||||
@@ -23,6 +23,8 @@ ExternalProject_Add(
|
||||
DOWNLOAD_COMMAND ""
|
||||
SOURCE_DIR "${GOOGLETEST_DISTRIB_SOURCE_DIR}/googletest"
|
||||
CMAKE_ARGS "-DCMAKE_CXX_FLAGS=${TARGET_M}"
|
||||
BUILD_BYPRODUCTS "googletest-prefix/src/googletest-build/${CMAKE_STATIC_LIBRARY_PREFIX}gtest${CMAKE_STATIC_LIBRARY_SUFFIX}"
|
||||
BUILD_BYPRODUCTS "googletest-prefix/src/googletest-build/${CMAKE_STATIC_LIBRARY_PREFIX}gtest_main${CMAKE_STATIC_LIBRARY_SUFFIX}"
|
||||
# Disable install step
|
||||
INSTALL_COMMAND ""
|
||||
# Wrap download, configure and build steps in a script to log output
|
||||
|
||||
Reference in New Issue
Block a user