CPP: Don't add GCC flags and don't link with pthread on WIN32.
authorphilip.liard@gmail.com <philip.liard@gmail.com@ee073f10-1060-11df-b6a4-87a95322a99c>
Wed, 19 Oct 2011 08:13:17 +0000 (08:13 +0000)
committerphilip.liard@gmail.com <philip.liard@gmail.com@ee073f10-1060-11df-b6a4-87a95322a99c>
Wed, 19 Oct 2011 08:13:17 +0000 (08:13 +0000)
Review URL: http://codereview.appspot.com/5302049

git-svn-id: http://libphonenumber.googlecode.com/svn/trunk@370 ee073f10-1060-11df-b6a4-87a95322a99c

cpp/CMakeLists.txt

index 5f941ee..28c50e5 100644 (file)
@@ -248,7 +248,10 @@ add_metadata_gen_target (
   "test_metadata"
 )
 list (APPEND TESTING_LIBRARY_SOURCES "src/phonenumbers/test_metadata.cc")
-add_definitions ("-Wall -Werror")
+
+if (NOT WIN32)
+  add_definitions ("-Wall -Werror")
+endif ()
 
 include_directories ("src")
 
@@ -322,10 +325,13 @@ endif ()
 # Build the testing binary.
 include_directories ("test")
 add_executable (libphonenumber_test ${TEST_SOURCES})
-target_link_libraries (
-  libphonenumber_test
-  phonenumber_testing ${GTEST_LIB} pthread
-)
+set (TEST_LIBS phonenumber_testing ${GTEST_LIB})
+
+if (NOT WIN32)
+  list (APPEND TEST_LIBS pthread)
+endif ()
+
+target_link_libraries (libphonenumber_test ${TEST_LIBS})
 add_custom_target(test COMMAND libphonenumber_test DEPENDS libphonenumber_test)
 
 # Install rules.