OrangeC: Add support for OrangeC compiler

Add compiler information modules.  Update the test suite.

Fixes: #25032
Co-authored-by: Brad King <brad.king@kitware.com>
This commit is contained in:
David Lindauer
2023-06-24 21:23:39 -04:00
committed by Brad King
parent 10f435a58f
commit 531b4fe643
57 changed files with 213 additions and 61 deletions

View File

@@ -0,0 +1,5 @@
orangec-compiler
----------------
* The OrangeC compiler is now supported with
:variable:`compiler id <CMAKE_<LANG>_COMPILER_ID>` ``OrangeC``.

View File

@@ -35,6 +35,7 @@ Value Name
``MSVC`` `Microsoft Visual Studio`_
``NVHPC`` `NVIDIA HPC Compiler`_
``NVIDIA`` `NVIDIA CUDA Compiler`_
``OrangeC`` `OrangeC Compiler`_
``OpenWatcom`` `Open Watcom`_
``PGI`` The Portland Group
``PathScale`` PathScale
@@ -63,6 +64,7 @@ languages.
.. _NVIDIA HPC Compiler: https://developer.nvidia.com/hpc-compilers
.. _NVIDIA CUDA Compiler: https://developer.nvidia.com/cuda-llvm-compiler
.. _Open Watcom: https://open-watcom.github.io
.. _OrangeC Compiler: https://github.com/LADSoft/OrangeC
.. _Small Device C Compiler: https://sdcc.sourceforge.net
.. _Tiny C Compiler: https://bellard.org/tcc
.. _Tasking Compiler Toolsets: https://www.tasking.com

View File

