Commit 21ab58d3 authored by Fred Baksik's avatar Fred Baksik

GHS: Update test suite

-- Allow for testing default toolset settings
   If CMake_TEST_GreenHillsMULTI_config is not defined then
   just run the GHS tests using defaults.
-- Handle paths that contain spaces
-- Update test suite to use "-non_shared" linker option
   Fixes linking issue if GHS is not shipped with shared libraries
-- Other minor cleanup
parent 72e0c115
......@@ -532,6 +532,7 @@ void cmGhsMultiTargetGenerator::WriteObjectLangOverride(
}
}
}
void cmGhsMultiTargetGenerator::WriteReferences(std::ostream& fout)
{
// This only applies to INTEGRITY Applications
......
......@@ -2260,11 +2260,18 @@ ${CMake_BINARY_DIR}/bin/cmake -DDIR=dev -P ${CMake_SOURCE_DIR}/Utilities/Release
endif()
if (CMake_TEST_GreenHillsMULTI)
macro(add_test_GhsMulti test_name test_dir bin_sub_dir build_opts test_cmd)
separate_arguments(_build_opts UNIX_COMMAND ${build_opts})
separate_arguments(_test_cmd UNIX_COMMAND ${test_cmd})
macro(add_test_GhsMulti test_name test_dir bin_sub_dir build_opts)
separate_arguments(_ghs_build_opts UNIX_COMMAND ${build_opts})
separate_arguments(_ghs_toolset_extra UNIX_COMMAND ${ghs_toolset_extra})
add_test(NAME GhsMulti.${ghs_config_name}.${test_name}
if(${ARGC} GREATER 4)
set(_ghs_test_command --test-command ${ARGN})
endif()
if(ghs_config_name STREQUAL "__default__")
set(_ghs_test_name "${test_name}")
else()
set(_ghs_test_name "${ghs_config_name}.${test_name}")
endif()
add_test(NAME GhsMulti.${_ghs_test_name}
COMMAND ${CMAKE_CTEST_COMMAND}
--build-and-test
"${CMake_SOURCE_DIR}/Tests/GhsMulti/${test_dir}"
......@@ -2273,51 +2280,71 @@ ${CMake_BINARY_DIR}/bin/cmake -DDIR=dev -P ${CMake_SOURCE_DIR}/Utilities/Release
--build-project test
--build-config $<CONFIGURATION>
--build-options ${ghs_target_arch} ${ghs_toolset_name} ${ghs_toolset_root} ${ghs_target_platform}
${ghs_os_root} ${ghs_os_dir} ${ghs_bsp_name} ${_build_opts} ${_ghs_toolset_extra}
--test-command ${_test_cmd}
${ghs_os_root} ${ghs_os_dir} ${ghs_bsp_name} ${_ghs_build_opts} ${_ghs_toolset_extra}
${_ghs_test_command}
)
endmacro ()
unset(_ghs_build_opts)
unset(_ghs_toolset_extra)
unset(_ghs_test_command)
unset(_ghs_test_name)
endmacro()
macro(add_test_GhsMulti_rename_install test_name)
add_test_GhsMulti( ${test_name} GhsMultiRenameInstall ${test_name}
"-DCMAKE_INSTALL_PREFIX=. -DRUN_TEST=${test_name}" "${CMAKE_CMAKE_COMMAND} -P ./cmake_install.cmake")
endmacro ()
"-DCMAKE_INSTALL_PREFIX=. -DRUN_TEST=${test_name}" ${CMAKE_CMAKE_COMMAND} -P ./cmake_install.cmake)
endmacro()
#unset ghs config variables
unset(ghs_config_name)
unset(ghs_target_arch)
unset(ghs_toolset_root)
unset(ghs_toolset_name)
unset(ghs_os_root)
unset(ghs_os_dir)
unset(ghs_target_platform)
unset(ghs_bsp_name)
unset(ghs_toolset_extra)
if(NOT CMake_TEST_GreenHillsMULTI_config)
#if list of config settings not defined then just run once as default
set(CMake_TEST_GreenHillsMULTI_config "__default__")
endif()
foreach(ghs_file IN LISTS CMake_TEST_GreenHillsMULTI_config)
# source GHS tools config file
if(IS_ABSOLUTE ${ghs_file})
include(${ghs_file})
else()
include(${CMAKE_BINARY_DIR}/${ghs_file})
if(NOT ghs_file STREQUAL "__default__")
if(IS_ABSOLUTE ${ghs_file})
include(${ghs_file})
else()
include(${CMAKE_BINARY_DIR}/${ghs_file})
endif()
endif()
if(NOT ghs_config_name)
set(ghs_config_name "__default__")
endif()
# test integrity build
if (NOT ghs_skip_integrity AND (NOT ghs_target_platform OR ghs_target_platform MATCHES "integrity"))
add_test_GhsMulti(integrityDDInt GhsMultiIntegrity/GhsMultiIntegrityDDInt "" "" "")
add_test_GhsMulti(integrityMonolith GhsMultiIntegrity/GhsMultiIntegrityMonolith "" "" "")
add_test_GhsMulti(integrityDD GhsMultiIntegrity/GhsMultiIntegrityDD "" "" "")
endif ()
add_test_GhsMulti(duplicate_source_filenames GhsMultiDuplicateSourceFilenames "" "" "")
add_test_GhsMulti(integrityDDInt GhsMultiIntegrity/GhsMultiIntegrityDDInt "" "")
add_test_GhsMulti(integrityMonolith GhsMultiIntegrity/GhsMultiIntegrityMonolith "" "")
add_test_GhsMulti(integrityDD GhsMultiIntegrity/GhsMultiIntegrityDD "" "")
endif()
add_test_GhsMulti(duplicate_source_filenames GhsMultiDuplicateSourceFilenames "" "")
add_test_GhsMulti_rename_install(SINGLE_EXEC)
add_test_GhsMulti_rename_install(SINGLE_EXEC_RENAMED)
add_test_GhsMulti_rename_install(EXEC_AND_LIB)
add_test_GhsMulti(multiple_source_groups GhsMultiSrcGroups Default "" "")
add_test_GhsMulti(multiple_source_groups_folders GhsMultiSrcGroups PropFolders "-DTEST_PROP=ON" "")
add_test_GhsMulti(multiple_source_groups_all_folders GhsMultiSrcGroups AllFolders "-DGHS_NO_SOURCE_GROUP_FILE=ON" "")
add_test_GhsMulti(unsupported_targets GhsMultiUnsupportedTargets "" "" "")
set_tests_properties(GhsMulti.${ghs_config_name}.unsupported_targets PROPERTIES TIMEOUT 15)
add_test_GhsMulti(object_library GhsMultiObjectLibrary "" "" "")
set_tests_properties(GhsMulti.${ghs_config_name}.object_library PROPERTIES TIMEOUT 15)
add_test_GhsMulti(multiple_source_groups GhsMultiSrcGroups Default "")
add_test_GhsMulti(multiple_source_groups_folders GhsMultiSrcGroups PropFolders "-DTEST_PROP=ON")
add_test_GhsMulti(multiple_source_groups_all_folders GhsMultiSrcGroups AllFolders "-DGHS_NO_SOURCE_GROUP_FILE=ON")
add_test_GhsMulti(unsupported_targets GhsMultiUnsupportedTargets "" "")
add_test_GhsMulti(object_library GhsMultiObjectLibrary "" "")
add_test_GhsMulti(exclude GhsMultiExclude "" ""
"${CMAKE_CMAKE_COMMAND} -P ${CMake_SOURCE_DIR}/Tests/GhsMulti/GhsMultiExclude/verify.cmake")
add_test_GhsMulti(interface GhsMultiInterface "" "" "")
set_tests_properties(GhsMulti.${ghs_config_name}.interface PROPERTIES TIMEOUT 15)
add_test_GhsMulti(transitive_link_test GhsMultiLinkTest TransitiveLink "-DRUN_TEST=NO_FLAGS" "")
add_test_GhsMulti(flags_link_test GhsMultiLinkTest FlagsCheck "-DRUN_TEST=CHECK_FLAGS" "")
add_test_GhsMulti(sub_link_test GhsMultiLinkTestSub "" "" "")
${CMAKE_CMAKE_COMMAND} -P ${CMake_SOURCE_DIR}/Tests/GhsMulti/GhsMultiExclude/verify.cmake)
add_test_GhsMulti(interface GhsMultiInterface "" "")
add_test_GhsMulti(transitive_link_test GhsMultiLinkTest TransitiveLink "-DRUN_TEST=NO_FLAGS")
add_test_GhsMulti(flags_link_test GhsMultiLinkTest FlagsCheck "-DRUN_TEST=CHECK_FLAGS")
add_test_GhsMulti(sub_link_test GhsMultiLinkTestSub "" "")
add_test_GhsMulti(multiple_projects GhsMultiMultipleProjects "" ""
"${CMAKE_CMAKE_COMMAND} -P ${CMake_SOURCE_DIR}/Tests/GhsMulti/GhsMultiMultipleProjects/verify.cmake")
add_test_GhsMulti(compiler_options_none GhsMultiCompilerOptions None "-DRUN_TEST=RELEASE_FLAGS -DRUN_TEST_BUILD_TYPE=\"\"" "")
add_test_GhsMulti(compiler_options_kernel GhsMultiCompilerOptions Kernel "-DRUN_TEST=KERNEL_FLAGS -DRUN_TEST_BUILD_TYPE=DEBUG" "")
add_test_GhsMulti(try_compile_copy GhsMultiCopyFile "" "" "")
add_test_GhsMulti(ghs_platform GhsMultiPlatform "" "" "")
${CMAKE_CMAKE_COMMAND} -P ${CMake_SOURCE_DIR}/Tests/GhsMulti/GhsMultiMultipleProjects/verify.cmake)
add_test_GhsMulti(compiler_options_none GhsMultiCompilerOptions None "-DRUN_TEST=RELEASE_FLAGS -DRUN_TEST_BUILD_TYPE=\"\"")
add_test_GhsMulti(compiler_options_kernel GhsMultiCompilerOptions Kernel "-DRUN_TEST=KERNEL_FLAGS -DRUN_TEST_BUILD_TYPE=DEBUG")
add_test_GhsMulti(try_compile_copy GhsMultiCopyFile "" "")
add_test_GhsMulti(ghs_platform GhsMultiPlatform "" "")
list(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/GhsMulti/${ghs_config_name}")
#unset ghs config variables
unset(ghs_config_name)
......@@ -2329,8 +2356,8 @@ ${CMake_BINARY_DIR}/bin/cmake -DDIR=dev -P ${CMake_SOURCE_DIR}/Utilities/Release
unset(ghs_target_platform)
unset(ghs_bsp_name)
unset(ghs_toolset_extra)
endforeach(ghs_file)
endif ()
endforeach()
endif()
if(tegra AND NOT "${CMake_SOURCE_DIR};${CMake_BINARY_DIR}" MATCHES " ")
macro(add_test_VSNsightTegra name generator)
......
......@@ -5,24 +5,28 @@ cmake_minimum_required(VERSION 3.12 FATAL_ERROR)
project(test C)
if(CMAKE_C_COMPILER_ID STREQUAL "GHS")
add_link_options("-non_shared")
endif()
if(RUN_TEST STREQUAL "RELEASE_FLAGS")
#RELEASE flags used when CMAKE_BUILD_TYPE is undefined
string(APPEND CMAKE_C_FLAGS_RELEASE " -unexpected_release_option")
add_executable(test_none test.c)
#RELEASE flags used when CMAKE_BUILD_TYPE is undefined
string(APPEND CMAKE_C_FLAGS_RELEASE " -unexpected_release_option")
add_executable(test_none test.c)
endif()
if(RUN_TEST STREQUAL "KERNEL_FLAGS")
#DEBUG flag missing when -kernel is added as a compile option
string(APPEND CMAKE_C_FLAGS_DEBUG " -required-debug-option")
#DEBUG flag missing when -kernel is added as a compile option
string(APPEND CMAKE_C_FLAGS_DEBUG " -required-debug-option")
add_executable(K1 test.c)
add_executable(K1 test.c)
add_executable(K2 test.c)
target_compile_options(K2 PRIVATE -kernel)
add_executable(K2 test.c)
target_compile_options(K2 PRIVATE -kernel)
add_executable(K3 test.c)
target_compile_options(K3 PRIVATE -kernel=fast)
add_executable(K3 test.c)
target_compile_options(K3 PRIVATE -kernel=fast)
add_executable(K4 test.c)
target_link_options(K4 PRIVATE -kernel)
add_executable(K4 test.c)
target_link_options(K4 PRIVATE -kernel)
endif()
......@@ -12,6 +12,6 @@ add_library(libdemo
add_executable(demo main.c)
target_link_libraries(demo libdemo)
if(GHSMULTI)
target_compile_options(demo PUBLIC "-non_shared")
if(CMAKE_C_COMPILER_ID STREQUAL "GHS")
target_link_options(demo PRIVATE "-non_shared")
endif()
......@@ -5,6 +5,10 @@ cmake_minimum_required(VERSION 3.12 FATAL_ERROR)
project(test C)
if(CMAKE_C_COMPILER_ID STREQUAL "GHS")
add_link_options("-non_shared")
endif()
add_library(lib1 lib1.c)
set_target_properties( lib1 PROPERTIES EXCLUDE_FROM_ALL yes )
......
......@@ -5,6 +5,8 @@ cmake_minimum_required(VERSION 3.12 FATAL_ERROR)
project(test C)
add_link_options("-non_shared")
# create virtual AS
add_executable(vas exe.c)
target_link_libraries(vas lib)
......
......@@ -3,6 +3,8 @@
cmake_minimum_required(VERSION 3.12 FATAL_ERROR)
add_link_options("-non_shared")
project(test C)
# create virtual AS
......
......@@ -37,7 +37,7 @@ if (RUN_TEST STREQUAL "NO_FLAGS")
endif()
else()
unset(fileName CACHE)
find_file (fileName exe1.gpj
find_file(fileName exe1.gpj
${CMAKE_CURRENT_BINARY_DIR}/link_build
${CMAKE_CURRENT_BINARY_DIR}/link_build/exe1
)
......@@ -50,12 +50,12 @@ else()
-lcsl1 csl2
-clinkexe1 -clinkexe2
-special-lib2-public-link)
foreach( opt IN LISTS expected_flags )
foreach(opt IN LISTS expected_flags)
string(FIND "${fileText}" "${opt}" opt_found)
if ( opt_found EQUAL -1 )
message(SEND_ERROR "Could not find: ${opt}")
endif()
endforeach(opt)
endforeach()
unset(fileName CACHE)
find_file (fileName lib1.gpj
......@@ -67,12 +67,12 @@ else()
set(expected_flags
-clinkexeA1 -clinkexeA2
-static-lib-flags1 -static-lib-flags2)
foreach( opt IN LISTS expected_flags )
foreach(opt IN LISTS expected_flags)
string(FIND "${fileText}" "${opt}" opt_found)
if ( opt_found EQUAL -1 )
if (opt_found EQUAL -1)
message(SEND_ERROR "Could not find: ${opt}")
endif()
endforeach(opt)
endforeach()
unset(fileName CACHE)
find_file (fileName lib2.gpj
......@@ -83,10 +83,10 @@ else()
file(STRINGS ${fileName} fileText)
set(expected_flags
-clinkexeA1 -clinkexeA2)
foreach( opt IN LISTS expected_flags )
foreach(opt IN LISTS expected_flags)
string(FIND "${fileText}" "${opt}" opt_found)
if ( opt_found EQUAL -1 )
message(SEND_ERROR "Could not find: ${opt}")
endif()
endforeach(opt)
endforeach()
endif()
......@@ -5,31 +5,39 @@ cmake_minimum_required(VERSION 3.12 FATAL_ERROR)
project(test C)
if( RUN_TEST STREQUAL "CHECK_FLAGS" )
add_link_options(-add-link-options1 -add-link-options2)
link_directories(link_directories_used1 link_directories_used2 "c:/absolute")
link_libraries(link_libraries_used1 link_libraries_used2 )
set( CMAKE_C_STANDARD_LIBRARIES "${CMAKE_C_STANDARD_LIBRARIES} -lcsl1 csl2" )
set( CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -clinkexe1 -clinkexe2")
if(CMAKE_C_COMPILER_ID STREQUAL "GHS")
add_link_options("-non_shared")
endif()
if(RUN_TEST STREQUAL "CHECK_FLAGS")
add_link_options(-add-link-options1 -add-link-options2)
link_directories(link_directories_used1 link_directories_used2 "c:/absolute")
link_libraries(link_libraries_used1 link_libraries_used2 )
set( CMAKE_C_STANDARD_LIBRARIES "${CMAKE_C_STANDARD_LIBRARIES} -lcsl1 csl2" )
set( CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -clinkexe1 -clinkexe2")
endif()
add_executable(exe1 exe1.c)
target_link_libraries(exe1 lib1)
if( RUN_TEST STREQUAL "CHECK_FLAGS" )
set_property( TARGET exe1 APPEND_STRING PROPERTY LINK_FLAGS "--link-flag-prop1 --link-flag-prop2")
set_property( TARGET exe1 APPEND PROPERTY LINK_OPTIONS --link-opt-prop1 --link-opt-prop2)
if(RUN_TEST STREQUAL "CHECK_FLAGS")
set_property(TARGET exe1 APPEND_STRING PROPERTY LINK_FLAGS "--link-flag-prop1 --link-flag-prop2")
set_property(TARGET exe1 APPEND PROPERTY LINK_OPTIONS --link-opt-prop1 --link-opt-prop2)
endif()
if( RUN_TEST STREQUAL "CHECK_FLAGS" )
set( CMAKE_STATIC_LINKER_FLAGS ${CMAKE_STATIC_LINKER_FLAGS} "-clinkexeA1 -clinkexeA2")
if(RUN_TEST STREQUAL "CHECK_FLAGS")
set(CMAKE_STATIC_LINKER_FLAGS ${CMAKE_STATIC_LINKER_FLAGS} "-clinkexeA1 -clinkexeA2")
endif()
add_library(lib1 STATIC func2.c func3.c func4.c)
target_link_libraries(lib1 lib2)
if( RUN_TEST STREQUAL "CHECK_FLAGS" )
set_property( TARGET lib1 APPEND_STRING PROPERTY STATIC_LIBRARY_FLAGS "-static-lib-flags1 -static-lib-flags2")
if(RUN_TEST STREQUAL "CHECK_FLAGS")
set_property(TARGET lib1 APPEND_STRING PROPERTY STATIC_LIBRARY_FLAGS "-static-lib-flags1 -static-lib-flags2")
endif()
add_library(lib2 STATIC func5.c func6.c func7.c)
if( RUN_TEST STREQUAL "CHECK_FLAGS" )
target_link_options(lib2 PUBLIC -special-lib2-public-link)
if(RUN_TEST STREQUAL "CHECK_FLAGS")
target_link_options(lib2 PUBLIC -special-lib2-public-link)
endif()
......@@ -7,3 +7,6 @@ project(test C)
add_executable(exe1 exe1.c)
target_link_libraries(exe1 lib1)
if(CMAKE_C_COMPILER_ID STREQUAL "GHS")
target_link_options(exe1 PRIVATE "-non_shared")
endif()
......@@ -5,6 +5,10 @@ cmake_minimum_required(VERSION 3.12 FATAL_ERROR)
project(test C)
if(CMAKE_C_COMPILER_ID STREQUAL "GHS")
add_link_options("-non_shared")
endif()
add_library(lib1 lib1.c)
add_executable(exe1 exe1.c)
target_link_libraries(exe1 lib1)
......
......@@ -3,13 +3,13 @@
#test project was generated
unset(fileName CACHE)
find_file (fileName lib3.gpj
find_file(fileName lib3.gpj
${CMAKE_CURRENT_BINARY_DIR}
${CMAKE_CURRENT_BINARY_DIR}/lib3
${CMAKE_CURRENT_BINARY_DIR}/examples
)
if ( fileName )
if (fileName)
message("Found target lib3: ${fileName}")
else()
message(SEND_ERROR "Could not find target lib3: ${fileName}")
......@@ -23,7 +23,7 @@ find_file (fileName exe3.gpj
${CMAKE_CURRENT_BINARY_DIR}/examples
)
if ( fileName )
if (fileName)
message("Found target exe3: ${fileName}")
else()
message(SEND_ERROR "Could not find target exe3: ${fileName}")
......@@ -37,7 +37,7 @@ find_file (fileName lib3.a
${CMAKE_CURRENT_BINARY_DIR}/examples
)
if ( fileName )
if (fileName)
message(SEND_ERROR "Found target lib3: ${fileName}")
else()
message("Could not find target lib3: ${fileName}")
......@@ -51,7 +51,7 @@ find_file (fileName NAMES exe3.as exe3
${CMAKE_CURRENT_BINARY_DIR}/examples
)
if ( fileName )
if (fileName)
message(SEND_ERROR "Found target exe3: ${fileName}")
else()
message("Could not find target exe3: ${fileName}")
......
......@@ -8,3 +8,6 @@ project(test C)
add_library(obj1 OBJECT testObj.c testObj.h sub/testObj.c testObj2.c)
add_executable(exe1 exe.c $<TARGET_OBJECTS:obj1>)
if(CMAKE_C_COMPILER_ID STREQUAL "GHS")
target_link_options(exe1 PRIVATE "-non_shared")
endif()
......@@ -5,9 +5,12 @@ cmake_minimum_required(VERSION 3.12 FATAL_ERROR)
project(test)
message("PLATFORM_ID = ${PLATFORM_ID}")
message("CMAKE_C_COMPILER = ${CMAKE_C_COMPILER}")
message("CMAKE_C_COMPILER_ID = ${CMAKE_C_COMPILER_ID}")
message("CMAKE_C_COMPILER_VERSION = ${CMAKE_C_COMPILER_VERSION}")
message("CMAKE_C_COMPILER_VERSION_INTERNAL = ${CMAKE_C_COMPILER_VERSION_INTERNAL}")
message("CMAKE_C_PLATFORM_ID = ${CMAKE_C_PLATFORM_ID}")
message("CMAKE_C_COMPILER_ARCHITECTURE_ID = ${CMAKE_C_COMPILER_ARCHITECTURE_ID}")
message("CMAKE_C_COMPILER_ABI = ${CMAKE_C_COMPILER_ABI}")
......@@ -16,6 +19,7 @@ message("CMAKE_C_STANDARD_COMPUTED_DEFAULT = ${CMAKE_C_STANDARD_COMPUTED_DEFAULT
message("CMAKE_CXX_COMPILER = ${CMAKE_CXX_COMPILER}")
message("CMAKE_CXX_COMPILER_ID = ${CMAKE_CXX_COMPILER_ID}")
message("CMAKE_CXX_COMPILER_VERSION = ${CMAKE_CXX_COMPILER_VERSION}")
message("CMAKE_CXX_COMPILER_VERSION_INTERNAL = ${CMAKE_CXX_COMPILER_VERSION_INTERNAL}")
message("CMAKE_CXX_PLATFORM_ID = ${CMAKE_CXX_PLATFORM_ID}")
message("CMAKE_CXX_COMPILER_ARCHITECTURE_ID = ${CMAKE_CXX_COMPILER_ARCHITECTURE_ID}")
message("CMAKE_CXX_COMPILER_ABI = ${CMAKE_CXX_COMPILER_ABI}")
......
#include <stdio.h>
int main(void)
{
printf("Testing...\n");
return -42;
}
......@@ -7,29 +7,33 @@ project(test C)
set(targets_to_install "")
if( RUN_TEST STREQUAL "SINGLE_EXEC" )
add_executable(exe1 exe.c)
set(targets_to_install ${targets_to_install} exe1)
if(CMAKE_C_COMPILER_ID STREQUAL "GHS")
add_link_options("-non_shared")
endif()
if( RUN_TEST STREQUAL "SINGLE_EXEC_RENAMED" )
set(name new_name)
add_executable(exe1 exe.c)
set_property(TARGET exe1 PROPERTY RUNTIME_OUTPUT_DIRECTORY ${name}_bin_$<CONFIG>)
set_property(TARGET exe1 PROPERTY OUTPUT_NAME ${name}_$<CONFIG>)
set_property(TARGET exe1 PROPERTY SUFFIX .bin)
set(targets_to_install ${targets_to_install} exe1)
if(RUN_TEST STREQUAL "SINGLE_EXEC")
add_executable(exe1 exe.c)
set(targets_to_install ${targets_to_install} exe1)
endif()
if( RUN_TEST STREQUAL "EXEC_AND_LIB" )
add_library(lib1 lib1.c)
set_property(TARGET lib1 PROPERTY ARCHIVE_OUTPUT_DIRECTORY forced-$<CONFIG>)
set_property(TARGET lib1 PROPERTY SUFFIX .LL)
set_property(TARGET lib1 PROPERTY OUTPUT_NAME lib1_$<CONFIG>)
if(RUN_TEST STREQUAL "SINGLE_EXEC_RENAMED")
set(name new_name)
add_executable(exe1 exe.c)
set_property(TARGET exe1 PROPERTY RUNTIME_OUTPUT_DIRECTORY ${name}_bin_$<CONFIG>)
set_property(TARGET exe1 PROPERTY OUTPUT_NAME ${name}_$<CONFIG>)
set_property(TARGET exe1 PROPERTY SUFFIX .bin)
set(targets_to_install ${targets_to_install} exe1)
endif()
if(RUN_TEST STREQUAL "EXEC_AND_LIB")
add_library(lib1 lib1.c)
set_property(TARGET lib1 PROPERTY ARCHIVE_OUTPUT_DIRECTORY forced-$<CONFIG>)
set_property(TARGET lib1 PROPERTY SUFFIX .LL)
set_property(TARGET lib1 PROPERTY OUTPUT_NAME lib1_$<CONFIG>)
add_executable(exe1 exe1.c)
target_link_libraries(exe1 lib1)
set(targets_to_install ${targets_to_install} exe1 lib1)
add_executable(exe1 exe1.c)
target_link_libraries(exe1 lib1)
set(targets_to_install ${targets_to_install} exe1 lib1)
endif()
install(TARGETS ${targets_to_install}
......
......@@ -35,6 +35,9 @@ add_executable(groups
if(TEST_PROP)
set_target_properties(groups PROPERTIES GHS_NO_SOURCE_GROUP_FILE ON)
endif()
if(CMAKE_C_COMPILER_ID MATCHES "GHS")
target_link_options(groups PRIVATE "-non_shared")
endif()
source_group( gC FILES sub/testOBJ.h testOBJ.c testOBJ.h sub/testOBJ.c )
source_group( gA FILES test1.c test1.h)
source_group( gB test[65].c )
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment