Skip to content

Commit f792dd7

Browse files
Fix issue with runtime.build_os and runtime.build_architecture (#623)
### Fix issue with runtime.build_os and runtime.build_architecture ### Linked issues n/a ### Summarize your change. Add missing compiler definitions for MacOS and Linux. There are some unrelated changes because of the pre-commit hook. ### Describe the reason for the change. The command build_os and build_architecture were returning empty strings on Linux. ### Describe what you have tested and on which operating system. Rocky 8 Signed-off-by: Cédrik Fuoco <[email protected]>
1 parent 2ace247 commit f792dd7

File tree

1 file changed

+23
-5
lines changed

1 file changed

+23
-5
lines changed

cmake/defaults/rv_targets.cmake

Lines changed: 23 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,20 +9,23 @@ SET(CMAKE_SKIP_RPATH
99
)
1010

1111
IF(APPLE)
12-
# Only native builds are supported (x86_64 on Intel MacOS and ARM64 on Apple chipset).
13-
# Rosetta can be used to build x86_64 on Apple chipset.
12+
# Only native builds are supported (x86_64 on Intel MacOS and ARM64 on Apple chipset). Rosetta can be used to build x86_64 on Apple chipset.
1413
IF("${CMAKE_HOST_SYSTEM_PROCESSOR}" STREQUAL "x86_64")
1514
SET(RV_TARGET_APPLE_X86_64
1615
ON
1716
CACHE INTERNAL "Compile for x86_64 on Apple MacOS" FORCE
1817
)
19-
SET(__target_arch__ -DRV_ARCH_X86_64)
18+
SET(__target_arch__
19+
-DRV_ARCH_X86_64
20+
)
2021
ELSEIF("${CMAKE_HOST_SYSTEM_PROCESSOR}" STREQUAL "arm64")
2122
SET(RV_TARGET_APPLE_ARM64
2223
ON
2324
CACHE INTERNAL "Compile for arm64 on Apple MacOS" FORCE
2425
)
25-
SET(__target_arch__ -DRV_ARCH_ARM64)
26+
SET(__target_arch__
27+
-DRV_ARCH_ARM64
28+
)
2629
ENDIF()
2730

2831
MESSAGE(STATUS "Building for ${CMAKE_HOST_SYSTEM_PROCESSOR}")
@@ -44,6 +47,11 @@ IF(APPLE)
4447
CACHE STRING "Platform identifier used in Tweak Makefiles"
4548
)
4649

50+
SET(ARCH
51+
"${CMAKE_HOST_SYSTEM_PROCESSOR}"
52+
CACHE STRING "CPU Architecture identifier"
53+
)
54+
4755
SET(CMAKE_MACOSX_RPATH
4856
ON
4957
)
@@ -107,6 +115,16 @@ ELSEIF(UNIX)
107115
-DPLATFORM_OPENGL=1
108116
)
109117

118+
SET(PLATFORM
119+
"LINUX"
120+
CACHE STRING "Platform identifier"
121+
)
122+
123+
SET(ARCH
124+
"IA32_64"
125+
CACHE STRING "CPU Architecture identifier"
126+
)
127+
110128
EXECUTE_PROCESS(
111129
COMMAND cat /etc/redhat-release
112130
OUTPUT_VARIABLE RHEL_VERBOSE
@@ -150,4 +168,4 @@ ELSEIF(WIN32)
150168
ELSE()
151169
MESSAGE(FATAL_ERROR "Unsupported platform")
152170

153-
ENDIF()
171+
ENDIF()

0 commit comments

Comments
 (0)