@@ -72,6 +72,7 @@ function(compiler_id_detection outvar lang)
Fujitsu
GHS
Tasking
OrangeC
)
if ("x${lang}" STREQUAL "xC")
list(APPEND ordered_compilers

View File

@@ -70,6 +70,10 @@ if(NOT CMAKE_ASM${ASM_DIALECT}_COMPILER_ID)
set(CMAKE_ASM${ASM_DIALECT}_COMPILER_ID_VENDOR_FLAGS_ARMClang "--version")
set(CMAKE_ASM${ASM_DIALECT}_COMPILER_ID_VENDOR_REGEX_ARMClang "armclang")
list(APPEND CMAKE_ASM${ASM_DIALECT}_COMPILER_ID_VENDORS OrangeC )
set(CMAKE_ASM${ASM_DIALECT}_COMPILER_ID_VENDOR_FLAGS_OrangeC "--version")
set(CMAKE_ASM${ASM_DIALECT}_COMPILER_ID_VENDOR_REGEX_OrangeC "occ \\(OrangeC\\) Version")
list(APPEND CMAKE_ASM${ASM_DIALECT}_COMPILER_ID_VENDORS HP )
set(CMAKE_ASM${ASM_DIALECT}_COMPILER_ID_VENDOR_FLAGS_HP "-V")
set(CMAKE_ASM${ASM_DIALECT}_COMPILER_ID_VENDOR_REGEX_HP "HP C")

View File

@@ -0,0 +1,7 @@
include(Compiler/OrangeC)
__compiler_orangec(ASM)
set(CMAKE_ASM_OUTPUT_EXTENSION ".o")
set(CMAKE_ASM_VERBOSE_FLAG "-yyyyy")
set(CMAKE_ASM_SOURCE_FILE_EXTENSIONS s;S;asm;nas)

View File

@@ -0,0 +1,20 @@
include(Compiler/OrangeC)
include(Compiler/CMakeCommonCompilerMacros)
set(CMAKE_C_OUTPUT_EXTENSION ".o")
set(CMAKE_C_VERBOSE_FLAG "-yyyyy")
set(CMAKE_C_COMPILE_OPTIONS_EXPLICIT_LANGUAGE -x c)
set(CMAKE_C90_STANDARD_COMPILE_OPTION -std=c89)
set(CMAKE_C90_EXTENSION_COMPILE_OPTION -std=c89)
set(CMAKE_C90_STANDARD__HAS_FULL_SUPPORT ON)
set(CMAKE_C99_STANDARD_COMPILE_OPTION -std=c99)
set(CMAKE_C99_EXTENSION_COMPILE_OPTION -std=c99)
set(CMAKE_C99_STANDARD__HAS_FULL_SUPPORT ON)
set(CMAKE_C11_STANDARD_COMPILE_OPTION -std=c11)
set(CMAKE_C11_EXTENSION_COMPILE_OPTION -std=c11)
set(CMAKE_C11_STANDARD__HAS_FULL_SUPPORT ON)
__compiler_orangec(C)
#- 6.38 is the earliest version which version info is available in the preprocessor
__compiler_check_default_language_standard(C 6.38 11)

View File

@@ -0,0 +1,25 @@
include(Compiler/OrangeC)
include(Compiler/CMakeCommonCompilerMacros)
set(_ORANGEC_COMPILE_CXX " -x c++")
set(CMAKE_CXX_COMPILE_OPTIONS_EXPLICIT_LANGUAGE -x c++)
set(CMAKE_CXX_OUTPUT_EXTENSION ".o")
set(CMAKE_CXX_VERBOSE_FLAG "-yyyyy")
#- OrangeC is a little lax when accepting compiler version specifications.
# Usually changing the version only changes the value of __cplusplus.
# Also we don't support CXX98
set(CMAKE_CXX11_STANDARD_COMPILE_OPTION "-std=c++11")
set(CMAKE_CXX11_EXTENSION_COMPILE_OPTION "-std=c++11")
set(CMAKE_CXX11_STANDARD__HAS_FULL_SUPPORT ON)
set(CMAKE_CXX14_STANDARD_COMPILE_OPTION "-std=c++14")
set(CMAKE_CXX14_EXTENSION_COMPILE_OPTION "-std=c++14")
set(CMAKE_CXX14_STANDARD__HAS_FULL_SUPPORT ON)
__compiler_orangec(CXX)
#- 6.38 is the earliest version which version info is available in the preprocessor
__compiler_check_default_language_standard(CXX 6.38 14)

View File

@@ -0,0 +1,7 @@
set(_compiler_id_pp_test "defined(__ORANGEC__)")
set(_compiler_id_version_compute "
# define @PREFIX@COMPILER_VERSION_MAJOR @MACRO_DEC@(__ORANGEC_MAJOR__)
# define @PREFIX@COMPILER_VERSION_MINOR @MACRO_DEC@(__ORANGEC_MINOR__)
# define @PREFIX@COMPILER_VERSION_PATCH @MACRO_DEC@(__ORANGEC_PATCHLEVEL__)")

View File

@@ -0,0 +1,33 @@
include_guard()
macro(__compiler_orangec lang)
if ("x${lang}" MATCHES "^x(C|CXX)$")
set(CMAKE_${lang}_CREATE_PREPROCESSED_SOURCE "<CMAKE_${lang}_COMPILER> ${_ORANGEC_COMPILE_${lang}} -! <SOURCE> <DEFINES> <INCLUDES> <FLAGS> +i -o <PREPROCESSED_SOURCE>")
set(CMAKE_${lang}_CREATE_ASSEMBLY_SOURCE "<CMAKE_${lang}_COMPILER> ${_ORANGEC_COMPILE_${lang}} -! <SOURCE> <DEFINES> <INCLUDES> <FLAGS> -S -o <ASSEMBLY_SOURCE>")
endif()
set(CMAKE_${lang}_COMPILE_OBJECT "<CMAKE_${lang}_COMPILER> ${_ORANGEC_COMPILE_${lang}} -! -c <SOURCE> <DEFINES> <INCLUDES> <FLAGS> -o <OBJECT>")
unset(_ORANGEC_COMPILE_${lang})
set(CMAKE_DEPFILE_FLAGS_${lang} "-MD -MT <DEP_TARGET> -MF <DEP_FILE>")
set(CMAKE_${lang}_DEPFILE_FORMAT gcc)
set(CMAKE_${lang}_DEPENDS_USE_COMPILER TRUE)
string(APPEND CMAKE_${lang}_FLAGS_INIT " ")
string(APPEND CMAKE_${lang}_FLAGS_DEBUG_INIT " -g")
string(APPEND CMAKE_${lang}_FLAGS_RELEASE_INIT " -O2 -DNDEBUG")
string(APPEND CMAKE_${lang}_FLAGS_MINSIZEREL_INIT " -O1 -DNDEBUG")
string(APPEND CMAKE_${lang}_FLAGS_RELWITHDEBINFO_INIT " -O2 -g -DNDEBUG")
set(CMAKE_${lang}_CREATE_STATIC_LIBRARY
"<CMAKE_${lang}_COMPILER> -! -static -o <TARGET> <LINK_FLAGS> <OBJECTS> ")
set(CMAKE_${lang}_LINK_EXECUTABLE "<CMAKE_${lang}_COMPILER> -! <FLAGS> -o <TARGET> --out-implib <TARGET_IMPLIB> <CMAKE_${lang}_LINK_FLAGS> <LINK_FLAGS> <OBJECTS> <LINK_LIBRARIES>")
set(CMAKE_${lang}_CREATE_SHARED_LIBRARY
"<CMAKE_${lang}_COMPILER> -! <FLAGS> -o <TARGET> --out-implib <TARGET_IMPLIB> <CMAKE_SHARED_LIBRARY_${lang}_FLAGS> <LANGUAGE_COMPILE_FLAGS> <LINK_FLAGS> <CMAKE_SHARED_LIBRARY_CREATE_${lang}_FLAGS> <OBJECTS> <LINK_LIBRARIES>")
set(CMAKE_${lang}_CREATE_SHARED_MODULE "${CMAKE_${lang}_CREATE_SHARED_LIBRARY}")
set(CMAKE_LIBRARY_PATH_FLAG "-L")
set(CMAKE_SHARED_LIBRARY_CREATE_${lang}_FLAGS "-! -shared")
set(CMAKE_${lang}_RESPONSE_FILE_FLAG "@")
set(CMAKE_${lang}_RESPONSE_FILE_LINK_FLAG "@")
endmacro()

View File

@@ -0,0 +1,2 @@
include(Platform/Windows-OrangeC)
__windows_compiler_orangec(C)

View File

@@ -0,0 +1,2 @@
include(Platform/Windows-OrangeC)
__windows_compiler_orangec(CXX)

View File

@@ -0,0 +1,10 @@
set(CMAKE_LINK_LIBRARY_SUFFIX "")
set(CMAKE_STATIC_LIBRARY_SUFFIX ".l")
set(CMAKE_IMPORT_LIBRARY_SUFFIX ".l")
set(CMAKE_FIND_LIBRARY_PREFIXES "")
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")
endmacro()

View File

@@ -12,7 +12,7 @@ set(SRCS)
# and also generate assembler files from C:
if("${CMAKE_GENERATOR}" MATCHES "Makefile|Xcode|Ninja" AND
NOT CMAKE_OSX_ARCHITECTURES MATCHES ";")
if((CMAKE_C_COMPILER_ID MATCHES "^(GNU|LCC|Clang|AppleClang|HP|SunPro|XL)$") OR (CMAKE_C_COMPILER_ID MATCHES "Intel" AND UNIX)
if((CMAKE_C_COMPILER_ID MATCHES "^(GNU|LCC|Clang|AppleClang|HP|SunPro|XL|OrangeC)$") OR (CMAKE_C_COMPILER_ID MATCHES "Intel" AND UNIX)
AND NOT (CMAKE_C_COMPILER_ID STREQUAL "Clang" AND "x${CMAKE_C_COMPILER_FRONTEND_VARIANT}" STREQUAL "xMSVC"))
set(C_FLAGS "${CMAKE_C_FLAGS}")
separate_arguments(C_FLAGS)

View File

@@ -117,8 +117,8 @@ if(BUILD_TESTING)
if(WIN32 OR CYGWIN)
set(CMake_TEST_RESOURCES TRUE)
endif()
# for borland and watcom there is no resource support
if(WATCOM OR BORLAND)
# For some Windows toolchains there is no resource support.
if(WATCOM OR BORLAND OR CMAKE_C_COMPILER_ID STREQUAL "OrangeC")
set(CMake_TEST_RESOURCES FALSE)
endif()
@@ -2094,7 +2094,10 @@ if(BUILD_TESTING)
)
endif()
if(MAKE_SUPPORTS_SPACES AND NOT CMAKE_GENERATOR STREQUAL "Xcode" AND NOT CMAKE_GENERATOR STREQUAL "Watcom WMake")
if(MAKE_SUPPORTS_SPACES
AND NOT CMAKE_GENERATOR STREQUAL "Xcode"
AND NOT CMAKE_GENERATOR STREQUAL "Watcom WMake"
)
add_test(SubDirSpaces ${CMAKE_CTEST_COMMAND}
--build-and-test
"${CMake_SOURCE_DIR}/Tests/SubDirSpaces"
@@ -3000,8 +3003,8 @@ if(BUILD_TESTING)
-S "${CMake_BINARY_DIR}/Tests/CTestTestCrash/test.cmake" -V
--output-log "${CMake_BINARY_DIR}/Tests/CTestTestCrash/testOutput.log"
)
# with watcom the SEGFAULT is not found, it just fails
if(CMAKE_GENERATOR MATCHES "Watcom WMake")
# With Watcom and OrangeC the SEGFAULT is not found, it just fails
if(CMAKE_GENERATOR MATCHES "Watcom WMake" OR CMAKE_C_COMPILER_ID STREQUAL "OrangeC")
set_tests_properties(CTestTestCrash PROPERTIES
PASS_REGULAR_EXPRESSION "Failed")
else()

View File

@@ -18,7 +18,7 @@ macro(run_test feature lang)
endif()
endmacro()
if(NOT CMAKE_C_COMPILER_ID MATCHES "^(Cray|PGI|NVHPC|XL|XLClang|IBMClang|IntelLLVM|Fujitsu|FujitsuClang)$")
if(NOT CMAKE_C_COMPILER_ID MATCHES "^(Cray|PGI|NVHPC|XL|XLClang|IBMClang|IntelLLVM|Fujitsu|FujitsuClang|OrangeC)$")
get_property(c_features GLOBAL PROPERTY CMAKE_C_KNOWN_FEATURES)
list(FILTER c_features EXCLUDE REGEX "^c_std_[0-9][0-9]")
foreach(feature ${c_features})
@@ -26,7 +26,7 @@ if(NOT CMAKE_C_COMPILER_ID MATCHES "^(Cray|PGI|NVHPC|XL|XLClang|IBMClang|IntelLL
endforeach()
endif()
if(NOT CMAKE_CXX_COMPILER_ID MATCHES "^(Cray|PGI|NVHPC|XL|XLClang|IBMClang|IntelLLVM|Fujitsu|FujitsuClang)$")
if(NOT CMAKE_CXX_COMPILER_ID MATCHES "^(Cray|PGI|NVHPC|XL|XLClang|IBMClang|IntelLLVM|Fujitsu|FujitsuClang|OrangeC)$")
get_property(cxx_features GLOBAL PROPERTY CMAKE_CXX_KNOWN_FEATURES)
list(FILTER cxx_features EXCLUDE REGEX "^cxx_std_[0-9][0-9]")
foreach(feature ${cxx_features})

View File

@@ -244,6 +244,12 @@ configure_file(
${Complex_SOURCE_DIR}/Library/dummy
${Complex_BINARY_DIR}/Library/dummylib.lib
COPYONLY)
if(CMAKE_C_COMPILER_ID STREQUAL "OrangeC")
configure_file(
${Complex_SOURCE_DIR}/Library/dummy
${Complex_BINARY_DIR}/Library/dummylib.l
COPYONLY)
endif()
foreach (ext ${CMAKE_SHLIB_SUFFIX};.so;.a;.sl
${CMAKE_SHARED_LIBRARY_SUFFIX}.2
${CMAKE_STATIC_LIBRARY_SUFFIX}.2)

View File

@@ -45,7 +45,7 @@ add_executable(complex.file complex.file.cxx complex_nobuild.cxx
if (UNIX)
target_link_libraries(complex ${CMAKE_DL_LIBS})
elseif(NOT BORLAND AND NOT MINGW)
elseif(NOT BORLAND AND NOT MINGW AND NOT CMAKE_C_COMPILER_ID STREQUAL "OrangeC")
target_link_libraries(complex rpcrt4.lib)
endif ()

View File

@@ -23,7 +23,7 @@ set(LibrarySources ${LibrarySources}
remove(LibrarySources create_file.cxx GENERATED nonexisting_file)
add_library(CMakeTestLibrary ${LibrarySources})
if(WIN32 AND NOT CYGWIN AND NOT BORLAND AND NOT MINGW)
if(WIN32 AND NOT CYGWIN AND NOT BORLAND AND NOT MINGW AND NOT CMAKE_C_COMPILER_ID STREQUAL "OrangeC")
target_link_libraries(CMakeTestLibrary debug user32.lib)
target_link_libraries(CMakeTestLibrary optimized kernel32.lib)
endif()

View File

@@ -231,6 +231,12 @@ configure_file(
${Complex_SOURCE_DIR}/Library/dummy
${Complex_BINARY_DIR}/Library/dummylib.lib
COPYONLY)
if(CMAKE_C_COMPILER_ID STREQUAL "OrangeC")
configure_file(
${Complex_SOURCE_DIR}/Library/dummy
${Complex_BINARY_DIR}/Library/dummylib.l
COPYONLY)
endif()
foreach (ext ${CMAKE_SHLIB_SUFFIX};.so;.a;.sl)
configure_file(
${Complex_SOURCE_DIR}/Library/dummy

View File

@@ -45,7 +45,7 @@ add_executable(complex.file complex.file.cxx complex_nobuild.cxx
if (UNIX)
target_link_libraries(complex ${CMAKE_DL_LIBS})
elseif(NOT BORLAND AND NOT MINGW)
elseif(NOT BORLAND AND NOT MINGW AND NOT CMAKE_C_COMPILER_ID STREQUAL "OrangeC")
target_link_libraries(complex rpcrt4.lib)
endif ()

View File

@@ -23,7 +23,7 @@ set(LibrarySources ${LibrarySources}
remove(LibrarySources create_file.cxx GENERATED nonexisting_file)
add_library(CMakeTestLibrary ${LibrarySources})
if(WIN32 AND NOT CYGWIN AND NOT BORLAND AND NOT MINGW)
if(WIN32 AND NOT CYGWIN AND NOT BORLAND AND NOT MINGW AND NOT CMAKE_C_COMPILER_ID STREQUAL "OrangeC")
target_link_libraries(CMakeTestLibrary debug user32.lib)
target_link_libraries(CMakeTestLibrary optimized kernel32.lib)
endif()

View File

@@ -3,7 +3,7 @@ include("${CMAKE_CURRENT_LIST_DIR}/../check_installed.cmake")
if(CMAKE_HOST_SYSTEM_NAME STREQUAL "Linux")
check_installed([[^lib;lib/libdep8\.so;lib/liblib\.so;subdir;subdir/bin;subdir/bin/exe1;subdir/bin/exe2;subdir/lib;subdir/lib/libdep10\.so;subdir/lib/libdep11\.so;subdir/lib/libdep2\.so\.1;subdir/lib/libdep2\.so\.1\.2\.3;subdir/lib/libdep3\.so;subdir/lib/libdep5\.so;subdir/lib/libdep6\.so;subdir/lib/libdep8\.so;subdir/lib/libdep9\.so;subdir/lib/liblib\.so;subdir/lib/libmod\.so;subdir/lib/libsublib1\.so$]])
elseif(CMAKE_HOST_SYSTEM_NAME STREQUAL "Windows")
set(_msvc_check [[bin;bin/dep8\.dll;bin/lib\.dll;lib;lib/lib\.lib;subdir;subdir/bin;subdir/bin/dep10\.dll;subdir/bin/dep11\.dll;subdir/bin/dep2\.dll;subdir/bin/dep3\.dll;subdir/bin/dep5\.dll;subdir/bin/dep6\.dll;subdir/bin/dep8\.dll;subdir/bin/dep9\.dll;subdir/bin/exe1\.exe;subdir/bin/exe2\.exe;subdir/bin/lib\.dll;subdir/bin/sublib1\.dll;subdir/lib;subdir/lib/mod\.dll]])
set(_msvc_check [[bin;bin/dep8\.dll;bin/lib\.dll;lib;lib/lib\.(lib|l);subdir;subdir/bin;subdir/bin/dep10\.dll;subdir/bin/dep11\.dll;subdir/bin/dep2\.dll;subdir/bin/dep3\.dll;subdir/bin/dep5\.dll;subdir/bin/dep6\.dll;subdir/bin/dep8\.dll;subdir/bin/dep9\.dll;subdir/bin/exe1\.exe;subdir/bin/exe2\.exe;subdir/bin/lib\.dll;subdir/bin/sublib1\.dll;subdir/lib;subdir/lib/mod\.dll]])
set(_mingw_check [[bin;bin/libdep8\.dll;bin/liblib\.dll;lib;lib/liblib\.dll\.a;lib/liblib\.lib;subdir;subdir/bin;subdir/bin/exe1\.exe;subdir/bin/exe2\.exe;subdir/bin/libdep10\.dll;subdir/bin/libdep11\.dll;subdir/bin/libdep2\.dll;subdir/bin/libdep3\.dll;subdir/bin/libdep5\.dll;subdir/bin/libdep6\.dll;subdir/bin/libdep8\.dll;subdir/bin/libdep9\.dll;subdir/bin/liblib\.dll;subdir/bin/libsublib1\.dll;subdir/lib;subdir/lib/libmod\.dll]])
check_installed("^(${_msvc_check}|${_mingw_check})$")
elseif(CMAKE_HOST_SYSTEM_NAME STREQUAL "Darwin")

View File

@@ -55,7 +55,7 @@ endmacro()
# detailed features tables, not just meta-features
if (CMAKE_C_COMPILE_FEATURES)
if (NOT CMAKE_C_COMPILER_ID MATCHES "^(LCC|Cray|CrayClang|PGI|NVHPC|XL|XLClang|IBMClang|IntelLLVM|Fujitsu|FujitsuClang)$")
if (NOT CMAKE_C_COMPILER_ID MATCHES "^(LCC|Cray|CrayClang|PGI|NVHPC|XL|XLClang|IBMClang|IntelLLVM|Fujitsu|FujitsuClang|OrangeC)$")
set(C_expected_features ${CMAKE_C_COMPILE_FEATURES})
list(FILTER C_expected_features EXCLUDE REGEX "^c_std_[0-9][0-9]")
endif()
@@ -98,7 +98,7 @@ if (C_expected_features)
endif()
if (CMAKE_CXX_COMPILE_FEATURES)
if (NOT CMAKE_CXX_COMPILER_ID MATCHES "^(LCC|Cray|CrayClang|PGI|NVHPC|XL|XLClang|IBMClang|IntelLLVM|Fujitsu|FujitsuClang)$")
if (NOT CMAKE_CXX_COMPILER_ID MATCHES "^(LCC|Cray|CrayClang|PGI|NVHPC|XL|XLClang|IBMClang|IntelLLVM|Fujitsu|FujitsuClang|OrangeC)$")
set(CXX_expected_features ${CMAKE_CXX_COMPILE_FEATURES})
list(FILTER CXX_expected_features EXCLUDE REGEX "^cxx_std_[0-9][0-9]")
endif()

View File

@@ -1,5 +1,5 @@
set(CMAKE_FIND_LIBRARY_PREFIXES "lib" "")
set(CMAKE_FIND_LIBRARY_SUFFIXES ".lib" ".a" ".so" ".sl" ".dylib" ".dll.a")
set(CMAKE_FIND_LIBRARY_SUFFIXES ".lib" ".a" ".so" ".sl" ".dylib" ".dll.a" ".l")
find_library(TESTC1_LIB
NAMES testc1 testc1_test_debug_postfix

View File

@@ -10,6 +10,9 @@ unset(RunCMake_TEST_OPTIONS)
if(RunCMake_GENERATOR MATCHES "Watcom WMake|Borland Makefiles")
return()
endif()
if(CMAKE_CXX_COMPILER_ID STREQUAL "OrangeC")
return()
endif()
if(RunCMake_GENERATOR MATCHES "Ninja|Visual Studio" AND
CMAKE_CXX_COMPILER_ID STREQUAL "MSVC")
set(EXPORTS TRUE)

View File

@@ -6,7 +6,7 @@
Some library files are in directories implicitly searched by the linker
when invoked for C:
.*/Tests/RunCMake/CMP0060/CMP0060-WARN-ON-build/lib/(lib)?CMP0060.(a|lib)
.*/Tests/RunCMake/CMP0060/CMP0060-WARN-ON-build/lib/(lib)?CMP0060.(a|lib|l)
For compatibility with older versions of CMake, the generated link line
will ask the linker to search for these by library name.

View File

@@ -8,10 +8,10 @@ function(run_CMP0119 status)
endfunction()
if(NOT RunCMake_GENERATOR MATCHES "Visual Studio|Xcode" AND
NOT CMAKE_C_COMPILER_ID MATCHES "(Borland|Embarcadero|Watcom)")
NOT CMAKE_C_COMPILER_ID MATCHES "(Borland|Embarcadero|Watcom|OrangeC)")
run_CMP0119(WARN)
run_CMP0119(OLD)
endif()
if((CMAKE_C_COMPILER_ID MATCHES "(GNU|LCC|Clang|MSVC|Borland|Embarcadero|Intel|TI)"))
if((CMAKE_C_COMPILER_ID MATCHES "(GNU|LCC|Clang|MSVC|Borland|Embarcadero|Intel|TI|OrangeC)"))
run_CMP0119(NEW)
endif()

View File

@@ -201,6 +201,7 @@ elseif(CMake_TEST_Qt5)
endif()
if(CMAKE_GENERATOR MATCHES "Ninja")
set(Ninja_ARGS
-DCMAKE_C_COMPILER_ID=${CMAKE_C_COMPILER_ID}
-DCMAKE_C_OUTPUT_EXTENSION=${CMAKE_C_OUTPUT_EXTENSION}
-DCMAKE_SHARED_LIBRARY_PREFIX=${CMAKE_SHARED_LIBRARY_PREFIX}
-DCMAKE_SHARED_LIBRARY_SUFFIX=${CMAKE_SHARED_LIBRARY_SUFFIX})

View File

@@ -16,7 +16,7 @@
"type": "target",
"destination": "lib",
"paths": [
"^fileset/((Debug|Release|MinSizeRel|RelWithDebInfo)/)?(lib)?c_headers_1\\.(a|lib)?$"
"^fileset/((Debug|Release|MinSizeRel|RelWithDebInfo)/)?(lib)?c_headers_1\\.(a|lib|l)?$"
],
"isExcludeFromAll": null,
"isForAllComponents": null,
@@ -172,7 +172,7 @@
"type": "target",
"destination": "lib",
"paths": [
"^fileset/((Debug|Release|MinSizeRel|RelWithDebInfo)/)?(lib)?c_headers_2\\.(a|lib)?$"
"^fileset/((Debug|Release|MinSizeRel|RelWithDebInfo)/)?(lib)?c_headers_2\\.(a|lib|l)?$"
],
"isExcludeFromAll": null,
"isForAllComponents": null,

View File

@@ -80,7 +80,7 @@
"type": "target",
"destination": "lib",
"paths": [
"^((Debug|Release|MinSizeRel|RelWithDebInfo)/)?(lib)?c_shared_lib\\.(lib|dll\\.a)$"
"^((Debug|Release|MinSizeRel|RelWithDebInfo)/)?(lib)?c_shared_lib\\.(dll\\.a|lib|l)$"
],
"isExcludeFromAll": null,
"isForAllComponents": null,
@@ -173,7 +173,7 @@
"type": "target",
"destination": "lib",
"paths": [
"^cxx/((Debug|Release|MinSizeRel|RelWithDebInfo)/)?(lib)?cxx_shared_lib\\.(lib|dll\\.a)$"
"^cxx/((Debug|Release|MinSizeRel|RelWithDebInfo)/)?(lib)?cxx_shared_lib\\.(dll\\.a|lib|l)$"
],
"isExcludeFromAll": null,
"isForAllComponents": null,

View File

@@ -219,10 +219,10 @@
}
],
"folder": null,
"nameOnDisk": "^(lib)?c_headers_1\\.(a|lib)$",
"nameOnDisk": "^(lib)?c_headers_1\\.(a|lib|l)$",
"artifacts": [
{
"path": "^fileset/((Debug|Release|RelWithDebInfo|MinSizeRel)/)?(lib)?c_headers_1\\.(a|lib)$",
"path": "^fileset/((Debug|Release|RelWithDebInfo|MinSizeRel)/)?(lib)?c_headers_1\\.(a|lib|l)$",
"_dllExtra": false
}
],

View File

@@ -71,10 +71,10 @@
}
],
"folder": null,
"nameOnDisk": "^(lib)?c_headers_2\\.(a|lib)$",
"nameOnDisk": "^(lib)?c_headers_2\\.(a|lib|l)$",
"artifacts": [
{
"path": "^fileset/((Debug|Release|RelWithDebInfo|MinSizeRel)/)?(lib)?c_headers_2\\.(a|lib)$",
"path": "^fileset/((Debug|Release|RelWithDebInfo|MinSizeRel)/)?(lib)?c_headers_2\\.(a|lib|l)$",
"_dllExtra": false
}
],

View File

@@ -88,10 +88,10 @@
}
],
"folder": null,
"nameOnDisk": "^(lib)?c_lib\\.(a|lib)$",
"nameOnDisk": "^(lib)?c_lib\\.(a|lib|l)$",
"artifacts": [
{
"path": "^((Debug|Release|RelWithDebInfo|MinSizeRel)/)?(lib)?c_lib\\.(a|lib)$",
"path": "^((Debug|Release|RelWithDebInfo|MinSizeRel)/)?(lib)?c_lib\\.(a|lib|l)$",
"_dllExtra": false
}
],

View File

@@ -100,7 +100,7 @@
"_dllExtra": false
},
{
"path": "^((Debug|Release|RelWithDebInfo|MinSizeRel)/)?(lib)?c_shared_lib\\.(dll\\.a|lib)$",
"path": "^((Debug|Release|RelWithDebInfo|MinSizeRel)/)?(lib)?c_shared_lib\\.(dll\\.a|lib|l)$",
"_dllExtra": true
},
{

View File

@@ -88,10 +88,10 @@
}
],
"folder": null,
"nameOnDisk": "^(lib)?c_static_lib\\.(a|lib)$",
"nameOnDisk": "^(lib)?c_static_lib\\.(a|lib|l)$",
"artifacts": [
{
"path": "^((Debug|Release|RelWithDebInfo|MinSizeRel)/)?(lib)?c_static_lib\\.(a|lib)$",
"path": "^((Debug|Release|RelWithDebInfo|MinSizeRel)/)?(lib)?c_static_lib\\.(a|lib|l)$",
"_dllExtra": false
}
],

