diff options
author | David Cole <david.cole@kitware.com> | 2012-03-08 20:14:03 (GMT) |
---|---|---|
committer | CMake Topic Stage <kwrobot@kitware.com> | 2012-03-08 20:14:03 (GMT) |
commit | f55119e63b4063daf6c8cdce5eb5415d04b0c2bd (patch) | |
tree | 5afda3c63fb305d3c646c7046f1ea2694afd9411 /Tests | |
parent | 9f6c38253a29288a7f8479d43e7c87fd3d958e79 (diff) | |
parent | b28e7fa174798717ebf8e18b8d97755d3568b04d (diff) | |
download | CMake-f55119e63b4063daf6c8cdce5eb5415d04b0c2bd.zip CMake-f55119e63b4063daf6c8cdce5eb5415d04b0c2bd.tar.gz CMake-f55119e63b4063daf6c8cdce5eb5415d04b0c2bd.tar.bz2 |
Merge topic 'fix-12189-support-SBCS-in-VS'
b28e7fa VS6: Avoid SBCS test on VS6 (#12189)
df19b9c VS6: Avoid _MBCS define when _SBCS is defined (#12189)
ba89e92 Visual Studio: Allow setting Single Byte Character Set (#12189)
Diffstat (limited to 'Tests')
-rw-r--r-- | Tests/CMakeLists.txt | 4 | ||||
-rw-r--r-- | Tests/SBCS/CMakeLists.txt | 6 | ||||
-rw-r--r-- | Tests/SBCS/SBCS.cxx | 22 |
3 files changed, 32 insertions, 0 deletions
diff --git a/Tests/CMakeLists.txt b/Tests/CMakeLists.txt index 53c59cc..07a6c36 100644 --- a/Tests/CMakeLists.txt +++ b/Tests/CMakeLists.txt @@ -1338,6 +1338,10 @@ ${CMake_BINARY_DIR}/bin/cmake -DVERSION=master -P ${CMake_SOURCE_DIR}/Utilities/ endif() IF(${CMAKE_TEST_GENERATOR} MATCHES "Visual Studio") + IF(NOT MSVC60) + ADD_TEST_MACRO(SBCS SBCS) + ENDIF(NOT MSVC60) + ADD_TEST(VSExternalInclude ${CMAKE_CTEST_COMMAND} --build-and-test "${CMake_SOURCE_DIR}/Tests/VSExternalInclude" diff --git a/Tests/SBCS/CMakeLists.txt b/Tests/SBCS/CMakeLists.txt new file mode 100644 index 0000000..b3c3c2c --- /dev/null +++ b/Tests/SBCS/CMakeLists.txt @@ -0,0 +1,6 @@ +# a SBCS test case +project (SBCS) + +add_definitions(-D_SBCS) + +add_executable (SBCS SBCS.cxx) diff --git a/Tests/SBCS/SBCS.cxx b/Tests/SBCS/SBCS.cxx new file mode 100644 index 0000000..6ce2c9f --- /dev/null +++ b/Tests/SBCS/SBCS.cxx @@ -0,0 +1,22 @@ +// Test to verify that _SBCS being defined causes CharacterSet to be set to 0 (Single Byte Character Set) + +int main () +{ +#ifdef _UNICODE + bool UnicodeSet=true; +#else + bool UnicodeSet=false; +#endif + +#ifdef _MBCS + bool MBCSSet=true; +#else + bool MBCSSet=false; +#endif + + // if neither _UNICODE nor _MBCS is set, CharacterSet must be set to SBCS. + bool SBCSSet=(!UnicodeSet && !MBCSSet); + + // Reverse boolean to indicate error case correctly + return !SBCSSet; +} |