ENH: check for compile flags and add back c flag to unix generator
This commit is contained in:
parent
b3cb8ae4bd
commit
d6da8ce630
@ -1,6 +1,7 @@
|
|||||||
#
|
#
|
||||||
# Create exe.
|
# Create exe.
|
||||||
#
|
#
|
||||||
|
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DTEST_CXX_FLAGS")
|
||||||
SET_SOURCE_FILES_PROPERTIES(complex
|
SET_SOURCE_FILES_PROPERTIES(complex
|
||||||
COMPILE_FLAGS "-DFILE_HAS_EXTRA_COMPILE_FLAGS")
|
COMPILE_FLAGS "-DFILE_HAS_EXTRA_COMPILE_FLAGS")
|
||||||
ADD_EXECUTABLE(complex complex)
|
ADD_EXECUTABLE(complex complex)
|
||||||
|
@ -132,7 +132,10 @@ int main()
|
|||||||
{
|
{
|
||||||
cmPassed("Call to file2 function returned 1.");
|
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
|
// Test ADD_DEFINITIONS
|
||||||
|
|
||||||
|
@ -25,7 +25,7 @@ ADD_LIBRARY(CMakeTestLibrary LibrarySources)
|
|||||||
#
|
#
|
||||||
SOURCE_FILES(SharedLibrarySources sharedFile)
|
SOURCE_FILES(SharedLibrarySources sharedFile)
|
||||||
ADD_LIBRARY(CMakeTestLibraryShared SHARED SharedLibrarySources)
|
ADD_LIBRARY(CMakeTestLibraryShared SHARED SharedLibrarySources)
|
||||||
|
SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -DTEST_C_FLAGS")
|
||||||
ADD_LIBRARY(CMakeTestCLibraryShared SHARED testConly.c)
|
ADD_LIBRARY(CMakeTestCLibraryShared SHARED testConly.c)
|
||||||
|
|
||||||
#
|
#
|
||||||
|
@ -2,5 +2,11 @@
|
|||||||
|
|
||||||
int CsharedFunction()
|
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;
|
return 1;
|
||||||
}
|
}
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
#
|
#
|
||||||
# Create exe.
|
# Create exe.
|
||||||
#
|
#
|
||||||
|
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DTEST_CXX_FLAGS")
|
||||||
SET_SOURCE_FILES_PROPERTIES(complex
|
SET_SOURCE_FILES_PROPERTIES(complex
|
||||||
COMPILE_FLAGS "-DFILE_HAS_EXTRA_COMPILE_FLAGS")
|
COMPILE_FLAGS "-DFILE_HAS_EXTRA_COMPILE_FLAGS")
|
||||||
ADD_EXECUTABLE(complex complex)
|
ADD_EXECUTABLE(complex complex)
|
||||||
|
@ -132,7 +132,10 @@ int main()
|
|||||||
{
|
{
|
||||||
cmPassed("Call to file2 function returned 1.");
|
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
|
// Test ADD_DEFINITIONS
|
||||||
|
|
||||||
|
@ -25,7 +25,7 @@ ADD_LIBRARY(CMakeTestLibrary LibrarySources)
|
|||||||
#
|
#
|
||||||
SOURCE_FILES(SharedLibrarySources sharedFile)
|
SOURCE_FILES(SharedLibrarySources sharedFile)
|
||||||
ADD_LIBRARY(CMakeTestLibraryShared SHARED SharedLibrarySources)
|
ADD_LIBRARY(CMakeTestLibraryShared SHARED SharedLibrarySources)
|
||||||
|
SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -DTEST_C_FLAGS")
|
||||||
ADD_LIBRARY(CMakeTestCLibraryShared SHARED testConly.c)
|
ADD_LIBRARY(CMakeTestCLibraryShared SHARED testConly.c)
|
||||||
|
|
||||||
#
|
#
|
||||||
|
@ -2,5 +2,11 @@
|
|||||||
|
|
||||||
int CsharedFunction()
|
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;
|
return 1;
|
||||||
}
|
}
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
#
|
#
|
||||||
# Create exe.
|
# Create exe.
|
||||||
#
|
#
|
||||||
|
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DTEST_CXX_FLAGS")
|
||||||
SET_SOURCE_FILES_PROPERTIES(complex
|
SET_SOURCE_FILES_PROPERTIES(complex
|
||||||
COMPILE_FLAGS "-DFILE_HAS_EXTRA_COMPILE_FLAGS")
|
COMPILE_FLAGS "-DFILE_HAS_EXTRA_COMPILE_FLAGS")
|
||||||
ADD_EXECUTABLE(complex complex)
|
ADD_EXECUTABLE(complex complex)
|
||||||
|
@ -132,7 +132,10 @@ int main()
|
|||||||
{
|
{
|
||||||
cmPassed("Call to file2 function returned 1.");
|
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
|
// Test ADD_DEFINITIONS
|
||||||
|
|
||||||
|
@ -25,7 +25,7 @@ ADD_LIBRARY(CMakeTestLibrary LibrarySources)
|
|||||||
#
|
#
|
||||||
SOURCE_FILES(SharedLibrarySources sharedFile)
|
SOURCE_FILES(SharedLibrarySources sharedFile)
|
||||||
ADD_LIBRARY(CMakeTestLibraryShared SHARED SharedLibrarySources)
|
ADD_LIBRARY(CMakeTestLibraryShared SHARED SharedLibrarySources)
|
||||||
|
SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -DTEST_C_FLAGS")
|
||||||
ADD_LIBRARY(CMakeTestCLibraryShared SHARED testConly.c)
|
ADD_LIBRARY(CMakeTestCLibraryShared SHARED testConly.c)
|
||||||
|
|
||||||
#
|
#
|
||||||
|
@ -2,5 +2,11 @@
|
|||||||
|
|
||||||
int CsharedFunction()
|
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;
|
return 1;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user