View File

@@ -113,10 +113,10 @@
}
],
"folder": null,
"nameOnDisk": "^(lib)?c_subdir\\.(a|lib)$",
"nameOnDisk": "^(lib)?c_subdir\\.(a|lib|l)$",
"artifacts": [
{
"path": "^((Debug|Release|RelWithDebInfo|MinSizeRel)/)?(lib)?c_subdir\\.(a|lib)$",
"path": "^((Debug|Release|RelWithDebInfo|MinSizeRel)/)?(lib)?c_subdir\\.(a|lib|l)$",
"_dllExtra": false
}
],

View File

@@ -64,10 +64,10 @@
}
],
"folder": null,
"nameOnDisk": "^(lib)?cxx_lib\\.(a|lib)$",
"nameOnDisk": "^(lib)?cxx_lib\\.(a|lib|l)$",
"artifacts": [
{
"path": "^cxx/((Debug|Release|RelWithDebInfo|MinSizeRel)/)?(lib)?cxx_lib\\.(a|lib)$",
"path": "^cxx/((Debug|Release|RelWithDebInfo|MinSizeRel)/)?(lib)?cxx_lib\\.(a|lib|l)$",
"_dllExtra": false
}
],

View File

@@ -76,7 +76,7 @@
"_dllExtra": false
},
{
"path": "^cxx/((Debug|Release|RelWithDebInfo|MinSizeRel)/)?(lib)?cxx_shared_lib\\.(dll\\.a|lib)$",
"path": "^cxx/((Debug|Release|RelWithDebInfo|MinSizeRel)/)?(lib)?cxx_shared_lib\\.(dll\\.a|lib|l)$",
"_dllExtra": true
},
{

View File

@@ -64,10 +64,10 @@
}
],
"folder": null,
"nameOnDisk": "^(lib)?cxx_static_lib\\.(a|lib)$",
"nameOnDisk": "^(lib)?cxx_static_lib\\.(a|lib|l)$",
"artifacts": [
{
"path": "^cxx/((Debug|Release|RelWithDebInfo|MinSizeRel)/)?(lib)?cxx_static_lib\\.(a|lib)$",
"path": "^cxx/((Debug|Release|RelWithDebInfo|MinSizeRel)/)?(lib)?cxx_static_lib\\.(a|lib|l)$",
"_dllExtra": false
}
],

