diff options
author | Brad King <brad.king@kitware.com> | 2012-02-03 15:36:26 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2012-02-03 20:45:13 (GMT) |
commit | 749584509ee3155bb87e56a08ee538e4100a59d8 (patch) | |
tree | 20c0d0665cecaf450310a75d949a5a4e6cfab5b8 /Tests/CxxOnly | |
parent | bb29f2765c0cd752c97862c6eb81975afdcdaed1 (diff) | |
download | CMake-749584509ee3155bb87e56a08ee538e4100a59d8.zip CMake-749584509ee3155bb87e56a08ee538e4100a59d8.tar.gz CMake-749584509ee3155bb87e56a08ee538e4100a59d8.tar.bz2 |
Fix CXX/Fortran MODULE flags when enabled before C (#12929)
If CXX or Fortran is enabled before C then the values of
CMAKE_SHARED_MODULE_C_FLAGS
CMAKE_SHARED_MODULE_CREATE_C_FLAGS
may not be available. On platforms where MODULE library (plugin) creation
is the same as SHARED library creation initialize the MODULE creation
flags from the SHARED creation flags of the matching language instead of
assuming that C has been enabled first.
Teach the COnly and CxxOnly tests to build MODULE libraries. The latter
covers this specific case.
Diffstat (limited to 'Tests/CxxOnly')
-rw-r--r-- | Tests/CxxOnly/CMakeLists.txt | 2 | ||||
-rw-r--r-- | Tests/CxxOnly/testCxxModule.cxx | 6 |
2 files changed, 8 insertions, 0 deletions
diff --git a/Tests/CxxOnly/CMakeLists.txt b/Tests/CxxOnly/CMakeLists.txt index 5d27890..e62f3c7 100644 --- a/Tests/CxxOnly/CMakeLists.txt +++ b/Tests/CxxOnly/CMakeLists.txt @@ -9,3 +9,5 @@ add_library(testcxx1.my STATIC libcxx1.cxx ${EXTRA_SRCS}) add_library(testcxx2 SHARED libcxx2.cxx) add_executable (CxxOnly cxxonly.cxx) target_link_libraries(CxxOnly testcxx1.my testcxx2) + +add_library(testCxxModule MODULE testCxxModule.cxx) diff --git a/Tests/CxxOnly/testCxxModule.cxx b/Tests/CxxOnly/testCxxModule.cxx new file mode 100644 index 0000000..dd16d2b --- /dev/null +++ b/Tests/CxxOnly/testCxxModule.cxx @@ -0,0 +1,6 @@ +#ifdef _WIN32 +# define TEST_EXPORT __declspec(dllexport) +#else +# define TEST_EXPORT +#endif +TEST_EXPORT int testCxxModule(void) { return 0; } |