Commit d6da8ce6 authored by Bill Hoffman's avatar Bill Hoffman
Browse files

ENH: check for compile flags and add back c flag to unix generator

parent b3cb8ae4
#
# Create exe.
#
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DTEST_CXX_FLAGS")
SET_SOURCE_FILES_PROPERTIES(complex
COMPILE_FLAGS "-DFILE_HAS_EXTRA_COMPILE_FLAGS")
ADD_EXECUTABLE(complex complex)
......
......@@ -132,7 +132,10 @@ int main()
{
cmPassed("Call to file2 function returned 1.");
}
#ifndef TEST_CXX_FLAGS
cmFailed("CMake CMAKE_CXX_FLAGS is not being passed to the compiler!");
#else
cmPassed("CMake CMAKE_CXX_FLAGS is being passed to the compiler.");
// ----------------------------------------------------------------------
// Test ADD_DEFINITIONS
......
......@@ -25,7 +25,7 @@ ADD_LIBRARY(CMakeTestLibrary LibrarySources)
#
SOURCE_FILES(SharedLibrarySources sharedFile)
ADD_LIBRARY(CMakeTestLibraryShared SHARED SharedLibrarySources)
SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -DTEST_C_FLAGS")
ADD_LIBRARY(CMakeTestCLibraryShared SHARED testConly.c)
#
......
......@@ -2,5 +2,11 @@
int CsharedFunction()
{
#ifndef TEST_C_FLAGS
printf("TEST_C_FLAGS failed\n");
return 0;
#else
printf("Passed: TEST_C_FLAGS passed\n");
#endif
return 1;
}
#
# Create exe.
#
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DTEST_CXX_FLAGS")
SET_SOURCE_FILES_PROPERTIES(complex
COMPILE_FLAGS "-DFILE_HAS_EXTRA_COMPILE_FLAGS")
ADD_EXECUTABLE(complex complex)
......
......@@ -132,7 +132,10 @@ int main()
{
cmPassed("Call to file2 function returned 1.");
}
#ifndef TEST_CXX_FLAGS
cmFailed("CMake CMAKE_CXX_FLAGS is not being passed to the compiler!");
#else
cmPassed("CMake CMAKE_CXX_FLAGS is being passed to the compiler.");
// ----------------------------------------------------------------------
// Test ADD_DEFINITIONS
......
......@@ -25,7 +25,7 @@ ADD_LIBRARY(CMakeTestLibrary LibrarySources)
#
SOURCE_FILES(SharedLibrarySources sharedFile)
ADD_LIBRARY(CMakeTestLibraryShared SHARED SharedLibrarySources)
SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -DTEST_C_FLAGS")
ADD_LIBRARY(CMakeTestCLibraryShared SHARED testConly.c)
#
......
......@@ -2,5 +2,11 @@
int CsharedFunction()
{
#ifndef TEST_C_FLAGS
printf("TEST_C_FLAGS failed\n");
return 0;
#else
printf("Passed: TEST_C_FLAGS passed\n");
#endif
return 1;
}
#
# Create exe.
#
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DTEST_CXX_FLAGS")
SET_SOURCE_FILES_PROPERTIES(complex
COMPILE_FLAGS "-DFILE_HAS_EXTRA_COMPILE_FLAGS")
ADD_EXECUTABLE(complex complex)
......
......@@ -132,7 +132,10 @@ int main()
{
cmPassed("Call to file2 function returned 1.");
}
#ifndef TEST_CXX_FLAGS
cmFailed("CMake CMAKE_CXX_FLAGS is not being passed to the compiler!");
#else
cmPassed("CMake CMAKE_CXX_FLAGS is being passed to the compiler.");
// ----------------------------------------------------------------------
// Test ADD_DEFINITIONS
......
......@@ -25,7 +25,7 @@ ADD_LIBRARY(CMakeTestLibrary LibrarySources)
#
SOURCE_FILES(SharedLibrarySources sharedFile)
ADD_LIBRARY(CMakeTestLibraryShared SHARED SharedLibrarySources)
SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -DTEST_C_FLAGS")
ADD_LIBRARY(CMakeTestCLibraryShared SHARED testConly.c)
#
......
......@@ -2,5 +2,11 @@
int CsharedFunction()
{
#ifndef TEST_C_FLAGS
printf("TEST_C_FLAGS failed\n");
return 0;
#else
printf("Passed: TEST_C_FLAGS passed\n");
#endif
return 1;
}
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