View File

@@ -170,7 +170,7 @@
"_dllExtra": false
},
{
"path": "^lib/((Debug|Release|RelWithDebInfo|MinSizeRel)/)?(lib)?my_interface_exe\\.(dll\\.a|lib)$",
"path": "^lib/((Debug|Release|RelWithDebInfo|MinSizeRel)/)?(lib)?my_interface_exe\\.(dll\\.a|lib|l)$",
"_dllExtra": true
},
{

View File

@@ -76,7 +76,7 @@
"_dllExtra": false
},
{
"path": "^framework/((Debug|Release|RelWithDebInfo|MinSizeRel)/)?(lib)?shared_framework\\.(dll\\.a|lib)$",
"path": "^framework/((Debug|Release|RelWithDebInfo|MinSizeRel)/)?(lib)?shared_framework\\.(dll\\.a|lib|l)$",
"_dllExtra": true
},
{

View File

@@ -64,10 +64,10 @@
}
],
"folder": null,
"nameOnDisk": "^(lib)?static_framework\\.(a|lib)$",
"nameOnDisk": "^(lib)?static_framework\\.(a|lib|l)$",
"artifacts": [
{
"path": "^framework/((Debug|Release|RelWithDebInfo|MinSizeRel)/)?(lib)?static_framework\\.(a|lib)$",
"path": "^framework/((Debug|Release|RelWithDebInfo|MinSizeRel)/)?(lib)?static_framework\\.(a|lib|l)$",
"_dllExtra": false
}
],

