Files
CMake/Tests/RunCMake/FileAPI/object/CMakeLists.txt
AJIOB 6874efb592 MSVC: Always define a character set
When targeting the MSVC ABI, define `_MBCS` by default if the project
does not define `_SBCS` or `_UNICODE`.  Visual Studio has long defined
one of the three character set macros automatically.  For consistency,
define it when compiling for the MSVC ABI with other generators.
Add policy CMP0204 for compatibility.

Fixes: #27275
2025-10-07 09:29:32 -04:00

17 lines
493 B
CMake

cmake_minimum_required(VERSION 3.13)
project(Object)
enable_language(CXX)
cmake_policy(SET CMP0203 NEW)
cmake_policy(SET CMP0204 NEW)
add_library(c_object_lib OBJECT ../empty.c)
add_executable(c_object_exe ../empty.c)
target_link_libraries(c_object_exe PRIVATE c_object_lib)
add_library(cxx_object_lib OBJECT ../empty.cxx)
add_executable(cxx_object_exe ../empty.cxx)
target_link_libraries(cxx_object_exe PRIVATE cxx_object_lib)
install(TARGETS c_object_exe cxx_object_exe DESTINATION bin)