OrangeC: Add support for compiling Windows Resources

OrangeC 7.0 and above come with a resource compiler, ORC.
This commit is contained in:
Serguei E. Leontiev
2026-03-24 14:53:10 +03:00
committed by Brad King
parent 552e1688f3
commit 402d72b6c0
4 changed files with 15 additions and 2 deletions

View File

@@ -39,7 +39,9 @@ set(CMAKE_RC_FLAG_REGEX "^[-/](D|I)")
# now define the following rule variables
# CMAKE_RC_COMPILE_OBJECT
set(CMAKE_INCLUDE_FLAG_RC "-I ")
if(NOT CMAKE_INCLUDE_FLAG_RC)
set(CMAKE_INCLUDE_FLAG_RC "-I ")
endif()
# compile a Resource file into an object file
if(NOT CMAKE_RC_COMPILE_OBJECT)
set(CMAKE_RC_COMPILE_OBJECT

View File

@@ -7,4 +7,11 @@ set(CMAKE_FIND_LIBRARY_SUFFIXES ".l")
macro(__windows_compiler_orangec lang)
set(CMAKE_${lang}_CREATE_WIN32_EXE "-Wg")
set(CMAKE_${lang}_CREATE_CONSOLE_EXE "-Wc")
if(CMAKE_C_COMPILER_VERSION VERSION_GREATER_EQUAL "7.0")
if(NOT CMAKE_RC_COMPILER_INIT)
set(CMAKE_RC_COMPILER_INIT orc)
endif()
enable_language(RC)
endif()
endmacro()

View File

@@ -0,0 +1,2 @@
set(CMAKE_RC_COMPILE_OBJECT "<CMAKE_RC_COMPILER> -! <DEFINES> <INCLUDES> <FLAGS> -o<OBJECT> <SOURCE>")
set(CMAKE_INCLUDE_FLAG_RC "-i ")

View File

@@ -131,7 +131,9 @@ if(BUILD_TESTING)
set(CMake_TEST_RESOURCES TRUE)
endif()
# For some Windows toolchains there is no resource support.
if(WATCOM OR BORLAND OR CMAKE_C_COMPILER_ID STREQUAL "OrangeC")
if(WATCOM OR BORLAND
OR (CMAKE_C_COMPILER_ID STREQUAL "OrangeC" AND
CMAKE_C_COMPILER_VERSION VERSION_LESS "7.0"))
set(CMake_TEST_RESOURCES FALSE)
endif()