View File

@@ -98,7 +98,7 @@ if (WIN32 OR CYGWIN)
if((CMAKE_CXX_COMPILER_ID STREQUAL "Clang" OR CMAKE_CXX_COMPILER_ID STREQUAL "IntelLLVM") AND
CMAKE_CXX_SIMULATE_ID STREQUAL "MSVC")
set(_platform Win32-Clang)
elseif(MSVC AND COMPILER_HAS_DEPRECATED)
elseif((MSVC OR CMAKE_C_COMPILER_ID STREQUAL "OrangeC") AND COMPILER_HAS_DEPRECATED)
set(_platform Win32)
elseif(CYGWIN AND COMPILER_HAS_DEPRECATED)
set(_platform Cygwin)

View File

@@ -348,7 +348,11 @@ if("${ninja_version}" VERSION_LESS 1.6)
return()
endif()
foreach(ninja_output_path_prefix "sub space" "sub")
set(ninja_output_path_prefixes "sub")
if(NOT CMAKE_C_COMPILER_ID STREQUAL "OrangeC")
list(APPEND ninja_output_path_prefixes "sub space")
endif()
foreach(ninja_output_path_prefix IN LISTS ninja_output_path_prefixes)
run_sub_cmake(Executable "${ninja_output_path_prefix}")
run_sub_cmake(StaticLib "${ninja_output_path_prefix}")
run_sub_cmake(SharedLib "${ninja_output_path_prefix}")

View File

@@ -8,7 +8,7 @@ set(expected_compile_commands
]*",
"file": "[^
]*(/Tests/RunCMake/NinjaMultiConfig/main\.c|\\\\Tests\\\\RunCMake\\\\NinjaMultiConfig\\\\main\.c)",
"output": "(CMakeFiles/exe\.dir/Debug/main\.c\.o|CMakeFiles\\\\exe\.dir\\\\Debug\\\\main\.c\.obj)"
"output": "(CMakeFiles/exe\.dir/Debug/main\.c\.o|CMakeFiles\\\\exe\.dir\\\\Debug\\\\main\.c\.(obj|o))"
},
{
"directory": "[^
@@ -18,7 +18,7 @@ set(expected_compile_commands
]*",
"file": "[^
]*(/Tests/RunCMake/NinjaMultiConfig/main\.c|\\\\Tests\\\\RunCMake\\\\NinjaMultiConfig\\\\main\.c)",
"output": "(CMakeFiles/exe\.dir/Release/main\.c\.o|CMakeFiles\\\\exe\.dir\\\\Release\\\\main\.c\.obj)"
"output": "(CMakeFiles/exe\.dir/Release/main\.c\.o|CMakeFiles\\\\exe\.dir\\\\Release\\\\main\.c\.(obj|o))"
}
]$]==])

View File

@@ -17,7 +17,7 @@ function(check_files dir)
list(SORT expected)
file(GLOB_RECURSE actual "${dir}/*")
list(FILTER actual EXCLUDE REGEX "/CMakeFiles/|\\.ninja$|/CMakeCache\\.txt$|/target_files[^/]*\\.cmake$|/\\.ninja_[^/]*$|/cmake_install\\.cmake$|\\.ilk$|\\.manifest$|\\.pdb$|\\.exp$|/install_manifest\\.txt$|/\\.qt/QtDeploySupport[^/]*\\.cmake$")
list(FILTER actual EXCLUDE REGEX "/CMakeFiles/|\\.ninja$|/CMakeCache\\.txt$|/target_files[^/]*\\.cmake$|/\\.ninja_[^/]*$|/cmake_install\\.cmake$|\\.ilk$|\\.manifest$|\\.odx$|\\.pdb$|\\.exp$|/install_manifest\\.txt$|/\\.qt/QtDeploySupport[^/]*\\.cmake$")
foreach(f IN LISTS _check_files_INCLUDE _check_files_EXCLUDE)
if(EXISTS ${f})
list(APPEND actual ${f})

View File

@@ -1 +1 @@
^ninja: error: unknown target 'simplestatic:all'$
^ninja: error: unknown target 'simplestatic:all'(, did you mean 'simplestatic.l'\?)?$

View File

@@ -1,4 +1,4 @@
if(CMAKE_C_COMPILER_ID STREQUAL "Borland")
if(CMAKE_C_COMPILER_ID MATCHES "^(Borland|OrangeC)$")
# Borland upper-cases dll names referenced in import libraries.
set(conflict_dll [[CONFLICT\.DLL]])
set(unresolved_dll [[UNRESOLVED\.DLL]])

View File

@@ -0,0 +1,7 @@
^CMake Error at cmake_install\.cmake:[0-9]+ \(file\):
file Multiple conflicting paths found for PATH\.DLL:
[^
]*/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/windows-conflict-build/root-all/lib/test1/path\.dll
[^
]*/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/windows-conflict-build/root-all/lib/test2/path\.dll$

View File

@@ -0,0 +1,4 @@
^CMake Error at cmake_install\.cmake:[0-9]+ \(file\):
file Could not resolve runtime dependencies:
UNRESOLVED\.DLL$

View File

@@ -1,7 +1,7 @@
if(WIN32)
set(_check_files
[[lib3]]
[[lib3/(lib)?lib3\.(dll\.a|lib)]]
[[lib3/(lib)?lib3\.(dll\.a|lib|l)]]
[[lib4]]
[[lib4/(lib)?lib4\.dll]]
[[mybin]]
@@ -10,8 +10,8 @@ if(WIN32)
[[myinclude]]
[[myinclude/obj3\.h]]
[[mylib]]
[[mylib/(lib)?lib1\.(dll\.a|lib)]]
[[mylib/(lib)?lib2\.(a|lib)]]
[[mylib/(lib)?lib1\.(dll\.a|lib|l)]]
[[mylib/(lib)?lib2\.(a|lib|l)]]
)
elseif(MSYS)
set(_check_files

View File

@@ -8,10 +8,10 @@ if(WIN32)
[[include/obj2\.h]]
[[include/obj3\.h]]
[[lib]]
[[lib/(lib)?lib1\.(dll\.a|lib)]]
[[lib/(lib)?lib2\.(a|lib)]]
[[lib/(lib)?lib1\.(dll\.a|lib|l)]]
[[lib/(lib)?lib2\.(a|lib|l)]]
[[lib3]]
[[lib3/(lib)?lib3\.(dll\.a|lib)]]
[[lib3/(lib)?lib3\.(dll\.a|lib|l)]]
[[lib4]]
[[lib4/(lib)?lib4\.dll]]
)

View File

@@ -1,7 +1,7 @@
if(WIN32)
set(test123 [[bin/test1out\.exe;bin/test2deb\.exe;bin/test3exc\.exe]])
set(libtest45 [[bin/libtest4\.dll;bin/libtest4\.dll\.a;bin/libtest5ar\.a]])
set(test45 [[bin/test4\.dll;bin/test4\.lib;bin/test5ar\.lib]])
set(test45 [[bin/test4\.dll;bin/test4\.(lib|l);bin/test5ar\.(lib|l)]])
check_installed("^bin;(${libtest45};${test123})|(${test123};${test45})\$")
elseif(MSYS)

View File

@@ -1 +1 @@
check_installed([[^include;include/obj1\.h;lib;lib/(mylib\.lib|(lib|cyg)mylib\.a)$]])
check_installed([[^include;include/obj1\.h;lib;lib/(mylib\.(lib|l)|(lib|cyg)mylib\.a)$]])

View File

@@ -1 +1 @@
check_installed([[^static;static/(liblib\.a|lib\.lib)$]])
check_installed([[^static;static/(liblib\.a|lib\.(lib|l))$]])

View File

@@ -31,7 +31,7 @@ if ((RunCMake_GENERATOR MATCHES "Makefiles|Ninja|Xcode"
set(LINK_SHARED_LIBRARY_PREFIX ${CMAKE_SHARED_LIBRARY_PREFIX})
set(LINK_SHARED_LIBRARY_SUFFIX ${CMAKE_SHARED_LIBRARY_SUFFIX})
endif()
if (MINGW OR MSYS OR CYGWIN)
if (MINGW OR MSYS OR CYGWIN OR CMAKE_C_COMPILER_ID STREQUAL "OrangeC")
set(LINK_EXTERN_LIBRARY_SUFFIX "")
else()
set(LINK_EXTERN_LIBRARY_SUFFIX "${CMAKE_IMPORT_LIBRARY_SUFFIX}")

View File

@@ -5,7 +5,7 @@
#if defined(_WIN32) && \
(defined(_MSC_VER) || defined(__WATCOMC__) || defined(__BORLANDC__) || \
defined(__MINGW32__))
defined(__MINGW32__) || defined(__ORANGEC__))
# include <direct.h>
# include <io.h>